rb-document-form-constructor 0.8.72 → 0.8.75

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,5 @@
1
1
  import Vue$1 from 'vue';
2
+ import crypto from 'crypto';
2
3
 
3
4
  const UtFormConfig = {
4
5
  findField(fieldName, formConfig) {
@@ -13164,6 +13165,182 @@ const __vue_component__$5 = /*#__PURE__*/normalizeComponent({
13164
13165
  }, __vue_inject_styles__$4, __vue_script__$4, __vue_scope_id__$4, __vue_is_functional_template__$4, __vue_module_identifier__$4, false, undefined, undefined, undefined);
13165
13166
  var DocTemplateFacetList = __vue_component__$5;
13166
13167
 
13168
+ // Unique ID creation requires a high quality random # generator. In node.js
13169
+ // this is pretty straight-forward - we use the crypto API.
13170
+
13171
+
13172
+
13173
+ var rng = function nodeRNG() {
13174
+ return crypto.randomBytes(16);
13175
+ };
13176
+
13177
+ /**
13178
+ * Convert array of 16 byte values to UUID string format of the form:
13179
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
13180
+ */
13181
+ var byteToHex = [];
13182
+ for (var i = 0; i < 256; ++i) {
13183
+ byteToHex[i] = (i + 0x100).toString(16).substr(1);
13184
+ }
13185
+
13186
+ function bytesToUuid(buf, offset) {
13187
+ var i = offset || 0;
13188
+ var bth = byteToHex;
13189
+ // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
13190
+ return ([
13191
+ bth[buf[i++]], bth[buf[i++]],
13192
+ bth[buf[i++]], bth[buf[i++]], '-',
13193
+ bth[buf[i++]], bth[buf[i++]], '-',
13194
+ bth[buf[i++]], bth[buf[i++]], '-',
13195
+ bth[buf[i++]], bth[buf[i++]], '-',
13196
+ bth[buf[i++]], bth[buf[i++]],
13197
+ bth[buf[i++]], bth[buf[i++]],
13198
+ bth[buf[i++]], bth[buf[i++]]
13199
+ ]).join('');
13200
+ }
13201
+
13202
+ var bytesToUuid_1 = bytesToUuid;
13203
+
13204
+ // **`v1()` - Generate time-based UUID**
13205
+ //
13206
+ // Inspired by https://github.com/LiosK/UUID.js
13207
+ // and http://docs.python.org/library/uuid.html
13208
+
13209
+ var _nodeId;
13210
+ var _clockseq;
13211
+
13212
+ // Previous uuid creation time
13213
+ var _lastMSecs = 0;
13214
+ var _lastNSecs = 0;
13215
+
13216
+ // See https://github.com/uuidjs/uuid for API details
13217
+ function v1(options, buf, offset) {
13218
+ var i = buf && offset || 0;
13219
+ var b = buf || [];
13220
+
13221
+ options = options || {};
13222
+ var node = options.node || _nodeId;
13223
+ var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
13224
+
13225
+ // node and clockseq need to be initialized to random values if they're not
13226
+ // specified. We do this lazily to minimize issues related to insufficient
13227
+ // system entropy. See #189
13228
+ if (node == null || clockseq == null) {
13229
+ var seedBytes = rng();
13230
+ if (node == null) {
13231
+ // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
13232
+ node = _nodeId = [
13233
+ seedBytes[0] | 0x01,
13234
+ seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
13235
+ ];
13236
+ }
13237
+ if (clockseq == null) {
13238
+ // Per 4.2.2, randomize (14 bit) clockseq
13239
+ clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
13240
+ }
13241
+ }
13242
+
13243
+ // UUID timestamps are 100 nano-second units since the Gregorian epoch,
13244
+ // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
13245
+ // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
13246
+ // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
13247
+ var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
13248
+
13249
+ // Per 4.2.1.2, use count of uuid's generated during the current clock
13250
+ // cycle to simulate higher resolution clock
13251
+ var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
13252
+
13253
+ // Time since last uuid creation (in msecs)
13254
+ var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
13255
+
13256
+ // Per 4.2.1.2, Bump clockseq on clock regression
13257
+ if (dt < 0 && options.clockseq === undefined) {
13258
+ clockseq = clockseq + 1 & 0x3fff;
13259
+ }
13260
+
13261
+ // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
13262
+ // time interval
13263
+ if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
13264
+ nsecs = 0;
13265
+ }
13266
+
13267
+ // Per 4.2.1.2 Throw error if too many uuids are requested
13268
+ if (nsecs >= 10000) {
13269
+ throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
13270
+ }
13271
+
13272
+ _lastMSecs = msecs;
13273
+ _lastNSecs = nsecs;
13274
+ _clockseq = clockseq;
13275
+
13276
+ // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
13277
+ msecs += 12219292800000;
13278
+
13279
+ // `time_low`
13280
+ var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
13281
+ b[i++] = tl >>> 24 & 0xff;
13282
+ b[i++] = tl >>> 16 & 0xff;
13283
+ b[i++] = tl >>> 8 & 0xff;
13284
+ b[i++] = tl & 0xff;
13285
+
13286
+ // `time_mid`
13287
+ var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
13288
+ b[i++] = tmh >>> 8 & 0xff;
13289
+ b[i++] = tmh & 0xff;
13290
+
13291
+ // `time_high_and_version`
13292
+ b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
13293
+ b[i++] = tmh >>> 16 & 0xff;
13294
+
13295
+ // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
13296
+ b[i++] = clockseq >>> 8 | 0x80;
13297
+
13298
+ // `clock_seq_low`
13299
+ b[i++] = clockseq & 0xff;
13300
+
13301
+ // `node`
13302
+ for (var n = 0; n < 6; ++n) {
13303
+ b[i + n] = node[n];
13304
+ }
13305
+
13306
+ return buf ? buf : bytesToUuid_1(b);
13307
+ }
13308
+
13309
+ var v1_1 = v1;
13310
+
13311
+ function v4(options, buf, offset) {
13312
+ var i = buf && offset || 0;
13313
+
13314
+ if (typeof(options) == 'string') {
13315
+ buf = options === 'binary' ? new Array(16) : null;
13316
+ options = null;
13317
+ }
13318
+ options = options || {};
13319
+
13320
+ var rnds = options.random || (options.rng || rng)();
13321
+
13322
+ // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
13323
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
13324
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
13325
+
13326
+ // Copy bytes to buffer, if provided
13327
+ if (buf) {
13328
+ for (var ii = 0; ii < 16; ++ii) {
13329
+ buf[i + ii] = rnds[ii];
13330
+ }
13331
+ }
13332
+
13333
+ return buf || bytesToUuid_1(rnds);
13334
+ }
13335
+
13336
+ var v4_1 = v4;
13337
+
13338
+ var uuid = v4_1;
13339
+ uuid.v1 = v1_1;
13340
+ uuid.v4 = v4_1;
13341
+
13342
+ var uuid_1 = uuid;
13343
+
13167
13344
  var toString = Object.prototype.toString;
13168
13345
 
13169
13346
  var _typeof = function(object) {
@@ -13541,21 +13718,6 @@ const __vue_component__$4 = /*#__PURE__*/normalizeComponent({
13541
13718
  }, __vue_inject_styles__$3, __vue_script__$3, __vue_scope_id__$3, __vue_is_functional_template__$3, __vue_module_identifier__$3, false, undefined, undefined, undefined);
13542
13719
  var DocForm = __vue_component__$4;
13543
13720
 
13544
- const generateRandomString = length => {
13545
- let result = '';
13546
- const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
13547
- const charactersLength = characters.length;
13548
- for (let i = 0; i < length; i++) {
13549
- result += characters.charAt(Math.floor(Math.random() * charactersLength));
13550
- }
13551
- return result;
13552
- };
13553
- const UtRandom = {
13554
- getRandomString(length) {
13555
- return generateRandomString(length);
13556
- }
13557
- };
13558
-
13559
13721
  //
13560
13722
  var script$2 = {
13561
13723
  name: 'FieldRuleFormModal',
@@ -13648,7 +13810,7 @@ var script$2 = {
13648
13810
  },
13649
13811
  getDefaultRule() {
13650
13812
  return {
13651
- id: UtRandom.getRandomString(10),
13813
+ id: uuid_1.v4(),
13652
13814
  name: null,
13653
13815
  event: null,
13654
13816
  script: null
@@ -14011,7 +14173,7 @@ var script$1 = {
14011
14173
  rule: {},
14012
14174
  mode: 'ins'
14013
14175
  },
14014
- rulesHash: UtRandom.getRandomString(10)
14176
+ rulesHash: uuid_1.v4()
14015
14177
  };
14016
14178
  },
14017
14179
  computed: {
@@ -14103,7 +14265,7 @@ var script$1 = {
14103
14265
  this.field.rules.push({
14104
14266
  ...rule
14105
14267
  });
14106
- this.rulesHash = UtRandom.getRandomString(10);
14268
+ this.rulesHash = uuid_1.v4();
14107
14269
  }
14108
14270
  };
14109
14271
  this.$bvModal.show(this.modalId);
@@ -14128,7 +14290,7 @@ var script$1 = {
14128
14290
  if (index >= 0) {
14129
14291
  this.field.rules.splice(index, 1);
14130
14292
  }
14131
- this.rulesHash = UtRandom.getRandomString(10);
14293
+ this.rulesHash = uuid_1.v4();
14132
14294
  }
14133
14295
  },
14134
14296
  created() {