Comparing version 3.0.2 to 3.1.1
@@ -65,2 +65,8 @@ import { ActionType } from './enums'; | ||
type: ActionType.UpdateData, | ||
}); }; | ||
export var showLoading = function () { return ({ | ||
type: ActionType.ShowLoading, | ||
}); }; | ||
export var hideLoading = function () { return ({ | ||
type: ActionType.HideLoading, | ||
}); }; |
@@ -81,1 +81,8 @@ import { ActionType } from './enums'; | ||
}); | ||
export const showLoading = () => ({ | ||
type: ActionType.ShowLoading, | ||
}); | ||
export const hideLoading = () => ({ | ||
type: ActionType.HideLoading, | ||
}); |
@@ -20,5 +20,6 @@ var __assign = (this && this.__assign) || function () { | ||
import HeadRow from '../HeadRow/HeadRow'; | ||
import Loading from '../Loading/Loading'; | ||
import TableBody from '../TableBody/TableBody'; | ||
export var Table = function (props) { | ||
var _a = props.childAttributes, childAttributes = _a === void 0 ? {} : _a, _b = props.editableCells, editableCells = _b === void 0 ? [] : _b, _c = props.editingMode, editingMode = _c === void 0 ? EditingMode.None : _c, filteringMode = props.filteringMode, _d = props.sortingMode, sortingMode = _d === void 0 ? SortingMode.None : _d, _e = props.selectedRows, selectedRows = _e === void 0 ? [] : _e, groups = props.groups, _f = props.data, data = _f === void 0 ? [] : _f; | ||
var _a = props.childAttributes, childAttributes = _a === void 0 ? {} : _a, _b = props.data, data = _b === void 0 ? [] : _b, _c = props.editableCells, editableCells = _c === void 0 ? [] : _c, _d = props.editingMode, editingMode = _d === void 0 ? EditingMode.None : _d, filteringMode = props.filteringMode, groups = props.groups, loading = props.loading, _e = props.selectedRows, selectedRows = _e === void 0 ? [] : _e, _f = props.sortingMode, sortingMode = _f === void 0 ? SortingMode.None : _f; | ||
var groupsExpanded = props.groupsExpanded; | ||
@@ -36,3 +37,5 @@ var preparedOptions = prepareTableOptions(props); | ||
var areAllRowsSelected = data.length === selectedRows.length; | ||
return (React.createElement("div", { className: 'ka' }, | ||
var isLoadingActive = loading; | ||
var kaCss = isLoadingActive ? 'ka ka-loading-active' : 'ka'; | ||
return (React.createElement("div", { className: kaCss }, | ||
React.createElement("table", __assign({}, tableProps), | ||
@@ -43,3 +46,4 @@ React.createElement("thead", { className: defaultOptions.css.thead, ref: theadRef }, | ||
(React.createElement(FilterRow, { columns: preparedOptions.columns, dispatch: dispatch, groupColumnsCount: preparedOptions.groupColumnsCount }))), | ||
React.createElement(TableBody, __assign({}, props, { childAttributes: childAttributes, columns: preparedOptions.columns, data: preparedOptions.groupedData, dispatch: dispatch, editableCells: editableCells, editingMode: editingMode, groupColumnsCount: preparedOptions.groupColumnsCount, groupedColumns: preparedOptions.groupedColumns, groupsExpanded: groupsExpanded, selectedRows: selectedRows }))))); | ||
React.createElement(TableBody, __assign({}, props, { childAttributes: childAttributes, columns: preparedOptions.columns, data: preparedOptions.groupedData, dispatch: dispatch, editableCells: editableCells, editingMode: editingMode, groupColumnsCount: preparedOptions.groupColumnsCount, groupedColumns: preparedOptions.groupedColumns, groupsExpanded: groupsExpanded, selectedRows: selectedRows }))), | ||
React.createElement(Loading, { loading: loading }))); | ||
}; |
@@ -20,2 +20,3 @@ export var DataType; | ||
ActionType["DeselectRow"] = "DeselectRow"; | ||
ActionType["HideLoading"] = "HideLoading"; | ||
ActionType["OpenEditor"] = "OpenEditor"; | ||
@@ -27,2 +28,3 @@ ActionType["ScrollTable"] = "ScrollTable"; | ||
ActionType["SelectSingleRow"] = "SelectSingleRow"; | ||
ActionType["ShowLoading"] = "ShowLoading"; | ||
ActionType["UpdateCellValue"] = "UpdateCellValue"; | ||
@@ -29,0 +31,0 @@ ActionType["UpdateData"] = "UpdateData"; |
@@ -19,2 +19,3 @@ export enum DataType { | ||
DeselectRow = 'DeselectRow', | ||
HideLoading = 'HideLoading', | ||
OpenEditor = 'OpenEditor', | ||
@@ -26,2 +27,3 @@ ScrollTable = 'ScrollTable', | ||
SelectSingleRow = 'SelectSingleRow', | ||
ShowLoading = 'ShowLoading', | ||
UpdateCellValue = 'UpdateCellValue', | ||
@@ -28,0 +30,0 @@ UpdateData = 'UpdateData', |
{ | ||
"name": "ka-table", | ||
"version": "3.0.2", | ||
"version": "3.1.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "github:komarovalexander/ka-table", |
@@ -29,2 +29,8 @@ var __assign = (this && this.__assign) || function () { | ||
switch (action.type) { | ||
case ActionType.HideLoading: { | ||
return __assign(__assign({}, state), { loading: false }); | ||
} | ||
case ActionType.ShowLoading: { | ||
return __assign(__assign({}, state), { loading: true }); | ||
} | ||
case ActionType.OpenEditor: { | ||
@@ -31,0 +37,0 @@ var newEditableCells = addItemToEditableCells(action, editableCells); |
@@ -24,2 +24,8 @@ | ||
switch (action.type) { | ||
case ActionType.HideLoading: { | ||
return { ...state, loading: false }; | ||
} | ||
case ActionType.ShowLoading: { | ||
return { ...state, loading: true }; | ||
} | ||
case ActionType.OpenEditor: { | ||
@@ -26,0 +32,0 @@ const newEditableCells = addItemToEditableCells( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
202686
148
3926