@elliemae/ds-shared 3.5.0-rc.0 → 3.5.0-rc.11
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/dist/cjs/Animations/BaseAnimation.js +9 -5
- package/dist/cjs/Animations/BaseAnimation.js.map +1 -1
- package/dist/cjs/Animations/Grow.js +9 -5
- package/dist/cjs/Animations/Grow.js.map +1 -1
- package/dist/cjs/Animations/GrowRight.js +9 -5
- package/dist/cjs/Animations/GrowRight.js.map +1 -1
- package/dist/cjs/Animations/GrowVertical.js +9 -5
- package/dist/cjs/Animations/GrowVertical.js.map +1 -1
- package/dist/cjs/Animations/index.js +4 -1
- package/dist/cjs/Animations/index.js.map +1 -1
- package/dist/cjs/CheckableGroup.js +4 -1
- package/dist/cjs/CheckableGroup.js.map +2 -2
- package/dist/cjs/DeferRenderAfterComputation.js +11 -4
- package/dist/cjs/DeferRenderAfterComputation.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGrid.js +15 -7
- package/dist/cjs/FocusGroup/FocusGrid.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGroup.js +10 -3
- package/dist/cjs/FocusGroup/FocusGroup.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGroupContext.js +4 -1
- package/dist/cjs/FocusGroup/FocusGroupContext.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGroupManager.js +10 -5
- package/dist/cjs/FocusGroup/FocusGroupManager.js.map +1 -1
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js +12 -8
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js.map +1 -1
- package/dist/cjs/FocusGroup/index.js +4 -1
- package/dist/cjs/FocusGroup/index.js.map +1 -1
- package/dist/cjs/FocusGroup/useFocusGroupItem.js +4 -1
- package/dist/cjs/FocusGroup/useFocusGroupItem.js.map +1 -1
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js +4 -1
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js.map +1 -1
- package/dist/cjs/GroupContext/Group.js +10 -5
- package/dist/cjs/GroupContext/Group.js.map +2 -2
- package/dist/cjs/GroupContext/GroupContext.js +4 -1
- package/dist/cjs/GroupContext/GroupContext.js.map +2 -2
- package/dist/cjs/GroupContext/GroupItem.js +8 -3
- package/dist/cjs/GroupContext/GroupItem.js.map +1 -1
- package/dist/cjs/GroupContext/index.js +4 -1
- package/dist/cjs/GroupContext/index.js.map +1 -1
- package/dist/cjs/ScrollSync/ScrollSync.js +9 -4
- package/dist/cjs/ScrollSync/ScrollSync.js.map +2 -2
- package/dist/cjs/ScrollSync/ScrollSyncPane.js +15 -7
- package/dist/cjs/ScrollSync/ScrollSyncPane.js.map +1 -1
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js +8 -2
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js.map +2 -2
- package/dist/cjs/ScrollSync/index.js +4 -1
- package/dist/cjs/ScrollSync/index.js.map +1 -1
- package/dist/cjs/ScrollSync/useScrollSync.js +4 -1
- package/dist/cjs/ScrollSync/useScrollSync.js.map +1 -1
- package/dist/cjs/constants.js +4 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/createDataInstance/createInstancePlugin.js +4 -1
- package/dist/cjs/createDataInstance/createInstancePlugin.js.map +1 -1
- package/dist/cjs/createDataInstance/createInstanceRef.js +24 -6
- package/dist/cjs/createDataInstance/createInstanceRef.js.map +2 -2
- package/dist/cjs/createDataInstance/index.js +4 -1
- package/dist/cjs/createDataInstance/index.js.map +1 -1
- package/dist/cjs/createDataInstance/utils.js +24 -6
- package/dist/cjs/createDataInstance/utils.js.map +1 -1
- package/dist/cjs/defer-render-hoc/index.js +7 -3
- package/dist/cjs/defer-render-hoc/index.js.map +2 -2
- package/dist/cjs/dimsum.config.js +4 -1
- package/dist/cjs/dimsum.config.js.map +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/prop-types.js +4 -1
- package/dist/cjs/prop-types.js.map +1 -1
- package/dist/cjs/react-spring/index.js +4 -1
- package/dist/cjs/react-spring/index.js.map +1 -1
- package/dist/cjs/react-spring/renderprops.js +4 -1
- package/dist/cjs/react-spring/renderprops.js.map +1 -1
- package/dist/cjs/toolbar/ToolbarProvider.js +51 -32
- package/dist/cjs/toolbar/ToolbarProvider.js.map +2 -2
- package/dist/cjs/useDataGrid/VolatileRowsListener.js +4 -1
- package/dist/cjs/useDataGrid/VolatileRowsListener.js.map +1 -1
- package/dist/cjs/useDataGrid/index.js +4 -1
- package/dist/cjs/useDataGrid/index.js.map +1 -1
- package/dist/cjs/useDataGrid/initColumnDefinition.js +30 -23
- package/dist/cjs/useDataGrid/initColumnDefinition.js.map +2 -2
- package/dist/cjs/useDataGrid/useDataGrid.js +84 -40
- package/dist/cjs/useDataGrid/useDataGrid.js.map +2 -2
- package/dist/cjs/useDataList/index.js +4 -1
- package/dist/cjs/useDataList/index.js.map +1 -1
- package/dist/cjs/useDataList/recordIterator.js +4 -1
- package/dist/cjs/useDataList/recordIterator.js.map +1 -1
- package/dist/cjs/useDataList/useDataList.js +26 -6
- package/dist/cjs/useDataList/useDataList.js.map +2 -2
- package/dist/cjs/utils.js +7 -2
- package/dist/cjs/utils.js.map +1 -1
- package/dist/cjs/virtualization/AutoHeightList.js +36 -30
- package/dist/cjs/virtualization/AutoHeightList.js.map +2 -2
- package/dist/cjs/virtualization/FluidHeightList.js +16 -9
- package/dist/cjs/virtualization/FluidHeightList.js.map +2 -2
- package/dist/cjs/virtualization/index.js +4 -1
- package/dist/cjs/virtualization/index.js.map +1 -1
- package/dist/esm/Animations/BaseAnimation.js +5 -4
- package/dist/esm/Animations/BaseAnimation.js.map +1 -1
- package/dist/esm/Animations/Grow.js +5 -4
- package/dist/esm/Animations/Grow.js.map +1 -1
- package/dist/esm/Animations/GrowRight.js +5 -4
- package/dist/esm/Animations/GrowRight.js.map +1 -1
- package/dist/esm/Animations/GrowVertical.js +5 -4
- package/dist/esm/Animations/GrowVertical.js.map +1 -1
- package/dist/esm/Animations/index.js.map +1 -1
- package/dist/esm/CheckableGroup.js.map +2 -2
- package/dist/esm/DeferRenderAfterComputation.js +7 -3
- package/dist/esm/DeferRenderAfterComputation.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGrid.js +11 -6
- package/dist/esm/FocusGroup/FocusGrid.js.map +2 -2
- package/dist/esm/FocusGroup/FocusGroup.js +6 -2
- package/dist/esm/FocusGroup/FocusGroup.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGroupContext.js.map +2 -2
- package/dist/esm/FocusGroup/FocusGroupManager.js +6 -4
- package/dist/esm/FocusGroup/FocusGroupManager.js.map +1 -1
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js +8 -7
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js.map +1 -1
- package/dist/esm/FocusGroup/index.js.map +1 -1
- package/dist/esm/FocusGroup/useFocusGroupItem.js.map +1 -1
- package/dist/esm/FocusGroup/utils/getNextCellPosition.js.map +1 -1
- package/dist/esm/GroupContext/Group.js +6 -4
- package/dist/esm/GroupContext/Group.js.map +1 -1
- package/dist/esm/GroupContext/GroupContext.js.map +2 -2
- package/dist/esm/GroupContext/GroupItem.js +4 -2
- package/dist/esm/GroupContext/GroupItem.js.map +1 -1
- package/dist/esm/GroupContext/index.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSync.js +5 -3
- package/dist/esm/ScrollSync/ScrollSync.js.map +2 -2
- package/dist/esm/ScrollSync/ScrollSyncPane.js +11 -6
- package/dist/esm/ScrollSync/ScrollSyncPane.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSyncProvider.js +4 -1
- package/dist/esm/ScrollSync/ScrollSyncProvider.js.map +2 -2
- package/dist/esm/ScrollSync/index.js.map +1 -1
- package/dist/esm/ScrollSync/useScrollSync.js.map +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/createDataInstance/createInstancePlugin.js.map +1 -1
- package/dist/esm/createDataInstance/createInstanceRef.js +20 -5
- package/dist/esm/createDataInstance/createInstanceRef.js.map +1 -1
- package/dist/esm/createDataInstance/index.js.map +1 -1
- package/dist/esm/createDataInstance/utils.js +20 -5
- package/dist/esm/createDataInstance/utils.js.map +1 -1
- package/dist/esm/defer-render-hoc/index.js +3 -2
- package/dist/esm/defer-render-hoc/index.js.map +1 -1
- package/dist/esm/dimsum.config.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/prop-types.js.map +1 -1
- package/dist/esm/react-spring/index.js.map +1 -1
- package/dist/esm/react-spring/renderprops.js.map +1 -1
- package/dist/esm/toolbar/ToolbarProvider.js +47 -31
- package/dist/esm/toolbar/ToolbarProvider.js.map +2 -2
- package/dist/esm/useDataGrid/VolatileRowsListener.js.map +1 -1
- package/dist/esm/useDataGrid/index.js.map +1 -1
- package/dist/esm/useDataGrid/initColumnDefinition.js +26 -22
- package/dist/esm/useDataGrid/initColumnDefinition.js.map +1 -1
- package/dist/esm/useDataGrid/useDataGrid.js +80 -39
- package/dist/esm/useDataGrid/useDataGrid.js.map +1 -1
- package/dist/esm/useDataList/index.js.map +1 -1
- package/dist/esm/useDataList/recordIterator.js.map +1 -1
- package/dist/esm/useDataList/useDataList.js +22 -5
- package/dist/esm/useDataList/useDataList.js.map +1 -1
- package/dist/esm/utils.js +3 -1
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/virtualization/AutoHeightList.js +32 -29
- package/dist/esm/virtualization/AutoHeightList.js.map +1 -1
- package/dist/esm/virtualization/FluidHeightList.js +12 -8
- package/dist/esm/virtualization/FluidHeightList.js.map +1 -1
- package/dist/esm/virtualization/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var useDataGrid_exports = {};
|
|
23
26
|
__export(useDataGrid_exports, {
|
|
@@ -58,7 +61,10 @@ const useDataGrid = ({
|
|
|
58
61
|
const [originalRows, updateRows] = (0, import_ds_utilities.useDerivedStateFromProps)(rows, {
|
|
59
62
|
onUpdate: resolve.resolve({
|
|
60
63
|
columns,
|
|
61
|
-
method: (extra) => (0, import_ds_utilities.compose)(
|
|
64
|
+
method: (extra) => (0, import_ds_utilities.compose)(
|
|
65
|
+
resolve.byFunction("valueTransformation")(extra),
|
|
66
|
+
resolve.nested(extra)
|
|
67
|
+
)
|
|
62
68
|
}),
|
|
63
69
|
updateOnStateChange: true
|
|
64
70
|
});
|
|
@@ -107,11 +113,13 @@ const useDataGrid = ({
|
|
|
107
113
|
registerHotKeys: [],
|
|
108
114
|
decorateColumn: [],
|
|
109
115
|
decorateColumns: [
|
|
110
|
-
(cols) => cols.map(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
(cols) => cols.map(
|
|
117
|
+
(col) => (0, import_initColumnDefinition.initColumnDefinition)({
|
|
118
|
+
useTextTruncation: col.useTextTruncation,
|
|
119
|
+
wrapText: props.wrapText,
|
|
120
|
+
normalize: props.normalizeDataKeys
|
|
121
|
+
})(col)
|
|
122
|
+
)
|
|
115
123
|
],
|
|
116
124
|
decorateRenderers: [],
|
|
117
125
|
getRowProps: [],
|
|
@@ -126,24 +134,30 @@ const useDataGrid = ({
|
|
|
126
134
|
plugins.forEach((plugin) => nextDecorators = plugin(nextDecorators));
|
|
127
135
|
return nextDecorators;
|
|
128
136
|
}, [plugins]);
|
|
129
|
-
instance.current = decorators.decorateGrid.reduce(
|
|
130
|
-
|
|
131
|
-
...decorator(instance.current)
|
|
132
|
-
}), instance.current);
|
|
133
|
-
instance.current = decorators.registerStateHook.reduce((nextInstance, decorator) => {
|
|
134
|
-
const { state, actions } = decorator(instance.current);
|
|
135
|
-
return {
|
|
137
|
+
instance.current = decorators.decorateGrid.reduce(
|
|
138
|
+
(nextInstance, decorator) => ({
|
|
136
139
|
...nextInstance,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
140
|
+
...decorator(instance.current)
|
|
141
|
+
}),
|
|
142
|
+
instance.current
|
|
143
|
+
);
|
|
144
|
+
instance.current = decorators.registerStateHook.reduce(
|
|
145
|
+
(nextInstance, decorator) => {
|
|
146
|
+
const { state, actions } = decorator(instance.current);
|
|
147
|
+
return {
|
|
148
|
+
...nextInstance,
|
|
149
|
+
state: {
|
|
150
|
+
...nextInstance.state,
|
|
151
|
+
...state
|
|
152
|
+
},
|
|
153
|
+
actions: {
|
|
154
|
+
...nextInstance.actions,
|
|
155
|
+
...actions
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
},
|
|
159
|
+
instance.current
|
|
160
|
+
);
|
|
147
161
|
const reduceHotKey = (nextInstance, { key, handler, options }) => ({
|
|
148
162
|
...nextInstance,
|
|
149
163
|
hotKeys: {
|
|
@@ -151,31 +165,61 @@ const useDataGrid = ({
|
|
|
151
165
|
[key]: { handler, options }
|
|
152
166
|
}
|
|
153
167
|
});
|
|
154
|
-
instance.current = decorators.registerHotKeys.reduce(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
168
|
+
instance.current = decorators.registerHotKeys.reduce(
|
|
169
|
+
(nextInstance, decorator) => {
|
|
170
|
+
const hotKeys = decorator(nextInstance);
|
|
171
|
+
if (Array.isArray(hotKeys)) {
|
|
172
|
+
return hotKeys.reduce(reduceHotKey, nextInstance);
|
|
173
|
+
}
|
|
174
|
+
return reduceHotKey(nextInstance, hotKeys);
|
|
175
|
+
},
|
|
176
|
+
instance.current
|
|
177
|
+
);
|
|
178
|
+
instance.current.decoratedRenderers = (0, import_utils.applyDecorators)(
|
|
179
|
+
instance.current.decoratedRenderers,
|
|
180
|
+
decorators.decorateRenderers,
|
|
181
|
+
instance.current
|
|
182
|
+
);
|
|
162
183
|
instance.current.decoratedColumns = (0, import_react.useMemo)(() => {
|
|
163
|
-
const visibleColumns = (0, import_ds_utilities.cloneDeep)(columns).filter(
|
|
184
|
+
const visibleColumns = (0, import_ds_utilities.cloneDeep)(columns).filter(
|
|
185
|
+
(column) => typeof column.visible === "undefined" || column.visible
|
|
186
|
+
);
|
|
164
187
|
return visibleColumns.length ? (0, import_utils.decorateColumns)(visibleColumns, decorators, instance.current) : [];
|
|
165
188
|
}, [columns]);
|
|
166
|
-
instance.current.getBodyProps = (0, import_utils.reducePropsGetter)(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
instance.current.
|
|
171
|
-
|
|
189
|
+
instance.current.getBodyProps = (0, import_utils.reducePropsGetter)(
|
|
190
|
+
decorators.getBodyProps,
|
|
191
|
+
instance.current
|
|
192
|
+
);
|
|
193
|
+
instance.current.getHeaderProps = (0, import_utils.reducePropsGetter)(
|
|
194
|
+
decorators.getHeaderProps,
|
|
195
|
+
instance.current
|
|
196
|
+
);
|
|
197
|
+
instance.current.getRowProps = (0, import_utils.reducePropsGetter)(
|
|
198
|
+
decorators.getRowProps,
|
|
199
|
+
instance.current
|
|
200
|
+
);
|
|
201
|
+
instance.current.getHeaderRowProps = (0, import_utils.reducePropsGetter)(
|
|
202
|
+
decorators.getHeaderRowProps,
|
|
203
|
+
instance.current
|
|
204
|
+
);
|
|
205
|
+
instance.current.getTableProps = (0, import_utils.reducePropsGetter)(
|
|
206
|
+
decorators.getTableProps,
|
|
207
|
+
instance.current
|
|
208
|
+
);
|
|
209
|
+
instance.current.composedRows = decorators.composeRows.reduce(
|
|
210
|
+
(nextRows, getter) => getter(nextRows, instance.current),
|
|
211
|
+
instance.current.composedRows
|
|
212
|
+
);
|
|
172
213
|
RowsObserver.notify(instance.current.composedRows);
|
|
173
214
|
const currentShouldRefocus = instance.current.shouldRefocus.current;
|
|
174
215
|
const prevState = (0, import_ds_utilities.usePrevious)(instance.current.state);
|
|
175
216
|
if ((0, import_ds_utilities.isObject)(currentShouldRefocus) && currentShouldRefocus.forced) {
|
|
176
217
|
instance.current.shouldRefocus.current = currentShouldRefocus.value;
|
|
177
218
|
} else {
|
|
178
|
-
instance.current.shouldRefocus.current = !(0, import_ds_utilities.isEqual)(
|
|
219
|
+
instance.current.shouldRefocus.current = !(0, import_ds_utilities.isEqual)(
|
|
220
|
+
prevState,
|
|
221
|
+
instance.current.state
|
|
222
|
+
);
|
|
179
223
|
}
|
|
180
224
|
if (props.instanceRef)
|
|
181
225
|
(0, import_ds_utilities.setRef)(props.instanceRef, instance.current);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/useDataGrid/useDataGrid.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\nimport {\n cloneDeep,\n compose,\n isEqual,\n isObject,\n setRef, \n usePrevious, \n useDerivedStateFromProps \n} from '@elliemae/ds-utilities';\nimport { useMemo, useRef, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport * as resolve from 'table-resolver';\nimport { initColumnDefinition } from './initColumnDefinition';\nimport {\n applyDecorators,\n decorateColumns,\n reducePropsGetter,\n} from '../createDataInstance/utils';\nimport { VolatileRowsListener } from './VolatileRowsListener';\nimport { isInternetExplorer } from '../utils';\n\nconst IS_INTERNET_EXPLORER = isInternetExplorer();\n\n// TODO: Reuse createDataInstance for the grid the same\n// way as the list does ex: packages/ds-shared/src/useDataList/useDataList.js\n// eslint-disable-next-line max-statements\nexport const useDataGrid = ({\n uuid: uuidProp,\n plugins: pluginsFromProps,\n rows,\n columns,\n renderers = {},\n ...props\n}) => {\n const plugins = pluginsFromProps;\n const instance = useRef();\n const tableRef = useRef();\n const headerRef = useRef();\n const bodyRef = useRef();\n const bodyInnerRef = useRef();\n const [uuid] = useState(uuidProp || (() => uuidv4()));\n const [hasScroll, setHasScroll] = useState(false);\n const [isRowDragging, setIsRowDragging] = useState(false);\n const isScrolling = useRef();\n const shouldRefocus = useRef(); // todo: we probably need a plugin for focus related stuff\n const [RowsObserver] = useState(() => new VolatileRowsListener());\n\n // todo move this with rows composition\n const [originalRows, updateRows] = useDerivedStateFromProps(rows, {\n onUpdate: resolve.resolve({\n columns,\n method: (extra) =>\n compose(\n resolve.byFunction('valueTransformation')(extra),\n resolve.nested(extra),\n ),\n }),\n updateOnStateChange: true,\n });\n\n instance.current = {\n decoratedRenderers: cloneDeep(renderers),\n decoratedColumns: columns,\n columns,\n rows,\n composedRows: originalRows,\n getRowProps: [],\n getHeaderRowProps: [],\n getBodyProps: [],\n getTableProps: [],\n effects: [],\n uuid,\n props,\n refs: {\n table: tableRef,\n body: bodyRef,\n header: headerRef,\n innerBody: bodyInnerRef,\n },\n state: {\n hasScroll,\n },\n actions: {\n updateRows,\n },\n updateRows,\n // eslint-disable-next-line no-return-assign\n enableEvents: () =>\n (document.body.style.pointerEvents = IS_INTERNET_EXPLORER ? '' : null),\n // eslint-disable-next-line no-return-assign\n disableEvents: () => (document.body.style.pointerEvents = 'none'),\n observeRows: (observer) => RowsObserver.observe(observer),\n hotKeys: {},\n shouldRefocus,\n isScrolling,\n setHasScroll,\n setIsRowDragging,\n isRowDragging,\n plugins,\n };\n instance.current.getState = () => instance.current.state;\n instance.current.getInstance = () => instance.current;\n\n const defaultDecorators = {\n decorateGrid: [],\n registerStateHook: [],\n registerHotKeys: [],\n decorateColumn: [],\n decorateColumns: [\n (cols) =>\n cols.map((col) =>\n initColumnDefinition({\n useTextTruncation: col.useTextTruncation,\n wrapText: props.wrapText,\n normalize: props.normalizeDataKeys,\n })(col),\n ),\n ],\n decorateRenderers: [],\n getRowProps: [],\n getHeaderRowProps: [],\n getBodyProps: [],\n getTableProps: [],\n getHeaderProps: [],\n composeRows: [],\n };\n\n const decorators = useMemo(() => {\n let nextDecorators = defaultDecorators;\n // eslint-disable-next-line no-return-assign\n plugins.forEach((plugin) => (nextDecorators = plugin(nextDecorators)));\n return nextDecorators;\n }, [plugins]);\n\n instance.current = decorators.decorateGrid.reduce(\n (nextInstance, decorator) => ({\n ...nextInstance,\n ...decorator(instance.current),\n }),\n instance.current,\n );\n\n instance.current = decorators.registerStateHook.reduce(\n (nextInstance, decorator) => {\n const { state, actions } = decorator(instance.current);\n return {\n ...nextInstance,\n state: {\n ...nextInstance.state,\n ...state,\n },\n actions: {\n ...nextInstance.actions,\n ...actions,\n },\n };\n },\n instance.current,\n );\n\n const reduceHotKey = (nextInstance, { key, handler, options }) => ({\n ...nextInstance,\n hotKeys: {\n ...nextInstance.hotKeys,\n [key]: { handler, options },\n },\n });\n instance.current = decorators.registerHotKeys.reduce(\n (nextInstance, decorator) => {\n const hotKeys = decorator(nextInstance);\n if (Array.isArray(hotKeys)) {\n return hotKeys.reduce(reduceHotKey, nextInstance);\n }\n return reduceHotKey(nextInstance, hotKeys);\n },\n instance.current,\n );\n\n instance.current.decoratedRenderers = applyDecorators(\n instance.current.decoratedRenderers,\n decorators.decorateRenderers,\n instance.current,\n );\n\n instance.current.decoratedColumns = useMemo(() => {\n const visibleColumns = cloneDeep(columns).filter(\n (column) => typeof column.visible === 'undefined' || column.visible,\n );\n return visibleColumns.length\n ? decorateColumns(visibleColumns, decorators, instance.current)\n : [];\n }, [columns]);\n\n instance.current.getBodyProps = reducePropsGetter(\n decorators.getBodyProps,\n instance.current,\n );\n instance.current.getHeaderProps = reducePropsGetter(\n decorators.getHeaderProps,\n instance.current,\n );\n instance.current.getRowProps = reducePropsGetter(\n decorators.getRowProps,\n instance.current,\n );\n instance.current.getHeaderRowProps = reducePropsGetter(\n decorators.getHeaderRowProps,\n instance.current,\n );\n instance.current.getTableProps = reducePropsGetter(\n decorators.getTableProps,\n instance.current,\n );\n\n instance.current.composedRows = decorators.composeRows.reduce(\n (nextRows, getter) => getter(nextRows, instance.current),\n instance.current.composedRows,\n );\n\n RowsObserver.notify(instance.current.composedRows);\n\n const currentShouldRefocus = instance.current.shouldRefocus.current;\n const prevState = usePrevious(instance.current.state);\n if (isObject(currentShouldRefocus) && currentShouldRefocus.forced) {\n instance.current.shouldRefocus.current = currentShouldRefocus.value;\n } else {\n instance.current.shouldRefocus.current = !isEqual(\n prevState,\n instance.current.state,\n );\n }\n\n if (props.instanceRef) setRef(props.instanceRef, instance.current);\n\n return {\n ...instance.current,\n decorators,\n };\n};\n\nexport default useDataGrid;\n\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAQO;AACP,mBAA0C;AAC1C,kBAA6B;AAC7B,cAAyB;AACzB,kCAAqC;AACrC,mBAIO;AACP,kCAAqC;AACrC,IAAAA,gBAAmC;AAEnC,MAAM,2BAAuB,kCAAmB;AAKzC,MAAM,cAAc,CAAC;AAAA,EAC1B,MAAM;AAAA,EACN,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,YAAY,CAAC;AAAA,KACV;AACL,MAAM;AACJ,QAAM,UAAU;AAChB,QAAM,eAAW,qBAAO;AACxB,QAAM,eAAW,qBAAO;AACxB,QAAM,gBAAY,qBAAO;AACzB,QAAM,cAAU,qBAAO;AACvB,QAAM,mBAAe,qBAAO;AAC5B,QAAM,CAAC,IAAI,QAAI,uBAAS,aAAa,UAAM,YAAAC,IAAO,EAAE;AACpD,QAAM,CAAC,WAAW,YAAY,QAAI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EA,eAAa,OAAO,SAAS,QAAQ,YAAY;AAEjD,QAAM,uBAAuB,SAAS,QAAQ,cAAc;AAC5D,QAAM,gBAAY,iCAAY,SAAS,QAAQ,KAAK;AACpD,UAAI,8BAAS,oBAAoB,KAAK,qBAAqB,QAAQ;AACjE,aAAS,QAAQ,cAAc,UAAU,qBAAqB;AAAA,EAChE,OAAO;AACL,aAAS,QAAQ,cAAc,UAAU,KAAC;AAAA,MACxC;AAAA,MACA,SAAS,QAAQ;AAAA,IACnB;AAAA,EACF;AAEA,MAAI,MAAM;AAAa,oCAAO,MAAM,aAAa,SAAS,OAAO;AAEjE,SAAO;AAAA,IACL,GAAG,SAAS;AAAA,IACZ;AAAA,EACF;AACF;AAEA,IAAO,sBAAQ;",
|
|
6
|
+
"names": ["import_utils", "uuidv4"]
|
|
7
7
|
}
|
|
@@ -14,7 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
16
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
19
|
+
mod
|
|
20
|
+
));
|
|
18
21
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
22
|
var useDataList_exports = {};
|
|
20
23
|
module.exports = __toCommonJS(useDataList_exports);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/useDataList/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export * from './useDataList';\nexport * from './recordIterator';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,gCAAc,0BAAd;AACA,gCAAc,6BADd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var recordIterator_exports = {};
|
|
23
26
|
__export(recordIterator_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/useDataList/recordIterator.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["const defaultStrategy = () => {\n throw Error('Implement an iterator strategy for record iterator');\n};\n\nexport function recordIterator(\n records,\n strategy = defaultStrategy,\n decorators = [],\n instance,\n) {\n const nextRows = [];\n\n strategy({\n data: records,\n cb: row => {\n let nextRow = row;\n\n // eslint-disable-next-line no-loops/no-loops,no-plusplus\n for (let i = 0; i < decorators.length; i++) {\n nextRow = decorators[i](nextRow, instance);\n if (!nextRow) break;\n }\n\n if (nextRow) nextRows.push(nextRow);\n },\n instance,\n });\n\n return nextRows;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,MAAM,kBAAkB,MAAM;AAC5B,QAAM,MAAM,oDAAoD;AAClE;AAEO,SAAS,eACd,SACA,WAAW,iBACX,aAAa,CAAC,GACd,UACA;AACA,QAAM,WAAW,CAAC;AAElB,WAAS;AAAA,IACP,MAAM;AAAA,IACN,IAAI,SAAO;AACT,UAAI,UAAU;AAGd,eAAS,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;AAC1C,kBAAU,WAAW,GAAG,SAAS,QAAQ;AACzC,YAAI,CAAC;AAAS;AAAA,MAChB;AAEA,UAAI;AAAS,iBAAS,KAAK,OAAO;AAAA,IACpC;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var useDataList_exports = {};
|
|
23
26
|
__export(useDataList_exports, {
|
|
@@ -71,12 +74,29 @@ const useDataList = ({
|
|
|
71
74
|
instance.current.getItemLabel = (record) => getItemLabel(record, props.nameKey);
|
|
72
75
|
instance.current.getItemChildren = (record) => getItemChildren(record, props.childrenKey);
|
|
73
76
|
instance.current.decorators = decorators;
|
|
74
|
-
instance.current.getListProps = (0, import_utils.reducePropsGetter)(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
instance.current.getListProps = (0, import_utils.reducePropsGetter)(
|
|
78
|
+
decorators.getListProps,
|
|
79
|
+
instance.current
|
|
80
|
+
);
|
|
81
|
+
instance.current.getItemProps = (0, import_utils.reducePropsGetter)(
|
|
82
|
+
decorators.getItemProps,
|
|
83
|
+
instance.current
|
|
84
|
+
);
|
|
85
|
+
instance.current.itemRenderer = (0, import_utils.composeFormatters)(
|
|
86
|
+
instance.current.decorators.itemRenderer,
|
|
87
|
+
instance.current
|
|
88
|
+
);
|
|
77
89
|
instance.current.records = (0, import_react.useMemo)(() => {
|
|
78
|
-
let nextRecords = (0, import_recordIterator.recordIterator)(
|
|
79
|
-
|
|
90
|
+
let nextRecords = (0, import_recordIterator.recordIterator)(
|
|
91
|
+
data,
|
|
92
|
+
instance.current.decorators.recordIterator,
|
|
93
|
+
decorators.record,
|
|
94
|
+
instance.current
|
|
95
|
+
);
|
|
96
|
+
nextRecords = decorators.records.reduce(
|
|
97
|
+
(nextRows, getter) => getter(nextRows, instance.current),
|
|
98
|
+
nextRecords
|
|
99
|
+
);
|
|
80
100
|
return nextRecords;
|
|
81
101
|
});
|
|
82
102
|
if (props.instanceRef)
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/useDataList/useDataList.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { useMemo, useRef } from 'react';\nimport { setRef } from '@elliemae/ds-utilities';\nimport get from 'lodash/get';\nimport {\n composeFormatters,\n reducePropsGetter,\n} from '../createDataInstance/utils';\nimport { recordIterator } from './recordIterator';\nimport { createDataInstanceRef } from '../createDataInstance/createInstanceRef';\n\nexport const getItemLabel = (record, nameKey = 'name') =>\n get(record, ['data', nameKey]);\nexport const getItemChildren = (record, childrenKey = 'children') =>\n get(record, ['data', childrenKey]);\n\nconst listRenderers = {\n list: 'ul',\n item: 'li',\n};\n\n// todo: check if a plugin is a LIST plugin rather than GRID\nexport const useDataList = ({\n data = [],\n plugins = [],\n renderers = listRenderers,\n itemRenderer = [],\n customDecorators,\n ...props\n}) => {\n const listRef = useRef();\n const { instance, decorators } = createDataInstanceRef({\n data,\n renderers,\n plugins,\n customDecorators: {\n ...customDecorators,\n recordIterator,\n getListProps: [],\n getItemProps: [],\n itemRenderer: [...itemRenderer], // components reduce to compose item content\n record: [],\n records: [],\n },\n ...props,\n });\n instance.current.getListRef = () => listRef;\n instance.current.setListRef = (ref) => {\n listRef.current = ref;\n };\n instance.current.getItemLabel = (record) =>\n getItemLabel(record, props.nameKey);\n instance.current.getItemChildren = (record) =>\n getItemChildren(record, props.childrenKey);\n\n instance.current.decorators = decorators;\n instance.current.getListProps = reducePropsGetter(\n decorators.getListProps,\n instance.current,\n );\n instance.current.getItemProps = reducePropsGetter(\n decorators.getItemProps,\n instance.current,\n );\n instance.current.itemRenderer = composeFormatters(\n instance.current.decorators.itemRenderer,\n instance.current,\n );\n\n instance.current.records = useMemo(() => {\n // record iterator TREE / Simple\n let nextRecords = recordIterator(\n data,\n instance.current.decorators.recordIterator,\n decorators.record,\n instance.current,\n );\n\n // compose all records\n nextRecords = decorators.records.reduce(\n (nextRows, getter) => getter(nextRows, instance.current),\n nextRecords,\n );\n\n return nextRecords;\n });\n\n if (props.instanceRef) setRef(props.instanceRef, instance.current);\n\n return instance.current;\n};\n\nexport default useDataList;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAgC;AAChC,0BAAuB;AACvB,iBAAgB;AAChB,mBAGO;AACP,4BAA+B;AAC/B,+BAAsC;AAE/B,MAAM,eAAe,CAAC,QAAQ,UAAU,eAC7C,WAAAA,SAAI,QAAQ,CAAC,QAAQ,OAAO,CAAC;AACxB,MAAM,kBAAkB,CAAC,QAAQ,cA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AAGA,kBAAc,WAAW,QAAQ;AAAA,MAC/B,CAAC,UAAU,WAAW,OAAO,UAAU,SAAS,OAAO;AAAA,MACvD;AAAA,IACF;AAEA,WAAO;AAAA,EACT,CAAC;AAED,MAAI,MAAM;AAAa,oCAAO,MAAM,aAAa,SAAS,OAAO;AAEjE,SAAO,SAAS;AAClB;AAEA,IAAO,sBAAQ;",
|
|
6
|
+
"names": ["get"]
|
|
7
7
|
}
|
package/dist/cjs/utils.js
CHANGED
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var utils_exports = {};
|
|
23
26
|
__export(utils_exports, {
|
|
@@ -85,7 +88,9 @@ const listWithChildren = (list, childrenProp) => list.map((item) => ({
|
|
|
85
88
|
const getAllNonEmptyNodesIds = (items, childrenProp) => {
|
|
86
89
|
let childrenIds = [];
|
|
87
90
|
const ids = items.filter((item) => item[childrenProp].length).map((item) => {
|
|
88
|
-
childrenIds = childrenIds.concat(
|
|
91
|
+
childrenIds = childrenIds.concat(
|
|
92
|
+
getAllNonEmptyNodesIds(item[childrenProp], childrenProp)
|
|
93
|
+
);
|
|
89
94
|
return item.id;
|
|
90
95
|
});
|
|
91
96
|
return ids.concat(childrenIds);
|
package/dist/cjs/utils.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-cond-assign */\nexport const objectType = (obj) =>\n Object.prototype.toString.call(obj).slice(8, -1);\nexport const isDefined = (param) => typeof param !== 'undefined';\nexport const isUndefined = (param) => typeof param === 'undefined';\nexport const isFunction = (param) => typeof param === 'function';\nexport const isNumber = param => typeof param === 'number' && !isNaN(param); // eslint-disable-line\nexport const isString = (str) => objectType(str) === 'String';\nexport const isArray = (arr) => objectType(arr) === 'Array';\n\nexport const closest = (target, selector) => {\n // closest(e.target, '.field')\n while (target) {\n // eslint-disable-line\n if (target.matches && target.matches(selector)) return target;\n if (target.msMatchesSelector && target.msMatchesSelector(selector))\n return target;\n // eslint-disable-next-line no-param-reassign\n target = target.parentNode;\n }\n return null;\n};\n\nexport const getOffsetRect = (elem) => {\n // (1)\n const box = elem.getBoundingClientRect();\n\n const { body, documentElement } = document;\n\n // (2)\n const scrollTop =\n window.pageYOffset || documentElement.scrollTop || body.scrollTop;\n const scrollLeft =\n window.pageXOffset || documentElement.scrollLeft || body.scrollLeft;\n\n // (3)\n const clientTop = documentElement.clientTop || body.clientTop || 0;\n const clientLeft = documentElement.clientLeft || body.clientLeft || 0;\n\n // (4)\n const top = box.top + scrollTop - clientTop;\n const left = box.left + scrollLeft - clientLeft;\n\n return { top: Math.round(top), left: Math.round(left) };\n};\n\nexport const getTotalScroll = (elem) => {\n let top = 0;\n let left = 0;\n\n // eslint-disable-next-line no-param-reassign\n while ((elem = elem.parentNode)) {\n top += elem.scrollTop || 0;\n left += elem.scrollLeft || 0;\n }\n\n return { top, left };\n};\n\nexport const getTransformProps = (x, y) => ({\n transform: `translate(${x}px, ${y}px)`,\n});\n\nexport const listWithChildren = (list, childrenProp) =>\n list.map((item) => ({\n ...item,\n [childrenProp]: item[childrenProp]\n ? listWithChildren(item[childrenProp], childrenProp)\n : [],\n }));\n\nexport const getAllNonEmptyNodesIds = (items, childrenProp) => {\n let childrenIds = [];\n const ids = items\n .filter((item) => item[childrenProp].length)\n .map((item) => {\n childrenIds = childrenIds.concat(\n getAllNonEmptyNodesIds(item[childrenProp], childrenProp),\n );\n return item.id;\n });\n\n return ids.concat(childrenIds);\n};\n\nexport const isInternetExplorer = () => {\n const ua = window.navigator.userAgent;\n const msie = ua.indexOf('MSIE ');\n // If Internet Explorer, return version number\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv:11\\./)) {\n return true;\n }\n return false;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADChB,MAAM,aAAa,CAAC,QACzB,OAAO,UAAU,SAAS,KAAK,GAAG,EAAE,MAAM,GAAG,EAAE;AAC1C,MAAM,YAAY,CAAC,UAAU,OAAO,UAAU;AAC9C,MAAM,cAAc,CAAC,UAAU,OAAO,UAAU;AAChD,MAAM,aAAa,CAAC,UAAU,OAAO,UAAU;AAC/C,MAAM,WAAW,WAAS,OAAO,UAAU,YAAY,CAAC,MAAM,KAAK;AACnE,MAAM,WAAW,CAAC,QAAQ,WAAW,GAAG,MAAM;AAC9C,MAAM,UAAU,CAAC,QAAQ,WAAW,GAAG,MAAM;AAE7C,MAAM,UAAU,CAAC,QAAQ,aAAa;AAE3C,SAAO,QAAQ;AAEb,QAAI,OAAO,WAAW,OAAO,QAAQ,QAAQ;AAAG,aAAO;AACvD,QAAI,OAAO,qBAAqB,OAAO,kBAAkB,QAAQ;AAC/D,aAAO;AAET,aAAS,OAAO;AAAA,EAClB;AACA,SAAO;AACT;AAEO,MAAM,gBAAgB,CAAC,SAAS;AAErC,QAAM,MAAM,KAAK,sBAAsB;AAEvC,QAAM,EAAE,MAAM,gBAAgB,IAAI;AAGlC,QAAM,YACJ,OAAO,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AAO;AAAA,EACT;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var AutoHeightList_exports = {};
|
|
23
26
|
__export(AutoHeightList_exports, {
|
|
@@ -25,39 +28,42 @@ __export(AutoHeightList_exports, {
|
|
|
25
28
|
});
|
|
26
29
|
module.exports = __toCommonJS(AutoHeightList_exports);
|
|
27
30
|
var React = __toESM(require("react"));
|
|
28
|
-
var
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
var import_react = require("react");
|
|
29
33
|
var import_react_window = require("react-window");
|
|
30
34
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
31
|
-
const AutoHeightList = (0, import_react.forwardRef)(
|
|
32
|
-
|
|
33
|
-
className,
|
|
34
|
-
innerRef,
|
|
35
|
-
itemData,
|
|
36
|
-
itemKey,
|
|
37
|
-
itemSize,
|
|
38
|
-
outerRef,
|
|
39
|
-
component: ListComponent = import_react_window.FixedSizeList,
|
|
40
|
-
...otherProps
|
|
41
|
-
}, ref) => {
|
|
42
|
-
const listRef = (0, import_react.useRef)();
|
|
43
|
-
const outerListRef = (0, import_react.useRef)();
|
|
44
|
-
(0, import_ds_utilities.useWindowScrollerList)({
|
|
45
|
-
listInstance: listRef,
|
|
46
|
-
outerListRef
|
|
47
|
-
});
|
|
48
|
-
return /* @__PURE__ */ import_react.default.createElement(ListComponent, {
|
|
49
|
-
...otherProps,
|
|
50
|
-
ref: (0, import_ds_utilities.mergeRefs)(ref, listRef),
|
|
51
|
-
className: (0, import_ds_utilities.cx)(className, "window-scroller-override"),
|
|
52
|
-
height: window.innerHeight,
|
|
53
|
-
innerRef,
|
|
35
|
+
const AutoHeightList = (0, import_react.forwardRef)(
|
|
36
|
+
({
|
|
54
37
|
itemCount,
|
|
38
|
+
className,
|
|
39
|
+
innerRef,
|
|
55
40
|
itemData,
|
|
56
41
|
itemKey,
|
|
57
42
|
itemSize,
|
|
58
|
-
outerRef
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
})
|
|
62
|
-
|
|
43
|
+
outerRef,
|
|
44
|
+
component: ListComponent = import_react_window.FixedSizeList,
|
|
45
|
+
...otherProps
|
|
46
|
+
}, ref) => {
|
|
47
|
+
const listRef = (0, import_react.useRef)();
|
|
48
|
+
const outerListRef = (0, import_react.useRef)();
|
|
49
|
+
(0, import_ds_utilities.useWindowScrollerList)({
|
|
50
|
+
listInstance: listRef,
|
|
51
|
+
outerListRef
|
|
52
|
+
});
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListComponent, {
|
|
54
|
+
...otherProps,
|
|
55
|
+
ref: (0, import_ds_utilities.mergeRefs)(ref, listRef),
|
|
56
|
+
className: (0, import_ds_utilities.cx)(className, "window-scroller-override"),
|
|
57
|
+
height: window.innerHeight,
|
|
58
|
+
innerRef,
|
|
59
|
+
itemCount,
|
|
60
|
+
itemData,
|
|
61
|
+
itemKey,
|
|
62
|
+
itemSize,
|
|
63
|
+
outerRef: (0, import_ds_utilities.mergeRefs)(outerListRef, outerRef),
|
|
64
|
+
overscanCount: 10,
|
|
65
|
+
useIsScrolling: true
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
);
|
|
63
69
|
//# sourceMappingURL=AutoHeightList.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/virtualization/AutoHeightList.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { forwardRef, useRef } from 'react';\nimport { FixedSizeList as List } from 'react-window';\nimport { cx, useWindowScrollerList, mergeRefs } from '@elliemae/ds-utilities';\n\nexport const AutoHeightList = forwardRef(\n (\n {\n itemCount,\n className,\n innerRef,\n itemData,\n itemKey,\n itemSize,\n outerRef,\n component: ListComponent = List,\n ...otherProps\n },\n ref,\n ) => {\n const listRef = useRef();\n const outerListRef = useRef();\n\n useWindowScrollerList({\n listInstance: listRef,\n outerListRef,\n });\n\n return (\n <ListComponent\n {...otherProps}\n ref={mergeRefs(ref, listRef)}\n className={cx(className, 'window-scroller-override')}\n height={window.innerHeight}\n innerRef={innerRef}\n itemCount={itemCount}\n itemData={itemData}\n itemKey={itemKey}\n itemSize={itemSize}\n outerRef={mergeRefs(outerListRef, outerRef)}\n overscanCount={10}\n useIsScrolling\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAA0C;AAC1C,0BAAsC;AACtC,0BAAqD;AAE9C,MAAM,qBAAiB;AAAA,EAC5B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,gBAAgB,oBAAAA;AAAA,OACxB;AAAA,EACL,GACA,QACG;AACH,UAAM,cAAU,qBAAO;AACvB,UAAM,mBAAe,qBAAO;AAE5B,mDAAsB;AAAA,MACpB,cAAc;AAAA,MACd;AAAA,IACF,CAAC;AAED,WACE,4CAAC;AAAA,MACE,GAAG;AAAA,MACJ,SAAK,+BAAU,KAAK,OAAO;AAAA,MAC3B,eAAW,wBAAG,WAAW,0BAA0B;AAAA,MACnD,QAAQ,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,cAAU,+BAAU,cAAc,QAAQ;AAAA,MAC1C,eAAe;AAAA,MACf,gBAAc;AAAA,KAChB;AAAA,EAEJ;AACF;",
|
|
6
|
+
"names": ["List"]
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var FluidHeightList_exports = {};
|
|
23
26
|
__export(FluidHeightList_exports, {
|
|
@@ -25,13 +28,17 @@ __export(FluidHeightList_exports, {
|
|
|
25
28
|
});
|
|
26
29
|
module.exports = __toCommonJS(FluidHeightList_exports);
|
|
27
30
|
var React = __toESM(require("react"));
|
|
28
|
-
var
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
var import_react = require("react");
|
|
29
33
|
var import_react_virtualized_auto_sizer = __toESM(require("react-virtualized-auto-sizer"));
|
|
30
|
-
const FluidHeightList = (0, import_react.forwardRef)(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const FluidHeightList = (0, import_react.forwardRef)(
|
|
35
|
+
({ component: Component, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_virtualized_auto_sizer.default, {
|
|
36
|
+
disableWidth: true,
|
|
37
|
+
children: ({ height: fluidHeight }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {
|
|
38
|
+
...props,
|
|
39
|
+
ref,
|
|
40
|
+
height: fluidHeight - 32
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
);
|
|
37
44
|
//# sourceMappingURL=FluidHeightList.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/virtualization/FluidHeightList.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { forwardRef } from 'react';\nimport AutoSizer from 'react-virtualized-auto-sizer';\n\nexport const FluidHeightList = forwardRef(\n ({ component: Component, ...props }, ref) => (\n <AutoSizer disableWidth>\n {({ height: fluidHeight }) => (\n <Component\n {...props}\n ref={ref}\n height={fluidHeight - 32} // taking in count the margins of the list\n />\n )}\n </AutoSizer>\n ),\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAAkC;AAClC,0CAAsB;AAEf,MAAM,sBAAkB;AAAA,EAC7B,CAAC,EAAE,WAAW,cAAc,MAAM,GAAG,QACnC,4CAAC,oCAAAA,SAAA;AAAA,IAAU,cAAY;AAAA,IACpB,WAAC,EAAE,QAAQ,YAAY,MACtB,4CAAC;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,QAAQ,cAAc;AAAA,KACxB;AAAA,GAEJ;AAEJ;",
|
|
6
|
+
"names": ["AutoSizer"]
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var virtualization_exports = {};
|
|
23
26
|
__export(virtualization_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/virtualization/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { FluidHeightList } from './FluidHeightList';\nimport { AutoHeightList } from './AutoHeightList';\n\nexport { FluidHeightList, AutoHeightList };\n\nexport function getVirtualListComponent({ component: Component, fluid, height, autoHeight }) {\n if (autoHeight) return AutoHeightList;\n if (fluid) return FluidHeightList;\n return Component;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,6BAAgC;AAChC,4BAA+B;AAIxB,SAAS,wBAAwB,EAAE,WAAW,WAAW,OAAO,QAAQ,WAAW,GAAG;AAC3F,MAAI;AAAY,WAAO;AACvB,MAAI;AAAO,WAAO;AAClB,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Transition } from "react-spring/renderprops";
|
|
4
4
|
const BaseAnimation = ({
|
|
5
5
|
keys = void 0,
|
|
@@ -10,15 +10,16 @@ const BaseAnimation = ({
|
|
|
10
10
|
leave = {},
|
|
11
11
|
onRest = () => null,
|
|
12
12
|
children
|
|
13
|
-
}) => /* @__PURE__ */
|
|
13
|
+
}) => /* @__PURE__ */ jsx(Transition, {
|
|
14
14
|
config: { duration },
|
|
15
15
|
enter,
|
|
16
16
|
from,
|
|
17
17
|
items,
|
|
18
18
|
keys,
|
|
19
19
|
leave,
|
|
20
|
-
onRest
|
|
21
|
-
|
|
20
|
+
onRest,
|
|
21
|
+
children
|
|
22
|
+
});
|
|
22
23
|
var BaseAnimation_default = BaseAnimation;
|
|
23
24
|
export {
|
|
24
25
|
BaseAnimation,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/Animations/BaseAnimation.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { Transition } from 'react-spring/renderprops';\n\nconst BaseAnimation = ({\n keys = undefined,\n items = [],\n duration = 100,\n enter = {},\n from = {},\n leave = {},\n onRest = () => null,\n children,\n}) => (\n <Transition\n config={{ duration }}\n enter={enter}\n from={from}\n items={items}\n keys={keys}\n leave={leave}\n onRest={onRest}\n >\n {children}\n </Transition>\n);\n\nexport { BaseAnimation };\nexport default BaseAnimation;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,SAAS,kBAAkB;AAE3B,MAAM,gBAAgB,CAAC;AAAA,EACrB,OAAO;AAAA,EACP,QAAQ,CAAC;AAAA,EACT,WAAW;AAAA,EACX,QAAQ,CAAC;AAAA,EACT,OAAO,CAAC;AAAA,EACR,QAAQ,CAAC;AAAA,EACT,SAAS,MAAM;AAAA,EACf;AACF,MACE,oBAAC;AAAA,EACC,QAAQ,EAAE,SAAS;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEC;AAAA,CACH;AAIF,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { BaseAnimation } from "./BaseAnimation";
|
|
4
4
|
const Grow = ({
|
|
5
5
|
keys = void 0,
|
|
@@ -9,15 +9,16 @@ const Grow = ({
|
|
|
9
9
|
to = 1,
|
|
10
10
|
children,
|
|
11
11
|
onRest = () => null
|
|
12
|
-
}) => /* @__PURE__ */
|
|
12
|
+
}) => /* @__PURE__ */ jsx(BaseAnimation, {
|
|
13
13
|
duration,
|
|
14
14
|
enter: { opacity: 1, transform: `scale(${to})` },
|
|
15
15
|
from: { opacity: 0, transform: `scale(${from})` },
|
|
16
16
|
items,
|
|
17
17
|
keys,
|
|
18
18
|
leave: { opacity: 0, transform: `scale(${from})` },
|
|
19
|
-
onRest
|
|
20
|
-
|
|
19
|
+
onRest,
|
|
20
|
+
children
|
|
21
|
+
});
|
|
21
22
|
var Grow_default = Grow;
|
|
22
23
|
export {
|
|
23
24
|
Grow,
|