@hi-ui/hiui 3.9.0-rc.8 → 4.0.0-beta.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.
- package/README.md +5 -79
- package/lib/cjs/index.js +576 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/esm/index.js +66 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/types/index.d.ts +56 -0
- package/package.json +101 -184
- package/CHANGELOG.md +0 -330
- package/es/_util/EventEmitter.js +0 -56
- package/es/_util/SwitchVersion.js +0 -40
- package/es/_util/depreactedPropsCompat.js +0 -58
- package/es/_util/deprecatedPropsCheck.js +0 -21
- package/es/_util/index.js +0 -31
- package/es/_util/warning.js +0 -19
- package/es/alert/Alert.js +0 -129
- package/es/alert/__tests__/index.test.js +0 -84
- package/es/alert/index.d.ts +0 -18
- package/es/alert/index.js +0 -20
- package/es/alert/style/index.css +0 -1
- package/es/alert/style/index.js +0 -3
- package/es/badge/Badge.js +0 -94
- package/es/badge/__tests__/index.test.js +0 -82
- package/es/badge/index.d.ts +0 -15
- package/es/badge/index.js +0 -22
- package/es/badge/style/index.css +0 -1
- package/es/badge/style/index.js +0 -3
- package/es/base-css/index.js +0 -3
- package/es/base-css/style/index.css +0 -1
- package/es/base-css/style/index.js +0 -3
- package/es/breadcrumb/__tests__/index.test.js +0 -61
- package/es/breadcrumb/index.d.ts +0 -19
- package/es/breadcrumb/index.js +0 -72
- package/es/breadcrumb/style/index.css +0 -1
- package/es/breadcrumb/style/index.js +0 -3
- package/es/button/Button.js +0 -158
- package/es/button/ButtonGroup.js +0 -63
- package/es/button/IconLoading.js +0 -27
- package/es/button/__tests__/index.test.js +0 -221
- package/es/button/index.d.ts +0 -26
- package/es/button/index.js +0 -19
- package/es/button/style/index.css +0 -1
- package/es/button/style/index.js +0 -3
- package/es/card/CoverCard.js +0 -41
- package/es/card/NormalCard.js +0 -46
- package/es/card/SimpleCard.js +0 -32
- package/es/card/__tests__/index.test.js +0 -180
- package/es/card/index.d.ts +0 -18
- package/es/card/index.js +0 -75
- package/es/card/style/index.css +0 -1
- package/es/card/style/index.js +0 -3
- package/es/carousel/__tests__/index.test.js +0 -104
- package/es/carousel/index.d.ts +0 -13
- package/es/carousel/index.js +0 -242
- package/es/carousel/style/index.css +0 -1
- package/es/carousel/style/index.js +0 -3
- package/es/cascader/Cascader.js +0 -530
- package/es/cascader/Menu.js +0 -147
- package/es/cascader/__tests__/index.test.js +0 -393
- package/es/cascader/img/empty.png +0 -0
- package/es/cascader/index.d.ts +0 -36
- package/es/cascader/index.js +0 -15
- package/es/cascader/style/cascader.css +0 -1
- package/es/cascader/style/index.js +0 -5
- package/es/cascader/style/menu.css +0 -1
- package/es/cascader/utils.js +0 -216
- package/es/charts/hi-echarts-theme-default.json +0 -502
- package/es/charts/index.d.ts +0 -12
- package/es/charts/index.js +0 -32
- package/es/checkbox/Checkbox.js +0 -145
- package/es/checkbox/Group.js +0 -198
- package/es/checkbox/__tests__/index.test.js +0 -226
- package/es/checkbox/checkbox-legacy/Base.js +0 -216
- package/es/checkbox/checkbox-legacy/CheckBox.js +0 -161
- package/es/checkbox/checkbox-legacy/common.js +0 -47
- package/es/checkbox/checkbox-legacy/index.js +0 -15
- package/es/checkbox/checkbox-legacy/style/index.css +0 -1
- package/es/checkbox/checkbox-legacy/style/index.js +0 -3
- package/es/checkbox/index.d.ts +0 -35
- package/es/checkbox/index.js +0 -38
- package/es/checkbox/style/index.css +0 -1
- package/es/checkbox/style/index.js +0 -3
- package/es/collapse/Panel.js +0 -135
- package/es/collapse/__tests__/index.test.js +0 -111
- package/es/collapse/index.d.ts +0 -24
- package/es/collapse/index.js +0 -197
- package/es/collapse/style/index.css +0 -1
- package/es/collapse/style/index.js +0 -3
- package/es/context/index.d.ts +0 -3
- package/es/context/index.js +0 -120
- package/es/counter/Counter.js +0 -369
- package/es/counter/__tests__/index.test.js +0 -134
- package/es/counter/counter-legacy/index.js +0 -271
- package/es/counter/index.d.ts +0 -13
- package/es/counter/index.js +0 -29
- package/es/counter/style/index.css +0 -1
- package/es/counter/style/index.js +0 -3
- package/es/date-picker/BasePicker.js +0 -325
- package/es/date-picker/TimePicker.d.ts +0 -23
- package/es/date-picker/TimePicker.js +0 -211
- package/es/date-picker/__tests__/index.test.js +0 -957
- package/es/date-picker/components/Calender.js +0 -274
- package/es/date-picker/components/Header.js +0 -98
- package/es/date-picker/components/Input.js +0 -103
- package/es/date-picker/components/Panel.js +0 -145
- package/es/date-picker/components/PickerIcon.js +0 -33
- package/es/date-picker/components/RangePanel.js +0 -353
- package/es/date-picker/components/Root.js +0 -128
- package/es/date-picker/components/Time.js +0 -258
- package/es/date-picker/components/TimeList.js +0 -193
- package/es/date-picker/components/TimePanel.js +0 -67
- package/es/date-picker/components/TimePeriodPanel.js +0 -78
- package/es/date-picker/constants.js +0 -54
- package/es/date-picker/context.js +0 -15
- package/es/date-picker/hooks/index.js +0 -47
- package/es/date-picker/hooks/useAltData.js +0 -112
- package/es/date-picker/hooks/useCalenderData.js +0 -371
- package/es/date-picker/hooks/useDate.js +0 -46
- package/es/date-picker/hooks/useFormat.js +0 -27
- package/es/date-picker/hooks/usePlaceholder.js +0 -43
- package/es/date-picker/hooks/useTimePeriodData.js +0 -29
- package/es/date-picker/index.d.ts +0 -61
- package/es/date-picker/index.js +0 -31
- package/es/date-picker/style/index.css +0 -1
- package/es/date-picker/style/index.js +0 -3
- package/es/date-picker/style/timepicker.css +0 -1
- package/es/date-picker/style/timepicker.js +0 -3
- package/es/date-picker/toLunar.js +0 -172
- package/es/date-picker/utils.js +0 -347
- package/es/drawer/index.d.ts +0 -18
- package/es/drawer/index.js +0 -133
- package/es/drawer/style/index.css +0 -1
- package/es/drawer/style/index.js +0 -3
- package/es/dropdown/Dropdown.js +0 -239
- package/es/dropdown/DropdownButton.js +0 -105
- package/es/dropdown/DropdownMenu.js +0 -119
- package/es/dropdown/DropdownMenuItem.js +0 -176
- package/es/dropdown/__tests__/index.test.js +0 -313
- package/es/dropdown/index.d.ts +0 -29
- package/es/dropdown/index.js +0 -88
- package/es/dropdown/style/index.css +0 -1
- package/es/dropdown/style/index.js +0 -3
- package/es/dropdown/tests/index.test.js +0 -76
- package/es/dropdown/utils.js +0 -35
- package/es/ficon/index.js +0 -56
- package/es/ficon/style/_fa/font-awesome.css +0 -1
- package/es/ficon/style/fonts/FontAwesome.otf +0 -0
- package/es/ficon/style/fonts/fontawesome-webfont.eot +0 -0
- package/es/ficon/style/fonts/fontawesome-webfont.svg +0 -2671
- package/es/ficon/style/fonts/fontawesome-webfont.ttf +0 -0
- package/es/ficon/style/fonts/fontawesome-webfont.woff +0 -0
- package/es/ficon/style/fonts/fontawesome-webfont.woff2 +0 -0
- package/es/ficon/style/index.css +0 -1
- package/es/ficon/style/index.js +0 -3
- package/es/filter/index.d.ts +0 -18
- package/es/filter/index.js +0 -146
- package/es/filter/style/index.css +0 -1
- package/es/filter/style/index.js +0 -3
- package/es/form/Form.js +0 -425
- package/es/form/FormContext.js +0 -15
- package/es/form/FormReducer.js +0 -144
- package/es/form/Item.js +0 -557
- package/es/form/List.js +0 -127
- package/es/form/Reset.js +0 -41
- package/es/form/SchemaForm.js +0 -129
- package/es/form/Submit.js +0 -39
- package/es/form/__tests__/index.test.js +0 -575
- package/es/form/form-legacy/form-v2/Form.js +0 -175
- package/es/form/form-legacy/form-v2/Item.js +0 -283
- package/es/form/form-legacy/form-v2/__tests__/index.test.js +0 -575
- package/es/form/form-legacy/form-v2/index.js +0 -27
- package/es/form/form-legacy/form-v2/style/index.css +0 -1
- package/es/form/form-legacy/form-v2/style/index.js +0 -3
- package/es/form/hooks/useForm.js +0 -48
- package/es/form/hooks/useFormInstance.js +0 -46
- package/es/form/index.d.ts +0 -80
- package/es/form/index.js +0 -47
- package/es/form/style/index.css +0 -1
- package/es/form/style/index.js +0 -3
- package/es/form/test.js +0 -52
- package/es/form/utils.js +0 -77
- package/es/grid/__tests__/index.test.js +0 -100
- package/es/grid/index.d.ts +0 -38
- package/es/grid/index.js +0 -178
- package/es/grid/style/index.css +0 -1
- package/es/grid/style/index.js +0 -3
- package/es/hi-base-table/index.d.ts +0 -675
- package/es/hi-base-table/index.js +0 -226
- package/es/hi-base-table/style/hiui-basetable-theme.css +0 -1
- package/es/hi-base-table/style/index.js +0 -3
- package/es/hi-request/axios.d.ts +0 -5
- package/es/hi-request/axios.js +0 -40
- package/es/hi-request/download.d.ts +0 -5
- package/es/hi-request/download.js +0 -30
- package/es/hi-request/index.d.ts +0 -4
- package/es/hi-request/index.js +0 -4
- package/es/hi-request/jsonp.d.ts +0 -5
- package/es/hi-request/jsonp.js +0 -66
- package/es/hi-request/mixin.d.ts +0 -3
- package/es/hi-request/mixin.js +0 -42
- package/es/hi-request/type.d.ts +0 -69
- package/es/hi-request/type.js +0 -0
- package/es/hi-request/upload.d.ts +0 -5
- package/es/hi-request/upload.js +0 -23
- package/es/hi-request/utils.d.ts +0 -1
- package/es/hi-request/utils.js +0 -3
- package/es/icon/iconfont.js +0 -48
- package/es/icon/index.d.ts +0 -13
- package/es/icon/index.js +0 -101
- package/es/icon/style/index.css +0 -1
- package/es/icon/style/index.js +0 -3
- package/es/index.d.ts +0 -95
- package/es/index.js +0 -58
- package/es/input/Input.js +0 -420
- package/es/input/__tests__/index.test.js +0 -377
- package/es/input/index.d.ts +0 -27
- package/es/input/index.js +0 -44
- package/es/input/input-legacy/index.js +0 -349
- package/es/input/input-legacy/util.js +0 -176
- package/es/input/style/index.css +0 -1
- package/es/input/style/index.js +0 -5
- package/es/input/util.js +0 -191
- package/es/lib/withDragDropContext.js +0 -16
- package/es/list/IconText.js +0 -40
- package/es/list/Item.js +0 -63
- package/es/list/index.d.ts +0 -30
- package/es/list/index.js +0 -159
- package/es/list/style/index.css +0 -1
- package/es/list/style/index.js +0 -3
- package/es/loading/Loading.js +0 -185
- package/es/loading/__tests__/index.test.js +0 -110
- package/es/loading/index.d.ts +0 -24
- package/es/loading/index.js +0 -18
- package/es/loading/style/index.css +0 -1
- package/es/loading/style/index.js +0 -3
- package/es/locales/en-US.js +0 -138
- package/es/locales/index.js +0 -25
- package/es/locales/zh-CN.js +0 -141
- package/es/locales/zh-Hant-HK.js +0 -141
- package/es/locales/zh-Hant-TW.js +0 -141
- package/es/menu/Item.js +0 -100
- package/es/menu/Menu.js +0 -420
- package/es/menu/SubMenu.js +0 -218
- package/es/menu/Title.js +0 -84
- package/es/menu/__tests__/index.test.js +0 -275
- package/es/menu/index.d.ts +0 -26
- package/es/menu/index.js +0 -24
- package/es/menu/style/index.css +0 -1
- package/es/menu/style/index.js +0 -3
- package/es/message/__tests__/index.test.js +0 -71
- package/es/message/index.d.ts +0 -18
- package/es/message/index.js +0 -70
- package/es/message/style/index.css +0 -1
- package/es/message/style/index.js +0 -5
- package/es/modal/__tests__/index.test.js +0 -178
- package/es/modal/index.d.ts +0 -33
- package/es/modal/index.js +0 -312
- package/es/modal/style/index.css +0 -1
- package/es/modal/style/index.js +0 -3
- package/es/notice/Notice.js +0 -138
- package/es/notice/NoticeContainer.js +0 -109
- package/es/notice/__tests__/index.test.js +0 -174
- package/es/notice/index.js +0 -66
- package/es/notice/style/index.css +0 -1
- package/es/notice/style/index.js +0 -5
- package/es/notification/HandleNotification/index.js +0 -220
- package/es/notification/HandleNotification/style/index.css +0 -1
- package/es/notification/HandleNotification/style/index.js +0 -5
- package/es/notification/__tests__/index.test.js +0 -114
- package/es/notification/index.d.ts +0 -25
- package/es/notification/index.js +0 -87
- package/es/notification/style/index.css +0 -1
- package/es/notification/style/index.js +0 -5
- package/es/pagination/Pager.js +0 -57
- package/es/pagination/Pagination.js +0 -538
- package/es/pagination/__tests__/index.test.js +0 -244
- package/es/pagination/index.d.ts +0 -20
- package/es/pagination/index.js +0 -18
- package/es/pagination/style/index.css +0 -1
- package/es/pagination/style/index.js +0 -5
- package/es/popover/__tests__/index.test.js +0 -152
- package/es/popover/index.d.ts +0 -14
- package/es/popover/index.js +0 -220
- package/es/popover/style/index.css +0 -1
- package/es/popover/style/index.js +0 -3
- package/es/popper/Overlay.js +0 -246
- package/es/popper/Portal.js +0 -42
- package/es/popper/index.js +0 -90
- package/es/popper/style/index.css +0 -1
- package/es/popper/style/index.js +0 -3
- package/es/popper/utils/popper.js +0 -311
- package/es/popper/utils/positionUtils.js +0 -314
- package/es/popper/utils/useClickOutside.js +0 -37
- package/es/popper/utils/useWaitForDOMRef.js +0 -56
- package/es/preview/index.d.ts +0 -16
- package/es/preview/index.js +0 -442
- package/es/preview/style/index.css +0 -1
- package/es/preview/style/index.js +0 -3
- package/es/progress/BarProgress.js +0 -157
- package/es/progress/CircleProgress.js +0 -49
- package/es/progress/DashboardProgress.js +0 -60
- package/es/progress/Progress.js +0 -111
- package/es/progress/__tests__/index.test.js +0 -131
- package/es/progress/index.d.ts +0 -18
- package/es/progress/index.js +0 -15
- package/es/progress/style/index.css +0 -1
- package/es/progress/style/index.js +0 -3
- package/es/radio/Group.js +0 -280
- package/es/radio/Radio.js +0 -167
- package/es/radio/__tests__/index.test.js +0 -128
- package/es/radio/index.d.ts +0 -32
- package/es/radio/index.js +0 -31
- package/es/radio/radio-legacy/__test__/index.test.js +0 -79
- package/es/radio/radio-legacy/index.js +0 -218
- package/es/radio/radio-legacy/style/index.css +0 -1
- package/es/radio/radio-legacy/style/index.js +0 -3
- package/es/radio/style/index.css +0 -1
- package/es/radio/style/index.js +0 -3
- package/es/rate/Icons.js +0 -294
- package/es/rate/Rate.js +0 -316
- package/es/rate/__tests__/index.test.js +0 -124
- package/es/rate/index.d.ts +0 -22
- package/es/rate/index.js +0 -15
- package/es/rate/style/index.css +0 -1
- package/es/rate/style/index.js +0 -3
- package/es/rich-text-editor/index.d.ts +0 -8
- package/es/rich-text-editor/index.js +0 -67
- package/es/rich-text-editor/style/index.css +0 -1
- package/es/rich-text-editor/style/index.js +0 -9
- package/es/search/index.d.ts +0 -23
- package/es/search/index.js +0 -264
- package/es/search/searchDropdown.js +0 -111
- package/es/search/style/index.css +0 -1
- package/es/search/style/index.js +0 -3
- package/es/select/MultipleInput.js +0 -163
- package/es/select/Select.js +0 -775
- package/es/select/SelectDropdown.js +0 -341
- package/es/select/SelectInput.js +0 -31
- package/es/select/SingleInput.js +0 -94
- package/es/select/__tests__/index.test.js +0 -505
- package/es/select/common.js +0 -19
- package/es/select/index.d.ts +0 -65
- package/es/select/index.js +0 -32
- package/es/select/select-legacy/select-v1/Option.js +0 -81
- package/es/select/select-legacy/select-v1/Select.js +0 -706
- package/es/select/select-legacy/select-v1/SelectDropdown.js +0 -160
- package/es/select/select-legacy/select-v1/SelectInput.js +0 -308
- package/es/select/select-legacy/select-v1/common.js +0 -19
- package/es/select/select-legacy/select-v1/index.js +0 -16
- package/es/select/select-legacy/select-v2/Select.js +0 -756
- package/es/select/select-legacy/select-v2/SelectDropdown.js +0 -322
- package/es/select/select-legacy/select-v2/SelectInput.js +0 -331
- package/es/select/select-legacy/select-v2/__tests__/index.test.js +0 -505
- package/es/select/select-legacy/select-v2/common.js +0 -19
- package/es/select/select-legacy/select-v2/index.js +0 -15
- package/es/select/select-legacy/select-v2/style/index.css +0 -1
- package/es/select/select-legacy/select-v2/style/index.js +0 -9
- package/es/select/select-legacy/select-v2/style/select-dropdown.css +0 -1
- package/es/select/select-legacy/select-v2/style/select-input.css +0 -1
- package/es/select/style/index.css +0 -1
- package/es/select/style/index.js +0 -9
- package/es/select/style/select-dropdown.css +0 -1
- package/es/select/style/select-input.css +0 -1
- package/es/select/utils.js +0 -72
- package/es/select-tree/SelectTreeHook.js +0 -788
- package/es/select-tree/components/Trigger.js +0 -85
- package/es/select-tree/components/tree/LoadingIcon.js +0 -38
- package/es/select-tree/components/tree/NavTree.js +0 -229
- package/es/select-tree/components/tree/TreeNode.js +0 -167
- package/es/select-tree/components/tree/context.js +0 -15
- package/es/select-tree/components/tree/index.js +0 -80
- package/es/select-tree/components/tree/style/index.css +0 -1
- package/es/select-tree/components/tree/style/index.js +0 -3
- package/es/select-tree/components/tree/util.js +0 -621
- package/es/select-tree/index.d.ts +0 -47
- package/es/select-tree/index.js +0 -15
- package/es/select-tree/keyEvents.js +0 -121
- package/es/select-tree/style/index.css +0 -1
- package/es/select-tree/style/index.js +0 -3
- package/es/slider/index.d.ts +0 -22
- package/es/slider/index.js +0 -491
- package/es/slider/style/index.css +0 -1
- package/es/slider/style/index.js +0 -3
- package/es/stepper/Stepper.js +0 -158
- package/es/stepper/__tests__/index.test.js +0 -161
- package/es/stepper/index.d.ts +0 -16
- package/es/stepper/index.js +0 -33
- package/es/stepper/style/index.css +0 -1
- package/es/stepper/style/index.js +0 -3
- package/es/style/icon/diyIcon.css +0 -1
- package/es/style/icon/index.css +0 -1
- package/es/switch/__tests__/index.test.js +0 -68
- package/es/switch/index.d.ts +0 -13
- package/es/switch/index.js +0 -21
- package/es/switch/style/index.css +0 -1
- package/es/switch/style/index.js +0 -3
- package/es/switch/switch-legacy/__tests__/index.test.js +0 -68
- package/es/switch/switch-legacy/index.js +0 -128
- package/es/switch/switch-legacy/style/index.css +0 -1
- package/es/switch/switch-legacy/style/index.js +0 -3
- package/es/switch/switch.js +0 -76
- package/es/table/AdvanceHeader/CustomFilter.js +0 -73
- package/es/table/AdvanceHeader/Sorter.js +0 -72
- package/es/table/AdvanceHeader/index.js +0 -41
- package/es/table/AdvanceHeader/select/index.js +0 -720
- package/es/table/AdvanceHeader/select/style/index.css +0 -1
- package/es/table/AdvanceHeader/select/style/index.js +0 -5
- package/es/table/AdvanceHeader/style/index.css +0 -1
- package/es/table/AdvanceHeader/style/index.js +0 -3
- package/es/table/BodyTable.js +0 -261
- package/es/table/Cell.js +0 -193
- package/es/table/ColumnMenu.js +0 -148
- package/es/table/Expandcol.js +0 -48
- package/es/table/HeaderTable.js +0 -359
- package/es/table/Indent.js +0 -27
- package/es/table/LoadingIcon.js +0 -38
- package/es/table/Row.js +0 -261
- package/es/table/SettingMenu.js +0 -205
- package/es/table/Table.js +0 -697
- package/es/table/context.js +0 -15
- package/es/table/hooks/useClickOutside.js +0 -23
- package/es/table/index.d.ts +0 -108
- package/es/table/index.js +0 -21
- package/es/table/style/Table.css +0 -1
- package/es/table/style/index.css +0 -1
- package/es/table/style/index.js +0 -3
- package/es/table/style/reset.css +0 -1
- package/es/table/style/variable.css +0 -0
- package/es/table/table-legacy/table-v2/Body.js +0 -298
- package/es/table/table-legacy/table-v2/ClickOuterside.js +0 -99
- package/es/table/table-legacy/table-v2/Footer.js +0 -174
- package/es/table/table-legacy/table-v2/Header.js +0 -319
- package/es/table/table-legacy/table-v2/TableContent.js +0 -105
- package/es/table/table-legacy/table-v2/__tests__/index.test.js +0 -129
- package/es/table/table-legacy/table-v2/checkbox/index.js +0 -98
- package/es/table/table-legacy/table-v2/checkbox/style/index.css +0 -1
- package/es/table/table-legacy/table-v2/checkbox/style/index.js +0 -3
- package/es/table/table-legacy/table-v2/index.js +0 -1466
- package/es/table/table-legacy/table-v2/menu/index.js +0 -110
- package/es/table/table-legacy/table-v2/prefix.js +0 -20
- package/es/table/table-legacy/table-v2/style/Table.css +0 -1
- package/es/table/table-legacy/table-v2/style/index.css +0 -1
- package/es/table/table-legacy/table-v2/style/index.js +0 -3
- package/es/table/table-legacy/table-v2/tool.js +0 -129
- package/es/table/util.js +0 -320
- package/es/tabs/ItemDropdown.js +0 -158
- package/es/tabs/TabItem.js +0 -116
- package/es/tabs/TabPane.js +0 -64
- package/es/tabs/Tabs.js +0 -576
- package/es/tabs/__tests__/index.test.js +0 -333
- package/es/tabs/hooks/useTabItems.js +0 -77
- package/es/tabs/hooks/useTranslate.js +0 -71
- package/es/tabs/index.d.ts +0 -47
- package/es/tabs/index.js +0 -38
- package/es/tabs/style/animate.css +0 -1
- package/es/tabs/style/index.css +0 -1
- package/es/tabs/style/index.js +0 -3
- package/es/tabs/tabs-legacy/ItemDropdown.js +0 -166
- package/es/tabs/tabs-legacy/TabPane.js +0 -74
- package/es/tabs/tabs-legacy/Tabs.js +0 -295
- package/es/tabs/tabs-legacy/index.js +0 -18
- package/es/tabs/tabs-legacy/style/index.css +0 -1
- package/es/tabs/tabs-legacy/style/index.js +0 -3
- package/es/tag/TagGroup.js +0 -235
- package/es/tag/TagItem.js +0 -116
- package/es/tag/__tests__/index.test.js +0 -46
- package/es/tag/index.d.ts +0 -32
- package/es/tag/index.js +0 -18
- package/es/tag/style/index.css +0 -1
- package/es/tag/style/index.js +0 -3
- package/es/timeline/__tests__/index.test.js +0 -198
- package/es/timeline/index.d.ts +0 -18
- package/es/timeline/index.js +0 -264
- package/es/timeline/style/index.css +0 -1
- package/es/timeline/style/index.js +0 -3
- package/es/tooltip/__tests__/index.test.js +0 -170
- package/es/tooltip/index.d.ts +0 -19
- package/es/tooltip/index.js +0 -210
- package/es/tooltip/style/index.css +0 -1
- package/es/tooltip/style/index.js +0 -3
- package/es/transfer/Item.js +0 -192
- package/es/transfer/Transfer.js +0 -562
- package/es/transfer/__tests__/index.test.js +0 -210
- package/es/transfer/img/switch.png +0 -0
- package/es/transfer/img/warning.png +0 -0
- package/es/transfer/index.d.ts +0 -25
- package/es/transfer/index.js +0 -16
- package/es/transfer/style/index.css +0 -1
- package/es/transfer/style/index.js +0 -3
- package/es/tree/BaseTree.js +0 -209
- package/es/tree/IconLoading.js +0 -38
- package/es/tree/Switcher.js +0 -42
- package/es/tree/Tree.js +0 -610
- package/es/tree/TreeNode.js +0 -326
- package/es/tree/context.js +0 -15
- package/es/tree/customTreeNode.js +0 -140
- package/es/tree/hooks/useCheckable.js +0 -153
- package/es/tree/hooks/useClickOutside.js +0 -26
- package/es/tree/hooks/useExpand.js +0 -46
- package/es/tree/hooks/useFlatData.js +0 -61
- package/es/tree/hooks/useSelect.js +0 -47
- package/es/tree/index.d.ts +0 -67
- package/es/tree/index.js +0 -21
- package/es/tree/style/index.css +0 -1
- package/es/tree/style/index.js +0 -3
- package/es/tree/tree-legacy/tree-v1/Tree.js +0 -333
- package/es/tree/tree-legacy/tree-v1/TreeDivider.js +0 -25
- package/es/tree/tree-legacy/tree-v1/TreeItem.js +0 -329
- package/es/tree/tree-legacy/tree-v1/TreeNode.js +0 -715
- package/es/tree/tree-legacy/tree-v1/index.js +0 -13
- package/es/tree/tree-legacy/tree-v1/style/index.css +0 -1
- package/es/tree/tree-legacy/tree-v1/style/index.js +0 -3
- package/es/tree/tree-legacy/tree-v1/util.js +0 -434
- package/es/tree/tree-legacy/tree-v2/IconLoading.js +0 -38
- package/es/tree/tree-legacy/tree-v2/Modal.js +0 -71
- package/es/tree/tree-legacy/tree-v2/Tree.js +0 -347
- package/es/tree/tree-legacy/tree-v2/TreeDivider.js +0 -25
- package/es/tree/tree-legacy/tree-v2/TreeItem.js +0 -439
- package/es/tree/tree-legacy/tree-v2/TreeNode.js +0 -909
- package/es/tree/tree-legacy/tree-v2/__tests__/index.test.js +0 -603
- package/es/tree/tree-legacy/tree-v2/index.js +0 -20
- package/es/tree/tree-legacy/tree-v2/style/index.css +0 -1
- package/es/tree/tree-legacy/tree-v2/style/index.js +0 -3
- package/es/tree/tree-legacy/tree-v2/util.js +0 -195
- package/es/tree/util.js +0 -131
- package/es/upload/AvatarUpload.js +0 -293
- package/es/upload/DragUpload.js +0 -194
- package/es/upload/FileSelect.js +0 -47
- package/es/upload/NormalUpload.js +0 -146
- package/es/upload/PictureListUpload.js +0 -147
- package/es/upload/PictureUpload.js +0 -233
- package/es/upload/Preview.js +0 -441
- package/es/upload/__tests__/index.test.js +0 -760
- package/es/upload/hooks/useUpload.js +0 -274
- package/es/upload/index.d.ts +0 -42
- package/es/upload/index.js +0 -44
- package/es/upload/request.js +0 -118
- package/es/upload/style/index.css +0 -1
- package/es/upload/style/index.js +0 -5
- package/es/upload/style/preview.css +0 -1
- package/es/upload/style/preview.js +0 -3
- package/es/upload/util.js +0 -55
- package/es/watermark/index.d.ts +0 -12
- package/es/watermark/index.js +0 -110
- package/es/watermark/watermark.js +0 -252
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
|
-
|
|
16
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
-
|
|
18
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
-
|
|
20
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
-
|
|
22
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
|
-
|
|
24
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
25
|
-
|
|
26
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
|
-
|
|
28
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
29
|
-
|
|
30
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
31
|
-
|
|
32
|
-
var _util = require("./util");
|
|
33
|
-
|
|
34
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
35
|
-
|
|
36
|
-
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; } }
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* 自定义属性全小写;原声属性驼峰法
|
|
40
|
-
* @prop type 输入框类型
|
|
41
|
-
*/
|
|
42
|
-
var Input = /*#__PURE__*/function (_Component) {
|
|
43
|
-
(0, _inherits2["default"])(Input, _Component);
|
|
44
|
-
|
|
45
|
-
var _super = _createSuper(Input);
|
|
46
|
-
|
|
47
|
-
function Input(props) {
|
|
48
|
-
var _this;
|
|
49
|
-
|
|
50
|
-
(0, _classCallCheck2["default"])(this, Input);
|
|
51
|
-
_this = _super.call(this, props); // 传入属性
|
|
52
|
-
|
|
53
|
-
var commonAttrs = {
|
|
54
|
-
type: 'text',
|
|
55
|
-
size: 'm',
|
|
56
|
-
prefixicon: '',
|
|
57
|
-
suffixicon: '',
|
|
58
|
-
prefix: '',
|
|
59
|
-
suffix: ''
|
|
60
|
-
};
|
|
61
|
-
var oldProps = Object.assign({}, commonAttrs, _this.props);
|
|
62
|
-
var newProps = (0, _util.getAttrs)(oldProps); // 分离有效属性和事件
|
|
63
|
-
|
|
64
|
-
_this.attrs = newProps.attrs;
|
|
65
|
-
var type = (0, _typeof2["default"])(_this.props.value);
|
|
66
|
-
var prefix = typeof _this.props.prefix === 'undefined' ? '' : _this.props.prefix;
|
|
67
|
-
var suffix = typeof _this.props.suffix === 'undefined' ? '' : _this.props.suffix;
|
|
68
|
-
_this.state = {
|
|
69
|
-
value: type === 'string' || type === 'number' ? (0, _util.format)(_this.props.value, _this.props.type) : '',
|
|
70
|
-
valueTrue: prefix + _this.props.value + suffix,
|
|
71
|
-
hover: false,
|
|
72
|
-
active: false
|
|
73
|
-
};
|
|
74
|
-
return _this;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
(0, _createClass2["default"])(Input, [{
|
|
78
|
-
key: "componentWillReceiveProps",
|
|
79
|
-
value: function componentWillReceiveProps(nextProps) {
|
|
80
|
-
if (nextProps.value !== undefined) {
|
|
81
|
-
if (nextProps.value !== this.state.value) {
|
|
82
|
-
this.setState({
|
|
83
|
-
value: (0, _util.format)(nextProps.value, this.props.type),
|
|
84
|
-
valueTrue: nextProps.value
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* 渲染 text 输入框
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
}, {
|
|
94
|
-
key: "renderText",
|
|
95
|
-
value: function renderText() {
|
|
96
|
-
var _this2 = this;
|
|
97
|
-
|
|
98
|
-
var _this$state = this.state,
|
|
99
|
-
hover = _this$state.hover,
|
|
100
|
-
active = _this$state.active,
|
|
101
|
-
value = _this$state.value;
|
|
102
|
-
var _this$props = this.props,
|
|
103
|
-
disabled = _this$props.disabled,
|
|
104
|
-
type = _this$props.type,
|
|
105
|
-
prefix = _this$props.prefix,
|
|
106
|
-
suffix = _this$props.suffix,
|
|
107
|
-
prepend = _this$props.prepend,
|
|
108
|
-
append = _this$props.append,
|
|
109
|
-
id = _this$props.id,
|
|
110
|
-
placeholder = _this$props.placeholder;
|
|
111
|
-
var noClear = ['textarea'];
|
|
112
|
-
var prefixId = id ? id + '_prefix' : '';
|
|
113
|
-
var suffixId = id ? id + '_suffix' : '';
|
|
114
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
115
|
-
className: (0, _classnames["default"])('hi-input__out', {
|
|
116
|
-
'hi-input--prepend': prepend,
|
|
117
|
-
'hi-input--append': append
|
|
118
|
-
})
|
|
119
|
-
}, // 前置元素
|
|
120
|
-
prepend && /*#__PURE__*/_react["default"].createElement("span", {
|
|
121
|
-
className: "hi-input__prepend"
|
|
122
|
-
}, prepend), /*#__PURE__*/_react["default"].createElement("div", {
|
|
123
|
-
className: "hi-input__inner".concat(active ? ' active' : '').concat(disabled ? ' disabled' : '')
|
|
124
|
-
}, // 前缀
|
|
125
|
-
prefix && /*#__PURE__*/_react["default"].createElement("span", {
|
|
126
|
-
id: prefixId,
|
|
127
|
-
className: "hi-input__prefix",
|
|
128
|
-
"data-value": prefix
|
|
129
|
-
}, prefix), /*#__PURE__*/_react["default"].createElement("input", (0, _extends2["default"])({
|
|
130
|
-
ref: function ref(arg) {
|
|
131
|
-
_this2._Input = arg;
|
|
132
|
-
},
|
|
133
|
-
className: "hi-input__text ".concat(disabled ? 'disabled' : ''),
|
|
134
|
-
value: this.state.value,
|
|
135
|
-
autoComplete: "off",
|
|
136
|
-
disabled: disabled
|
|
137
|
-
}, this.attrs, {
|
|
138
|
-
placeholder: placeholder,
|
|
139
|
-
onChange: function onChange(e) {
|
|
140
|
-
e.persist();
|
|
141
|
-
var value = e.target.value;
|
|
142
|
-
var valueTrue = (0, _util.formatValue)(value, type);
|
|
143
|
-
|
|
144
|
-
if (prefix) {
|
|
145
|
-
valueTrue = prefix + valueTrue;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (suffix) {
|
|
149
|
-
valueTrue = valueTrue + suffix;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
value = (0, _util.format)(value, type);
|
|
153
|
-
|
|
154
|
-
_this2.setState({
|
|
155
|
-
value: value,
|
|
156
|
-
valueTrue: valueTrue
|
|
157
|
-
}, function () {
|
|
158
|
-
_this2.props.onChange && _this2.props.onChange(e, valueTrue);
|
|
159
|
-
});
|
|
160
|
-
},
|
|
161
|
-
onBlur: function onBlur(e) {
|
|
162
|
-
e.persist();
|
|
163
|
-
var value = e.target.value;
|
|
164
|
-
var valueTrue = _this2.state.valueTrue; // amount 自动添加小数
|
|
165
|
-
|
|
166
|
-
if (_this2.props.type === 'amount' && value !== '') {
|
|
167
|
-
value = (0, _util.formatAmount)(value);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
_this2.setState({
|
|
171
|
-
active: false,
|
|
172
|
-
value: value
|
|
173
|
-
}, function () {
|
|
174
|
-
_this2.props.onBlur && _this2.props.onBlur(e, valueTrue);
|
|
175
|
-
});
|
|
176
|
-
},
|
|
177
|
-
onFocus: function onFocus(e) {
|
|
178
|
-
e.persist();
|
|
179
|
-
var valueTrue = _this2.state.valueTrue;
|
|
180
|
-
|
|
181
|
-
_this2.setState({
|
|
182
|
-
active: true
|
|
183
|
-
}, function () {
|
|
184
|
-
_this2.props.onFocus && _this2.props.onFocus(e, valueTrue);
|
|
185
|
-
});
|
|
186
|
-
},
|
|
187
|
-
onKeyDown: function onKeyDown(e) {
|
|
188
|
-
var valueTrue = _this2.state.valueTrue;
|
|
189
|
-
_this2.props.onKeyDown && _this2.props.onKeyDown(e, valueTrue);
|
|
190
|
-
},
|
|
191
|
-
onKeyUp: function onKeyUp(e) {
|
|
192
|
-
var valueTrue = _this2.state.valueTrue;
|
|
193
|
-
_this2.props.onKeyUp && _this2.props.onKeyUp(e, valueTrue);
|
|
194
|
-
},
|
|
195
|
-
onKeyPress: function onKeyPress(e) {
|
|
196
|
-
var valueTrue = _this2.state.valueTrue;
|
|
197
|
-
_this2.props.onKeyPress && _this2.props.onKeyPress(e, valueTrue);
|
|
198
|
-
},
|
|
199
|
-
onInput: function onInput(e) {
|
|
200
|
-
var valueTrue = _this2.state.valueTrue;
|
|
201
|
-
_this2.props.onInput && _this2.props.onInput(e, valueTrue);
|
|
202
|
-
}
|
|
203
|
-
})), // 清除
|
|
204
|
-
noClear.indexOf(type) === -1 && typeof prefix === 'undefined' && typeof suffix === 'undefined' && value !== '' && /*#__PURE__*/_react["default"].createElement("span", {
|
|
205
|
-
className: "hi-input__fix-box ".concat(hover && !disabled ? '' : 'invisible'),
|
|
206
|
-
onClick: function onClick() {
|
|
207
|
-
_this2._Input.focus();
|
|
208
|
-
|
|
209
|
-
var prefix = typeof _this2.props.prefix === 'undefined' ? '' : _this2.props.prefix;
|
|
210
|
-
var suffix = typeof _this2.props.suffix === 'undefined' ? '' : _this2.props.suffix;
|
|
211
|
-
var valueTrue = prefix + '' + suffix;
|
|
212
|
-
|
|
213
|
-
_this2.setState({
|
|
214
|
-
value: '',
|
|
215
|
-
valueTrue: valueTrue
|
|
216
|
-
}, function () {
|
|
217
|
-
var e = {
|
|
218
|
-
target: _this2._Input
|
|
219
|
-
};
|
|
220
|
-
_this2.props.onChange && _this2.props.onChange(e, '');
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
224
|
-
className: "hi-input__clear hi-input__suffix__icon hi-icon icon-close-circle"
|
|
225
|
-
})), // 后缀
|
|
226
|
-
suffix && /*#__PURE__*/_react["default"].createElement("span", {
|
|
227
|
-
id: suffixId,
|
|
228
|
-
className: "hi-input__suffix",
|
|
229
|
-
"data-value": suffix
|
|
230
|
-
}, suffix)), // 后置元素
|
|
231
|
-
append && /*#__PURE__*/_react["default"].createElement("span", {
|
|
232
|
-
className: "hi-input__append"
|
|
233
|
-
}, append));
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* 渲染 textarea
|
|
237
|
-
*/
|
|
238
|
-
|
|
239
|
-
}, {
|
|
240
|
-
key: "renderTextarea",
|
|
241
|
-
value: function renderTextarea() {
|
|
242
|
-
var _this3 = this;
|
|
243
|
-
|
|
244
|
-
var active = this.state.active;
|
|
245
|
-
var disabled = this.props.disabled;
|
|
246
|
-
return /*#__PURE__*/_react["default"].createElement("textarea", (0, _extends2["default"])({
|
|
247
|
-
className: "hi-input ".concat(active ? 'active' : '', " ").concat(disabled ? 'disabled' : ''),
|
|
248
|
-
style: this.props.style,
|
|
249
|
-
autoComplete: "off",
|
|
250
|
-
value: this.state.value,
|
|
251
|
-
disabled: disabled
|
|
252
|
-
}, this.attrs, {
|
|
253
|
-
onChange: function onChange(e) {
|
|
254
|
-
e.persist();
|
|
255
|
-
var valueTrue = e.target.value;
|
|
256
|
-
|
|
257
|
-
_this3.setState({
|
|
258
|
-
value: valueTrue,
|
|
259
|
-
valueTrue: valueTrue
|
|
260
|
-
}, function () {
|
|
261
|
-
_this3.props.onChange && _this3.props.onChange(e, valueTrue);
|
|
262
|
-
});
|
|
263
|
-
},
|
|
264
|
-
onBlur: function onBlur(e) {
|
|
265
|
-
e.persist();
|
|
266
|
-
var valueTrue = e.target.value;
|
|
267
|
-
|
|
268
|
-
_this3.setState({
|
|
269
|
-
active: false
|
|
270
|
-
}, function () {
|
|
271
|
-
_this3.props.onBlur && _this3.props.onBlur(e, valueTrue);
|
|
272
|
-
});
|
|
273
|
-
},
|
|
274
|
-
onFocus: function onFocus(e) {
|
|
275
|
-
e.persist();
|
|
276
|
-
var valueTrue = e.target.value;
|
|
277
|
-
|
|
278
|
-
_this3.setState({
|
|
279
|
-
active: true
|
|
280
|
-
}, function () {
|
|
281
|
-
_this3.props.onFocus && _this3.props.onFocus(e, valueTrue);
|
|
282
|
-
});
|
|
283
|
-
},
|
|
284
|
-
onKeyDown: function onKeyDown(e) {
|
|
285
|
-
var valueTrue = e.target.value;
|
|
286
|
-
_this3.props.onKeyDown && _this3.props.onKeyDown(e, valueTrue);
|
|
287
|
-
},
|
|
288
|
-
onKeyUp: function onKeyUp(e) {
|
|
289
|
-
var valueTrue = e.target.value;
|
|
290
|
-
_this3.props.onKeyUp && _this3.props.onKeyUp(e, valueTrue);
|
|
291
|
-
},
|
|
292
|
-
onKeyPress: function onKeyPress(e) {
|
|
293
|
-
var valueTrue = e.target.value;
|
|
294
|
-
_this3.props.onKeyPress && _this3.props.onKeyPress(e, valueTrue);
|
|
295
|
-
},
|
|
296
|
-
onInput: function onInput(e) {
|
|
297
|
-
var valueTrue = e.target.value;
|
|
298
|
-
_this3.props.onInput && _this3.props.onInput(e, valueTrue);
|
|
299
|
-
},
|
|
300
|
-
onMouseOver: function onMouseOver(e) {
|
|
301
|
-
_this3.setState({
|
|
302
|
-
hover: true
|
|
303
|
-
});
|
|
304
|
-
},
|
|
305
|
-
onMouseLeave: function onMouseLeave(e) {
|
|
306
|
-
_this3.setState({
|
|
307
|
-
hover: false
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
}));
|
|
311
|
-
}
|
|
312
|
-
}, {
|
|
313
|
-
key: "render",
|
|
314
|
-
value: function render() {
|
|
315
|
-
var _this4 = this;
|
|
316
|
-
|
|
317
|
-
var type = this.attrs.type;
|
|
318
|
-
var _this$props2 = this.props,
|
|
319
|
-
size = _this$props2.size,
|
|
320
|
-
id = _this$props2.id,
|
|
321
|
-
className = _this$props2.className,
|
|
322
|
-
required = _this$props2.required;
|
|
323
|
-
return type === 'textarea' ? this.renderTextarea() : /*#__PURE__*/_react["default"].createElement("div", {
|
|
324
|
-
id: id,
|
|
325
|
-
className: "hi-input ".concat(className || '', " ").concat(type || '').concat(size ? ' hi-input_' + size : '').concat(required ? ' required' : ''),
|
|
326
|
-
style: this.props.style,
|
|
327
|
-
"data-value": this.state.valueTrue,
|
|
328
|
-
onClick: function onClick(e) {
|
|
329
|
-
_this4._Input.focus();
|
|
330
|
-
},
|
|
331
|
-
onMouseOver: function onMouseOver(e) {
|
|
332
|
-
_this4.setState({
|
|
333
|
-
hover: true
|
|
334
|
-
});
|
|
335
|
-
},
|
|
336
|
-
onMouseLeave: function onMouseLeave(e) {
|
|
337
|
-
_this4.setState({
|
|
338
|
-
hover: false
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
}, this.renderText());
|
|
342
|
-
}
|
|
343
|
-
}]);
|
|
344
|
-
return Input;
|
|
345
|
-
}(_react.Component);
|
|
346
|
-
|
|
347
|
-
(0, _defineProperty2["default"])(Input, "_Input", '');
|
|
348
|
-
var _default = Input;
|
|
349
|
-
exports["default"] = _default;
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.formatValue = exports.formatAmount = exports.format = exports.formatCard = exports.formatTel = exports.formatId = exports.getAttrs = void 0;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 提取非函数属性
|
|
10
|
-
* @param {object} oldProps 原始props
|
|
11
|
-
*/
|
|
12
|
-
var getAttrs = function getAttrs(oldProps) {
|
|
13
|
-
var noNeed = ['value', 'className', 'class', 'id', 'style', 'size', 'disabled'];
|
|
14
|
-
var attrs = {};
|
|
15
|
-
var events = {};
|
|
16
|
-
|
|
17
|
-
for (var i in oldProps) {
|
|
18
|
-
if (!(oldProps[i] instanceof Function)) {
|
|
19
|
-
if (noNeed.indexOf(i) === -1) {
|
|
20
|
-
attrs[i] = oldProps[i];
|
|
21
|
-
}
|
|
22
|
-
} else {
|
|
23
|
-
events[i] = oldProps[i];
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
attrs: attrs,
|
|
29
|
-
events: events
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* 格式化身份证
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
exports.getAttrs = getAttrs;
|
|
38
|
-
|
|
39
|
-
var formatId = function formatId(val) {
|
|
40
|
-
val = val.replace(/[^a-zA-Z0-9]/g, '');
|
|
41
|
-
var len = val.length;
|
|
42
|
-
|
|
43
|
-
if (val === '' || len < 7) {
|
|
44
|
-
return val;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (len < 11) {
|
|
48
|
-
return val.slice(0, 6) + ' ' + val.slice(6, 10);
|
|
49
|
-
} else if (len < 15) {
|
|
50
|
-
return val.slice(0, 6) + ' ' + val.slice(6, 10) + ' ' + val.slice(10, 14);
|
|
51
|
-
} else {
|
|
52
|
-
return val.slice(0, 6) + ' ' + val.slice(6, 10) + ' ' + val.slice(10, 14) + ' ' + val.slice(14, 18);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* 格式化手机号
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
exports.formatId = formatId;
|
|
61
|
-
|
|
62
|
-
var formatTel = function formatTel(val) {
|
|
63
|
-
val = val.replace(/\D/g, '');
|
|
64
|
-
var len = val.length;
|
|
65
|
-
|
|
66
|
-
if (val === '' || len < 4) {
|
|
67
|
-
return val;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (len < 8) {
|
|
71
|
-
return val.slice(0, 3) + ' ' + val.slice(3, 7);
|
|
72
|
-
} else {
|
|
73
|
-
return val.slice(0, 3) + ' ' + val.slice(3, 7) + ' ' + val.slice(7, 11);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* 格式化银行卡号
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
exports.formatTel = formatTel;
|
|
82
|
-
|
|
83
|
-
var formatCard = function formatCard(val) {
|
|
84
|
-
val = val.replace(/\D/g, '');
|
|
85
|
-
var len = val.length;
|
|
86
|
-
|
|
87
|
-
if (val === '' || val.length < 5) {
|
|
88
|
-
return val;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (len < 5) {
|
|
92
|
-
return val.slice(0, 4);
|
|
93
|
-
} else if (len < 9) {
|
|
94
|
-
return val.slice(0, 4) + ' ' + val.slice(4, 8);
|
|
95
|
-
} else if (len < 13) {
|
|
96
|
-
return val.slice(0, 4) + ' ' + val.slice(4, 8) + ' ' + val.slice(8, 12);
|
|
97
|
-
} else if (len < 17) {
|
|
98
|
-
return val.slice(0, 4) + ' ' + val.slice(4, 8) + ' ' + val.slice(8, 12) + ' ' + val.slice(12, 16);
|
|
99
|
-
} else {
|
|
100
|
-
return val.slice(0, 4) + ' ' + val.slice(4, 8) + ' ' + val.slice(8, 12) + ' ' + val.slice(12, 16) + ' ' + val.slice(16, 19);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* 输入规则
|
|
105
|
-
* @param {string} val 需要处理的值
|
|
106
|
-
* @param {string} type 输入框类型
|
|
107
|
-
*/
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
exports.formatCard = formatCard;
|
|
111
|
-
|
|
112
|
-
var format = function format(val, type) {
|
|
113
|
-
switch (type) {
|
|
114
|
-
case 'id':
|
|
115
|
-
return formatId(val);
|
|
116
|
-
|
|
117
|
-
case 'tel':
|
|
118
|
-
return formatTel(val);
|
|
119
|
-
|
|
120
|
-
case 'card':
|
|
121
|
-
return formatCard(val);
|
|
122
|
-
|
|
123
|
-
case 'email':
|
|
124
|
-
return val.replace(/\W/g, '');
|
|
125
|
-
|
|
126
|
-
case 'amount':
|
|
127
|
-
val = val.replace(/[^\d|.|,]/g, '');
|
|
128
|
-
return val;
|
|
129
|
-
|
|
130
|
-
default:
|
|
131
|
-
return val;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* 金额自动生成小数
|
|
136
|
-
* @param {string} val 需要处理的值
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
exports.format = format;
|
|
141
|
-
|
|
142
|
-
var formatAmount = function formatAmount(val) {
|
|
143
|
-
return val.indexOf('.') > -1 ? val : val + '.00';
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* 净化数据
|
|
147
|
-
*/
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
exports.formatAmount = formatAmount;
|
|
151
|
-
|
|
152
|
-
var formatValue = function formatValue(val, type) {
|
|
153
|
-
var numberType = ['id', 'tel', 'amount', 'card'];
|
|
154
|
-
|
|
155
|
-
if (numberType.indexOf(type) > -1) {
|
|
156
|
-
var tmp = val.replace(/[^\d|.]/g, '');
|
|
157
|
-
|
|
158
|
-
switch (type) {
|
|
159
|
-
case 'id':
|
|
160
|
-
return tmp.slice(0, 18);
|
|
161
|
-
|
|
162
|
-
case 'tel':
|
|
163
|
-
return tmp.slice(0, 11);
|
|
164
|
-
|
|
165
|
-
case 'card':
|
|
166
|
-
return tmp.slice(0, 19);
|
|
167
|
-
|
|
168
|
-
default:
|
|
169
|
-
return tmp;
|
|
170
|
-
}
|
|
171
|
-
} else {
|
|
172
|
-
return val;
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
exports.formatValue = formatValue;
|
package/es/input/style/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
textarea.hi-input{display:block;-webkit-box-shadow:none;box-shadow:none;outline:none;color:var(--color-black);font-size:14px;min-height:32px;height:auto;line-height:22px;resize:vertical;overflow:auto;padding:4px 12px;border:1px solid var(--color-gray-30);-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:2px;background-color:var(--color-white);-webkit-transition:border-color 0.3s;transition:border-color 0.3s}textarea.hi-input:not(.disabled):hover{z-index:1;border-color:var(--color-primary)}textarea.hi-input.active{z-index:1;border-color:var(--color-primary)}textarea.hi-input.disabled{color:var(--color-gray-50);background-color:var(--color-gray-10);cursor:not-allowed}textarea.hi-input::-webkit-input-placeholder{color:var(--color-gray-50)}textarea.hi-input:-moz-placeholder{color:var(--color-gray-50)}textarea.hi-input::-moz-placeholder{color:var(--color-gray-50)}textarea.hi-input:-ms-input-placeholder{color:var(--color-gray-50)}.hi-input,.hi-input_m{position:relative;display:inline-block;width:100%;height:32px;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-input ::-webkit-input-placeholder,.hi-input_m ::-webkit-input-placeholder{color:var(--color-gray-50)}.hi-input :-moz-placeholder,.hi-input_m :-moz-placeholder{color:var(--color-gray-50)}.hi-input ::-moz-placeholder,.hi-input_m ::-moz-placeholder{color:var(--color-gray-50)}.hi-input :-ms-input-placeholder,.hi-input_m :-ms-input-placeholder{color:var(--color-gray-50)}.hi-input input,.hi-input_m input{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;border:none;outline:none;min-height:30px;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--color-black);font-size:14px;line-height:22px;-webkit-box-shadow:none;box-shadow:none}.hi-input input.disabled,.hi-input_m input.disabled{color:var(--color-gray-50);background-color:var(--color-gray-10);cursor:not-allowed}.hi-input input[type='search'],.hi-input_m input[type='search']{-webkit-appearance:none}.hi-input ::-webkit-search-cancel-button,.hi-input_m ::-webkit-search-cancel-button{display:none}.hi-input .hi-input__out,.hi-input_m .hi-input__out{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;height:100%}.hi-input .hi-input__inner,.hi-input_m .hi-input__inner{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:2px;background-color:var(--color-white);-webkit-transition:border-color 0.3s;transition:border-color 0.3s}.hi-input .hi-input__inner.bordered,.hi-input_m .hi-input__inner.bordered{border:1px solid var(--color-gray-30)}.hi-input .hi-input__inner:not(.disabled):hover,.hi-input_m .hi-input__inner:not(.disabled):hover{z-index:1;border-color:var(--color-primary)}.hi-input .hi-input__inner.active,.hi-input_m .hi-input__inner.active{z-index:1;border-color:var(--color-primary)}.hi-input .hi-input__inner.disabled,.hi-input_m .hi-input__inner.disabled{color:var(--color-gray-50);background-color:var(--color-gray-10)}.hi-input__fix-box,.hi-input_m__fix-box{display:inline-block;width:12px;height:auto;padding:0 18px 0 2px;-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;cursor:pointer;opacity:1;-webkit-transition:all 0.3s;transition:all 0.3s}.hi-input__fix-box.invisible,.hi-input_m__fix-box.invisible{visibility:hidden;opacity:0}.hi-input__fix-box .hi-input__clear,.hi-input_m__fix-box .hi-input__clear{display:block;border-radius:50%;color:var(--color-gray-50);font-size:22px;text-align:center}.hi-input__fix-box .hi-input__clear:hover,.hi-input_m__fix-box .hi-input__clear:hover{color:var(--color-black)}.hi-input__fix-box .hi-input__suffix__icon,.hi-input_m__fix-box .hi-input__suffix__icon{position:absolute;top:50%;width:14px;height:14px;line-height:14px;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:14px}.hi-input__text,.hi-input_m__text{width:100%;padding:4px 12px}.hi-input__prefix,.hi-input__suffix,.hi-input_m__prefix,.hi-input_m__suffix{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around;-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;color:var(--color-black);font-size:14px;line-height:30px}.hi-input__prefix,.hi-input_m__prefix{padding-left:12px}.hi-input__suffix,.hi-input_m__suffix{padding-right:12px}.hi-input--prepend .hi-input__inner,.hi-input_m--prepend .hi-input__inner{border-top-left-radius:0;border-bottom-left-radius:0}.hi-input__prepend,.hi-input_m__prepend{margin-right:-1px;z-index:1}.hi-input__prepend .hi-btn,.hi-input__prepend .hi-select__input,.hi-input_m__prepend .hi-btn,.hi-input_m__prepend .hi-select__input{border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:2px;border-bottom-left-radius:2px}.hi-input--append .hi-input__inner,.hi-input_m--append .hi-input__inner{border-top-right-radius:0;border-bottom-right-radius:0}.hi-input__append,.hi-input_m__append{color:var(--color-primary);margin-left:-1px}.hi-input__append .hi-btn,.hi-input__append .hi-select__input,.hi-input_m__append .hi-btn,.hi-input_m__append .hi-select__input{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px}.hi-input.required::after,.hi-input_m.required::after{position:absolute;top:0;content:'*';right:-30px;width:30px;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#f44343}
|