@elliemae/ds-shared 3.16.0 → 3.16.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/cjs/Animations/BaseAnimation.js +5 -13
- package/dist/cjs/Animations/BaseAnimation.js.map +2 -2
- package/dist/cjs/Animations/Grow.js +6 -10
- package/dist/cjs/Animations/Grow.js.map +2 -2
- package/dist/cjs/Animations/GrowRight.js +5 -1
- package/dist/cjs/Animations/GrowRight.js.map +2 -2
- package/dist/cjs/Animations/GrowVertical.js +5 -1
- package/dist/cjs/Animations/GrowVertical.js.map +2 -2
- package/dist/cjs/Animations/index.js +8 -4
- package/dist/cjs/Animations/index.js.map +2 -2
- package/dist/cjs/CheckableGroup.js +10 -4
- package/dist/cjs/CheckableGroup.js.map +2 -2
- package/dist/cjs/DeferRenderAfterComputation.js +5 -6
- package/dist/cjs/DeferRenderAfterComputation.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGrid.js +5 -1
- package/dist/cjs/FocusGroup/FocusGrid.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGroup.js +4 -0
- package/dist/cjs/FocusGroup/FocusGroup.js.map +1 -1
- package/dist/cjs/FocusGroup/FocusGroupContext.js +4 -0
- package/dist/cjs/FocusGroup/FocusGroupContext.js.map +1 -1
- package/dist/cjs/FocusGroup/FocusGroupManager.js +6 -2
- package/dist/cjs/FocusGroup/FocusGroupManager.js.map +2 -2
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js +17 -16
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js.map +2 -2
- package/dist/cjs/FocusGroup/index.js +11 -7
- package/dist/cjs/FocusGroup/index.js.map +2 -2
- package/dist/cjs/FocusGroup/useFocusGroupItem.js +5 -1
- package/dist/cjs/FocusGroup/useFocusGroupItem.js.map +2 -2
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js +4 -0
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js.map +2 -2
- package/dist/cjs/GroupContext/Group.js +5 -1
- package/dist/cjs/GroupContext/Group.js.map +2 -2
- package/dist/cjs/GroupContext/GroupContext.js +4 -0
- package/dist/cjs/GroupContext/GroupContext.js.map +1 -1
- package/dist/cjs/GroupContext/GroupItem.js +5 -1
- package/dist/cjs/GroupContext/GroupItem.js.map +2 -2
- package/dist/cjs/GroupContext/index.js +7 -3
- package/dist/cjs/GroupContext/index.js.map +2 -2
- package/dist/cjs/ScrollSync/ScrollSync.js +4 -0
- package/dist/cjs/ScrollSync/ScrollSync.js.map +1 -1
- package/dist/cjs/ScrollSync/ScrollSyncPane.js +6 -4
- package/dist/cjs/ScrollSync/ScrollSyncPane.js.map +2 -2
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js +25 -21
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js.map +2 -2
- package/dist/cjs/ScrollSync/index.js +8 -4
- package/dist/cjs/ScrollSync/index.js.map +2 -2
- package/dist/cjs/ScrollSync/useScrollSync.js +5 -3
- package/dist/cjs/ScrollSync/useScrollSync.js.map +2 -2
- package/dist/cjs/constants.js +4 -0
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/createDataInstance/createInstancePlugin.js +4 -0
- package/dist/cjs/createDataInstance/createInstancePlugin.js.map +1 -1
- package/dist/cjs/createDataInstance/createInstanceRef.js +12 -25
- package/dist/cjs/createDataInstance/createInstanceRef.js.map +2 -2
- package/dist/cjs/createDataInstance/index.js +7 -3
- package/dist/cjs/createDataInstance/index.js.map +2 -2
- package/dist/cjs/createDataInstance/utils.js +9 -20
- package/dist/cjs/createDataInstance/utils.js.map +2 -2
- package/dist/cjs/defer-render-hoc/index.js +4 -0
- package/dist/cjs/defer-render-hoc/index.js.map +2 -2
- package/dist/cjs/dimsum.config.js +4 -0
- package/dist/cjs/dimsum.config.js.map +1 -1
- package/dist/cjs/index.js +20 -16
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/prop-types.js +4 -0
- package/dist/cjs/prop-types.js.map +1 -1
- package/dist/cjs/react-spring/index.js +4 -0
- package/dist/cjs/react-spring/index.js.map +1 -1
- package/dist/cjs/react-spring/renderprops.js +4 -0
- package/dist/cjs/react-spring/renderprops.js.map +1 -1
- package/dist/cjs/toolbar/ToolbarProvider.js +4 -0
- package/dist/cjs/toolbar/ToolbarProvider.js.map +1 -1
- package/dist/cjs/useDataGrid/VolatileRowsListener.js +4 -0
- package/dist/cjs/useDataGrid/VolatileRowsListener.js.map +2 -2
- package/dist/cjs/useDataGrid/index.js +7 -3
- package/dist/cjs/useDataGrid/index.js.map +2 -2
- package/dist/cjs/useDataGrid/initColumnDefinition.js +9 -4
- package/dist/cjs/useDataGrid/initColumnDefinition.js.map +2 -2
- package/dist/cjs/useDataGrid/useDataGrid.js +10 -4
- package/dist/cjs/useDataGrid/useDataGrid.js.map +2 -2
- package/dist/cjs/useDataList/index.js +6 -2
- package/dist/cjs/useDataList/index.js.map +2 -2
- package/dist/cjs/useDataList/recordIterator.js +4 -0
- package/dist/cjs/useDataList/recordIterator.js.map +2 -2
- package/dist/cjs/useDataList/useDataList.js +15 -22
- package/dist/cjs/useDataList/useDataList.js.map +3 -3
- package/dist/cjs/utils.js +5 -3
- package/dist/cjs/utils.js.map +2 -2
- package/dist/cjs/virtualization/AutoHeightList.js +4 -0
- package/dist/cjs/virtualization/AutoHeightList.js.map +1 -1
- package/dist/cjs/virtualization/FluidHeightList.js +12 -10
- package/dist/cjs/virtualization/FluidHeightList.js.map +2 -2
- package/dist/cjs/virtualization/index.js +6 -2
- package/dist/cjs/virtualization/index.js.map +2 -2
- package/dist/esm/Animations/BaseAnimation.js +1 -13
- package/dist/esm/Animations/BaseAnimation.js.map +2 -2
- package/dist/esm/Animations/Grow.js +2 -10
- package/dist/esm/Animations/Grow.js.map +2 -2
- package/dist/esm/Animations/GrowRight.js +1 -1
- package/dist/esm/Animations/GrowRight.js.map +1 -1
- package/dist/esm/Animations/GrowVertical.js +1 -1
- package/dist/esm/Animations/GrowVertical.js.map +1 -1
- package/dist/esm/Animations/index.js +4 -4
- package/dist/esm/Animations/index.js.map +1 -1
- package/dist/esm/CheckableGroup.js +6 -4
- package/dist/esm/CheckableGroup.js.map +2 -2
- package/dist/esm/DeferRenderAfterComputation.js +1 -6
- package/dist/esm/DeferRenderAfterComputation.js.map +2 -2
- package/dist/esm/FocusGroup/FocusGrid.js +1 -1
- package/dist/esm/FocusGroup/FocusGrid.js.map +2 -2
- package/dist/esm/FocusGroup/FocusGroup.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGroupManager.js +2 -2
- package/dist/esm/FocusGroup/FocusGroupManager.js.map +2 -2
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js +13 -16
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js.map +2 -2
- package/dist/esm/FocusGroup/index.js +7 -7
- package/dist/esm/FocusGroup/index.js.map +1 -1
- package/dist/esm/FocusGroup/useFocusGroupItem.js +1 -1
- package/dist/esm/FocusGroup/useFocusGroupItem.js.map +2 -2
- package/dist/esm/FocusGroup/utils/getNextCellPosition.js.map +2 -2
- package/dist/esm/GroupContext/Group.js +1 -1
- package/dist/esm/GroupContext/Group.js.map +1 -1
- package/dist/esm/GroupContext/GroupItem.js +1 -1
- package/dist/esm/GroupContext/GroupItem.js.map +2 -2
- package/dist/esm/GroupContext/index.js +3 -3
- package/dist/esm/GroupContext/index.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSync.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSyncPane.js +2 -4
- package/dist/esm/ScrollSync/ScrollSyncPane.js.map +2 -2
- package/dist/esm/ScrollSync/ScrollSyncProvider.js +21 -21
- package/dist/esm/ScrollSync/ScrollSyncProvider.js.map +2 -2
- package/dist/esm/ScrollSync/index.js +4 -4
- package/dist/esm/ScrollSync/index.js.map +1 -1
- package/dist/esm/ScrollSync/useScrollSync.js +1 -3
- package/dist/esm/ScrollSync/useScrollSync.js.map +2 -2
- package/dist/esm/createDataInstance/createInstancePlugin.js.map +1 -1
- package/dist/esm/createDataInstance/createInstanceRef.js +8 -29
- package/dist/esm/createDataInstance/createInstanceRef.js.map +2 -2
- package/dist/esm/createDataInstance/index.js +3 -3
- package/dist/esm/createDataInstance/index.js.map +1 -1
- package/dist/esm/createDataInstance/utils.js +5 -20
- package/dist/esm/createDataInstance/utils.js.map +2 -2
- package/dist/esm/defer-render-hoc/index.js.map +2 -2
- package/dist/esm/index.js +16 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/dist/esm/useDataGrid/VolatileRowsListener.js.map +2 -2
- package/dist/esm/useDataGrid/index.js +3 -3
- package/dist/esm/useDataGrid/index.js.map +1 -1
- package/dist/esm/useDataGrid/initColumnDefinition.js +5 -4
- package/dist/esm/useDataGrid/initColumnDefinition.js.map +2 -2
- package/dist/esm/useDataGrid/useDataGrid.js +6 -4
- package/dist/esm/useDataGrid/useDataGrid.js.map +2 -2
- package/dist/esm/useDataList/index.js +2 -2
- package/dist/esm/useDataList/index.js.map +1 -1
- package/dist/esm/useDataList/recordIterator.js.map +2 -2
- package/dist/esm/useDataList/useDataList.js +9 -23
- package/dist/esm/useDataList/useDataList.js.map +2 -2
- package/dist/esm/utils.js +1 -3
- package/dist/esm/utils.js.map +2 -2
- package/dist/esm/virtualization/AutoHeightList.js.map +1 -1
- package/dist/esm/virtualization/FluidHeightList.js +8 -10
- package/dist/esm/virtualization/FluidHeightList.js.map +2 -2
- package/dist/esm/virtualization/index.js +2 -2
- package/dist/esm/virtualization/index.js.map +1 -1
- package/dist/types/Animations/BaseAnimation.d.ts +1 -0
- package/dist/types/Animations/Grow.d.ts +2 -1
- package/dist/types/Animations/GrowRight.d.ts +1 -0
- package/dist/types/Animations/GrowVertical.d.ts +1 -0
- package/dist/types/Animations/index.d.ts +4 -4
- package/dist/types/CheckableGroup.d.ts +8 -9
- package/dist/types/DeferRenderAfterComputation.d.ts +1 -1
- package/dist/types/FocusGroup/focusGroupManagerHoc.d.ts +1 -0
- package/dist/types/FocusGroup/index.d.ts +7 -7
- package/dist/types/GroupContext/GroupItem.d.ts +1 -0
- package/dist/types/GroupContext/index.d.ts +3 -3
- package/dist/types/ScrollSync/ScrollSyncPane.d.ts +1 -0
- package/dist/types/ScrollSync/ScrollSyncProvider.d.ts +11 -10
- package/dist/types/ScrollSync/index.d.ts +4 -4
- package/dist/types/createDataInstance/index.d.ts +3 -3
- package/dist/types/index.d.ts +16 -16
- package/dist/types/useDataGrid/index.d.ts +3 -3
- package/dist/types/useDataList/index.d.ts +2 -2
- package/dist/types/virtualization/index.d.ts +2 -2
- package/package.json +7 -7
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -33,10 +37,10 @@ var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
|
33
37
|
var import_react = require("react");
|
|
34
38
|
var import_uuid = require("uuid");
|
|
35
39
|
var resolve = __toESM(require("table-resolver"));
|
|
36
|
-
var import_initColumnDefinition = require("./initColumnDefinition");
|
|
37
|
-
var import_utils = require("../createDataInstance/utils");
|
|
38
|
-
var import_VolatileRowsListener = require("./VolatileRowsListener");
|
|
39
|
-
var import_utils2 = require("../utils");
|
|
40
|
+
var import_initColumnDefinition = require("./initColumnDefinition.js");
|
|
41
|
+
var import_utils = require("../createDataInstance/utils.js");
|
|
42
|
+
var import_VolatileRowsListener = require("./VolatileRowsListener.js");
|
|
43
|
+
var import_utils2 = require("../utils.js");
|
|
40
44
|
const IS_INTERNET_EXPLORER = (0, import_utils2.isInternetExplorer)();
|
|
41
45
|
const useDataGrid = ({ uuid: uuidProp, plugins: pluginsFromProps, rows, columns, renderers = {}, ...props }) => {
|
|
42
46
|
const plugins = pluginsFromProps;
|
|
@@ -84,7 +88,9 @@ const useDataGrid = ({ uuid: uuidProp, plugins: pluginsFromProps, rows, columns,
|
|
|
84
88
|
updateRows
|
|
85
89
|
},
|
|
86
90
|
updateRows,
|
|
91
|
+
// eslint-disable-next-line no-return-assign
|
|
87
92
|
enableEvents: () => document.body.style.pointerEvents = IS_INTERNET_EXPLORER ? "" : null,
|
|
93
|
+
// eslint-disable-next-line no-return-assign
|
|
88
94
|
disableEvents: () => document.body.style.pointerEvents = "none",
|
|
89
95
|
observeRows: (observer) => RowsObserver.observe(observer),
|
|
90
96
|
hotKeys: {},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/useDataGrid/useDataGrid.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
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 { applyDecorators, decorateColumns, reducePropsGetter } 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 = ({ uuid: uuidProp, plugins: pluginsFromProps, rows, columns, renderers = {}, ...props }) => {\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) => compose(resolve.byFunction('valueTransformation')(extra), resolve.nested(extra)),\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: () => (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((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 }, instance.current);\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((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 }, instance.current);\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 ? decorateColumns(visibleColumns, decorators, instance.current) : [];\n }, [columns]);\n\n instance.current.getBodyProps = reducePropsGetter(decorators.getBodyProps, instance.current);\n instance.current.getHeaderProps = reducePropsGetter(decorators.getHeaderProps, instance.current);\n instance.current.getRowProps = reducePropsGetter(decorators.getRowProps, instance.current);\n instance.current.getHeaderRowProps = reducePropsGetter(decorators.getHeaderRowProps, instance.current);\n instance.current.getTableProps = reducePropsGetter(decorators.getTableProps, instance.current);\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(prevState, instance.current.state);\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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
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.js';\nimport { applyDecorators, decorateColumns, reducePropsGetter } from '../createDataInstance/utils.js';\nimport { VolatileRowsListener } from './VolatileRowsListener.js';\nimport { isInternetExplorer } from '../utils.js';\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 = ({ uuid: uuidProp, plugins: pluginsFromProps, rows, columns, renderers = {}, ...props }) => {\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) => compose(resolve.byFunction('valueTransformation')(extra), resolve.nested(extra)),\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: () => (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((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 }, instance.current);\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((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 }, instance.current);\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 ? decorateColumns(visibleColumns, decorators, instance.current) : [];\n }, [columns]);\n\n instance.current.getBodyProps = reducePropsGetter(decorators.getBodyProps, instance.current);\n instance.current.getHeaderProps = reducePropsGetter(decorators.getHeaderProps, instance.current);\n instance.current.getRowProps = reducePropsGetter(decorators.getRowProps, instance.current);\n instance.current.getHeaderRowProps = reducePropsGetter(decorators.getHeaderRowProps, instance.current);\n instance.current.getTableProps = reducePropsGetter(decorators.getTableProps, instance.current);\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(prevState, instance.current.state);\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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAQO;AACP,mBAA0C;AAC1C,kBAA6B;AAC7B,cAAyB;AACzB,kCAAqC;AACrC,mBAAoE;AACpE,kCAAqC;AACrC,IAAAA,gBAAmC;AAEnC,MAAM,2BAAuB,kCAAmB;AAKzC,MAAM,cAAc,CAAC,EAAE,MAAM,UAAU,SAAS,kBAAkB,MAAM,SAAS,YAAY,CAAC,GAAG,GAAG,MAAM,MAAM;AACrH,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,uBAAS,KAAK;AAChD,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAS,KAAK;AACxD,QAAM,kBAAc,qBAAO;AAC3B,QAAM,oBAAgB,qBAAO;AAC7B,QAAM,CAAC,YAAY,QAAI,uBAAS,MAAM,IAAI,iDAAqB,CAAC;AAGhE,QAAM,CAAC,cAAc,UAAU,QAAI,8CAAyB,MAAM;AAAA,IAChE,UAAU,QAAQ,QAAQ;AAAA,MACxB;AAAA,MACA,QAAQ,CAAC,cAAU,6BAAQ,QAAQ,WAAW,qBAAqB,EAAE,KAAK,GAAG,QAAQ,OAAO,KAAK,CAAC;AAAA,IACpG,CAAC;AAAA,IACD,qBAAqB;AAAA,EACvB,CAAC;AAED,WAAS,UAAU;AAAA,IACjB,wBAAoB,+BAAU,SAAS;AAAA,IACvC,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA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CAAC,WAAW,OAAO,OAAO,YAAY,eAAe,OAAO;AAAA,IAC9D;AACA,WAAO,eAAe,aAAS,8BAAgB,gBAAgB,YAAY,SAAS,OAAO,IAAI,CAAC;AAAA,EAClG,GAAG,CAAC,OAAO,CAAC;AAEZ,WAAS,QAAQ,mBAAe,gCAAkB,WAAW,cAAc,SAAS,OAAO;AAC3F,WAAS,QAAQ,qBAAiB,gCAAkB,WAAW,gBAAgB,SAAS,OAAO;AAC/F,WAAS,QAAQ,kBAAc,gCAAkB,WAAW,aAAa,SAAS,OAAO;AACzF,WAAS,QAAQ,wBAAoB,gCAAkB,WAAW,mBAAmB,SAAS,OAAO;AACrG,WAAS,QAAQ,oBAAgB,gCAAkB,WAAW,eAAe,SAAS,OAAO;AAE7F,WAAS,QAAQ,eAAe,WAAW,YAAY;AAAA,IACrD,CAAC,UAAU,WAAW,OAAO,UAAU,SAAS,OAAO;AAAA,IACvD,SAAS,QAAQ;AAAA,EACnB;AAEA,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,6BAAQ,WAAW,SAAS,QAAQ,KAAK;AAAA,EACrF;AAEA,MAAI,MAAM;AAAa,oCAAO,MAAM,aAAa,SAAS,OAAO;AAEjE,SAAO;AAAA,IACL,GAAG,SAAS;AAAA,IACZ;AAAA,EACF;AACF;AAEA,IAAO,sBAAQ;",
|
|
6
6
|
"names": ["import_utils", "uuidv4"]
|
|
7
7
|
}
|
|
@@ -15,6 +15,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
};
|
|
16
16
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
17
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
18
22
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
19
23
|
mod
|
|
20
24
|
));
|
|
@@ -22,6 +26,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
26
|
var useDataList_exports = {};
|
|
23
27
|
module.exports = __toCommonJS(useDataList_exports);
|
|
24
28
|
var React = __toESM(require("react"));
|
|
25
|
-
__reExport(useDataList_exports, require("./useDataList"), module.exports);
|
|
26
|
-
__reExport(useDataList_exports, require("./recordIterator"), module.exports);
|
|
29
|
+
__reExport(useDataList_exports, require("./useDataList.js"), module.exports);
|
|
30
|
+
__reExport(useDataList_exports, require("./recordIterator.js"), module.exports);
|
|
27
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/useDataList/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from './useDataList';\nexport * from './recordIterator';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export * from './useDataList.js';\nexport * from './recordIterator.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,gCAAc,6BAAd;AACA,gCAAc,gCADd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/useDataList/recordIterator.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["const defaultStrategy = () => {\n throw Error('Implement an iterator strategy for record iterator');\n};\n\nexport function recordIterator(
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["const defaultStrategy = () => {\n throw Error('Implement an iterator strategy for record iterator');\n};\n\nexport function recordIterator(records, strategy = defaultStrategy, decorators = [], instance) {\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,MAAM,kBAAkB,MAAM;AAC5B,QAAM,MAAM,oDAAoD;AAClE;AAEO,SAAS,eAAe,SAAS,WAAW,iBAAiB,aAAa,CAAC,GAAG,UAAU;AAC7F,QAAM,WAAW,CAAC;AAElB,WAAS;AAAA,IACP,MAAM;AAAA,IACN,IAAI,CAAC,QAAQ;AACX,UAAI,UAAU;AAGd,eAAS,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;AAC1C,kBAAU,WAAW,CAAC,EAAE,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
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -33,12 +37,12 @@ module.exports = __toCommonJS(useDataList_exports);
|
|
|
33
37
|
var React = __toESM(require("react"));
|
|
34
38
|
var import_react = require("react");
|
|
35
39
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
36
|
-
var
|
|
37
|
-
var import_utils = require("../createDataInstance/utils");
|
|
38
|
-
var import_recordIterator = require("./recordIterator");
|
|
39
|
-
var import_createInstanceRef = require("../createDataInstance/createInstanceRef");
|
|
40
|
-
const getItemLabel = (record, nameKey = "name") => (0,
|
|
41
|
-
const getItemChildren = (record, childrenKey = "children") => (0,
|
|
40
|
+
var import_lodash = require("lodash");
|
|
41
|
+
var import_utils = require("../createDataInstance/utils.js");
|
|
42
|
+
var import_recordIterator = require("./recordIterator.js");
|
|
43
|
+
var import_createInstanceRef = require("../createDataInstance/createInstanceRef.js");
|
|
44
|
+
const getItemLabel = (record, nameKey = "name") => (0, import_lodash.get)(record, ["data", nameKey]);
|
|
45
|
+
const getItemChildren = (record, childrenKey = "children") => (0, import_lodash.get)(record, ["data", childrenKey]);
|
|
42
46
|
const listRenderers = {
|
|
43
47
|
list: "ul",
|
|
44
48
|
item: "li"
|
|
@@ -62,6 +66,7 @@ const useDataList = ({
|
|
|
62
66
|
getListProps: [],
|
|
63
67
|
getItemProps: [],
|
|
64
68
|
itemRenderer: [...itemRenderer],
|
|
69
|
+
// components reduce to compose item content
|
|
65
70
|
record: [],
|
|
66
71
|
records: []
|
|
67
72
|
},
|
|
@@ -74,18 +79,9 @@ const useDataList = ({
|
|
|
74
79
|
instance.current.getItemLabel = (record) => getItemLabel(record, props.nameKey);
|
|
75
80
|
instance.current.getItemChildren = (record) => getItemChildren(record, props.childrenKey);
|
|
76
81
|
instance.current.decorators = decorators;
|
|
77
|
-
instance.current.getListProps = (0, import_utils.reducePropsGetter)(
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
);
|
|
82
|
+
instance.current.getListProps = (0, import_utils.reducePropsGetter)(decorators.getListProps, instance.current);
|
|
83
|
+
instance.current.getItemProps = (0, import_utils.reducePropsGetter)(decorators.getItemProps, instance.current);
|
|
84
|
+
instance.current.itemRenderer = (0, import_utils.composeFormatters)(instance.current.decorators.itemRenderer, instance.current);
|
|
89
85
|
instance.current.records = (0, import_react.useMemo)(() => {
|
|
90
86
|
let nextRecords = (0, import_recordIterator.recordIterator)(
|
|
91
87
|
data,
|
|
@@ -93,10 +89,7 @@ const useDataList = ({
|
|
|
93
89
|
decorators.record,
|
|
94
90
|
instance.current
|
|
95
91
|
);
|
|
96
|
-
nextRecords = decorators.records.reduce(
|
|
97
|
-
(nextRows, getter) => getter(nextRows, instance.current),
|
|
98
|
-
nextRecords
|
|
99
|
-
);
|
|
92
|
+
nextRecords = decorators.records.reduce((nextRows, getter) => getter(nextRows, instance.current), nextRecords);
|
|
100
93
|
return nextRecords;
|
|
101
94
|
});
|
|
102
95
|
if (props.instanceRef)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/useDataList/useDataList.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemo, useRef } from 'react';\nimport { setRef } from '@elliemae/ds-utilities';\nimport get from 'lodash
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import { useMemo, useRef } from 'react';\nimport { setRef } from '@elliemae/ds-utilities';\nimport { get } from 'lodash';\nimport { composeFormatters, reducePropsGetter } from '../createDataInstance/utils.js';\nimport { recordIterator } from './recordIterator.js';\nimport { createDataInstanceRef } from '../createDataInstance/createInstanceRef.js';\n\nexport const getItemLabel = (record, nameKey = 'name') => get(record, ['data', nameKey]);\nexport const getItemChildren = (record, childrenKey = 'children') => 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) => getItemLabel(record, props.nameKey);\n instance.current.getItemChildren = (record) => getItemChildren(record, props.childrenKey);\n\n instance.current.decorators = decorators;\n instance.current.getListProps = reducePropsGetter(decorators.getListProps, instance.current);\n instance.current.getItemProps = reducePropsGetter(decorators.getItemProps, instance.current);\n instance.current.itemRenderer = composeFormatters(instance.current.decorators.itemRenderer, instance.current);\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((nextRows, getter) => getter(nextRows, instance.current), nextRecords);\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAgC;AAChC,0BAAuB;AACvB,oBAAoB;AACpB,mBAAqD;AACrD,4BAA+B;AAC/B,+BAAsC;AAE/B,MAAM,eAAe,CAAC,QAAQ,UAAU,eAAW,mBAAI,QAAQ,CAAC,QAAQ,OAAO,CAAC;AAChF,MAAM,kBAAkB,CAAC,QAAQ,cAAc,mBAAe,mBAAI,QAAQ,CAAC,QAAQ,WAAW,CAAC;AAEtG,MAAM,gBAAgB;AAAA,EACpB,MAAM;AAAA,EACN,MAAM;AACR;AAGO,MAAM,cAAc,CAAC;AAAA,EAC1B,OAAO,CAAC;AAAA,EACR,UAAU,CAAC;AAAA,EACX,YAAY;AAAA,EACZ,eAAe,CAAC;AAAA,EAChB;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,cAAU,qBAAO;AACvB,QAAM,EAAE,UAAU,WAAW,QAAI,gDAAsB;AA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toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -88,9 +92,7 @@ const listWithChildren = (list, childrenProp) => list.map((item) => ({
|
|
|
88
92
|
const getAllNonEmptyNodesIds = (items, childrenProp) => {
|
|
89
93
|
let childrenIds = [];
|
|
90
94
|
const ids = items.filter((item) => item[childrenProp].length).map((item) => {
|
|
91
|
-
childrenIds = childrenIds.concat(
|
|
92
|
-
getAllNonEmptyNodesIds(item[childrenProp], childrenProp)
|
|
93
|
-
);
|
|
95
|
+
childrenIds = childrenIds.concat(getAllNonEmptyNodesIds(item[childrenProp], childrenProp));
|
|
94
96
|
return item.id;
|
|
95
97
|
});
|
|
96
98
|
return ids.concat(childrenIds);
|
package/dist/cjs/utils.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-cond-assign */\nexport const objectType = (obj)
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-cond-assign */\nexport const objectType = (obj) => 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)) 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 = window.pageYOffset || documentElement.scrollTop || body.scrollTop;\n const scrollLeft = 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] ? listWithChildren(item[childrenProp], childrenProp) : [],\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(getAllNonEmptyNodesIds(item[childrenProp], childrenProp));\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
|
+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AAiB,CAAC,SAAS;AACtC,MAAI,MAAM;AACV,MAAI,OAAO;AAGX,SAAQ,OAAO,KAAK,YAAa;AAC/B,WAAO,KAAK,aAAa;AACzB,YAAQ,KAAK,cAAc;AAAA,EAC7B;AAEA,SAAO,EAAE,KAAK,KAAK;AACrB;AAEO,MAAM,oBAAoB,CAAC,GAAG,OAAO;AAAA,EAC1C,WAAW,aAAa,QAAQ;AAClC;AAEO,MAAM,mBAAmB,CAAC,MAAM,iBACrC,KAAK,IAAI,CAAC,UAAU;AAAA,EAClB,GAAG;AAAA,EACH,CAAC,YAAY,GAAG,KAAK,YAAY,IAAI,iBAAiB,KAAK,YAAY,GAAG,YAAY,IAAI,CAAC;AAC7F,EAAE;AAEG,MAAM,yBAAyB,CAAC,OAAO,iBAAiB;AAC7D,MAAI,cAAc,CAAC;AACnB,QAAM,MAAM,MACT,OAAO,CAAC,SAAS,KAAK,YAAY,EAAE,MAAM,EAC1C,IAAI,CAAC,SAAS;AACb,kBAAc,YAAY,OAAO,uBAAuB,KAAK,YAAY,GAAG,YAAY,CAAC;AACzF,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
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4BjB;AA5BN,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,IAC3B,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,cAAU,qBAAO;AACvB,UAAM,mBAAe,qBAAO;AAE5B,mDAAsB;AAAA,MACpB,cAAc;AAAA,MACd;AAAA,IACF,CAAC;AAED,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,SAAK,+BAAU,KAAK,OAAO;AAAA,QAC3B,eAAW,wBAAG,WAAW,0BAA0B;AAAA,QACnD,QAAQ,OAAO;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,cAAU,+BAAU,cAAc,QAAQ;AAAA,QAC1C,eAAe;AAAA,QACf,gBAAc;AAAA;AAAA,IAChB;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["List"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -31,14 +35,12 @@ var React = __toESM(require("react"));
|
|
|
31
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
36
|
var import_react = require("react");
|
|
33
37
|
var import_react_virtualized_auto_sizer = __toESM(require("react-virtualized-auto-sizer"));
|
|
34
|
-
const FluidHeightList = (0, import_react.forwardRef)(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
) })
|
|
43
|
-
);
|
|
38
|
+
const FluidHeightList = (0, import_react.forwardRef)(({ component: Component, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_virtualized_auto_sizer.default, { disableWidth: true, children: ({ height: fluidHeight }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
+
Component,
|
|
40
|
+
{
|
|
41
|
+
...props,
|
|
42
|
+
ref,
|
|
43
|
+
height: fluidHeight - 32
|
|
44
|
+
}
|
|
45
|
+
) }));
|
|
44
46
|
//# sourceMappingURL=FluidHeightList.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/virtualization/FluidHeightList.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { forwardRef } from 'react';\nimport AutoSizer from 'react-virtualized-auto-sizer';\n\nexport const FluidHeightList = forwardRef(
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React, { forwardRef } from 'react';\nimport AutoSizer from 'react-virtualized-auto-sizer';\n\nexport const FluidHeightList = forwardRef(({ 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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADMjB;AANN,mBAAkC;AAClC,0CAAsB;AAEf,MAAM,sBAAkB,yBAAW,CAAC,EAAE,WAAW,WAAW,GAAG,MAAM,GAAG,QAC7E,4CAAC,oCAAAA,SAAA,EAAU,cAAY,MACpB,WAAC,EAAE,QAAQ,YAAY,MACtB;AAAA,EAAC;AAAA;AAAA,IACE,GAAG;AAAA,IACJ;AAAA,IACA,QAAQ,cAAc;AAAA;AACxB,GAEJ,CACD;",
|
|
6
6
|
"names": ["AutoSizer"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -30,8 +34,8 @@ __export(virtualization_exports, {
|
|
|
30
34
|
});
|
|
31
35
|
module.exports = __toCommonJS(virtualization_exports);
|
|
32
36
|
var React = __toESM(require("react"));
|
|
33
|
-
var import_FluidHeightList = require("./FluidHeightList");
|
|
34
|
-
var import_AutoHeightList = require("./AutoHeightList");
|
|
37
|
+
var import_FluidHeightList = require("./FluidHeightList.js");
|
|
38
|
+
var import_AutoHeightList = require("./AutoHeightList.js");
|
|
35
39
|
function getVirtualListComponent({ component: Component, fluid, height, autoHeight }) {
|
|
36
40
|
if (autoHeight)
|
|
37
41
|
return import_AutoHeightList.AutoHeightList;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/virtualization/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
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": "
|
|
4
|
+
"sourcesContent": ["import { FluidHeightList } from './FluidHeightList.js';\nimport { AutoHeightList } from './AutoHeightList.js';\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
}
|
|
@@ -10,19 +10,7 @@ const BaseAnimation = ({
|
|
|
10
10
|
leave = {},
|
|
11
11
|
onRest = () => null,
|
|
12
12
|
children
|
|
13
|
-
}) => /* @__PURE__ */ jsx(
|
|
14
|
-
Transition,
|
|
15
|
-
{
|
|
16
|
-
config: { duration },
|
|
17
|
-
enter,
|
|
18
|
-
from,
|
|
19
|
-
items,
|
|
20
|
-
keys,
|
|
21
|
-
leave,
|
|
22
|
-
onRest,
|
|
23
|
-
children
|
|
24
|
-
}
|
|
25
|
-
);
|
|
13
|
+
}) => /* @__PURE__ */ jsx(Transition, { config: { duration }, enter, from, items, keys, leave, onRest, children });
|
|
26
14
|
var BaseAnimation_default = BaseAnimation;
|
|
27
15
|
export {
|
|
28
16
|
BaseAnimation,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/Animations/BaseAnimation.tsx"],
|
|
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
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACcrB;AAZF,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
|
|
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 config={{ duration }} enter={enter} from={from} items={items} keys={keys} leave={leave} onRest={onRest}>\n {children}\n </Transition>\n);\n\nexport { BaseAnimation };\nexport default BaseAnimation;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACcrB;AAZF,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,cAAW,QAAQ,EAAE,SAAS,GAAG,OAAc,MAAY,OAAc,MAAY,OAAc,QACjG,UACH;AAIF,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { BaseAnimation } from "./BaseAnimation";
|
|
4
|
-
const Grow = ({
|
|
5
|
-
keys = void 0,
|
|
6
|
-
duration,
|
|
7
|
-
items = void 0,
|
|
8
|
-
from = 0,
|
|
9
|
-
to = 1,
|
|
10
|
-
children,
|
|
11
|
-
onRest = () => null
|
|
12
|
-
}) => /* @__PURE__ */ jsx(
|
|
3
|
+
import { BaseAnimation } from "./BaseAnimation.js";
|
|
4
|
+
const Grow = ({ keys = void 0, duration, items = void 0, from = 0, to = 1, children, onRest = () => null }) => /* @__PURE__ */ jsx(
|
|
13
5
|
BaseAnimation,
|
|
14
6
|
{
|
|
15
7
|
duration,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/Animations/Grow.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { BaseAnimation } from './BaseAnimation';\n\nconst Grow = ({
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { BaseAnimation } from './BaseAnimation.js';\n\nconst Grow = ({ keys = undefined, duration, items = undefined, from = 0, to = 1, children, onRest = () => null }) => (\n <BaseAnimation\n duration={duration}\n enter={{ opacity: 1, transform: `scale(${to})` }}\n from={{ opacity: 0, transform: `scale(${from})` }}\n items={items}\n keys={keys}\n leave={{ opacity: 0, transform: `scale(${from})` }}\n onRest={onRest}\n >\n {children}\n </BaseAnimation>\n);\n\nexport { Grow };\nexport default Grow;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIrB;AAHF,SAAS,qBAAqB;AAE9B,MAAM,OAAO,CAAC,EAAE,OAAO,QAAW,UAAU,QAAQ,QAAW,OAAO,GAAG,KAAK,GAAG,UAAU,SAAS,MAAM,KAAK,MAC7G;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,OAAO,EAAE,SAAS,GAAG,WAAW,SAAS,MAAM;AAAA,IAC/C,MAAM,EAAE,SAAS,GAAG,WAAW,SAAS,QAAQ;AAAA,IAChD;AAAA,IACA;AAAA,IACA,OAAO,EAAE,SAAS,GAAG,WAAW,SAAS,QAAQ;AAAA,IACjD;AAAA,IAEC;AAAA;AACH;AAIF,IAAO,eAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/Animations/GrowRight.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { BaseAnimation } from './BaseAnimation';\n\nconst GrowRight = ({\n keys = undefined,\n items = undefined,\n duration = 200,\n from = 0,\n to = 1,\n children,\n onRest = () => null,\n}) => (\n <BaseAnimation\n duration={duration}\n enter={{\n opacity: `${to}`,\n transform: 'translateX(0px)',\n }}\n from={{\n opacity: `${from}`,\n transform: 'translateX(100%)',\n }}\n items={items}\n keys={keys}\n leave={{\n opacity: `${from}`,\n transform: 'translateX(100%)',\n }}\n onRest={onRest}\n >\n {children}\n </BaseAnimation>\n);\n\nexport { GrowRight };\nexport default GrowRight;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { BaseAnimation } from './BaseAnimation.js';\n\nconst GrowRight = ({\n keys = undefined,\n items = undefined,\n duration = 200,\n from = 0,\n to = 1,\n children,\n onRest = () => null,\n}) => (\n <BaseAnimation\n duration={duration}\n enter={{\n opacity: `${to}`,\n transform: 'translateX(0px)',\n }}\n from={{\n opacity: `${from}`,\n transform: 'translateX(100%)',\n }}\n items={items}\n keys={keys}\n leave={{\n opacity: `${from}`,\n transform: 'translateX(100%)',\n }}\n onRest={onRest}\n >\n {children}\n </BaseAnimation>\n);\n\nexport { GrowRight };\nexport default GrowRight;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACYrB;AAXF,SAAS,qBAAqB;AAE9B,MAAM,YAAY,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AAAA,EACP,KAAK;AAAA,EACL;AAAA,EACA,SAAS,MAAM;AACjB,MACE;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,OAAO;AAAA,MACL,SAAS,GAAG;AAAA,MACZ,WAAW;AAAA,IACb;AAAA,IACA,MAAM;AAAA,MACJ,SAAS,GAAG;AAAA,MACZ,WAAW;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACL,SAAS,GAAG;AAAA,MACZ,WAAW;AAAA,IACb;AAAA,IACA;AAAA,IAEC;AAAA;AACH;AAIF,IAAO,oBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/Animations/GrowVertical.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { BaseAnimation } from './BaseAnimation';\n\nconst GrowVertical = ({\n keys = undefined,\n duration,\n items = undefined,\n from = 0,\n to = 1,\n children,\n onRest = () => null,\n}) => (\n <BaseAnimation\n duration={duration}\n enter={{ opacity: 1, transform: `scaleY(${to})`, transformOrigin: 'top' }}\n from={{\n opacity: 0,\n transform: `scaleY(${from})`,\n transformOrigin: 'top',\n }}\n items={items}\n keys={keys}\n leave={{\n opacity: 0,\n transform: `scaleY(${from})`,\n transformOrigin: 'top',\n }}\n onRest={onRest}\n >\n {children}\n </BaseAnimation>\n);\n\nexport { GrowVertical };\nexport default GrowVertical;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { BaseAnimation } from './BaseAnimation.js';\n\nconst GrowVertical = ({\n keys = undefined,\n duration,\n items = undefined,\n from = 0,\n to = 1,\n children,\n onRest = () => null,\n}) => (\n <BaseAnimation\n duration={duration}\n enter={{ opacity: 1, transform: `scaleY(${to})`, transformOrigin: 'top' }}\n from={{\n opacity: 0,\n transform: `scaleY(${from})`,\n transformOrigin: 'top',\n }}\n items={items}\n keys={keys}\n leave={{\n opacity: 0,\n transform: `scaleY(${from})`,\n transformOrigin: 'top',\n }}\n onRest={onRest}\n >\n {children}\n </BaseAnimation>\n);\n\nexport { GrowVertical };\nexport default GrowVertical;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACYrB;AAXF,SAAS,qBAAqB;AAE9B,MAAM,eAAe,CAAC;AAAA,EACpB,OAAO;AAAA,EACP;AAAA,EACA,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,KAAK;AAAA,EACL;AAAA,EACA,SAAS,MAAM;AACjB,MACE;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,OAAO,EAAE,SAAS,GAAG,WAAW,UAAU,OAAO,iBAAiB,MAAM;AAAA,IACxE,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,WAAW,UAAU;AAAA,MACrB,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,MACT,WAAW,UAAU;AAAA,MACrB,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IAEC;AAAA;AACH;AAIF,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export * from "./BaseAnimation";
|
|
3
|
-
export * from "./Grow";
|
|
4
|
-
export * from "./GrowRight";
|
|
5
|
-
export * from "./GrowVertical";
|
|
2
|
+
export * from "./BaseAnimation.js";
|
|
3
|
+
export * from "./Grow.js";
|
|
4
|
+
export * from "./GrowRight.js";
|
|
5
|
+
export * from "./GrowVertical.js";
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/Animations/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './BaseAnimation';\nexport * from './Grow';\nexport * from './GrowRight';\nexport * from './GrowVertical';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './BaseAnimation.js';\nexport * from './Grow.js';\nexport * from './GrowRight.js';\nexport * from './GrowVertical.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,16 +21,18 @@ function useCheckableGroup({ children, active: activeProp, multi, onCheck = () =
|
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
const CheckableGroup = ({
|
|
25
25
|
active = [],
|
|
26
26
|
multi = false,
|
|
27
|
+
// checkbox or radio
|
|
27
28
|
children
|
|
28
|
-
}) {
|
|
29
|
-
return useCheckableGroup({ active, multi, children });
|
|
30
|
-
}
|
|
29
|
+
}) => useCheckableGroup({ active, multi, children });
|
|
31
30
|
CheckableGroup.propTypes = {
|
|
31
|
+
/* The item (if multi false) or items (if multi true) selected */
|
|
32
32
|
active: PropTypes.arrayOf(PropTypes.string),
|
|
33
|
+
/* Whether is multi select or not */
|
|
33
34
|
multi: PropTypes.bool,
|
|
35
|
+
/* Handler when a user checks an item */
|
|
34
36
|
onCheck: PropTypes.func
|
|
35
37
|
};
|
|
36
38
|
var CheckableGroup_default = CheckableGroup;
|