@v2coding/ui 1.1.10 → 1.1.11

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.
@@ -1935,6 +1935,43 @@ const DefaultVType = {
1935
1935
  pattern: /^(?=.*[a-zA-Z])(?=.*\d)[^]{6,20}$/,
1936
1936
  message: message || `请输入6-20位的${label},至少包含字母和字符串`
1937
1937
  };
1938
+ },
1939
+ complexCipher: _ref17 => {
1940
+ return {
1941
+ validator: (rule, value, callback) => {
1942
+ // 检查重复的数字
1943
+ const repeatingRegex = /(\d)\1{5,}/; // 匹配连续重复6次或以上的数字
1944
+ // 检查连续递增的数字
1945
+
1946
+ for (let i = 0; i < value.length - 1; i++) {
1947
+ if (Number(value[i + 1]) - Number(value[i]) === 1) {
1948
+ const sequenceStart = i;
1949
+ let sequenceEnd = i + 1; // 1 < 6 && 2 - 1 === 1
1950
+ // 2 < 6 && 3 - 2 === 1
1951
+ // 3 < 6 && 4 - 3 === 1
1952
+ // .....
1953
+
1954
+ while (sequenceEnd < value.length && Number(value[sequenceEnd]) - Number(value[sequenceEnd - 1]) === 1) {
1955
+ sequenceEnd++;
1956
+ }
1957
+
1958
+ if (sequenceEnd - sequenceStart >= 6) {
1959
+ // 至少需要6个数字才能构成连续序列
1960
+ callback(new Error('不能输入连续的数字'));
1961
+ return;
1962
+ }
1963
+
1964
+ i = sequenceEnd - 1; // 跳过已检查的序列
1965
+ }
1966
+ }
1967
+
1968
+ if (repeatingRegex.test(value)) {
1969
+ callback(new Error('不能连续输入任何一个重复的数字超过6个'));
1970
+ } else {
1971
+ callback();
1972
+ }
1973
+ }
1974
+ };
1938
1975
  }
1939
1976
  };
1940
1977
 
@@ -1946,7 +1983,6 @@ const initDefaultVType = () => {
1946
1983
  };
1947
1984
 
1948
1985
  initDefaultVType();
1949
- var VType$1 = VType;
1950
1986
 
1951
1987
  var FieldMixin = {
1952
1988
  inheritAttrs: false,
@@ -7440,7 +7476,7 @@ var script$g = {
7440
7476
 
7441
7477
  if (typeof vtype === 'string') {
7442
7478
  const [type, ...args] = vtype.split(':');
7443
- rule = VType$1[type](this.$props, ...args);
7479
+ rule = VType[type](this.$props, ...args);
7444
7480
  }
7445
7481
 
7446
7482
  rule && rules.push(rule);
@@ -13098,4 +13134,4 @@ var index = {
13098
13134
  Components: ComponentList
13099
13135
  };
13100
13136
 
13101
- export { arrays as Arrays, Axios, Date$1 as Dates, FieldMixin, Files, mixin as HistoryMixin, Objects, Router, Store, Strings, Upload, addFieldType, index as default, getAMap, onReady };
13137
+ export { arrays as Arrays, Axios, Date$1 as Dates, FieldMixin, Files, mixin as HistoryMixin, Objects, Router, Store, Strings, Upload, addFieldType, addVType, index as default, getAMap, onReady };