@lingxiteam/assets 1.0.11-alpha.7 → 1.0.11-alpha.9

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.
@@ -1,4 +1,4 @@
1
- import { hasSomeOwnProperty } from '../utils';
1
+ import { hasSomeOwnProperty, hasEveryOwnProperty } from '../utils';
2
2
  var h5 = {
3
3
  Icon: function Icon() {
4
4
  var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -77,13 +77,24 @@ var h5 = {
77
77
  props === null || props === void 0 ? true : delete props.acceptExtension;
78
78
  }
79
79
  return component;
80
+ },
81
+ 'Image|DformFile|DformImagePicker|Signature': function ImageDformFileDformImagePickerSignature() {
82
+ var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
83
+ var _component$props6 = component.props,
84
+ props = _component$props6 === void 0 ? {} : _component$props6;
85
+ if (props.hasOwnProperty('action')) {
86
+ // 旧数据含有action,实际用到的值和columns当中的api是相同
87
+ props.columns.api = props.action;
88
+ delete props.action;
89
+ }
90
+ return component;
80
91
  }
81
92
  };
82
93
  var pc = {
83
94
  'DatePicker|TimePicker': function DatePickerTimePicker() {
84
95
  var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
85
- var _component$props6 = component.props,
86
- props = _component$props6 === void 0 ? {} : _component$props6;
96
+ var _component$props7 = component.props,
97
+ props = _component$props7 === void 0 ? {} : _component$props7;
87
98
  var isCurrent = props.isCurrent,
88
99
  defaultValue = props.defaultValue,
89
100
  customTime = props.customTime;
@@ -110,8 +121,8 @@ var pc = {
110
121
  },
111
122
  Button: function Button() {
112
123
  var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
113
- var _component$props7 = component.props,
114
- props = _component$props7 === void 0 ? {} : _component$props7;
124
+ var _component$props8 = component.props,
125
+ props = _component$props8 === void 0 ? {} : _component$props8;
115
126
  // const { popoverSetting, showPopover } = props;
116
127
  if (props.iconType && !props.icon) {
117
128
  var theme = props.theme,
@@ -140,15 +151,15 @@ var pc = {
140
151
  },
141
152
  'Dropdown|Menu': function DropdownMenu() {
142
153
  var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
143
- var _component$props8 = component.props,
144
- props = _component$props8 === void 0 ? {} : _component$props8;
154
+ var _component$props9 = component.props,
155
+ props = _component$props9 === void 0 ? {} : _component$props9;
145
156
  delete props.iconInfo;
146
157
  return component;
147
158
  },
148
159
  'Input|Card|Collapse': function InputCardCollapse() {
149
160
  var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
150
- var _component$props9 = component.props,
151
- props = _component$props9 === void 0 ? {} : _component$props9;
161
+ var _component$props10 = component.props,
162
+ props = _component$props10 === void 0 ? {} : _component$props10;
152
163
  delete props.type;
153
164
  delete props.theme;
154
165
  delete props.fontAddress;
@@ -166,8 +177,8 @@ var pc = {
166
177
  },
167
178
  'StdUpload|Icon': function StdUploadIcon() {
168
179
  var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
169
- var _component$props10 = component.props,
170
- props = _component$props10 === void 0 ? {} : _component$props10;
180
+ var _component$props11 = component.props,
181
+ props = _component$props11 === void 0 ? {} : _component$props11;
171
182
  delete props.type;
172
183
  delete props.theme;
173
184
  delete props.fontAddress;
@@ -179,8 +190,8 @@ var pc = {
179
190
  },
180
191
  Table: function Table() {
181
192
  var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
182
- var _component$props11 = component.props,
183
- props = _component$props11 === void 0 ? {} : _component$props11;
193
+ var _component$props12 = component.props,
194
+ props = _component$props12 === void 0 ? {} : _component$props12;
184
195
  if (typeof props.showCustom === 'boolean') {
185
196
  // 旧数据
186
197
  var iconPosition = props.iconPosition,
@@ -215,14 +226,14 @@ var pc = {
215
226
  return component;
216
227
  },
217
228
  Upload: function Upload(component) {
218
- var _component$props12 = component.props,
219
- props = _component$props12 === void 0 ? {} : _component$props12;
229
+ var _component$props13 = component.props,
230
+ props = _component$props13 === void 0 ? {} : _component$props13;
220
231
  if (props.hasOwnProperty('action')) {
221
232
  // 旧数据含有action
222
233
  props.columns.api = props.action;
223
234
  delete props.action;
224
235
  }
225
- if (props.hasOwnProperty('accept') && props.hasOwnProperty('acceptType')) {
236
+ if (hasEveryOwnProperty(props, ['accept', 'acceptType'])) {
226
237
  // 实际数据是取acceptType
227
238
  delete props.accept;
228
239
  }
@@ -4,7 +4,7 @@ export default {
4
4
  compType: -1,
5
5
  isBusiObjContainer: false,
6
6
  isContainer: false,
7
- label: '页面',
7
+ label: '业务组件',
8
8
  props: {
9
9
  objType: 'app',
10
10
  catalogItemId: -1
@@ -4,7 +4,7 @@ export default {
4
4
  compType: -1,
5
5
  isBusiObjContainer: false,
6
6
  isContainer: false,
7
- label: '页面',
7
+ label: '弹窗',
8
8
  props: {
9
9
  catalogItemId: -1,
10
10
  ignoreLogin: false,
@@ -4,7 +4,7 @@ export default {
4
4
  compType: -1,
5
5
  isBusiObjContainer: false,
6
6
  isContainer: false,
7
- label: '页面',
7
+ label: '气泡卡片',
8
8
  props: {
9
9
  pageLayout: 'BaseLayout',
10
10
  pageDynamicFlag: false,
@@ -4,7 +4,7 @@ export default {
4
4
  compType: -1,
5
5
  isBusiObjContainer: false,
6
6
  isContainer: false,
7
- label: '页面',
7
+ label: '业务组件',
8
8
  props: {
9
9
  objType: 'app',
10
10
  catalogItemId: -1
@@ -4,7 +4,7 @@ export default {
4
4
  compType: -1,
5
5
  isBusiObjContainer: false,
6
6
  isContainer: false,
7
- label: '页面',
7
+ label: '抽屉',
8
8
  props: {
9
9
  width: 624,
10
10
  height: 300,
@@ -4,7 +4,7 @@ export default {
4
4
  compType: -1,
5
5
  isBusiObjContainer: false,
6
6
  isContainer: false,
7
- label: '页面',
7
+ label: '弹窗',
8
8
  props: {
9
9
  catalogItemId: -1,
10
10
  width: 624,
@@ -4,7 +4,7 @@ export default {
4
4
  compType: -1,
5
5
  isBusiObjContainer: false,
6
6
  isContainer: false,
7
- label: '页面',
7
+ label: '气泡卡片',
8
8
  props: {
9
9
  catalogItemId: -1,
10
10
  width: 624,
@@ -2169,7 +2169,7 @@ var todoActionObject = {
2169
2169
  label: '给组件设置属性',
2170
2170
  todoOptions: [{
2171
2171
  key: 'rProps',
2172
- label: '设置远程组件属性',
2172
+ label: '设置自定义组件属性',
2173
2173
  type: 'SelectCustomParams'
2174
2174
  }]
2175
2175
  },
@@ -979,7 +979,7 @@ var todoOptionList = {
979
979
  },
980
980
  rProps: {
981
981
  key: 'rProps',
982
- label: '设置远程组件属性',
982
+ label: '设置自定义组件属性',
983
983
  type: 'SelectCustomParams'
984
984
  },
985
985
  hasEventExtService: {
package/es/utils/url.js CHANGED
@@ -1,9 +1,9 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
1
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
2
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
4
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
5
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
7
7
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
8
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
9
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -49,41 +49,54 @@ href 当前文档的完整url
49
49
  */
50
50
  export var parseUrlExpression = function parseUrlExpression(urlStr) {
51
51
  var urlParamsContext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52
- var _ref = window.location || {},
53
- protocol = _ref.protocol,
54
- _ref$href = _ref.href,
55
- href = _ref$href === void 0 ? '' : _ref$href,
56
- port = _ref.port,
57
- pathname = _ref.pathname,
58
- host = _ref.host,
59
- hostname = _ref.hostname,
60
- hash = _ref.hash;
61
- var defaultParams = {
62
- protocol: protocol,
63
- href: href,
64
- port: port,
65
- pathname: pathname,
66
- host: host,
67
- hostname: hostname,
68
- searchObj: getSearchObj(href),
69
- search: decodeURIComponent(href.split('?').pop() || ''),
70
- hash: decodeURIComponent(hash)
71
- };
72
- var evalVariableExpression = function evalVariableExpression(text) {
73
- var params = _objectSpread(_objectSpread({}, defaultParams), urlParamsContext);
74
- try {
75
- return Function('context', "\n with(context) {\n return (function(){\n \"use strict\";\n return ".concat(text.slice(2, text.length - 1), ";\n })();\n }\n "))(params);
76
- } catch (error) {
77
- console.warn("".concat(text, "\u8868\u8FBE\u5F0F\u6267\u884C\u6709\u8BEF:"), error);
78
- return text;
79
- }
80
- };
81
- var regexp = /\$\{(.+?)\}/g;
52
+ if (urlStr && typeof urlStr !== 'string') {
53
+ console.error("parseUrlExpression\u5904\u7406".concat(urlStr, "\u65F6\u89E3\u6790\u9519\u8BEF:\u8868\u8FBE\u5F0F\u9700\u4E3A\u5B57\u7B26\u4E32\u683C\u5F0F"));
54
+ return '';
55
+ }
56
+ var extend = urlParamsContext;
82
57
  var result = urlStr;
83
- if (result) {
84
- result = result.replace(regexp, function (str) {
85
- return evalVariableExpression(str);
86
- });
58
+ if (_typeof(urlParamsContext) !== 'object') {
59
+ console.warn("parseUrlExpression\u53C2\u6570\u9519\u8BEF:\u6269\u5C55\u53C2\u6570\u9700\u4E3A\u5BF9\u8C61");
60
+ extend = {};
61
+ }
62
+ try {
63
+ var _ref = window.location || {},
64
+ protocol = _ref.protocol,
65
+ _ref$href = _ref.href,
66
+ href = _ref$href === void 0 ? '' : _ref$href,
67
+ port = _ref.port,
68
+ pathname = _ref.pathname,
69
+ host = _ref.host,
70
+ hostname = _ref.hostname,
71
+ hash = _ref.hash;
72
+ var defaultParams = {
73
+ protocol: protocol,
74
+ href: href,
75
+ port: port,
76
+ pathname: pathname,
77
+ host: host,
78
+ hostname: hostname,
79
+ searchObj: getSearchObj(href),
80
+ search: decodeURIComponent(href.split('?').pop() || ''),
81
+ hash: decodeURIComponent(hash)
82
+ };
83
+ var evalVariableExpression = function evalVariableExpression(text) {
84
+ var params = _objectSpread(_objectSpread({}, defaultParams), extend);
85
+ try {
86
+ return Function('context', "\n with(context) {\n return (function(){\n \"use strict\";\n return ".concat(text.slice(2, text.length - 1), ";\n })();\n }\n "))(params);
87
+ } catch (error) {
88
+ console.warn("parseUrlExpression\u5904\u7406".concat(text, "\u65F6\u89E3\u6790\u9519\u8BEF:"), error);
89
+ return text;
90
+ }
91
+ };
92
+ var regexp = /\$\{(.+?)\}/g;
93
+ if (result) {
94
+ result = result.replace(regexp, function (str) {
95
+ return evalVariableExpression(str);
96
+ });
97
+ }
98
+ } catch (e) {
99
+ console.error("parseUrlExpression\u6267\u884C\u9519\u8BEF:", e);
87
100
  }
88
- return result;
101
+ return result || '';
89
102
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingxiteam/assets",
3
- "version": "1.0.11-alpha.7",
3
+ "version": "1.0.11-alpha.9",
4
4
  "description": "灵犀低代码平台移动端 - 工具类",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",