react-ui-basics 0.0.154 → 0.0.157
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/Dialog.js +1 -1
- package/DroppableHorizontalList.js +1 -1
- package/DroppableList.js +1 -1
- package/Dropzone.js +1 -1
- package/ImageGallery.js +1 -1
- package/Modal.js +1 -1
- package/ReactConstants.d.ts +18 -0
- package/ReactConstants.js +25 -36
- package/ReactConstants.js.map +1 -1
- package/Scrollable.js +1 -1
- package/ScrollableTable.d.ts +15 -0
- package/ScrollableTable.js +18 -32
- package/ScrollableTable.js.map +1 -1
- package/Table.d.ts +30 -47
- package/Table.js +108 -105
- package/Table.js.map +1 -1
- package/TextField.js +1 -1
- package/Tools.d.ts +1 -1
- package/Tools.js +6 -5
- package/Tools.js.map +1 -1
- package/bundle.css +835 -835
- package/package.json +1 -1
- package/router/Route.js +1 -1
package/Dialog.js
CHANGED
|
@@ -9,7 +9,7 @@ import ReactCreateElement from './ReactCreateElement.js';
|
|
|
9
9
|
import Button from './Button.js';
|
|
10
10
|
import Modal from './Modal.js';
|
|
11
11
|
import { classNames, UNDEFINED, isUndefined, orNoop, createRef, preventDefault } from './Tools.js';
|
|
12
|
-
import { render,
|
|
12
|
+
import { render, stateGSs, componentDidMount, PureComponent, propsGetter } from './ReactConstants.js';
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
|
|
15
15
|
var _excluded = ["top", "className"];
|
|
@@ -10,7 +10,7 @@ import DNDDroppable from './DNDDroppable.js';
|
|
|
10
10
|
import { orNoop, NOOP, setTimeout, classNames } from './Tools.js';
|
|
11
11
|
import DNDDraggable from './DNDDraggable.js';
|
|
12
12
|
import { addListener } from './DNDContainer.js';
|
|
13
|
-
import {
|
|
13
|
+
import { stateGS, componentDidUpdate, children, componentDidMount, setState, props, render, propsGetter } from './ReactConstants.js';
|
|
14
14
|
|
|
15
15
|
var DroppableHorizontalList = function (_Component) {
|
|
16
16
|
_inherits(DroppableHorizontalList, _Component);
|
package/DroppableList.js
CHANGED
|
@@ -10,7 +10,7 @@ import DNDDroppable from './DNDDroppable.js';
|
|
|
10
10
|
import { orNoop, NOOP, setTimeout, classNames } from './Tools.js';
|
|
11
11
|
import DNDDraggable from './DNDDraggable.js';
|
|
12
12
|
import { addListener } from './DNDContainer.js';
|
|
13
|
-
import {
|
|
13
|
+
import { stateGS, componentDidUpdate, children, componentDidMount, setState, props, render, propsGetter } from './ReactConstants.js';
|
|
14
14
|
|
|
15
15
|
var DroppableList = function (_Component) {
|
|
16
16
|
_inherits(DroppableList, _Component);
|
package/Dropzone.js
CHANGED
|
@@ -8,7 +8,7 @@ import 'react';
|
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
10
10
|
import { setOf, classNames, UNDEFINED, createRef, preventDefault, stopPropagation } from './Tools.js';
|
|
11
|
-
import {
|
|
11
|
+
import { stateGS, render, propsGetter, PureComponent } from './ReactConstants.js';
|
|
12
12
|
|
|
13
13
|
var toArray = function toArray(o) {
|
|
14
14
|
if (o instanceof Array) return o;
|
package/ImageGallery.js
CHANGED
|
@@ -11,7 +11,7 @@ import Button from './Button.js';
|
|
|
11
11
|
import SpinningProgress from './SpinningProgress.js';
|
|
12
12
|
import { UNDEFINED, setTimeout, addEventListener, removeEventListener, classNames, WINDOW, orNoop, preventDefault, isDifferent, DOCUMENT, stopPropagation, createRef, debounce } from './Tools.js';
|
|
13
13
|
import MaterialIcon from './MaterialIcon.js';
|
|
14
|
-
import { stateGSs,
|
|
14
|
+
import { stateGSs, componentDidUpdate, componentDidMount, componentWillUnmount, render, propsGetter } from './ReactConstants.js';
|
|
15
15
|
|
|
16
16
|
var _reducers;
|
|
17
17
|
var min = Math.min;
|
package/Modal.js
CHANGED
|
@@ -9,7 +9,7 @@ import ReactDOM from 'react-dom';
|
|
|
9
9
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
10
10
|
import Button from './Button.js';
|
|
11
11
|
import { classNames, orNoop, setTimeout, UNDEFINED, removeEventListener, DOCUMENT, addEventListener, createRef, stopPropagation } from './Tools.js';
|
|
12
|
-
import { stateGSs,
|
|
12
|
+
import { stateGSs, render, componentDidMount, componentDidUpdate, propsGetter, PureComponent } from './ReactConstants.js';
|
|
13
13
|
import MaterialIcon from './MaterialIcon.js';
|
|
14
14
|
import PropTypes from 'prop-types';
|
|
15
15
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const props: <P>(that: React.Component<P>) => P;
|
|
3
|
+
export declare const propsGetter: <P>(that: React.Component<P>) => (() => P);
|
|
4
|
+
export declare const state: <P, S>(that: React.Component<P, S>) => S;
|
|
5
|
+
export declare const setState: (that: any, data: any, cb?: any) => void;
|
|
6
|
+
export declare const stateFieldSetter: (that: any, key: any, cb?: any) => (value: any, cb2?: any) => void;
|
|
7
|
+
export declare const stateGS: (that: any) => {
|
|
8
|
+
(): any;
|
|
9
|
+
toString(): string;
|
|
10
|
+
};
|
|
11
|
+
export declare const stateGSs: (that: any, num: any) => any[];
|
|
12
|
+
export declare const componentDidMount = "componentDidMount";
|
|
13
|
+
export declare const componentWillUnmount = "componentWillUnmount";
|
|
14
|
+
export declare const componentDidUpdate = "componentDidUpdate";
|
|
15
|
+
export declare const render = "render";
|
|
16
|
+
export declare const children = "children";
|
|
17
|
+
export declare const className = "className";
|
|
18
|
+
export declare const PureComponent: typeof React.PureComponent;
|
package/ReactConstants.js
CHANGED
|
@@ -1,44 +1,33 @@
|
|
|
1
|
-
import { defineProperty as _defineProperty } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
var EMPTY = {};
|
|
5
|
-
var props = function
|
|
6
|
-
|
|
4
|
+
var props = function (that) { return that.props; };
|
|
5
|
+
var propsGetter = function (that) { return function () { return props(that); }; };
|
|
6
|
+
// @ts-ignore //ignore incompatible casting EMPTY to S
|
|
7
|
+
var state = function (that) { return that.state || EMPTY; };
|
|
8
|
+
var setState = function (that, data, cb) {
|
|
9
|
+
that.setState(data, cb);
|
|
7
10
|
};
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
var stateFieldSetter = function (that, key, cb) { return function (value, cb2) {
|
|
12
|
+
var _a;
|
|
13
|
+
setState(that, (_a = {}, _a[key] = value, _a), cb2 || cb);
|
|
14
|
+
}; };
|
|
15
|
+
var stateGS = function (that) {
|
|
16
|
+
!that.sfc && (that.sfc = 0);
|
|
17
|
+
var key = '_' + (that.sfc++);
|
|
18
|
+
var setter = stateFieldSetter(that, key);
|
|
19
|
+
var result = function () {
|
|
20
|
+
return !arguments.length ? state(that)[key] : setter.apply(null, arguments);
|
|
21
|
+
};
|
|
22
|
+
result.toString = function () { return key; };
|
|
23
|
+
return result;
|
|
12
24
|
};
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var stateFieldSetter = function stateFieldSetter(that, key, cb) {
|
|
20
|
-
return function (value, cb2) {
|
|
21
|
-
setState(that, _defineProperty({}, key, value), cb2 || cb);
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
var stateGS = function stateGS(that) {
|
|
25
|
-
!that.sfc && (that.sfc = 0);
|
|
26
|
-
var key = '_' + that.sfc++;
|
|
27
|
-
var setter = stateFieldSetter(that, key);
|
|
28
|
-
var result = function result() {
|
|
29
|
-
return !arguments.length ? state(that)[key] : setter.apply(null, arguments);
|
|
30
|
-
};
|
|
31
|
-
result.toString = function () {
|
|
32
|
-
return key;
|
|
33
|
-
};
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var stateGSs = function stateGSs(that, num) {
|
|
37
|
-
var result = [];
|
|
38
|
-
for (var i = 0; i < num; i++) {
|
|
39
|
-
result.push(stateGS(that));
|
|
40
|
-
}
|
|
41
|
-
return result;
|
|
25
|
+
var stateGSs = function (that, num) {
|
|
26
|
+
var result = [];
|
|
27
|
+
for (var i = 0; i < num; i++) {
|
|
28
|
+
result.push(stateGS(that));
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
42
31
|
};
|
|
43
32
|
var componentDidMount = 'componentDidMount';
|
|
44
33
|
var componentWillUnmount = 'componentWillUnmount';
|
package/ReactConstants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactConstants.js","sources":["../../../src/react-ui-basics/ReactConstants.
|
|
1
|
+
{"version":3,"file":"ReactConstants.js","sources":["../../../src/src/react-ui-basics/ReactConstants.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA,IAAM,KAAK,GAAG,EAAE,CAAC;AACV,IAAM,KAAK,GAAuC,UAAA,IAAI,EAAI,EAAA,OAAA,IAAI,CAAC,KAAK,CAAA,GAAC;AAC/D,IAAA,WAAW,GAA+C,UAAA,IAAI,IAAI,OAAA,YAAA,EAAM,OAAA,KAAK,CAAC,IAAI,CAAC,GAAA,CAAA,GAAC;AACjG;AACO,IAAM,KAAK,GAA6C,UAAA,IAAI,EAAA,EAAI,OAAA,IAAI,CAAC,KAAK,IAAI,KAAK,CAAA,GAAC;IAC9E,QAAQ,GAAG,UAAC,IAAI,EAAE,IAAI,EAAE,EAAG,EAAA;AACpC,IAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC5B,EAAE;AACK,IAAM,gBAAgB,GAAG,UAAC,IAAI,EAAE,GAAG,EAAE,EAAG,EAAK,EAAA,OAAA,UAAC,KAAK,EAAE,GAAI,EAAA;;AAC5D,IAAA,QAAQ,CAAC,IAAI,GAAG,EAAA,GAAA,EAAA,EAAA,EAAA,CAAC,GAAG,CAAA,GAAG,KAAK,EAAA,EAAA,GAAG,GAAG,IAAI,EAAE,CAAC,CAAC;AAC9C,CAAC,CAAA,GAAC;AACK,IAAM,OAAO,GAAG,UAAC,IAAI,EAAA;IACxB,CAAC,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAC5B,IAAM,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/B,IAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC3C,IAAA,IAAM,MAAM,GAAG,YAAA;QACX,OAAO,CAAC,SAAS,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAChF,KAAC,CAAC;IACF,MAAM,CAAC,QAAQ,GAAG,YAAA,EAAM,OAAA,GAAG,CAAA,EAAA,CAAC;AAC5B,IAAA,OAAO,MAAM,CAAC;AAClB,EAAE;AACW,IAAA,QAAQ,GAAG,UAAC,IAAI,EAAE,GAAG,EAAA;IAC9B,IAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QAC1B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9B,KAAA;AACD,IAAA,OAAO,MAAM,CAAC;AAClB,EAAE;AAEK,IAAM,iBAAiB,GAAG,oBAAoB;AAC9C,IAAM,oBAAoB,GAAG,uBAAuB;AACpD,IAAM,kBAAkB,GAAG,qBAAqB;AAChD,IAAM,MAAM,GAAG,SAAS;AACxB,IAAM,QAAQ,GAAG,WAAW;AAC5B,IAAM,SAAS,GAAG,YAAY;AACxB,IAAA,aAAa,GAAG,KAAK,CAAC;;;;"}
|
package/Scrollable.js
CHANGED
|
@@ -8,7 +8,7 @@ import 'react';
|
|
|
8
8
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import { classNames, createRef, clearInterval, clearTimeout, orNoop, addEventListener, WINDOW, preventDefault, setTimeout, setInterval, removeEventListener } from './Tools.js';
|
|
11
|
-
import {
|
|
11
|
+
import { stateGS, componentDidMount, componentWillUnmount, componentDidUpdate, render, propsGetter, PureComponent } from './ReactConstants.js';
|
|
12
12
|
|
|
13
13
|
var SCROLLBAR_MODE_HIDDEN = 'hidden';
|
|
14
14
|
var SCROLLBAR_MODE_VISIBLE = 'visible';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TableProps, TableState } from "./Table";
|
|
2
|
+
import Scrollable from "./Scrollable";
|
|
3
|
+
import "./ScrollableTable.css";
|
|
4
|
+
import { PureComponent } from "./ReactConstants";
|
|
5
|
+
export interface WithScrollable {
|
|
6
|
+
getScrollable: () => Scrollable;
|
|
7
|
+
}
|
|
8
|
+
export interface ScrollableTableProps<T> extends TableProps<T> {
|
|
9
|
+
scrollableProps?: any;
|
|
10
|
+
}
|
|
11
|
+
declare class ScrollableTable<T> extends PureComponent<ScrollableTableProps<T>, TableState<T>> implements WithScrollable {
|
|
12
|
+
constructor(properties: any);
|
|
13
|
+
getScrollable(): Scrollable;
|
|
14
|
+
}
|
|
15
|
+
export default ScrollableTable;
|
package/ScrollableTable.js
CHANGED
|
@@ -1,44 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { jsx as jsxRuntime_2 } from 'react/jsx-runtime';
|
|
2
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
3
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
6
|
import {className as __className} from "./ReactConstants";
|
|
6
7
|
import {children as __children} from "./ReactConstants";
|
|
7
|
-
import 'react';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement.js';
|
|
9
8
|
import Table from './Table.js';
|
|
10
9
|
import Scrollable from './Scrollable.js';
|
|
11
10
|
import { render, props, PureComponent } from './ReactConstants.js';
|
|
12
11
|
import { createRef } from './Tools.js';
|
|
13
|
-
import 'prop-types';
|
|
14
12
|
|
|
15
|
-
var ScrollableTable = function (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
that.getScrollable = function () {
|
|
32
|
-
return scrollableRef();
|
|
33
|
-
};
|
|
34
|
-
return _this;
|
|
35
|
-
}
|
|
36
|
-
return _createClass(ScrollableTable);
|
|
37
|
-
}(PureComponent);
|
|
38
|
-
var ScrollableTable$1 = ScrollableTable;
|
|
39
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
40
|
-
ScrollableTable.propTypes = Table.propTypes;
|
|
41
|
-
}
|
|
13
|
+
var ScrollableTable = /** @class */ (function (_super) {
|
|
14
|
+
__inherits(ScrollableTable, _super);
|
|
15
|
+
function ScrollableTable(properties) {
|
|
16
|
+
var _this = _super.call(this, properties) || this;
|
|
17
|
+
var that = _this;
|
|
18
|
+
var scrollableRef = createRef();
|
|
19
|
+
that[render] = function () {
|
|
20
|
+
return jsxRuntime_2("div", __extends({ [__className]: "ScrollableTable" }, { [__children]: jsxRuntime_2(Scrollable, __extends({ ref: scrollableRef }, props(that).scrollableProps, { [__children]: jsxRuntime_2(Table, __extends({}, props(that))) })) }));
|
|
21
|
+
};
|
|
22
|
+
that.getScrollable = function () { return scrollableRef(); };
|
|
23
|
+
return _this;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return ScrollableTable;
|
|
27
|
+
}(PureComponent));
|
|
42
28
|
|
|
43
|
-
export { ScrollableTable
|
|
29
|
+
export { ScrollableTable as default };
|
|
44
30
|
//# sourceMappingURL=ScrollableTable.js.map
|
package/ScrollableTable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollableTable.js","sources":["../../../src/react-ui-basics/ScrollableTable.
|
|
1
|
+
{"version":3,"file":"ScrollableTable.js","sources":["../../../src/src/react-ui-basics/ScrollableTable.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;AAeA,IAAA,eAAA,kBAAA,UAAA,MAAA,EAAA;IAAiC,SAAqD,CAAA,eAAA,EAAA,MAAA,CAAA,CAAA;AAElF,IAAA,SAAA,eAAA,CAAY,UAAU,EAAA;QAAtB,IACI,KAAA,GAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EAAM,UAAU,CAAC,IAapB,IAAA,CAAA;QAZG,IAAM,IAAI,GAAG,KAAI,CAAC;AAElB,QAAA,IAAM,aAAa,GAAG,SAAS,EAAE,CAAC;QAElC,IAAI,CAAC,MAAM,CAAC,GAAG,YAAA;AACX,YAAA,OAAOA,YAAK,CAAA,KAAA,EAAA,QAAA,CAAA,EAAA,SAAS,EAAE,iBAAiB,EACpC,EAAA,EAAA,QAAA,EAAAA,YAAA,CAAC,UAAU,EAAA,QAAA,CAAA,EAAC,GAAG,EAAE,aAAa,EAAA,EAAM,KAAK,CAAC,IAAI,CAAC,CAAC,eAAe,EAC3D,EAAA,QAAA,EAAAA,YAAA,CAAC,KAAK,EAAA,QAAA,CAAA,EAAA,EAAK,KAAK,CAAC,IAAI,CAAC,CAAG,CAAA,EAAA,CAAA,CAChB,IACX,CAAC;AACX,SAAC,CAAA;QACD,IAAI,CAAC,aAAa,GAAG,YAAA,EAAM,OAAA,aAAa,EAAE,CAAf,EAAe,CAAA;;KAC7C;AAED,IAAA,eAAA,CAAA,SAAA,CAAA,aAAa,GAAb,YAAA;AACI,QAAA,OAAO,SAAS,CAAC;KACpB,CAAA;IACL,OAAC,eAAA,CAAA;AAAD,CArBA,CAAiC,aAAa,CAqB7C;;;;"}
|
package/Table.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ReactElement } from 'react';
|
|
1
|
+
import { ChangeEvent, Component, ReactElement } from 'react';
|
|
2
2
|
import './Table.css';
|
|
3
3
|
export declare const SORT_ASC: string;
|
|
4
4
|
export declare const SORT_DESC: string;
|
|
@@ -6,71 +6,54 @@ declare type SortOrder = typeof SORT_ASC | typeof SORT_DESC;
|
|
|
6
6
|
declare type Comparator = <T>(a: T, b: T) => number;
|
|
7
7
|
declare const editorSelect = "Select";
|
|
8
8
|
declare const editorSwitch = "Switch";
|
|
9
|
-
export interface RowProps {
|
|
10
|
-
item:
|
|
11
|
-
disabled?:
|
|
9
|
+
export interface RowProps<T> {
|
|
10
|
+
item: T;
|
|
11
|
+
disabled?: (t: T) => boolean;
|
|
12
12
|
editing: any;
|
|
13
|
-
onClick?: (
|
|
14
|
-
className?: string | (
|
|
15
|
-
columns: TableColumn[];
|
|
16
|
-
|
|
13
|
+
onClick?: (t: T) => void;
|
|
14
|
+
className?: string | ((e: T) => string);
|
|
15
|
+
columns: TableColumn<T>[];
|
|
16
|
+
cancelEditing: () => void;
|
|
17
|
+
onFinishEditing: () => void;
|
|
18
|
+
handleInputChange: (e: ChangeEvent) => void;
|
|
19
|
+
setValue: (v: any) => void;
|
|
20
|
+
setEditing: (t: T, i: number, field: string) => void;
|
|
17
21
|
}
|
|
18
22
|
export declare type Formatter<T, V> = ((value?: V, item?: T, format?: string) => ReactElement) | ((value: V, item: T) => ReactElement) | ((value: V) => ReactElement);
|
|
19
|
-
export interface TableColumn {
|
|
23
|
+
export interface TableColumn<T> {
|
|
20
24
|
field?: string;
|
|
21
25
|
className?: string;
|
|
22
26
|
comparator?: Comparator;
|
|
23
27
|
header?: string | ReactElement;
|
|
24
28
|
sortable?: boolean;
|
|
25
29
|
displayEditor?: boolean;
|
|
26
|
-
formatter?: Formatter<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
formatter?: Formatter<T, any>;
|
|
31
|
+
format?: string;
|
|
32
|
+
editable?: boolean | ((t: T) => boolean);
|
|
33
|
+
editor?: typeof editorSelect | typeof editorSwitch | ((t: T, cancel: () => void, isEditing: boolean) => ReactElement);
|
|
34
|
+
preEditor?: (a: any) => any;
|
|
30
35
|
}
|
|
31
|
-
export interface TableProps {
|
|
32
|
-
columns: TableColumn[];
|
|
33
|
-
data:
|
|
36
|
+
export interface TableProps<T> {
|
|
37
|
+
columns: TableColumn<T>[];
|
|
38
|
+
data: T[];
|
|
34
39
|
className?: string;
|
|
35
40
|
sortOrder?: SortOrder;
|
|
36
41
|
sortBy?: string;
|
|
37
42
|
onSortChange?: (sortBy: string, sortOrder: SortOrder) => void;
|
|
38
|
-
onRowClick?: (
|
|
39
|
-
disabled?:
|
|
40
|
-
toKey?:
|
|
41
|
-
onChange?:
|
|
42
|
-
rowClassName?: string | (
|
|
43
|
+
onRowClick?: (t: T) => void;
|
|
44
|
+
disabled?: (t: T) => boolean;
|
|
45
|
+
toKey?: (t: T) => number | string;
|
|
46
|
+
onChange?: (t: T, cancel: () => void) => void;
|
|
47
|
+
rowClassName?: string | ((t: T) => string);
|
|
43
48
|
}
|
|
44
|
-
export interface TableState {
|
|
49
|
+
export interface TableState<T> {
|
|
45
50
|
sortOrder?: SortOrder;
|
|
46
51
|
sortBy?: string;
|
|
47
52
|
comparator?: Comparator;
|
|
48
|
-
data?:
|
|
53
|
+
data?: T[];
|
|
49
54
|
editing?: any;
|
|
50
55
|
}
|
|
51
|
-
declare class Table extends Component<TableProps
|
|
52
|
-
|
|
53
|
-
updateHeadersInterval: number;
|
|
54
|
-
constructor(props: any);
|
|
55
|
-
componentDidMount(): void;
|
|
56
|
-
setData: (data: any) => void;
|
|
57
|
-
componentDidUpdate(prevProps: any, prevState: any, snapshot: any): void;
|
|
58
|
-
render(): JSX.Element;
|
|
59
|
-
componentWillUnmount(): void;
|
|
60
|
-
updateHeaders: () => void;
|
|
61
|
-
cancelEditing: () => void;
|
|
62
|
-
setEditing: (item: any, columnIndex: any, field: any) => void;
|
|
63
|
-
prepareEditing: (item: any, field: any, columnIndex: any) => {
|
|
64
|
-
id: any;
|
|
65
|
-
value: any;
|
|
66
|
-
columnIndex: any;
|
|
67
|
-
item: any;
|
|
68
|
-
field: any;
|
|
69
|
-
};
|
|
70
|
-
handleInputChange: (event: any) => void;
|
|
71
|
-
extractValue: (event: any) => any;
|
|
72
|
-
selectNewValue: (value: any) => void;
|
|
73
|
-
onFinishEditing: () => void;
|
|
74
|
-
sort: (e: any, sortBy: any, comparator: any) => void;
|
|
56
|
+
declare class Table<T> extends Component<TableProps<T>, TableState<T>> {
|
|
57
|
+
constructor(properties: any);
|
|
75
58
|
}
|
|
76
59
|
export default Table;
|