@elliemae/ds-datagrids 2.0.0-alpha.1 → 2.0.0-alpha.13
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/cjs/DSDataGrid.js +247 -244
- package/cjs/DataGridImpl.js +22 -13
- package/cjs/PaginatedDataGrid.js +11 -6
- package/cjs/blockNames.js +2 -2
- package/cjs/columns/IconColumn.js +23 -21
- package/cjs/columns/NumberColumn.js +2 -4
- package/cjs/components/BodyCell.js +23 -15
- package/cjs/components/BodyList.js +11 -4
- package/cjs/components/ColumnVisibilityMenuOption.js +12 -6
- package/cjs/components/ColumnsOptionsMenuSection.js +35 -28
- package/cjs/components/EmptyState.js +23 -21
- package/cjs/components/HeaderCell.js +17 -11
- package/cjs/components/List.js +6 -1
- package/cjs/components/ListItem.js +8 -1
- package/cjs/components/NoResults.js +8 -3
- package/cjs/components/RowsLoader.js +6 -5
- package/cjs/components/Table.js +9 -4
- package/cjs/components/TableBody.js +8 -3
- package/cjs/components/TableHeader.js +6 -1
- package/cjs/components/footer/addOptionalFooterComponents.js +6 -5
- package/cjs/components/header/PrimaryControls.js +20 -15
- package/cjs/components/header/addOptionalHeaderComponents.js +5 -4
- package/cjs/components/renderers/defaultClassedRenderers.js +35 -23
- package/cjs/components/renderers/renderRowsLoader.js +1 -1
- package/cjs/components/tableContext.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +54 -43
- package/cjs/plugins/column-dnd/DndColumnsPlugin.js +13 -9
- package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +3 -4
- package/cjs/plugins/column-sizing/ColumnSizingPlugin.js +12 -10
- package/cjs/plugins/column-sizing/columnMeasurerTransformer.js +14 -7
- package/cjs/plugins/column-sizing/ext-points/decorateColumn.js +3 -3
- package/cjs/plugins/column-sizing/ext-points/getTableProps.js +24 -18
- package/cjs/plugins/column-sizing/useColumnSizeService.js +14 -4
- package/cjs/plugins/column-sizing/useStylesheetHelpers.js +70 -56
- package/cjs/plugins/column-sizing/utils.js +10 -6
- package/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js +2 -2
- package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +11 -6
- package/cjs/plugins/custom-cell-renderer/getRendererComponent.js +24 -25
- package/cjs/plugins/editable/EditableComponents/ComboBox.js +10 -7
- package/cjs/plugins/editable/EditableComponents/TextBox.js +24 -19
- package/cjs/plugins/editable/EditablePlugin.js +17 -16
- package/cjs/plugins/editable/decorateEditable.js +25 -19
- package/cjs/plugins/editable/getEditorComponent.js +46 -35
- package/cjs/plugins/expandable-grid/ExpandableColumn.js +66 -59
- package/cjs/plugins/expandable-grid/ExpandablePlugin.js +42 -30
- package/cjs/plugins/expandable-grid/ExpandedRow.js +41 -31
- package/cjs/plugins/expandable-grid/ExpandedRowExtra.js +22 -16
- package/cjs/plugins/expandable-grid/useExpandGridState.js +4 -8
- package/cjs/plugins/export-data/ExportDataPlugin.js +34 -19
- package/cjs/plugins/filterable/FilterablePlugin.js +9 -8
- package/cjs/plugins/filterable/addFilterToColumn.js +6 -1
- package/cjs/plugins/filterable/components/FilterableHeader.js +39 -30
- package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +52 -45
- package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +38 -33
- package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +127 -161
- package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +38 -29
- package/cjs/plugins/filterable/filterableFormatter.js +16 -11
- package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +18 -6
- package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +11 -8
- package/cjs/plugins/filterable/helper.js +18 -8
- package/cjs/plugins/filterable/useFilterableState.js +13 -6
- package/cjs/plugins/grouping-by/GroupingByPlugin.js +4 -2
- package/cjs/plugins/grouping-grid/GroupingPlugin.js +14 -5
- package/cjs/plugins/grouping-grid/walkStrategy.js +13 -9
- package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +11 -4
- package/cjs/plugins/pagination/PaginationPlugin.js +17 -10
- package/cjs/plugins/pagination/components/Pagination.js +12 -11
- package/cjs/plugins/pagination/components/Paginator.js +23 -22
- package/cjs/plugins/pagination/components/PerPageDropdown.js +24 -17
- package/cjs/plugins/pagination/helper.js +11 -8
- package/cjs/plugins/pagination/usePaginationState.js +9 -4
- package/cjs/plugins/resizable/ResizablePlugin.js +6 -5
- package/cjs/plugins/resizable/decorateResizable.js +16 -10
- package/cjs/plugins/resizable/useResizeHandle.js +21 -16
- package/cjs/plugins/resizable/utils.js +9 -6
- package/cjs/plugins/row-dnd/DndRowsPlugin.js +27 -19
- package/cjs/plugins/selectable/SelectablePlugin.js +13 -12
- package/cjs/plugins/selectable/addSelectableColumn.js +25 -17
- package/cjs/plugins/selectable/helper.js +13 -4
- package/cjs/plugins/selectable/selectableFormatter.js +83 -74
- package/cjs/plugins/selectable/useSelectableState.js +26 -12
- package/cjs/plugins/sortable/SortablePlugin.js +11 -12
- package/cjs/plugins/sortable/checkIfSortable.js +1 -1
- package/cjs/plugins/sortable/sortHeaderFormatter.js +17 -18
- package/cjs/plugins/sortable/sortTree.js +16 -8
- package/cjs/plugins/sortable/sorter.js +153 -135
- package/cjs/plugins/sortable/useSortableState.js +12 -6
- package/cjs/plugins/toolbar/RowRenderer.js +13 -7
- package/cjs/plugins/toolbar/ToolbarPlugin.js +3 -2
- package/cjs/plugins/toolbar/ToolbarTrigger.js +26 -21
- package/cjs/plugins/virtualization/AutoHeightList.js +12 -10
- package/cjs/plugins/virtualization/VirtualizationPlugin.js +35 -28
- package/cjs/plugins/virtualization/VirtualizedBody.js +23 -13
- package/cjs/plugins/virtualization/VirtualizedBodyRow.js +8 -7
- package/cjs/renders/CellWithAddons.js +23 -21
- package/cjs/renders/styled.js +7 -18
- package/cjs/utilities/getPluginsFromProps.js +5 -1
- package/cjs/utilities/getScrollbarSize.js +2 -1
- package/cjs/utilities/normalizeData.js +8 -2
- package/esm/DSDataGrid.js +246 -243
- package/esm/DataGridImpl.js +18 -9
- package/esm/PaginatedDataGrid.js +5 -0
- package/esm/blockNames.js +2 -2
- package/esm/columns/IconColumn.js +19 -17
- package/esm/columns/NumberColumn.js +2 -4
- package/esm/components/BodyCell.js +20 -12
- package/esm/components/BodyList.js +7 -0
- package/esm/components/ColumnVisibilityMenuOption.js +12 -6
- package/esm/components/ColumnsOptionsMenuSection.js +35 -28
- package/esm/components/EmptyState.js +18 -15
- package/esm/components/HeaderCell.js +15 -9
- package/esm/components/List.js +5 -0
- package/esm/components/ListItem.js +7 -0
- package/esm/components/NoResults.js +5 -0
- package/esm/components/RowsLoader.js +5 -4
- package/esm/components/Table.js +5 -0
- package/esm/components/TableBody.js +5 -0
- package/esm/components/TableHeader.js +5 -0
- package/esm/components/footer/addOptionalFooterComponents.js +5 -4
- package/esm/components/header/PrimaryControls.js +20 -14
- package/esm/components/header/addOptionalHeaderComponents.js +4 -3
- package/esm/components/renderers/defaultClassedRenderers.js +35 -23
- package/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +50 -39
- package/esm/plugins/column-dnd/DndColumnsPlugin.js +8 -4
- package/esm/plugins/column-dnd/decorateGridWithDndColumns.js +1 -1
- package/esm/plugins/column-sizing/ColumnSizingPlugin.js +10 -8
- package/esm/plugins/column-sizing/columnMeasurerTransformer.js +12 -5
- package/esm/plugins/column-sizing/ext-points/decorateColumn.js +1 -1
- package/esm/plugins/column-sizing/ext-points/getTableProps.js +22 -15
- package/esm/plugins/column-sizing/useColumnSizeService.js +13 -3
- package/esm/plugins/column-sizing/useStylesheetHelpers.js +67 -51
- package/esm/plugins/column-sizing/utils.js +8 -4
- package/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +6 -1
- package/esm/plugins/custom-cell-renderer/getRendererComponent.js +15 -11
- package/esm/plugins/editable/EditableComponents/ComboBox.js +8 -4
- package/esm/plugins/editable/EditableComponents/TextBox.js +21 -15
- package/esm/plugins/editable/EditablePlugin.js +14 -12
- package/esm/plugins/editable/decorateEditable.js +18 -9
- package/esm/plugins/editable/getEditorComponent.js +49 -38
- package/esm/plugins/expandable-grid/ExpandableColumn.js +59 -50
- package/esm/plugins/expandable-grid/ExpandablePlugin.js +34 -20
- package/esm/plugins/expandable-grid/ExpandedRow.js +27 -17
- package/esm/plugins/expandable-grid/ExpandedRowExtra.js +17 -11
- package/esm/plugins/expandable-grid/useExpandGridState.js +2 -2
- package/esm/plugins/export-data/ExportDataPlugin.js +31 -16
- package/esm/plugins/filterable/FilterablePlugin.js +5 -4
- package/esm/plugins/filterable/addFilterToColumn.js +5 -0
- package/esm/plugins/filterable/components/FilterableHeader.js +32 -22
- package/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +41 -33
- package/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +28 -22
- package/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +121 -154
- package/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +28 -18
- package/esm/plugins/filterable/filterableFormatter.js +15 -10
- package/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +14 -2
- package/esm/plugins/filterable/filtering-helper/strategiesOperators.js +7 -4
- package/esm/plugins/filterable/helper.js +11 -1
- package/esm/plugins/filterable/useFilterableState.js +12 -5
- package/esm/plugins/grouping-by/GroupingByPlugin.js +3 -1
- package/esm/plugins/grouping-grid/GroupingPlugin.js +10 -1
- package/esm/plugins/grouping-grid/walkStrategy.js +13 -9
- package/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js +8 -1
- package/esm/plugins/pagination/PaginationPlugin.js +8 -1
- package/esm/plugins/pagination/components/Pagination.js +10 -9
- package/esm/plugins/pagination/components/Paginator.js +20 -19
- package/esm/plugins/pagination/components/PerPageDropdown.js +17 -9
- package/esm/plugins/pagination/helper.js +10 -7
- package/esm/plugins/pagination/usePaginationState.js +7 -1
- package/esm/plugins/resizable/ResizablePlugin.js +4 -3
- package/esm/plugins/resizable/decorateResizable.js +14 -8
- package/esm/plugins/resizable/useResizeHandle.js +21 -16
- package/esm/plugins/resizable/utils.js +7 -4
- package/esm/plugins/row-dnd/DndRowsPlugin.js +22 -13
- package/esm/plugins/selectable/SelectablePlugin.js +10 -9
- package/esm/plugins/selectable/addSelectableColumn.js +24 -16
- package/esm/plugins/selectable/helper.js +10 -1
- package/esm/plugins/selectable/selectableFormatter.js +79 -68
- package/esm/plugins/selectable/useSelectableState.js +20 -5
- package/esm/plugins/sortable/SortablePlugin.js +5 -4
- package/esm/plugins/sortable/sortHeaderFormatter.js +12 -11
- package/esm/plugins/sortable/sortTree.js +13 -3
- package/esm/plugins/sortable/sorter.js +152 -134
- package/esm/plugins/sortable/useSortableState.js +8 -0
- package/esm/plugins/toolbar/RowRenderer.js +8 -2
- package/esm/plugins/toolbar/ToolbarPlugin.js +1 -0
- package/esm/plugins/toolbar/ToolbarTrigger.js +17 -11
- package/esm/plugins/virtualization/AutoHeightList.js +6 -3
- package/esm/plugins/virtualization/VirtualizationPlugin.js +31 -24
- package/esm/plugins/virtualization/VirtualizedBody.js +16 -6
- package/esm/plugins/virtualization/VirtualizedBodyRow.js +8 -7
- package/esm/renders/CellWithAddons.js +15 -14
- package/esm/renders/styled.js +3 -15
- package/esm/utilities/getPluginsFromProps.js +5 -1
- package/esm/utilities/getScrollbarSize.js +2 -1
- package/esm/utilities/normalizeData.js +7 -1
- package/package.json +27 -18
- package/types/DSDataGrid.d.ts +744 -105
- package/types/components/BodyCell.d.ts +1 -1
- package/types/components/HeaderCell.d.ts +1 -1
- package/types/plugins/column-sizing/columnMeasurerTransformer.d.ts +1 -1
- package/types/plugins/column-sizing/ext-points/getTableProps.d.ts +1 -1
- package/types/plugins/expandable-grid/ExpandedRowExtra.d.ts +1 -1
- package/types/plugins/expandable-grid/useExpandGridState.d.ts +4 -4
- package/types/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.d.ts +1 -1
- package/types/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.d.ts +1 -1
- package/types/plugins/filterable/components/filterable-menus/TextFilterMenu.d.ts +1 -1
- package/types/plugins/filterable/helper.d.ts +15 -3
- package/types/plugins/pagination/components/Paginator.d.ts +1 -1
- package/types/plugins/pagination/components/PerPageDropdown.d.ts +1 -1
- package/types/plugins/sortable/sorter.d.ts +1 -1
- package/types/renders/styled.d.ts +3 -3
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
|
@@ -3,33 +3,39 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
6
12
|
var React = require('react');
|
|
7
|
-
var
|
|
8
|
-
var system = require('@elliemae/ds-utilities/system');
|
|
13
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
9
14
|
var utils = require('../utils.js');
|
|
10
15
|
|
|
11
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
17
|
|
|
13
18
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
14
|
-
var useResizeObserver__default = /*#__PURE__*/_interopDefaultLegacy(useResizeObserver);
|
|
15
19
|
|
|
16
20
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
21
|
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
19
|
-
function getTableProps(tableProps, {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
23
|
+
function getTableProps(tableProps, _ref) {
|
|
24
|
+
let {
|
|
25
|
+
refs,
|
|
26
|
+
tableRef,
|
|
27
|
+
bodyWidth,
|
|
28
|
+
scrollbarWidth,
|
|
29
|
+
isDragging,
|
|
30
|
+
columnSizeService,
|
|
31
|
+
updateRowWidth,
|
|
32
|
+
columns
|
|
33
|
+
} = _ref;
|
|
29
34
|
const [tableNode, tableRefCallback] = React.useState();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
dsUtilities.useResizeObserver(_ref2 => {
|
|
36
|
+
let {
|
|
37
|
+
width
|
|
38
|
+
} = _ref2;
|
|
33
39
|
if (!refs.header.current) return;
|
|
34
40
|
if (typeof scrollbarWidth.current !== 'number') scrollbarWidth.current = utils.getScrollbarSizeFromHeaderAndBody(refs);
|
|
35
41
|
if (typeof bodyWidth.current !== 'number') bodyWidth.current = refs.body.offsetWidth; // DataGrid: header with width 0 after redirect from details page (https://jira.elliemae.io/browse/PUI-2162)
|
|
@@ -50,7 +56,7 @@ function getTableProps(tableProps, {
|
|
|
50
56
|
if (typeof bodyWidth.current !== 'number') bodyWidth.current = refs.body.clientWidth;
|
|
51
57
|
}, [columns, tableNode]);
|
|
52
58
|
return _objectSpread(_objectSpread({}, tableProps), {}, {
|
|
53
|
-
innerRef:
|
|
59
|
+
innerRef: dsUtilities.mergeRefs(tableRefCallback, tableProps.innerRef, tableRef)
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
62
|
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
10
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.reduce.js');
|
|
4
14
|
var React = require('react');
|
|
5
15
|
var utils = require('./utils.js');
|
|
6
16
|
|
|
@@ -10,7 +20,7 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
10
20
|
|
|
11
21
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
12
22
|
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
24
|
function useColumnSizeService(instance) {
|
|
15
25
|
const columns = React.useRef({});
|
|
16
26
|
const [expandableGridDetailWidth, setExpandableGridDetailWidth] = React.useState(0);
|
|
@@ -47,7 +57,7 @@ function useColumnSizeService(instance) {
|
|
|
47
57
|
const columnsArray = Object.values(columns.current);
|
|
48
58
|
columnsArray.forEach(column => {
|
|
49
59
|
const columnOffsetWidth = column.node.offsetWidth;
|
|
50
|
-
column.updateBodyHeaderWidth(
|
|
60
|
+
column.updateBodyHeaderWidth("".concat(columnOffsetWidth, "px"), "".concat(columnOffsetWidth, "px"));
|
|
51
61
|
});
|
|
52
62
|
};
|
|
53
63
|
|
|
@@ -101,7 +111,7 @@ function useColumnSizeService(instance) {
|
|
|
101
111
|
|
|
102
112
|
if (percentValue) {
|
|
103
113
|
const pxs = gridWidth * percentValue / 100;
|
|
104
|
-
const pxWidths =
|
|
114
|
+
const pxWidths = "".concat(utils.getColumnWidthSize(pxs, minColumnWidth, column), "px");
|
|
105
115
|
column.updateBodyHeaderWidth(pxWidths, pxWidths);
|
|
106
116
|
columns.current[column.uuid].computedWidth = pxs;
|
|
107
117
|
|
|
@@ -114,7 +124,7 @@ function useColumnSizeService(instance) {
|
|
|
114
124
|
const percentWidth = columnFixWidth / gridWidth * 100;
|
|
115
125
|
const pxs = gridWidth * percentWidth / 100;
|
|
116
126
|
const actualWidthAfterChecks = utils.getColumnWidthSize(pxs, minColumnWidth, column);
|
|
117
|
-
column.updateBodyHeaderWidth(
|
|
127
|
+
column.updateBodyHeaderWidth("".concat(actualWidthAfterChecks, "px"), column.minWidth || minColumnWidth ? "".concat(column.minWidth || minColumnWidth, "px") : "".concat(pxs, "px"));
|
|
118
128
|
resizedColumns.current[column.uuid] = actualWidthAfterChecks;
|
|
119
129
|
columns.current[column.uuid].computedWidth = actualWidthAfterChecks;
|
|
120
130
|
}
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
8
|
var stylesheet = require('stylesheet-helpers');
|
|
6
9
|
var React = require('react');
|
|
7
|
-
var
|
|
10
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
8
11
|
var getColumnNameFromProperty = require('./getColumnNameFromProperty.js');
|
|
9
12
|
var getScrollbarSize = require('../../utilities/getScrollbarSize.js');
|
|
10
13
|
|
|
@@ -17,32 +20,30 @@ function _interopNamespace(e) {
|
|
|
17
20
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
21
|
Object.defineProperty(n, k, d.get ? d : {
|
|
19
22
|
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return e[k];
|
|
22
|
-
}
|
|
23
|
+
get: function () { return e[k]; }
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
|
-
n[
|
|
28
|
+
n["default"] = e;
|
|
28
29
|
return Object.freeze(n);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
var stylesheet__namespace = /*#__PURE__*/_interopNamespace(stylesheet);
|
|
32
33
|
|
|
33
|
-
/* eslint-disable no-param-reassign */
|
|
34
34
|
const SCROLLBAR_WIDTH = getScrollbarSize.getScrollbarWidth();
|
|
35
|
-
const RowStylesheetHelper =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
const RowStylesheetHelper = _ref => {
|
|
36
|
+
let {
|
|
37
|
+
grid,
|
|
38
|
+
className
|
|
39
|
+
} = _ref;
|
|
39
40
|
const {
|
|
40
41
|
styleSheet,
|
|
41
42
|
styleSheetElement
|
|
42
43
|
} = stylesheet__namespace.create();
|
|
43
44
|
|
|
44
45
|
const update = width => {
|
|
45
|
-
const widths = typeof width === 'string' ? width :
|
|
46
|
+
const widths = typeof width === 'string' ? width : "".concat(width, "px");
|
|
46
47
|
stylesheet__namespace.updateProperties(window, styleSheet, className, width ? {
|
|
47
48
|
width: widths,
|
|
48
49
|
minWidth: widths,
|
|
@@ -55,8 +56,8 @@ const RowStylesheetHelper = ({
|
|
|
55
56
|
const {
|
|
56
57
|
hasScroll
|
|
57
58
|
} = grid.getState();
|
|
58
|
-
const headerWidth =
|
|
59
|
-
stylesheet__namespace.updateProperties(window, styleSheet,
|
|
59
|
+
const headerWidth = "".concat(width + (hasScroll ? SCROLLBAR_WIDTH : 0), "px");
|
|
60
|
+
stylesheet__namespace.updateProperties(window, styleSheet, "".concat(className, "-header"), width ? {
|
|
60
61
|
width: headerWidth,
|
|
61
62
|
minWidth: headerWidth,
|
|
62
63
|
maxWidth: headerWidth
|
|
@@ -78,58 +79,68 @@ const RowStylesheetHelper = ({
|
|
|
78
79
|
};
|
|
79
80
|
};
|
|
80
81
|
|
|
81
|
-
const getColumnClassName =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
const getColumnClassName = _ref2 => {
|
|
83
|
+
let {
|
|
84
|
+
globalId,
|
|
85
|
+
column,
|
|
86
|
+
isHeader = false,
|
|
87
|
+
getId
|
|
88
|
+
} = _ref2;
|
|
89
|
+
return "column-".concat(globalId, "-").concat(getId(column)).concat(isHeader ? '-header' : '');
|
|
90
|
+
};
|
|
87
91
|
|
|
88
|
-
function setWidth({
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
function setWidth(_ref3) {
|
|
93
|
+
let {
|
|
94
|
+
styleSheet,
|
|
95
|
+
className,
|
|
96
|
+
width,
|
|
97
|
+
minWidth
|
|
98
|
+
} = _ref3;
|
|
94
99
|
let widths;
|
|
95
100
|
if (typeof width === 'string') widths = width;
|
|
96
|
-
if (typeof width === 'number') widths =
|
|
101
|
+
if (typeof width === 'number') widths = "".concat(width, "px");
|
|
97
102
|
let minWidths;
|
|
98
103
|
if (typeof minWidth === 'string') minWidths = minWidth;
|
|
99
|
-
if (typeof minWidth === 'number') minWidths =
|
|
104
|
+
if (typeof minWidth === 'number') minWidths = "".concat(minWidth, "px");
|
|
100
105
|
stylesheet__namespace.updateProperties(window, styleSheet, className, {
|
|
101
|
-
width:
|
|
102
|
-
minWidth:
|
|
106
|
+
width: "".concat(widths || minWidths),
|
|
107
|
+
minWidth: "".concat(widths || minWidths),
|
|
103
108
|
// minWidth: `${minWidths || widths}`,
|
|
104
|
-
maxWidth:
|
|
109
|
+
maxWidth: "".concat(widths || minWidths)
|
|
105
110
|
});
|
|
106
111
|
}
|
|
107
112
|
|
|
108
|
-
function updateStyle({
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
function updateStyle(_ref4) {
|
|
114
|
+
let {
|
|
115
|
+
styleSheet,
|
|
116
|
+
className,
|
|
117
|
+
style
|
|
118
|
+
} = _ref4;
|
|
113
119
|
stylesheet__namespace.updateProperties(window, styleSheet, className, style);
|
|
114
120
|
}
|
|
115
121
|
|
|
116
|
-
function columnSizesHelperImpl({
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
function columnSizesHelperImpl(_ref5) {
|
|
123
|
+
let {
|
|
124
|
+
globalId,
|
|
125
|
+
getId = _ref6 => {
|
|
126
|
+
let {
|
|
127
|
+
property
|
|
128
|
+
} = _ref6;
|
|
129
|
+
return getColumnNameFromProperty(property);
|
|
130
|
+
}
|
|
131
|
+
} = _ref5;
|
|
122
132
|
const {
|
|
123
133
|
styleSheetElement,
|
|
124
134
|
styleSheet
|
|
125
135
|
} = stylesheet__namespace.create();
|
|
126
136
|
|
|
127
|
-
const updateBodyHeaderWidth =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
137
|
+
const updateBodyHeaderWidth = _ref7 => {
|
|
138
|
+
let {
|
|
139
|
+
className,
|
|
140
|
+
headerClassName,
|
|
141
|
+
width,
|
|
142
|
+
minWidth
|
|
143
|
+
} = _ref7;
|
|
133
144
|
setWidth({
|
|
134
145
|
styleSheet,
|
|
135
146
|
className,
|
|
@@ -158,9 +169,9 @@ function columnSizesHelperImpl({
|
|
|
158
169
|
getId,
|
|
159
170
|
column
|
|
160
171
|
});
|
|
161
|
-
const headerClassName =
|
|
162
|
-
|
|
163
|
-
|
|
172
|
+
const headerClassName = "".concat(cellClassName, "-header");
|
|
173
|
+
dsUtilities.set(column, 'header.props.className', headerClassName);
|
|
174
|
+
dsUtilities.set(column, 'cell.props.className', cellClassName);
|
|
164
175
|
|
|
165
176
|
column.updateBodyHeaderWidth = (width, minWidth) => {
|
|
166
177
|
updateBodyHeaderWidth({
|
|
@@ -213,11 +224,11 @@ function columnSizesHelperImpl({
|
|
|
213
224
|
},
|
|
214
225
|
|
|
215
226
|
getColumnHeaderClassName(column) {
|
|
216
|
-
return
|
|
227
|
+
return "".concat(getColumnClassName({
|
|
217
228
|
globalId,
|
|
218
229
|
getId,
|
|
219
230
|
column
|
|
220
|
-
})
|
|
231
|
+
}), "-header");
|
|
221
232
|
},
|
|
222
233
|
|
|
223
234
|
cleanup() {
|
|
@@ -236,11 +247,14 @@ function useStylesheetHelpers(grid) {
|
|
|
236
247
|
} = grid;
|
|
237
248
|
const [columnsStylesheet] = React.useState(() => columnSizesHelperImpl({
|
|
238
249
|
globalId: bindColumnsSizeTo || grid.uuid,
|
|
239
|
-
getId:
|
|
240
|
-
|
|
241
|
-
|
|
250
|
+
getId: _ref8 => {
|
|
251
|
+
let {
|
|
252
|
+
uuid
|
|
253
|
+
} = _ref8;
|
|
254
|
+
return getColumnNameFromProperty(uuid);
|
|
255
|
+
}
|
|
242
256
|
}));
|
|
243
|
-
const rowClassName =
|
|
257
|
+
const rowClassName = "row-".concat(bindRowSizeTo || grid.uuid);
|
|
244
258
|
const [rowsStylesheet] = React.useState(() => RowStylesheetHelper({
|
|
245
259
|
grid,
|
|
246
260
|
className: rowClassName
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
6
9
|
|
|
7
10
|
function getScrollbarSizeFromHeaderAndBody(refs) {
|
|
8
|
-
const innerBodyOffsetWidth =
|
|
9
|
-
const headerOffsetWidth =
|
|
11
|
+
const innerBodyOffsetWidth = dsUtilities.get(refs, ['innerBody', 'current', 'offsetWidth']);
|
|
12
|
+
const headerOffsetWidth = dsUtilities.get(refs, ['header', 'current', 'offsetWidth']);
|
|
10
13
|
return headerOffsetWidth - innerBodyOffsetWidth;
|
|
11
14
|
}
|
|
12
15
|
const isScrollbarVisible = element => element.scrollHeight > element.clientHeight;
|
|
@@ -25,9 +28,10 @@ const getColumnWidthSize = (width, minWidth, column) => {
|
|
|
25
28
|
};
|
|
26
29
|
const calculateMinWidthForWrappedText = columns => {
|
|
27
30
|
let longestWord = 0;
|
|
28
|
-
columns.forEach(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
columns.forEach(_ref => {
|
|
32
|
+
let {
|
|
33
|
+
label
|
|
34
|
+
} = _ref;
|
|
31
35
|
const localLongestWord = label.split(' ').sort((a, b) => b.length - a.length)[0].length;
|
|
32
36
|
if (localLongestWord > longestWord) longestWord = localLongestWord;
|
|
33
37
|
});
|
|
@@ -9,9 +9,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
|
|
10
10
|
var createInstancePlugin__default = /*#__PURE__*/_interopDefaultLegacy(createInstancePlugin);
|
|
11
11
|
|
|
12
|
-
const decorateColumn = (column, grid) => addCustomRendererToCell[
|
|
12
|
+
const decorateColumn = (column, grid) => addCustomRendererToCell["default"](grid)(column);
|
|
13
13
|
|
|
14
|
-
const CustomRendererPlugin = createInstancePlugin__default[
|
|
14
|
+
const CustomRendererPlugin = createInstancePlugin__default["default"]('custom-renderer', {
|
|
15
15
|
decorateColumn
|
|
16
16
|
});
|
|
17
17
|
|
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
10
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
-
var
|
|
11
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
7
12
|
var initColumnDefinition = require('@elliemae/ds-shared/useDataGrid/initColumnDefinition');
|
|
8
13
|
var getRendererComponent = require('./getRendererComponent.js');
|
|
9
14
|
|
|
@@ -13,7 +18,7 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
13
18
|
|
|
14
19
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
20
|
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
21
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
22
|
const getRenderer = (renderer, grid, column) => (value, metaData) => {
|
|
18
23
|
const {
|
|
19
24
|
props: {
|
|
@@ -46,14 +51,14 @@ const addCustomRendererToCell = grid => column => {
|
|
|
46
51
|
const {
|
|
47
52
|
customRenderer
|
|
48
53
|
} = column;
|
|
49
|
-
const customHeaderRenderer =
|
|
54
|
+
const customHeaderRenderer = dsUtilities.get(column, ['header', 'customRenderer']);
|
|
50
55
|
if (!customRenderer && !customHeaderRenderer) return column;
|
|
51
56
|
|
|
52
|
-
if (
|
|
57
|
+
if (dsUtilities.isFunction(customHeaderRenderer)) {
|
|
53
58
|
column.header.formatters.push(getRenderer(customHeaderRenderer, grid));
|
|
54
59
|
}
|
|
55
60
|
|
|
56
|
-
if (
|
|
61
|
+
if (dsUtilities.isFunction(customRenderer)) {
|
|
57
62
|
column = initColumnDefinition.appendCellFormatter(getRenderer(customRenderer, grid, column), column);
|
|
58
63
|
} else {
|
|
59
64
|
if (!customRenderer) return column;
|
|
@@ -63,5 +68,5 @@ const addCustomRendererToCell = grid => column => {
|
|
|
63
68
|
return column;
|
|
64
69
|
};
|
|
65
70
|
|
|
66
|
-
exports[
|
|
71
|
+
exports["default"] = addCustomRendererToCell;
|
|
67
72
|
exports.getRenderer = getRenderer;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
5
10
|
require('react');
|
|
6
|
-
var DSButton = require('@elliemae/ds-
|
|
7
|
-
var
|
|
8
|
-
var DSComboBox = require('@elliemae/ds-basic/form/ComboBox');
|
|
9
|
-
var DSRadio = require('@elliemae/ds-basic/form/Radio');
|
|
10
|
-
var DSTextBox = require('@elliemae/ds-basic/form/TextBox');
|
|
11
|
-
var DSToggle = require('@elliemae/ds-basic/form/Toggle');
|
|
11
|
+
var DSButton = require('@elliemae/ds-button');
|
|
12
|
+
var dsForm = require('@elliemae/ds-form');
|
|
12
13
|
var DSDropdownMenu = require('@elliemae/ds-dropdownmenu');
|
|
13
14
|
var index = require('../../components/renderers/index.js');
|
|
14
15
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -18,38 +19,36 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
18
19
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
19
20
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
20
21
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
21
|
-
var DSCheckbox__default = /*#__PURE__*/_interopDefaultLegacy(DSCheckbox);
|
|
22
|
-
var DSComboBox__default = /*#__PURE__*/_interopDefaultLegacy(DSComboBox);
|
|
23
|
-
var DSRadio__default = /*#__PURE__*/_interopDefaultLegacy(DSRadio);
|
|
24
|
-
var DSTextBox__default = /*#__PURE__*/_interopDefaultLegacy(DSTextBox);
|
|
25
|
-
var DSToggle__default = /*#__PURE__*/_interopDefaultLegacy(DSToggle);
|
|
26
22
|
var DSDropdownMenu__default = /*#__PURE__*/_interopDefaultLegacy(DSDropdownMenu);
|
|
27
23
|
|
|
28
24
|
const _excluded = ["type", "handlers"];
|
|
29
25
|
|
|
30
26
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
31
27
|
|
|
32
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
28
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
33
29
|
const components = {
|
|
34
|
-
DSButton: DSButton__default[
|
|
35
|
-
DSCheckbox:
|
|
36
|
-
DSComboBox:
|
|
37
|
-
DSRadio:
|
|
38
|
-
DSTextBox:
|
|
39
|
-
DSToggle:
|
|
40
|
-
DSDropdownMenu: DSDropdownMenu__default[
|
|
30
|
+
DSButton: DSButton__default["default"],
|
|
31
|
+
DSCheckbox: dsForm.DSCheckbox,
|
|
32
|
+
DSComboBox: dsForm.DSComboBox,
|
|
33
|
+
DSRadio: dsForm.DSRadio,
|
|
34
|
+
DSTextBox: dsForm.DSTextBox,
|
|
35
|
+
DSToggle: dsForm.DSToggle,
|
|
36
|
+
DSDropdownMenu: DSDropdownMenu__default["default"]
|
|
41
37
|
};
|
|
42
38
|
|
|
43
|
-
const getRendererComponent = ({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
const getRendererComponent = (_ref2, _ref, _ref3) => {
|
|
40
|
+
let {
|
|
41
|
+
props
|
|
42
|
+
} = _ref2;
|
|
43
|
+
let {
|
|
44
|
+
rowData
|
|
45
|
+
} = _ref3;
|
|
46
|
+
|
|
48
47
|
let {
|
|
49
48
|
type = 'DSTextBox',
|
|
50
49
|
handlers
|
|
51
50
|
} = _ref,
|
|
52
|
-
rest = _objectWithoutProperties__default[
|
|
51
|
+
rest = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
53
52
|
|
|
54
53
|
const Component = components[type] || index[type];
|
|
55
54
|
const {
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
4
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
5
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
3
8
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
9
|
var React = require('react');
|
|
5
|
-
var
|
|
10
|
+
var dsForm = require('@elliemae/ds-form');
|
|
6
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
12
|
|
|
8
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
14
|
|
|
10
15
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
11
|
-
var DSComboBox__default = /*#__PURE__*/_interopDefaultLegacy(DSComboBox);
|
|
12
16
|
|
|
13
17
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
14
18
|
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
16
20
|
class ComboBox extends React.Component {
|
|
17
21
|
constructor(props) {
|
|
18
22
|
super(props);
|
|
@@ -50,7 +54,7 @@ class ComboBox extends React.Component {
|
|
|
50
54
|
const {
|
|
51
55
|
value
|
|
52
56
|
} = this.state;
|
|
53
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
57
|
+
return /*#__PURE__*/jsxRuntime.jsx(dsForm.DSComboBox, _objectSpread(_objectSpread({}, this.props), {}, {
|
|
54
58
|
menuIsOpen: true,
|
|
55
59
|
onBlur: this.handleBlur,
|
|
56
60
|
onChange: this.handleChange,
|
|
@@ -60,9 +64,8 @@ class ComboBox extends React.Component {
|
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
}
|
|
63
|
-
|
|
64
|
-
_defineProperty__default['default'](ComboBox, "defaultProps", {
|
|
67
|
+
ComboBox.defaultProps = {
|
|
65
68
|
onValue: () => null
|
|
66
|
-
}
|
|
69
|
+
};
|
|
67
70
|
|
|
68
71
|
module.exports = ComboBox;
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
4
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
5
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
3
8
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
9
|
var React = require('react');
|
|
5
|
-
var
|
|
10
|
+
var dsForm = require('@elliemae/ds-form');
|
|
6
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
12
|
|
|
8
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
14
|
|
|
10
15
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
11
16
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
-
var DSTextBox__default = /*#__PURE__*/_interopDefaultLegacy(DSTextBox);
|
|
13
17
|
|
|
14
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
19
|
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
21
|
class TextBox extends React.Component {
|
|
18
22
|
constructor(props) {
|
|
19
23
|
super(props);
|
|
20
|
-
this.inputRef = /*#__PURE__*/React__default[
|
|
24
|
+
this.inputRef = /*#__PURE__*/React__default["default"].createRef();
|
|
21
25
|
this.state = {
|
|
22
26
|
value: props.value
|
|
23
27
|
};
|
|
@@ -35,12 +39,13 @@ class TextBox extends React.Component {
|
|
|
35
39
|
}, 50);
|
|
36
40
|
}
|
|
37
41
|
|
|
38
|
-
handleKeyUp({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
handleKeyUp(_ref) {
|
|
43
|
+
let {
|
|
44
|
+
key,
|
|
45
|
+
target: {
|
|
46
|
+
value
|
|
47
|
+
}
|
|
48
|
+
} = _ref;
|
|
44
49
|
const {
|
|
45
50
|
onValue
|
|
46
51
|
} = this.props;
|
|
@@ -69,11 +74,12 @@ class TextBox extends React.Component {
|
|
|
69
74
|
onValue(value);
|
|
70
75
|
}
|
|
71
76
|
|
|
72
|
-
handleChange({
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
handleChange(_ref2) {
|
|
78
|
+
let {
|
|
79
|
+
target: {
|
|
80
|
+
value
|
|
81
|
+
}
|
|
82
|
+
} = _ref2;
|
|
77
83
|
this.setState({
|
|
78
84
|
value
|
|
79
85
|
});
|
|
@@ -83,7 +89,7 @@ class TextBox extends React.Component {
|
|
|
83
89
|
const {
|
|
84
90
|
value
|
|
85
91
|
} = this.state;
|
|
86
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
92
|
+
return /*#__PURE__*/jsxRuntime.jsx(dsForm.DSTextBox, _objectSpread(_objectSpread({
|
|
87
93
|
"data-testid": "ds-datagrids-editable-text-box"
|
|
88
94
|
}, this.props), {}, {
|
|
89
95
|
innerRef: this.inputRef,
|
|
@@ -97,9 +103,8 @@ class TextBox extends React.Component {
|
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
}
|
|
100
|
-
|
|
101
|
-
_defineProperty__default['default'](TextBox, "defaultProps", {
|
|
106
|
+
TextBox.defaultProps = {
|
|
102
107
|
onValue: () => null
|
|
103
|
-
}
|
|
108
|
+
};
|
|
104
109
|
|
|
105
110
|
module.exports = TextBox;
|