@instructure/ui-position 10.19.2-snapshot-2 → 10.19.2-snapshot-4

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/package.json +15 -16
  3. package/tsconfig.build.json +0 -3
  4. package/tsconfig.build.tsbuildinfo +1 -1
  5. package/es/Position/PositionContentLocator.js +0 -27
  6. package/es/Position/PositionLocator.js +0 -48
  7. package/es/Position/PositionTargetLocator.js +0 -27
  8. package/es/Position/__new-tests__/Position.test.js +0 -623
  9. package/es/Position/locator.js +0 -28
  10. package/es/__new-tests__/mirrorHorizontalPlacement.test.js +0 -68
  11. package/es/__new-tests__/mirrorPlacement.test.js +0 -68
  12. package/lib/Position/PositionContentLocator.js +0 -33
  13. package/lib/Position/PositionLocator.js +0 -65
  14. package/lib/Position/PositionTargetLocator.js +0 -33
  15. package/lib/Position/__new-tests__/Position.test.js +0 -624
  16. package/lib/Position/locator.js +0 -55
  17. package/lib/__new-tests__/mirrorHorizontalPlacement.test.js +0 -70
  18. package/lib/__new-tests__/mirrorPlacement.test.js +0 -70
  19. package/src/Position/PositionContentLocator.ts +0 -30
  20. package/src/Position/PositionLocator.ts +0 -55
  21. package/src/Position/PositionTargetLocator.ts +0 -30
  22. package/src/Position/__new-tests__/Position.test.tsx +0 -586
  23. package/src/Position/locator.ts +0 -34
  24. package/src/__new-tests__/mirrorHorizontalPlacement.test.tsx +0 -115
  25. package/src/__new-tests__/mirrorPlacement.test.tsx +0 -113
  26. package/types/Position/PositionContentLocator.d.ts +0 -310
  27. package/types/Position/PositionContentLocator.d.ts.map +0 -1
  28. package/types/Position/PositionLocator.d.ts +0 -1221
  29. package/types/Position/PositionLocator.d.ts.map +0 -1
  30. package/types/Position/PositionTargetLocator.d.ts +0 -310
  31. package/types/Position/PositionTargetLocator.d.ts.map +0 -1
  32. package/types/Position/__new-tests__/Position.test.d.ts +0 -2
  33. package/types/Position/__new-tests__/Position.test.d.ts.map +0 -1
  34. package/types/Position/locator.d.ts +0 -5
  35. package/types/Position/locator.d.ts.map +0 -1
  36. package/types/__new-tests__/mirrorHorizontalPlacement.test.d.ts +0 -2
  37. package/types/__new-tests__/mirrorHorizontalPlacement.test.d.ts.map +0 -1
  38. package/types/__new-tests__/mirrorPlacement.test.d.ts +0 -2
  39. package/types/__new-tests__/mirrorPlacement.test.d.ts.map +0 -1
@@ -1,68 +0,0 @@
1
- /*
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2015 - present Instructure, Inc.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- import { mirrorHorizontalPlacement } from '../mirrorHorizontalPlacement';
26
- import { placementPropValues } from '../PositionPropTypes';
27
- import '@testing-library/jest-dom';
28
- const mirrorHorizontallyAsArrayMap = [['top'], ['bottom'], ['end'], ['start'], ['top', 'end'], ['top', 'center'], ['top', 'start'], ['top', 'stretch'], ['bottom', 'end'], ['bottom', 'center'], ['bottom', 'start'], ['bottom', 'stretch'], ['end', 'top'], ['end', 'center'], ['end', 'bottom'], ['end', 'stretch'], ['start', 'top'], ['start', 'center'], ['start', 'bottom'], ['start', 'stretch'], ['center', 'end'], ['center', 'start'], ['offscreen']];
29
- describe('mirrorHorizontalPlacement', () => {
30
- describe('when string is passed', () => {
31
- describe('without delimiter should return mirrored values as array', () => {
32
- placementPropValues.forEach((placement, idx) => {
33
- it(placement, () => {
34
- const mirrored = mirrorHorizontalPlacement(placement);
35
- expect(mirrored[0]).toEqual(mirrorHorizontallyAsArrayMap[idx][0]);
36
- expect(mirrored[1]).toEqual(mirrorHorizontallyAsArrayMap[idx][1]);
37
- });
38
- });
39
- });
40
- describe('with delimiter should return mirrored values as string', () => {
41
- placementPropValues.forEach((placement, idx) => {
42
- it(placement, () => {
43
- const mirrored = mirrorHorizontalPlacement(placement, ' ');
44
- expect(mirrored).toEqual(mirrorHorizontallyAsArrayMap[idx].join(' '));
45
- });
46
- });
47
- });
48
- });
49
- describe('when array is passed', () => {
50
- describe('without delimiter should return mirrored values as array', () => {
51
- placementPropValues.forEach((placement, idx) => {
52
- it(placement, () => {
53
- const mirrored = mirrorHorizontalPlacement(placement.split(' '));
54
- expect(mirrored[0]).toEqual(mirrorHorizontallyAsArrayMap[idx][0]);
55
- expect(mirrored[1]).toEqual(mirrorHorizontallyAsArrayMap[idx][1]);
56
- });
57
- });
58
- });
59
- describe('with delimiter should return mirrored values as string', () => {
60
- placementPropValues.forEach((placement, idx) => {
61
- it(placement, () => {
62
- const mirrored = mirrorHorizontalPlacement(placement.split(' '), ' ');
63
- expect(mirrored).toEqual(mirrorHorizontallyAsArrayMap[idx].join(' '));
64
- });
65
- });
66
- });
67
- });
68
- });
@@ -1,68 +0,0 @@
1
- /*
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2015 - present Instructure, Inc.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- import { mirrorPlacement } from '../mirrorPlacement';
26
- import { placementPropValues } from '../PositionPropTypes';
27
- import '@testing-library/jest-dom';
28
- const mirrorVertiallyAsArrayMap = [['bottom'], ['top'], ['end'], ['start'], ['bottom', 'start'], ['bottom', 'center'], ['bottom', 'end'], ['bottom', 'stretch'], ['top', 'start'], ['top', 'center'], ['top', 'end'], ['top', 'stretch'], ['end', 'top'], ['end', 'center'], ['end', 'bottom'], ['end', 'stretch'], ['start', 'top'], ['start', 'center'], ['start', 'bottom'], ['start', 'stretch'], ['center', 'start'], ['center', 'end'], ['offscreen']];
29
- describe('mirrorPlacement', () => {
30
- describe('when string is passed', () => {
31
- describe('without delimiter should return mirrored values as array', () => {
32
- placementPropValues.forEach((placement, idx) => {
33
- it(placement, () => {
34
- const mirrored = mirrorPlacement(placement);
35
- expect(mirrored[0]).toEqual(mirrorVertiallyAsArrayMap[idx][0]);
36
- expect(mirrored[1]).toEqual(mirrorVertiallyAsArrayMap[idx][1]);
37
- });
38
- });
39
- });
40
- describe('with delimiter should return mirrored values as string', () => {
41
- placementPropValues.forEach((placement, idx) => {
42
- it(placement, () => {
43
- const mirrored = mirrorPlacement(placement, ' ');
44
- expect(mirrored).toEqual(mirrorVertiallyAsArrayMap[idx].join(' '));
45
- });
46
- });
47
- });
48
- });
49
- describe('when array is passed', () => {
50
- describe('without delimiter should return mirrored values as array', () => {
51
- placementPropValues.forEach((placement, idx) => {
52
- it(placement, () => {
53
- const mirrored = mirrorPlacement(placement.split(' '));
54
- expect(mirrored[0]).toEqual(mirrorVertiallyAsArrayMap[idx][0]);
55
- expect(mirrored[1]).toEqual(mirrorVertiallyAsArrayMap[idx][1]);
56
- });
57
- });
58
- });
59
- describe('with delimiter should return mirrored values as string', () => {
60
- placementPropValues.forEach((placement, idx) => {
61
- it(placement, () => {
62
- const mirrored = mirrorPlacement(placement.split(' '), ' ');
63
- expect(mirrored).toEqual(mirrorVertiallyAsArrayMap[idx].join(' '));
64
- });
65
- });
66
- });
67
- });
68
- });
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PositionContentLocator = void 0;
7
- var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
8
- var _index = require("./index");
9
- /*
10
- * The MIT License (MIT)
11
- *
12
- * Copyright (c) 2015 - present Instructure, Inc.
13
- *
14
- * Permission is hereby granted, free of charge, to any person obtaining a copy
15
- * of this software and associated documentation files (the "Software"), to deal
16
- * in the Software without restriction, including without limitation the rights
17
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- * copies of the Software, and to permit persons to whom the Software is
19
- * furnished to do so, subject to the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be included in all
22
- * copies or substantial portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
31
- */
32
-
33
- const PositionContentLocator = exports.PositionContentLocator = (0, _locator.locator)(`[${_index.Position.contentLocatorAttribute}]`);
@@ -1,65 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "PositionContentLocator", {
7
- enumerable: true,
8
- get: function () {
9
- return _PositionContentLocator.PositionContentLocator;
10
- }
11
- });
12
- exports.PositionLocator = void 0;
13
- Object.defineProperty(exports, "PositionTargetLocator", {
14
- enumerable: true,
15
- get: function () {
16
- return _PositionTargetLocator.PositionTargetLocator;
17
- }
18
- });
19
- exports.customMethods = void 0;
20
- var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
21
- var _index = require("./index");
22
- var _PositionContentLocator = require("./PositionContentLocator");
23
- var _PositionTargetLocator = require("./PositionTargetLocator");
24
- /*
25
- * The MIT License (MIT)
26
- *
27
- * Copyright (c) 2015 - present Instructure, Inc.
28
- *
29
- * Permission is hereby granted, free of charge, to any person obtaining a copy
30
- * of this software and associated documentation files (the "Software"), to deal
31
- * in the Software without restriction, including without limitation the rights
32
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
33
- * copies of the Software, and to permit persons to whom the Software is
34
- * furnished to do so, subject to the following conditions:
35
- *
36
- * The above copyright notice and this permission notice shall be included in all
37
- * copies or substantial portions of the Software.
38
- *
39
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
42
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
43
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
44
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
45
- * SOFTWARE.
46
- */
47
-
48
- const customMethods = exports.customMethods = {
49
- findTarget: (element, ...args) => {
50
- if (element && element.getAttribute) {
51
- const id = element.getAttribute(_index.Position.locatorAttribute);
52
- return (0, _locator.locator)(`[${_index.Position.targetLocatorAttribute}="${id}"]`).find(...args);
53
- }
54
- throw new Error('Element ' + element + ' not found');
55
- },
56
- findContent: (element, ...args) => {
57
- if (element && element.getAttribute) {
58
- const id = element.getAttribute(_index.Position.locatorAttribute);
59
- return (0, _locator.locator)(`[${_index.Position.contentLocatorAttribute}="${id}"]`).find(...args);
60
- }
61
- throw new Error('Element ' + element + ' not found');
62
- }
63
- };
64
- // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
65
- const PositionLocator = exports.PositionLocator = (0, _locator.locator)(_index.Position.selector, customMethods);
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PositionTargetLocator = void 0;
7
- var _index = require("./index");
8
- var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
9
- /*
10
- * The MIT License (MIT)
11
- *
12
- * Copyright (c) 2015 - present Instructure, Inc.
13
- *
14
- * Permission is hereby granted, free of charge, to any person obtaining a copy
15
- * of this software and associated documentation files (the "Software"), to deal
16
- * in the Software without restriction, including without limitation the rights
17
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- * copies of the Software, and to permit persons to whom the Software is
19
- * furnished to do so, subject to the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be included in all
22
- * copies or substantial portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
31
- */
32
-
33
- const PositionTargetLocator = exports.PositionTargetLocator = (0, _locator.locator)(`[${_index.Position.targetLocatorAttribute}]`);