@ldmjs/ui 1.0.27 → 1.0.29

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.d.ts CHANGED
@@ -174,3 +174,26 @@ export {
174
174
  export {
175
175
  IPagerOptions
176
176
  } from './types/pager';
177
+ export {
178
+ ValidateFunction
179
+ } from './types/validation';
180
+ export {
181
+ validators
182
+ } from './types/validators';
183
+ export {
184
+ requiredRule,
185
+ maxLengthRule,
186
+ alphaRule,
187
+ alphaNumRule,
188
+ betweenRule,
189
+ decimalRule,
190
+ emailRule,
191
+ integerRule,
192
+ ipAddressRule,
193
+ macAddressRule,
194
+ maxValueRule,
195
+ minValueRule,
196
+ numericRule,
197
+ urlRule,
198
+ phoneRule,
199
+ } from './types/validators';
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  (function webpackUniversalModuleDefinition(root, factory) {
2
2
  if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("./calendar.js"), require("./floating.js"), require("./imask.js"), require("./multiselect.js"), require("./runtime-template.js"), require("@vuelidate/validators"), require("markdown-it"), require("md-editor-v3"), require("vue"), require("vue-class-component"), require("vue-property-decorator"), require("vue-toastification"));
3
+ module.exports = factory(require("./lib/calendar.js"), require("./lib/floating.js"), require("./lib/imask.js"), require("./lib/multiselect.js"), require("./lib/runtime-template.js"), require("./utils/validators.js"), require("markdown-it"), require("md-editor-v3"), require("vue"), require("vue-class-component"), require("vue-property-decorator"), require("vue-toastification"));
4
4
  else if(typeof define === 'function' && define.amd)
5
- define(["./calendar.js", "./floating.js", "./imask.js", "./multiselect.js", "./runtime-template.js", "@vuelidate/validators", "markdown-it", "md-editor-v3", "vue", "vue-class-component", "vue-property-decorator", "vue-toastification"], factory);
5
+ define(["./lib/calendar.js", "./lib/floating.js", "./lib/imask.js", "./lib/multiselect.js", "./lib/runtime-template.js", "./utils/validators.js", "markdown-it", "md-editor-v3", "vue", "vue-class-component", "vue-property-decorator", "vue-toastification"], factory);
6
6
  else if(typeof exports === 'object')
7
- exports["ldmui"] = factory(require("./calendar.js"), require("./floating.js"), require("./imask.js"), require("./multiselect.js"), require("./runtime-template.js"), require("@vuelidate/validators"), require("markdown-it"), require("md-editor-v3"), require("vue"), require("vue-class-component"), require("vue-property-decorator"), require("vue-toastification"));
7
+ exports["ldmui"] = factory(require("./lib/calendar.js"), require("./lib/floating.js"), require("./lib/imask.js"), require("./lib/multiselect.js"), require("./lib/runtime-template.js"), require("./utils/validators.js"), require("markdown-it"), require("md-editor-v3"), require("vue"), require("vue-class-component"), require("vue-property-decorator"), require("vue-toastification"));
8
8
  else
9
- root["ldmui"] = factory(root["./calendar.js"], root["./floating.js"], root["./imask.js"], root["./multiselect.js"], root["./runtime-template.js"], root["@vuelidate/validators"], root["markdown-it"], root["md-editor-v3"], root["vue"], root["vue-class-component"], root["vue-property-decorator"], root["vue-toastification"]);
10
- })(self, (__WEBPACK_EXTERNAL_MODULE__4634__, __WEBPACK_EXTERNAL_MODULE__3654__, __WEBPACK_EXTERNAL_MODULE__6135__, __WEBPACK_EXTERNAL_MODULE__9225__, __WEBPACK_EXTERNAL_MODULE__119__, __WEBPACK_EXTERNAL_MODULE__887__, __WEBPACK_EXTERNAL_MODULE__8461__, __WEBPACK_EXTERNAL_MODULE__6443__, __WEBPACK_EXTERNAL_MODULE__2380__, __WEBPACK_EXTERNAL_MODULE__9299__, __WEBPACK_EXTERNAL_MODULE__5070__, __WEBPACK_EXTERNAL_MODULE__7982__) => {
9
+ root["ldmui"] = factory(root["./lib/calendar.js"], root["./lib/floating.js"], root["./lib/imask.js"], root["./lib/multiselect.js"], root["./lib/runtime-template.js"], root["./utils/validators.js"], root["markdown-it"], root["md-editor-v3"], root["vue"], root["vue-class-component"], root["vue-property-decorator"], root["vue-toastification"]);
10
+ })(self, (__WEBPACK_EXTERNAL_MODULE__8766__, __WEBPACK_EXTERNAL_MODULE__9018__, __WEBPACK_EXTERNAL_MODULE__6203__, __WEBPACK_EXTERNAL_MODULE__5733__, __WEBPACK_EXTERNAL_MODULE__9435__, __WEBPACK_EXTERNAL_MODULE__9119__, __WEBPACK_EXTERNAL_MODULE__8461__, __WEBPACK_EXTERNAL_MODULE__6443__, __WEBPACK_EXTERNAL_MODULE__2380__, __WEBPACK_EXTERNAL_MODULE__9299__, __WEBPACK_EXTERNAL_MODULE__5070__, __WEBPACK_EXTERNAL_MODULE__7982__) => {
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ var __webpack_modules__ = ({
13
13
 
@@ -38,51 +38,51 @@ exports.A = (sfc, props) => {
38
38
 
39
39
  /***/ }),
40
40
 
41
- /***/ 4634:
41
+ /***/ 8766:
42
42
  /***/ ((module) => {
43
43
 
44
44
  "use strict";
45
- module.exports = __WEBPACK_EXTERNAL_MODULE__4634__;
45
+ module.exports = __WEBPACK_EXTERNAL_MODULE__8766__;
46
46
 
47
47
  /***/ }),
48
48
 
49
- /***/ 3654:
49
+ /***/ 9018:
50
50
  /***/ ((module) => {
51
51
 
52
52
  "use strict";
53
- module.exports = __WEBPACK_EXTERNAL_MODULE__3654__;
53
+ module.exports = __WEBPACK_EXTERNAL_MODULE__9018__;
54
54
 
55
55
  /***/ }),
56
56
 
57
- /***/ 6135:
57
+ /***/ 6203:
58
58
  /***/ ((module) => {
59
59
 
60
60
  "use strict";
61
- module.exports = __WEBPACK_EXTERNAL_MODULE__6135__;
61
+ module.exports = __WEBPACK_EXTERNAL_MODULE__6203__;
62
62
 
63
63
  /***/ }),
64
64
 
65
- /***/ 9225:
65
+ /***/ 5733:
66
66
  /***/ ((module) => {
67
67
 
68
68
  "use strict";
69
- module.exports = __WEBPACK_EXTERNAL_MODULE__9225__;
69
+ module.exports = __WEBPACK_EXTERNAL_MODULE__5733__;
70
70
 
71
71
  /***/ }),
72
72
 
73
- /***/ 119:
73
+ /***/ 9435:
74
74
  /***/ ((module) => {
75
75
 
76
76
  "use strict";
77
- module.exports = __WEBPACK_EXTERNAL_MODULE__119__;
77
+ module.exports = __WEBPACK_EXTERNAL_MODULE__9435__;
78
78
 
79
79
  /***/ }),
80
80
 
81
- /***/ 887:
81
+ /***/ 9119:
82
82
  /***/ ((module) => {
83
83
 
84
84
  "use strict";
85
- module.exports = __WEBPACK_EXTERNAL_MODULE__887__;
85
+ module.exports = __WEBPACK_EXTERNAL_MODULE__9119__;
86
86
 
87
87
  /***/ }),
88
88
 
@@ -253,25 +253,41 @@ __webpack_require__.d(__webpack_exports__, {
253
253
  Uint8ArrayToHex: () => (/* reexport */ Uint8ArrayToHex),
254
254
  ValidateMixin: () => (/* reexport */ ValidateMixin),
255
255
  ValidateMixinOptions: () => (/* reexport */ ValidateMixinOptions),
256
+ alphaNumRule: () => (/* reexport */ validators_js_.alphaNumRule),
257
+ alphaRule: () => (/* reexport */ validators_js_.alphaRule),
256
258
  awaiting: () => (/* reexport */ awaiting),
257
259
  base64: () => (/* reexport */ base64),
258
260
  base64ToUint8Array: () => (/* reexport */ base64ToUint8Array),
261
+ betweenRule: () => (/* reexport */ validators_js_.betweenRule),
259
262
  cookie: () => (/* reexport */ cookie),
263
+ decimalRule: () => (/* reexport */ validators_js_.decimalRule),
260
264
  deepValueGetter: () => (/* reexport */ deepValueGetter),
261
265
  "default": () => (/* binding */ src),
262
266
  defaults: () => (/* reexport */ defaults),
263
267
  delay: () => (/* reexport */ delay),
268
+ emailRule: () => (/* reexport */ validators_js_.emailRule),
264
269
  fileToArrayBuffer: () => (/* reexport */ fileToArrayBuffer),
265
270
  fileToBase64: () => (/* reexport */ fileToBase64),
266
271
  getAliases: () => (/* reexport */ getAliases),
267
272
  hexToArrayBuffer: () => (/* reexport */ hexToArrayBuffer),
273
+ integerRule: () => (/* reexport */ validators_js_.integerRule),
274
+ ipAddressRule: () => (/* reexport */ validators_js_.ipAddressRule),
268
275
  isDefined: () => (/* reexport */ isDefined),
269
276
  isObjectEmpty: () => (/* reexport */ isObjectEmpty),
277
+ macAddressRule: () => (/* reexport */ validators_js_.macAddressRule),
278
+ maxLengthRule: () => (/* reexport */ validators_js_.maxLengthRule),
279
+ maxValueRule: () => (/* reexport */ validators_js_.maxValueRule),
280
+ minValueRule: () => (/* reexport */ validators_js_.minValueRule),
281
+ numericRule: () => (/* reexport */ validators_js_.numericRule),
282
+ phoneRule: () => (/* reexport */ validators_js_.phoneRule),
270
283
  pluralizeNoun: () => (/* reexport */ pluralizeNoun),
284
+ requiredRule: () => (/* reexport */ validators_js_.requiredRule),
271
285
  strings: () => (/* reexport */ strings),
272
286
  uidGen: () => (/* reexport */ uidGen),
273
287
  uint8ArrayToBase64: () => (/* reexport */ uint8ArrayToBase64),
274
- urlRegexp: () => (/* reexport */ urlRegexp)
288
+ urlRegexp: () => (/* reexport */ urlRegexp),
289
+ urlRule: () => (/* reexport */ validators_js_.urlRule),
290
+ validators: () => (/* reexport */ validators_js_.validators)
275
291
  });
276
292
 
277
293
  // NAMESPACE OBJECT: ./src/utils/index.ts
@@ -622,9 +638,9 @@ function ld_loader_reg(vue, options) {
622
638
  }
623
639
  /* harmony default export */ const src_ld_loader = (ld_loader_reg);
624
640
 
625
- ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-chip/ld-chip.vue?vue&type=template&id=4722b6ca&ts=true
641
+ ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-chip/ld-chip.vue?vue&type=template&id=153bb3e8&ts=true
626
642
 
627
- const ld_chipvue_type_template_id_4722b6ca_ts_true_hoisted_1 = /*#__PURE__*/ (0,external_vue_.createElementVNode)("svg", {
643
+ const ld_chipvue_type_template_id_153bb3e8_ts_true_hoisted_1 = /*#__PURE__*/ (0,external_vue_.createElementVNode)("svg", {
628
644
  width: "18",
629
645
  height: "18",
630
646
  viewBox: "0 0 18 18",
@@ -657,7 +673,7 @@ const ld_chipvue_type_template_id_4722b6ca_ts_true_hoisted_1 = /*#__PURE__*/ (0,
657
673
  transform: "matrix(-0.70710678,0.70710678,0.70710678,0.70710678,0,0)"
658
674
  })
659
675
  ], -1);
660
- function ld_chipvue_type_template_id_4722b6ca_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
676
+ function ld_chipvue_type_template_id_153bb3e8_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
661
677
  const _component_v_btn = (0,external_vue_.resolveComponent)("v-btn");
662
678
  const _component_v_chip = (0,external_vue_.resolveComponent)("v-chip");
663
679
  return ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_chip, {
@@ -675,10 +691,10 @@ function ld_chipvue_type_template_id_4722b6ca_ts_true_render(_ctx, _cache, $prop
675
691
  icon: "",
676
692
  width: "18",
677
693
  height: "18",
678
- onClick: _cache[0] || (_cache[0] = ($event) => (_ctx.$emit('click:close')))
694
+ onClick: _cache[0] || (_cache[0] = (0,external_vue_.withModifiers)(($event) => (_ctx.$emit('click:close')), ["stop"]))
679
695
  }, {
680
696
  default: (0,external_vue_.withCtx)(() => [
681
- ld_chipvue_type_template_id_4722b6ca_ts_true_hoisted_1
697
+ ld_chipvue_type_template_id_153bb3e8_ts_true_hoisted_1
682
698
  ]),
683
699
  _: 1
684
700
  }))
@@ -692,7 +708,7 @@ function ld_chipvue_type_template_id_4722b6ca_ts_true_render(_ctx, _cache, $prop
692
708
  }, 8, ["color"]));
693
709
  }
694
710
 
695
- ;// CONCATENATED MODULE: ./src/ld-chip/ld-chip.vue?vue&type=template&id=4722b6ca&ts=true
711
+ ;// CONCATENATED MODULE: ./src/ld-chip/ld-chip.vue?vue&type=template&id=153bb3e8&ts=true
696
712
 
697
713
  ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-chip/ld-chip.ts?vue&type=script&lang=ts&external
698
714
  var ld_chipvue_type_script_lang_ts_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -735,7 +751,7 @@ ChipComponent = ld_chipvue_type_script_lang_ts_external_decorate([
735
751
 
736
752
 
737
753
  ;
738
- const ld_chip_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_chipvue_type_script_lang_ts_external, [['render',ld_chipvue_type_template_id_4722b6ca_ts_true_render]])
754
+ const ld_chip_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_chipvue_type_script_lang_ts_external, [['render',ld_chipvue_type_template_id_153bb3e8_ts_true_render]])
739
755
 
740
756
  /* harmony default export */ const ld_chip = (ld_chip_exports_);
741
757
  ;// CONCATENATED MODULE: ./src/ld-chip/index.ts
@@ -2595,155 +2611,8 @@ function uidGen(len = 6, format) {
2595
2611
  return result;
2596
2612
  }
2597
2613
 
2598
- // EXTERNAL MODULE: external "@vuelidate/validators"
2599
- var validators_ = __webpack_require__(887);
2600
- ;// CONCATENATED MODULE: ./src/mixins/validators.ts
2601
-
2602
- /** requiredRule(name?: string) - Обязательность заполнения поля */
2603
- const requiredRule = (name) => value => {
2604
- // eslint-disable-next-line eqeqeq
2605
- if (value == null || (typeof value === 'string' && value === '')) {
2606
- return name ? `Поле ${name} обязательно` : 'Это поле обязательно';
2607
- }
2608
- const valid = validators_.required.$validator(value, null, null);
2609
- if (typeof valid === 'boolean' && valid) {
2610
- return true;
2611
- }
2612
- return name ? `Поле ${name} обязательно` : 'Это поле обязательно';
2613
- };
2614
- /** maxLengthRule(max: number) - Значение должно быть меньше ${max} символов */
2615
- const maxLengthRule = (max) => value => {
2616
- const valid = (0,validators_.maxLength)(max).$validator(value, null, null);
2617
- if (typeof valid === 'boolean' && valid) {
2618
- return true;
2619
- }
2620
- return `Значение должно быть меньше ${max} символов`;
2621
- };
2622
- /** alphaRule() - Разрешены только буквы */
2623
- const alphaRule = () => value => {
2624
- const valid = validators_.alpha.$validator(value, null, null);
2625
- if (typeof valid === 'boolean' && valid) {
2626
- return true;
2627
- }
2628
- return 'Разрешены только латинские буквы';
2629
- };
2630
- /** alphaNumRule() - Разрешены только буквы и цифры */
2631
- const alphaNumRule = () => value => {
2632
- const valid = validators_.alphaNum.$validator(value, null, null);
2633
- if (typeof valid === 'boolean' && valid) {
2634
- return true;
2635
- }
2636
- return 'Разрешены только латинские буквы и цифры';
2637
- };
2638
- /** andRule(..._validators: Array<() => {}>) - Добавление дополнительных валидаторов */
2639
- // export const andRule =
2640
- // (..._validators: Array<ValidationRule>): ValidateFunction =>
2641
- // value =>
2642
- // and(_validators) ? 'Ошибка' : true;
2643
- /** betweenRule(min: number, max: number) - допустимы значения в диапазоне от ${min} до ${max} */
2644
- const betweenRule = (min, max) => value => {
2645
- const valid = (0,validators_.between)(min, max).$validator(value, null, null);
2646
- if (typeof valid === 'boolean' && valid) {
2647
- return true;
2648
- }
2649
- return `Значение должно быть в диапазоне от ${min} до ${max}`;
2650
- };
2651
- /** decimalRule() - Значение должно быть целым или дробным числом */
2652
- const decimalRule = () => value => {
2653
- const valid = validators_.decimal.$validator(value, null, null);
2654
- if (typeof valid === 'boolean' && valid) {
2655
- return true;
2656
- }
2657
- return 'Значение должно быть целым или дробным числом';
2658
- };
2659
- /** emailRule() - только эл. почта */
2660
- const emailRule = () => value => {
2661
- const valid = validators_.email.$validator(value, null, null);
2662
- if (typeof valid === 'boolean' && valid) {
2663
- return true;
2664
- }
2665
- return 'Неверный формат адреса эл.почты';
2666
- };
2667
- /** integerRule() - Значение должно быть целым числом */
2668
- const integerRule = () => value => {
2669
- const valid = validators_.integer.$validator(value, null, null);
2670
- if (typeof valid === 'boolean' && valid) {
2671
- return true;
2672
- }
2673
- return 'Значение должно быть целым числом';
2674
- };
2675
- /** ipAddressRule() - Неправильный формат IP-адреса */
2676
- const ipAddressRule = () => value => {
2677
- const valid = validators_.ipAddress.$validator(value, null, null);
2678
- if (typeof valid === 'boolean' && valid) {
2679
- return true;
2680
- }
2681
- return 'Неправильный формат IP-адреса';
2682
- };
2683
- /** macAddressRule() - Неправильный формат mac-адреса */
2684
- const macAddressRule = () => value => {
2685
- const valid = (0,validators_.macAddress)(':').$validator(value, null, null);
2686
- if (typeof valid === 'boolean' && valid) {
2687
- return true;
2688
- }
2689
- return 'Неправильный формат mac-адреса';
2690
- };
2691
- /** maxValueRule(max: number) - Значение должно быть меньше ${max} */
2692
- const maxValueRule = (max) => value => {
2693
- const valid = (0,validators_.maxValue)(max).$validator(value, null, null);
2694
- if (typeof valid === 'boolean' && valid) {
2695
- return true;
2696
- }
2697
- return `Значение должно быть меньше ${max}`;
2698
- };
2699
- /** minValueRule(min: number) - Значение должно быть больше ${min} */
2700
- const minValueRule = (min) => value => {
2701
- const valid = (0,validators_.minValue)(min).$validator(value, null, null);
2702
- if (typeof valid === 'boolean' && valid) {
2703
- return true;
2704
- }
2705
- return `Значение должно быть больше ${min}`;
2706
- };
2707
- /** numericRule() - Разрешены только цифры */
2708
- const numericRule = () => value => {
2709
- const valid = validators_.numeric.$validator(value, null, null);
2710
- if (typeof valid === 'boolean' && valid) {
2711
- return true;
2712
- }
2713
- return 'Разрешены только цифры';
2714
- };
2715
- /** urlRule() - Неправильный формат URI */
2716
- const urlRule = () => value => {
2717
- const valid = validators_.url.$validator(value, null, null);
2718
- if (typeof valid === 'boolean' && valid) {
2719
- return true;
2720
- }
2721
- return 'Неправильный формат URI';
2722
- };
2723
- /** phoneRule() - Неправильный формат телефона */
2724
- const phoneRule = () => value => {
2725
- const pattern = /^[\d()+-]+$/;
2726
- return pattern.test(value) || 'Неправильный формат телефона';
2727
- };
2728
- const validators = {
2729
- requiredRule,
2730
- maxLengthRule,
2731
- alphaRule,
2732
- alphaNumRule,
2733
- betweenRule,
2734
- decimalRule,
2735
- emailRule,
2736
- integerRule,
2737
- ipAddressRule,
2738
- macAddressRule,
2739
- maxValueRule,
2740
- minValueRule,
2741
- numericRule,
2742
- urlRule,
2743
- phoneRule,
2744
- };
2745
- /* harmony default export */ const mixins_validators = ({});
2746
-
2614
+ // EXTERNAL MODULE: external "./utils/validators.js"
2615
+ var validators_js_ = __webpack_require__(9119);
2747
2616
  ;// CONCATENATED MODULE: ./src/mixins/validatable.mixin.ts
2748
2617
  var validatable_mixin_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2749
2618
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -2774,7 +2643,7 @@ class ValidatableMixin extends external_vue_property_decorator_.Vue {
2774
2643
  }
2775
2644
  }
2776
2645
  get validRules() {
2777
- return this.required ? [requiredRule()].concat(this.myRules) : this.myRules;
2646
+ return this.required ? [(0,validators_js_.requiredRule)()].concat(this.myRules) : this.myRules;
2778
2647
  }
2779
2648
  get showError() {
2780
2649
  return this.validRules.length ? Boolean(this.validationMessage) : false;
@@ -2799,8 +2668,8 @@ validatable_mixin_decorate([
2799
2668
  validatable_mixin_metadata("design:returntype", void 0)
2800
2669
  ], ValidatableMixin.prototype, "onRulesChanged", null);
2801
2670
 
2802
- // EXTERNAL MODULE: external "./imask.js"
2803
- var external_imask_js_ = __webpack_require__(6135);
2671
+ // EXTERNAL MODULE: external "./lib/imask.js"
2672
+ var imask_js_ = __webpack_require__(6203);
2804
2673
  ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-edit-text/ld-edit-text.ts?vue&type=script&lang=ts&external
2805
2674
  var ld_edit_textvue_type_script_lang_ts_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2806
2675
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -3161,7 +3030,7 @@ ld_edit_textvue_type_script_lang_ts_external_decorate([
3161
3030
  EditTextComponent = ld_edit_textvue_type_script_lang_ts_external_decorate([
3162
3031
  (0,external_vue_property_decorator_.Options)({
3163
3032
  components: {
3164
- 'imask-input': external_imask_js_.IMaskComponent,
3033
+ 'imask-input': imask_js_.IMaskComponent,
3165
3034
  'ld-label': ld_label
3166
3035
  },
3167
3036
  })
@@ -7378,9 +7247,9 @@ try {
7378
7247
 
7379
7248
 
7380
7249
 
7381
- // EXTERNAL MODULE: external "./calendar.js"
7382
- var external_calendar_js_ = __webpack_require__(4634);
7383
- var external_calendar_js_default = /*#__PURE__*/__webpack_require__.n(external_calendar_js_);
7250
+ // EXTERNAL MODULE: external "./lib/calendar.js"
7251
+ var calendar_js_ = __webpack_require__(8766);
7252
+ var calendar_js_default = /*#__PURE__*/__webpack_require__.n(calendar_js_);
7384
7253
  ;// CONCATENATED MODULE: ./src/utils/datetime.ts
7385
7254
  function dateLocalToISO(value) {
7386
7255
  const parsed = /^(\d\d?).(\d\d?).(\d\d\d?\d?)$/.exec(value);
@@ -8104,7 +7973,7 @@ DatepickerComponent = ld_datepickervue_type_script_lang_js_external_decorate([
8104
7973
  (0,external_vue_class_component_.Options)({
8105
7974
  components: {
8106
7975
  'ld-label': ld_label,
8107
- 'datepicker': (external_calendar_js_default())
7976
+ 'datepicker': (calendar_js_default())
8108
7977
  },
8109
7978
  })
8110
7979
  ], DatepickerComponent);
@@ -8929,11 +8798,11 @@ function ld_select_list_boxvue_type_template_id_0b117ea1_scoped_true_ts_true_ren
8929
8798
 
8930
8799
  ;// CONCATENATED MODULE: ./src/ld-select-list-box/ld-select-list-box.vue?vue&type=template&id=0b117ea1&scoped=true&ts=true
8931
8800
 
8932
- // EXTERNAL MODULE: external "./multiselect.js"
8933
- var external_multiselect_js_ = __webpack_require__(9225);
8934
- var external_multiselect_js_default = /*#__PURE__*/__webpack_require__.n(external_multiselect_js_);
8935
- // EXTERNAL MODULE: external "./floating.js"
8936
- var external_floating_js_ = __webpack_require__(3654);
8801
+ // EXTERNAL MODULE: external "./lib/multiselect.js"
8802
+ var multiselect_js_ = __webpack_require__(5733);
8803
+ var multiselect_js_default = /*#__PURE__*/__webpack_require__.n(multiselect_js_);
8804
+ // EXTERNAL MODULE: external "./lib/floating.js"
8805
+ var floating_js_ = __webpack_require__(9018);
8937
8806
  ;// CONCATENATED MODULE: ./src/mixins/floatingUI.mixin.ts
8938
8807
 
8939
8808
 
@@ -8950,11 +8819,11 @@ class FloatingUI extends external_vue_class_component_.Vue {
8950
8819
  if (!dropdownEl || !referenceEl || !window.ResizeObserver) {
8951
8820
  return;
8952
8821
  }
8953
- FloatingUI.CleanupPosWatcher = (0,external_floating_js_.autoUpdate)(referenceEl, dropdownEl, async () => {
8954
- const { y, strategy } = await (0,external_floating_js_.computePosition)(referenceEl, dropdownEl, {
8822
+ FloatingUI.CleanupPosWatcher = (0,floating_js_.autoUpdate)(referenceEl, dropdownEl, async () => {
8823
+ const { y, strategy } = await (0,floating_js_.computePosition)(referenceEl, dropdownEl, {
8955
8824
  strategy: 'fixed',
8956
8825
  middleware: [
8957
- (0,external_floating_js_.autoPlacement)({
8826
+ (0,floating_js_.autoPlacement)({
8958
8827
  allowedPlacements: ['top', 'bottom'],
8959
8828
  }),
8960
8829
  ],
@@ -11415,7 +11284,7 @@ let SelectListBoxComponent = class SelectListBoxComponent extends (0,external_vu
11415
11284
  this.validationMessage = '';
11416
11285
  let funcResult = true;
11417
11286
  if (this.required) {
11418
- funcResult = requiredRule()(this.selectedToArray);
11287
+ funcResult = (0,validators_js_.requiredRule)()(this.selectedToArray);
11419
11288
  if (funcResult !== true) {
11420
11289
  this.validationMessage = this.messagesBucket.validation || funcResult;
11421
11290
  return false;
@@ -11644,7 +11513,7 @@ SelectListBoxComponent = ld_select_list_boxvue_type_script_lang_ts_external_deco
11644
11513
  (0,external_vue_property_decorator_.Options)({
11645
11514
  components: {
11646
11515
  'ld-label': ld_label,
11647
- 'multiselect': (external_multiselect_js_default()),
11516
+ 'multiselect': (multiselect_js_default()),
11648
11517
  },
11649
11518
  })
11650
11519
  ], SelectListBoxComponent);
@@ -12323,7 +12192,7 @@ let RadioGroupComponent = class RadioGroupComponent extends (0,external_vue_clas
12323
12192
  }
12324
12193
  validate() {
12325
12194
  this.validationMessage = '';
12326
- const validationResult = requiredRule()(String(this.modelValue));
12195
+ const validationResult = (0,validators_js_.requiredRule)()(String(this.modelValue));
12327
12196
  if (validationResult !== true) {
12328
12197
  this.validationMessage = validationResult;
12329
12198
  }
@@ -13440,7 +13309,7 @@ let ld_comboboxvue_type_script_lang_ts_external_SelectListBoxComponent = class S
13440
13309
  this.validationMessage = '';
13441
13310
  let funcResult = true;
13442
13311
  if (this.required) {
13443
- funcResult = requiredRule()(this.selectedToArray);
13312
+ funcResult = (0,validators_js_.requiredRule)()(this.selectedToArray);
13444
13313
  if (funcResult !== true) {
13445
13314
  this.validationMessage = this.messagesBucket.validation || funcResult;
13446
13315
  return false;
@@ -13729,7 +13598,7 @@ ld_comboboxvue_type_script_lang_ts_external_SelectListBoxComponent = ld_combobox
13729
13598
  (0,external_vue_property_decorator_.Options)({
13730
13599
  components: {
13731
13600
  'ld-label': ld_label,
13732
- 'multiselect': (external_multiselect_js_default()),
13601
+ 'multiselect': (multiselect_js_default()),
13733
13602
  },
13734
13603
  })
13735
13604
  ], ld_comboboxvue_type_script_lang_ts_external_SelectListBoxComponent);
@@ -14530,7 +14399,7 @@ EditMaskedTextComponent = ld_edit_masked_textvue_type_script_lang_js_external_de
14530
14399
  (0,external_vue_property_decorator_.Options)({
14531
14400
  components: {
14532
14401
  'ld-label': ld_label,
14533
- 'imask-input': external_imask_js_.IMaskComponent,
14402
+ 'imask-input': imask_js_.IMaskComponent,
14534
14403
  },
14535
14404
  })
14536
14405
  ], EditMaskedTextComponent);
@@ -14775,9 +14644,9 @@ const ru_RU = {
14775
14644
  };
14776
14645
  /* harmony default export */ const translation = (ru_RU);
14777
14646
 
14778
- // EXTERNAL MODULE: external "./runtime-template.js"
14779
- var external_runtime_template_js_ = __webpack_require__(119);
14780
- var external_runtime_template_js_default = /*#__PURE__*/__webpack_require__.n(external_runtime_template_js_);
14647
+ // EXTERNAL MODULE: external "./lib/runtime-template.js"
14648
+ var runtime_template_js_ = __webpack_require__(9435);
14649
+ var runtime_template_js_default = /*#__PURE__*/__webpack_require__.n(runtime_template_js_);
14781
14650
  // EXTERNAL MODULE: external "md-editor-v3"
14782
14651
  var external_md_editor_v3_ = __webpack_require__(6443);
14783
14652
  ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-text-markup/ld-text-markup.ts?vue&type=script&lang=js&external
@@ -14993,7 +14862,7 @@ TextMarkupComponent = ld_text_markupvue_type_script_lang_js_external_decorate([
14993
14862
  (0,external_vue_property_decorator_.Options)({
14994
14863
  components: {
14995
14864
  'ld-label': ld_label,
14996
- 'v-runtime-template': (external_runtime_template_js_default()),
14865
+ 'v-runtime-template': (runtime_template_js_default()),
14997
14866
  'md-editor': external_md_editor_v3_.MdEditor,
14998
14867
  },
14999
14868
  })
@@ -19219,6 +19088,8 @@ const ldmuiPlugin = {
19219
19088
 
19220
19089
 
19221
19090
 
19091
+
19092
+
19222
19093
 
19223
19094
  })();
19224
19095
 
@@ -0,0 +1,67 @@
1
+ /* eslint-disable no-nested-ternary */
2
+ import { ValidateFunction } from './validation';
3
+ import {
4
+ alpha,
5
+ alphaNum,
6
+ between,
7
+ decimal,
8
+ email,
9
+ integer,
10
+ ipAddress,
11
+ macAddress,
12
+ maxLength,
13
+ maxValue,
14
+ minValue,
15
+ numeric,
16
+ required,
17
+ url,
18
+ } from '@vuelidate/validators';
19
+
20
+ /** requiredRule(name?: string) - Обязательность заполнения поля */
21
+ export const requiredRule: (name?: string) => ValidateFunction;
22
+ /** maxLengthRule(max: number) - Значение должно быть меньше ${max} символов */
23
+ export const maxLengthRule: (max: number) => ValidateFunction;
24
+ /** alphaRule() - Разрешены только буквы */
25
+ export const alphaRule: () => ValidateFunction;
26
+ /** alphaNumRule() - Разрешены только буквы и цифры */
27
+ export const alphaNumRule: () => ValidateFunction;
28
+ /** betweenRule(min: number, max: number) - допустимы значения в диапазоне от ${min} до ${max} */
29
+ export const betweenRule: (min: number, max: number) => ValidateFunction;
30
+ /** decimalRule() - Значение должно быть целым или дробным числом */
31
+ export const decimalRule: () => ValidateFunction;
32
+ /** emailRule() - только эл. почта */
33
+ export const emailRule: () => ValidateFunction;
34
+ /** integerRule() - Значение должно быть целым числом */
35
+ export const integerRule: () => ValidateFunction;
36
+ /** ipAddressRule() - Неправильный формат IP-адреса */
37
+ export const ipAddressRule: () => ValidateFunction;
38
+ /** macAddressRule() - Неправильный формат mac-адреса */
39
+ export const macAddressRule: () => ValidateFunction;
40
+ /** maxValueRule(max: number) - Значение должно быть меньше ${max} */
41
+ export const maxValueRule: (max: number) => ValidateFunction;
42
+ /** minValueRule(min: number) - Значение должно быть больше ${min} */
43
+ export const minValueRule: (min: number) => ValidateFunction;
44
+ /** numericRule() - Разрешены только цифры */
45
+ export const numericRule: () => ValidateFunction;
46
+ /** urlRule() - Неправильный формат URI */
47
+ export const urlRule: () => ValidateFunction;
48
+ /** phoneRule() - Неправильный формат телефона */
49
+ export const phoneRule: () => ValidateFunction;
50
+
51
+ export const validators = {
52
+ requiredRule,
53
+ maxLengthRule,
54
+ alphaRule,
55
+ alphaNumRule,
56
+ betweenRule,
57
+ decimalRule,
58
+ emailRule,
59
+ integerRule,
60
+ ipAddressRule,
61
+ macAddressRule,
62
+ maxValueRule,
63
+ minValueRule,
64
+ numericRule,
65
+ urlRule,
66
+ phoneRule,
67
+ };
@@ -0,0 +1 @@
1
+ (function webpackUniversalModuleDefinition(e,l){"object"===typeof exports&&"object"===typeof module?module.exports=l(require("@vuelidate/validators")):"function"===typeof define&&define.amd?define(["@vuelidate/validators"],l):"object"===typeof exports?exports["ldmui"]=l(require("@vuelidate/validators")):e["ldmui"]=l(e["@vuelidate/validators"])})(self,(e=>(()=>{"use strict";var l={887:l=>{l.exports=e}},r={};function __webpack_require__(e){var u=r[e];if(void 0!==u)return u.exports;var t=r[e]={exports:{}};return l[e](t,t.exports,__webpack_require__),t.exports}(()=>{__webpack_require__.n=e=>{var l=e&&e.__esModule?()=>e["default"]:()=>e;return __webpack_require__.d(l,{a:l}),l}})(),(()=>{__webpack_require__.d=(e,l)=>{for(var r in l)__webpack_require__.o(l,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:l[r]})}})(),(()=>{__webpack_require__.o=(e,l)=>Object.prototype.hasOwnProperty.call(e,l)})(),(()=>{__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var u={};__webpack_require__.r(u),__webpack_require__.d(u,{alphaNumRule:()=>alphaNumRule,alphaRule:()=>alphaRule,betweenRule:()=>betweenRule,decimalRule:()=>decimalRule,default:()=>a,emailRule:()=>emailRule,integerRule:()=>integerRule,ipAddressRule:()=>ipAddressRule,macAddressRule:()=>macAddressRule,maxLengthRule:()=>maxLengthRule,maxValueRule:()=>maxValueRule,minValueRule:()=>minValueRule,numericRule:()=>numericRule,phoneRule:()=>phoneRule,requiredRule:()=>requiredRule,urlRule:()=>urlRule,validators:()=>o});var t=__webpack_require__(887);const requiredRule=e=>l=>{if(null==l||"string"===typeof l&&""===l)return e?`Поле ${e} обязательно`:"Это поле обязательно";const r=t.required.$validator(l,null,null);return!("boolean"!==typeof r||!r)||(e?`Поле ${e} обязательно`:"Это поле обязательно")},maxLengthRule=e=>l=>{const r=(0,t.maxLength)(e).$validator(l,null,null);return!("boolean"!==typeof r||!r)||`Значение должно быть меньше ${e} символов`},alphaRule=()=>e=>{const l=t.alpha.$validator(e,null,null);return!("boolean"!==typeof l||!l)||"Разрешены только латинские буквы"},alphaNumRule=()=>e=>{const l=t.alphaNum.$validator(e,null,null);return!("boolean"!==typeof l||!l)||"Разрешены только латинские буквы и цифры"},betweenRule=(e,l)=>r=>{const u=(0,t.between)(e,l).$validator(r,null,null);return!("boolean"!==typeof u||!u)||`Значение должно быть в диапазоне от ${e} до ${l}`},decimalRule=()=>e=>{const l=t.decimal.$validator(e,null,null);return!("boolean"!==typeof l||!l)||"Значение должно быть целым или дробным числом"},emailRule=()=>e=>{const l=t.email.$validator(e,null,null);return!("boolean"!==typeof l||!l)||"Неверный формат адреса эл.почты"},integerRule=()=>e=>{const l=t.integer.$validator(e,null,null);return!("boolean"!==typeof l||!l)||"Значение должно быть целым числом"},ipAddressRule=()=>e=>{const l=t.ipAddress.$validator(e,null,null);return!("boolean"!==typeof l||!l)||"Неправильный формат IP-адреса"},macAddressRule=()=>e=>{const l=(0,t.macAddress)(":").$validator(e,null,null);return!("boolean"!==typeof l||!l)||"Неправильный формат mac-адреса"},maxValueRule=e=>l=>{const r=(0,t.maxValue)(e).$validator(l,null,null);return!("boolean"!==typeof r||!r)||`Значение должно быть меньше ${e}`},minValueRule=e=>l=>{const r=(0,t.minValue)(e).$validator(l,null,null);return!("boolean"!==typeof r||!r)||`Значение должно быть больше ${e}`},numericRule=()=>e=>{const l=t.numeric.$validator(e,null,null);return!("boolean"!==typeof l||!l)||"Разрешены только цифры"},urlRule=()=>e=>{const l=t.url.$validator(e,null,null);return!("boolean"!==typeof l||!l)||"Неправильный формат URI"},phoneRule=()=>e=>{const l=/^[\d()+-]+$/;return l.test(e)||"Неправильный формат телефона"},o={requiredRule,maxLengthRule,alphaRule,alphaNumRule,betweenRule,decimalRule,emailRule,integerRule,ipAddressRule,macAddressRule,maxValueRule,minValueRule,numericRule,urlRule,phoneRule},a={};return u})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldmjs/ui",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "description": "ldm ui",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
File without changes
File without changes
File without changes
File without changes