@wibetter/json-utils 5.0.21 → 5.1.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/dist/index.esm.js CHANGED
@@ -282,7 +282,6 @@ var initJSONSchemaData = {
282
282
  func: {
283
283
  type: 'object',
284
284
  title: '功能设置',
285
- isContainer: false,
286
285
  properties: {
287
286
  a: {
288
287
  title: '单文本框',
@@ -301,7 +300,6 @@ var initJSONSchemaData = {
301
300
  style: {
302
301
  type: 'object',
303
302
  title: '样式设置',
304
- isContainer: false,
305
303
  properties: {
306
304
  b: {
307
305
  title: '单文本框',
@@ -318,7 +316,6 @@ var initJSONSchemaData = {
318
316
  data: {
319
317
  type: 'data',
320
318
  title: '数据设置',
321
- isContainer: false,
322
319
  properties: {
323
320
  c: {
324
321
  title: '单文本框',
@@ -899,6 +896,61 @@ var initBoxStyleData = {
899
896
  propertyOrder: ['unit', 'quantity'],
900
897
  };
901
898
 
899
+ /** padding-margin 字段项
900
+ * 【字段属性说明】
901
+ * title:字段项的label值
902
+ * properties:存放所有的子字段数据内容
903
+ * type:用于标识字段项的展示类型(input、date、data-time、url、textarea 等)
904
+ * readOnly:字段项可设置是否可编辑
905
+ * required:存放所有子字段的key值,用于验证子字段项是否存在,同时required可充当排序功能
906
+ * propertyOrder:按序存放所有子字段的key值(排序功能)
907
+ * */
908
+ var initPaddingMarginData = {
909
+ type: 'padding-margin',
910
+ title: '边距设置',
911
+ isContainer: false,
912
+ properties: {
913
+ margin: {
914
+ title: '外边距',
915
+ type: 'input',
916
+ default: '0',
917
+ // 默认值为'0':'0px 0px 0px 0px';为'5px': '5px 5px 5px 5px'
918
+ description: '',
919
+ },
920
+ padding: {
921
+ title: '内边距',
922
+ type: 'input',
923
+ default: '0',
924
+ description: '',
925
+ },
926
+ quantity: {
927
+ type: 'select',
928
+ // 选择列表
929
+ default: 'px',
930
+ options: [
931
+ {
932
+ label: 'px',
933
+ value: 'px',
934
+ },
935
+ {
936
+ label: 'rem',
937
+ value: 'rem',
938
+ },
939
+ {
940
+ label: 'em',
941
+ value: 'em',
942
+ },
943
+ {
944
+ label: '%',
945
+ value: '%',
946
+ },
947
+ ],
948
+ title: '单位类型',
949
+ },
950
+ },
951
+ propertyOrder: ['margin', 'padding', 'quantity'],
952
+ };
953
+
902
954
  /* json类型字段
903
955
  * 【字段属性说明】
904
956
  * title:字段项的label值
@@ -2360,6 +2412,7 @@ var TypeDataList = {
2360
2412
  time: initTimeData,
2361
2413
  quantity: initQuantityData,
2362
2414
  'box-style': initBoxStyleData,
2415
+ 'padding-margin': initPaddingMarginData,
2363
2416
  radio: initRadioData,
2364
2417
  select: initSelectData,
2365
2418
  cascader: initCascaderSchema,
@@ -7419,6 +7472,7 @@ var valExpectType =
7419
7472
  array: 'array',
7420
7473
  boolean: 'boolean',
7421
7474
  'box-style': 'object',
7475
+ 'padding-margin': 'object',
7422
7476
  codearea: 'string',
7423
7477
  color: 'string',
7424
7478
  datasource: 'object',
@@ -21,7 +21,7 @@ function l(e) {
21
21
  function u(e, t) {
22
22
  return r(e, t);
23
23
  }
24
- function c(e, t) {
24
+ function p(e, t) {
25
25
  var r = t || {};
26
26
  if (!e) return !1;
27
27
  var n = new Function('data', 'with(data) { return (' + e + ');}'),
@@ -33,7 +33,7 @@ function c(e, t) {
33
33
  }
34
34
  return o;
35
35
  }
36
- function p(e, t, r) {
36
+ function c(e, t, r) {
37
37
  var n = t;
38
38
  if ((r && (n = a(t)), e))
39
39
  for (var o = e.split('-'), i = 0, s = o.length; i < s; i++) {
@@ -220,7 +220,6 @@ var y,
220
220
  func: {
221
221
  type: 'object',
222
222
  title: '功能设置',
223
- isContainer: !1,
224
223
  properties: {
225
224
  a: {
226
225
  title: '单文本框',
@@ -236,7 +235,6 @@ var y,
236
235
  style: {
237
236
  type: 'object',
238
237
  title: '样式设置',
239
- isContainer: !1,
240
238
  properties: {
241
239
  b: {
242
240
  title: '单文本框',
@@ -251,7 +249,6 @@ var y,
251
249
  data: {
252
250
  type: 'data',
253
251
  title: '数据设置',
254
- isContainer: !1,
255
252
  properties: {
256
253
  c: {
257
254
  title: '单文本框',
@@ -467,6 +464,37 @@ var y,
467
464
  },
468
465
  propertyOrder: ['unit', 'quantity'],
469
466
  },
467
+ 'padding-margin': {
468
+ type: 'padding-margin',
469
+ title: '边距设置',
470
+ isContainer: !1,
471
+ properties: {
472
+ margin: {
473
+ title: '外边距',
474
+ type: 'input',
475
+ default: '0',
476
+ description: '',
477
+ },
478
+ padding: {
479
+ title: '内边距',
480
+ type: 'input',
481
+ default: '0',
482
+ description: '',
483
+ },
484
+ quantity: {
485
+ type: 'select',
486
+ default: 'px',
487
+ options: [
488
+ { label: 'px', value: 'px' },
489
+ { label: 'rem', value: 'rem' },
490
+ { label: 'em', value: 'em' },
491
+ { label: '%', value: '%' },
492
+ ],
493
+ title: '单位类型',
494
+ },
495
+ },
496
+ propertyOrder: ['margin', 'padding', 'quantity'],
497
+ },
470
498
  radio: {
471
499
  type: 'radio',
472
500
  title: '单选',
@@ -1252,10 +1280,10 @@ var y,
1252
1280
  function _(e) {
1253
1281
  return /^http[s]?:\/\/.*/.test(e);
1254
1282
  }
1255
- function j(e) {
1283
+ function x(e) {
1256
1284
  return 'String' === Object.prototype.toString.call(e).slice(8, -1);
1257
1285
  }
1258
- function x(e) {
1286
+ function j(e) {
1259
1287
  return (
1260
1288
  'number' == typeof e ||
1261
1289
  '[object Number]' === Object.prototype.toString.call(e)
@@ -1285,7 +1313,7 @@ function V(e) {
1285
1313
  function T(e) {
1286
1314
  if (!V(e)) return !1;
1287
1315
  for (var t = 0, r = e.length; t < r; t++) {
1288
- if (!j(e[t])) return !1;
1316
+ if (!x(e[t])) return !1;
1289
1317
  }
1290
1318
  return !0;
1291
1319
  }
@@ -1354,7 +1382,7 @@ function M(e) {
1354
1382
  : (function (e) {
1355
1383
  var t = '';
1356
1384
  if (S(e)) t = a(E.boolean);
1357
- else if (x(e)) t = a(E.number);
1385
+ else if (j(e)) t = a(E.number);
1358
1386
  else if (_(e)) t = a(E.url);
1359
1387
  else if (D(e)) t = a(E.date);
1360
1388
  else if (C(e)) t = a(E['date-time']);
@@ -1362,7 +1390,7 @@ function M(e) {
1362
1390
  else if (P(e)) t = a(E.color);
1363
1391
  else
1364
1392
  try {
1365
- t = x(JSON.parse(e)) ? a(E.input) : a(E.json);
1393
+ t = j(JSON.parse(e)) ? a(E.input) : a(E.json);
1366
1394
  } catch (r) {
1367
1395
  t = e && e.length > 30 ? a(E.textarea) : a(E.input);
1368
1396
  }
@@ -1436,27 +1464,27 @@ function q(e) {
1436
1464
  var i = t.properties,
1437
1465
  s = i.type && i.type.default,
1438
1466
  u = i.data && i.data.default,
1439
- c = i.filter && i.filter.default;
1467
+ p = i.filter && i.filter.default;
1440
1468
  'local' === s
1441
1469
  ? ((t = a(w.local)).properties.data.default = u ? a(u) : '{}')
1442
1470
  : ((t = a(w.remote)).properties.data.default = u ? a(u) : 'http://xxx'),
1443
- (t.properties.filter.default = c ? a(c) : '() => {}');
1471
+ (t.properties.filter.default = p ? a(p) : '() => {}');
1444
1472
  }
1445
1473
  if ('event' === t.type) {
1446
- var p = t.properties,
1447
- d = p.type && p.type.default;
1474
+ var c = t.properties,
1475
+ d = c.type && c.type.default;
1448
1476
  if ('in' === d || 'on' === d) {
1449
- var f = (p.filter && p.filter.default) || '() => {}';
1477
+ var f = (c.filter && c.filter.default) || '() => {}';
1450
1478
  (t = a(N.on)),
1451
- p.actionFunc &&
1452
- k(p.actionFunc) &&
1453
- (t.properties.actionFunc.default = p.actionFunc.default || a(f));
1479
+ c.actionFunc &&
1480
+ k(c.actionFunc) &&
1481
+ (t.properties.actionFunc.default = c.actionFunc.default || a(f));
1454
1482
  } else {
1455
- var v = (p.filter && p.filter.default) || '{}';
1483
+ var v = (c.filter && c.filter.default) || '{}';
1456
1484
  (t = a(N.emit)),
1457
- p.eventData &&
1458
- k(p.eventData) &&
1459
- (t.properties.eventData.default = p.eventData.default || a(v));
1485
+ c.eventData &&
1486
+ k(c.eventData) &&
1487
+ (t.properties.eventData.default = c.eventData.default || a(v));
1460
1488
  }
1461
1489
  }
1462
1490
  return (
@@ -1639,7 +1667,7 @@ function ue(e, t, r) {
1639
1667
  o = new se(e);
1640
1668
  return t !== W && Rt('onBecomeObserved', o, t, n), r !== W && kt(o, r), o;
1641
1669
  }
1642
- var ce = {
1670
+ var pe = {
1643
1671
  identity: function (e, t) {
1644
1672
  return e === t;
1645
1673
  },
@@ -1653,9 +1681,9 @@ var ce = {
1653
1681
  return wr(e, t, 1);
1654
1682
  },
1655
1683
  },
1656
- pe = function (e, t) {
1684
+ ce = function (e, t) {
1657
1685
  return (
1658
- (pe =
1686
+ (ce =
1659
1687
  Object.setPrototypeOf ||
1660
1688
  ({ __proto__: [] } instanceof Array &&
1661
1689
  function (e, t) {
@@ -1664,7 +1692,7 @@ var ce = {
1664
1692
  function (e, t) {
1665
1693
  for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]);
1666
1694
  }),
1667
- pe(e, t)
1695
+ ce(e, t)
1668
1696
  );
1669
1697
  };
1670
1698
  /*! *****************************************************************************
@@ -1836,7 +1864,7 @@ function we(e, t, r) {
1836
1864
  function _e(e) {
1837
1865
  return e;
1838
1866
  }
1839
- function je(e) {
1867
+ function xe(e) {
1840
1868
  J(e);
1841
1869
  var t = Ee(!0, function (t, r, n, o, i) {
1842
1870
  'production' !== process.env.NODE_ENV &&
@@ -1863,13 +1891,13 @@ function je(e) {
1863
1891
  : t;
1864
1892
  return (r.enhancer = e), r;
1865
1893
  }
1866
- var xe = { deep: !0, name: void 0, defaultDecorator: void 0, proxy: !0 };
1894
+ var je = { deep: !0, name: void 0, defaultDecorator: void 0, proxy: !0 };
1867
1895
  function Se(e) {
1868
1896
  /^(deep|name|equals|defaultDecorator|proxy)$/.test(e) ||
1869
1897
  z('invalid option for (extend)observable: ' + e);
1870
1898
  }
1871
1899
  function De(e) {
1872
- if (null == e) return xe;
1900
+ if (null == e) return je;
1873
1901
  if ('string' == typeof e) return { name: e, deep: !0, proxy: !0 };
1874
1902
  if ('production' !== process.env.NODE_ENV) {
1875
1903
  if ('object' != typeof e) return z('expected options object');
@@ -1877,10 +1905,10 @@ function De(e) {
1877
1905
  }
1878
1906
  return e;
1879
1907
  }
1880
- Object.freeze(xe);
1881
- var Ce = je(we),
1882
- Ae = je(function (e, t, r) {
1883
- return null == e || br(e) || nr(e) || sr(e) || cr(e)
1908
+ Object.freeze(je);
1909
+ var Ce = xe(we),
1910
+ Ae = xe(function (e, t, r) {
1911
+ return null == e || br(e) || nr(e) || sr(e) || pr(e)
1884
1912
  ? e
1885
1913
  : Array.isArray(e)
1886
1914
  ? Pe.array(e, { name: r, deep: !1 })
@@ -1895,8 +1923,8 @@ var Ce = je(we),
1895
1923
  'The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets',
1896
1924
  );
1897
1925
  }),
1898
- Ve = je(_e),
1899
- Te = je(function (e, t, r) {
1926
+ Ve = xe(_e),
1927
+ Te = xe(function (e, t, r) {
1900
1928
  if ('production' !== process.env.NODE_ENV && qt(e))
1901
1929
  throw 'observable.struct should not be used with observable values';
1902
1930
  return wr(e, t) ? t : e;
@@ -2011,7 +2039,7 @@ var Me,
2011
2039
  s = o[0] || {};
2012
2040
  dr(e).addComputedProp(e, t, de({ get: i, set: a, context: e }, s));
2013
2041
  });
2014
- Be({ equals: ce.structural }),
2042
+ Be({ equals: pe.structural }),
2015
2043
  (function (e) {
2016
2044
  (e[(e.NOT_TRACKING = -1)] = 'NOT_TRACKING'),
2017
2045
  (e[(e.UP_TO_DATE = 0)] = 'UP_TO_DATE'),
@@ -2192,17 +2220,17 @@ function rt(e, t, r) {
2192
2220
  var l = He();
2193
2221
  yt();
2194
2222
  var u = nt(!0),
2195
- c = $e(!0),
2196
- p = {
2223
+ p = $e(!0),
2224
+ c = {
2197
2225
  prevDerivation: l,
2198
2226
  prevAllowStateChanges: u,
2199
- prevAllowStateReads: c,
2227
+ prevAllowStateReads: p,
2200
2228
  notifySpy: n,
2201
2229
  startTime: o,
2202
2230
  actionId: Qe++,
2203
2231
  parentActionId: Ze,
2204
2232
  };
2205
- return (Ze = p.actionId), p;
2233
+ return (Ze = c.actionId), c;
2206
2234
  })(e, r, n);
2207
2235
  try {
2208
2236
  return t.apply(r, n);
@@ -2245,7 +2273,7 @@ var it = (function (e) {
2245
2273
  function t(t, r, n, o, i) {
2246
2274
  void 0 === n && (n = 'ObservableValue@' + K()),
2247
2275
  void 0 === o && (o = !0),
2248
- void 0 === i && (i = ce.default);
2276
+ void 0 === i && (i = pe.default);
2249
2277
  var a = e.call(this, n) || this;
2250
2278
  return (
2251
2279
  (a.enhancer = r),
@@ -2265,7 +2293,7 @@ var it = (function (e) {
2265
2293
  function r() {
2266
2294
  this.constructor = e;
2267
2295
  }
2268
- pe(e, t),
2296
+ ce(e, t),
2269
2297
  (e.prototype =
2270
2298
  null === t
2271
2299
  ? Object.create(t)
@@ -2361,7 +2389,7 @@ var at = (function () {
2361
2389
  e.set && (this.setter = rt(this.name + '-setter', e.set)),
2362
2390
  (this.equals =
2363
2391
  e.equals ||
2364
- (e.compareStructural || e.struct ? ce.structural : ce.default)),
2392
+ (e.compareStructural || e.struct ? pe.structural : pe.default)),
2365
2393
  (this.scope = e.context),
2366
2394
  (this.requiresReaction = !!e.requiresReaction),
2367
2395
  (this.keepAlive = !!e.keepAlive);
@@ -2601,7 +2629,7 @@ var at = (function () {
2601
2629
  (this.suppressReactionErrors = !1);
2602
2630
  },
2603
2631
  ut = {};
2604
- function ct() {
2632
+ function pt() {
2605
2633
  return 'undefined' != typeof window
2606
2634
  ? window
2607
2635
  : 'undefined' != typeof global
@@ -2610,15 +2638,15 @@ function ct() {
2610
2638
  ? self
2611
2639
  : ut;
2612
2640
  }
2613
- var pt = !0,
2641
+ var ct = !0,
2614
2642
  dt = (function () {
2615
- var e = ct();
2643
+ var e = pt();
2616
2644
  return (
2617
- e.__mobxInstanceCount > 0 && !e.__mobxGlobals && (pt = !1),
2645
+ e.__mobxInstanceCount > 0 && !e.__mobxGlobals && (ct = !1),
2618
2646
  e.__mobxGlobals &&
2619
2647
  e.__mobxGlobals.version !== new lt().version &&
2620
- (pt = !1),
2621
- pt
2648
+ (ct = !1),
2649
+ ct
2622
2650
  ? e.__mobxGlobals
2623
2651
  ? ((e.__mobxInstanceCount += 1),
2624
2652
  e.__mobxGlobals.UNCHANGED || (e.__mobxGlobals.UNCHANGED = {}),
@@ -2859,9 +2887,9 @@ var Et = (function () {
2859
2887
  return e();
2860
2888
  };
2861
2889
  function _t() {
2862
- dt.inBatch > 0 || dt.isRunningReactions || wt(jt);
2890
+ dt.inBatch > 0 || dt.isRunningReactions || wt(xt);
2863
2891
  }
2864
- function jt() {
2892
+ function xt() {
2865
2893
  dt.isRunningReactions = !0;
2866
2894
  for (var e = dt.pendingReactions, t = 0; e.length > 0; ) {
2867
2895
  ++t === Nt &&
@@ -2877,7 +2905,7 @@ function jt() {
2877
2905
  }
2878
2906
  dt.isRunningReactions = !1;
2879
2907
  }
2880
- var xt = Q('Reaction', Et);
2908
+ var jt = Q('Reaction', Et);
2881
2909
  function St() {
2882
2910
  return 'production' !== process.env.NODE_ENV && !!dt.spyListeners.length;
2883
2911
  }
@@ -2949,8 +2977,8 @@ function Mt(e, t, r, n) {
2949
2977
  ) {
2950
2978
  var l = re(r);
2951
2979
  try {
2952
- for (var u = fe(l), c = u.next(); !c.done; c = u.next()) {
2953
- (f = c.value) in t ||
2980
+ for (var u = fe(l), p = u.next(); !p.done; p = u.next()) {
2981
+ (f = p.value) in t ||
2954
2982
  z(
2955
2983
  "Trying to declare a decorator for unspecified property '" +
2956
2984
  ne(f) +
@@ -2961,7 +2989,7 @@ function Mt(e, t, r, n) {
2961
2989
  o = { error: e };
2962
2990
  } finally {
2963
2991
  try {
2964
- c && !c.done && (i = u.return) && i.call(u);
2992
+ p && !p.done && (i = u.return) && i.call(u);
2965
2993
  } finally {
2966
2994
  if (o) throw o.error;
2967
2995
  }
@@ -2971,7 +2999,7 @@ function Mt(e, t, r, n) {
2971
2999
  try {
2972
3000
  l = ie(t);
2973
3001
  try {
2974
- for (var p = fe(l), d = p.next(); !d.done; d = p.next()) {
3002
+ for (var c = fe(l), d = c.next(); !d.done; d = c.next()) {
2975
3003
  var f = d.value,
2976
3004
  v = Object.getOwnPropertyDescriptor(t, f);
2977
3005
  'production' !== process.env.NODE_ENV &&
@@ -2994,7 +3022,7 @@ function Mt(e, t, r, n) {
2994
3022
  a = { error: e };
2995
3023
  } finally {
2996
3024
  try {
2997
- d && !d.done && (s = p.return) && s.call(p);
3025
+ d && !d.done && (s = c.return) && s.call(c);
2998
3026
  } finally {
2999
3027
  if (a) throw a.error;
3000
3028
  }
@@ -3052,20 +3080,20 @@ function qt(e) {
3052
3080
  'isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.',
3053
3081
  )
3054
3082
  : !!br(e) && e[ae].values.has(t)
3055
- : br(e) || !!e[ae] || le(e) || xt(e) || st(e))
3083
+ : br(e) || !!e[ae] || le(e) || jt(e) || st(e))
3056
3084
  );
3057
3085
  })(e)
3058
3086
  );
3059
3087
  }
3060
3088
  function Ut(e, t, r) {
3061
- if (2 !== arguments.length || cr(e))
3089
+ if (2 !== arguments.length || pr(e))
3062
3090
  if (br(e)) {
3063
3091
  var n = e[ae];
3064
3092
  n.values.get(t)
3065
3093
  ? n.write(t, r)
3066
3094
  : n.addObservableProp(t, r, n.defaultEnhancer);
3067
3095
  } else if (sr(e)) e.set(t, r);
3068
- else if (cr(e)) e.add(t);
3096
+ else if (pr(e)) e.add(t);
3069
3097
  else {
3070
3098
  if (!nr(e))
3071
3099
  return z(
@@ -3827,23 +3855,23 @@ var or,
3827
3855
  l = !1;
3828
3856
  try {
3829
3857
  for (
3830
- var u = fe(t._data.keys()), c = u.next();
3831
- !c.done;
3832
- c = u.next()
3858
+ var u = fe(t._data.keys()), p = u.next();
3859
+ !p.done;
3860
+ p = u.next()
3833
3861
  ) {
3834
- var p = c.value;
3835
- if (!a.has(p))
3836
- if (t.delete(p)) l = !0;
3862
+ var c = p.value;
3863
+ if (!a.has(c))
3864
+ if (t.delete(c)) l = !0;
3837
3865
  else {
3838
- var d = t._data.get(p);
3839
- s.set(p, d);
3866
+ var d = t._data.get(c);
3867
+ s.set(c, d);
3840
3868
  }
3841
3869
  }
3842
3870
  } catch (e) {
3843
3871
  r = { error: e };
3844
3872
  } finally {
3845
3873
  try {
3846
- c && !c.done && (n = u.return) && n.call(u);
3874
+ p && !p.done && (n = u.return) && n.call(u);
3847
3875
  } finally {
3848
3876
  if (r) throw r.error;
3849
3877
  }
@@ -3855,10 +3883,10 @@ var or,
3855
3883
  v = f.next()
3856
3884
  ) {
3857
3885
  var h = ve(v.value, 2),
3858
- y = ((p = h[0]), (d = h[1]), t._data.has(p));
3859
- if ((t.set(p, d), t._data.has(p))) {
3860
- var b = t._data.get(p);
3861
- s.set(p, b), y || (l = !0);
3886
+ y = ((c = h[0]), (d = h[1]), t._data.has(c));
3887
+ if ((t.set(c, d), t._data.has(c))) {
3888
+ var b = t._data.get(c);
3889
+ s.set(c, b), y || (l = !0);
3862
3890
  }
3863
3891
  }
3864
3892
  } catch (e) {
@@ -4115,7 +4143,7 @@ var or,
4115
4143
  (e.prototype.replace = function (e) {
4116
4144
  var t = this;
4117
4145
  return (
4118
- cr(e) && (e = e.toJS()),
4146
+ pr(e) && (e = e.toJS()),
4119
4147
  Ft(function () {
4120
4148
  var r = nt(!0);
4121
4149
  try {
@@ -4157,8 +4185,8 @@ var or,
4157
4185
  e
4158
4186
  );
4159
4187
  })(),
4160
- cr = Q('ObservableSet', ur),
4161
- pr = (function () {
4188
+ pr = Q('ObservableSet', ur),
4189
+ cr = (function () {
4162
4190
  function e(e, t, r, n) {
4163
4191
  void 0 === t && (t = new Map()),
4164
4192
  (this.target = e),
@@ -4428,7 +4456,7 @@ function dr(e, t, r) {
4428
4456
  ),
4429
4457
  X(e) || (t = (e.constructor.name || 'ObservableObject') + '@' + K()),
4430
4458
  t || (t = 'ObservableObject@' + K());
4431
- var n = new pr(e, new Map(), ne(t), r);
4459
+ var n = new cr(e, new Map(), ne(t), r);
4432
4460
  return Y(e, ae, n), n;
4433
4461
  }
4434
4462
  var fr = Object.create(null),
@@ -4437,7 +4465,7 @@ function hr(e) {
4437
4465
  var t = e[ae];
4438
4466
  return t || (Oe(e), e[ae]);
4439
4467
  }
4440
- var yr = Q('ObservableObjectAdministration', pr);
4468
+ var yr = Q('ObservableObjectAdministration', cr);
4441
4469
  function br(e) {
4442
4470
  return !!$(e) && (Oe(e), yr(e[ae]));
4443
4471
  }
@@ -4452,7 +4480,7 @@ function mr(e, t) {
4452
4480
  ),
4453
4481
  e[ae].atom
4454
4482
  );
4455
- if (cr(e)) return e[ae];
4483
+ if (pr(e)) return e[ae];
4456
4484
  if (sr(e)) {
4457
4485
  var r = e;
4458
4486
  return void 0 === t
@@ -4485,8 +4513,8 @@ function mr(e, t) {
4485
4513
  'production' !== process.env.NODE_ENV &&
4486
4514
  'please specify a property',
4487
4515
  );
4488
- if (le(e) || st(e) || xt(e)) return e;
4489
- } else if ('function' == typeof e && xt(e[ae])) return e[ae];
4516
+ if (le(e) || st(e) || jt(e)) return e;
4517
+ } else if ('function' == typeof e && jt(e[ae])) return e[ae];
4490
4518
  return z(
4491
4519
  'production' !== process.env.NODE_ENV && 'Cannot obtain atom from ' + e,
4492
4520
  );
@@ -4496,7 +4524,7 @@ function gr(e, t) {
4496
4524
  e || z('Expecting some object'),
4497
4525
  void 0 !== t
4498
4526
  ? gr(mr(e, t))
4499
- : le(e) || st(e) || xt(e) || sr(e) || cr(e)
4527
+ : le(e) || st(e) || jt(e) || sr(e) || pr(e)
4500
4528
  ? e
4501
4529
  : (Oe(e),
4502
4530
  e[ae]
@@ -4508,7 +4536,7 @@ function gr(e, t) {
4508
4536
  );
4509
4537
  }
4510
4538
  function Or(e, t) {
4511
- return (void 0 !== t ? mr(e, t) : br(e) || sr(e) || cr(e) ? gr(e) : mr(e))
4539
+ return (void 0 !== t ? mr(e, t) : br(e) || sr(e) || pr(e) ? gr(e) : mr(e))
4512
4540
  .name;
4513
4541
  }
4514
4542
  var Er,
@@ -4542,7 +4570,7 @@ function _r(e, t, r, n, o) {
4542
4570
  case '[object Set]':
4543
4571
  r >= 0 && r++;
4544
4572
  }
4545
- (e = jr(e)), (t = jr(t));
4573
+ (e = xr(e)), (t = xr(t));
4546
4574
  var s = '[object Array]' === a;
4547
4575
  if (!s) {
4548
4576
  if ('object' != typeof e || 'object' != typeof t) return !1;
@@ -4563,27 +4591,27 @@ function _r(e, t, r, n, o) {
4563
4591
  }
4564
4592
  if (0 === r) return !1;
4565
4593
  r < 0 && (r = -1), (o = o || []);
4566
- for (var c = (n = n || []).length; c--; ) if (n[c] === e) return o[c] === t;
4594
+ for (var p = (n = n || []).length; p--; ) if (n[p] === e) return o[p] === t;
4567
4595
  if ((n.push(e), o.push(t), s)) {
4568
- if ((c = e.length) !== t.length) return !1;
4569
- for (; c--; ) if (!_r(e[c], t[c], r - 1, n, o)) return !1;
4596
+ if ((p = e.length) !== t.length) return !1;
4597
+ for (; p--; ) if (!_r(e[p], t[p], r - 1, n, o)) return !1;
4570
4598
  } else {
4571
- var p = Object.keys(e),
4599
+ var c = Object.keys(e),
4572
4600
  d = void 0;
4573
- if (((c = p.length), Object.keys(t).length !== c)) return !1;
4574
- for (; c--; )
4575
- if (!xr(t, (d = p[c])) || !_r(e[d], t[d], r - 1, n, o)) return !1;
4601
+ if (((p = c.length), Object.keys(t).length !== p)) return !1;
4602
+ for (; p--; )
4603
+ if (!jr(t, (d = c[p])) || !_r(e[d], t[d], r - 1, n, o)) return !1;
4576
4604
  }
4577
4605
  return n.pop(), o.pop(), !0;
4578
4606
  }
4579
- function jr(e) {
4607
+ function xr(e) {
4580
4608
  return nr(e)
4581
4609
  ? e.slice()
4582
- : ee(e) || sr(e) || te(e) || cr(e)
4610
+ : ee(e) || sr(e) || te(e) || pr(e)
4583
4611
  ? Array.from(e.entries())
4584
4612
  : e;
4585
4613
  }
4586
- function xr(e, t) {
4614
+ function jr(e, t) {
4587
4615
  return Object.prototype.hasOwnProperty.call(e, t);
4588
4616
  }
4589
4617
  function Sr(e) {
@@ -4599,7 +4627,7 @@ if ('undefined' == typeof Proxy || 'undefined' == typeof Symbol)
4599
4627
  try {
4600
4628
  process.env.NODE_ENV;
4601
4629
  } catch (e) {
4602
- var Cr = ct();
4630
+ var Cr = pt();
4603
4631
  'undefined' == typeof process && (Cr.process = {}), (Cr.process.env = {});
4604
4632
  }
4605
4633
  !(function () {
@@ -4638,6 +4666,7 @@ var Ar =
4638
4666
  array: 'array',
4639
4667
  boolean: 'boolean',
4640
4668
  'box-style': 'object',
4669
+ 'padding-margin': 'object',
4641
4670
  codearea: 'string',
4642
4671
  color: 'string',
4643
4672
  datasource: 'object',
@@ -5042,11 +5071,11 @@ export {
5042
5071
  E as TypeDataList,
5043
5072
  Yr as dataRoute2dataPath,
5044
5073
  Xr as dynamicDataAnalyzer,
5045
- c as evalExpression,
5074
+ p as evalExpression,
5046
5075
  Lr as getCurPosition,
5047
5076
  Kr as getDefaultOptionVal,
5048
5077
  Vr as getExpectType,
5049
- p as getJsonDataByKeyRoute,
5078
+ c as getJsonDataByKeyRoute,
5050
5079
  qr as getNextIndexRoute,
5051
5080
  Br as getParentIndexRoute,
5052
5081
  Ur as getParentIndexRoute_CurIndex,
@@ -5066,12 +5095,12 @@ export {
5066
5095
  s as isEqual,
5067
5096
  I as isFunction,
5068
5097
  Rr as isNewSchemaData,
5069
- x as isNumber,
5098
+ j as isNumber,
5070
5099
  k as isObject,
5071
5100
  R as isQuantity,
5072
5101
  Mr as isSameParent,
5073
5102
  T as isSelect,
5074
- j as isString,
5103
+ x as isString,
5075
5104
  Ir as isStructuredSchema,
5076
5105
  A as isTimeStr,
5077
5106
  _ as isURL,
package/dist/index.js CHANGED
@@ -102,7 +102,7 @@
102
102
  return b;
103
103
  },
104
104
  isArray: function () {
105
- return q;
105
+ return k;
106
106
  },
107
107
  isBoolean: function () {
108
108
  return w;
@@ -117,7 +117,7 @@
117
117
  return R;
118
118
  },
119
119
  isDateTimeStr: function () {
120
- return E;
120
+ return q;
121
121
  },
122
122
  isEmptySchema: function () {
123
123
  return W;
@@ -153,7 +153,7 @@
153
153
  return Z;
154
154
  },
155
155
  isTimeStr: function () {
156
- return k;
156
+ return E;
157
157
  },
158
158
  isURL: function () {
159
159
  return T;
@@ -332,7 +332,7 @@
332
332
  return a;
333
333
  }
334
334
  var m,
335
- h = {
335
+ g = {
336
336
  type: 'event',
337
337
  title: '事件',
338
338
  isContainer: !1,
@@ -362,7 +362,7 @@
362
362
  },
363
363
  propertyOrder: ['type', 'trigger', 'eventData'],
364
364
  },
365
- g = {
365
+ h = {
366
366
  type: 'datasource',
367
367
  title: '数据源',
368
368
  isContainer: !1,
@@ -440,7 +440,6 @@
440
440
  func: {
441
441
  type: 'object',
442
442
  title: '功能设置',
443
- isContainer: !1,
444
443
  properties: {
445
444
  a: {
446
445
  title: '单文本框',
@@ -456,7 +455,6 @@
456
455
  style: {
457
456
  type: 'object',
458
457
  title: '样式设置',
459
- isContainer: !1,
460
458
  properties: {
461
459
  b: {
462
460
  title: '单文本框',
@@ -471,7 +469,6 @@
471
469
  data: {
472
470
  type: 'data',
473
471
  title: '数据设置',
474
- isContainer: !1,
475
472
  properties: {
476
473
  c: {
477
474
  title: '单文本框',
@@ -697,6 +694,37 @@
697
694
  },
698
695
  propertyOrder: ['unit', 'quantity'],
699
696
  },
697
+ 'padding-margin': {
698
+ type: 'padding-margin',
699
+ title: '边距设置',
700
+ isContainer: !1,
701
+ properties: {
702
+ margin: {
703
+ title: '外边距',
704
+ type: 'input',
705
+ default: '0',
706
+ description: '',
707
+ },
708
+ padding: {
709
+ title: '内边距',
710
+ type: 'input',
711
+ default: '0',
712
+ description: '',
713
+ },
714
+ quantity: {
715
+ type: 'select',
716
+ default: 'px',
717
+ options: [
718
+ { label: 'px', value: 'px' },
719
+ { label: 'rem', value: 'rem' },
720
+ { label: 'em', value: 'em' },
721
+ { label: '%', value: '%' },
722
+ ],
723
+ title: '单位类型',
724
+ },
725
+ },
726
+ propertyOrder: ['margin', 'padding', 'quantity'],
727
+ },
700
728
  radio: {
701
729
  type: 'radio',
702
730
  title: '单选',
@@ -824,8 +852,8 @@
824
852
  },
825
853
  propertyOrder: ['type', 'config', 'data', 'localFilter'],
826
854
  },
827
- datasource: g,
828
- event: h,
855
+ datasource: h,
856
+ event: g,
829
857
  'dynamic-config': {
830
858
  type: 'dynamic-config',
831
859
  title: '动态配置',
@@ -1490,9 +1518,9 @@
1490
1518
  },
1491
1519
  propertyOrder: ['type', 'register', 'actionFunc'],
1492
1520
  },
1493
- emit: h,
1521
+ emit: g,
1494
1522
  },
1495
- S = { local: g, remote: j };
1523
+ S = { local: h, remote: j };
1496
1524
  function T(e) {
1497
1525
  return /^http[s]?:\/\/.*/.test(e);
1498
1526
  }
@@ -1511,16 +1539,16 @@
1511
1539
  function R(e) {
1512
1540
  return /^\d{4}-\d{2}-\d{2}$/.test(e);
1513
1541
  }
1514
- function E(e) {
1542
+ function q(e) {
1515
1543
  return (
1516
1544
  /^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/.test(e) ||
1517
1545
  /^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/.test(e)
1518
1546
  );
1519
1547
  }
1520
- function k(e) {
1548
+ function E(e) {
1521
1549
  return /^\d{2}:\d{2}:\d{2}$/.test(e) || /^\d{2}:\d{2}$/.test(e);
1522
1550
  }
1523
- function q(e) {
1551
+ function k(e) {
1524
1552
  var t = !1;
1525
1553
  return (
1526
1554
  'Array' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0),
@@ -1528,7 +1556,7 @@
1528
1556
  );
1529
1557
  }
1530
1558
  function F(e) {
1531
- if (!q(e)) return !1;
1559
+ if (!k(e)) return !1;
1532
1560
  for (var t = 0, r = e.length; t < r; t++) if (!D(e[t])) return !1;
1533
1561
  return !0;
1534
1562
  }
@@ -1564,7 +1592,7 @@
1564
1592
  if (P(e)) {
1565
1593
  var r = Object.keys(e);
1566
1594
  e.data && e.filter && 2 === r.length
1567
- ? (t = q(e.data) || P(e.data) ? o(S.local) : o(S.remote))
1595
+ ? (t = k(e.data) || P(e.data) ? o(S.local) : o(S.remote))
1568
1596
  : e.trigger && e.eventData && 2 === r.length
1569
1597
  ? (t = o(x.emit))
1570
1598
  : e.register && e.actionFunc && 2 === r.length
@@ -1579,10 +1607,10 @@
1579
1607
  }
1580
1608
  return t;
1581
1609
  })(e)
1582
- : e && q(e)
1610
+ : e && k(e)
1583
1611
  ? (function (e) {
1584
1612
  var t;
1585
- if (e && q(e))
1613
+ if (e && k(e))
1586
1614
  if (F(e)) {
1587
1615
  (t = o(C.select)).items.enum = e;
1588
1616
  var r = t.items.enumextra.length,
@@ -1603,8 +1631,8 @@
1603
1631
  else if (N(e)) t = o(C.number);
1604
1632
  else if (T(e)) t = o(C.url);
1605
1633
  else if (R(e)) t = o(C.date);
1606
- else if (E(e)) t = o(C['date-time']);
1607
- else if (k(e)) t = o(C.time);
1634
+ else if (q(e)) t = o(C['date-time']);
1635
+ else if (E(e)) t = o(C.time);
1608
1636
  else if (M(e)) t = o(C.color);
1609
1637
  else
1610
1638
  try {
@@ -1760,6 +1788,7 @@
1760
1788
  array: 'array',
1761
1789
  boolean: 'boolean',
1762
1790
  'box-style': 'object',
1791
+ 'padding-margin': 'object',
1763
1792
  codearea: 'string',
1764
1793
  color: 'string',
1765
1794
  datasource: 'object',
@@ -1900,7 +1929,7 @@
1900
1929
  p(i) &&
1901
1930
  p(e.default) &&
1902
1931
  (typeof i != typeof e.default ||
1903
- ((r = i), (a = e.default), P(r) + '-' + q(r) != P(a) + '-' + q(a))) &&
1932
+ ((r = i), (a = e.default), P(r) + '-' + k(r) != P(a) + '-' + k(a))) &&
1904
1933
  (i = void 0);
1905
1934
  var n = p(i) ? i : e.default;
1906
1935
  switch (e.type) {
@@ -1923,7 +1952,7 @@
1923
1952
  break;
1924
1953
  case 'json':
1925
1954
  var o = '';
1926
- if (P(n) || q(n)) o = n;
1955
+ if (P(n) || k(n)) o = n;
1927
1956
  else if (_(n) || '' === n) o = {};
1928
1957
  else
1929
1958
  try {
@@ -2023,11 +2052,11 @@
2023
2052
  if (e && 'array' === z(e.type)) {
2024
2053
  var a = t;
2025
2054
  p(a) &&
2026
- ((p(e.default) && typeof a != typeof e.default) || !q(a)) &&
2055
+ ((p(e.default) && typeof a != typeof e.default) || !k(a)) &&
2027
2056
  (a = void 0);
2028
2057
  var l = p(a) ? a : e.default;
2029
2058
  if ('array' === z(e.type))
2030
- if (q(l))
2059
+ if (k(l))
2031
2060
  l.map(function (t) {
2032
2061
  r.push(ne(e.items, t));
2033
2062
  });
@@ -2074,7 +2103,7 @@
2074
2103
  ce(e[t], r);
2075
2104
  });
2076
2105
  else
2077
- q(e) &&
2106
+ k(e) &&
2078
2107
  e.map(function (e) {
2079
2108
  ce(e, r);
2080
2109
  });
@@ -2096,15 +2125,15 @@
2096
2125
  ? Object.keys(e).map(function (a) {
2097
2126
  var l = e[a],
2098
2127
  i = t ? t + '-' + a : a;
2099
- P(l) || q(l)
2128
+ P(l) || k(l)
2100
2129
  ? r.push({ title: a, value: i, key: i, children: de(l, i) })
2101
2130
  : r.push({ title: a, value: i, key: i });
2102
2131
  })
2103
- : q(e) &&
2132
+ : k(e) &&
2104
2133
  e.map(function (e, a) {
2105
2134
  var l = a.toString(),
2106
2135
  i = t ? t + '-' + a : l;
2107
- P(e) || q(e)
2136
+ P(e) || k(e)
2108
2137
  ? r.push({ title: l, value: i, key: i, children: de(e, i) })
2109
2138
  : r.push({ title: l, value: i, key: i });
2110
2139
  }),
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * @wibetter/json-utils v5.0.21
2
+ * @wibetter/json-utils v5.1.2
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Tue Dec 31 2024 17:31:46 GMT+0800 (中国标准时间)
5
+ * build time: Fri Jan 10 2025 16:28:49 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wibetter/json-utils",
3
- "version": "5.0.21",
3
+ "version": "5.1.2",
4
4
  "description": "提供JSON相关的各类工具方法,比如schema转json、json转schema、json元数据分析等",
5
5
  "keywords": [
6
6
  "json工具包",