amis 1.9.0-beta.12 → 1.9.0-beta.15
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/lib/Schema.d.ts +4 -2
- package/lib/Schema.js.map +1 -1
- package/lib/SchemaRenderer.d.ts +2 -2
- package/lib/SchemaRenderer.js +3 -3
- package/lib/SchemaRenderer.js.map +2 -2
- package/lib/actions/Action.d.ts +8 -6
- package/lib/actions/Action.js.map +2 -2
- package/lib/actions/AjaxAction.d.ts +10 -7
- package/lib/actions/AjaxAction.js +27 -21
- package/lib/actions/AjaxAction.js.map +2 -2
- package/lib/actions/BreakAction.d.ts +2 -2
- package/lib/actions/BreakAction.js.map +1 -1
- package/lib/actions/BroadcastAction.d.ts +3 -3
- package/lib/actions/BroadcastAction.js +3 -2
- package/lib/actions/BroadcastAction.js.map +2 -2
- package/lib/actions/CmptAction.d.ts +2 -2
- package/lib/actions/CmptAction.js +7 -9
- package/lib/actions/CmptAction.js.map +2 -2
- package/lib/actions/ContinueAction.d.ts +2 -2
- package/lib/actions/ContinueAction.js.map +1 -1
- package/lib/actions/CopyAction.d.ts +7 -4
- package/lib/actions/CopyAction.js +8 -6
- package/lib/actions/CopyAction.js.map +2 -2
- package/lib/actions/CustomAction.d.ts +2 -2
- package/lib/actions/CustomAction.js.map +1 -1
- package/lib/actions/DialogAction.d.ts +14 -8
- package/lib/actions/DialogAction.js +6 -6
- package/lib/actions/DialogAction.js.map +2 -2
- package/lib/actions/DrawerAction.d.ts +3 -3
- package/lib/actions/DrawerAction.js.map +1 -1
- package/lib/actions/EmailAction.d.ts +10 -7
- package/lib/actions/EmailAction.js +4 -5
- package/lib/actions/EmailAction.js.map +2 -2
- package/lib/actions/LinkAction.d.ts +19 -11
- package/lib/actions/LinkAction.js +6 -5
- package/lib/actions/LinkAction.js.map +2 -2
- package/lib/actions/LoopAction.d.ts +6 -3
- package/lib/actions/LoopAction.js +22 -20
- package/lib/actions/LoopAction.js.map +2 -2
- package/lib/actions/PageAction.d.ts +8 -5
- package/lib/actions/PageAction.js +3 -2
- package/lib/actions/PageAction.js.map +2 -2
- package/lib/actions/ParallelAction.d.ts +2 -2
- package/lib/actions/ParallelAction.js.map +1 -1
- package/lib/actions/SwitchAction.d.ts +2 -2
- package/lib/actions/SwitchAction.js.map +1 -1
- package/lib/actions/ToastAction.d.ts +2 -2
- package/lib/actions/ToastAction.js +6 -4
- package/lib/actions/ToastAction.js.map +2 -2
- package/lib/components/Editor.d.ts +84 -84
- package/lib/components/InputBox.js +1 -1
- package/lib/components/InputBox.js.map +2 -2
- package/lib/components/Pagination.d.ts +1175 -0
- package/lib/components/Pagination.js +274 -0
- package/lib/components/Pagination.js.map +13 -0
- package/lib/components/PickerContainer.d.ts +1 -0
- package/lib/components/PickerContainer.js +3 -2
- package/lib/components/PickerContainer.js.map +2 -2
- package/lib/components/Rating.js +11 -9
- package/lib/components/Rating.js.map +2 -2
- package/lib/components/Select.js +3 -3
- package/lib/components/Select.js.map +2 -2
- package/lib/components/Tag.d.ts +148 -0
- package/lib/components/Tag.js +96 -0
- package/lib/components/Tag.js.map +13 -0
- package/lib/components/TooltipWrapper.d.ts +25 -21
- package/lib/components/TooltipWrapper.js +11 -1
- package/lib/components/TooltipWrapper.js.map +2 -2
- package/lib/components/TransferDropDown.d.ts +85 -84
- package/lib/components/TransferDropDown.js +2 -2
- package/lib/components/TransferDropDown.js.map +2 -2
- package/lib/components/Tree.d.ts +84 -84
- package/lib/components/formula/VariableList.d.ts +1 -0
- package/lib/components/formula/VariableList.js.map +2 -2
- package/lib/components/icons.js +2 -0
- package/lib/components/icons.js.map +2 -2
- package/lib/components/index.d.ts +4 -1
- package/lib/components/index.js +7 -1
- package/lib/components/index.js.map +2 -2
- package/lib/components/schema-editor/Array.d.ts +11 -0
- package/lib/components/schema-editor/Array.js +66 -0
- package/lib/components/schema-editor/Array.js.map +13 -0
- package/lib/components/schema-editor/Common.d.ts +29 -0
- package/lib/components/schema-editor/Common.js +69 -0
- package/lib/components/schema-editor/Common.js.map +13 -0
- package/lib/components/schema-editor/Item.d.ts +9 -0
- package/lib/components/schema-editor/Item.js +31 -0
- package/lib/components/schema-editor/Item.js.map +13 -0
- package/lib/components/schema-editor/Object.d.ts +44 -0
- package/lib/components/schema-editor/Object.js +191 -0
- package/lib/components/schema-editor/Object.js.map +13 -0
- package/lib/components/schema-editor/SchemaVariableList.d.ts +316 -0
- package/lib/components/schema-editor/SchemaVariableList.js +74 -0
- package/lib/components/schema-editor/SchemaVariableList.js.map +13 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.d.ts +305 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.js +32 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.js.map +13 -0
- package/lib/components/schema-editor/index.d.ts +520 -0
- package/lib/components/schema-editor/index.js +118 -0
- package/lib/components/schema-editor/index.js.map +13 -0
- package/lib/components/table/Cell.d.ts +930 -0
- package/lib/components/table/Cell.js +36 -0
- package/lib/components/table/Cell.js.map +13 -0
- package/lib/components/table/HeadCellDropDown.d.ts +514 -0
- package/lib/components/table/HeadCellDropDown.js +52 -0
- package/lib/components/table/HeadCellDropDown.js.map +13 -0
- package/lib/components/table/HeadCellFilter.d.ts +771 -0
- package/lib/components/table/HeadCellFilter.js +106 -0
- package/lib/components/table/HeadCellFilter.js.map +13 -0
- package/lib/components/table/HeadCellSelect.d.ts +672 -0
- package/lib/components/table/HeadCellSelect.js +46 -0
- package/lib/components/table/HeadCellSelect.js.map +13 -0
- package/lib/components/table/HeadCellSort.d.ts +498 -0
- package/lib/components/table/HeadCellSort.js +67 -0
- package/lib/components/table/HeadCellSort.js.map +13 -0
- package/lib/components/table/index.d.ts +1355 -0
- package/lib/components/table/index.js +1095 -0
- package/lib/components/table/index.js.map +13 -0
- package/lib/env.d.ts +2 -4
- package/lib/env.js.map +2 -2
- package/lib/factory.js +0 -95
- package/lib/factory.js.map +2 -2
- package/lib/icons/dot.js +11 -0
- package/lib/index.d.ts +6 -1
- package/lib/index.js +9 -2
- package/lib/index.js.map +2 -2
- package/lib/locale/de-DE.js +18 -1
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +18 -1
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +20 -1
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Action.js +0 -2
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/Carousel.d.ts +5 -1
- package/lib/renderers/Carousel.js +18 -5
- package/lib/renderers/Carousel.js.map +2 -2
- package/lib/renderers/Form/ButtonGroupSelect.d.ts +2 -0
- package/lib/renderers/Form/ButtonGroupSelect.js +7 -0
- package/lib/renderers/Form/ButtonGroupSelect.js.map +2 -2
- package/lib/renderers/Form/Checkbox.js +3 -4
- package/lib/renderers/Form/Checkbox.js.map +2 -2
- package/lib/renderers/Form/Checkboxes.d.ts +2 -1
- package/lib/renderers/Form/Checkboxes.js +19 -14
- package/lib/renderers/Form/Checkboxes.js.map +2 -2
- package/lib/renderers/Form/Combo.js +23 -4
- package/lib/renderers/Form/Combo.js.map +2 -2
- package/lib/renderers/Form/DiffEditor.d.ts +126 -18
- package/lib/renderers/Form/Editor.d.ts +412 -112
- package/lib/renderers/Form/Editor.js +10 -1
- package/lib/renderers/Form/Editor.js.map +2 -2
- package/lib/renderers/Form/InputExcel.js +6 -1
- package/lib/renderers/Form/InputExcel.js.map +2 -2
- package/lib/renderers/Form/InputFile.js +1 -2
- package/lib/renderers/Form/InputFile.js.map +2 -2
- package/lib/renderers/Form/InputTree.js +1 -1
- package/lib/renderers/Form/InputTree.js.map +2 -2
- package/lib/renderers/Form/Item.d.ts +0 -6
- package/lib/renderers/Form/JSONSchemaEditor.d.ts +41 -0
- package/lib/renderers/Form/JSONSchemaEditor.js +33 -0
- package/lib/renderers/Form/JSONSchemaEditor.js.map +13 -0
- package/lib/renderers/Form/ListSelect.d.ts +2 -0
- package/lib/renderers/Form/ListSelect.js +7 -0
- package/lib/renderers/Form/ListSelect.js.map +2 -2
- package/lib/renderers/Form/Options.js +1 -0
- package/lib/renderers/Form/Options.js.map +2 -2
- package/lib/renderers/Form/Select.js +12 -1
- package/lib/renderers/Form/Select.js.map +2 -2
- package/lib/renderers/Form/TabsTransfer.d.ts +1 -1
- package/lib/renderers/Form/TabsTransfer.js +2 -2
- package/lib/renderers/Form/TabsTransfer.js.map +2 -2
- package/lib/renderers/Form/TreeSelect.d.ts +4 -0
- package/lib/renderers/Form/TreeSelect.js +2 -2
- package/lib/renderers/Form/TreeSelect.js.map +2 -2
- package/lib/renderers/Form/wrapControl.js +10 -5
- package/lib/renderers/Form/wrapControl.js.map +2 -2
- package/lib/renderers/Pagination.d.ts +49 -30
- package/lib/renderers/Pagination.js +3 -132
- package/lib/renderers/Pagination.js.map +2 -2
- package/lib/renderers/Table/HeadCellSearchDropdown.js +0 -1
- package/lib/renderers/Table/HeadCellSearchDropdown.js.map +2 -2
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.d.ts +29 -0
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.js +158 -0
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.js.map +13 -0
- package/lib/renderers/Table-v2/TableCell.d.ts +6 -0
- package/lib/renderers/Table-v2/TableCell.js +28 -0
- package/lib/renderers/Table-v2/TableCell.js.map +13 -0
- package/lib/renderers/Table-v2/index.d.ts +256 -0
- package/lib/renderers/Table-v2/index.js +548 -0
- package/lib/renderers/Table-v2/index.js.map +13 -0
- package/lib/renderers/Tabs.js +1 -1
- package/lib/renderers/Tabs.js.map +2 -2
- package/lib/renderers/Tag.d.ts +66 -0
- package/lib/renderers/Tag.js +53 -0
- package/lib/renderers/Tag.js.map +13 -0
- package/lib/renderers/Wizard.js +3 -3
- package/lib/renderers/Wizard.js.map +2 -2
- package/lib/schemaExtend.js +24 -30
- package/lib/schemaExtend.js.map +2 -2
- package/lib/store/combo.d.ts +140 -20
- package/lib/store/form.d.ts +56 -8
- package/lib/store/formItem.d.ts +3 -1
- package/lib/store/formItem.js +3 -1
- package/lib/store/formItem.js.map +2 -2
- package/lib/store/index.js +2 -0
- package/lib/store/index.js.map +2 -2
- package/lib/store/table-v2.d.ts +308 -0
- package/lib/store/table-v2.js +452 -0
- package/lib/store/table-v2.js.map +13 -0
- package/lib/store/table.d.ts +112 -16
- package/lib/store/table.js +1 -1
- package/lib/store/table.js.map +2 -2
- package/lib/themes/ang-ie11.css +1686 -120
- package/lib/themes/ang.css +1807 -208
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +1667 -101
- package/lib/themes/antd.css +1789 -201
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +1662 -97
- package/lib/themes/cxd.css +1983 -394
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +1667 -101
- package/lib/themes/dark.css +1789 -201
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +1662 -97
- package/lib/themes/default.css +1983 -394
- package/lib/themes/default.css.map +1 -1
- package/lib/utils/DataSchema.d.ts +25 -0
- package/lib/utils/DataSchema.js +104 -0
- package/lib/utils/DataSchema.js.map +13 -0
- package/lib/utils/DataScope.d.ts +23 -0
- package/lib/utils/DataScope.js +140 -0
- package/lib/utils/DataScope.js.map +13 -0
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/handleAction.js.map +2 -2
- package/lib/utils/renderer-event.d.ts +8 -2
- package/lib/utils/renderer-event.js +102 -1
- package/lib/utils/renderer-event.js.map +2 -2
- package/package.json +3 -2
- package/schema.json +1476 -469
- package/scss/_properties.scss +69 -0
- package/scss/components/_button.scss +37 -39
- package/scss/components/_context-menu.scss +3 -18
- package/scss/components/_json-schema-editor.scss +126 -0
- package/scss/components/_pagination.scss +104 -23
- package/scss/components/_result-box.scss +2 -2
- package/scss/components/_table-v2.scss +912 -0
- package/scss/components/_tag.scss +177 -0
- package/scss/components/form/_selection.scss +1 -14
- package/scss/components/form/_text.scss +1 -1
- package/scss/themes/_antd-variables.scss +0 -13
- package/scss/themes/_common.scss +3 -0
- package/scss/themes/_cxd-variables.scss +7 -17
- package/scss/themes/_dark-variables.scss +0 -13
- package/scss/themes/cxd.scss +1 -1
- package/sdk/ang-ie11.css +2240 -227
- package/sdk/ang.css +2905 -859
- package/sdk/antd-ie11.css +2233 -220
- package/sdk/antd.css +2905 -870
- package/sdk/barcode.js +51 -51
- package/sdk/charts.js +14 -14
- package/sdk/codemirror.js +7 -7
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +2223 -211
- package/sdk/cxd.css +2911 -875
- package/sdk/dark-ie11.css +2233 -220
- package/sdk/dark.css +2905 -870
- package/sdk/exceljs.js +1 -1
- package/sdk/locale/de-DE.js +18 -1
- package/sdk/markdown.js +69 -69
- package/sdk/papaparse.js +1 -1
- package/sdk/renderers/Form/CityDB.js +1 -1
- package/sdk/rest.js +16 -16
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +2223 -211
- package/sdk/sdk.css +2911 -875
- package/sdk/sdk.js +1326 -1270
- package/sdk/thirds/hls.js/hls.js +1 -1
- package/sdk/thirds/mpegts.js/mpegts.js +1 -1
- package/sdk/tinymce.js +57 -57
- package/src/Schema.ts +7 -0
- package/src/SchemaRenderer.tsx +4 -5
- package/src/actions/Action.ts +7 -6
- package/src/actions/AjaxAction.ts +33 -24
- package/src/actions/BreakAction.ts +2 -2
- package/src/actions/BroadcastAction.ts +6 -5
- package/src/actions/CmptAction.ts +5 -6
- package/src/actions/ContinueAction.ts +2 -2
- package/src/actions/CopyAction.ts +14 -8
- package/src/actions/CustomAction.ts +2 -2
- package/src/actions/DialogAction.ts +16 -10
- package/src/actions/DrawerAction.ts +3 -3
- package/src/actions/EmailAction.ts +12 -12
- package/src/actions/LinkAction.ts +34 -14
- package/src/actions/LoopAction.ts +13 -8
- package/src/actions/PageAction.ts +9 -6
- package/src/actions/ParallelAction.ts +2 -2
- package/src/actions/SwitchAction.ts +2 -2
- package/src/actions/ToastAction.ts +9 -5
- package/src/components/InputBox.tsx +1 -0
- package/src/components/Pagination.tsx +446 -0
- package/src/components/PickerContainer.tsx +8 -5
- package/src/components/Rating.tsx +16 -9
- package/src/components/Select.tsx +3 -3
- package/src/components/Tag.tsx +179 -0
- package/src/components/TooltipWrapper.tsx +14 -1
- package/src/components/TransferDropDown.tsx +3 -0
- package/src/components/formula/VariableList.tsx +1 -0
- package/src/components/icons.tsx +2 -0
- package/src/components/index.tsx +7 -1
- package/src/components/schema-editor/Array.tsx +95 -0
- package/src/components/schema-editor/Common.tsx +138 -0
- package/src/components/schema-editor/Item.tsx +36 -0
- package/src/components/schema-editor/Object.tsx +299 -0
- package/src/components/schema-editor/SchemaVariableList.tsx +97 -0
- package/src/components/schema-editor/SchemaVariableListPicker.tsx +66 -0
- package/src/components/schema-editor/index.tsx +211 -0
- package/src/components/table/Cell.tsx +70 -0
- package/src/components/table/HeadCellDropDown.tsx +115 -0
- package/src/components/table/HeadCellFilter.tsx +193 -0
- package/src/components/table/HeadCellSelect.tsx +86 -0
- package/src/components/table/HeadCellSort.tsx +102 -0
- package/src/components/table/index.tsx +1681 -0
- package/src/env.tsx +7 -14
- package/src/factory.tsx +3 -106
- package/src/icons/dot.svg +11 -0
- package/src/index.tsx +8 -1
- package/src/locale/de-DE.ts +18 -1
- package/src/locale/en-US.ts +18 -1
- package/src/locale/zh-CN.ts +20 -1
- package/src/renderers/Action.tsx +1 -1
- package/src/renderers/Carousel.tsx +21 -6
- package/src/renderers/Form/ButtonGroupSelect.tsx +10 -1
- package/src/renderers/Form/Checkbox.tsx +4 -4
- package/src/renderers/Form/Checkboxes.tsx +31 -25
- package/src/renderers/Form/Combo.tsx +20 -4
- package/src/renderers/Form/Editor.tsx +15 -1
- package/src/renderers/Form/InputExcel.tsx +6 -1
- package/src/renderers/Form/InputFile.tsx +1 -2
- package/src/renderers/Form/InputTree.tsx +1 -1
- package/src/renderers/Form/JSONSchemaEditor.tsx +67 -0
- package/src/renderers/Form/ListSelect.tsx +9 -1
- package/src/renderers/Form/Options.tsx +1 -1
- package/src/renderers/Form/Select.tsx +7 -0
- package/src/renderers/Form/TabsTransfer.tsx +2 -2
- package/src/renderers/Form/TreeSelect.tsx +8 -1
- package/src/renderers/Form/wrapControl.tsx +11 -5
- package/src/renderers/Pagination.tsx +65 -253
- package/src/renderers/Table/HeadCellSearchDropdown.tsx +0 -1
- package/src/renderers/Table-v2/HeadCellSearchDropdown.tsx +244 -0
- package/src/renderers/Table-v2/TableCell.tsx +19 -0
- package/src/renderers/Table-v2/index.tsx +1140 -0
- package/src/renderers/Tabs.tsx +1 -1
- package/src/renderers/Tag.tsx +128 -0
- package/src/renderers/Wizard.tsx +3 -3
- package/src/schemaExtend.ts +24 -28
- package/src/store/formItem.ts +5 -1
- package/src/store/index.ts +2 -0
- package/src/store/table-v2.ts +646 -0
- package/src/store/table.ts +1 -1
- package/src/utils/DataSchema.ts +131 -0
- package/src/utils/DataScope.ts +190 -0
- package/src/utils/handleAction.ts +1 -1
- package/src/utils/renderer-event.ts +113 -2
@@ -0,0 +1,46 @@
|
|
1
|
+
"use strict";
|
2
|
+
/**
|
3
|
+
* @file table/HeadCellSelect
|
4
|
+
* @author fex
|
5
|
+
*/
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
7
|
+
exports.HeadCellSelect = void 0;
|
8
|
+
var tslib_1 = require("tslib");
|
9
|
+
var react_1 = (0, tslib_1.__importDefault)(require("react"));
|
10
|
+
var react_dom_1 = require("react-dom");
|
11
|
+
var theme_1 = require("../../theme");
|
12
|
+
var locale_1 = require("../../locale");
|
13
|
+
var HeadCellDropDown_1 = (0, tslib_1.__importDefault)(require("./HeadCellDropDown"));
|
14
|
+
var icons_1 = require("../icons");
|
15
|
+
var HeadCellSelect = /** @class */ (function (_super) {
|
16
|
+
(0, tslib_1.__extends)(HeadCellSelect, _super);
|
17
|
+
function HeadCellSelect(props) {
|
18
|
+
var _this = _super.call(this, props) || this;
|
19
|
+
_this.state = {
|
20
|
+
key: ''
|
21
|
+
};
|
22
|
+
return _this;
|
23
|
+
}
|
24
|
+
HeadCellSelect.prototype.render = function () {
|
25
|
+
var _this = this;
|
26
|
+
var _a = this.props, selections = _a.selections, allKeys = _a.keys, popOverContainer = _a.popOverContainer, cx = _a.classnames, ns = _a.classPrefix;
|
27
|
+
return (react_1.default.createElement(HeadCellDropDown_1.default, { className: "".concat(ns, "TableCell-selectionBtn"), layerClassName: "".concat(ns, "TableCell-selectionPopOver"), filterIcon: react_1.default.createElement(icons_1.Icon, { icon: "left-arrow", className: "icon" }), active: false, popOverContainer: popOverContainer ? popOverContainer : function () { return (0, react_dom_1.findDOMNode)(_this); }, filterDropdown: function (_a) {
|
28
|
+
var setSelectedKeys = _a.setSelectedKeys, selectedKeys = _a.selectedKeys, confirm = _a.confirm, clearFilters = _a.clearFilters;
|
29
|
+
return react_1.default.createElement("ul", { className: cx('DropDown-menu') }, selections.map(function (item, index) { return (react_1.default.createElement("li", { key: index, onClick: function () {
|
30
|
+
item.onSelect && item.onSelect(allKeys);
|
31
|
+
_this.handleClick(confirm, setSelectedKeys, item.key);
|
32
|
+
} }, item.text)); }));
|
33
|
+
}, setSelectedKeys: function (keys) { return _this.setState({ key: keys }); }, selectedKeys: this.state.key }));
|
34
|
+
};
|
35
|
+
HeadCellSelect.prototype.handleClick = function (confirm, setSelectedKeys, selectedKeys) {
|
36
|
+
setSelectedKeys && setSelectedKeys(selectedKeys);
|
37
|
+
confirm();
|
38
|
+
};
|
39
|
+
HeadCellSelect.defaultProps = {
|
40
|
+
selections: []
|
41
|
+
};
|
42
|
+
return HeadCellSelect;
|
43
|
+
}(react_1.default.Component));
|
44
|
+
exports.HeadCellSelect = HeadCellSelect;
|
45
|
+
exports.default = (0, theme_1.themeable)((0, locale_1.localeable)(HeadCellSelect));
|
46
|
+
//# sourceMappingURL=./components/table/HeadCellSelect.js.map
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"file": "HeadCellSelect.js",
|
4
|
+
"sourceRoot": "",
|
5
|
+
"sources": [
|
6
|
+
"/src/components/table/HeadCellSelect.tsx"
|
7
|
+
],
|
8
|
+
"names": [],
|
9
|
+
"mappings": ";AAAA;;;GAGG;;;;AAEH,6DAA0B;AAC1B,uCAAsC;AAEtC,qCAAkD;AAClD,uCAAqD;AACrD,qFAAmE;AAEnE,kCAA8B;AAY9B;IAAoC,+CAA6B;IAK/D,wBAAY,KAAY;QAAxB,YACE,kBAAM,KAAK,CAAC,SAKb;QAHC,KAAI,CAAC,KAAK,GAAG;YACX,GAAG,EAAE,EAAE;SACR,CAAA;;IACH,CAAC;IAED,+BAAM,GAAN;QAAA,iBAmCC;QAlCO,IAAA,KAMF,IAAI,CAAC,KAAK,EALZ,UAAU,gBAAA,EACJ,OAAO,UAAA,EACb,gBAAgB,sBAAA,EACJ,EAAE,gBAAA,EACD,EAAE,iBACH,CAAC;QAEf,OAAO,CACL,8BAAC,0BAAgB,IACf,SAAS,EAAE,UAAG,EAAE,2BAAwB,EACxC,cAAc,EAAE,UAAG,EAAE,+BAA4B,EACjD,UAAU,EAAE,8BAAC,YAAI,IAAC,IAAI,EAAC,YAAY,EAAC,SAAS,EAAC,MAAM,GAAG,EACvD,MAAM,EAAE,KAAK,EACb,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAM,OAAA,IAAA,uBAAW,EAAC,KAAI,CAAC,EAAjB,CAAiB,EAC/E,cAAc,EAAE,UAAC,EAAsD;oBAArD,eAAe,qBAAA,EAAE,YAAY,kBAAA,EAAE,OAAO,aAAA,EAAE,YAAY,kBAAA;gBACpE,OAAO,sCAAI,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,IACtC,UAAU,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,KAAK,IAAK,OAAA,CAC/B,sCACE,GAAG,EAAE,KAAK,EACV,OAAO,EAAE;wBACP,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;wBACxC,KAAI,CAAC,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;oBACvD,CAAC,IACA,IAAI,CAAC,IAAI,CACP,CACN,EATgC,CAShC,CAAC,CACC,CAAE;YACT,CAAC,EACD,eAAe,EAAE,UAAA,IAAI,IAAI,OAAA,KAAI,CAAC,QAAQ,CAAC,EAAC,GAAG,EAAE,IAAI,EAAC,CAAC,EAA1B,CAA0B,EACnD,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAEX,CACpB,CAAC;IACJ,CAAC;IAED,oCAAW,GAAX,UACE,OAA0C,EAC1C,eAA8E,EAC9E,YAAqC;QAEnC,eAAe,IAAI,eAAe,CAAC,YAAY,CAAC,CAAC;QAEjD,OAAO,EAAE,CAAC;IACd,CAAC;IAzDM,2BAAY,GAAG;QACpB,UAAU,EAAE,EAAE;KACf,CAAC;IAwDJ,qBAAC;CAAA,AA3DD,CAAoC,eAAK,CAAC,SAAS,GA2DlD;AA3DY,wCAAc;AA6D3B,kBAAe,IAAA,iBAAS,EAAC,IAAA,mBAAU,EAAC,cAAc,CAAC,CAAC,CAAC",
|
10
|
+
"sourcesContent": [
|
11
|
+
"/**\n * @file table/HeadCellSelect\n * @author fex\n */\n\nimport React from 'react';\nimport {findDOMNode} from 'react-dom';\n\nimport {themeable, ThemeProps} from '../../theme';\nimport {LocaleProps, localeable} from '../../locale';\nimport HeadCellDropDown, {FilterPayload} from './HeadCellDropDown';\nimport {RowSelectionOptionProps} from './index';\nimport {Icon} from '../icons';\n\nexport interface Props extends ThemeProps, LocaleProps {\n selections: Array<RowSelectionOptionProps>;\n keys: Array<string | number> | string;\n popOverContainer?: () => Element | Text | null;\n}\n\nexport interface State {\n key: Array<string | number> | string;\n}\n\nexport class HeadCellSelect extends React.Component<Props, State> {\n static defaultProps = {\n selections: []\n };\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n key: ''\n }\n }\n\n render() {\n const {\n selections,\n keys: allKeys,\n popOverContainer,\n classnames: cx,\n classPrefix: ns\n } = this.props;\n\n return (\n <HeadCellDropDown\n className={`${ns}TableCell-selectionBtn`}\n layerClassName={`${ns}TableCell-selectionPopOver`}\n filterIcon={<Icon icon=\"left-arrow\" className=\"icon\" />}\n active={false}\n popOverContainer={popOverContainer ? popOverContainer : () => findDOMNode(this)}\n filterDropdown={({setSelectedKeys, selectedKeys, confirm, clearFilters}) => {\n return <ul className={cx('DropDown-menu')}>\n {selections.map((item, index) => (\n <li\n key={index}\n onClick={() => {\n item.onSelect && item.onSelect(allKeys);\n this.handleClick(confirm, setSelectedKeys, item.key);\n }}>\n {item.text}\n </li>\n ))}\n </ul> ;\n }}\n setSelectedKeys={keys => this.setState({key: keys})}\n selectedKeys={this.state.key}\n >\n </HeadCellDropDown>\n );\n }\n\n handleClick(\n confirm: (payload?: FilterPayload) => void,\n setSelectedKeys?: (keys?: Array<string | number> | string) => void | undefined,\n selectedKeys?: Array<string> | string\n ) {\n setSelectedKeys && setSelectedKeys(selectedKeys);\n\n confirm();\n }\n}\n\nexport default themeable(localeable(HeadCellSelect));"
|
12
|
+
]
|
13
|
+
}
|
@@ -0,0 +1,498 @@
|
|
1
|
+
/**
|
2
|
+
* @file table/HeadCellSort
|
3
|
+
* @author fex
|
4
|
+
*/
|
5
|
+
/// <reference types="hoist-non-react-statics" />
|
6
|
+
import React from 'react';
|
7
|
+
import { ThemeProps } from '../../theme';
|
8
|
+
import { LocaleProps } from '../../locale';
|
9
|
+
export interface Props extends ThemeProps, LocaleProps {
|
10
|
+
column: any;
|
11
|
+
onSort?: Function;
|
12
|
+
}
|
13
|
+
export interface State {
|
14
|
+
order: string;
|
15
|
+
orderBy: string;
|
16
|
+
}
|
17
|
+
export declare class HeadCellSort extends React.Component<Props, State> {
|
18
|
+
constructor(props: Props);
|
19
|
+
render(): JSX.Element;
|
20
|
+
}
|
21
|
+
declare const _default: {
|
22
|
+
new (props: (Omit<Omit<Props, keyof LocaleProps> & {
|
23
|
+
locale?: string | undefined;
|
24
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
25
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps) | Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
26
|
+
locale?: string | undefined;
|
27
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
28
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>): {
|
29
|
+
render(): JSX.Element;
|
30
|
+
context: any;
|
31
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
32
|
+
locale?: string | undefined;
|
33
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
34
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
35
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
36
|
+
readonly props: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
37
|
+
locale?: string | undefined;
|
38
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
39
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps> & Readonly<{
|
40
|
+
children?: React.ReactNode;
|
41
|
+
}>;
|
42
|
+
state: Readonly<{}>;
|
43
|
+
refs: {
|
44
|
+
[key: string]: React.ReactInstance;
|
45
|
+
};
|
46
|
+
componentDidMount?(): void;
|
47
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
48
|
+
locale?: string | undefined;
|
49
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
50
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
51
|
+
componentWillUnmount?(): void;
|
52
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
53
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
54
|
+
locale?: string | undefined;
|
55
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
56
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, prevState: Readonly<{}>): any;
|
57
|
+
componentDidUpdate?(prevProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
58
|
+
locale?: string | undefined;
|
59
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
60
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
61
|
+
componentWillMount?(): void;
|
62
|
+
UNSAFE_componentWillMount?(): void;
|
63
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
64
|
+
locale?: string | undefined;
|
65
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
66
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextContext: any): void;
|
67
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
68
|
+
locale?: string | undefined;
|
69
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
70
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextContext: any): void;
|
71
|
+
componentWillUpdate?(nextProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
72
|
+
locale?: string | undefined;
|
73
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
74
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
75
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
76
|
+
locale?: string | undefined;
|
77
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
78
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
79
|
+
};
|
80
|
+
new (props: Omit<Omit<Props, keyof LocaleProps> & {
|
81
|
+
locale?: string | undefined;
|
82
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
83
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps, context: any): {
|
84
|
+
render(): JSX.Element;
|
85
|
+
context: any;
|
86
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
87
|
+
locale?: string | undefined;
|
88
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
89
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
90
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
91
|
+
readonly props: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
92
|
+
locale?: string | undefined;
|
93
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
94
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps> & Readonly<{
|
95
|
+
children?: React.ReactNode;
|
96
|
+
}>;
|
97
|
+
state: Readonly<{}>;
|
98
|
+
refs: {
|
99
|
+
[key: string]: React.ReactInstance;
|
100
|
+
};
|
101
|
+
componentDidMount?(): void;
|
102
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
103
|
+
locale?: string | undefined;
|
104
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
105
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
106
|
+
componentWillUnmount?(): void;
|
107
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
108
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
109
|
+
locale?: string | undefined;
|
110
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
111
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, prevState: Readonly<{}>): any;
|
112
|
+
componentDidUpdate?(prevProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
113
|
+
locale?: string | undefined;
|
114
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
115
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
116
|
+
componentWillMount?(): void;
|
117
|
+
UNSAFE_componentWillMount?(): void;
|
118
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
119
|
+
locale?: string | undefined;
|
120
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
121
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextContext: any): void;
|
122
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
123
|
+
locale?: string | undefined;
|
124
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
125
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextContext: any): void;
|
126
|
+
componentWillUpdate?(nextProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
127
|
+
locale?: string | undefined;
|
128
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
129
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
130
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Omit<Props, keyof LocaleProps> & {
|
131
|
+
locale?: string | undefined;
|
132
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
133
|
+
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
134
|
+
};
|
135
|
+
displayName: string;
|
136
|
+
contextType: React.Context<string>;
|
137
|
+
ComposedComponent: React.ComponentType<{
|
138
|
+
new (props: (Omit<Props, keyof LocaleProps> & {
|
139
|
+
locale?: string | undefined;
|
140
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
141
|
+
}) | Readonly<Omit<Props, keyof LocaleProps> & {
|
142
|
+
locale?: string | undefined;
|
143
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
144
|
+
}>): {
|
145
|
+
render(): JSX.Element;
|
146
|
+
context: any;
|
147
|
+
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Props, keyof LocaleProps> & {
|
148
|
+
locale?: string | undefined;
|
149
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
150
|
+
}>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
|
151
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
152
|
+
readonly props: Readonly<Omit<Props, keyof LocaleProps> & {
|
153
|
+
locale?: string | undefined;
|
154
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
155
|
+
}> & Readonly<{
|
156
|
+
children?: React.ReactNode;
|
157
|
+
}>;
|
158
|
+
state: Readonly<{}>;
|
159
|
+
refs: {
|
160
|
+
[key: string]: React.ReactInstance;
|
161
|
+
};
|
162
|
+
componentDidMount?(): void;
|
163
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
164
|
+
locale?: string | undefined;
|
165
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
166
|
+
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
167
|
+
componentWillUnmount?(): void;
|
168
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
169
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
170
|
+
locale?: string | undefined;
|
171
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
172
|
+
}>, prevState: Readonly<{}>): any;
|
173
|
+
componentDidUpdate?(prevProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
174
|
+
locale?: string | undefined;
|
175
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
176
|
+
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
177
|
+
componentWillMount?(): void;
|
178
|
+
UNSAFE_componentWillMount?(): void;
|
179
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
180
|
+
locale?: string | undefined;
|
181
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
182
|
+
}>, nextContext: any): void;
|
183
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
184
|
+
locale?: string | undefined;
|
185
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
186
|
+
}>, nextContext: any): void;
|
187
|
+
componentWillUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
188
|
+
locale?: string | undefined;
|
189
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
190
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
191
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
192
|
+
locale?: string | undefined;
|
193
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
194
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
195
|
+
};
|
196
|
+
new (props: Omit<Props, keyof LocaleProps> & {
|
197
|
+
locale?: string | undefined;
|
198
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
199
|
+
}, context: any): {
|
200
|
+
render(): JSX.Element;
|
201
|
+
context: any;
|
202
|
+
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Props, keyof LocaleProps> & {
|
203
|
+
locale?: string | undefined;
|
204
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
205
|
+
}>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
|
206
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
207
|
+
readonly props: Readonly<Omit<Props, keyof LocaleProps> & {
|
208
|
+
locale?: string | undefined;
|
209
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
210
|
+
}> & Readonly<{
|
211
|
+
children?: React.ReactNode;
|
212
|
+
}>;
|
213
|
+
state: Readonly<{}>;
|
214
|
+
refs: {
|
215
|
+
[key: string]: React.ReactInstance;
|
216
|
+
};
|
217
|
+
componentDidMount?(): void;
|
218
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
219
|
+
locale?: string | undefined;
|
220
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
221
|
+
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
222
|
+
componentWillUnmount?(): void;
|
223
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
224
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
225
|
+
locale?: string | undefined;
|
226
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
227
|
+
}>, prevState: Readonly<{}>): any;
|
228
|
+
componentDidUpdate?(prevProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
229
|
+
locale?: string | undefined;
|
230
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
231
|
+
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
232
|
+
componentWillMount?(): void;
|
233
|
+
UNSAFE_componentWillMount?(): void;
|
234
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
235
|
+
locale?: string | undefined;
|
236
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
237
|
+
}>, nextContext: any): void;
|
238
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
239
|
+
locale?: string | undefined;
|
240
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
241
|
+
}>, nextContext: any): void;
|
242
|
+
componentWillUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
243
|
+
locale?: string | undefined;
|
244
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
245
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
246
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
247
|
+
locale?: string | undefined;
|
248
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
249
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
250
|
+
};
|
251
|
+
displayName: string;
|
252
|
+
contextType: React.Context<string>;
|
253
|
+
ComposedComponent: React.ComponentType<typeof HeadCellSort>;
|
254
|
+
} & import("hoist-non-react-statics").NonReactStatics<typeof HeadCellSort, {}> & {
|
255
|
+
ComposedComponent: typeof HeadCellSort;
|
256
|
+
}>;
|
257
|
+
} & import("hoist-non-react-statics").NonReactStatics<{
|
258
|
+
new (props: (Omit<Props, keyof LocaleProps> & {
|
259
|
+
locale?: string | undefined;
|
260
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
261
|
+
}) | Readonly<Omit<Props, keyof LocaleProps> & {
|
262
|
+
locale?: string | undefined;
|
263
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
264
|
+
}>): {
|
265
|
+
render(): JSX.Element;
|
266
|
+
context: any;
|
267
|
+
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Props, keyof LocaleProps> & {
|
268
|
+
locale?: string | undefined;
|
269
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
270
|
+
}>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
|
271
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
272
|
+
readonly props: Readonly<Omit<Props, keyof LocaleProps> & {
|
273
|
+
locale?: string | undefined;
|
274
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
275
|
+
}> & Readonly<{
|
276
|
+
children?: React.ReactNode;
|
277
|
+
}>;
|
278
|
+
state: Readonly<{}>;
|
279
|
+
refs: {
|
280
|
+
[key: string]: React.ReactInstance;
|
281
|
+
};
|
282
|
+
componentDidMount?(): void;
|
283
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
284
|
+
locale?: string | undefined;
|
285
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
286
|
+
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
287
|
+
componentWillUnmount?(): void;
|
288
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
289
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
290
|
+
locale?: string | undefined;
|
291
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
292
|
+
}>, prevState: Readonly<{}>): any;
|
293
|
+
componentDidUpdate?(prevProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
294
|
+
locale?: string | undefined;
|
295
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
296
|
+
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
297
|
+
componentWillMount?(): void;
|
298
|
+
UNSAFE_componentWillMount?(): void;
|
299
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
300
|
+
locale?: string | undefined;
|
301
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
302
|
+
}>, nextContext: any): void;
|
303
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
304
|
+
locale?: string | undefined;
|
305
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
306
|
+
}>, nextContext: any): void;
|
307
|
+
componentWillUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
308
|
+
locale?: string | undefined;
|
309
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
310
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
311
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
312
|
+
locale?: string | undefined;
|
313
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
314
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
315
|
+
};
|
316
|
+
new (props: Omit<Props, keyof LocaleProps> & {
|
317
|
+
locale?: string | undefined;
|
318
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
319
|
+
}, context: any): {
|
320
|
+
render(): JSX.Element;
|
321
|
+
context: any;
|
322
|
+
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Props, keyof LocaleProps> & {
|
323
|
+
locale?: string | undefined;
|
324
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
325
|
+
}>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
|
326
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
327
|
+
readonly props: Readonly<Omit<Props, keyof LocaleProps> & {
|
328
|
+
locale?: string | undefined;
|
329
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
330
|
+
}> & Readonly<{
|
331
|
+
children?: React.ReactNode;
|
332
|
+
}>;
|
333
|
+
state: Readonly<{}>;
|
334
|
+
refs: {
|
335
|
+
[key: string]: React.ReactInstance;
|
336
|
+
};
|
337
|
+
componentDidMount?(): void;
|
338
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
339
|
+
locale?: string | undefined;
|
340
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
341
|
+
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
342
|
+
componentWillUnmount?(): void;
|
343
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
344
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
345
|
+
locale?: string | undefined;
|
346
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
347
|
+
}>, prevState: Readonly<{}>): any;
|
348
|
+
componentDidUpdate?(prevProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
349
|
+
locale?: string | undefined;
|
350
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
351
|
+
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
352
|
+
componentWillMount?(): void;
|
353
|
+
UNSAFE_componentWillMount?(): void;
|
354
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
355
|
+
locale?: string | undefined;
|
356
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
357
|
+
}>, nextContext: any): void;
|
358
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
359
|
+
locale?: string | undefined;
|
360
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
361
|
+
}>, nextContext: any): void;
|
362
|
+
componentWillUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
363
|
+
locale?: string | undefined;
|
364
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
365
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
366
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
367
|
+
locale?: string | undefined;
|
368
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
369
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
370
|
+
};
|
371
|
+
displayName: string;
|
372
|
+
contextType: React.Context<string>;
|
373
|
+
ComposedComponent: React.ComponentType<typeof HeadCellSort>;
|
374
|
+
} & import("hoist-non-react-statics").NonReactStatics<typeof HeadCellSort, {}> & {
|
375
|
+
ComposedComponent: typeof HeadCellSort;
|
376
|
+
}, {}> & {
|
377
|
+
ComposedComponent: {
|
378
|
+
new (props: (Omit<Props, keyof LocaleProps> & {
|
379
|
+
locale?: string | undefined;
|
380
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
381
|
+
}) | Readonly<Omit<Props, keyof LocaleProps> & {
|
382
|
+
locale?: string | undefined;
|
383
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
384
|
+
}>): {
|
385
|
+
render(): JSX.Element;
|
386
|
+
context: any;
|
387
|
+
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Props, keyof LocaleProps> & {
|
388
|
+
locale?: string | undefined;
|
389
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
390
|
+
}>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
|
391
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
392
|
+
readonly props: Readonly<Omit<Props, keyof LocaleProps> & {
|
393
|
+
locale?: string | undefined;
|
394
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
395
|
+
}> & Readonly<{
|
396
|
+
children?: React.ReactNode;
|
397
|
+
}>;
|
398
|
+
state: Readonly<{}>;
|
399
|
+
refs: {
|
400
|
+
[key: string]: React.ReactInstance;
|
401
|
+
};
|
402
|
+
componentDidMount?(): void;
|
403
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
404
|
+
locale?: string | undefined;
|
405
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
406
|
+
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
407
|
+
componentWillUnmount?(): void;
|
408
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
409
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
410
|
+
locale?: string | undefined;
|
411
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
412
|
+
}>, prevState: Readonly<{}>): any;
|
413
|
+
componentDidUpdate?(prevProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
414
|
+
locale?: string | undefined;
|
415
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
416
|
+
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
417
|
+
componentWillMount?(): void;
|
418
|
+
UNSAFE_componentWillMount?(): void;
|
419
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
420
|
+
locale?: string | undefined;
|
421
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
422
|
+
}>, nextContext: any): void;
|
423
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
424
|
+
locale?: string | undefined;
|
425
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
426
|
+
}>, nextContext: any): void;
|
427
|
+
componentWillUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
428
|
+
locale?: string | undefined;
|
429
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
430
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
431
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
432
|
+
locale?: string | undefined;
|
433
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
434
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
435
|
+
};
|
436
|
+
new (props: Omit<Props, keyof LocaleProps> & {
|
437
|
+
locale?: string | undefined;
|
438
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
439
|
+
}, context: any): {
|
440
|
+
render(): JSX.Element;
|
441
|
+
context: any;
|
442
|
+
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Props, keyof LocaleProps> & {
|
443
|
+
locale?: string | undefined;
|
444
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
445
|
+
}>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
|
446
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
447
|
+
readonly props: Readonly<Omit<Props, keyof LocaleProps> & {
|
448
|
+
locale?: string | undefined;
|
449
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
450
|
+
}> & Readonly<{
|
451
|
+
children?: React.ReactNode;
|
452
|
+
}>;
|
453
|
+
state: Readonly<{}>;
|
454
|
+
refs: {
|
455
|
+
[key: string]: React.ReactInstance;
|
456
|
+
};
|
457
|
+
componentDidMount?(): void;
|
458
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
459
|
+
locale?: string | undefined;
|
460
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
461
|
+
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
462
|
+
componentWillUnmount?(): void;
|
463
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
464
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
465
|
+
locale?: string | undefined;
|
466
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
467
|
+
}>, prevState: Readonly<{}>): any;
|
468
|
+
componentDidUpdate?(prevProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
469
|
+
locale?: string | undefined;
|
470
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
471
|
+
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
472
|
+
componentWillMount?(): void;
|
473
|
+
UNSAFE_componentWillMount?(): void;
|
474
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
475
|
+
locale?: string | undefined;
|
476
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
477
|
+
}>, nextContext: any): void;
|
478
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
479
|
+
locale?: string | undefined;
|
480
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
481
|
+
}>, nextContext: any): void;
|
482
|
+
componentWillUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
483
|
+
locale?: string | undefined;
|
484
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
485
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
486
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Props, keyof LocaleProps> & {
|
487
|
+
locale?: string | undefined;
|
488
|
+
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
489
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
490
|
+
};
|
491
|
+
displayName: string;
|
492
|
+
contextType: React.Context<string>;
|
493
|
+
ComposedComponent: React.ComponentType<typeof HeadCellSort>;
|
494
|
+
} & import("hoist-non-react-statics").NonReactStatics<typeof HeadCellSort, {}> & {
|
495
|
+
ComposedComponent: typeof HeadCellSort;
|
496
|
+
};
|
497
|
+
};
|
498
|
+
export default _default;
|
@@ -0,0 +1,67 @@
|
|
1
|
+
"use strict";
|
2
|
+
/**
|
3
|
+
* @file table/HeadCellSort
|
4
|
+
* @author fex
|
5
|
+
*/
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
7
|
+
exports.HeadCellSort = void 0;
|
8
|
+
var tslib_1 = require("tslib");
|
9
|
+
var react_1 = (0, tslib_1.__importDefault)(require("react"));
|
10
|
+
var theme_1 = require("../../theme");
|
11
|
+
var locale_1 = require("../../locale");
|
12
|
+
var icons_1 = require("../icons");
|
13
|
+
var HeadCellSort = /** @class */ (function (_super) {
|
14
|
+
(0, tslib_1.__extends)(HeadCellSort, _super);
|
15
|
+
function HeadCellSort(props) {
|
16
|
+
var _this = _super.call(this, props) || this;
|
17
|
+
_this.state = {
|
18
|
+
order: '',
|
19
|
+
orderBy: ''
|
20
|
+
};
|
21
|
+
return _this;
|
22
|
+
}
|
23
|
+
HeadCellSort.prototype.render = function () {
|
24
|
+
var _this = this;
|
25
|
+
var _a = this.props, column = _a.column, onSort = _a.onSort, cx = _a.classnames;
|
26
|
+
return (react_1.default.createElement("span", { className: cx('TableCell-sortBtn'), onClick: function () {
|
27
|
+
var callback = function () {
|
28
|
+
if (onSort) {
|
29
|
+
onSort({
|
30
|
+
orderBy: _this.state.orderBy,
|
31
|
+
order: _this.state.order
|
32
|
+
});
|
33
|
+
}
|
34
|
+
};
|
35
|
+
var sortPayload = {};
|
36
|
+
if (column.key === _this.state.orderBy) {
|
37
|
+
if (_this.state.order === 'descend') {
|
38
|
+
// 降序改为取消
|
39
|
+
sortPayload = { orderBy: '', order: 'ascend' };
|
40
|
+
}
|
41
|
+
else {
|
42
|
+
// 升序之后降序
|
43
|
+
sortPayload = { order: 'descend' };
|
44
|
+
}
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
// 默认先升序
|
48
|
+
sortPayload = { orderBy: column.key, order: 'ascend' };
|
49
|
+
}
|
50
|
+
_this.setState(sortPayload, callback);
|
51
|
+
} },
|
52
|
+
react_1.default.createElement("i", { className: cx('TableCell-sortBtn--down', this.state.orderBy === column.key && this.state.order === 'descend'
|
53
|
+
? 'is-active'
|
54
|
+
: '') },
|
55
|
+
react_1.default.createElement(icons_1.Icon, { icon: "sort-desc", className: "icon" })),
|
56
|
+
react_1.default.createElement("i", { className: cx('TableCell-sortBtn--up', this.state.orderBy === column.key && this.state.order === 'ascend'
|
57
|
+
? 'is-active'
|
58
|
+
: '') },
|
59
|
+
react_1.default.createElement(icons_1.Icon, { icon: "sort-asc", className: "icon" })),
|
60
|
+
react_1.default.createElement("i", { className: cx('TableCell-sortBtn--default', this.state.orderBy === column.key ? '' : 'is-active') },
|
61
|
+
react_1.default.createElement(icons_1.Icon, { icon: "sort-default", className: "icon" }))));
|
62
|
+
};
|
63
|
+
return HeadCellSort;
|
64
|
+
}(react_1.default.Component));
|
65
|
+
exports.HeadCellSort = HeadCellSort;
|
66
|
+
exports.default = (0, theme_1.themeable)((0, locale_1.localeable)(HeadCellSort));
|
67
|
+
//# sourceMappingURL=./components/table/HeadCellSort.js.map
|