@arcblock/ux 1.15.22 → 1.15.24

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.
@@ -9,9 +9,20 @@ var _styles = require("@material-ui/core/styles");
9
9
 
10
10
  var _responsiveFontSizes = _interopRequireDefault(require("./responsiveFontSizes"));
11
11
 
12
+ const _excluded = ["mode", "pageWidth", "palette", "typography", "overrides"];
13
+
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
15
 
14
- // https://app.zeplin.io/styleguide/5d1436f1e97c2156f49c0725/colors
16
+ 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; }
17
+
18
+ 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; }
19
+
20
+ 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; }
21
+
22
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
23
+
24
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
25
+
15
26
  const colors = {
16
27
  white: '#FFFFFF',
17
28
  dark: '#4A707C',
@@ -36,14 +47,17 @@ const colors = {
36
47
  exports.colors = colors;
37
48
 
38
49
  const create = function create() {
39
- let {
50
+ let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
51
+ {
40
52
  mode = 'light',
41
53
  pageWidth = 'md',
42
54
  palette,
43
55
  typography,
44
56
  overrides
45
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
46
- const theme = (0, _styles.createTheme)({
57
+ } = _ref,
58
+ rest = _objectWithoutProperties(_ref, _excluded);
59
+
60
+ const theme = (0, _styles.createTheme)(_objectSpread({
47
61
  themeName: 'ArcBlock',
48
62
  palette: Object.assign({
49
63
  primary: {
@@ -141,7 +155,7 @@ const create = function create() {
141
155
  pageWidth,
142
156
  colors,
143
157
  mode
144
- });
158
+ }, rest));
145
159
  const enhanced = (0, _responsiveFontSizes.default)(theme, {
146
160
  breakpoints: ['xs', 'sm', 'md', 'lg'],
147
161
  disableAlign: false,
package/lib/Util/index.js CHANGED
@@ -11,6 +11,7 @@ exports.setDateTool = setDateTool;
11
11
  exports.getDateTool = getDateTool;
12
12
  exports.formatToDate = formatToDate;
13
13
  exports.formatToDatetime = formatToDatetime;
14
+ exports.openWebWallet = openWebWallet;
14
15
  exports.formatUptime = exports.str2color = exports.getTimezone = exports.getBackground = exports.getColor = void 0;
15
16
 
16
17
  var _padStart = _interopRequireDefault(require("lodash/padStart"));
@@ -266,4 +267,46 @@ function formatToDatetime(date) {
266
267
  locale,
267
268
  tz
268
269
  });
270
+ }
271
+
272
+ function openWebWallet(_ref3) {
273
+ let {
274
+ webWalletUrl,
275
+ action = 'login',
276
+ locale = 'en',
277
+ url,
278
+ windowFeatures
279
+ } = _ref3;
280
+ const defaultWindowFeatures = {
281
+ toolbar: 'no',
282
+ location: 'no',
283
+ status: 'no',
284
+ menubar: 'no',
285
+ scrollbars: 'yes',
286
+ resizable: 'yes',
287
+ // iphone 8plus size
288
+ width: 414,
289
+ height: 736
290
+ };
291
+ const windowUrl = "".concat(webWalletUrl, "?action=").concat(action, "&locale=").concat(locale, "&url=").concat(encodeURIComponent(url));
292
+ const mergedWindowFeatures = Object.assign({}, defaultWindowFeatures, windowFeatures);
293
+
294
+ const getWindowWidth = win => {
295
+ return win.innerWidth || win.document.documentElement.clientWidth || win.document.body.clientWidth;
296
+ }; // 默认在浏览器右上角弹出窗口
297
+
298
+
299
+ if (!('left' in mergedWindowFeatures)) {
300
+ const winWidth = getWindowWidth(window.top || window);
301
+ const winLeft = window.screenLeft || window.screenX;
302
+ mergedWindowFeatures.left = winWidth + winLeft - mergedWindowFeatures.width;
303
+ }
304
+
305
+ if (!('top' in mergedWindowFeatures)) {
306
+ const winTop = window.screenTop || window.screenY;
307
+ mergedWindowFeatures.top = winTop;
308
+ }
309
+
310
+ const strWindowFeatures = Object.keys(mergedWindowFeatures).map(key => "".concat(key, "=").concat(mergedWindowFeatures[key])).join(',');
311
+ window.open(windowUrl, 'targetWindow', strWindowFeatures);
269
312
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "1.15.22",
3
+ "version": "1.15.24",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -52,10 +52,10 @@
52
52
  "react": ">=16.12.0",
53
53
  "react-ga": "^2.7.0"
54
54
  },
55
- "gitHead": "4cfa3b8a8ea49873c4f2917f41120b49491f1818",
55
+ "gitHead": "e502ebd457e93e4abcb9c3531b66cd135a561759",
56
56
  "dependencies": {
57
- "@arcblock/icons": "^1.15.22",
58
- "@arcblock/react-hooks": "^1.15.22",
57
+ "@arcblock/icons": "^1.15.24",
58
+ "@arcblock/react-hooks": "^1.15.24",
59
59
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
60
60
  "@material-ui/core": "^4.12.3",
61
61
  "@material-ui/icons": "4.11.2",