@geneui/components 2.11.1

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 (154) hide show
  1. package/ActionableList.js +1761 -0
  2. package/AdvancedSearch.js +872 -0
  3. package/Alert.js +98 -0
  4. package/Avatar.js +77 -0
  5. package/Badge.js +76 -0
  6. package/Breadcrumb.js +128 -0
  7. package/BusyLoader.js +69 -0
  8. package/Button.js +130 -0
  9. package/CHANGELOG.md +424 -0
  10. package/Card.js +513 -0
  11. package/CardList.js +705 -0
  12. package/CellMeasurerCache-c11cec83.js +229 -0
  13. package/Charts.js +99 -0
  14. package/Checkbox.js +232 -0
  15. package/CheckboxGroup.js +206 -0
  16. package/CheckboxGroupWithSearch.js +279 -0
  17. package/Collapse.js +196 -0
  18. package/ColorPicker.js +210 -0
  19. package/ComboBox.js +99 -0
  20. package/Counter.js +99 -0
  21. package/DateFilter.js +179 -0
  22. package/DatePicker.js +1231 -0
  23. package/DatePickerInput.js +30 -0
  24. package/Divider.js +56 -0
  25. package/Drawer.js +264 -0
  26. package/Dropdown.js +99 -0
  27. package/Editor.js +22965 -0
  28. package/Empty.js +132 -0
  29. package/ExtendedInput.js +578 -0
  30. package/Form.js +116 -0
  31. package/FormContainer.js +189 -0
  32. package/FormableCheckbox.js +27 -0
  33. package/FormableDatePicker.js +39 -0
  34. package/FormableDropdown.js +105 -0
  35. package/FormableEditor.js +24 -0
  36. package/FormableHOC-21051057.js +83 -0
  37. package/FormableMultiSelectDropdown.js +105 -0
  38. package/FormableNumberInput.js +31 -0
  39. package/FormableRadio.js +23 -0
  40. package/FormableSwitcher.js +23 -0
  41. package/FormableTextInput.js +31 -0
  42. package/FormableUploader.js +40 -0
  43. package/GeneUIProvider.js +256 -0
  44. package/Grid.js +166 -0
  45. package/Holder.js +99 -0
  46. package/Icon.js +63 -0
  47. package/Image.js +130 -0
  48. package/ImagePreview.js +99 -0
  49. package/KeyValue.js +63 -0
  50. package/Label.js +58 -0
  51. package/LinkButton.js +104 -0
  52. package/Menu.js +277 -0
  53. package/MobileNavigation.js +95 -0
  54. package/MobilePopup.js +180 -0
  55. package/Modal.js +251 -0
  56. package/ModuleTitle.js +99 -0
  57. package/NavigationMenu.js +212 -0
  58. package/Notification.js +120 -0
  59. package/Option.js +186 -0
  60. package/Overlay.js +99 -0
  61. package/Overspread.js +343 -0
  62. package/Pagination.js +258 -0
  63. package/Paper.js +97 -0
  64. package/Popover-f4d1cac0.js +411 -0
  65. package/Popover.js +20 -0
  66. package/PopoverV2.js +19 -0
  67. package/Portal.js +58 -0
  68. package/Products.js +115 -0
  69. package/Profile.js +99 -0
  70. package/Progress.js +200 -0
  71. package/QRCode.js +816 -0
  72. package/README.md +90 -0
  73. package/Radio.js +152 -0
  74. package/RadioGroup.js +105 -0
  75. package/Range.js +14 -0
  76. package/RichEditor-b7928765.js +228 -0
  77. package/RichEditor.js +13 -0
  78. package/Scrollbar.js +1587 -0
  79. package/Search.js +72 -0
  80. package/SearchWithDropdown.js +195 -0
  81. package/Section.js +62 -0
  82. package/SkeletonLoader.js +82 -0
  83. package/Slider.js +256 -0
  84. package/Status.js +104 -0
  85. package/Steps.js +312 -0
  86. package/SuggestionList.js +15 -0
  87. package/Switcher.js +194 -0
  88. package/Table.js +102 -0
  89. package/TableCompositions.js +17028 -0
  90. package/Tabs.js +236 -0
  91. package/Tag.js +103 -0
  92. package/TextLink.js +22 -0
  93. package/Textarea.js +239 -0
  94. package/Time.js +63 -0
  95. package/TimePicker.js +99 -0
  96. package/Timeline.js +114 -0
  97. package/Title.js +66 -0
  98. package/Toaster.js +116 -0
  99. package/Tooltip.js +157 -0
  100. package/TransferList.js +502 -0
  101. package/Uploader.js +32 -0
  102. package/ValidatableCheckbox.js +126 -0
  103. package/ValidatableDatePicker.js +312 -0
  104. package/ValidatableDropdown.js +99 -0
  105. package/ValidatableElements.js +99 -0
  106. package/ValidatableMultiSelectDropdown.js +99 -0
  107. package/ValidatableNumberInput.js +194 -0
  108. package/ValidatableRadio.js +117 -0
  109. package/ValidatableSwitcher.js +94 -0
  110. package/ValidatableTextInput.js +164 -0
  111. package/ValidatableTimeInput.js +171 -0
  112. package/ValidatableUploader.js +94 -0
  113. package/Widget.js +99 -0
  114. package/_commonjsHelpers-24198af3.js +35 -0
  115. package/_rollupPluginBabelHelpers-e8fb2e5c.js +16 -0
  116. package/checkTimeValidation-e56771be.js +16 -0
  117. package/checkboxRadioSwitcher-5b69d7bd.js +4 -0
  118. package/clsx.m-2bb6df4b.js +3 -0
  119. package/configs-91c86664.js +96 -0
  120. package/configs.js +131 -0
  121. package/dateValidation-67caec66.js +225 -0
  122. package/debounce-4419bc2f.js +17 -0
  123. package/globalStyling-9c60a159.js +4 -0
  124. package/guid-8ddf77b3.js +16 -0
  125. package/index-00fe8887.js +193 -0
  126. package/index-0cf65939.js +30991 -0
  127. package/index-122432cd.js +270 -0
  128. package/index-262edd7a.js +77 -0
  129. package/index-5cea9a7d.js +407 -0
  130. package/index-5e722d91.js +867 -0
  131. package/index-67f4d4d1.js +6568 -0
  132. package/index-6ff23041.js +66 -0
  133. package/index-702bf24a.js +1938 -0
  134. package/index-a4635754.js +329 -0
  135. package/index-a59530cd.js +4 -0
  136. package/index-ac59cb10.js +169 -0
  137. package/index-b7a33c58.js +11 -0
  138. package/index-d9e8a888.js +987 -0
  139. package/index-e0af0caf.js +1182 -0
  140. package/index-e8776f3d.js +807 -0
  141. package/index.js +128 -0
  142. package/localization-4ba17032.js +46 -0
  143. package/objectWithoutPropertiesLoose-299691d8.js +78 -0
  144. package/package.json +190 -0
  145. package/rangeAndSlider-20599da4.js +8839 -0
  146. package/react-beautiful-dnd.esm-38c37304.js +10117 -0
  147. package/style-inject.es-746bb8ed.js +28 -0
  148. package/useClickOutside-5183e396.js +25 -0
  149. package/useDeviceType-dd51db38.js +15 -0
  150. package/useEllipsisDetection-ef536015.js +23 -0
  151. package/useKeyDown-38102ae7.js +21 -0
  152. package/useMount-6fef51a5.js +9 -0
  153. package/useWidth-9f4647f8.js +15 -0
  154. package/useWindowSize-80369d76.js +33 -0
@@ -0,0 +1,229 @@
1
+ import { _ as _createClass, n as _classCallCheck } from './index-0cf65939.js';
2
+ import { _ as _defineProperty } from './objectWithoutPropertiesLoose-299691d8.js';
3
+
4
+ var DEFAULT_HEIGHT = 30;
5
+ var DEFAULT_WIDTH = 100; // Enables more intelligent mapping of a given column and row index to an item ID.
6
+ // This prevents a cell cache from being invalidated when its parent collection is modified.
7
+
8
+ /**
9
+ * Caches measurements for a given cell.
10
+ */
11
+ var CellMeasurerCache =
12
+ /*#__PURE__*/
13
+ function () {
14
+ function CellMeasurerCache() {
15
+ var _this = this;
16
+
17
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18
+
19
+ _classCallCheck(this, CellMeasurerCache);
20
+
21
+ _defineProperty(this, "_cellHeightCache", {});
22
+
23
+ _defineProperty(this, "_cellWidthCache", {});
24
+
25
+ _defineProperty(this, "_columnWidthCache", {});
26
+
27
+ _defineProperty(this, "_rowHeightCache", {});
28
+
29
+ _defineProperty(this, "_defaultHeight", void 0);
30
+
31
+ _defineProperty(this, "_defaultWidth", void 0);
32
+
33
+ _defineProperty(this, "_minHeight", void 0);
34
+
35
+ _defineProperty(this, "_minWidth", void 0);
36
+
37
+ _defineProperty(this, "_keyMapper", void 0);
38
+
39
+ _defineProperty(this, "_hasFixedHeight", void 0);
40
+
41
+ _defineProperty(this, "_hasFixedWidth", void 0);
42
+
43
+ _defineProperty(this, "_columnCount", 0);
44
+
45
+ _defineProperty(this, "_rowCount", 0);
46
+
47
+ _defineProperty(this, "columnWidth", function (_ref) {
48
+ var index = _ref.index;
49
+
50
+ var key = _this._keyMapper(0, index);
51
+
52
+ return _this._columnWidthCache[key] !== undefined ? _this._columnWidthCache[key] : _this._defaultWidth;
53
+ });
54
+
55
+ _defineProperty(this, "rowHeight", function (_ref2) {
56
+ var index = _ref2.index;
57
+
58
+ var key = _this._keyMapper(index, 0);
59
+
60
+ return _this._rowHeightCache[key] !== undefined ? _this._rowHeightCache[key] : _this._defaultHeight;
61
+ });
62
+
63
+ var defaultHeight = params.defaultHeight,
64
+ defaultWidth = params.defaultWidth,
65
+ fixedHeight = params.fixedHeight,
66
+ fixedWidth = params.fixedWidth,
67
+ keyMapper = params.keyMapper,
68
+ minHeight = params.minHeight,
69
+ minWidth = params.minWidth;
70
+ this._hasFixedHeight = fixedHeight === true;
71
+ this._hasFixedWidth = fixedWidth === true;
72
+ this._minHeight = minHeight || 0;
73
+ this._minWidth = minWidth || 0;
74
+ this._keyMapper = keyMapper || defaultKeyMapper;
75
+ this._defaultHeight = Math.max(this._minHeight, typeof defaultHeight === 'number' ? defaultHeight : DEFAULT_HEIGHT);
76
+ this._defaultWidth = Math.max(this._minWidth, typeof defaultWidth === 'number' ? defaultWidth : DEFAULT_WIDTH);
77
+
78
+ if (process.env.NODE_ENV !== 'production') {
79
+ if (this._hasFixedHeight === false && this._hasFixedWidth === false) {
80
+ console.warn("CellMeasurerCache should only measure a cell's width or height. " + 'You have configured CellMeasurerCache to measure both. ' + 'This will result in poor performance.');
81
+ }
82
+
83
+ if (this._hasFixedHeight === false && this._defaultHeight === 0) {
84
+ console.warn('Fixed height CellMeasurerCache should specify a :defaultHeight greater than 0. ' + 'Failing to do so will lead to unnecessary layout and poor performance.');
85
+ }
86
+
87
+ if (this._hasFixedWidth === false && this._defaultWidth === 0) {
88
+ console.warn('Fixed width CellMeasurerCache should specify a :defaultWidth greater than 0. ' + 'Failing to do so will lead to unnecessary layout and poor performance.');
89
+ }
90
+ }
91
+ }
92
+
93
+ _createClass(CellMeasurerCache, [{
94
+ key: "clear",
95
+ value: function clear(rowIndex) {
96
+ var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
97
+
98
+ var key = this._keyMapper(rowIndex, columnIndex);
99
+
100
+ delete this._cellHeightCache[key];
101
+ delete this._cellWidthCache[key];
102
+
103
+ this._updateCachedColumnAndRowSizes(rowIndex, columnIndex);
104
+ }
105
+ }, {
106
+ key: "clearAll",
107
+ value: function clearAll() {
108
+ this._cellHeightCache = {};
109
+ this._cellWidthCache = {};
110
+ this._columnWidthCache = {};
111
+ this._rowHeightCache = {};
112
+ this._rowCount = 0;
113
+ this._columnCount = 0;
114
+ }
115
+ }, {
116
+ key: "hasFixedHeight",
117
+ value: function hasFixedHeight() {
118
+ return this._hasFixedHeight;
119
+ }
120
+ }, {
121
+ key: "hasFixedWidth",
122
+ value: function hasFixedWidth() {
123
+ return this._hasFixedWidth;
124
+ }
125
+ }, {
126
+ key: "getHeight",
127
+ value: function getHeight(rowIndex) {
128
+ var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
129
+
130
+ if (this._hasFixedHeight) {
131
+ return this._defaultHeight;
132
+ } else {
133
+ var _key = this._keyMapper(rowIndex, columnIndex);
134
+
135
+ return this._cellHeightCache[_key] !== undefined ? Math.max(this._minHeight, this._cellHeightCache[_key]) : this._defaultHeight;
136
+ }
137
+ }
138
+ }, {
139
+ key: "getWidth",
140
+ value: function getWidth(rowIndex) {
141
+ var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
142
+
143
+ if (this._hasFixedWidth) {
144
+ return this._defaultWidth;
145
+ } else {
146
+ var _key2 = this._keyMapper(rowIndex, columnIndex);
147
+
148
+ return this._cellWidthCache[_key2] !== undefined ? Math.max(this._minWidth, this._cellWidthCache[_key2]) : this._defaultWidth;
149
+ }
150
+ }
151
+ }, {
152
+ key: "has",
153
+ value: function has(rowIndex) {
154
+ var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
155
+
156
+ var key = this._keyMapper(rowIndex, columnIndex);
157
+
158
+ return this._cellHeightCache[key] !== undefined;
159
+ }
160
+ }, {
161
+ key: "set",
162
+ value: function set(rowIndex, columnIndex, width, height) {
163
+ var key = this._keyMapper(rowIndex, columnIndex);
164
+
165
+ if (columnIndex >= this._columnCount) {
166
+ this._columnCount = columnIndex + 1;
167
+ }
168
+
169
+ if (rowIndex >= this._rowCount) {
170
+ this._rowCount = rowIndex + 1;
171
+ } // Size is cached per cell so we don't have to re-measure if cells are re-ordered.
172
+
173
+
174
+ this._cellHeightCache[key] = height;
175
+ this._cellWidthCache[key] = width;
176
+
177
+ this._updateCachedColumnAndRowSizes(rowIndex, columnIndex);
178
+ }
179
+ }, {
180
+ key: "_updateCachedColumnAndRowSizes",
181
+ value: function _updateCachedColumnAndRowSizes(rowIndex, columnIndex) {
182
+ // :columnWidth and :rowHeight are derived based on all cells in a column/row.
183
+ // Pre-cache these derived values for faster lookup later.
184
+ // Reads are expected to occur more frequently than writes in this case.
185
+ // Only update non-fixed dimensions though to avoid doing unnecessary work.
186
+ if (!this._hasFixedWidth) {
187
+ var columnWidth = 0;
188
+
189
+ for (var i = 0; i < this._rowCount; i++) {
190
+ columnWidth = Math.max(columnWidth, this.getWidth(i, columnIndex));
191
+ }
192
+
193
+ var columnKey = this._keyMapper(0, columnIndex);
194
+
195
+ this._columnWidthCache[columnKey] = columnWidth;
196
+ }
197
+
198
+ if (!this._hasFixedHeight) {
199
+ var rowHeight = 0;
200
+
201
+ for (var _i = 0; _i < this._columnCount; _i++) {
202
+ rowHeight = Math.max(rowHeight, this.getHeight(rowIndex, _i));
203
+ }
204
+
205
+ var rowKey = this._keyMapper(rowIndex, 0);
206
+
207
+ this._rowHeightCache[rowKey] = rowHeight;
208
+ }
209
+ }
210
+ }, {
211
+ key: "defaultHeight",
212
+ get: function get() {
213
+ return this._defaultHeight;
214
+ }
215
+ }, {
216
+ key: "defaultWidth",
217
+ get: function get() {
218
+ return this._defaultWidth;
219
+ }
220
+ }]);
221
+
222
+ return CellMeasurerCache;
223
+ }();
224
+
225
+ function defaultKeyMapper(rowIndex, columnIndex) {
226
+ return "".concat(rowIndex, "-").concat(columnIndex);
227
+ }
228
+
229
+ export { CellMeasurerCache as C };
package/Charts.js ADDED
@@ -0,0 +1,99 @@
1
+ import './globalStyling-9c60a159.js';
2
+ export { A as AreaChart, B as BarChart, e as ColumnChart, l as ColumnRangeChart, f as DalColumnChart, i as DonutChart, F as FunnelChart, k as HeatMapChart, L as LineChart, c as MapChart, h as PieChart, j as ScatterChart, S as StackedBarChart, g as StackedColumnChart, d as TreeMapChart } from './index-0cf65939.js';
3
+ import './style-inject.es-746bb8ed.js';
4
+ import './Editor.js';
5
+ import './_rollupPluginBabelHelpers-e8fb2e5c.js';
6
+ import 'react';
7
+ import './index-e0af0caf.js';
8
+ import './_commonjsHelpers-24198af3.js';
9
+ import 'react-dom';
10
+ import './index-6ff23041.js';
11
+ import './index-ac59cb10.js';
12
+ import './dateValidation-67caec66.js';
13
+ import './useMount-6fef51a5.js';
14
+ import './useDeviceType-dd51db38.js';
15
+ import './configs-91c86664.js';
16
+ import './useWindowSize-80369d76.js';
17
+ import './Button.js';
18
+ import './Icon.js';
19
+ import './ValidatableUploader.js';
20
+ import './index-d9e8a888.js';
21
+ import './Grid.js';
22
+ import './useWidth-9f4647f8.js';
23
+ import './useKeyDown-38102ae7.js';
24
+ import './BusyLoader.js';
25
+ import './Image.js';
26
+ import './Empty.js';
27
+ import './Tooltip.js';
28
+ import './Popover-f4d1cac0.js';
29
+ import './GeneUIProvider.js';
30
+ import './Checkbox.js';
31
+ import './checkboxRadioSwitcher-5b69d7bd.js';
32
+ import './guid-8ddf77b3.js';
33
+ import './ExtendedInput.js';
34
+ import './index-5cea9a7d.js';
35
+ import './useClickOutside-5183e396.js';
36
+ import './Scrollbar.js';
37
+ import './ValidatableRadio.js';
38
+ import './RadioGroup.js';
39
+ import './Radio.js';
40
+ import './ValidatableCheckbox.js';
41
+ import './ValidatableSwitcher.js';
42
+ import './Switcher.js';
43
+ import './ValidatableNumberInput.js';
44
+ import './ValidatableTextInput.js';
45
+ import './ValidatableDatePicker.js';
46
+ import './index-5e722d91.js';
47
+ import './index-702bf24a.js';
48
+ import './index-122432cd.js';
49
+ import './debounce-4419bc2f.js';
50
+ import './DatePicker.js';
51
+ import './localization-4ba17032.js';
52
+ import './checkTimeValidation-e56771be.js';
53
+ import './useEllipsisDetection-ef536015.js';
54
+ import './Tabs.js';
55
+ import './Steps.js';
56
+ import './index-a4635754.js';
57
+ import './Portal.js';
58
+ import './Timeline.js';
59
+ import './Card.js';
60
+ import './MobilePopup.js';
61
+ import './Menu.js';
62
+ import './Option.js';
63
+ import './SkeletonLoader.js';
64
+ import './KeyValue.js';
65
+ import './configs.js';
66
+ import './Tag.js';
67
+ import './Alert.js';
68
+ import './index-00fe8887.js';
69
+ import './rangeAndSlider-20599da4.js';
70
+ import './Slider.js';
71
+ import './Pagination.js';
72
+ import './Divider.js';
73
+ import './objectWithoutPropertiesLoose-299691d8.js';
74
+ import './clsx.m-2bb6df4b.js';
75
+ import './index-a59530cd.js';
76
+ import './Notification.js';
77
+ import './Modal.js';
78
+ import './Collapse.js';
79
+ import './Status.js';
80
+ import './Avatar.js';
81
+ import './Search.js';
82
+ import './TextLink.js';
83
+ import './Label.js';
84
+ import './Paper.js';
85
+ import './Badge.js';
86
+ import './Time.js';
87
+ import './Title.js';
88
+ import './index-b7a33c58.js';
89
+ import './QRCode.js';
90
+ import './Progress.js';
91
+ import './MobileNavigation.js';
92
+ import './Products.js';
93
+ import './Breadcrumb.js';
94
+ import './Section.js';
95
+ import './ColorPicker.js';
96
+ import './NavigationMenu.js';
97
+ import './Textarea.js';
98
+ import './AdvancedSearch.js';
99
+ import './LinkButton.js';
package/Checkbox.js ADDED
@@ -0,0 +1,232 @@
1
+ import { _ as _extends } from './_rollupPluginBabelHelpers-e8fb2e5c.js';
2
+ import React__default, { forwardRef, useState, useMemo } from 'react';
3
+ import { p as propTypesExports } from './index-e0af0caf.js';
4
+ import { c as classnames } from './index-6ff23041.js';
5
+ import { c as checkboxRadioSwitcherConfig } from './configs-91c86664.js';
6
+ import { n as noop, i as interceptValue, s as stopEvent } from './index-ac59cb10.js';
7
+ import Tooltip from './Tooltip.js';
8
+ import './globalStyling-9c60a159.js';
9
+ import './checkboxRadioSwitcher-5b69d7bd.js';
10
+ import { g as guid } from './guid-8ddf77b3.js';
11
+ import './dateValidation-67caec66.js';
12
+ import './_commonjsHelpers-24198af3.js';
13
+ import 'react-dom';
14
+ import './Popover-f4d1cac0.js';
15
+ import './useDeviceType-dd51db38.js';
16
+ import './useWindowSize-80369d76.js';
17
+ import './GeneUIProvider.js';
18
+ import './style-inject.es-746bb8ed.js';
19
+
20
+ const Checkbox = /*#__PURE__*/forwardRef((props, ref) => {
21
+ const {
22
+ size,
23
+ label,
24
+ labelPosition,
25
+ labelTooltip,
26
+ labelAlignment,
27
+ description,
28
+ indeterminate,
29
+ readOnly,
30
+ disabled,
31
+ required,
32
+ isValid,
33
+ errorText,
34
+ defaultChecked,
35
+ onChange,
36
+ value,
37
+ className,
38
+ onKeyPress,
39
+ checked,
40
+ onWrapperClick,
41
+ onMouseEnter,
42
+ onMouseLeave,
43
+ ...restProps
44
+ } = props;
45
+ const [checkedState, setCheckedState] = useState(defaultChecked);
46
+ const isControlled = 'checked' in props && typeof checked !== 'undefined';
47
+ const localChecked = isControlled ? checked : checkedState;
48
+ const randomId = useMemo(guid, []);
49
+ const handleChange = e => {
50
+ const {
51
+ checked
52
+ } = e.target;
53
+ !isControlled && setCheckedState(checked);
54
+ onChange(interceptValue(e, value));
55
+ };
56
+ const handleKeyPress = e => {
57
+ if (e.which === 13 || e.keyCode === 13) {
58
+ // need this for prevent form default submit
59
+ stopEvent(e);
60
+ const {
61
+ checked
62
+ } = e.target;
63
+
64
+ // need this because in event time checkbox value is old.
65
+ const changedEvent = {
66
+ ...e
67
+ };
68
+ changedEvent.target.checked = !checked;
69
+ !isControlled && setCheckedState(checked => !checked);
70
+ onChange(interceptValue(changedEvent, value));
71
+ }
72
+ onKeyPress(e);
73
+ };
74
+ const hasError = !isValid;
75
+ return /*#__PURE__*/React__default.createElement("div", {
76
+ onMouseEnter: onMouseEnter,
77
+ onMouseLeave: onMouseLeave,
78
+ className: classnames('crs-holder', className, "lp-".concat(labelPosition), "la-".concat(labelAlignment), {
79
+ disabled,
80
+ error: hasError,
81
+ 'read-only': readOnly
82
+ }),
83
+ onClick: onWrapperClick
84
+ }, /*#__PURE__*/React__default.createElement("div", {
85
+ className: classnames('label-holder', {
86
+ 'has-label': !!label
87
+ })
88
+ }, label && /*#__PURE__*/React__default.createElement(Tooltip, {
89
+ position: "auto",
90
+ title: label,
91
+ isVisible: labelTooltip
92
+ }, /*#__PURE__*/React__default.createElement("div", {
93
+ className: "crs-item crs-label"
94
+ }, /*#__PURE__*/React__default.createElement("label", {
95
+ className: "ellipsis-text",
96
+ title: labelTooltip,
97
+ htmlFor: randomId
98
+ }, required && "* ", label))), /*#__PURE__*/React__default.createElement("div", {
99
+ className: "crs-item crs-component"
100
+ }, /*#__PURE__*/React__default.createElement("input", _extends({
101
+ type: "checkbox",
102
+ onKeyPress: handleKeyPress,
103
+ onChange: handleChange,
104
+ checked: localChecked,
105
+ disabled: disabled,
106
+ value: value,
107
+ ref: ref,
108
+ id: randomId
109
+ }, restProps)), /*#__PURE__*/React__default.createElement("label", {
110
+ className: classnames('checkbox', 'cr-element', "s-".concat(size), {
111
+ indeterminate,
112
+ active: !indeterminate && localChecked,
113
+ 'error-color': !indeterminate && !localChecked && !errorText && hasError
114
+ }),
115
+ htmlFor: randomId
116
+ }))), hasError && errorText && /*#__PURE__*/React__default.createElement("div", {
117
+ className: "information-message color-danger"
118
+ }, errorText), description && /*#__PURE__*/React__default.createElement("div", {
119
+ className: "input-description"
120
+ }, description));
121
+ });
122
+ Checkbox.propTypes = {
123
+ /**
124
+ * At what point an element becomes focusable when a user is interacting with the page via a keyboard
125
+ */
126
+ tabIndex: propTypesExports.number,
127
+ /**
128
+ * Use this prop to control Checkbox state. Note that when you specify this prop, the Checkbox will not functionate itself
129
+ */
130
+ checked: propTypesExports.bool,
131
+ /**
132
+ * Checkbox size
133
+ */
134
+ size: propTypesExports.oneOf(checkboxRadioSwitcherConfig.size),
135
+ /**
136
+ * Use this prop to add an additional label to Checkbox
137
+ */
138
+ label: propTypesExports.node,
139
+ /**
140
+ * Tooltip for label
141
+ */
142
+ labelTooltip: propTypesExports.string,
143
+ /**
144
+ * Specify "label" position
145
+ */
146
+ labelPosition: propTypesExports.oneOf(checkboxRadioSwitcherConfig.labelPosition),
147
+ /**
148
+ * Specify "label" alignment
149
+ */
150
+ labelAlignment: propTypesExports.oneOf(checkboxRadioSwitcherConfig.labelAlignment),
151
+ /**
152
+ * Use this prop to add an additional description field to the Checkbox
153
+ */
154
+ description: propTypesExports.node,
155
+ /**
156
+ * Use this prop to make checkbox neither checked nor unchecked
157
+ */
158
+ indeterminate: propTypesExports.bool,
159
+ /**
160
+ * Makes Checkbox readonly when set to "true"
161
+ */
162
+ readOnly: propTypesExports.bool,
163
+ /**
164
+ * Makes Checkbox disabled when set to "true"
165
+ */
166
+ disabled: propTypesExports.bool,
167
+ /**
168
+ * Checkbox adds an extra asterisk to the "label". For more info see "ValidatableCheckbox"(integrated Checkbox with "Form" organism).
169
+ */
170
+ required: propTypesExports.bool,
171
+ /**
172
+ * Control Checkbox validation. For more info see "ValidatableCheckbox"(integrated Checkbox with "Form" organism).
173
+ */
174
+ isValid: propTypesExports.bool,
175
+ /**
176
+ * Use this prop to specify error message. This will be displayed when "isValid" is set to "false"
177
+ */
178
+ errorText: propTypesExports.node,
179
+ /**
180
+ * This prop will only applied once as defaultState for "checked" when Checkbox mounts.
181
+ * Note that specifying this prop does not mean to control it.
182
+ */
183
+ defaultChecked: propTypesExports.bool,
184
+ /**
185
+ * Fires an event when Checkbox is clicked or "enter" key is pressed((event: Event) => void).
186
+ */
187
+ onChange: propTypesExports.func,
188
+ /**
189
+ * Fires an event when any key is pressed((event: Event) => void).
190
+ */
191
+ onKeyPress: propTypesExports.func,
192
+ /**
193
+ * Fires an event when mouse enter((event: Event) => void).
194
+ */
195
+ onMouseEnter: propTypesExports.func,
196
+ /**
197
+ * Fires an event when mouse leave((event: Event) => void).
198
+ */
199
+ onMouseLeave: propTypesExports.func,
200
+ /**
201
+ * Fires an event when clicking on parent/wrapper of input ((event: Event) => void).
202
+ */
203
+ onWrapperClick: propTypesExports.func,
204
+ /**
205
+ * Use this prop to get specified value when "onChange" is fired
206
+ */
207
+ value: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.bool, propTypesExports.number]),
208
+ /**
209
+ * Additional className
210
+ */
211
+ className: propTypesExports.string
212
+ };
213
+ Checkbox.defaultProps = {
214
+ tabIndex: 0,
215
+ size: checkboxRadioSwitcherConfig.size[0],
216
+ label: '',
217
+ labelPosition: checkboxRadioSwitcherConfig.labelPosition[0],
218
+ labelAlignment: checkboxRadioSwitcherConfig.labelAlignment[0],
219
+ description: '',
220
+ indeterminate: false,
221
+ readOnly: false,
222
+ disabled: false,
223
+ required: false,
224
+ isValid: true,
225
+ errorText: '',
226
+ defaultChecked: false,
227
+ onKeyPress: noop,
228
+ onChange: noop,
229
+ onWrapperClick: noop
230
+ };
231
+
232
+ export { Checkbox as default };