@pisell/materials 1.0.2 → 1.0.4
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -0
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.css +1 -0
- package/build/lowcode/view.js +11 -11
- package/es/components/auto-complete/index.d.ts +7 -0
- package/es/components/auto-complete/index.js +4 -0
- package/es/components/button/index.d.ts +8 -0
- package/es/components/button/index.js +15 -0
- package/es/components/calendar/index.d.ts +3 -0
- package/es/components/calendar/index.js +4 -0
- package/es/components/cascader/index.d.ts +2 -0
- package/es/components/cascader/index.js +6 -0
- package/es/components/checkbox/index.d.ts +3 -0
- package/es/components/checkbox/index.js +5 -0
- package/es/components/config-provider/index.d.ts +4 -0
- package/es/components/config-provider/index.js +30 -0
- package/es/components/date-picker/index.d.ts +3 -0
- package/es/components/date-picker/index.js +7 -0
- package/es/components/div/index.d.ts +7 -0
- package/es/components/div/index.js +10 -0
- package/es/components/drawer/index.d.ts +2 -0
- package/es/components/drawer/index.js +13 -0
- package/es/components/dropdown/index.d.ts +3 -0
- package/es/components/dropdown/index.js +13 -0
- package/es/components/form/index.d.ts +8 -0
- package/es/components/form/index.js +132 -0
- package/es/components/icon/index.d.ts +12 -0
- package/es/components/icon/index.js +40 -0
- package/es/components/iconfont/index.d.ts +6 -0
- package/es/components/iconfont/index.js +13 -0
- package/es/components/iconfont/index.less +0 -0
- package/es/components/input/index.d.ts +11 -0
- package/es/components/input/index.js +12 -0
- package/es/components/modal/index.d.ts +2 -0
- package/es/components/modal/index.js +18 -0
- package/es/components/radio/index.d.ts +3 -0
- package/es/components/radio/index.js +5 -0
- package/es/components/select/index.d.ts +7 -0
- package/es/components/select/index.js +4 -0
- package/es/components/skeleton/index.d.ts +3 -0
- package/es/components/skeleton/index.js +4 -0
- package/es/components/slider/index.d.ts +3 -0
- package/es/components/slider/index.js +16 -0
- package/es/components/table/Actions/Buttons/index.d.ts +3 -0
- package/es/components/table/Actions/Buttons/index.js +10 -0
- package/es/components/table/Actions/Buttons/index.less +30 -0
- package/es/components/table/Actions/Filter/FilterItem/index.d.ts +10 -0
- package/es/components/table/Actions/Filter/FilterItem/index.js +15 -0
- package/es/components/table/Actions/Filter/FilterItem/index.less +0 -0
- package/es/components/table/Actions/Filter/index.d.ts +12 -0
- package/es/components/table/Actions/Filter/index.js +15 -0
- package/es/components/table/Actions/Filter/index.less +0 -0
- package/es/components/table/Actions/Filter/items/index.d.ts +42 -0
- package/es/components/table/Actions/Filter/items/index.js +13 -0
- package/es/components/table/Actions/Filter/items/text/Editor/index.d.ts +3 -0
- package/es/components/table/Actions/Filter/items/text/Editor/index.js +10 -0
- package/es/components/table/Actions/Filter/items/text/Editor/index.less +0 -0
- package/es/components/table/Actions/Filter/items/text/Preview/index.d.ts +3 -0
- package/es/components/table/Actions/Filter/items/text/Preview/index.js +17 -0
- package/es/components/table/Actions/Filter/items/text/Preview/index.less +0 -0
- package/es/components/table/Actions/Filter/items/text/index.d.ts +12 -0
- package/es/components/table/Actions/Filter/items/text/index.js +13 -0
- package/es/components/table/Actions/Filter/items/text/index.less +0 -0
- package/es/components/table/Actions/index.d.ts +4 -0
- package/es/components/table/Actions/index.js +20 -0
- package/es/components/table/Actions/index.less +30 -0
- package/es/components/table/Pagination/index.d.ts +5 -0
- package/es/components/table/Pagination/index.js +35 -0
- package/es/components/table/Pagination/index.less +88 -0
- package/es/components/table/Table/AddFieldModal/index.d.ts +3 -0
- package/es/components/table/Table/AddFieldModal/index.js +140 -0
- package/es/components/table/Table/AddFieldModal/index.less +84 -0
- package/es/components/table/Table/SelectField/index.d.ts +3 -0
- package/es/components/table/Table/SelectField/index.js +89 -0
- package/es/components/table/Table/SelectField/index.less +97 -0
- package/es/components/table/Table/fields/index.d.ts +57 -0
- package/es/components/table/Table/fields/index.js +15 -0
- package/es/components/table/Table/fields/link/Editor/index.d.ts +3 -0
- package/es/components/table/Table/fields/link/Editor/index.js +10 -0
- package/es/components/table/Table/fields/link/Editor/index.less +0 -0
- package/es/components/table/Table/fields/link/Preview/index.d.ts +3 -0
- package/es/components/table/Table/fields/link/Preview/index.js +17 -0
- package/es/components/table/Table/fields/link/Preview/index.less +0 -0
- package/es/components/table/Table/fields/link/index.d.ts +12 -0
- package/es/components/table/Table/fields/link/index.js +13 -0
- package/es/components/table/Table/fields/link/index.less +0 -0
- package/es/components/table/Table/fields/text/Editor/index.d.ts +3 -0
- package/es/components/table/Table/fields/text/Editor/index.js +11 -0
- package/es/components/table/Table/fields/text/Editor/index.less +0 -0
- package/es/components/table/Table/fields/text/Preview/index.d.ts +3 -0
- package/es/components/table/Table/fields/text/Preview/index.js +18 -0
- package/es/components/table/Table/fields/text/Preview/index.less +0 -0
- package/es/components/table/Table/fields/text/index.d.ts +12 -0
- package/es/components/table/Table/fields/text/index.js +13 -0
- package/es/components/table/Table/fields/text/index.less +0 -0
- package/es/components/table/Table/index.d.ts +4 -0
- package/es/components/table/Table/index.js +136 -0
- package/es/components/table/Table/index.less +104 -0
- package/es/components/table/Table/tableConfig/SortRow/index.d.ts +4 -0
- package/es/components/table/Table/tableConfig/SortRow/index.js +39 -0
- package/es/components/table/Table/tableConfig/SortRow/index.less +0 -0
- package/es/components/table/Table/tableConfig/body/CellContent/index.d.ts +4 -0
- package/es/components/table/Table/tableConfig/body/CellContent/index.js +14 -0
- package/es/components/table/Table/tableConfig/body/CellContent/index.less +17 -0
- package/es/components/table/Table/tableConfig/body/CellProvider/index.d.ts +4 -0
- package/es/components/table/Table/tableConfig/body/CellProvider/index.js +136 -0
- package/es/components/table/Table/tableConfig/body/CellProvider/index.less +18 -0
- package/es/components/table/Table/tableConfig/body/index.d.ts +30 -0
- package/es/components/table/Table/tableConfig/body/index.js +48 -0
- package/es/components/table/Table/tableConfig/body/index.less +10 -0
- package/es/components/table/Table/tableConfig/header/CellProvider/index.d.ts +14 -0
- package/es/components/table/Table/tableConfig/header/CellProvider/index.js +26 -0
- package/es/components/table/Table/tableConfig/header/CellProvider/index.less +36 -0
- package/es/components/table/Table/tableConfig/header/index.d.ts +18 -0
- package/es/components/table/Table/tableConfig/header/index.js +53 -0
- package/es/components/table/Table/tableConfig/header/index.less +0 -0
- package/es/components/table/Table/tableConfig/summary/index.d.ts +3 -0
- package/es/components/table/Table/tableConfig/summary/index.js +18 -0
- package/es/components/table/Table/tableConfig/summary/index.less +0 -0
- package/es/components/table/index.d.ts +4 -0
- package/es/components/table/index.js +42 -0
- package/es/components/table/index.less +7 -0
- package/es/components/table/model.d.ts +16 -0
- package/es/components/table/model.js +96 -0
- package/es/components/tabs/index.d.ts +11 -0
- package/es/components/tabs/index.js +93 -0
- package/es/components/time-picker/index.d.ts +3 -0
- package/es/components/time-picker/index.js +4 -0
- package/es/components/tree-select/index.d.ts +2 -0
- package/es/components/tree-select/index.js +6 -0
- package/es/components/upload/index.d.ts +3 -0
- package/es/components/upload/index.js +4 -0
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/index.js +2 -0
- package/es/hooks/useSharedState.d.ts +11 -0
- package/es/hooks/useSharedState.js +18 -0
- package/{src/index.tsx → es/index.d.ts} +3 -81
- package/es/index.js +88 -0
- package/es/utils/hoc.d.ts +17 -0
- package/es/utils/hoc.js +81 -0
- package/es/utils/miniRedux.d.ts +17 -0
- package/es/utils/miniRedux.js +69 -0
- package/es/utils/warning.d.ts +1 -0
- package/es/utils/warning.js +6 -0
- package/lib/components/auto-complete/index.d.ts +7 -0
- package/lib/components/auto-complete/index.js +28 -0
- package/lib/components/button/index.d.ts +8 -0
- package/lib/components/button/index.js +47 -0
- package/lib/components/calendar/index.d.ts +3 -0
- package/lib/components/calendar/index.js +32 -0
- package/lib/components/cascader/index.d.ts +2 -0
- package/lib/components/cascader/index.js +28 -0
- package/lib/components/checkbox/index.d.ts +3 -0
- package/lib/components/checkbox/index.js +29 -0
- package/lib/components/config-provider/index.d.ts +4 -0
- package/lib/components/config-provider/index.js +54 -0
- package/lib/components/date-picker/index.d.ts +3 -0
- package/lib/components/date-picker/index.js +41 -0
- package/lib/components/div/index.d.ts +7 -0
- package/lib/components/div/index.js +40 -0
- package/lib/components/drawer/index.d.ts +2 -0
- package/lib/components/drawer/index.js +45 -0
- package/lib/components/dropdown/index.d.ts +3 -0
- package/lib/components/dropdown/index.js +45 -0
- package/lib/components/form/index.d.ts +8 -0
- package/lib/components/form/index.js +114 -0
- package/lib/components/icon/index.d.ts +12 -0
- package/lib/components/icon/index.js +52 -0
- package/lib/components/iconfont/index.d.ts +6 -0
- package/lib/components/iconfont/index.js +44 -0
- package/lib/components/iconfont/index.less +0 -0
- package/lib/components/input/index.d.ts +11 -0
- package/lib/components/input/index.js +38 -0
- package/lib/components/modal/index.d.ts +2 -0
- package/lib/components/modal/index.js +50 -0
- package/lib/components/radio/index.d.ts +3 -0
- package/lib/components/radio/index.js +29 -0
- package/lib/components/select/index.d.ts +7 -0
- package/lib/components/select/index.js +28 -0
- package/lib/components/skeleton/index.d.ts +3 -0
- package/lib/components/skeleton/index.js +28 -0
- package/lib/components/slider/index.d.ts +3 -0
- package/lib/components/slider/index.js +47 -0
- package/lib/components/table/Actions/Buttons/index.d.ts +3 -0
- package/lib/components/table/Actions/Buttons/index.js +43 -0
- package/lib/components/table/Actions/Buttons/index.less +30 -0
- package/lib/components/table/Actions/Filter/FilterItem/index.d.ts +10 -0
- package/lib/components/table/Actions/Filter/FilterItem/index.js +41 -0
- package/lib/components/table/Actions/Filter/FilterItem/index.less +0 -0
- package/lib/components/table/Actions/Filter/index.d.ts +12 -0
- package/lib/components/table/Actions/Filter/index.js +43 -0
- package/lib/components/table/Actions/Filter/index.less +0 -0
- package/lib/components/table/Actions/Filter/items/index.d.ts +42 -0
- package/lib/components/table/Actions/Filter/items/index.js +56 -0
- package/lib/components/table/Actions/Filter/items/text/Editor/index.d.ts +3 -0
- package/lib/components/table/Actions/Filter/items/text/Editor/index.js +29 -0
- package/lib/components/table/Actions/Filter/items/text/Editor/index.less +0 -0
- package/lib/components/table/Actions/Filter/items/text/Preview/index.d.ts +3 -0
- package/lib/components/table/Actions/Filter/items/text/Preview/index.js +38 -0
- package/lib/components/table/Actions/Filter/items/text/Preview/index.less +0 -0
- package/lib/components/table/Actions/Filter/items/text/index.d.ts +12 -0
- package/lib/components/table/Actions/Filter/items/text/index.js +47 -0
- package/lib/components/table/Actions/Filter/items/text/index.less +0 -0
- package/lib/components/table/Actions/index.d.ts +4 -0
- package/lib/components/table/Actions/index.js +42 -0
- package/lib/components/table/Actions/index.less +30 -0
- package/lib/components/table/Pagination/index.d.ts +5 -0
- package/lib/components/table/Pagination/index.js +62 -0
- package/lib/components/table/Pagination/index.less +88 -0
- package/lib/components/table/Table/AddFieldModal/index.d.ts +3 -0
- package/lib/components/table/Table/AddFieldModal/index.js +159 -0
- package/lib/components/table/Table/AddFieldModal/index.less +84 -0
- package/lib/components/table/Table/SelectField/index.d.ts +3 -0
- package/lib/components/table/Table/SelectField/index.js +124 -0
- package/lib/components/table/Table/SelectField/index.less +97 -0
- package/lib/components/table/Table/fields/index.d.ts +57 -0
- package/lib/components/table/Table/fields/index.js +58 -0
- package/lib/components/table/Table/fields/link/Editor/index.d.ts +3 -0
- package/lib/components/table/Table/fields/link/Editor/index.js +29 -0
- package/lib/components/table/Table/fields/link/Editor/index.less +0 -0
- package/lib/components/table/Table/fields/link/Preview/index.d.ts +3 -0
- package/lib/components/table/Table/fields/link/Preview/index.js +38 -0
- package/lib/components/table/Table/fields/link/Preview/index.less +0 -0
- package/lib/components/table/Table/fields/link/index.d.ts +12 -0
- package/lib/components/table/Table/fields/link/index.js +47 -0
- package/lib/components/table/Table/fields/link/index.less +0 -0
- package/lib/components/table/Table/fields/text/Editor/index.d.ts +3 -0
- package/lib/components/table/Table/fields/text/Editor/index.js +40 -0
- package/lib/components/table/Table/fields/text/Editor/index.less +0 -0
- package/lib/components/table/Table/fields/text/Preview/index.d.ts +3 -0
- package/lib/components/table/Table/fields/text/Preview/index.js +49 -0
- package/lib/components/table/Table/fields/text/Preview/index.less +0 -0
- package/lib/components/table/Table/fields/text/index.d.ts +12 -0
- package/lib/components/table/Table/fields/text/index.js +47 -0
- package/lib/components/table/Table/fields/text/index.less +0 -0
- package/lib/components/table/Table/index.d.ts +4 -0
- package/lib/components/table/Table/index.js +139 -0
- package/lib/components/table/Table/index.less +104 -0
- package/lib/components/table/Table/tableConfig/SortRow/index.d.ts +4 -0
- package/lib/components/table/Table/tableConfig/SortRow/index.js +58 -0
- package/lib/components/table/Table/tableConfig/SortRow/index.less +0 -0
- package/lib/components/table/Table/tableConfig/body/CellContent/index.d.ts +4 -0
- package/lib/components/table/Table/tableConfig/body/CellContent/index.js +49 -0
- package/lib/components/table/Table/tableConfig/body/CellContent/index.less +17 -0
- package/lib/components/table/Table/tableConfig/body/CellProvider/index.d.ts +4 -0
- package/lib/components/table/Table/tableConfig/body/CellProvider/index.js +141 -0
- package/lib/components/table/Table/tableConfig/body/CellProvider/index.less +18 -0
- package/lib/components/table/Table/tableConfig/body/index.d.ts +30 -0
- package/lib/components/table/Table/tableConfig/body/index.js +76 -0
- package/lib/components/table/Table/tableConfig/body/index.less +10 -0
- package/lib/components/table/Table/tableConfig/header/CellProvider/index.d.ts +14 -0
- package/lib/components/table/Table/tableConfig/header/CellProvider/index.js +49 -0
- package/lib/components/table/Table/tableConfig/header/CellProvider/index.less +36 -0
- package/lib/components/table/Table/tableConfig/header/index.d.ts +18 -0
- package/lib/components/table/Table/tableConfig/header/index.js +106 -0
- package/lib/components/table/Table/tableConfig/header/index.less +0 -0
- package/lib/components/table/Table/tableConfig/summary/index.d.ts +3 -0
- package/lib/components/table/Table/tableConfig/summary/index.js +47 -0
- package/lib/components/table/Table/tableConfig/summary/index.less +0 -0
- package/lib/components/table/index.d.ts +4 -0
- package/lib/components/table/index.js +59 -0
- package/lib/components/table/index.less +7 -0
- package/lib/components/table/model.d.ts +16 -0
- package/lib/components/table/model.js +134 -0
- package/lib/components/tabs/index.d.ts +11 -0
- package/lib/components/tabs/index.js +92 -0
- package/lib/components/time-picker/index.d.ts +3 -0
- package/lib/components/time-picker/index.js +31 -0
- package/lib/components/tree-select/index.d.ts +2 -0
- package/lib/components/tree-select/index.js +40 -0
- package/lib/components/upload/index.d.ts +3 -0
- package/lib/components/upload/index.js +28 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.js +39 -0
- package/lib/hooks/useSharedState.d.ts +11 -0
- package/lib/hooks/useSharedState.js +33 -0
- package/lib/index.d.ts +63 -0
- package/lib/index.js +225 -0
- package/lib/utils/hoc.d.ts +17 -0
- package/lib/utils/hoc.js +101 -0
- package/lib/utils/miniRedux.d.ts +17 -0
- package/lib/utils/miniRedux.js +86 -0
- package/lib/utils/warning.d.ts +1 -0
- package/lib/utils/warning.js +31 -0
- package/lowcode/alert/meta.ts +62 -62
- package/lowcode/card/meta.ts +33 -32
- package/lowcode/card/snippets.ts +46 -0
- package/lowcode/div/meta.ts +70 -0
- package/lowcode/table/meta.ts +131 -0
- package/lowcode/test/meta.ts +48 -0
- package/package.json +23 -4
- package/.fatherrc.ts +0 -7
- package/.tmp/assets-daily.json +0 -93
- package/.tmp/assets-dev.json +0 -93
- package/.tmp/assets-prod.json +0 -93
- package/.tmp/default.view.js +0 -24
- package/.tmp/index.jsx +0 -279
- package/.tmp/meta.js +0 -251
- package/.tmp/preview.jsx +0 -72
- package/.tmp/view.js +0 -25
- package/CHANGELOG.md +0 -13
- package/build.lowcode.js +0 -46
- package/src/components/auto-complete/index.tsx +0 -6
- package/src/components/button/index.tsx +0 -12
- package/src/components/calendar/index.tsx +0 -10
- package/src/components/cascader/index.tsx +0 -6
- package/src/components/checkbox/index.tsx +0 -7
- package/src/components/config-provider/index.tsx +0 -27
- package/src/components/date-picker/index.tsx +0 -22
- package/src/components/drawer/index.tsx +0 -13
- package/src/components/dropdown/index.tsx +0 -13
- package/src/components/form/index.tsx +0 -97
- package/src/components/icon/index.tsx +0 -34
- package/src/components/input/index.tsx +0 -18
- package/src/components/modal/index.tsx +0 -18
- package/src/components/radio/index.tsx +0 -7
- package/src/components/select/index.tsx +0 -6
- package/src/components/skeleton/index.tsx +0 -6
- package/src/components/slider/index.tsx +0 -18
- package/src/components/table/index.tsx +0 -10
- package/src/components/tabs/index.tsx +0 -67
- package/src/components/time-picker/index.tsx +0 -9
- package/src/components/tree-select/index.tsx +0 -8
- package/src/components/upload/index.tsx +0 -5
- package/src/utils/hoc.tsx +0 -92
- package/src/utils/warning.ts +0 -3
- package/tsconfig.json +0 -14
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
var _excluded = ["tab"];
|
|
2
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
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; }
|
|
7
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
+
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
10
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
12
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
13
|
+
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); }; }
|
|
14
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
15
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
18
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
21
|
+
import React, { Component } from 'react';
|
|
22
|
+
import { Tabs as OriginalTabs } from 'antd';
|
|
23
|
+
import { warning } from "../../utils/warning";
|
|
24
|
+
var Tabs = /*#__PURE__*/function (_Component) {
|
|
25
|
+
_inherits(Tabs, _Component);
|
|
26
|
+
var _super = _createSuper(Tabs);
|
|
27
|
+
function Tabs() {
|
|
28
|
+
var _this$props$activeKey;
|
|
29
|
+
var _this;
|
|
30
|
+
_classCallCheck(this, Tabs);
|
|
31
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32
|
+
args[_key] = arguments[_key];
|
|
33
|
+
}
|
|
34
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
35
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
36
|
+
activeKey: (_this$props$activeKey = _this.props.activeKey) !== null && _this$props$activeKey !== void 0 ? _this$props$activeKey : _this.props.defaultActiveKey
|
|
37
|
+
});
|
|
38
|
+
_defineProperty(_assertThisInitialized(_this), "_handleChange", function (key) {
|
|
39
|
+
_this.setActiveKey(key);
|
|
40
|
+
});
|
|
41
|
+
_defineProperty(_assertThisInitialized(_this), "setActiveKey", function (key) {
|
|
42
|
+
var _this$props$onChange = _this.props.onChange,
|
|
43
|
+
onChange = _this$props$onChange === void 0 ? function () {} : _this$props$onChange;
|
|
44
|
+
_this.setState({
|
|
45
|
+
activeKey: key
|
|
46
|
+
});
|
|
47
|
+
onChange(key);
|
|
48
|
+
});
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "getActiveKey", function () {
|
|
50
|
+
return _this.state.activeKey;
|
|
51
|
+
});
|
|
52
|
+
return _this;
|
|
53
|
+
}
|
|
54
|
+
_createClass(Tabs, [{
|
|
55
|
+
key: "render",
|
|
56
|
+
value: function render() {
|
|
57
|
+
var props = this.props;
|
|
58
|
+
var activeKey = this.state.activeKey;
|
|
59
|
+
var children = props.children;
|
|
60
|
+
var items = props.items;
|
|
61
|
+
|
|
62
|
+
// props.items 存在,只认 props.items
|
|
63
|
+
// 兼容代码:props.childrens 反推 props.items
|
|
64
|
+
if (!props.items && Array.isArray(children) && children.length > 0) {
|
|
65
|
+
warning('Tabs.TabPane is deprecated. Please use `items` directly.');
|
|
66
|
+
items = children.map(function (node) {
|
|
67
|
+
if ( /*#__PURE__*/React.isValidElement(node)) {
|
|
68
|
+
var key = node.key,
|
|
69
|
+
_props = node.props;
|
|
70
|
+
var _ref = _props || {},
|
|
71
|
+
tab = _ref.tab,
|
|
72
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
73
|
+
var item = _objectSpread(_objectSpread({
|
|
74
|
+
key: String(key)
|
|
75
|
+
}, restProps), {}, {
|
|
76
|
+
label: tab
|
|
77
|
+
});
|
|
78
|
+
return item;
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}).filter(Boolean);
|
|
82
|
+
}
|
|
83
|
+
return /*#__PURE__*/React.createElement(OriginalTabs, _extends({}, props, {
|
|
84
|
+
items: items,
|
|
85
|
+
activeKey: activeKey,
|
|
86
|
+
onChange: this._handleChange
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
}]);
|
|
90
|
+
return Tabs;
|
|
91
|
+
}(Component);
|
|
92
|
+
Tabs.TabPane = OriginalTabs.TabPane;
|
|
93
|
+
export default Tabs;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @title: 使用状态管理器的自定义钩子函数
|
|
4
|
+
* @description:
|
|
5
|
+
* @param {useMyContext} MyContext
|
|
6
|
+
* @return {*}
|
|
7
|
+
* @Author: zhiwei.Wang
|
|
8
|
+
* @Date: 2023-07-05 10:23
|
|
9
|
+
*/
|
|
10
|
+
declare const useSharedState: <T>(MyContext: Context<T>) => NonNullable<T>;
|
|
11
|
+
export default useSharedState;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @title: 使用状态管理器的自定义钩子函数
|
|
5
|
+
* @description:
|
|
6
|
+
* @param {useMyContext} MyContext
|
|
7
|
+
* @return {*}
|
|
8
|
+
* @Author: zhiwei.Wang
|
|
9
|
+
* @Date: 2023-07-05 10:23
|
|
10
|
+
*/
|
|
11
|
+
var useSharedState = function useSharedState(MyContext) {
|
|
12
|
+
var context = useContext(MyContext);
|
|
13
|
+
if (!context) {
|
|
14
|
+
throw new Error('useMyContext must be used within a MyStateProvider');
|
|
15
|
+
}
|
|
16
|
+
return context;
|
|
17
|
+
};
|
|
18
|
+
export default useSharedState;
|
|
@@ -1,141 +1,63 @@
|
|
|
1
1
|
export { Affix } from 'antd';
|
|
2
|
-
|
|
3
2
|
export { Anchor } from 'antd';
|
|
4
|
-
|
|
5
3
|
export { Alert } from 'antd';
|
|
6
|
-
|
|
7
4
|
export { Avatar } from 'antd';
|
|
8
|
-
|
|
9
5
|
export { Badge } from 'antd';
|
|
10
|
-
|
|
11
6
|
export { Breadcrumb } from 'antd';
|
|
12
|
-
|
|
13
7
|
export { Card } from 'antd';
|
|
14
|
-
|
|
15
8
|
export { Collapse } from 'antd';
|
|
16
|
-
|
|
17
9
|
export { Carousel } from 'antd';
|
|
18
|
-
|
|
19
|
-
// export { Cascader } from 'antd';
|
|
20
|
-
|
|
21
|
-
// export { Checkbox } from 'antd';
|
|
22
|
-
|
|
23
10
|
export { Col } from 'antd';
|
|
24
|
-
|
|
25
11
|
export { Descriptions } from 'antd';
|
|
26
|
-
|
|
27
12
|
export { Divider } from 'antd';
|
|
28
|
-
|
|
29
|
-
// export { Drawer } from 'antd';
|
|
30
|
-
|
|
31
13
|
export { Empty } from 'antd';
|
|
32
|
-
|
|
33
14
|
export { Grid } from 'antd';
|
|
34
|
-
|
|
35
|
-
// export { Input } from 'antd';
|
|
36
|
-
|
|
37
15
|
export { Image } from 'antd';
|
|
38
|
-
|
|
39
16
|
export { InputNumber } from 'antd';
|
|
40
|
-
|
|
41
17
|
export { List } from 'antd';
|
|
42
|
-
|
|
43
18
|
export { message } from 'antd';
|
|
44
|
-
|
|
45
19
|
export { Menu } from 'antd';
|
|
46
|
-
|
|
47
20
|
export { Mentions } from 'antd';
|
|
48
|
-
|
|
49
21
|
export { Statistic } from 'antd';
|
|
50
|
-
|
|
51
22
|
export { notification } from 'antd';
|
|
52
|
-
|
|
53
|
-
export { PageHeader } from 'antd';
|
|
54
|
-
|
|
55
23
|
export { Pagination } from 'antd';
|
|
56
|
-
|
|
57
24
|
export { Popconfirm } from 'antd';
|
|
58
|
-
|
|
59
25
|
export { Popover } from 'antd';
|
|
60
|
-
|
|
61
26
|
export { Progress } from 'antd';
|
|
62
|
-
|
|
63
|
-
// export { Radio } from 'antd';
|
|
64
|
-
|
|
65
27
|
export { Rate } from 'antd';
|
|
66
|
-
|
|
67
28
|
export { Result } from 'antd';
|
|
68
|
-
|
|
69
29
|
export { Row } from 'antd';
|
|
70
|
-
|
|
71
|
-
// export { Skeleton } from 'antd';
|
|
72
|
-
|
|
73
30
|
export { Space } from 'antd';
|
|
74
|
-
|
|
75
31
|
export { Spin } from 'antd';
|
|
76
|
-
|
|
77
32
|
export { Steps } from 'antd';
|
|
78
|
-
|
|
79
33
|
export { Switch } from 'antd';
|
|
80
|
-
|
|
81
34
|
export { Transfer } from 'antd';
|
|
82
|
-
|
|
83
35
|
export { Tree } from 'antd';
|
|
84
|
-
|
|
85
|
-
// export { TreeSelect } from 'antd';
|
|
86
|
-
|
|
87
|
-
// export { Tabs } from 'antd';
|
|
88
|
-
|
|
89
36
|
export { Tag } from 'antd';
|
|
90
|
-
|
|
91
37
|
export { Timeline } from 'antd';
|
|
92
|
-
|
|
93
38
|
export { Tooltip } from 'antd';
|
|
94
|
-
|
|
95
39
|
export { Typography } from 'antd';
|
|
96
|
-
|
|
97
40
|
export { version } from 'antd';
|
|
98
|
-
|
|
99
41
|
export { default as Skeleton } from './components/skeleton';
|
|
100
|
-
|
|
101
42
|
export { default as Checkbox } from './components/checkbox';
|
|
102
|
-
|
|
103
43
|
export { default as Button } from './components/button';
|
|
104
|
-
|
|
105
44
|
export { default as Radio } from './components/radio';
|
|
106
|
-
|
|
107
45
|
export { default as Upload } from './components/upload';
|
|
108
|
-
|
|
109
46
|
export { default as Icon } from './components/icon';
|
|
110
|
-
|
|
111
47
|
export { default as Form } from './components/form';
|
|
112
|
-
|
|
113
48
|
export { default as Dropdown } from './components/dropdown';
|
|
114
|
-
|
|
115
49
|
export { default as Calendar } from './components/calendar';
|
|
116
|
-
|
|
117
50
|
export { default as ConfigProvider } from './components/config-provider';
|
|
118
|
-
|
|
119
51
|
export { default as DatePicker } from './components/date-picker';
|
|
120
|
-
|
|
121
52
|
export { default as Tabs } from './components/tabs';
|
|
122
|
-
|
|
123
53
|
export { default as TimePicker } from './components/time-picker';
|
|
124
|
-
|
|
125
54
|
export { default as Slider } from './components/slider';
|
|
126
|
-
|
|
127
55
|
export { default as Table } from './components/table';
|
|
128
|
-
|
|
129
56
|
export { default as Modal } from './components/modal';
|
|
130
|
-
|
|
131
57
|
export { default as Drawer } from './components/drawer';
|
|
132
|
-
|
|
133
58
|
export { default as TreeSelect } from './components/tree-select';
|
|
134
|
-
|
|
135
59
|
export { default as Input } from './components/input';
|
|
136
|
-
|
|
137
|
-
export { default as Select } from './components/select'
|
|
138
|
-
|
|
60
|
+
export { default as Select } from './components/select';
|
|
139
61
|
export { default as Cascader } from './components/cascader';
|
|
140
|
-
|
|
141
|
-
export { default as
|
|
62
|
+
export { default as AutoComplete } from './components/auto-complete';
|
|
63
|
+
export { default as Div } from './components/div';
|
package/es/index.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export { Affix } from 'antd';
|
|
2
|
+
export { Anchor } from 'antd';
|
|
3
|
+
export { Alert } from 'antd';
|
|
4
|
+
export { Avatar } from 'antd';
|
|
5
|
+
export { Badge } from 'antd';
|
|
6
|
+
export { Breadcrumb } from 'antd';
|
|
7
|
+
export { Card } from 'antd';
|
|
8
|
+
export { Collapse } from 'antd';
|
|
9
|
+
export { Carousel } from 'antd';
|
|
10
|
+
|
|
11
|
+
// export { Cascader } from 'antd';
|
|
12
|
+
|
|
13
|
+
// export { Checkbox } from 'antd';
|
|
14
|
+
|
|
15
|
+
export { Col } from 'antd';
|
|
16
|
+
export { Descriptions } from 'antd';
|
|
17
|
+
export { Divider } from 'antd';
|
|
18
|
+
|
|
19
|
+
// export { Drawer } from 'antd';
|
|
20
|
+
|
|
21
|
+
export { Empty } from 'antd';
|
|
22
|
+
export { Grid } from 'antd';
|
|
23
|
+
|
|
24
|
+
// export { Input } from 'antd';
|
|
25
|
+
|
|
26
|
+
export { Image } from 'antd';
|
|
27
|
+
export { InputNumber } from 'antd';
|
|
28
|
+
export { List } from 'antd';
|
|
29
|
+
export { message } from 'antd';
|
|
30
|
+
export { Menu } from 'antd';
|
|
31
|
+
export { Mentions } from 'antd';
|
|
32
|
+
export { Statistic } from 'antd';
|
|
33
|
+
export { notification } from 'antd';
|
|
34
|
+
|
|
35
|
+
// export { PageHeader } from 'antd';
|
|
36
|
+
|
|
37
|
+
export { Pagination } from 'antd';
|
|
38
|
+
export { Popconfirm } from 'antd';
|
|
39
|
+
export { Popover } from 'antd';
|
|
40
|
+
export { Progress } from 'antd';
|
|
41
|
+
|
|
42
|
+
// export { Radio } from 'antd';
|
|
43
|
+
|
|
44
|
+
export { Rate } from 'antd';
|
|
45
|
+
export { Result } from 'antd';
|
|
46
|
+
export { Row } from 'antd';
|
|
47
|
+
|
|
48
|
+
// export { Skeleton } from 'antd';
|
|
49
|
+
|
|
50
|
+
export { Space } from 'antd';
|
|
51
|
+
export { Spin } from 'antd';
|
|
52
|
+
export { Steps } from 'antd';
|
|
53
|
+
export { Switch } from 'antd';
|
|
54
|
+
export { Transfer } from 'antd';
|
|
55
|
+
export { Tree } from 'antd';
|
|
56
|
+
|
|
57
|
+
// export { TreeSelect } from 'antd';
|
|
58
|
+
|
|
59
|
+
// export { Tabs } from 'antd';
|
|
60
|
+
|
|
61
|
+
export { Tag } from 'antd';
|
|
62
|
+
export { Timeline } from 'antd';
|
|
63
|
+
export { Tooltip } from 'antd';
|
|
64
|
+
export { Typography } from 'antd';
|
|
65
|
+
export { version } from 'antd';
|
|
66
|
+
export { default as Skeleton } from "./components/skeleton";
|
|
67
|
+
export { default as Checkbox } from "./components/checkbox";
|
|
68
|
+
export { default as Button } from "./components/button";
|
|
69
|
+
export { default as Radio } from "./components/radio";
|
|
70
|
+
export { default as Upload } from "./components/upload";
|
|
71
|
+
export { default as Icon } from "./components/icon";
|
|
72
|
+
export { default as Form } from "./components/form";
|
|
73
|
+
export { default as Dropdown } from "./components/dropdown";
|
|
74
|
+
export { default as Calendar } from "./components/calendar";
|
|
75
|
+
export { default as ConfigProvider } from "./components/config-provider";
|
|
76
|
+
export { default as DatePicker } from "./components/date-picker";
|
|
77
|
+
export { default as Tabs } from "./components/tabs";
|
|
78
|
+
export { default as TimePicker } from "./components/time-picker";
|
|
79
|
+
export { default as Slider } from "./components/slider";
|
|
80
|
+
export { default as Table } from "./components/table";
|
|
81
|
+
export { default as Modal } from "./components/modal";
|
|
82
|
+
export { default as Drawer } from "./components/drawer";
|
|
83
|
+
export { default as TreeSelect } from "./components/tree-select";
|
|
84
|
+
export { default as Input } from "./components/input";
|
|
85
|
+
export { default as Select } from "./components/select";
|
|
86
|
+
export { default as Cascader } from "./components/cascader";
|
|
87
|
+
export { default as AutoComplete } from "./components/auto-complete";
|
|
88
|
+
export { default as Div } from "./components/div";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 简单包装,不做任何处理
|
|
4
|
+
* 部分组件ref比较特殊,包一层会解决这个问题
|
|
5
|
+
*/
|
|
6
|
+
export declare function withWrap<T extends ComponentType<any>>(Comp: T): React.ForwardRefExoticComponent<React.PropsWithoutRef<React.ComponentProps<T>> & React.RefAttributes<any>>;
|
|
7
|
+
/**
|
|
8
|
+
* 某些组件会用React.Children.only检查子节点
|
|
9
|
+
* 需要做处理避免报错
|
|
10
|
+
*/
|
|
11
|
+
export declare function withSingleChild(Comp: ComponentType<any>, needsConvert?: string[]): (props: any) => JSX.Element;
|
|
12
|
+
export declare function withSingleFunctionChild(Comp: ComponentType<any>): (props: any) => JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* moment对象在序列化后会被转为字符串
|
|
15
|
+
* 需要让日期类组件支持接受字符串值
|
|
16
|
+
*/
|
|
17
|
+
export declare function withMomentProps(Comp: ComponentType<any>, needsConvert?: string[]): (props: any) => JSX.Element;
|
package/es/utils/hoc.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { get, set, has } from 'lodash';
|
|
5
|
+
function convertProps(props, list, mapper) {
|
|
6
|
+
var out = {};
|
|
7
|
+
list.forEach(function (key) {
|
|
8
|
+
if (has(props, key)) {
|
|
9
|
+
set(out, key, mapper(get(props, key), key));
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
return out;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 简单包装,不做任何处理
|
|
17
|
+
* 部分组件ref比较特殊,包一层会解决这个问题
|
|
18
|
+
*/
|
|
19
|
+
export function withWrap(Comp) {
|
|
20
|
+
return /*#__PURE__*/forwardRef(function (props, ref) {
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
return /*#__PURE__*/React.createElement(Comp, _extends({}, props, {
|
|
23
|
+
ref: ref
|
|
24
|
+
}));
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 某些组件会用React.Children.only检查子节点
|
|
30
|
+
* 需要做处理避免报错
|
|
31
|
+
*/
|
|
32
|
+
export function withSingleChild(Comp) {
|
|
33
|
+
var needsConvert = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['children'];
|
|
34
|
+
return function (props) {
|
|
35
|
+
var convertedProps = convertProps(props, needsConvert, function (prop) {
|
|
36
|
+
var node = React.Children.toArray(prop)[0];
|
|
37
|
+
if (node === null || _typeof(node) !== 'object') {
|
|
38
|
+
node = /*#__PURE__*/React.createElement("div", null, node);
|
|
39
|
+
}
|
|
40
|
+
return node;
|
|
41
|
+
});
|
|
42
|
+
return /*#__PURE__*/React.createElement(Comp, _extends({}, props, convertedProps));
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function withSingleFunctionChild(Comp) {
|
|
46
|
+
return function (props) {
|
|
47
|
+
var children = props.children;
|
|
48
|
+
var node;
|
|
49
|
+
if (typeof children === 'function') {
|
|
50
|
+
node = children;
|
|
51
|
+
}
|
|
52
|
+
if (Array.isArray(children) && children.length === 1 && typeof children[0] === 'function') {
|
|
53
|
+
node = children[0];
|
|
54
|
+
}
|
|
55
|
+
if (node) {
|
|
56
|
+
return /*#__PURE__*/React.createElement(Comp, props, node);
|
|
57
|
+
}
|
|
58
|
+
return /*#__PURE__*/React.createElement("div", null, children);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* moment对象在序列化后会被转为字符串
|
|
64
|
+
* 需要让日期类组件支持接受字符串值
|
|
65
|
+
*/
|
|
66
|
+
export function withMomentProps(Comp) {
|
|
67
|
+
var needsConvert = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['value', 'defaultValue'];
|
|
68
|
+
return function (props) {
|
|
69
|
+
var convertedProps = convertProps(props, needsConvert, function (prop) {
|
|
70
|
+
if (prop) {
|
|
71
|
+
if (Array.isArray(prop)) {
|
|
72
|
+
return prop.map(function (v) {
|
|
73
|
+
return moment.isMoment(v) ? v : moment(v);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return moment.isMoment(prop) ? prop : moment(prop);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return /*#__PURE__*/React.createElement(Comp, _extends({}, props, convertedProps));
|
|
80
|
+
};
|
|
81
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface MiniReduxProps<State, Namespace> {
|
|
3
|
+
namespace?: Namespace;
|
|
4
|
+
state?: State;
|
|
5
|
+
reducers?: any;
|
|
6
|
+
effects?: any;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: <State extends Record<string, any>, Namespace extends string>({ namespace, state, reducers, effects, }: MiniReduxProps<State, Namespace>) => {
|
|
9
|
+
Context: React.Context<{ [K in Namespace]: State; } & {
|
|
10
|
+
dispatch: (params: {
|
|
11
|
+
type: string;
|
|
12
|
+
payload: any;
|
|
13
|
+
}) => void;
|
|
14
|
+
}>;
|
|
15
|
+
Provider: (ComponentUi: any) => (props: any) => JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
import React, { createContext, useCallback, useReducer } from 'react';
|
|
15
|
+
export default (function (_ref2) {
|
|
16
|
+
var _ref2$namespace = _ref2.namespace,
|
|
17
|
+
namespace = _ref2$namespace === void 0 ? 'state' : _ref2$namespace,
|
|
18
|
+
state = _ref2.state,
|
|
19
|
+
_ref2$reducers = _ref2.reducers,
|
|
20
|
+
reducers = _ref2$reducers === void 0 ? {} : _ref2$reducers,
|
|
21
|
+
_ref2$effects = _ref2.effects,
|
|
22
|
+
effects = _ref2$effects === void 0 ? {} : _ref2$effects;
|
|
23
|
+
var Context = /*#__PURE__*/createContext({});
|
|
24
|
+
var Provider = function Provider(ComponentUi) {
|
|
25
|
+
var Components = function Components(props) {
|
|
26
|
+
var _objectSpread2, _ref5;
|
|
27
|
+
var _useReducer = useReducer(function (state, _ref3) {
|
|
28
|
+
var type = _ref3.type,
|
|
29
|
+
payload = _ref3.payload;
|
|
30
|
+
if (reducers[type]) {
|
|
31
|
+
return reducers[type](state, payload);
|
|
32
|
+
} else {
|
|
33
|
+
return state;
|
|
34
|
+
}
|
|
35
|
+
}, state),
|
|
36
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
37
|
+
providerState = _useReducer2[0],
|
|
38
|
+
dispatch = _useReducer2[1];
|
|
39
|
+
var _dispatch = useCallback(function (_ref4) {
|
|
40
|
+
var type = _ref4.type,
|
|
41
|
+
payload = _ref4.payload;
|
|
42
|
+
if (effects[type]) {
|
|
43
|
+
effects[type].call(null, payload, dispatch);
|
|
44
|
+
} else if (reducers[type]) {
|
|
45
|
+
dispatch({
|
|
46
|
+
type: type,
|
|
47
|
+
payload: payload
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}, []);
|
|
51
|
+
var _props = _objectSpread(_objectSpread({}, props), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, namespace, providerState), _defineProperty(_objectSpread2, "dispatch", _dispatch), _objectSpread2));
|
|
52
|
+
var _ref = null;
|
|
53
|
+
if (_props.forwardedRef) {
|
|
54
|
+
_ref = _props.forwardedRef;
|
|
55
|
+
delete _props.forwardedRef;
|
|
56
|
+
}
|
|
57
|
+
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
58
|
+
value: (_ref5 = {}, _defineProperty(_ref5, namespace, providerState), _defineProperty(_ref5, "dispatch", _dispatch), _ref5)
|
|
59
|
+
}, /*#__PURE__*/React.createElement(ComponentUi, _extends({}, _props, {
|
|
60
|
+
ref: _ref
|
|
61
|
+
})));
|
|
62
|
+
};
|
|
63
|
+
return Components;
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
Context: Context,
|
|
67
|
+
Provider: Provider
|
|
68
|
+
};
|
|
69
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const warning: (...args: any[]) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const AutoComplete: import("react").ForwardRefExoticComponent<Omit<import("antd").AutoCompleteProps<unknown, import("antd/es/select").DefaultOptionType | import("antd/es/select").BaseOptionType> & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
} & {
|
|
5
|
+
ref?: import("react").Ref<import("antd").RefSelectProps> | undefined;
|
|
6
|
+
}, "ref"> & import("react").RefAttributes<any>>;
|
|
7
|
+
export default AutoComplete;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/auto-complete/index.tsx
|
|
20
|
+
var auto_complete_exports = {};
|
|
21
|
+
__export(auto_complete_exports, {
|
|
22
|
+
default: () => auto_complete_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(auto_complete_exports);
|
|
25
|
+
var import_antd = require("antd");
|
|
26
|
+
var import_hoc = require("../../utils/hoc");
|
|
27
|
+
var AutoComplete = (0, import_hoc.withWrap)(import_antd.AutoComplete);
|
|
28
|
+
var auto_complete_default = AutoComplete;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ButtonProps as OriginalButtonProps } from "antd";
|
|
3
|
+
export interface ButtonProps extends OriginalButtonProps {
|
|
4
|
+
__designMode?: "design" | undefined;
|
|
5
|
+
href?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<any>>;
|
|
8
|
+
export default Button;
|