@instructure/ui-position
Advanced tools
Comparing version 6.16.1-rc.10 to 6.16.1-rc.11
@@ -25,2 +25,3 @@ /* | ||
export { Position } from './Position'; | ||
export { PositionLocator, PositionContentLocator, PositionTargetLocator } from './Position/PositionLocator'; | ||
export { calculateElementPosition } from './calculateElementPosition'; | ||
@@ -27,0 +28,0 @@ export { executeMirrorFunction } from './executeMirrorFunction'; |
@@ -24,38 +24,5 @@ /* | ||
*/ | ||
import { locator } from '@instructure/ui-test-utils'; | ||
import { Position } from './index'; | ||
export var PositionTargetLocator = locator("[".concat(Position.targetLocatorAttribute, "]")); | ||
export var PositionContentLocator = locator("[".concat(Position.contentLocatorAttribute, "]")); | ||
export var customMethods = { | ||
findTarget: function findTarget(element) { | ||
if (element && element.getAttribute) { | ||
var _locator; | ||
var id = element.getAttribute(Position.locatorAttribute); | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
return (_locator = locator("[".concat(Position.targetLocatorAttribute, "=\"").concat(id, "\"]"))).find.apply(_locator, args); | ||
} else { | ||
return null; | ||
} | ||
}, | ||
findContent: function findContent(element) { | ||
if (element && element.getAttribute) { | ||
var _locator2; | ||
var id = element.getAttribute(Position.locatorAttribute); | ||
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
args[_key2 - 1] = arguments[_key2]; | ||
} | ||
return (_locator2 = locator("[".concat(Position.contentLocatorAttribute, "=\"").concat(id, "\"]"))).find.apply(_locator2, args); | ||
} else { | ||
return null; | ||
} | ||
} | ||
}; | ||
export default locator(Position.selector, customMethods); | ||
import { PositionLocator } from './PositionLocator'; | ||
export { PositionContentLocator, PositionTargetLocator, customMethods } from './PositionLocator'; | ||
export { PositionLocator }; | ||
export default PositionLocator; |
@@ -12,2 +12,20 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "PositionLocator", { | ||
enumerable: true, | ||
get: function get() { | ||
return _PositionLocator.PositionLocator; | ||
} | ||
}); | ||
Object.defineProperty(exports, "PositionContentLocator", { | ||
enumerable: true, | ||
get: function get() { | ||
return _PositionLocator.PositionContentLocator; | ||
} | ||
}); | ||
Object.defineProperty(exports, "PositionTargetLocator", { | ||
enumerable: true, | ||
get: function get() { | ||
return _PositionLocator.PositionTargetLocator; | ||
} | ||
}); | ||
Object.defineProperty(exports, "calculateElementPosition", { | ||
@@ -52,2 +70,4 @@ enumerable: true, | ||
var _PositionLocator = require("./Position/PositionLocator"); | ||
var _calculateElementPosition = require("./calculateElementPosition"); | ||
@@ -54,0 +74,0 @@ |
@@ -6,8 +6,30 @@ "use strict"; | ||
}); | ||
exports.default = exports.customMethods = exports.PositionContentLocator = exports.PositionTargetLocator = void 0; | ||
Object.defineProperty(exports, "PositionLocator", { | ||
enumerable: true, | ||
get: function get() { | ||
return _PositionLocator.PositionLocator; | ||
} | ||
}); | ||
Object.defineProperty(exports, "PositionContentLocator", { | ||
enumerable: true, | ||
get: function get() { | ||
return _PositionLocator.PositionContentLocator; | ||
} | ||
}); | ||
Object.defineProperty(exports, "PositionTargetLocator", { | ||
enumerable: true, | ||
get: function get() { | ||
return _PositionLocator.PositionTargetLocator; | ||
} | ||
}); | ||
Object.defineProperty(exports, "customMethods", { | ||
enumerable: true, | ||
get: function get() { | ||
return _PositionLocator.customMethods; | ||
} | ||
}); | ||
exports.default = void 0; | ||
var _uiTestUtils = require("@instructure/ui-test-utils"); | ||
var _PositionLocator = require("./PositionLocator"); | ||
var _index = require("./index"); | ||
/* | ||
@@ -36,42 +58,3 @@ * The MIT License (MIT) | ||
*/ | ||
var PositionTargetLocator = (0, _uiTestUtils.locator)("[".concat(_index.Position.targetLocatorAttribute, "]")); | ||
exports.PositionTargetLocator = PositionTargetLocator; | ||
var PositionContentLocator = (0, _uiTestUtils.locator)("[".concat(_index.Position.contentLocatorAttribute, "]")); | ||
exports.PositionContentLocator = PositionContentLocator; | ||
var customMethods = { | ||
findTarget: function findTarget(element) { | ||
if (element && element.getAttribute) { | ||
var _locator; | ||
var id = element.getAttribute(_index.Position.locatorAttribute); | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
return (_locator = (0, _uiTestUtils.locator)("[".concat(_index.Position.targetLocatorAttribute, "=\"").concat(id, "\"]"))).find.apply(_locator, args); | ||
} else { | ||
return null; | ||
} | ||
}, | ||
findContent: function findContent(element) { | ||
if (element && element.getAttribute) { | ||
var _locator2; | ||
var id = element.getAttribute(_index.Position.locatorAttribute); | ||
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
args[_key2 - 1] = arguments[_key2]; | ||
} | ||
return (_locator2 = (0, _uiTestUtils.locator)("[".concat(_index.Position.contentLocatorAttribute, "=\"").concat(id, "\"]"))).find.apply(_locator2, args); | ||
} else { | ||
return null; | ||
} | ||
} | ||
}; | ||
exports.customMethods = customMethods; | ||
var _default = (0, _uiTestUtils.locator)(_index.Position.selector, customMethods); | ||
var _default = _PositionLocator.PositionLocator; | ||
exports.default = _default; |
{ | ||
"name": "@instructure/ui-position", | ||
"version": "6.16.1-rc.10+b3dbe0284", | ||
"version": "6.16.1-rc.11+ae3b13199", | ||
"description": "A component for positioning content with respect to a designated target.", | ||
@@ -25,11 +25,11 @@ "author": "Instructure, Inc. Engineering and Product Design", | ||
"@babel/runtime": "^7.5.0", | ||
"@instructure/debounce": "6.16.1-rc.10+b3dbe0284", | ||
"@instructure/ui-dom-utils": "6.16.1-rc.10+b3dbe0284", | ||
"@instructure/ui-portal": "6.16.1-rc.10+b3dbe0284", | ||
"@instructure/ui-prop-types": "6.16.1-rc.10+b3dbe0284", | ||
"@instructure/ui-react-utils": "6.16.1-rc.10+b3dbe0284", | ||
"@instructure/ui-testable": "6.16.1-rc.10+b3dbe0284", | ||
"@instructure/ui-themeable": "6.16.1-rc.10+b3dbe0284", | ||
"@instructure/ui-utils": "6.16.1-rc.10+b3dbe0284", | ||
"@instructure/uid": "6.16.1-rc.10+b3dbe0284", | ||
"@instructure/debounce": "6.16.1-rc.11+ae3b13199", | ||
"@instructure/ui-dom-utils": "6.16.1-rc.11+ae3b13199", | ||
"@instructure/ui-portal": "6.16.1-rc.11+ae3b13199", | ||
"@instructure/ui-prop-types": "6.16.1-rc.11+ae3b13199", | ||
"@instructure/ui-react-utils": "6.16.1-rc.11+ae3b13199", | ||
"@instructure/ui-testable": "6.16.1-rc.11+ae3b13199", | ||
"@instructure/ui-themeable": "6.16.1-rc.11+ae3b13199", | ||
"@instructure/ui-utils": "6.16.1-rc.11+ae3b13199", | ||
"@instructure/uid": "6.16.1-rc.11+ae3b13199", | ||
"classnames": "^2", | ||
@@ -39,5 +39,5 @@ "prop-types": "^15" | ||
"devDependencies": { | ||
"@instructure/ui-babel-preset": "6.16.1-rc.10+b3dbe0284", | ||
"@instructure/ui-color-utils": "6.16.1-rc.10+b3dbe0284", | ||
"@instructure/ui-test-utils": "6.16.1-rc.10+b3dbe0284" | ||
"@instructure/ui-babel-preset": "6.16.1-rc.11+ae3b13199", | ||
"@instructure/ui-color-utils": "6.16.1-rc.11+ae3b13199", | ||
"@instructure/ui-test-utils": "6.16.1-rc.11+ae3b13199" | ||
}, | ||
@@ -51,3 +51,3 @@ "peerDependencies": { | ||
"sideEffects": false, | ||
"gitHead": "b3dbe02846d1a068c0eb3fe22a6dd5e30b12d533" | ||
"gitHead": "ae3b13199c318c4adf1bd95c2927144c4b6d8de5" | ||
} |
@@ -25,2 +25,3 @@ /* | ||
export { Position } from './Position' | ||
export { PositionLocator, PositionContentLocator, PositionTargetLocator } from './Position/PositionLocator' | ||
@@ -27,0 +28,0 @@ export { calculateElementPosition } from './calculateElementPosition' |
@@ -24,29 +24,8 @@ /* | ||
*/ | ||
import { locator } from '@instructure/ui-test-utils' | ||
import { Position } from './index' | ||
export const PositionTargetLocator = locator(`[${Position.targetLocatorAttribute}]`) | ||
export const PositionContentLocator = locator(`[${Position.contentLocatorAttribute}]`) | ||
import { PositionLocator } from './PositionLocator' | ||
export const customMethods = { | ||
findTarget: (element, ...args) => { | ||
if (element && element.getAttribute) { | ||
const id = element.getAttribute(Position.locatorAttribute) | ||
return locator(`[${Position.targetLocatorAttribute}="${id}"]`) | ||
.find(...args) | ||
} else { | ||
return null | ||
} | ||
}, | ||
findContent: (element, ...args) => { | ||
if (element && element.getAttribute) { | ||
const id = element.getAttribute(Position.locatorAttribute) | ||
return locator(`[${Position.contentLocatorAttribute}="${id}"]`) | ||
.find(...args) | ||
} else { | ||
return null | ||
} | ||
} | ||
} | ||
export { PositionContentLocator, PositionTargetLocator, customMethods } from './PositionLocator' | ||
export default locator(Position.selector, customMethods) | ||
export { PositionLocator } | ||
export default PositionLocator |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
165446
46
3904