@elliemae/ds-shared 3.0.0-next.8 → 3.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Animations/BaseAnimation.js +9 -16
- package/dist/cjs/Animations/BaseAnimation.js.map +1 -1
- package/dist/cjs/Animations/Grow.js +9 -16
- package/dist/cjs/Animations/Grow.js.map +1 -1
- package/dist/cjs/Animations/GrowRight.js +9 -16
- package/dist/cjs/Animations/GrowRight.js.map +1 -1
- package/dist/cjs/Animations/GrowVertical.js +19 -10
- package/dist/cjs/Animations/GrowVertical.js.map +3 -3
- package/dist/cjs/Animations/index.js +25 -0
- package/dist/cjs/Animations/index.js.map +7 -0
- package/dist/cjs/CheckableGroup.js +10 -22
- package/dist/cjs/CheckableGroup.js.map +2 -2
- package/dist/cjs/DeferRenderAfterComputation.js +9 -16
- package/dist/cjs/DeferRenderAfterComputation.js.map +1 -1
- package/dist/cjs/FocusGroup/FocusGrid.js +9 -16
- package/dist/cjs/FocusGroup/FocusGrid.js.map +1 -1
- package/dist/cjs/FocusGroup/FocusGroup.js +27 -16
- package/dist/cjs/FocusGroup/FocusGroup.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGroupContext.js +9 -16
- package/dist/cjs/FocusGroup/FocusGroupContext.js.map +1 -1
- package/dist/cjs/FocusGroup/FocusGroupManager.js +9 -16
- package/dist/cjs/FocusGroup/FocusGroupManager.js.map +1 -1
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js +9 -16
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js.map +1 -1
- package/dist/cjs/FocusGroup/index.js +16 -26
- package/dist/cjs/FocusGroup/index.js.map +2 -2
- package/dist/cjs/FocusGroup/useFocusGroupItem.js +9 -16
- package/dist/cjs/FocusGroup/useFocusGroupItem.js.map +1 -1
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js +9 -16
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js.map +1 -1
- package/dist/cjs/GroupContext/Group.js +9 -16
- package/dist/cjs/GroupContext/Group.js.map +1 -1
- package/dist/cjs/GroupContext/GroupContext.js +9 -16
- package/dist/cjs/GroupContext/GroupContext.js.map +1 -1
- package/dist/cjs/GroupContext/GroupItem.js +9 -16
- package/dist/cjs/GroupContext/GroupItem.js.map +1 -1
- package/dist/cjs/GroupContext/index.js +9 -16
- package/dist/cjs/GroupContext/index.js.map +1 -1
- package/dist/cjs/ScrollSync/ScrollSync.js +11 -24
- package/dist/cjs/ScrollSync/ScrollSync.js.map +2 -2
- package/dist/cjs/ScrollSync/ScrollSyncPane.js +9 -16
- package/dist/cjs/ScrollSync/ScrollSyncPane.js.map +1 -1
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js +11 -24
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js.map +2 -2
- package/dist/cjs/ScrollSync/index.js +12 -16
- package/dist/cjs/ScrollSync/index.js.map +2 -2
- package/dist/cjs/ScrollSync/useScrollSync.js +9 -16
- package/dist/cjs/ScrollSync/useScrollSync.js.map +1 -1
- package/dist/cjs/constants.js +9 -16
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/createDataInstance/createInstancePlugin.js +11 -17
- package/dist/cjs/createDataInstance/createInstancePlugin.js.map +2 -2
- package/dist/cjs/createDataInstance/createInstanceRef.js +9 -16
- package/dist/cjs/createDataInstance/createInstanceRef.js.map +1 -1
- package/dist/cjs/createDataInstance/index.js +24 -0
- package/dist/cjs/createDataInstance/index.js.map +7 -0
- package/dist/cjs/createDataInstance/utils.js +9 -16
- package/dist/cjs/createDataInstance/utils.js.map +1 -1
- package/dist/cjs/defer-render-hoc/index.js +9 -16
- package/dist/cjs/defer-render-hoc/index.js.map +1 -1
- package/dist/cjs/dimsum.config.js +9 -16
- package/dist/cjs/dimsum.config.js.map +1 -1
- package/dist/cjs/index.js +26 -29
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/prop-types.js +9 -16
- package/dist/cjs/prop-types.js.map +1 -1
- package/dist/cjs/react-spring/index.js +11 -17
- package/dist/cjs/react-spring/index.js.map +1 -1
- package/dist/cjs/react-spring/renderprops.js +11 -17
- package/dist/cjs/react-spring/renderprops.js.map +1 -1
- package/dist/cjs/toolbar/ToolbarProvider.js +11 -18
- package/dist/cjs/toolbar/ToolbarProvider.js.map +2 -2
- package/dist/cjs/useDataGrid/VolatileRowsListener.js +9 -16
- package/dist/cjs/useDataGrid/VolatileRowsListener.js.map +1 -1
- package/dist/cjs/useDataGrid/index.js +13 -25
- package/dist/cjs/useDataGrid/index.js.map +2 -2
- package/dist/cjs/useDataGrid/initColumnDefinition.js +9 -16
- package/dist/cjs/useDataGrid/initColumnDefinition.js.map +1 -1
- package/dist/cjs/useDataGrid/useDataGrid.js +9 -16
- package/dist/cjs/useDataGrid/useDataGrid.js.map +1 -1
- package/dist/cjs/useDataList/index.js +12 -25
- package/dist/cjs/useDataList/index.js.map +2 -2
- package/dist/cjs/useDataList/recordIterator.js +9 -16
- package/dist/cjs/useDataList/recordIterator.js.map +1 -1
- package/dist/cjs/useDataList/useDataList.js +9 -16
- package/dist/cjs/useDataList/useDataList.js.map +1 -1
- package/dist/cjs/utils.js +9 -16
- package/dist/cjs/utils.js.map +1 -1
- package/dist/cjs/virtualization/AutoHeightList.js +9 -16
- package/dist/cjs/virtualization/AutoHeightList.js.map +1 -1
- package/dist/cjs/virtualization/FluidHeightList.js +9 -16
- package/dist/cjs/virtualization/FluidHeightList.js.map +1 -1
- package/dist/cjs/virtualization/index.js +10 -22
- package/dist/cjs/virtualization/index.js.map +2 -2
- package/dist/esm/Animations/BaseAnimation.js.map +1 -1
- package/dist/esm/Animations/Grow.js.map +1 -1
- package/dist/esm/Animations/GrowRight.js.map +1 -1
- package/dist/esm/Animations/GrowVertical.js +5 -0
- package/dist/esm/Animations/GrowVertical.js.map +2 -2
- package/dist/esm/Animations/index.js +6 -0
- package/dist/esm/Animations/index.js.map +7 -0
- package/dist/esm/CheckableGroup.js +1 -6
- package/dist/esm/CheckableGroup.js.map +2 -2
- package/dist/esm/DeferRenderAfterComputation.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGrid.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGroup.js +18 -0
- package/dist/esm/FocusGroup/FocusGroup.js.map +2 -2
- package/dist/esm/FocusGroup/FocusGroupContext.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGroupManager.js.map +1 -1
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js.map +1 -1
- package/dist/esm/FocusGroup/index.js +6 -10
- package/dist/esm/FocusGroup/index.js.map +2 -2
- package/dist/esm/FocusGroup/useFocusGroupItem.js.map +1 -1
- package/dist/esm/FocusGroup/utils/getNextCellPosition.js.map +1 -1
- package/dist/esm/GroupContext/Group.js.map +1 -1
- package/dist/esm/GroupContext/GroupContext.js.map +1 -1
- package/dist/esm/GroupContext/GroupItem.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSync.js +2 -8
- package/dist/esm/ScrollSync/ScrollSync.js.map +2 -2
- package/dist/esm/ScrollSync/ScrollSyncPane.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSyncProvider.js +2 -8
- package/dist/esm/ScrollSync/ScrollSyncProvider.js.map +2 -2
- package/dist/esm/ScrollSync/index.js +2 -0
- package/dist/esm/ScrollSync/index.js.map +2 -2
- package/dist/esm/ScrollSync/useScrollSync.js.map +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/createDataInstance/createInstancePlugin.js +2 -1
- package/dist/esm/createDataInstance/createInstancePlugin.js.map +2 -2
- package/dist/esm/createDataInstance/createInstanceRef.js.map +1 -1
- package/dist/esm/createDataInstance/index.js +5 -0
- package/dist/esm/createDataInstance/index.js.map +7 -0
- package/dist/esm/createDataInstance/utils.js.map +1 -1
- package/dist/esm/defer-render-hoc/index.js.map +1 -1
- package/dist/esm/dimsum.config.js.map +1 -1
- package/dist/esm/index.js +16 -9
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/prop-types.js.map +1 -1
- package/dist/esm/toolbar/ToolbarProvider.js +1 -1
- package/dist/esm/toolbar/ToolbarProvider.js.map +2 -2
- package/dist/esm/useDataGrid/VolatileRowsListener.js.map +1 -1
- package/dist/esm/useDataGrid/index.js +3 -5
- package/dist/esm/useDataGrid/index.js.map +2 -2
- package/dist/esm/useDataGrid/initColumnDefinition.js.map +1 -1
- package/dist/esm/useDataGrid/useDataGrid.js.map +1 -1
- package/dist/esm/useDataList/index.js +2 -5
- package/dist/esm/useDataList/index.js.map +2 -2
- package/dist/esm/useDataList/recordIterator.js.map +1 -1
- package/dist/esm/useDataList/useDataList.js.map +1 -1
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/virtualization/AutoHeightList.js.map +1 -1
- package/dist/esm/virtualization/FluidHeightList.js.map +1 -1
- package/dist/esm/virtualization/index.js +1 -6
- package/dist/esm/virtualization/index.js.map +2 -2
- package/package.json +11 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/FocusGroup/FocusGroup.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-param-reassign */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { isFunction, get } from '@elliemae/ds-utilities';\nimport hotkeys from 'hotkeys-js';\n\nconst defaultOptions = {\n orientation: 'vertical',\n};\n\nconst safeCallAction = (e, fun, ...args) => {\n if (isFunction(fun)) {\n e.preventDefault();\n fun(...args);\n }\n};\n\nconst registerHotkeys = (
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-param-reassign */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { isFunction, get } from '@elliemae/ds-utilities';\nimport hotkeys from 'hotkeys-js';\n\nconst defaultOptions = {\n orientation: 'vertical',\n};\n\nconst safeCallAction = (e, fun, ...args) => {\n if (isFunction(fun)) {\n e.preventDefault();\n fun(...args);\n }\n};\n\nconst registerHotkeys = (hotKeys = {}, params, getContainer = () => document) => {\n Object.keys(hotKeys).forEach((hotkey) => {\n const { options, handler, allowDocumentHandler = false } = hotKeys[hotkey];\n const parameterizedHandler = (e) => {\n const handlerParams = isFunction(params) ? params() : params;\n if (!allowDocumentHandler && handlerParams.item !== document.activeElement) return;\n e.preventDefault();\n handler(handlerParams);\n };\n hotkeys(hotkey, { element: getContainer(), ...options }, parameterizedHandler);\n });\n};\n\nconst unregisterHotKeys = (hotKeys = {}) => {\n Object.keys(hotKeys).forEach((hotkey) => {\n hotkeys.unbind(hotkey);\n });\n};\n\nconst noop = () => null;\n\nclass FocusGroup {\n items = [];\n\n constructor(options = {}) {\n this.options = { ...defaultOptions, ...options };\n\n const { orientation } = this.options;\n\n this.keyBindings = {\n ArrowUp: orientation !== 'horizontal' && 'previous',\n ArrowRight: orientation !== 'vertical' && 'next',\n ArrowDown: orientation !== 'horizontal' && 'next',\n ArrowLeft: orientation !== 'vertical' && 'previous',\n Home: 'first',\n End: 'last',\n PageUp: 'first',\n PageDown: 'last',\n Escape: 'exit',\n ...options.keyBindings,\n };\n\n this.currentFocusedItem = null;\n this.currIndex = null;\n\n this.mapActions = {\n previous: this.focusPrevious.bind(this),\n next: this.focusNext.bind(this),\n first: this.focusFirst.bind(this),\n last: this.focusLast.bind(this),\n exit: this.exit.bind(this),\n enter: () => null,\n };\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.register = this.register.bind(this);\n this.focusFirst = this.focusFirst.bind(this);\n this.focusLast = this.focusLast.bind(this);\n this.isGroupActive = this.isGroupActive.bind(this);\n this.focusNext = this.focusNext.bind(this);\n this.focusPrevious = this.focusPrevious.bind(this);\n this.focusItem = this.focusItem.bind(this);\n this.focusCurrent = this.focusCurrent.bind(this);\n this.getHotKeysParams = this.getHotKeysParams.bind(this);\n this.activate = this.activate.bind(this);\n this.deactivate = this.deactivate.bind(this);\n this.executeActionByEvent = this.executeActionByEvent.bind(this);\n this.unregister = this.unregister.bind(this);\n this.exit = this.exit.bind(this);\n this.focusByNode = this.focusByNode.bind(this);\n this.focusByIndex = this.focusByIndex.bind(this);\n this.focusNextGroup = this.focusNextGroup.bind(this);\n this.focusPreviousGroup = this.focusPreviousGroup.bind(this);\n this.getNextItem = this.getNextItem.bind(this);\n this.getPreviousItem = this.getPreviousItem.bind(this);\n this.checkCanFocusNext = this.checkCanFocusNext.bind(this);\n this.getItemByIndex = this.getItemByIndex.bind(this);\n this.getItemIndexByNode = this.getItemIndexByNode.bind(this);\n this.getFocusedIndex = this.getFocusedIndex.bind(this);\n this.getFocusedItem = this.getFocusedItem.bind(this);\n this.getFirstItem = this.getFirstItem.bind(this);\n this.getLastItem = this.getLastItem.bind(this);\n }\n\n getHotKeysParams() {\n const item = this.currentFocusedItem;\n const { index } = get(item, ['dataset'], {});\n return {\n item,\n index,\n };\n }\n\n activate() {\n const { getContainer } = this.options;\n document.addEventListener('keydown', this.handleKeyDown, true);\n registerHotkeys(this.options.hotKeys, this.getHotKeysParams, getContainer);\n }\n\n deactivate() {\n document.removeEventListener('keydown', this.handleKeyDown, true);\n unregisterHotKeys(this.options.hotKeys);\n }\n\n handleKeyDown(e) {\n if (!this.isGroupActive()) return;\n this.executeActionByEvent(e);\n }\n\n executeActionByEvent(e) {\n const actions = Array.isArray(this.keyBindings[e.key]) ? this.keyBindings[e.key] : [this.keyBindings[e.key]];\n return actions.map((action) =>\n typeof action === 'string' ? safeCallAction(e, this.mapActions[action]) : safeCallAction(e, action),\n );\n }\n\n register(node, props = {}) {\n const afterIndex = this.items.findIndex(\n (item) => item.compareDocumentPosition(node) === Node.DOCUMENT_POSITION_PRECEDING,\n );\n node.specialOnFocus = props.onFocus || noop;\n node.specialOnBlur = props.onBlur || noop;\n node.onclick = () => this.focusItem(node);\n node.onfocus = () => {\n this.focusItem(node);\n };\n if (afterIndex === -1) {\n this.items.push(node);\n } else {\n this.items.splice(afterIndex, 0, node);\n }\n }\n\n unregister(node) {\n const index = this.getItemIndexByNode(node);\n if (index > -1) this.items.splice(index, 1);\n }\n\n exit() {\n const { onExitFocusGroup } = this.options;\n onExitFocusGroup();\n }\n\n focusItem(node) {\n if (this.currentFocusedItem && this.currentFocusedItem !== node) {\n this.currentFocusedItem.specialOnBlur();\n this.currentFocusedItem.setAttribute('tabindex', -1);\n }\n if (!node) return;\n this.currentFocusedItem = node;\n node.setAttribute('tabindex', 0);\n node.focus();\n node.specialOnFocus();\n }\n\n focusNext() {\n const item = this.getNextItem();\n this.focusItem(item);\n }\n\n focusByNode(node) {\n const index = this.getItemIndexByNode(node);\n this.focusByIndex(index);\n }\n\n focusByIndex(index) {\n const item = this.getItemByIndex(index);\n this.focusItem(item);\n }\n\n focusPrevious() {\n const prevItem = this.getPreviousItem();\n this.focusItem(prevItem);\n }\n\n focusFirst() {\n const item = this.getFirstItem();\n this.focusItem(item);\n }\n\n focusLast() {\n const item = this.getLastItem();\n this.focusItem(item);\n }\n\n focusCurrent() {\n this.focusItem(this.currentFocusedItem);\n }\n\n focusNextGroup() {\n const { onFocusNextGroup } = this.options;\n this.exit();\n onFocusNextGroup();\n }\n\n focusPreviousGroup() {\n const { onFocusPreviousGroup } = this.options;\n this.exit();\n onFocusPreviousGroup();\n }\n\n getNextItem() {\n const { loop } = this.options;\n const currentIndex = this.getFocusedIndex();\n const supposedNextIndex = currentIndex + 1;\n if (!this.checkCanFocusNext(supposedNextIndex)) {\n return loop ? this.getFirstItem() : this.focusNextGroup();\n }\n return this.getItemByIndex(supposedNextIndex);\n }\n\n getPreviousItem() {\n const { loop } = this.options;\n const currentIndex = this.getFocusedIndex();\n const supposedPrevIndex = currentIndex - 1;\n if (!this.checkCanFocusPrev(supposedPrevIndex)) {\n return loop ? this.getLastItem() : this.focusPreviousGroup();\n }\n return this.getItemByIndex(supposedPrevIndex);\n }\n\n checkCanFocusNext(index) {\n return this.items.length > index;\n }\n\n checkCanFocusPrev(index) {\n return index >= 0;\n }\n\n getItemByIndex(index) {\n return this.items[index];\n }\n\n getItemIndexByNode(node) {\n return this.items.findIndex((item) => item === node);\n }\n\n getFocusedIndex() {\n return this.getItemIndexByNode(document.activeElement);\n }\n\n getFocusedItem() {\n const index = this.getFocusedIndex();\n return index > -1 && this.items[index];\n }\n\n isGroupActive() {\n return this.getFocusedIndex() !== -1;\n }\n\n getFirstItem() {\n return !!this.items.length && this.items[0];\n }\n\n getLastItem() {\n return !!this.items.length && this.items[this.items.length - 1];\n }\n}\n\nexport { FocusGroup };\nexport default FocusGroup;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,0BAAgC;AAChC,wBAAoB;AAEpB,MAAM,iBAAiB;AAAA,EACrB,aAAa;AACf;AAEA,MAAM,iBAAiB,CAAC,GAAG,QAAQ,SAAS;AAC1C,MAAI,oCAAW,GAAG,GAAG;AACnB,MAAE,eAAe;AACjB,QAAI,GAAG,IAAI;AAAA,EACb;AACF;AAEA,MAAM,kBAAkB,CAAC,UAAU,CAAC,GAAG,QAAQ,eAAe,MAAM,aAAa;AAC/E,SAAO,KAAK,OAAO,EAAE,QAAQ,CAAC,WAAW;AACvC,UAAM,EAAE,SAAS,SAAS,uBAAuB,UAAU,QAAQ;AACnE,UAAM,uBAAuB,CAAC,MAAM;AAClC,YAAM,gBAAgB,oCAAW,MAAM,IAAI,OAAO,IAAI;AACtD,UAAI,CAAC,wBAAwB,cAAc,SAAS,SAAS;AAAe;AAC5E,QAAE,eAAe;AACjB,cAAQ,aAAa;AAAA,IACvB;AACA,mCAAQ,QAAQ,iBAAE,SAAS,aAAa,KAAM,UAAW,oBAAoB;AAAA,EAC/E,CAAC;AACH;AAEA,MAAM,oBAAoB,CAAC,UAAU,CAAC,MAAM;AAC1C,SAAO,KAAK,OAAO,EAAE,QAAQ,CAAC,WAAW;AACvC,8BAAQ,OAAO,MAAM;AAAA,EACvB,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AAG;AAC9C,aAAO,OAAO,KAAK,YAAY,IAAI,KAAK,mBAAmB;AAAA,IAC7D;AACA,WAAO,KAAK,eAAe,iBAAiB;AAAA,EAC9C;AAAA,EAEA,kBAAkB,OAAO;AACvB,WAAO,KAAK,MAAM,SAAS;AAAA,EAC7B;AAAA,EAEA,kBAAkB,OAAO;AACvB,WAAO,SAAS;AAAA,EAClB;AAAA,EAEA,eAAe,OAAO;AACpB,WAAO,KAAK,MAAM;AAAA,EACpB;AAAA,EAEA,mBAAmB,MAAM;AACvB,WAAO,KAAK,MAAM,UAAU,CAAC,SAAS,SAAS,IAAI;AAAA,EACrD;AAAA,EAEA,kBAAkB;AAChB,WAAO,KAAK,mBAAmB,SAAS,aAAa;AAAA,EACvD;AAAA,EAEA,iBAAiB;AACf,UAAM,QAAQ,KAAK,gBAAgB;AACnC,WAAO,QAAQ,MAAM,KAAK,MAAM;AAAA,EAClC;AAAA,EAEA,gBAAgB;AACd,WAAO,KAAK,gBAAgB,MAAM;AAAA,EACpC;AAAA,EAEA,eAAe;AACb,WAAO,CAAC,CAAC,KAAK,MAAM,UAAU,KAAK,MAAM;AAAA,EAC3C;AAAA,EAEA,cAAc;AACZ,WAAO,CAAC,CAAC,KAAK,MAAM,UAAU,KAAK,MAAM,KAAK,MAAM,SAAS;AAAA,EAC/D;AACF;AAGA,IAAO,qBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,35 +4,28 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var FocusGroupContext_exports = {};
|
|
29
22
|
__export(FocusGroupContext_exports, {
|
|
30
23
|
FocusGroupContext: () => FocusGroupContext,
|
|
31
24
|
default: () => FocusGroupContext_default
|
|
32
25
|
});
|
|
26
|
+
module.exports = __toCommonJS(FocusGroupContext_exports);
|
|
33
27
|
var React = __toESM(require("react"));
|
|
34
28
|
var import_react = __toESM(require("react"));
|
|
35
29
|
const FocusGroupContext = import_react.default.createContext();
|
|
36
30
|
var FocusGroupContext_default = FocusGroupContext;
|
|
37
|
-
module.exports = __toCommonJS(FocusGroupContext_exports);
|
|
38
31
|
//# sourceMappingURL=FocusGroupContext.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/FocusGroup/FocusGroupContext.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\n\nconst FocusGroupContext = React.createContext();\nexport { FocusGroupContext };\nexport default FocusGroupContext;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAElB,MAAM,oBAAoB,qBAAM,cAAc;AAE9C,IAAO,4BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,33 +4,27 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var FocusGroupManager_exports = {};
|
|
29
22
|
__export(FocusGroupManager_exports, {
|
|
30
23
|
FocusGroupManager: () => FocusGroupProvider,
|
|
31
24
|
FocusGroupProvider: () => FocusGroupProvider,
|
|
32
25
|
default: () => FocusGroupManager_default
|
|
33
26
|
});
|
|
27
|
+
module.exports = __toCommonJS(FocusGroupManager_exports);
|
|
34
28
|
var React = __toESM(require("react"));
|
|
35
29
|
var import_react = __toESM(require("react"));
|
|
36
30
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
@@ -122,5 +116,4 @@ FocusGroupProvider.defaultProps = {
|
|
|
122
116
|
onFocusGroupSet: noop
|
|
123
117
|
};
|
|
124
118
|
var FocusGroupManager_default = FocusGroupProvider;
|
|
125
|
-
module.exports = __toCommonJS(FocusGroupManager_exports);
|
|
126
119
|
//# sourceMappingURL=FocusGroupManager.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/FocusGroup/FocusGroupManager.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { Component, useEffect } from 'react';\nimport { isFunction } from '@elliemae/ds-utilities';\nimport { FocusGroup } from './FocusGroup';\nimport { FocusGroupContext } from './FocusGroupContext';\n\nconst noop = () => null;\n\nclass FocusGroupProvider extends Component {\n activated = false;\n\n static defaultProps = {\n exitWhenNoPrevious: false,\n exitWhenNoNext: false,\n keyBindings: {},\n onFocus: noop,\n onExitFocusGroup: noop,\n onFocusPreviousGroup: noop,\n onFocusNextGroup: noop,\n onFocusGroupSet: noop,\n };\n\n constructor(props) {\n super(props);\n\n this.focusGroup = new FocusGroup(props);\n\n props.onFocusGroupSet(this);\n\n this.actions = {\n activate: this.activate.bind(this),\n deactivate: this.deactivate.bind(this),\n register: this.focusGroup.register,\n unregister: this.unregister.bind(this),\n focusFirst: this.focusGroup.focusFirst,\n focusLast: this.focusGroup.focusLast,\n focusItemByIndex: this.focusItemByIndex.bind(this),\n focusItemByNode: this.focusItemByNode.bind(this),\n focus: this.focusGroup.focusCurrent,\n isGroupActive: this.focusGroup.isGroupActive,\n focusNext: this.focusGroup.focusNext,\n focusPrevious: this.focusGroup.focusPrevious,\n };\n }\n\n componentDidMount() {\n const { autoFocusOnMount } = this.props;\n\n this.activate();\n\n if (autoFocusOnMount) {\n setTimeout(() => {\n this.actions.focusFirst();\n }, 0);\n }\n }\n\n componentWillUnmount() {\n this.deactivate();\n }\n\n activate() {\n const { onActivate } = this.props;\n this.focusGroup.activate();\n this.activated = true;\n if (isFunction(onActivate)) onActivate();\n }\n\n deactivate() {\n const { onExitFocusGroup } = this.props;\n this.activated = false;\n this.focusGroup.deactivate();\n if (isFunction(onExitFocusGroup)) {\n onExitFocusGroup();\n }\n }\n\n register(item) {\n this.focusGroup.register(item);\n }\n\n unregister(item) {\n this.focusGroup.unregister(item);\n }\n\n focusItemByIndex(index) {\n if (!this.activated) this.activate();\n setTimeout(() => {\n this.focusGroup.focusByIndex(index);\n }, 200);\n }\n\n focusItemByNode(node) {\n if (!this.activated) this.activate();\n const index = this.focusGroup.getItemIndexByNode(node);\n this.focusItemByIndex(index);\n }\n\n render() {\n const { children } = this.props;\n return (\n <FocusGroupContext.Provider value={this.actions}>\n {children}\n </FocusGroupContext.Provider>\n );\n }\n}\n\nexport { FocusGroupProvider, FocusGroupProvider as FocusGroupManager };\nexport default FocusGroupProvider;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA4C;AAC5C,0BAA2B;AAC3B,wBAA2B;AAC3B,+BAAkC;AAElC,MAAM,OAAO,MAAM;AAEnB,MAAM,2BAA2B,uBAAU;AAAA,EAczC,YAAY,OAAO;AACjB,UAAM,KAAK;AAdb,qBAAY;AAgBV,SAAK,aAAa,IAAI,6BAAW,KAAK;AAEtC,UAAM,gBAAgB,IAAI;AAE1B,SAAK,UAAU;AAAA,MACb,UAAU,KAAK,SAAS,KAAK,IAAI;AAAA,MACjC,YAAY,KAAK,WAAW,KAAK,IAAI;AAAA,MACrC,UAAU,KAAK,WAAW;AAAA,MAC1B,YAAY,KAAK,WAAW,KAAK,IAAI;AAAA,MACrC,YAAY,KAAK,WAAW;AAAA,MAC5B,WAAW,KAAK,WAAW;AAAA,MAC3B,kBAAkB,KAAK,iBAAiB,KAAK,IAAI;AAAA,MACjD,iBAAiB,KAAK,gBAAgB,KAAK,IAAI;AAAA,MAC/C,OAAO,KAAK,WAAW;AAAA,MACvB,eAAe,KAAK,WAAW;AAAA,MAC/B,WAAW,KAAK,WAAW;AAAA,MAC3B,eAAe,KAAK,WAAW;AAAA,IACjC;AAAA,EACF;AAAA,EAEA,oBAAoB;AAClB,UAAM,EAAE,qBAAqB,KAAK;AAElC,SAAK,SAAS;AAEd,QAAI,kBAAkB;AACpB,iBAAW,MAAM;AACf,aAAK,QAAQ,WAAW;AAAA,MAC1B,GAAG,CAAC;AAAA,IACN;AAAA,EACF;AAAA,EAEA,uBAAuB;AACrB,SAAK,WAA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20
|
};
|
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
21
|
var __objRest = (source, exclude) => {
|
|
23
22
|
var target = {};
|
|
24
23
|
for (var prop in source)
|
|
@@ -35,27 +34,22 @@ var __export = (target, all) => {
|
|
|
35
34
|
for (var name in all)
|
|
36
35
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
37
36
|
};
|
|
38
|
-
var
|
|
39
|
-
if (
|
|
40
|
-
for (let key of __getOwnPropNames(
|
|
41
|
-
if (!__hasOwnProp.call(
|
|
42
|
-
__defProp(
|
|
37
|
+
var __copyProps = (to, from, except, desc) => {
|
|
38
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
39
|
+
for (let key of __getOwnPropNames(from))
|
|
40
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
41
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
43
42
|
}
|
|
44
|
-
return
|
|
45
|
-
};
|
|
46
|
-
var __toESM = (module2, isNodeMode) => {
|
|
47
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
43
|
+
return to;
|
|
48
44
|
};
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
52
|
-
};
|
|
53
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
45
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
46
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
54
47
|
var focusGroupManagerHoc_exports = {};
|
|
55
48
|
__export(focusGroupManagerHoc_exports, {
|
|
56
49
|
FocusGroupHoc: () => FocusGroupHoc,
|
|
57
50
|
default: () => focusGroupManagerHoc_default
|
|
58
51
|
});
|
|
52
|
+
module.exports = __toCommonJS(focusGroupManagerHoc_exports);
|
|
59
53
|
var React = __toESM(require("react"));
|
|
60
54
|
var import_react = __toESM(require("react"));
|
|
61
55
|
var import_FocusGroupManager = require("./FocusGroupManager");
|
|
@@ -78,5 +72,4 @@ function FocusGroupHoc(WrappedComponent, options = {}) {
|
|
|
78
72
|
};
|
|
79
73
|
}
|
|
80
74
|
var focusGroupManagerHoc_default = FocusGroupHoc;
|
|
81
|
-
module.exports = __toCommonJS(focusGroupManagerHoc_exports);
|
|
82
75
|
//# sourceMappingURL=focusGroupManagerHoc.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/FocusGroup/focusGroupManagerHoc.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable react/display-name */\nimport React from 'react';\nimport { FocusGroupProvider } from './FocusGroupManager';\n\nfunction FocusGroupHoc(WrappedComponent, options = {}) {\n return ({\n onExitFocusGroup,\n onFocusPrevGroup,\n focusKeyBindings,\n ...props\n }) => (\n <FocusGroupProvider\n keyBindings={focusKeyBindings}\n onExitFocusGroup={onExitFocusGroup}\n onFocusPrevGroup={onFocusPrevGroup}\n {...options}\n >\n <WrappedComponent {...props} {...options} />\n </FocusGroupProvider>\n );\n}\n\nexport { FocusGroupHoc };\nexport default FocusGroupHoc;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,+BAAmC;AAEnC,uBAAuB,kBAAkB,UAAU,CAAC,GAAG;AACrD,SAAO,CAAC,OAKL;AALK,iBACN;AAAA;AAAA,MACA;AAAA,MACA;AAAA,QAHM,IAIH,kBAJG,IAIH;AAAA,MAHH;AAAA,MACA;AAAA,MACA;AAAA;AAGA,8DAAC;AAAA,MACC,aAAa;AAAA,MACb;AAAA,MACA;AAAA,OACI,UAEJ,mDAAC,oDAAqB,QAAW,QAAS,CAC5C;AAAA;AAEJ;AAGA,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,44 +4,34 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
22
|
var FocusGroup_exports = {};
|
|
29
23
|
__export(FocusGroup_exports, {
|
|
30
24
|
FocusGrid: () => import_FocusGrid.FocusGridProvider,
|
|
31
25
|
FocusGridContext: () => import_FocusGrid.FocusGridContext,
|
|
32
|
-
|
|
33
|
-
FocusGroupContext: () => import_FocusGroupContext.FocusGroupContext,
|
|
34
|
-
FocusGroupManager: () => import_FocusGroupManager.FocusGroupManager,
|
|
35
|
-
focusGroupManagerHoc: () => import_focusGroupManagerHoc.FocusGroupHoc,
|
|
36
|
-
useFocusGroupItem: () => import_useFocusGroupItem.useFocusGroupItem,
|
|
37
|
-
useFocusGroupWithState: () => import_useFocusGroupItem.useFocusGroupWithState
|
|
26
|
+
focusGroupManagerHoc: () => import_focusGroupManagerHoc.FocusGroupHoc
|
|
38
27
|
});
|
|
28
|
+
module.exports = __toCommonJS(FocusGroup_exports);
|
|
39
29
|
var React = __toESM(require("react"));
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
__reExport(FocusGroup_exports, require("./FocusGroup"), module.exports);
|
|
31
|
+
__reExport(FocusGroup_exports, require("./FocusGroupContext"), module.exports);
|
|
32
|
+
__reExport(FocusGroup_exports, require("./FocusGroupManager"), module.exports);
|
|
33
|
+
__reExport(FocusGroup_exports, require("./useFocusGroupItem"), module.exports);
|
|
44
34
|
var import_focusGroupManagerHoc = require("./focusGroupManagerHoc");
|
|
45
35
|
var import_FocusGrid = require("./FocusGrid");
|
|
46
|
-
module.exports
|
|
36
|
+
__reExport(FocusGroup_exports, require("./utils/getNextCellPosition"), module.exports);
|
|
47
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/FocusGroup/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export * from './FocusGroup';\nexport * from './FocusGroupContext';\nexport * from './FocusGroupManager';\nexport * from './useFocusGroupItem';\nexport { FocusGroupHoc as focusGroupManagerHoc } from './focusGroupManagerHoc';\nexport { FocusGridProvider as FocusGrid, FocusGridContext } from './FocusGrid';\nexport * from './utils/getNextCellPosition';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAc,yBAAd;AACA,+BAAc,gCADd;AAEA,+BAAc,gCAFd;AAGA,+BAAc,gCAHd;AAIA,kCAAsD;AACtD,uBAAiE;AACjE,+BAAc,wCANd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,7 +6,6 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
10
9
|
var __objRest = (source, exclude) => {
|
|
11
10
|
var target = {};
|
|
12
11
|
for (var prop in source)
|
|
@@ -23,28 +22,23 @@ var __export = (target, all) => {
|
|
|
23
22
|
for (var name in all)
|
|
24
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
24
|
};
|
|
26
|
-
var
|
|
27
|
-
if (
|
|
28
|
-
for (let key of __getOwnPropNames(
|
|
29
|
-
if (!__hasOwnProp.call(
|
|
30
|
-
__defProp(
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
30
|
}
|
|
32
|
-
return
|
|
33
|
-
};
|
|
34
|
-
var __toESM = (module2, isNodeMode) => {
|
|
35
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
31
|
+
return to;
|
|
36
32
|
};
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
40
|
-
};
|
|
41
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
42
35
|
var useFocusGroupItem_exports = {};
|
|
43
36
|
__export(useFocusGroupItem_exports, {
|
|
44
37
|
default: () => useFocusGroupItem_default,
|
|
45
38
|
useFocusGroupItem: () => useFocusGroupItem,
|
|
46
39
|
useFocusGroupWithState: () => useFocusGroupWithState
|
|
47
40
|
});
|
|
41
|
+
module.exports = __toCommonJS(useFocusGroupItem_exports);
|
|
48
42
|
var React = __toESM(require("react"));
|
|
49
43
|
var import_react = require("react");
|
|
50
44
|
var import_FocusGroupContext = require("./FocusGroupContext");
|
|
@@ -77,5 +71,4 @@ const useFocusGroupWithState = (ref = {}, props) => {
|
|
|
77
71
|
return otherActions;
|
|
78
72
|
};
|
|
79
73
|
var useFocusGroupItem_default = useFocusGroupItem;
|
|
80
|
-
module.exports = __toCommonJS(useFocusGroupItem_exports);
|
|
81
74
|
//# sourceMappingURL=useFocusGroupItem.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/FocusGroup/useFocusGroupItem.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { useContext, useEffect } from 'react';\nimport { FocusGroupContext } from './FocusGroupContext';\n\nfunction useFocusGroupItem(ref = {}, props) {\n const { register, unregister, ...otherActions } =\n useContext(FocusGroupContext) || {};\n\n useEffect(() => {\n if (ref.current && register) register(ref.current, props);\n return () => {\n if (ref.current && unregister) unregister(ref.current);\n };\n });\n\n // if the focus item is not wrapped with the focus provider then return null\n if (!register) return {};\n return otherActions;\n}\n\nexport const useFocusGroupWithState = (ref = {}, props) => {\n const { register, unregister, ...otherActions } =\n useContext(FocusGroupContext) || {};\n\n useEffect(() => {\n if (ref && register) register(ref, props);\n return () => {\n if (ref && unregister) unregister(ref);\n };\n }, [ref]);\n\n // if the focus item is not wrapped with the focus provider then return null\n if (!register) return {};\n return otherActions;\n};\n\nexport { useFocusGroupItem };\nexport default useFocusGroupItem;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAsC;AACtC,+BAAkC;AAElC,2BAA2B,MAAM,CAAC,GAAG,OAAO;AAC1C,QACE,kCAAW,0CAAiB,KAAK,CAAC,GAD5B,YAAU,eAChB,IAD+B,yBAC/B,IAD+B,CAAzB,YAAU;AAGlB,8BAAU,MAAM;AACd,QAAI,IAAI,WAAW;AAAU,eAAS,IAAI,SAAS,KAAK;AACxD,WAAO,MAAM;AACX,UAAI,IAAI,WAAW;AAAY,mBAAW,IAAI,OAAO;AAAA,IACvD;AAAA,EACF,CAAC;AAGD,MAAI,CAAC;AAAU,WAAO,CAAC;AACvB,SAAO;AACT;AAEO,MAAM,yBAAyB,CAAC,MAAM,CAAC,GAAG,UAAU;AACzD,QACE,kCAAW,0CAAiB,KAAK,CAAC,GAD5B,YAAU,eAChB,IAD+B,yBAC/B,IAD+B,CAAzB,YAAU;AAGlB,8BAAU,MAAM;AACd,QAAI,OAAO;AAAU,eAAS,KAAK,KAAK;AACxC,WAAO,MAAM;AACX,UAAI,OAAO;AAAY,mBAAW,GAAG;AAAA,IACvC;AAAA,EACF,GAAG,CAAC,GAAG,CAAC;AAGR,MAAI,CAAC;AAAU,WAAO,CAAC;AACvB,SAAO;AACT;AAGA,IAAO,4BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,32 +4,26 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var getNextCellPosition_exports = {};
|
|
29
22
|
__export(getNextCellPosition_exports, {
|
|
30
23
|
default: () => getNextCellPosition_default,
|
|
31
24
|
getNextCellPosition: () => getNextCellPosition
|
|
32
25
|
});
|
|
26
|
+
module.exports = __toCommonJS(getNextCellPosition_exports);
|
|
33
27
|
var React = __toESM(require("react"));
|
|
34
28
|
function getNextCellPosition({
|
|
35
29
|
grid,
|
|
@@ -76,5 +70,4 @@ function getNextCellPosition({
|
|
|
76
70
|
};
|
|
77
71
|
}
|
|
78
72
|
var getNextCellPosition_default = getNextCellPosition;
|
|
79
|
-
module.exports = __toCommonJS(getNextCellPosition_exports);
|
|
80
73
|
//# sourceMappingURL=getNextCellPosition.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/FocusGroup/utils/getNextCellPosition.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["// eslint-disable-next-line max-statements\nfunction getNextCellPosition({\n grid,\n currentRow = 0,\n currentCell = 0,\n directionY,\n directionX,\n shouldWrapCells,\n shouldWrapRows,\n}) {\n let nextRow = currentRow + directionY;\n let nextCell = currentCell + directionX;\n const rowCount = grid.length;\n const isLeftRight = directionX !== 0;\n\n if (!rowCount) {\n return false;\n }\n\n const cellsLength = grid[0].length;\n\n // moving horizontally\n if (shouldWrapCells && isLeftRight) {\n // to left\n if (nextCell < 0) {\n nextCell = cellsLength - 1;\n nextRow -= 1;\n }\n\n if (nextCell >= cellsLength) {\n nextCell = 0;\n nextRow += 1;\n }\n }\n\n // moving vertically\n if (shouldWrapRows && !isLeftRight) {\n // to top\n if (nextRow < 0) {\n nextCell -= 1;\n nextRow = rowCount - 1;\n if (grid[nextRow] && nextCell >= 0 && !grid[nextRow][nextCell]) {\n nextRow -= 1;\n }\n } else if (nextRow >= rowCount || !grid[nextRow][nextCell]) {\n nextRow = 0;\n nextCell += 1;\n }\n }\n\n return {\n cellIndex: nextCell,\n rowIndex: nextRow,\n };\n}\n\nexport { getNextCellPosition };\nexport default getNextCellPosition;", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,6BAA6B;AAAA,EAC3B;AAAA,EACA,aAAa;AAAA,EACb,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GACC;AACD,MAAI,UAAU,aAAa;AAC3B,MAAI,WAAW,cAAc;AAC7B,QAAM,WAAW,KAAK;AACtB,QAAM,cAAc,eAAe;AAEnC,MAAI,CAAC,UAAU;AACb,WAAO;AAAA,EACT;AAEA,QAAM,cAAc,KAAK,GAAG;AAG5B,MAAI,mBAAmB,aAAa;AAElC,QAAI,WAAW,GAAG;AAChB,iBAAW,cAAc;AACzB,iBAAW;AAAA,IACb;AAEA,QAAI,YAAY,aAAa;AAC3B,iBAAW;AACX,iBAAW;AAAA,IACb;AAAA,EACF;AAGA,MAAI,kBAAkB,CAAC,aAAa;AAElC,QAAI,UAAU,GAAG;AACf,kBAAY;AACZ,gBAAU,WAAW;AACrB,UAAI,KAAK,YAAY,YAAY,KAAK,CAAC,KAAK,SAAS,WAAW;AAC9D,mBAAW;AAAA,MACb;AAAA,IACF,WAAW,WAAW,YAAY,CAAC,KAAK,SAAS,WAAW;AAC1D,gBAAU;AACV,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AAAA,IACL,WAAW;AAAA,IACX,UAAU;AAAA,EACZ;AACF;AAGA,IAAO,8BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,32 +4,26 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var Group_exports = {};
|
|
29
22
|
__export(Group_exports, {
|
|
30
23
|
Group: () => Group,
|
|
31
24
|
default: () => Group_default
|
|
32
25
|
});
|
|
26
|
+
module.exports = __toCommonJS(Group_exports);
|
|
33
27
|
var React = __toESM(require("react"));
|
|
34
28
|
var import_react = __toESM(require("react"));
|
|
35
29
|
var import_prop_types = __toESM(require("prop-types"));
|
|
@@ -111,5 +105,4 @@ Group.propTypes = {
|
|
|
111
105
|
disabled: import_prop_types.default.bool
|
|
112
106
|
};
|
|
113
107
|
var Group_default = Group;
|
|
114
|
-
module.exports = __toCommonJS(Group_exports);
|
|
115
108
|
//# sourceMappingURL=Group.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/GroupContext/Group.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable react/no-unused-state */\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { GroupContext } from './GroupContext';\n\nconst getValueItem = (e) => {\n const { target, currentTarget } = e;\n if (target) {\n const { value } = target;\n return value;\n }\n if (currentTarget) {\n const { value } = currentTarget;\n return value;\n }\n return e;\n};\n\nconst toggleItemValue = (array, e) => {\n const newvalue = getValueItem(e);\n const res = array;\n const index = array.indexOf(newvalue);\n\n if (index === -1) {\n res.push(newvalue);\n } else {\n res.splice(index, 1);\n }\n\n return res;\n};\n\nconst { Provider } = GroupContext;\n/** deprecated use CheckableGroup instead */\nclass Group extends Component {\n constructor(props) {\n super(props);\n const { activeValue, disabled } = props;\n this.state = {\n activeValue,\n disabled,\n prevValue: null,\n onChange: this.handleChange.bind(this),\n };\n }\n\n static getDerivedStateFromProps(nextProps, { prevValue }) {\n if (nextProps.activeValue === prevValue) return null;\n return {\n activeValue: nextProps.activeValue,\n prevValue: nextProps.activeValue,\n };\n }\n\n handleChange(e, ...rest) {\n const { multiple, onChange } = this.props;\n const { activeValue } = this.state;\n const value = getValueItem(e);\n let newValue;\n if (multiple) {\n newValue = toggleItemValue(activeValue || [], value);\n } else if (activeValue !== value) {\n // default behaviour it will be toggle the active value\n newValue = value;\n }\n\n this.setState({\n activeValue: newValue,\n });\n\n if (onChange) onChange(newValue, ...rest);\n }\n\n render() {\n const { children } = this.props;\n return <Provider value={this.state}>{children}</Provider>;\n }\n}\n\nGroup.defaultProps = {\n multiple: false,\n};\n\nGroup.propTypes = {\n children: PropTypes.array,\n multiple: PropTypes.bool,\n onChange: PropTypes.func,\n activeValue: PropTypes.oneOfType([PropTypes.array, PropTypes.number]),\n disabled: PropTypes.bool,\n};\n\nexport { Group };\nexport default Group;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAiC;AACjC,wBAAsB;AACtB,0BAA6B;AAE7B,MAAM,eAAe,CAAC,MAAM;AAC1B,QAAM,EAAE,QAAQ,kB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,WAAO,mDAAC;AAAA,MAAS,OAAO,KAAK;AAAA,OAAQ,QAAS;AAAA,EAChD;AACF;AAEA,MAAM,eAAe;AAAA,EACnB,UAAU;AACZ;AAEA,MAAM,YAAY;AAAA,EAChB,UAAU,0BAAU;AAAA,EACpB,UAAU,0BAAU;AAAA,EACpB,UAAU,0BAAU;AAAA,EACpB,aAAa,0BAAU,UAAU,CAAC,0BAAU,OAAO,0BAAU,MAAM,CAAC;AAAA,EACpE,UAAU,0BAAU;AACtB;AAGA,IAAO,gBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,33 +4,26 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var GroupContext_exports = {};
|
|
29
22
|
__export(GroupContext_exports, {
|
|
30
23
|
GroupContext: () => GroupContext
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(GroupContext_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
27
|
var import_react = __toESM(require("react"));
|
|
34
28
|
const GroupContext = import_react.default.createContext();
|
|
35
|
-
module.exports = __toCommonJS(GroupContext_exports);
|
|
36
29
|
//# sourceMappingURL=GroupContext.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/GroupContext/GroupContext.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\n\nexport const GroupContext = React.createContext();\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAEX,MAAM,eAAe,qBAAM,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|