@hi-ui/hiui 2.15.11 → 2.15.12
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/es/_util/SwitchVersion.js +40 -0
- package/es/_util/depreactedPropsCompat.js +58 -0
- package/es/_util/index.js +31 -0
- package/es/_util/warning.js +2 -2
- package/es/alert/Alert.js +126 -0
- package/es/alert/__tests__/index.test.js +84 -0
- package/es/alert/index.js +6 -147
- package/es/alert/style/index.css +1 -1
- package/es/badge/Badge.js +82 -0
- package/es/badge/__tests__/index.test.js +82 -0
- package/es/badge/index.js +9 -87
- package/es/badge/style/index.css +1 -1
- package/es/badge/style/index.js +0 -0
- package/es/breadcrumb/__tests__/index.test.js +61 -0
- package/es/breadcrumb/index.js +85 -0
- package/es/breadcrumb/style/index.css +1 -0
- package/es/button/Button.js +62 -60
- package/es/button/ButtonGroup.js +24 -40
- package/es/button/IconLoading.js +6 -6
- package/es/button/__tests__/index.test.js +221 -0
- package/es/button/index.js +3 -2
- package/es/button/style/index.css +1 -1
- package/es/card/__tests__/index.test.js +179 -0
- package/es/card/index.js +61 -57
- package/es/card/style/index.css +1 -1
- package/es/carousel/__tests__/index.test.js +104 -0
- package/es/carousel/index.js +219 -0
- package/es/carousel/style/index.css +1 -0
- package/es/carousel/style/index.js +3 -0
- package/es/cascader/Cascader.js +190 -133
- package/es/cascader/Menu.js +168 -0
- package/es/cascader/__tests__/index.test.js +392 -0
- package/es/cascader/index.js +5 -2
- package/es/cascader/style/cascader.css +1 -1
- package/es/cascader/style/menu.css +1 -1
- package/es/checkbox/Checkbox.js +136 -0
- package/es/checkbox/Group.js +194 -0
- package/es/checkbox/__tests__/index.test.js +226 -0
- package/es/checkbox/checkbox-legacy/Base.js +212 -0
- package/es/checkbox/checkbox-legacy/CheckBox.js +157 -0
- package/es/checkbox/checkbox-legacy/index.js +15 -0
- package/es/checkbox/checkbox-legacy/style/index.css +1 -0
- package/es/checkbox/checkbox-legacy/style/index.js +3 -0
- package/es/checkbox/index.js +13 -4
- package/es/checkbox/style/index.css +1 -1
- package/es/collapse/__tests__/index.test.js +111 -0
- package/es/collapse/index.js +88 -110
- package/es/collapse/style/index.css +1 -1
- package/es/confirm/index.js +39 -60
- package/es/context/index.js +45 -51
- package/es/counter/Counter.js +339 -0
- package/es/counter/__tests__/index.test.js +134 -0
- package/es/counter/counter-legacy/index.js +267 -0
- package/es/counter/index.js +6 -270
- package/es/counter/style/index.css +1 -1
- package/es/date-picker/BasePicker.js +380 -302
- package/es/date-picker/Calender.js +326 -98
- package/es/date-picker/DatePanel.js +194 -213
- package/es/date-picker/DatePicker.js +143 -47
- package/es/date-picker/DateRangePanel.js +272 -208
- package/es/date-picker/Modal.js +18 -32
- package/es/date-picker/Time.js +231 -345
- package/es/date-picker/TimeList.js +246 -0
- package/es/date-picker/TimePanel.js +28 -41
- package/es/date-picker/TimePeriodPanel.js +27 -46
- package/es/date-picker/TimePicker.js +44 -46
- package/es/date-picker/TimeRangePanel.js +33 -51
- package/es/date-picker/Type.js +5 -1
- package/es/date-picker/WeekRangePanel.js +254 -175
- package/es/date-picker/YMRangePanel.js +364 -0
- package/es/date-picker/__tests__/index.test.js +956 -0
- package/es/date-picker/constants.js +14 -28
- package/es/date-picker/dateUtil.js +221 -52
- package/es/date-picker/datepicker-legacy/BasePicker.js +511 -0
- package/es/date-picker/datepicker-legacy/Calender.js +422 -0
- package/es/date-picker/datepicker-legacy/DatePanel.js +455 -0
- package/es/date-picker/datepicker-legacy/DatePicker.js +103 -0
- package/es/date-picker/datepicker-legacy/DateRangePanel.js +488 -0
- package/es/date-picker/datepicker-legacy/Modal.js +67 -0
- package/es/date-picker/datepicker-legacy/Time.js +405 -0
- package/es/date-picker/datepicker-legacy/TimePanel.js +85 -0
- package/es/date-picker/datepicker-legacy/TimePeriodPanel.js +118 -0
- package/es/date-picker/datepicker-legacy/TimePicker.js +78 -0
- package/es/date-picker/datepicker-legacy/TimeRangePanel.js +90 -0
- package/es/date-picker/datepicker-legacy/Type.js +31 -0
- package/es/date-picker/datepicker-legacy/WeekRangePanel.js +337 -0
- package/es/date-picker/datepicker-legacy/constants.js +79 -0
- package/es/date-picker/datepicker-legacy/dateUtil.js +258 -0
- package/es/date-picker/datepicker-legacy/index.js +15 -0
- package/es/date-picker/datepicker-legacy/local.js +11 -0
- package/es/date-picker/datepicker-legacy/style/index.css +1 -0
- package/es/date-picker/datepicker-legacy/style/index.js +3 -0
- package/es/date-picker/datepicker-legacy/style/timepicker.css +1 -0
- package/es/date-picker/datepicker-legacy/util.js +60 -0
- package/es/date-picker/index.js +5 -2
- package/es/date-picker/style/index.css +1 -1
- package/es/date-picker/toLunar.js +172 -0
- package/es/date-picker/util.js +101 -8
- package/es/dropdown/Dropdown.js +191 -203
- package/es/dropdown/DropdownButton.js +102 -0
- package/es/dropdown/DropdownMenu.js +107 -0
- package/es/dropdown/DropdownMenuItem.js +172 -0
- package/es/dropdown/__tests__/index.test.js +313 -0
- package/es/dropdown/index.js +69 -4
- package/es/dropdown/style/index.css +1 -1
- package/es/dropdown/style/index.js +0 -2
- package/es/dropdown/{__test__ → tests}/index.test.js +7 -7
- package/es/dropdown/utils.js +35 -0
- package/es/ficon/index.js +16 -30
- package/es/form/Form.js +176 -0
- package/es/form/{item.js → Item.js} +52 -60
- package/es/form/__tests__/index.test.js +571 -0
- package/es/form/index.js +6 -171
- package/es/form/style/index.css +1 -1
- package/es/grid/__tests__/index.test.js +100 -0
- package/es/grid/index.js +36 -56
- package/es/icon/index.js +23 -38
- package/es/index.js +61 -9
- package/es/input/Input.js +400 -0
- package/es/input/__tests__/index.test.js +376 -0
- package/es/input/index.js +26 -347
- package/es/input/input-legacy/index.js +341 -0
- package/es/input/input-legacy/util.js +176 -0
- package/es/input/style/index.css +1 -1
- package/es/input/util.js +26 -18
- package/es/lib/withDragDropContext.js +2 -2
- package/es/loading/Loading.js +173 -0
- package/es/loading/__tests__/index.test.js +110 -0
- package/es/loading/index.js +5 -129
- package/es/loading/style/index.css +0 -0
- package/es/loading/style/index.js +0 -0
- package/es/locales/en-US.js +45 -9
- package/es/locales/index.js +16 -2
- package/es/locales/zh-CN.js +46 -10
- package/es/locales/zh-Hant-HK.js +123 -0
- package/es/locales/zh-Hant-TW.js +125 -0
- package/es/menu/Item.js +34 -51
- package/es/menu/Menu.js +414 -0
- package/es/menu/SubMenu.js +63 -90
- package/es/menu/Title.js +37 -51
- package/es/menu/__tests__/index.test.js +274 -0
- package/es/menu/index.js +12 -419
- package/es/menu/style/index.css +1 -1
- package/es/message/__tests__/index.test.js +71 -0
- package/es/message/index.js +58 -0
- package/es/message/style/index.css +1 -0
- package/es/message/style/index.js +5 -0
- package/es/modal/__tests__/index.test.js +178 -0
- package/es/modal/index.js +85 -77
- package/es/modal/style/index.css +1 -1
- package/es/nav-menu/NavMenu.js +44 -61
- package/es/nav-menu/__test__/index.test.js +8 -8
- package/es/nav-menu/__tests__/index.test.js +23 -0
- package/es/nav-menu/index.js +2 -2
- package/es/notice/Notice.js +136 -0
- package/es/notice/NoticeContainer.js +107 -0
- package/es/notice/__tests__/index.test.js +174 -0
- package/es/notice/index.js +66 -0
- package/es/notice/style/index.css +1 -0
- package/es/notice/style/index.js +5 -0
- package/es/notification/HandleNotification/index.js +216 -0
- package/es/notification/HandleNotification/style/index.css +1 -0
- package/es/notification/HandleNotification/style/index.js +5 -0
- package/es/notification/__tests__/index.test.js +114 -0
- package/es/notification/index.js +68 -231
- package/es/notification/style/index.css +1 -1
- package/es/notification/style/index.js +0 -0
- package/es/pagination/Pager.js +7 -9
- package/es/pagination/Pagination.js +134 -133
- package/es/pagination/__tests__/index.test.js +244 -0
- package/es/pagination/index.js +9 -8
- package/es/pagination/style/index.css +1 -1
- package/es/panel/index.js +28 -46
- package/es/popover/__test__/index.test.js +10 -10
- package/es/popover/__tests__/index.test.js +152 -0
- package/es/popover/index.js +77 -83
- package/es/popper/index.js +68 -64
- package/es/popper/style/index.css +1 -1
- package/es/preview/index.js +529 -0
- package/es/preview/style/index.css +1 -0
- package/es/preview/style/index.js +3 -0
- package/es/progress/BarProgress.js +107 -43
- package/es/progress/CircleProgress.js +13 -14
- package/es/progress/DashboardProgress.js +11 -13
- package/es/progress/Progress.js +102 -0
- package/es/progress/__tests__/index.test.js +131 -0
- package/es/progress/index.js +8 -100
- package/es/progress/style/index.css +1 -1
- package/es/radio/Group.js +199 -0
- package/es/radio/Radio.js +147 -0
- package/es/radio/__tests__/index.test.js +127 -0
- package/es/radio/index.js +10 -216
- package/es/radio/{__test__ → radio-legacy/__test__}/index.test.js +13 -13
- package/es/radio/radio-legacy/index.js +214 -0
- package/es/radio/radio-legacy/style/index.css +1 -0
- package/es/radio/radio-legacy/style/index.js +3 -0
- package/es/radio/style/index.css +1 -1
- package/es/rate/Icons.js +70 -70
- package/es/rate/Rate.js +75 -108
- package/es/rate/__tests__/index.test.js +124 -0
- package/es/rate/index.js +5 -2
- package/es/rate/style/index.css +1 -1
- package/es/select/Select.js +330 -265
- package/es/select/SelectDropdown.js +223 -79
- package/es/select/SelectInput.js +120 -91
- package/es/select/__tests__/index.test.js +505 -0
- package/es/select/index.js +6 -4
- package/es/select/select-legacy/Option.js +78 -0
- package/es/select/select-legacy/Select.js +702 -0
- package/es/select/select-legacy/SelectDropdown.js +157 -0
- package/es/select/select-legacy/SelectInput.js +308 -0
- package/es/select/select-legacy/common.js +19 -0
- package/es/select/select-legacy/index.js +16 -0
- package/es/select/style/select-dropdown.css +1 -1
- package/es/select/style/select-input.css +1 -1
- package/es/stepper/Stepper.js +147 -0
- package/es/stepper/__tests__/index.test.js +161 -0
- package/es/stepper/index.js +21 -127
- package/es/stepper/style/index.css +1 -1
- package/es/style/icon/diyIcon.css +1 -1
- package/es/style/icon/index.css +1 -1
- package/es/switch/__tests__/index.test.js +68 -0
- package/es/switch/index.js +26 -46
- package/es/switch/style/index.css +1 -1
- package/es/table/Body.js +294 -0
- package/es/table/ClickOuterside.js +95 -0
- package/es/table/Footer.js +171 -0
- package/es/table/Header.js +320 -0
- package/es/table/TableContent.js +101 -0
- package/es/table/__tests__/index.test.js +129 -0
- package/es/table/checkbox/index.js +36 -47
- package/es/table/checkbox/style/index.css +1 -0
- package/es/table/checkbox/style/index.js +3 -0
- package/es/table/index.js +269 -314
- package/es/table/menu/index.js +34 -44
- package/es/table/prefix.js +2 -2
- package/es/table/style/Table.css +1 -1
- package/es/table/style/index.css +1 -1
- package/es/tabs/ItemDropdown.js +45 -65
- package/es/tabs/TabPane.js +26 -44
- package/es/tabs/Tabs.js +110 -111
- package/es/tabs/__tests__/index.test.js +329 -0
- package/es/tabs/index.js +9 -3
- package/es/tabs/style/index.css +1 -1
- package/es/tabs/tabs-legacy/ItemDropdown.js +162 -0
- package/es/tabs/tabs-legacy/TabPane.js +70 -0
- package/es/tabs/tabs-legacy/Tabs.js +291 -0
- package/es/tabs/tabs-legacy/index.js +18 -0
- package/es/tabs/tabs-legacy/style/index.css +1 -0
- package/es/tabs/tabs-legacy/style/index.js +3 -0
- package/es/tag/__tests__/index.test.js +46 -0
- package/es/tag/index.js +86 -0
- package/es/tag/style/index.css +1 -0
- package/es/tag/style/index.js +3 -0
- package/es/timeline/__tests__/index.test.js +198 -0
- package/es/timeline/index.js +206 -136
- package/es/timeline/style/index.css +1 -1
- package/es/tooltip/__tests__/index.test.js +166 -0
- package/es/tooltip/index.js +93 -52
- package/es/tooltip/style/index.css +1 -1
- package/es/transfer/Item.js +73 -71
- package/es/transfer/Transfer.js +558 -0
- package/es/transfer/__tests__/index.test.js +210 -0
- package/es/transfer/index.js +4 -443
- package/es/transfer/style/index.css +1 -1
- package/es/tree/IconLoading.js +38 -0
- package/es/tree/Tree.js +94 -111
- package/es/tree/TreeDivider.js +6 -6
- package/es/tree/TreeItem.js +217 -123
- package/es/tree/TreeNode.js +472 -333
- package/es/tree/__tests__/index.test.js +599 -0
- package/es/tree/index.js +9 -2
- package/es/tree/style/index.css +1 -1
- package/es/tree/tree-legacy/Tree.js +330 -0
- package/es/tree/tree-legacy/TreeDivider.js +25 -0
- package/es/tree/tree-legacy/TreeItem.js +326 -0
- package/es/tree/tree-legacy/TreeNode.js +711 -0
- package/es/tree/tree-legacy/index.js +13 -0
- package/es/tree/tree-legacy/style/index.css +1 -0
- package/es/tree/tree-legacy/style/index.js +3 -0
- package/es/tree/tree-legacy/util.js +434 -0
- package/es/tree/util.js +8 -256
- package/es/upload/Upload.js +292 -200
- package/es/upload/UploadAvatar.js +61 -79
- package/es/upload/UploadClick.js +62 -60
- package/es/upload/UploadDrag.js +63 -66
- package/es/upload/UploadPhoto.js +86 -75
- package/es/upload/UploadPictureCard.js +53 -60
- package/es/upload/__tests__/index.test.js +760 -0
- package/es/upload/index.js +8 -71
- package/es/upload/main.js +83 -0
- package/es/upload/style/index.css +1 -1
- package/es/upload/tool.js +0 -1
- package/es/upload/{Preview.js → upload-legacy/Preview.js} +48 -62
- package/es/upload/upload-legacy/Upload.js +431 -0
- package/es/upload/upload-legacy/UploadAvatar.js +318 -0
- package/es/upload/upload-legacy/UploadClick.js +121 -0
- package/es/upload/upload-legacy/UploadDrag.js +176 -0
- package/es/upload/upload-legacy/UploadPhoto.js +179 -0
- package/es/upload/upload-legacy/UploadPictureCard.js +122 -0
- package/es/upload/upload-legacy/index.js +67 -0
- package/es/upload/upload-legacy/style/index.css +1 -0
- package/es/upload/upload-legacy/style/index.js +5 -0
- package/es/upload/upload-legacy/tool.js +84 -0
- package/es/watermark/index.js +97 -0
- package/es/watermark/watermark.js +263 -0
- package/package.json +1 -1
- package/es/alert/__test__/index.test.js +0 -67
- package/es/button/__test__/index.test.js +0 -29
- package/es/cascader/__test__/index.test.js +0 -283
- package/es/cascader/menu.js +0 -155
- package/es/checkbox/Base.js +0 -205
- package/es/checkbox/CheckBox.js +0 -185
- package/es/collapse/__test__/index.test.js +0 -58
- package/es/counter/__test__/index.test.js +0 -52
- package/es/menu/ItemGroup.js +0 -81
- package/es/modal/__test__/index.test.js +0 -123
- package/es/notification/__test__/index.test.js +0 -56
- package/es/pagination/__test__/index.test.js +0 -140
- package/es/rate/__test__/index.test.js +0 -54
- package/es/select/Option.js +0 -93
- package/es/select/__test__/index.test.js +0 -429
- package/es/style/color/colors.css +0 -0
- package/es/style/index.css +0 -0
- package/es/style/mixins/colors.css +0 -0
- package/es/style/mixins/index.css +0 -0
- package/es/style/theme/dark.css +0 -0
- package/es/style/theme/default.css +0 -0
- package/es/switch/__test__/index.test.js +0 -39
- package/es/table/__test__/index.test.js +0 -73
- package/es/table/body.js +0 -318
- package/es/table/clickOuterside.js +0 -115
- package/es/table/footer.js +0 -196
- package/es/table/header.js +0 -337
- package/es/table/pover.js +0 -154
- package/es/table/tableContent.js +0 -120
- package/es/timeline/__test__/index.test.js +0 -49
- package/es/timeline/foldingItem.js +0 -82
- package/es/tooltip/__test__/index.test.js +0 -67
- package/es/transfer/__test__/index.test.js +0 -11
- /package/es/{style → breadcrumb/style}/index.js +0 -0
- /package/es/checkbox/{common.js → checkbox-legacy/common.js} +0 -0
- /package/es/upload/{style → upload-legacy/style}/preview.css +0 -0
- /package/es/upload/{style → upload-legacy/style}/preview.js +0 -0
package/es/form/index.js
CHANGED
|
@@ -1,186 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports["default"] = void 0;
|
|
7
9
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _Form = _interopRequireDefault(require("./Form"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _Item = _interopRequireDefault(require("./Item"));
|
|
13
13
|
|
|
14
14
|
var _context = _interopRequireDefault(require("../context"));
|
|
15
15
|
|
|
16
16
|
require("./style/index");
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
23
|
-
|
|
24
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
25
|
-
|
|
26
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
-
|
|
28
|
-
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); } }
|
|
29
|
-
|
|
30
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
31
|
-
|
|
32
|
-
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
-
|
|
34
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
-
|
|
36
|
-
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); }; }
|
|
37
|
-
|
|
38
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
39
|
-
|
|
40
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
-
|
|
42
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
43
|
-
|
|
44
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
-
|
|
46
|
-
var PropTypes = require('prop-types');
|
|
47
|
-
|
|
48
|
-
var Form = /*#__PURE__*/function (_Component) {
|
|
49
|
-
_inherits(Form, _Component);
|
|
50
|
-
|
|
51
|
-
var _super = _createSuper(Form);
|
|
52
|
-
|
|
53
|
-
function Form(props) {
|
|
54
|
-
var _this;
|
|
55
|
-
|
|
56
|
-
_classCallCheck(this, Form);
|
|
57
|
-
|
|
58
|
-
_this = _super.call(this, props);
|
|
59
|
-
_this.state = {
|
|
60
|
-
fields: []
|
|
61
|
-
};
|
|
62
|
-
return _this;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
_createClass(Form, [{
|
|
66
|
-
key: "getChildContext",
|
|
67
|
-
value: function getChildContext() {
|
|
68
|
-
return {
|
|
69
|
-
component: this
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "getClassNames",
|
|
74
|
-
value: function getClassNames() {
|
|
75
|
-
var _this$props = this.props,
|
|
76
|
-
labelPosition = _this$props.labelPosition,
|
|
77
|
-
inline = _this$props.inline;
|
|
78
|
-
var obj = {};
|
|
79
|
-
|
|
80
|
-
if (labelPosition) {
|
|
81
|
-
obj["hi-form--label--".concat(labelPosition)] = true;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (inline) {
|
|
85
|
-
obj["hi-form--inline"] = true;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return obj;
|
|
89
|
-
}
|
|
90
|
-
}, {
|
|
91
|
-
key: "addField",
|
|
92
|
-
value: function addField(field) {
|
|
93
|
-
this.setState(function (prevState) {
|
|
94
|
-
return {
|
|
95
|
-
fields: prevState.fields.concat(field)
|
|
96
|
-
};
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}, {
|
|
100
|
-
key: "removeField",
|
|
101
|
-
value: function removeField(prop) {
|
|
102
|
-
this.setState(function (prevState) {
|
|
103
|
-
return {
|
|
104
|
-
fields: prevState.fields.filter(function (field) {
|
|
105
|
-
return field.props.prop !== prop;
|
|
106
|
-
})
|
|
107
|
-
};
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}, {
|
|
111
|
-
key: "validate",
|
|
112
|
-
value: function validate(cb) {
|
|
113
|
-
var valid = true;
|
|
114
|
-
var count = 0;
|
|
115
|
-
var fields = this.state.fields;
|
|
116
|
-
|
|
117
|
-
if (fields.length === 0 && cb) {
|
|
118
|
-
cb(valid);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
fields.forEach(function (field) {
|
|
122
|
-
field.validate('', function (errors) {
|
|
123
|
-
if (errors) {
|
|
124
|
-
valid = false;
|
|
125
|
-
} else {
|
|
126
|
-
if (typeof cb === 'function' && ++count === fields.length) {
|
|
127
|
-
cb(valid);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}, {
|
|
134
|
-
key: "validateField",
|
|
135
|
-
value: function validateField(key, cb) {
|
|
136
|
-
var field = this.state.fields.filter(function (field) {
|
|
137
|
-
return field.props.prop === key;
|
|
138
|
-
})[0];
|
|
139
|
-
|
|
140
|
-
if (!field) {
|
|
141
|
-
throw new Error('must call validate Field with valid key string!');
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
field.validate('', cb);
|
|
145
|
-
}
|
|
146
|
-
}, {
|
|
147
|
-
key: "resetValidates",
|
|
148
|
-
value: function resetValidates() {
|
|
149
|
-
this.state.fields.forEach(function (field) {
|
|
150
|
-
field.resetValidate();
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}, {
|
|
154
|
-
key: "render",
|
|
155
|
-
value: function render() {
|
|
156
|
-
var children = this.props.children;
|
|
157
|
-
return /*#__PURE__*/_react["default"].createElement("form", {
|
|
158
|
-
className: (0, _classnames["default"])('hi-form', this.getClassNames())
|
|
159
|
-
}, children);
|
|
160
|
-
}
|
|
161
|
-
}]);
|
|
162
|
-
|
|
163
|
-
return Form;
|
|
164
|
-
}(_react.Component);
|
|
165
|
-
|
|
166
|
-
Form.childContextTypes = {
|
|
167
|
-
component: PropTypes.any
|
|
168
|
-
};
|
|
169
|
-
Form.propTypes = {
|
|
170
|
-
model: PropTypes.object,
|
|
171
|
-
rules: PropTypes.object,
|
|
172
|
-
labelPosition: PropTypes.oneOf(['right', 'left', 'top']),
|
|
173
|
-
labWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
174
|
-
inline: PropTypes.bool,
|
|
175
|
-
showColon: PropTypes.bool,
|
|
176
|
-
onSubmit: PropTypes.func
|
|
177
|
-
};
|
|
178
|
-
Form.defaultProps = {
|
|
179
|
-
size: 'small',
|
|
180
|
-
labelPosition: 'right',
|
|
181
|
-
showColon: true
|
|
182
|
-
};
|
|
183
|
-
var FormWrapper = (0, _context["default"])(Form);
|
|
184
|
-
FormWrapper.Item = _item["default"];
|
|
18
|
+
var FormWrapper = (0, _context["default"])(_Form["default"]);
|
|
19
|
+
FormWrapper.Item = _Item["default"];
|
|
185
20
|
var _default = FormWrapper;
|
|
186
21
|
exports["default"] = _default;
|
package/es/form/style/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.hi-form{max-width:100%;position:relative}.hi-form fieldset{margin:0;padding:0;border:0}.hi-form fieldset+fieldset{margin-top:16px}.hi-form legend{margin:0 0 16px;color:#666}.hi-form--inline{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.hi-form__title{-webkit-box-sizing:border-box;box-sizing:border-box;margin-top:0;margin-bottom:24px;font-size:16px;font-weight:400}.hi-form--label--left .hi-form-item__label{text-align:left}.hi-form--label--right .hi-form-item__label{text-align:right}.hi-form--label--top{padding-right:0;text-align:left}.hi-form--label--top.hi-form--inline .hi-form-item__span{min-height:32px}.hi-form--label--top .hi-form-item{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.hi-form-item{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:14px;margin-right:8px}.hi-form-item__label,.hi-form-item__span{-ms-flex-negative:0;flex-shrink:0;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:top;color:#666;overflow-wrap:break-word}.hi-form-item__label{min-height:32px;padding-right:8px;line-height:32px}.hi-form-item__content{-webkit-box-flex:1;-ms-flex:1;flex:1;position:relative;vertical-align:top;min-height:32px}.hi-form-item__error .hi-input__inner{border-color:#f44141}.hi-form-item--msg__error{font-size:12px;min-height:24px;padding:2px 0;-webkit-box-sizing:border-box;box-sizing:border-box;line-height:20px;color:#f44141}.hi-form--inline .hi-form-item--msg__error{top:36px;left:0;line-height:18px}.hi-form-item--required .hi-form-item__label::before{margin-right:4px;content:'*';color:#f44141}.hi-form-item--fixed{position:absolute;top:0;right:0}
|
|
1
|
+
.hi-form{max-width:100%;position:relative}.hi-form fieldset{margin:0;padding:0;border:0}.hi-form fieldset+fieldset{margin-top:16px}.hi-form legend{margin:0 0 16px;color:#666}.hi-form--inline{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.hi-form__title{-webkit-box-sizing:border-box;box-sizing:border-box;margin-top:0;margin-bottom:24px;font-size:16px;font-weight:400}.hi-form--label--left .hi-form-item__label{text-align:left}.hi-form--label--right .hi-form-item__label{text-align:right}.hi-form--label--top{padding-right:0;text-align:left}.hi-form--label--top.hi-form--inline .hi-form-item__span{min-height:32px}.hi-form--label--top .hi-form-item{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.hi-form--label--top .hi-form-item .hi-form-item__label{height:22px;padding-right:8px;margin-bottom:8px}.hi-form-item{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:14px;margin-right:8px}.hi-form-item__label,.hi-form-item__span{-ms-flex-negative:0;flex-shrink:0;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:top;color:#666;overflow-wrap:break-word}.hi-form-item__label{min-height:32px;padding-right:8px;line-height:32px}.hi-form-item__content{-webkit-box-flex:1;-ms-flex:1;flex:1;position:relative;vertical-align:top;min-height:32px}.hi-form-item__error .hi-form-item__content .hi-input__inner,.hi-form-item__error .hi-form-item__content .hi-select__input,.hi-form-item__error .hi-form-item__content .hi-cascader__input-container,.hi-form-item__error .hi-form-item__content .hi-datepicker__input,.hi-form-item__error .hi-form-item__content .tree-select__tag-wrapper,.hi-form-item__error .hi-form-item__content .hi-input{border-color:#f44141}.hi-form-item--msg__error{font-size:12px;min-height:24px;padding:2px 0;-webkit-box-sizing:border-box;box-sizing:border-box;line-height:20px;color:#f44141}.hi-form--inline .hi-form-item--msg__error{top:36px;left:0;line-height:18px}.hi-form-item--required .hi-form-item__label::before{margin-right:4px;content:'*';color:#f44141}.hi-form-item--fixed{position:absolute;top:0;right:0}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
+
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
|
|
9
|
+
var _enzyme = require("enzyme");
|
|
10
|
+
|
|
11
|
+
var _sinon = _interopRequireWildcard(require("sinon"));
|
|
12
|
+
|
|
13
|
+
var _simulant = _interopRequireDefault(require("simulant"));
|
|
14
|
+
|
|
15
|
+
var _index = _interopRequireDefault(require("../index"));
|
|
16
|
+
|
|
17
|
+
/* eslint-env jest */
|
|
18
|
+
describe('Grid', function () {
|
|
19
|
+
describe('Row&Col.PropTypes', function () {
|
|
20
|
+
it('gutter', function () {
|
|
21
|
+
var Row = _index["default"].Row;
|
|
22
|
+
var Col = _index["default"].Col;
|
|
23
|
+
var wrapper = (0, _enzyme.mount)(_react["default"].createElement(Row, {
|
|
24
|
+
gutter: true
|
|
25
|
+
}, _react["default"].createElement(Col, {
|
|
26
|
+
span: 12
|
|
27
|
+
}, "div"), _react["default"].createElement(Col, {
|
|
28
|
+
span: 12
|
|
29
|
+
}, "div")));
|
|
30
|
+
expect(wrapper.find('.hi-grid__row').hasClass('hi-grid__row--gutter')).toBeTruthy();
|
|
31
|
+
});
|
|
32
|
+
it('span', function () {
|
|
33
|
+
var Row = _index["default"].Row;
|
|
34
|
+
var Col = _index["default"].Col;
|
|
35
|
+
var wrapper = (0, _enzyme.mount)(_react["default"].createElement(Row, null, _react["default"].createElement(Col, null, "div"), _react["default"].createElement(Col, {
|
|
36
|
+
span: 4
|
|
37
|
+
}, "div"), _react["default"].createElement(Col, {
|
|
38
|
+
span: 8
|
|
39
|
+
}, "div"), _react["default"].createElement(Col, {
|
|
40
|
+
span: 12
|
|
41
|
+
}, "div")));
|
|
42
|
+
expect(wrapper.find('.hi-grid__col-4')).toHaveLength(1);
|
|
43
|
+
expect(wrapper.find('.hi-grid__col-8')).toHaveLength(1);
|
|
44
|
+
expect(wrapper.find('.hi-grid__col-12')).toHaveLength(1);
|
|
45
|
+
});
|
|
46
|
+
it('offset', function () {
|
|
47
|
+
var Row = _index["default"].Row;
|
|
48
|
+
var Col = _index["default"].Col;
|
|
49
|
+
var wrapper = (0, _enzyme.mount)(_react["default"].createElement(Row, null, _react["default"].createElement(Col, {
|
|
50
|
+
span: 3
|
|
51
|
+
}, "div"), _react["default"].createElement(Col, {
|
|
52
|
+
span: 8
|
|
53
|
+
}, "div"), _react["default"].createElement(Col, {
|
|
54
|
+
span: 4,
|
|
55
|
+
offset: 4
|
|
56
|
+
}, "div")));
|
|
57
|
+
expect(wrapper.find('.hi-grid__col-3')).toHaveLength(1);
|
|
58
|
+
expect(wrapper.find('.hi-grid__col-8')).toHaveLength(1);
|
|
59
|
+
expect(wrapper.find('.hi-grid__col-4').hasClass('hi-grid__offset-4')).toBeTruthy();
|
|
60
|
+
});
|
|
61
|
+
it('justify', function () {
|
|
62
|
+
var Row = _index["default"].Row;
|
|
63
|
+
var Col = _index["default"].Col;
|
|
64
|
+
var wrapper = (0, _enzyme.mount)(_react["default"].createElement("div", null, _react["default"].createElement(Row, {
|
|
65
|
+
justify: "center"
|
|
66
|
+
}, _react["default"].createElement(Col, {
|
|
67
|
+
span: 3,
|
|
68
|
+
justify: "flex-start"
|
|
69
|
+
}, "div"), _react["default"].createElement(Col, {
|
|
70
|
+
span: 8
|
|
71
|
+
}, "div"), _react["default"].createElement(Col, {
|
|
72
|
+
span: 4,
|
|
73
|
+
offset: 4
|
|
74
|
+
}, "div")), _react["default"].createElement(Row, {
|
|
75
|
+
justify: "space-between"
|
|
76
|
+
}, _react["default"].createElement(Col, {
|
|
77
|
+
span: 3
|
|
78
|
+
}, "div"), _react["default"].createElement(Col, {
|
|
79
|
+
span: 8
|
|
80
|
+
}, "div"), _react["default"].createElement(Col, {
|
|
81
|
+
span: 4,
|
|
82
|
+
offset: 4
|
|
83
|
+
}, "div"))));
|
|
84
|
+
expect(window.getComputedStyle(wrapper.find('.hi-grid__row').first().getDOMNode()).getPropertyValue('justify-content')).toEqual('center');
|
|
85
|
+
expect(window.getComputedStyle(wrapper.find('.hi-grid__row').at(1).getDOMNode()).getPropertyValue('justify-content')).toEqual('space-between');
|
|
86
|
+
expect(window.getComputedStyle(wrapper.find('.hi-grid__col-3').at(0).getDOMNode()).getPropertyValue('justify-content')).toEqual('flex-start');
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
describe('Br', function () {
|
|
90
|
+
var Row = _index["default"].Row;
|
|
91
|
+
var Col = _index["default"].Col;
|
|
92
|
+
var Br = _index["default"].Br;
|
|
93
|
+
var wrapper = (0, _enzyme.mount)(_react["default"].createElement("div", null, _react["default"].createElement(Row, null, _react["default"].createElement(Col, {
|
|
94
|
+
span: 3
|
|
95
|
+
}, "div")), _react["default"].createElement(Br, null), _react["default"].createElement(Row, null, _react["default"].createElement(Col, {
|
|
96
|
+
span: 3
|
|
97
|
+
}, "div"))));
|
|
98
|
+
expect(wrapper.containsAnyMatchingElements([_react["default"].createElement(Br, null)])).toBeTruthy();
|
|
99
|
+
});
|
|
100
|
+
});
|
package/es/grid/index.js
CHANGED
|
@@ -1,58 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
3
7
|
Object.defineProperty(exports, "__esModule", {
|
|
4
8
|
value: true
|
|
5
9
|
});
|
|
6
10
|
exports["default"] = void 0;
|
|
7
11
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
|
-
require("./style/index");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
17
|
-
|
|
18
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
19
|
-
|
|
20
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
21
|
-
|
|
22
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
|
-
|
|
24
|
-
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); } }
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
25
13
|
|
|
26
|
-
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
27
15
|
|
|
28
|
-
|
|
16
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
29
17
|
|
|
30
|
-
|
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
31
19
|
|
|
32
|
-
|
|
20
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
33
21
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
37
23
|
|
|
38
|
-
|
|
24
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
39
25
|
|
|
40
|
-
|
|
26
|
+
require("./style/index");
|
|
41
27
|
|
|
42
28
|
var PropTypes = require('prop-types');
|
|
43
29
|
|
|
44
|
-
var Col =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
30
|
+
var Col =
|
|
31
|
+
/*#__PURE__*/
|
|
32
|
+
function (_Component) {
|
|
33
|
+
(0, _inherits2["default"])(Col, _Component);
|
|
48
34
|
|
|
49
35
|
function Col() {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return _super.apply(this, arguments);
|
|
36
|
+
(0, _classCallCheck2["default"])(this, Col);
|
|
37
|
+
return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Col).apply(this, arguments));
|
|
53
38
|
}
|
|
54
39
|
|
|
55
|
-
|
|
40
|
+
(0, _createClass2["default"])(Col, [{
|
|
56
41
|
key: "render",
|
|
57
42
|
value: function render() {
|
|
58
43
|
var _this$props = this.props,
|
|
@@ -81,14 +66,13 @@ var Col = /*#__PURE__*/function (_Component) {
|
|
|
81
66
|
});
|
|
82
67
|
}
|
|
83
68
|
|
|
84
|
-
return
|
|
69
|
+
return _react["default"].createElement("div", {
|
|
85
70
|
id: "".concat(id || ''),
|
|
86
71
|
className: "".concat(colClass, " ").concat(className || ''),
|
|
87
72
|
style: style
|
|
88
73
|
}, children);
|
|
89
74
|
}
|
|
90
75
|
}]);
|
|
91
|
-
|
|
92
76
|
return Col;
|
|
93
77
|
}(_react.Component);
|
|
94
78
|
|
|
@@ -96,18 +80,17 @@ Col.contextTypes = {
|
|
|
96
80
|
gutter: PropTypes.bool
|
|
97
81
|
};
|
|
98
82
|
|
|
99
|
-
var Row =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
83
|
+
var Row =
|
|
84
|
+
/*#__PURE__*/
|
|
85
|
+
function (_Component2) {
|
|
86
|
+
(0, _inherits2["default"])(Row, _Component2);
|
|
103
87
|
|
|
104
88
|
function Row() {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return _super2.apply(this, arguments);
|
|
89
|
+
(0, _classCallCheck2["default"])(this, Row);
|
|
90
|
+
return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Row).apply(this, arguments));
|
|
108
91
|
}
|
|
109
92
|
|
|
110
|
-
|
|
93
|
+
(0, _createClass2["default"])(Row, [{
|
|
111
94
|
key: "getChildContext",
|
|
112
95
|
value: function getChildContext() {
|
|
113
96
|
return {
|
|
@@ -136,14 +119,13 @@ var Row = /*#__PURE__*/function (_Component2) {
|
|
|
136
119
|
});
|
|
137
120
|
}
|
|
138
121
|
|
|
139
|
-
return
|
|
122
|
+
return _react["default"].createElement("div", {
|
|
140
123
|
id: "".concat(id || ''),
|
|
141
124
|
className: "".concat(rowClass, " ").concat(className || ''),
|
|
142
125
|
style: style
|
|
143
126
|
}, children);
|
|
144
127
|
}
|
|
145
128
|
}]);
|
|
146
|
-
|
|
147
129
|
return Row;
|
|
148
130
|
}(_react.Component);
|
|
149
131
|
|
|
@@ -151,18 +133,17 @@ Row.childContextTypes = {
|
|
|
151
133
|
gutter: PropTypes.bool
|
|
152
134
|
};
|
|
153
135
|
|
|
154
|
-
var Br =
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
136
|
+
var Br =
|
|
137
|
+
/*#__PURE__*/
|
|
138
|
+
function (_Component3) {
|
|
139
|
+
(0, _inherits2["default"])(Br, _Component3);
|
|
158
140
|
|
|
159
141
|
function Br() {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
return _super3.apply(this, arguments);
|
|
142
|
+
(0, _classCallCheck2["default"])(this, Br);
|
|
143
|
+
return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Br).apply(this, arguments));
|
|
163
144
|
}
|
|
164
145
|
|
|
165
|
-
|
|
146
|
+
(0, _createClass2["default"])(Br, [{
|
|
166
147
|
key: "render",
|
|
167
148
|
value: function render() {
|
|
168
149
|
var _this$props3 = this.props,
|
|
@@ -171,12 +152,11 @@ var Br = /*#__PURE__*/function (_Component3) {
|
|
|
171
152
|
_this$props3$style = _this$props3.style,
|
|
172
153
|
style = _this$props3$style === void 0 ? {} : _this$props3$style;
|
|
173
154
|
style.height = parseInt(height) + 'px';
|
|
174
|
-
return
|
|
155
|
+
return _react["default"].createElement("div", {
|
|
175
156
|
style: style
|
|
176
157
|
});
|
|
177
158
|
}
|
|
178
159
|
}]);
|
|
179
|
-
|
|
180
160
|
return Br;
|
|
181
161
|
}(_react.Component);
|
|
182
162
|
|
package/es/icon/index.js
CHANGED
|
@@ -1,72 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports["default"] = void 0;
|
|
7
9
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
require("./style/index");
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
15
|
-
|
|
16
|
-
function _extends() { _extends = Object.assign || 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); }
|
|
17
|
-
|
|
18
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
19
11
|
|
|
20
|
-
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
21
13
|
|
|
22
|
-
|
|
14
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
25
17
|
|
|
26
|
-
|
|
18
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
27
19
|
|
|
28
|
-
|
|
20
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
29
21
|
|
|
30
|
-
|
|
22
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
31
23
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
35
|
-
|
|
36
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
37
|
-
|
|
38
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
+
var _react = _interopRequireDefault(require("react"));
|
|
39
25
|
|
|
40
|
-
|
|
26
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
41
27
|
|
|
42
|
-
|
|
43
|
-
_inherits(Icon, _React$Component);
|
|
28
|
+
require("./style/index");
|
|
44
29
|
|
|
45
|
-
|
|
30
|
+
var Icon =
|
|
31
|
+
/*#__PURE__*/
|
|
32
|
+
function (_React$Component) {
|
|
33
|
+
(0, _inherits2["default"])(Icon, _React$Component);
|
|
46
34
|
|
|
47
35
|
function Icon() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return _super.apply(this, arguments);
|
|
36
|
+
(0, _classCallCheck2["default"])(this, Icon);
|
|
37
|
+
return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Icon).apply(this, arguments));
|
|
51
38
|
}
|
|
52
39
|
|
|
53
|
-
|
|
40
|
+
(0, _createClass2["default"])(Icon, [{
|
|
54
41
|
key: "render",
|
|
55
42
|
value: function render() {
|
|
56
43
|
var _this$props = this.props,
|
|
57
44
|
className = _this$props.className,
|
|
58
45
|
name = _this$props.name,
|
|
59
46
|
style = _this$props.style,
|
|
60
|
-
rest =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
className: classes,
|
|
47
|
+
rest = (0, _objectWithoutProperties2["default"])(_this$props, ["className", "name", "style"]);
|
|
48
|
+
var iconCls = (0, _classnames["default"])("hi-icon", "icon-".concat(name), className);
|
|
49
|
+
return _react["default"].createElement("i", (0, _extends2["default"])({
|
|
50
|
+
className: iconCls,
|
|
65
51
|
style: style
|
|
66
52
|
}, rest));
|
|
67
53
|
}
|
|
68
54
|
}]);
|
|
69
|
-
|
|
70
55
|
return Icon;
|
|
71
56
|
}(_react["default"].Component);
|
|
72
57
|
|