@digigov/ui 1.0.0-55e4210c → 1.0.0-60addd4a
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/es/icons/Icon/index.js +2 -2
- package/es/navigation/Link/index.js +1 -21
- package/esm/icons/Icon/index.js +2 -2
- package/esm/index.js +1 -1
- package/esm/navigation/Link/index.js +1 -21
- package/icons/Icon/index.d.ts +2 -2
- package/icons/Icon/index.js +1 -1
- package/navigation/Link/index.d.ts +1 -1
- package/navigation/Link/index.js +7 -32
- package/package.json +3 -3
- package/src/icons/Icon/index.tsx +2 -2
- package/src/navigation/Link/index.tsx +1 -18
package/es/icons/Icon/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from '@digigov/react-
|
|
1
|
+
export * from '@digigov/react-core/Icon';
|
|
2
2
|
export * from '@digigov/react-icons';
|
|
3
3
|
export * from '@digigov/react-icons/icons';
|
|
4
|
-
import Icon from '@digigov/react-
|
|
4
|
+
import Icon from '@digigov/react-core/Icon';
|
|
5
5
|
export default Icon;
|
|
@@ -1,33 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["children", "href"];
|
|
4
|
-
import
|
|
4
|
+
import * as React from 'react';
|
|
5
5
|
import LinkBase from '@digigov/react-core/LinkBase';
|
|
6
6
|
export var CommonLink = function CommonLink(props) {
|
|
7
7
|
return /*#__PURE__*/React.createElement(LinkBase, props, props.children);
|
|
8
8
|
};
|
|
9
9
|
var LinkComponentContext = /*#__PURE__*/React.createContext(LinkBase);
|
|
10
10
|
export var LinkProvider = function LinkProvider(props) {
|
|
11
|
-
useEffect(function () {
|
|
12
|
-
var path = window.location.hash;
|
|
13
|
-
|
|
14
|
-
if (path && path.includes("#")) {
|
|
15
|
-
setTimeout(function () {
|
|
16
|
-
var id = path.replace("#", "");
|
|
17
|
-
var el = window.document.getElementById(id);
|
|
18
|
-
var r = el === null || el === void 0 ? void 0 : el.getBoundingClientRect();
|
|
19
|
-
|
|
20
|
-
if (r) {
|
|
21
|
-
var _window$top;
|
|
22
|
-
|
|
23
|
-
(_window$top = window.top) === null || _window$top === void 0 ? void 0 : _window$top.scroll({
|
|
24
|
-
top: scrollY + r.top,
|
|
25
|
-
behavior: "smooth"
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}, 600);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
11
|
return /*#__PURE__*/React.createElement(LinkComponentContext.Provider, {
|
|
32
12
|
value: props.component
|
|
33
13
|
}, props.children);
|
package/esm/icons/Icon/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from '@digigov/react-
|
|
1
|
+
export * from '@digigov/react-core/Icon';
|
|
2
2
|
export * from '@digigov/react-icons';
|
|
3
3
|
export * from '@digigov/react-icons/icons';
|
|
4
|
-
import Icon from '@digigov/react-
|
|
4
|
+
import Icon from '@digigov/react-core/Icon';
|
|
5
5
|
export default Icon;
|
package/esm/index.js
CHANGED
|
@@ -1,33 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["children", "href"];
|
|
4
|
-
import
|
|
4
|
+
import * as React from 'react';
|
|
5
5
|
import LinkBase from '@digigov/react-core/LinkBase';
|
|
6
6
|
export var CommonLink = function CommonLink(props) {
|
|
7
7
|
return /*#__PURE__*/React.createElement(LinkBase, props, props.children);
|
|
8
8
|
};
|
|
9
9
|
var LinkComponentContext = /*#__PURE__*/React.createContext(LinkBase);
|
|
10
10
|
export var LinkProvider = function LinkProvider(props) {
|
|
11
|
-
useEffect(function () {
|
|
12
|
-
var path = window.location.hash;
|
|
13
|
-
|
|
14
|
-
if (path && path.includes("#")) {
|
|
15
|
-
setTimeout(function () {
|
|
16
|
-
var id = path.replace("#", "");
|
|
17
|
-
var el = window.document.getElementById(id);
|
|
18
|
-
var r = el === null || el === void 0 ? void 0 : el.getBoundingClientRect();
|
|
19
|
-
|
|
20
|
-
if (r) {
|
|
21
|
-
var _window$top;
|
|
22
|
-
|
|
23
|
-
(_window$top = window.top) === null || _window$top === void 0 ? void 0 : _window$top.scroll({
|
|
24
|
-
top: scrollY + r.top,
|
|
25
|
-
behavior: "smooth"
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}, 600);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
11
|
return /*#__PURE__*/React.createElement(LinkComponentContext.Provider, {
|
|
32
12
|
value: props.component
|
|
33
13
|
}, props.children);
|
package/icons/Icon/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from '@digigov/react-
|
|
1
|
+
export * from '@digigov/react-core/Icon';
|
|
2
2
|
export * from '@digigov/react-icons';
|
|
3
3
|
export * from '@digigov/react-icons/icons';
|
|
4
|
-
import Icon from '@digigov/react-
|
|
4
|
+
import Icon from '@digigov/react-core/Icon';
|
|
5
5
|
export default Icon;
|
package/icons/Icon/index.js
CHANGED
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
var _exportNames = {};
|
|
9
9
|
exports["default"] = void 0;
|
|
10
10
|
|
|
11
|
-
var _Icon = _interopRequireWildcard(require("@digigov/react-
|
|
11
|
+
var _Icon = _interopRequireWildcard(require("@digigov/react-core/Icon"));
|
|
12
12
|
|
|
13
13
|
Object.keys(_Icon).forEach(function (key) {
|
|
14
14
|
if (key === "default" || key === "__esModule") return;
|
package/navigation/Link/index.js
CHANGED
|
@@ -20,7 +20,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
20
20
|
|
|
21
21
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var React = _interopRequireWildcard(require("react"));
|
|
24
24
|
|
|
25
25
|
var _LinkBase = _interopRequireDefault(require("@digigov/react-core/LinkBase"));
|
|
26
26
|
|
|
@@ -31,56 +31,31 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
31
31
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
32
32
|
|
|
33
33
|
var CommonLink = function CommonLink(props) {
|
|
34
|
-
return /*#__PURE__*/
|
|
34
|
+
return /*#__PURE__*/React.createElement(_LinkBase["default"], props, props.children);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
exports.CommonLink = CommonLink;
|
|
38
|
-
|
|
39
|
-
var LinkComponentContext = /*#__PURE__*/_react["default"].createContext(_LinkBase["default"]);
|
|
38
|
+
var LinkComponentContext = /*#__PURE__*/React.createContext(_LinkBase["default"]);
|
|
40
39
|
|
|
41
40
|
var LinkProvider = function LinkProvider(props) {
|
|
42
|
-
|
|
43
|
-
var path = window.location.hash;
|
|
44
|
-
|
|
45
|
-
if (path && path.includes("#")) {
|
|
46
|
-
setTimeout(function () {
|
|
47
|
-
var id = path.replace("#", "");
|
|
48
|
-
var el = window.document.getElementById(id);
|
|
49
|
-
var r = el === null || el === void 0 ? void 0 : el.getBoundingClientRect();
|
|
50
|
-
|
|
51
|
-
if (r) {
|
|
52
|
-
var _window$top;
|
|
53
|
-
|
|
54
|
-
(_window$top = window.top) === null || _window$top === void 0 ? void 0 : _window$top.scroll({
|
|
55
|
-
top: scrollY + r.top,
|
|
56
|
-
behavior: "smooth"
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}, 600);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
return /*#__PURE__*/_react["default"].createElement(LinkComponentContext.Provider, {
|
|
41
|
+
return /*#__PURE__*/React.createElement(LinkComponentContext.Provider, {
|
|
63
42
|
value: props.component
|
|
64
43
|
}, props.children);
|
|
65
44
|
};
|
|
66
45
|
|
|
67
46
|
exports.LinkProvider = LinkProvider;
|
|
68
|
-
|
|
69
|
-
var Link = /*#__PURE__*/_react["default"].forwardRef(function Link(_ref, ref) {
|
|
47
|
+
var Link = /*#__PURE__*/React.forwardRef(function Link(_ref, ref) {
|
|
70
48
|
var children = _ref.children,
|
|
71
49
|
_ref$href = _ref.href,
|
|
72
50
|
href = _ref$href === void 0 ? '' : _ref$href,
|
|
73
51
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return /*#__PURE__*/_react["default"].createElement(LinkComponent, (0, _extends2["default"])({
|
|
52
|
+
var LinkComponent = React.useContext(LinkComponentContext);
|
|
53
|
+
return /*#__PURE__*/React.createElement(LinkComponent, (0, _extends2["default"])({
|
|
78
54
|
ref: ref,
|
|
79
55
|
href: href
|
|
80
56
|
}, props), children);
|
|
81
57
|
}); //@ts-ignore
|
|
82
58
|
|
|
83
|
-
|
|
84
59
|
exports.Link = Link;
|
|
85
60
|
Link.displayName = 'Link';
|
|
86
61
|
var _default = Link;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/ui",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-60addd4a",
|
|
4
4
|
"description": "@digigov reusable components toolkit",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"react-query": "2.26.4",
|
|
14
14
|
"yup": "0.32.11",
|
|
15
15
|
"publint": "0.1.8",
|
|
16
|
-
"@digigov/react-icons": "1.0.0-
|
|
16
|
+
"@digigov/react-icons": "1.0.0-60addd4a"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@material-ui/core": "4.11.3",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"clsx": "1.1.1",
|
|
22
22
|
"react": "^16.8.0 || ^17.0.0",
|
|
23
23
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
24
|
-
"@digigov/react-core": "1.0.0-
|
|
24
|
+
"@digigov/react-core": "1.0.0-60addd4a"
|
|
25
25
|
},
|
|
26
26
|
"gitHead": "c903a46306f77f55ad7fc4d2e274006f39a6c871",
|
|
27
27
|
"private": false,
|
package/src/icons/Icon/index.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from '@digigov/react-
|
|
1
|
+
export * from '@digigov/react-core/Icon';
|
|
2
2
|
export * from '@digigov/react-icons';
|
|
3
3
|
export * from '@digigov/react-icons/icons';
|
|
4
4
|
|
|
5
|
-
import Icon from '@digigov/react-
|
|
5
|
+
import Icon from '@digigov/react-core/Icon';
|
|
6
6
|
export default Icon;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import LinkBase, { LinkBaseProps } from '@digigov/react-core/LinkBase';
|
|
3
3
|
|
|
4
4
|
export interface LinkComponentContextProps {
|
|
@@ -13,23 +13,6 @@ const LinkComponentContext = React.createContext<React.ElementType<LinkProps>>(
|
|
|
13
13
|
LinkBase
|
|
14
14
|
);
|
|
15
15
|
export const LinkProvider: React.FC<LinkComponentContextProps> = (props) => {
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const path = window.location.hash
|
|
18
|
-
if (path && path.includes("#")) {
|
|
19
|
-
setTimeout(() => {
|
|
20
|
-
const id = path.replace("#", "")
|
|
21
|
-
const el = window.document.getElementById(id)
|
|
22
|
-
const r = el?.getBoundingClientRect()
|
|
23
|
-
if (r) {
|
|
24
|
-
window.top?.scroll({
|
|
25
|
-
top: scrollY + r.top,
|
|
26
|
-
behavior: "smooth",
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
}, 600)
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
|
|
33
16
|
return (
|
|
34
17
|
<LinkComponentContext.Provider value={props.component}>
|
|
35
18
|
{props.children}
|