@elliemae/ds-shared 3.3.1-rc.0 → 3.3.1-rc.1
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/esm/Animations/BaseAnimation.js +0 -1
- package/dist/esm/Animations/BaseAnimation.js.map +1 -1
- package/dist/esm/Animations/Grow.js +0 -1
- package/dist/esm/Animations/Grow.js.map +1 -1
- package/dist/esm/Animations/GrowRight.js +0 -1
- package/dist/esm/Animations/GrowRight.js.map +1 -1
- package/dist/esm/Animations/GrowVertical.js +0 -1
- package/dist/esm/Animations/GrowVertical.js.map +1 -1
- package/dist/esm/Animations/index.js +0 -1
- package/dist/esm/Animations/index.js.map +1 -1
- package/dist/esm/CheckableGroup.js +0 -1
- package/dist/esm/CheckableGroup.js.map +1 -1
- package/dist/esm/DeferRenderAfterComputation.js +0 -1
- package/dist/esm/DeferRenderAfterComputation.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGrid.js +0 -1
- package/dist/esm/FocusGroup/FocusGrid.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGroup.js +0 -1
- package/dist/esm/FocusGroup/FocusGroup.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGroupContext.js +0 -1
- package/dist/esm/FocusGroup/FocusGroupContext.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGroupManager.js +0 -1
- package/dist/esm/FocusGroup/FocusGroupManager.js.map +1 -1
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js +0 -1
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js.map +1 -1
- package/dist/esm/FocusGroup/index.js +0 -1
- package/dist/esm/FocusGroup/index.js.map +1 -1
- package/dist/esm/FocusGroup/useFocusGroupItem.js +0 -1
- package/dist/esm/FocusGroup/useFocusGroupItem.js.map +1 -1
- package/dist/esm/FocusGroup/utils/getNextCellPosition.js +0 -1
- package/dist/esm/FocusGroup/utils/getNextCellPosition.js.map +1 -1
- package/dist/esm/GroupContext/Group.js +0 -1
- package/dist/esm/GroupContext/Group.js.map +1 -1
- package/dist/esm/GroupContext/GroupContext.js +0 -1
- package/dist/esm/GroupContext/GroupContext.js.map +1 -1
- package/dist/esm/GroupContext/GroupItem.js +0 -1
- package/dist/esm/GroupContext/GroupItem.js.map +1 -1
- package/dist/esm/GroupContext/index.js +0 -1
- package/dist/esm/GroupContext/index.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSync.js +0 -1
- package/dist/esm/ScrollSync/ScrollSync.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSyncPane.js +0 -1
- package/dist/esm/ScrollSync/ScrollSyncPane.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSyncProvider.js +0 -1
- package/dist/esm/ScrollSync/ScrollSyncProvider.js.map +1 -1
- package/dist/esm/ScrollSync/index.js +0 -1
- package/dist/esm/ScrollSync/index.js.map +1 -1
- package/dist/esm/ScrollSync/useScrollSync.js +0 -1
- package/dist/esm/ScrollSync/useScrollSync.js.map +1 -1
- package/dist/esm/constants.js +0 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/createDataInstance/createInstancePlugin.js +0 -1
- package/dist/esm/createDataInstance/createInstancePlugin.js.map +1 -1
- package/dist/esm/createDataInstance/createInstanceRef.js +0 -1
- package/dist/esm/createDataInstance/createInstanceRef.js.map +1 -1
- package/dist/esm/createDataInstance/index.js +0 -1
- package/dist/esm/createDataInstance/index.js.map +1 -1
- package/dist/esm/createDataInstance/utils.js +0 -1
- package/dist/esm/createDataInstance/utils.js.map +1 -1
- package/dist/esm/defer-render-hoc/index.js +0 -1
- package/dist/esm/defer-render-hoc/index.js.map +1 -1
- package/dist/esm/dimsum.config.js +0 -1
- package/dist/esm/dimsum.config.js.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/prop-types.js +0 -1
- package/dist/esm/prop-types.js.map +1 -1
- package/dist/esm/react-spring/index.js +0 -1
- package/dist/esm/react-spring/index.js.map +1 -1
- package/dist/esm/react-spring/renderprops.js +0 -1
- package/dist/esm/react-spring/renderprops.js.map +1 -1
- package/dist/esm/toolbar/ToolbarProvider.js +0 -1
- package/dist/esm/toolbar/ToolbarProvider.js.map +1 -1
- package/dist/esm/useDataGrid/VolatileRowsListener.js +0 -1
- package/dist/esm/useDataGrid/VolatileRowsListener.js.map +1 -1
- package/dist/esm/useDataGrid/index.js +0 -1
- package/dist/esm/useDataGrid/index.js.map +1 -1
- package/dist/esm/useDataGrid/initColumnDefinition.js +0 -1
- package/dist/esm/useDataGrid/initColumnDefinition.js.map +1 -1
- package/dist/esm/useDataGrid/useDataGrid.js +0 -1
- package/dist/esm/useDataGrid/useDataGrid.js.map +1 -1
- package/dist/esm/useDataList/index.js +0 -1
- package/dist/esm/useDataList/index.js.map +1 -1
- package/dist/esm/useDataList/recordIterator.js +0 -1
- package/dist/esm/useDataList/recordIterator.js.map +1 -1
- package/dist/esm/useDataList/useDataList.js +0 -1
- package/dist/esm/useDataList/useDataList.js.map +1 -1
- package/dist/esm/utils.js +0 -1
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/virtualization/AutoHeightList.js +0 -1
- package/dist/esm/virtualization/AutoHeightList.js.map +1 -1
- package/dist/esm/virtualization/FluidHeightList.js +0 -1
- package/dist/esm/virtualization/FluidHeightList.js.map +1 -1
- package/dist/esm/virtualization/index.js +0 -1
- package/dist/esm/virtualization/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/createInstanceRef.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { v4 as uuidv4 } from 'uuid';\nimport { useMemo, useRef, useState } from 'react';\nimport { orderBy } from 'lodash';\nimport {\n mergeInstance,\n registerHotKeysHookToInstance,\n registerStateHookToInstance,\n} from './utils';\n\nconst defaultDecorators = {\n instance: [],\n state: [],\n hotKeys: [],\n renderers: [],\n composeData: [],\n};\n\nfunction createDataInstanceRef({\n uuid: uuidProp,\n data,\n renderers,\n plugins,\n customDecorators,\n ...props\n}) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const instance = useRef();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const [uuid] = useState(uuidProp || (() => uuidv4()));\n\n instance.current = {\n uuid,\n state: {},\n actions: {},\n hotKeys: {}, // keyboard hotkeys to run specific actions\n originalData: data,\n records: [], // item abstraction with meta data for originalData\n renderers,\n ref(key) {\n // eslint-disable-next-line no-return-assign\n return (node) => (instance.current.refs[key] = node);\n },\n getInstance() {\n return instance.current;\n },\n props,\n };\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const decorators = useMemo(() => {\n let nextDecorators = { ...defaultDecorators, ...customDecorators };\n\n plugins.forEach((plugin) => {\n if (!plugin) return;\n nextDecorators = plugin(nextDecorators);\n });\n\n Object.keys(nextDecorators).forEach((key) => {\n if (Array.isArray(nextDecorators[key]))\n nextDecorators[key] = orderBy(\n nextDecorators[key],\n (item) => item.order,\n );\n });\n\n return nextDecorators;\n }, []); // the plugins are defined on creation, but not changed at runtime\n\n // todo: test if getting the hooks without registering them\n // here would be beneficial to memoize instance and squeeze performance\n instance.current = decorators.instance.reduce(\n mergeInstance,\n instance.current,\n );\n instance.current = decorators.state.reduce(\n registerStateHookToInstance,\n instance.current,\n );\n instance.current = decorators.hotKeys.reduce(\n registerHotKeysHookToInstance,\n instance.current,\n );\n instance.current.renderers = decorators.renderers.reduce(\n (result, decorator) => decorator(result, instance.current),\n renderers,\n );\n\n return { instance, decorators };\n}\n\nexport { createDataInstanceRef };\nexport default createDataInstanceRef;"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAMA,MAAM,oBAAoB;AAAA,EACxB,UAAU,CAAC;AAAA,EACX,OAAO,CAAC;AAAA,EACR,SAAS,CAAC;AAAA,EACV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
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './createInstancePlugin';\nexport * from './createInstanceRef';\nexport * from './utils';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/utils.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const reducePropsGetter = (decorators = [], grid) => (\n props = {},\n extraParams,\n) => {\n let nextProps = props;\n decorators.forEach((decorator) => {\n nextProps = decorator(nextProps, grid, extraParams);\n });\n return nextProps;\n};\n\n/* eslint-disable-next-line max-params */\nexport function evaluateTransforms(\n transforms,\n value,\n extraParams = {},\n props = {},\n grid,\n) {\n let nextProps = props;\n transforms.forEach((transform) => {\n nextProps = transform(value, extraParams, nextProps, grid);\n });\n return nextProps;\n}\n\n/* eslint-disable-next-line max-params */\nexport function evaluateFormatters(formatters, value, extraParams = {}, grid) {\n return formatters.reduce(\n (result, formatter) => formatter(result, extraParams, grid),\n value,\n );\n}\n\nexport function composeFormatters(\n formatters,\n instance,\n getItemValue = (record) => record.data.name,\n) {\n // todo: make the formatters subscribe to the item props instead of getting the whole instance\n // todo: addd should formatter update to memoize specific ones\n return (props) =>\n formatters.reduce(\n (result, formatter) => formatter(result, props, instance),\n getItemValue(props.record),\n );\n}\n\nexport const applyDecorators = (subject, decorators = [], ...args) =>\n decorators.reduce(\n (nextSubject, decorator) => decorator(nextSubject, ...args),\n subject,\n );\n\nexport const decorateColumns = (columns, decorators, grid) => {\n const nextColumns = applyDecorators(\n columns,\n decorators.decorateColumns,\n grid,\n );\n return nextColumns.map((column, index) =>\n applyDecorators(column, decorators.decorateColumn, grid, index),\n );\n};\n\nexport const mergeInstance = (instance, instanceHook) => ({\n ...instance,\n ...instanceHook(instance),\n});\n\nexport const registerStateHookToInstance = (instance, stateHook) => {\n const { state, actions } = stateHook(instance);\n return {\n ...instance,\n state: {\n ...instance.state,\n ...state,\n },\n actions: {\n ...instance.actions,\n ...actions,\n },\n };\n};\n\nconst reduceHotKey = (\n instance,\n { key, handler, options, allowDocumentHandler },\n) => ({\n ...instance,\n hotKeys: {\n ...instance.hotKeys,\n [key]: { handler, options, allowDocumentHandler },\n },\n});\n\nexport const registerHotKeysHookToInstance = (instance, hotKeysHook) => {\n const hotKeys = hotKeysHook(instance);\n if (Array.isArray(hotKeys)) {\n return hotKeys.reduce(reduceHotKey, instance);\n }\n return reduceHotKey(instance, hotKeys);\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,oBAAoB,CAAC,aAAa,CAAC,GAAG,SAAS,CAC1D,QAAQ,CAAC,GACT,gBACG;AACH,MAAI,YAAY;AAChB,aAAW,QAAQ,CAAC,cAAc;AAChC,gBAAY,UAAU,WAAW,MAAM,WAAW;AAAA,EACpD,CAAC;AACD,SAAO;AACT;AAGO,4BACL,YACA,OACA,cAAc,CAAC,GACf,QAAQ,CAAC,GACT,MACA;AACA,MAAI,YAAY;AAChB,aAAW,QAAQ,CAAC,cAAc;AAChC,gBAAY,UAAU,OAAO,aAAa,WAAW,IAAI;AAAA,EAC3D,CAAC;AACD,SAAO;AACT;AAGO,4BAA4B,YAAY,OAAO,cAAc,CAAC,GAAG,MAAM;AAC5E,SAAO,WAAW,OAChB,CAAC,QAAQ,cAAc,UAAU,QAAQ,aAAa,IAAI,GAC1D,KACF;AACF;AAEO,2BACL,YACA,UACA,eAAe,CAAC,WAAW,OAAO,KAAK,MACvC;AAGA,SAAO,CAAC,UACN,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
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/defer-render-hoc/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { PureComponent } from 'react';\nimport raf from 'raf';\nimport hoistNonReactStatic from 'hoist-non-react-statics';\n\n/**\n * Allows two animation frames to complete to allow other components to update\n * and re-render before mounting and rendering an expensive `WrappedComponent`.\n *\n * @param WrappedComponent\n * @param fallback\n */\nexport const deferComponentRender = (WrappedComponent, fallback) => {\n class DeferredRenderWrapper extends PureComponent {\n state = { shouldRender: false };\n\n componentDidMount() {\n raf(() => raf(() => this.setState({ shouldRender: true })));\n }\n\n render() {\n // eslint-disable-next-line react/destructuring-assignment\n return this.state.shouldRender ? (\n <WrappedComponent {...this.props} />\n ) : (\n fallback\n );\n }\n }\n\n return hoistNonReactStatic(DeferredRenderWrapper, WrappedComponent);\n};\n\nexport default deferComponentRender;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AASO,MAAM,uBAAuB,CAAC,kBAAkB,aAAa;AAClE,QAAM,8BAA8B,cAAc;AAAA,IAAlD;AAAA;AACE,mBAAQ,EAAE,cAAc,MAAM;AAAA;AAAA,IAE9B,oBAAoB;AAClB,UAAI,MAAM,IAAI,MAAM,KAAK,SAAS,EAAE,cAAc,KAAK,CAAC,CAAC,CAAC;AAAA,IAC5D;AAAA,IAEA,SAAS;AAEP,aAAO,KAAK,MAAM,eAChB,qCAAC;AAAA,QAAkB,GAAG,KAAK;AAAA,OAAO,IAElC;AAAA,IAEJ;AAAA,EACF;AAEA,SAAO,oBAAoB,uBAAuB,gBAAgB;AACpE;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/dimsum.config.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "const dimsumConfig = {\n classNamePrefix: 'em-ds',\n};\n\nexport { dimsumConfig };\nexport default dimsumConfig;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA,MAAM,eAAe;AAAA,EACnB,iBAAiB;AACnB;AAGA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './Animations';\nexport * from './createDataInstance';\nexport * from './defer-render-hoc';\nexport * from './FocusGroup';\nexport * from './GroupContext';\nexport * from './ScrollSync';\nexport * from './toolbar/ToolbarProvider';\nexport * from './useDataGrid';\nexport * from './useDataList';\nexport * from './virtualization';\n\nexport * from './CheckableGroup';\nexport * from './constants';\nexport * from './DeferRenderAfterComputation';\nexport * from './dimsum.config';\nexport * from './prop-types';\nexport * from './utils';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/prop-types.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/prop-types.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const dsBasicSizes = ['s' as const, 'm' as const, 'l' as const];\n\nexport const sizes = ['xsmall' as const, 'small' as const, 'medium' as const, 'large' as const, 'xlarge' as const];\n\nexport const iconSizes = [\n 'xxs' as const,\n 'xs' as const,\n 's' as const,\n 'm' as const,\n 'l' as const,\n 'xl' as const,\n 'xxl' as const,\n];\n\nexport const iconColors = [\n ['neutral', '900'] as const,\n ['neutral', '0'] as const,\n ['danger', '900'] as const,\n ['warning', '500'] as const,\n ['success', '900'] as const,\n ['brand-primary', '600'] as const,\n] as const;\n\nexport const CHECKBOX_VARIANT = {\n DEFAULT: 'variant-default' as const,\n FOCUS: 'variant-focus' as const,\n ACTIVE: 'variant-active' as const,\n DISABLED: 'variant-disabled' as const,\n ERROR: 'variant-error' as const,\n};\nexport const checkboxVariants = [\n CHECKBOX_VARIANT.DEFAULT,\n CHECKBOX_VARIANT.FOCUS,\n CHECKBOX_VARIANT.ACTIVE,\n CHECKBOX_VARIANT.DISABLED,\n CHECKBOX_VARIANT.ERROR,\n] as const;\n\nexport const COMBOBOX_VARIANT = {\n DEFAULT: 'variant-default' as const,\n FOCUS: 'variant-focus-input' as const,\n FOCUS_ICON: 'variant-focus-icon' as const,\n ACTIVE: 'variant-active-input' as const,\n ACTIVE_ICON: 'variant-active-icon' as const,\n DISABLED: 'variant-disabled' as const,\n ERROR: 'variant-error' as const,\n};\n\nexport const comboBoxVariants = [\n COMBOBOX_VARIANT.DEFAULT,\n COMBOBOX_VARIANT.FOCUS,\n COMBOBOX_VARIANT.FOCUS_ICON,\n COMBOBOX_VARIANT.ACTIVE,\n COMBOBOX_VARIANT.ACTIVE_ICON,\n COMBOBOX_VARIANT.DISABLED,\n COMBOBOX_VARIANT.ERROR,\n] as const;\n\nexport const sizeVariants = {\n S: 's' as const,\n M: 'm' as const,\n L: 'l' as const,\n};\n\nexport const position = {\n LEFT: 'left' as const,\n RIGHT: 'right' as const,\n CENTER: 'center' as const,\n};\n\nexport const fontColor = {\n NEUTRAL500: 'neutral500' as const,\n NEUTRAL700: 'neutral700' as const,\n};\n\nexport const orientation = ['horizontal' as const, 'vertical' as const] as const;\n\nexport const orientationVariants = {\n HORIZONTAL: 'horizontal' as const,\n VERTICAL: 'vertical' as const,\n};\n"],
|
|
5
|
-
"mappings": "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,cAAuB,UAAmB;AAE/D,MAAM,sBAAsB;AAAA,EACjC,YAAY;AAAA,EACZ,UAAU;AACZ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/react-spring/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from 'react-spring/web';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/react-spring/renderprops.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from 'react-spring/renderprops';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/toolbar/ToolbarProvider.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo, useRef, useState, useEffect, memo } from 'react';\nimport { DSPopover } from '@elliemae/ds-popover';\nimport { useOnClickOutside } from '@elliemae/ds-utilities';\n\nexport const ToolbarContext = React.createContext();\n\nconst { Provider } = ToolbarContext;\n\nconst useScrollListener = (callback, dependencies) => {\n useEffect(() => {\n window.addEventListener('scroll', callback, true);\n return () => {\n window.removeEventListener('scroll', callback, true);\n };\n }, [dependencies]);\n};\n\nconst noop = () => null;\nconst ToolbarProvider = memo(({ delay = 200, children, onHide = noop, onShow = noop }) => {\n const showTimer = useRef();\n const hideTimer = useRef();\n const toolbarRef = useRef();\n const [tooltipState, setTooltipState] = useState({});\n\n const show = (state) => {\n if (state.reference === tooltipState.reference) clearTimeout(hideTimer.current);\n showTimer.current = setTimeout(\n () =>\n setTooltipState({\n ...state,\n visible: true,\n }),\n delay,\n );\n onShow();\n };\n\n const hide = (e, force) => {\n if (!force) clearTimeout(showTimer.current);\n hideTimer.current = setTimeout(\n () =>\n setTooltipState((prevState) => ({\n ...prevState,\n visible: false,\n })),\n 100,\n );\n onHide(tooltipState, e);\n };\n\n useScrollListener((e) => hide(e, true), tooltipState.visible);\n useOnClickOutside(toolbarRef, () => hide());\n\n const keyDownHandler = (e) => {\n if (e.key === 'Escape') {\n hide(e);\n }\n };\n\n useEffect(() => {\n window.addEventListener('keydown', keyDownHandler);\n return () => {\n window.removeEventListener('keydown', keyDownHandler);\n };\n });\n\n const value = useMemo(\n () => ({\n state: tooltipState,\n show,\n hide,\n }),\n [tooltipState.reference],\n );\n\n return (\n <Provider value={value}>\n {children}\n <DSPopover\n boundaries=\"scrollParent\"\n {...(tooltipState.options || {})}\n content={tooltipState.renderer}\n placement=\"left\"\n referenceEl={tooltipState.reference}\n renderer={({ as: Component, style, children: Content }) => (\n <div ref={toolbarRef} onMouseEnter={(e) => show(tooltipState, e)} onMouseLeave={hide}>\n <Component style={style}>{Content}</Component>\n </div>\n )}\n style={tooltipState.style}\n visible={tooltipState.visible}\n />\n </Provider>\n );\n});\n\nexport { ToolbarProvider };\nexport default ToolbarProvider;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEO,MAAM,iBAAiB,OAAM,cAAc;AAElD,MAAM,EAAE,aAAa;AAErB,MAAM,oBAAoB,CAAC,UAAU,iBAAiB;AACpD,YAAU,MAAM;AACd,WAAO,iBAAiB,UAAU,UAAU,IAAI;AAChD,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,UAAU,IAAI;AAAA,IACrD;AAAA,EACF,GAAG,CAAC,YAAY,CAAC;AACnB;AAEA,MAAM,OAAO,MAAM;A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AAAA,IACV,aAAa,aAAa;AAAA,IAC1B,UAAU,CAAC,EAAE,IAAI,WAAW,OAAO,UAAU,cAC3C,qCAAC;AAAA,MAAI,KAAK;AAAA,MAAY,cAAc,CAAC,MAAM,KAAK,cAAc,CAAC;AAAA,MAAG,cAAc;AAAA,OAC9E,qCAAC;AAAA,MAAU;AAAA,OAAe,OAAQ,CACpC;AAAA,IAEF,OAAO,aAAa;AAAA,IACpB,SAAS,aAAa;AAAA,GACxB,CACF;AAEJ,CAAC;AAGD,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataGrid/VolatileRowsListener.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { safeCall } from '@elliemae/ds-utilities';\n\nclass VolatileRowsListener {\n observers = [];\n\n observe(listener) {\n this.observers.push(listener);\n }\n\n notify(nextRows) {\n this.observers.forEach(observer => safeCall(observer, nextRows));\n this.observers = [];\n }\n}\n\nexport { VolatileRowsListener };\nexport default VolatileRowsListener;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEA,MAAM,qBAAqB;AAAA,EAA3B;AACE,qBAAY,CAAC;AAAA;AAAA,EAEb,QAAQ,UAAU;AAChB,SAAK,UAAU,KAAK,QAAQ;AAAA,EAC9B;AAAA,EAEA,OAAO,UAAU;AACf,SAAK,UAAU,QAAQ,cAAY,SAAS,UAAU,QAAQ,CAAC;AAC/D,SAAK,YAAY,CAAC;AAAA,EACpB;AACF;AAGA,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataGrid/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './initColumnDefinition';\nexport * from './VolatileRowsListener';\nexport * from './useDataGrid';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataGrid/initColumnDefinition.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable react/display-name */\nimport React from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport {\n get,\n curry,\n set,\n cloneDeep,\n isFunction,\n} from '@elliemae/ds-utilities';\n\n// TODO: use lenses to access nested fields\n\nexport const appendHeaderFormatter = curry((formatter, column) => ({\n ...column,\n header: {\n ...column.header,\n formatters: [...get(column, 'header.formatters', []), formatter],\n },\n}));\n\nexport const appendCellFormatter = curry(\n (formatter, column, path = 'formatters') => {\n const nextColumn = cloneDeep(column);\n const formatters = get(nextColumn, ['cell', path], []);\n const scrollingFormatters = get(nextColumn, 'cell.scrollingFormatters', []);\n if (Array.isArray(formatter)) {\n if (formatter[1]) scrollingFormatters.push(formatter[1]);\n formatters.push(formatter[0]);\n } else {\n formatters.push(formatter);\n scrollingFormatters.push(formatter);\n }\n set(nextColumn, ['cell', path], formatters);\n set(nextColumn, 'cell.scrollingFormatters', scrollingFormatters);\n return nextColumn;\n },\n);\n\nconst defaultColumnDefinitionOptions = {\n normalize: false,\n useTextTruncation: true,\n isUserColumn: true,\n visible: true,\n};\n\nexport const mergeClassNameToColumnHeader = curry((className, column) => {\n const headerProps = get(column, ['header', 'props'], {});\n const headerClassName = headerProps.className || '';\n return {\n ...column,\n header: {\n ...column.header,\n props: {\n ...headerProps,\n className: `${headerClassName} ${className}`,\n },\n },\n };\n});\n\nexport const initColumnDefinition = (options = {}) => {\n // eslint-disable-next-line complexity\n return (column) => {\n // todo: clean this\n if (column.type === 'number') {\n // eslint-disable-next-line no-param-reassign\n column.cellStyle = {\n textAlign: 'right',\n };\n }\n const { useTextTruncation = true, isUserColumn, visible, normalize } = {\n ...defaultColumnDefinitionOptions,\n ...options,\n };\n\n if (normalize) {\n // eslint-disable-next-line no-param-reassign\n column.originalProperty = column.property;\n // eslint-disable-next-line no-param-reassign\n column.property = column.property.replace(/\\s+/g, '');\n }\n\n // eslint-disable-next-line no-param-reassign\n column.props = {\n ...column.props,\n style: {},\n };\n // eslint-disable-next-line no-param-reassign\n column.header = {\n ...column.header,\n label: column.label,\n formatters: [...get(column, ['header', 'formatters'], [])],\n props: {\n style: column.headerStyle || {},\n },\n };\n if (\n useTextTruncation &&\n !(\n isFunction(column.customHeaderRenderer) ||\n column.header.formatters.length\n )\n ) {\n column.header.formatters.push((value) => (\n <span className=\"cell-value\">{value}</span>\n ));\n }\n\n // eslint-disable-next-line no-param-reassign\n column.cell = {\n ...column.cell,\n transforms: [],\n formatters: [...get(column, ['cell', 'formatters'], [])],\n scrollingFormatters: [...get(column, ['cell', 'formatters'], [])],\n props: {\n style: column.cellStyle || {},\n },\n };\n\n if (\n useTextTruncation &&\n !(isFunction(column.customRenderer) || column.cell.formatters.length)\n ) {\n column.cell.formatters.push((value) => (\n <span\n className=\"cell-value\"\n style={{\n justifyContent:\n column.type === 'number' ? 'flex-end' : 'flex-start',\n }}\n >\n {value}\n </span>\n ));\n }\n // eslint-disable-next-line no-param-reassign\n column.uuid = column.uuid || uuidv4();\n // eslint-disable-next-line no-param-reassign\n column.visible = column.visible === undefined ? visible : column.visible;\n // eslint-disable-next-line no-param-reassign, max-lines\n column.isUserColumn = column.isUserColumn || isUserColumn;\n // eslint-disable-next-line no-param-reassign\n column.headerHookEffects = [];\n return column;\n };\n};\n\nexport default initColumnDefinition;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACEA;AACA;AACA;AAAA;AA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AA,QACV,OAAO;AAAA,UACL,gBACE,OAAO,SAAS,WAAW,aAAa;AAAA,QAC5C;AAAA,SAEC,KACH,CACD;AAAA,IACH;AAEA,WAAO,OAAO,OAAO,QAAQ,OAAO;AAEpC,WAAO,UAAU,OAAO,YAAY,SAAY,UAAU,OAAO;AAEjE,WAAO,eAAe,OAAO,gBAAgB;AAE7C,WAAO,oBAAoB,CAAC;AAC5B,WAAO;AAAA,EACT;AACF;AAEA,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataGrid/useDataGrid.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAKA;AACA;AAEA,MAAM,uBAAuB,mBAAmB;AAKzC,MAAM,cAAc,CAAC;AAAA,EAC1B,MAAM;AAAA,EACN,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,YAAY,CAAC;AAAA,KACV;AAAA,MACC;AACJ,QAAM,UAAU;AAChB,QAAM,WAAW,OAAO;AACxB,QAAM,WAAW,OAAO;AACxB,QAAM,YAAY,OAAO;AACzB,QAAM,UAAU,OAAO;AACvB,QAAM,eAAe,OAAO;AAC5B,QAAM,CAAC,QAAQ,SAAS,YAAa,OAAM,OAAO,EAAE;AACpD,QAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;AAChD,QAAM,CAAC,eAAe,oBAAoB,SAAS,KAAK;AACxD,QAAM,cAAc,OAAO;AAC3B,QAAM,gBAAgB,OAAO;AAC7B,QAAM,CAAC,gBAAgB,SAAS,MAAM,IAAI,qBAAqB,CAAC;AAGhE,QAAM,CAAC,cAAc,cAAc,yBAAyB,MAAM;AAAA,IAChE,UAAU,QAAQ,QAAQ;AAAA,MACxB;AAAA,MACA,QAAQ,CAAC,UACP,QACE,QAAQ,WAAW,qBAAqB,EAAE,KAAK,GAC/C,QAAQ,OAAO,KAAK,CACtB;AAAA,IACJ,CAAC;AAAA,IACD,qBAAqB;AAAA,EACvB,CAAC;AAED,WAAS,UAAU;AAAA,IACjB,oBAAoB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eAAe,OAAO,OAC9D;AACA,WAAO,eAAe,SAClB,gBAAgB,gBAAgB,YAAY,SAAS,OAAO,IAC5D,CAAC;AAAA,EACP,GAAG,CAAC,OAAO,CAAC;AAEZ,WAAS,QAAQ,eAAe,kBAC9B,WAAW,cACX,SAAS,OACX;AACA,WAAS,QAAQ,iBAAiB,kBAChC,WAAW,gBACX,SAAS,OACX;AACA,WAAS,QAAQ,cAAc,kBAC7B,WAAW,aACX,SAAS,OACX;AACA,WAAS,QAAQ,oBAAoB,kBACnC,WAAW,mBACX,SAAS,OACX;AACA,WAAS,QAAQ,gBAAgB,kBAC/B,WAAW,eACX,SAAS,OACX;AAEA,WAAS,QAAQ,eAAe,WAAW,YAAY,OACrD,CAAC,UAAU,WAAW,OAAO,UAAU,SAAS,OAAO,GACvD,SAAS,QAAQ,YACnB;AAEA,eAAa,OAAO,SAAS,QAAQ,YAAY;AAEjD,QAAM,uBAAuB,SAAS,QAAQ,cAAc;AAC5D,QAAM,YAAY,YAAY,SAAS,QAAQ,KAAK;AACpD,MAAI,SAAS,oBAAoB,KAAK,qBAAqB,QAAQ;AACjE,aAAS,QAAQ,cAAc,UAAU,qBAAqB;AAAA,EAChE,OAAO;AACL,aAAS,QAAQ,cAAc,UAAU,CAAC,QACxC,WACA,SAAS,QAAQ,KACnB;AAAA,EACF;AAEA,MAAI,MAAM;AAAa,WAAO,MAAM,aAAa,SAAS,OAAO;AAEjE,SAAO;AAAA,IACL,GAAG,SAAS;AAAA,IACZ;AAAA,EACF;AACF;AAEA,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataList/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './useDataList';\nexport * from './recordIterator';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataList/recordIterator.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA,MAAM,kBAAkB,MAAM;AAC5B,QAAM,MAAM,oDAAoD;AAClE;AAEO,wBACL,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
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataList/useDataList.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"m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AEvC,QAAI,cAAc,eAChB,MACA,SAAS,QAAQ,WAAW,gBAC5B,WAAW,QACX,SAAS,OACX;AAGA,kBAAc,WAAW,QAAQ,OAC/B,CAAC,UAAU,WAAW,OAAO,UAAU,SAAS,OAAO,GACvD,WACF;AAEA,WAAO;AAAA,EACT,CAAC;AAED,MAAI,MAAM;AAAa,WAAO,MAAM,aAAa,SAAS,OAAO;AAEjE,SAAO,SAAS;AAClB;AAEA,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/utils.js
CHANGED
package/dist/esm/utils.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/utils.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACCO,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;AAE3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,YAAY,OACxB,uBAAuB,KAAK,eAAe,YAAY,CACzD;AACA,WAAO,KAAK;AAAA,EACd,CAAC;AAEH,SAAO,IAAI,OAAO,WAAW;AAC/B;AAEO,MAAM,qBAAqB,MAAM;AACtC,QAAM,KAAK,OAAO,UAAU;AAC5B,QAAM,OAAO,GAAG,QAAQ,OAAO;AAE/B,MAAI,OAAO,KAAK,CAAC,CAAC,UAAU,UAAU,MAAM,kBAAkB,GAAG;AAC/D,WAAO;AAAA,EACT;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/virtualization/AutoHeightList.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEO,MAAM,iBAAiB,WAC5B,CACE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW,gBAAgB;AAAA,KACxB;AAAA,GAEL,QACG;AACH,QAAM,UAAU,OAAO;AACvB,QAAM,eAAe,OAAO;AAE5B,wBAAsB;AAAA,IACpB,cAAc;AAAA,IACd;AAAA,EACF,CAAC;AAED,SACE,qCAAC;AAAA,IACE,GAAG;AAAA,IACJ,KAAK,UAAU,KAAK,OAAO;AAAA,IAC3B,WAAW,GAAG,WAAW,0BAA0B;AAAA,IACnD,QAAQ,OAAO;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,UAAU,cAAc,QAAQ;AAAA,IAC1C,eAAe;AAAA,IACf,gBAAc;AAAA,GAChB;AAEJ,CACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/virtualization/FluidHeightList.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEO,MAAM,kBAAkB,WAC7B,CAAC,EAAE,WAAW,cAAc,SAAS,QACnC,qCAAC;AAAA,EAAU,cAAY;AAAA,GACpB,CAAC,EAAE,QAAQ,kBACV,qCAAC;AAAA,EACE,GAAG;AAAA,EACJ;AAAA,EACA,QAAQ,cAAc;AAAA,CACxB,CAEJ,CAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/virtualization/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAIO,iCAAiC,EAAE,WAAW,WAAW,OAAO,QAAQ,cAAc;AAC3F,MAAI;AAAY,WAAO;AACvB,MAAI;AAAO,WAAO;AAClB,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-shared",
|
|
3
|
-
"version": "3.3.1-rc.
|
|
3
|
+
"version": "3.3.1-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Shared components and utilities",
|
|
6
6
|
"files": [
|
|
@@ -215,8 +215,8 @@
|
|
|
215
215
|
"typeSafety": false
|
|
216
216
|
},
|
|
217
217
|
"dependencies": {
|
|
218
|
-
"@elliemae/ds-popover": "3.3.1-rc.
|
|
219
|
-
"@elliemae/ds-utilities": "3.3.1-rc.
|
|
218
|
+
"@elliemae/ds-popover": "3.3.1-rc.1",
|
|
219
|
+
"@elliemae/ds-utilities": "3.3.1-rc.1",
|
|
220
220
|
"hoist-non-react-statics": "~3.3.2",
|
|
221
221
|
"hotkeys-js": "~3.9.3",
|
|
222
222
|
"prop-types": "~15.8.1",
|