@dhis2-ui/cover 8.1.11 → 8.2.2
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/build/cjs/cover.js +18 -15
- package/build/cjs/cover.stories.e2e.js +1 -1
- package/build/cjs/cover.stories.js +3 -9
- package/build/cjs/features/click_behavior/index.js +2 -1
- package/build/es/cover.js +18 -15
- package/build/es/cover.stories.js +2 -8
- package/build/es/features/click_behavior/index.js +2 -1
- package/package.json +2 -2
package/build/cjs/cover.js
CHANGED
|
@@ -24,22 +24,25 @@ const createClickHandler = onClick => event => {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const Cover =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}) => /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
-
onClick: createClickHandler(onClick),
|
|
35
|
-
"data-test": dataTest,
|
|
36
|
-
className: _style.default.dynamic([["3798453419", [_uiConstants.layers.applicationTop]]]) + " " + ((0, _classnames.default)(className, {
|
|
27
|
+
const Cover = _ref => {
|
|
28
|
+
let {
|
|
29
|
+
children,
|
|
30
|
+
className,
|
|
31
|
+
dataTest,
|
|
32
|
+
onClick,
|
|
37
33
|
translucent
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
} = _ref;
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
+
onClick: createClickHandler(onClick),
|
|
37
|
+
"data-test": dataTest,
|
|
38
|
+
className: _style.default.dynamic([["3798453419", [_uiConstants.layers.applicationTop]]]) + " " + ((0, _classnames.default)(className, {
|
|
39
|
+
translucent
|
|
40
|
+
}) || "")
|
|
41
|
+
}, children, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
42
|
+
id: "3798453419",
|
|
43
|
+
dynamic: [_uiConstants.layers.applicationTop]
|
|
44
|
+
}, ["div.__jsx-style-dynamic-selector{position:absolute;top:0;right:0;bottom:0;left:0;z-index:".concat(_uiConstants.layers.applicationTop, ";}"), "div.translucent.__jsx-style-dynamic-selector{background:rgba(33,43,54,0.4);}"]));
|
|
45
|
+
};
|
|
43
46
|
|
|
44
47
|
exports.Cover = Cover;
|
|
45
48
|
Cover.defaultProps = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = exports.WithClickHandler = exports.WithChildren = exports.Blocking = void 0;
|
|
7
7
|
|
|
8
8
|
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = exports.WithClickHandler = exports.WithCenteredContentCircularLoader = exports.Translucent = exports.Default = void 0;
|
|
7
7
|
|
|
8
8
|
var _center = require("@dhis2-ui/center");
|
|
9
9
|
|
|
@@ -15,15 +15,9 @@ var _cover = require("./cover.js");
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
const description =
|
|
19
|
-
Covers sibling components. Useful for covering a component while it is loading.
|
|
20
|
-
|
|
21
|
-
\`\`\`js
|
|
22
|
-
import { Cover } from '@dhis2/ui'
|
|
23
|
-
\`\`\`
|
|
24
|
-
`;
|
|
18
|
+
const description = "\nCovers sibling components. Useful for covering a component while it is loading.\n\n```js\nimport { Cover } from '@dhis2/ui'\n```\n";
|
|
25
19
|
var _default = {
|
|
26
|
-
title: '
|
|
20
|
+
title: 'Component Cover',
|
|
27
21
|
component: _cover.Cover,
|
|
28
22
|
parameters: {
|
|
29
23
|
docs: {
|
|
@@ -15,7 +15,8 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
15
15
|
cy.get('[data-test="dhis2-uicore-componentcover"]').click();
|
|
16
16
|
});
|
|
17
17
|
(0, _steps.When)('the user clicks on the button coordinates', () => {
|
|
18
|
-
cy.getPositionsBySelectors('button').then(
|
|
18
|
+
cy.getPositionsBySelectors('button').then(_ref => {
|
|
19
|
+
let [rect] = _ref;
|
|
19
20
|
// Get button center coordinates
|
|
20
21
|
const buttonCenterX = rect.left + rect.width / 2;
|
|
21
22
|
const buttonCenterY = rect.top + rect.height / 2; // click body on the button center
|
package/build/es/cover.js
CHANGED
|
@@ -11,22 +11,25 @@ const createClickHandler = onClick => event => {
|
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
const Cover =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}) => /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
onClick: createClickHandler(onClick),
|
|
22
|
-
"data-test": dataTest,
|
|
23
|
-
className: _JSXStyle.dynamic([["3798453419", [layers.applicationTop]]]) + " " + (cx(className, {
|
|
14
|
+
const Cover = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
dataTest,
|
|
19
|
+
onClick,
|
|
24
20
|
translucent
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
onClick: createClickHandler(onClick),
|
|
24
|
+
"data-test": dataTest,
|
|
25
|
+
className: _JSXStyle.dynamic([["3798453419", [layers.applicationTop]]]) + " " + (cx(className, {
|
|
26
|
+
translucent
|
|
27
|
+
}) || "")
|
|
28
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
29
|
+
id: "3798453419",
|
|
30
|
+
dynamic: [layers.applicationTop]
|
|
31
|
+
}, ["div.__jsx-style-dynamic-selector{position:absolute;top:0;right:0;bottom:0;left:0;z-index:".concat(layers.applicationTop, ";}"), "div.translucent.__jsx-style-dynamic-selector{background:rgba(33,43,54,0.4);}"]));
|
|
32
|
+
};
|
|
30
33
|
|
|
31
34
|
Cover.defaultProps = {
|
|
32
35
|
dataTest: 'dhis2-uicore-componentcover'
|
|
@@ -2,15 +2,9 @@ import { Center } from '@dhis2-ui/center';
|
|
|
2
2
|
import { CircularLoader } from '@dhis2-ui/loader';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Cover } from './cover.js';
|
|
5
|
-
const description =
|
|
6
|
-
Covers sibling components. Useful for covering a component while it is loading.
|
|
7
|
-
|
|
8
|
-
\`\`\`js
|
|
9
|
-
import { Cover } from '@dhis2/ui'
|
|
10
|
-
\`\`\`
|
|
11
|
-
`;
|
|
5
|
+
const description = "\nCovers sibling components. Useful for covering a component while it is loading.\n\n```js\nimport { Cover } from '@dhis2/ui'\n```\n";
|
|
12
6
|
export default {
|
|
13
|
-
title: '
|
|
7
|
+
title: 'Component Cover',
|
|
14
8
|
component: Cover,
|
|
15
9
|
parameters: {
|
|
16
10
|
docs: {
|
|
@@ -12,7 +12,8 @@ When('the user clicks on the Cover', () => {
|
|
|
12
12
|
cy.get('[data-test="dhis2-uicore-componentcover"]').click();
|
|
13
13
|
});
|
|
14
14
|
When('the user clicks on the button coordinates', () => {
|
|
15
|
-
cy.getPositionsBySelectors('button').then(
|
|
15
|
+
cy.getPositionsBySelectors('button').then(_ref => {
|
|
16
|
+
let [rect] = _ref;
|
|
16
17
|
// Get button center coordinates
|
|
17
18
|
const buttonCenterX = rect.left + rect.width / 2;
|
|
18
19
|
const buttonCenterY = rect.top + rect.height / 2; // click body on the button center
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/cover",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.2",
|
|
4
4
|
"description": "UI Cover",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@dhis2/prop-types": "^3.0.0-beta.1",
|
|
35
|
-
"@dhis2/ui-constants": "8.
|
|
35
|
+
"@dhis2/ui-constants": "8.2.2",
|
|
36
36
|
"classnames": "^2.3.1",
|
|
37
37
|
"prop-types": "^15.7.2"
|
|
38
38
|
},
|