@synerise/ds-core 0.31.1 → 0.31.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.31.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-core@0.31.1...@synerise/ds-core@0.31.2) (2021-11-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.31.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-core@0.30.14...@synerise/ds-core@0.31.1) (2021-11-09)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-core
|
|
@@ -1,30 +1,12 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
4
2
|
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
4
|
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
|
|
9
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
|
-
|
|
11
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
12
|
-
|
|
13
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
14
|
-
|
|
15
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
|
-
|
|
17
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
-
|
|
19
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
20
|
-
|
|
21
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
22
|
-
|
|
23
5
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
6
|
|
|
25
|
-
function
|
|
7
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
26
8
|
|
|
27
|
-
function
|
|
9
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
28
10
|
|
|
29
11
|
import * as React from 'react';
|
|
30
12
|
import { IntlProvider } from 'react-intl';
|
|
@@ -35,78 +17,74 @@ import antMessages from './antLocales';
|
|
|
35
17
|
var DEFAULT_LANG = 'en-US';
|
|
36
18
|
|
|
37
19
|
var LocaleProvider = /*#__PURE__*/function (_React$Component) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var _super = _createSuper(LocaleProvider);
|
|
20
|
+
_inheritsLoose(LocaleProvider, _React$Component);
|
|
41
21
|
|
|
42
22
|
function LocaleProvider() {
|
|
43
23
|
var _this;
|
|
44
24
|
|
|
45
|
-
_classCallCheck(this, LocaleProvider);
|
|
46
|
-
|
|
47
25
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
48
26
|
args[_key] = arguments[_key];
|
|
49
27
|
}
|
|
50
28
|
|
|
51
|
-
_this =
|
|
52
|
-
|
|
29
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
30
|
+
|
|
31
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
53
32
|
dsLocales: {}
|
|
54
|
-
};
|
|
33
|
+
});
|
|
55
34
|
|
|
56
|
-
_this
|
|
35
|
+
_defineProperty(_assertThisInitialized(_this), "getLangForCode", function (code) {
|
|
57
36
|
return code.substring(0, 2);
|
|
58
|
-
};
|
|
37
|
+
});
|
|
59
38
|
|
|
60
39
|
return _this;
|
|
61
40
|
}
|
|
62
41
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
});
|
|
42
|
+
var _proto = LocaleProvider.prototype;
|
|
43
|
+
|
|
44
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
45
|
+
var _this2 = this;
|
|
46
|
+
|
|
47
|
+
var locale = this.props.locale;
|
|
48
|
+
var lang = this.getLangForCode(locale || DEFAULT_LANG);
|
|
49
|
+
import("../../../i18n/" + lang + ".json").then(function (dsLocales) {
|
|
50
|
+
return _this2.setState({
|
|
51
|
+
dsLocales: dsLocales
|
|
74
52
|
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}]);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
_proto.render = function render() {
|
|
57
|
+
var _this$props = this.props,
|
|
58
|
+
_this$props$defaultMe = _this$props.defaultMessages,
|
|
59
|
+
defaultMessages = _this$props$defaultMe === void 0 ? {} : _this$props$defaultMe,
|
|
60
|
+
_this$props$messages = _this$props.messages,
|
|
61
|
+
messages = _this$props$messages === void 0 ? {} : _this$props$messages,
|
|
62
|
+
locale = _this$props.locale,
|
|
63
|
+
timeZone = _this$props.timeZone,
|
|
64
|
+
children = _this$props.children;
|
|
65
|
+
var dsLocales = this.state.dsLocales;
|
|
66
|
+
var code = locale || DEFAULT_LANG;
|
|
67
|
+
var lang = this.getLangForCode(code);
|
|
68
|
+
var localeData = messages || {};
|
|
69
|
+
var localeDataForLang = localeData[lang] || {};
|
|
70
|
+
var antLocale = Object.prototype.hasOwnProperty.call(antMessages, lang) ? antMessages[lang] : antMessages["default"];
|
|
71
|
+
var currentMessages = flatten(_objectSpread({}, dsLocales, {}, merge.all([defaultMessages, localeDataForLang])));
|
|
72
|
+
return /*#__PURE__*/React.createElement(AntConfigProvider, {
|
|
73
|
+
locale: antLocale
|
|
74
|
+
}, /*#__PURE__*/React.createElement(IntlProvider, {
|
|
75
|
+
textComponent: "span",
|
|
76
|
+
locale: code,
|
|
77
|
+
messages: currentMessages,
|
|
78
|
+
timeZone: timeZone
|
|
79
|
+
}, children));
|
|
80
|
+
};
|
|
104
81
|
|
|
105
82
|
return LocaleProvider;
|
|
106
83
|
}(React.Component);
|
|
107
84
|
|
|
108
|
-
LocaleProvider
|
|
85
|
+
_defineProperty(LocaleProvider, "defaultProps", {
|
|
109
86
|
locale: DEFAULT_LANG,
|
|
110
87
|
localeData: {}
|
|
111
|
-
};
|
|
88
|
+
});
|
|
89
|
+
|
|
112
90
|
export { LocaleProvider as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly)
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2
2
|
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ var ThemeProvider = function ThemeProvider(props) {
|
|
|
12
12
|
var theme = props.theme,
|
|
13
13
|
children = props.children;
|
|
14
14
|
return /*#__PURE__*/React.createElement(ThemeProviderBase, {
|
|
15
|
-
theme: _objectSpread(
|
|
15
|
+
theme: _objectSpread({}, dsTheme, {}, theme)
|
|
16
16
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, children));
|
|
17
17
|
};
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-core",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.2",
|
|
4
4
|
"description": "Core Components for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"less-vars-loader": "1.1.0",
|
|
43
43
|
"webpack": "4.42.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "2468359677783819939fb9f1ef5acc36667ecd1a"
|
|
46
46
|
}
|