@factoringplus/pl-components-pack-v3 0.5.28 → 0.5.30-pre-1

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 { unref, getCurrentScope, onScopeDispose, ref, watch, getCurrentInstance, onMounted, nextTick, readonly, shallowRef, watchEffect, computed as computed$1, openBlock, createElementBlock, createElementVNode, warn, isVNode, provide, inject, onBeforeUnmount, toRef, onUnmounted, isRef, onBeforeMount, defineComponent, mergeProps, renderSlot, useAttrs as useAttrs$1, useSlots, withDirectives, createCommentVNode, Fragment, normalizeClass, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, toDisplayString, normalizeStyle, vShow, Transition, reactive, onUpdated, cloneVNode, Text, Comment, Teleport, onDeactivated, renderList, createTextVNode, toRaw as toRaw$1, vModelCheckbox, toRefs, withKeys, h as h$2, createSlots, triggerRef, resolveComponent, resolveDirective, vModelText, TransitionGroup, createApp, shallowReactive, render, useCssVars, pushScopeId, popScopeId, normalizeProps, guardReactiveProps, createStaticVNode } from "vue";
1
+ import { unref, getCurrentScope, onScopeDispose, ref, watch, getCurrentInstance, onMounted, nextTick, readonly, shallowRef, watchEffect, computed as computed$1, openBlock, createElementBlock, createElementVNode, warn, isVNode, provide, inject, onBeforeUnmount, toRef, onUnmounted, isRef, onBeforeMount, defineComponent, mergeProps, renderSlot, useAttrs as useAttrs$1, useSlots, withDirectives, createCommentVNode, Fragment, normalizeClass, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, toDisplayString, normalizeStyle, vShow, Transition, reactive, onUpdated, cloneVNode, Text, Comment, Teleport, onDeactivated, renderList, createTextVNode, toRaw as toRaw$1, vModelCheckbox, toRefs, withKeys, h as h$2, createSlots, triggerRef, resolveComponent, resolveDirective, vModelText, TransitionGroup, createApp, shallowReactive, render, useCssVars, vModelDynamic, pushScopeId, popScopeId, normalizeProps, guardReactiveProps, createStaticVNode } from "vue";
2
2
  import moment from "moment";
3
3
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
4
4
  var freeGlobal$1 = freeGlobal;
@@ -3833,12 +3833,12 @@ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
3833
3833
  const props = __props;
3834
3834
  const ns2 = useNamespace("icon");
3835
3835
  const style = computed$1(() => {
3836
- const { size, color: color2 } = props;
3837
- if (!size && !color2)
3836
+ const { size, color } = props;
3837
+ if (!size && !color)
3838
3838
  return {};
3839
3839
  return {
3840
3840
  fontSize: isUndefined$1(size) ? void 0 : addUnit(size),
3841
- "--color": color2
3841
+ "--color": color
3842
3842
  };
3843
3843
  });
3844
3844
  return (_ctx, _cache) => {
@@ -7238,11 +7238,11 @@ function convertHexToDecimal(h2) {
7238
7238
  function parseIntFromHex(val) {
7239
7239
  return parseInt(val, 16);
7240
7240
  }
7241
- function numberInputToObject(color2) {
7241
+ function numberInputToObject(color) {
7242
7242
  return {
7243
- r: color2 >> 16,
7244
- g: (color2 & 65280) >> 8,
7245
- b: color2 & 255
7243
+ r: color >> 16,
7244
+ g: (color & 65280) >> 8,
7245
+ b: color & 255
7246
7246
  };
7247
7247
  }
7248
7248
  var names = {
@@ -7395,7 +7395,7 @@ var names = {
7395
7395
  yellow: "#ffff00",
7396
7396
  yellowgreen: "#9acd32"
7397
7397
  };
7398
- function inputToRGB(color2) {
7398
+ function inputToRGB(color) {
7399
7399
  var rgb = { r: 0, g: 0, b: 0 };
7400
7400
  var a2 = 1;
7401
7401
  var s2 = null;
@@ -7403,35 +7403,35 @@ function inputToRGB(color2) {
7403
7403
  var l2 = null;
7404
7404
  var ok = false;
7405
7405
  var format2 = false;
7406
- if (typeof color2 === "string") {
7407
- color2 = stringInputToObject(color2);
7406
+ if (typeof color === "string") {
7407
+ color = stringInputToObject(color);
7408
7408
  }
7409
- if (typeof color2 === "object") {
7410
- if (isValidCSSUnit(color2.r) && isValidCSSUnit(color2.g) && isValidCSSUnit(color2.b)) {
7411
- rgb = rgbToRgb(color2.r, color2.g, color2.b);
7409
+ if (typeof color === "object") {
7410
+ if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
7411
+ rgb = rgbToRgb(color.r, color.g, color.b);
7412
7412
  ok = true;
7413
- format2 = String(color2.r).substr(-1) === "%" ? "prgb" : "rgb";
7414
- } else if (isValidCSSUnit(color2.h) && isValidCSSUnit(color2.s) && isValidCSSUnit(color2.v)) {
7415
- s2 = convertToPercentage(color2.s);
7416
- v2 = convertToPercentage(color2.v);
7417
- rgb = hsvToRgb(color2.h, s2, v2);
7413
+ format2 = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
7414
+ } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
7415
+ s2 = convertToPercentage(color.s);
7416
+ v2 = convertToPercentage(color.v);
7417
+ rgb = hsvToRgb(color.h, s2, v2);
7418
7418
  ok = true;
7419
7419
  format2 = "hsv";
7420
- } else if (isValidCSSUnit(color2.h) && isValidCSSUnit(color2.s) && isValidCSSUnit(color2.l)) {
7421
- s2 = convertToPercentage(color2.s);
7422
- l2 = convertToPercentage(color2.l);
7423
- rgb = hslToRgb(color2.h, s2, l2);
7420
+ } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
7421
+ s2 = convertToPercentage(color.s);
7422
+ l2 = convertToPercentage(color.l);
7423
+ rgb = hslToRgb(color.h, s2, l2);
7424
7424
  ok = true;
7425
7425
  format2 = "hsl";
7426
7426
  }
7427
- if (Object.prototype.hasOwnProperty.call(color2, "a")) {
7428
- a2 = color2.a;
7427
+ if (Object.prototype.hasOwnProperty.call(color, "a")) {
7428
+ a2 = color.a;
7429
7429
  }
7430
7430
  }
7431
7431
  a2 = boundAlpha(a2);
7432
7432
  return {
7433
7433
  ok,
7434
- format: color2.format || format2,
7434
+ format: color.format || format2,
7435
7435
  r: Math.min(255, Math.max(rgb.r, 0)),
7436
7436
  g: Math.min(255, Math.max(rgb.g, 0)),
7437
7437
  b: Math.min(255, Math.max(rgb.b, 0)),
@@ -7456,43 +7456,43 @@ var matchers = {
7456
7456
  hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
7457
7457
  hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
7458
7458
  };
7459
- function stringInputToObject(color2) {
7460
- color2 = color2.trim().toLowerCase();
7461
- if (color2.length === 0) {
7459
+ function stringInputToObject(color) {
7460
+ color = color.trim().toLowerCase();
7461
+ if (color.length === 0) {
7462
7462
  return false;
7463
7463
  }
7464
7464
  var named = false;
7465
- if (names[color2]) {
7466
- color2 = names[color2];
7465
+ if (names[color]) {
7466
+ color = names[color];
7467
7467
  named = true;
7468
- } else if (color2 === "transparent") {
7468
+ } else if (color === "transparent") {
7469
7469
  return { r: 0, g: 0, b: 0, a: 0, format: "name" };
7470
7470
  }
7471
- var match = matchers.rgb.exec(color2);
7471
+ var match = matchers.rgb.exec(color);
7472
7472
  if (match) {
7473
7473
  return { r: match[1], g: match[2], b: match[3] };
7474
7474
  }
7475
- match = matchers.rgba.exec(color2);
7475
+ match = matchers.rgba.exec(color);
7476
7476
  if (match) {
7477
7477
  return { r: match[1], g: match[2], b: match[3], a: match[4] };
7478
7478
  }
7479
- match = matchers.hsl.exec(color2);
7479
+ match = matchers.hsl.exec(color);
7480
7480
  if (match) {
7481
7481
  return { h: match[1], s: match[2], l: match[3] };
7482
7482
  }
7483
- match = matchers.hsla.exec(color2);
7483
+ match = matchers.hsla.exec(color);
7484
7484
  if (match) {
7485
7485
  return { h: match[1], s: match[2], l: match[3], a: match[4] };
7486
7486
  }
7487
- match = matchers.hsv.exec(color2);
7487
+ match = matchers.hsv.exec(color);
7488
7488
  if (match) {
7489
7489
  return { h: match[1], s: match[2], v: match[3] };
7490
7490
  }
7491
- match = matchers.hsva.exec(color2);
7491
+ match = matchers.hsva.exec(color);
7492
7492
  if (match) {
7493
7493
  return { h: match[1], s: match[2], v: match[3], a: match[4] };
7494
7494
  }
7495
- match = matchers.hex8.exec(color2);
7495
+ match = matchers.hex8.exec(color);
7496
7496
  if (match) {
7497
7497
  return {
7498
7498
  r: parseIntFromHex(match[1]),
@@ -7502,7 +7502,7 @@ function stringInputToObject(color2) {
7502
7502
  format: named ? "name" : "hex8"
7503
7503
  };
7504
7504
  }
7505
- match = matchers.hex6.exec(color2);
7505
+ match = matchers.hex6.exec(color);
7506
7506
  if (match) {
7507
7507
  return {
7508
7508
  r: parseIntFromHex(match[1]),
@@ -7511,7 +7511,7 @@ function stringInputToObject(color2) {
7511
7511
  format: named ? "name" : "hex"
7512
7512
  };
7513
7513
  }
7514
- match = matchers.hex4.exec(color2);
7514
+ match = matchers.hex4.exec(color);
7515
7515
  if (match) {
7516
7516
  return {
7517
7517
  r: parseIntFromHex(match[1] + match[1]),
@@ -7521,7 +7521,7 @@ function stringInputToObject(color2) {
7521
7521
  format: named ? "name" : "hex8"
7522
7522
  };
7523
7523
  }
7524
- match = matchers.hex3.exec(color2);
7524
+ match = matchers.hex3.exec(color);
7525
7525
  if (match) {
7526
7526
  return {
7527
7527
  r: parseIntFromHex(match[1] + match[1]),
@@ -7532,27 +7532,27 @@ function stringInputToObject(color2) {
7532
7532
  }
7533
7533
  return false;
7534
7534
  }
7535
- function isValidCSSUnit(color2) {
7536
- return Boolean(matchers.CSS_UNIT.exec(String(color2)));
7535
+ function isValidCSSUnit(color) {
7536
+ return Boolean(matchers.CSS_UNIT.exec(String(color)));
7537
7537
  }
7538
7538
  var TinyColor = function() {
7539
- function TinyColor2(color2, opts) {
7540
- if (color2 === void 0) {
7541
- color2 = "";
7539
+ function TinyColor2(color, opts) {
7540
+ if (color === void 0) {
7541
+ color = "";
7542
7542
  }
7543
7543
  if (opts === void 0) {
7544
7544
  opts = {};
7545
7545
  }
7546
7546
  var _a2;
7547
- if (color2 instanceof TinyColor2) {
7548
- return color2;
7547
+ if (color instanceof TinyColor2) {
7548
+ return color;
7549
7549
  }
7550
- if (typeof color2 === "number") {
7551
- color2 = numberInputToObject(color2);
7550
+ if (typeof color === "number") {
7551
+ color = numberInputToObject(color);
7552
7552
  }
7553
- this.originalInput = color2;
7554
- var rgb = inputToRGB(color2);
7555
- this.originalInput = color2;
7553
+ this.originalInput = color;
7554
+ var rgb = inputToRGB(color);
7555
+ this.originalInput = color;
7556
7556
  this.r = rgb.r;
7557
7557
  this.g = rgb.g;
7558
7558
  this.b = rgb.b;
@@ -7821,12 +7821,12 @@ var TinyColor = function() {
7821
7821
  hsl.h = hue < 0 ? 360 + hue : hue;
7822
7822
  return new TinyColor2(hsl);
7823
7823
  };
7824
- TinyColor2.prototype.mix = function(color2, amount) {
7824
+ TinyColor2.prototype.mix = function(color, amount) {
7825
7825
  if (amount === void 0) {
7826
7826
  amount = 50;
7827
7827
  }
7828
7828
  var rgb1 = this.toRgb();
7829
- var rgb2 = new TinyColor2(color2).toRgb();
7829
+ var rgb2 = new TinyColor2(color).toRgb();
7830
7830
  var p2 = amount / 100;
7831
7831
  var rgba = {
7832
7832
  r: (rgb2.r - rgb1.r) * p2 + rgb1.r,
@@ -7907,13 +7907,13 @@ var TinyColor = function() {
7907
7907
  }
7908
7908
  return result;
7909
7909
  };
7910
- TinyColor2.prototype.equals = function(color2) {
7911
- return this.toRgbString() === new TinyColor2(color2).toRgbString();
7910
+ TinyColor2.prototype.equals = function(color) {
7911
+ return this.toRgbString() === new TinyColor2(color).toRgbString();
7912
7912
  };
7913
7913
  return TinyColor2;
7914
7914
  }();
7915
- function darken(color2, amount = 20) {
7916
- return color2.mix("#141414", amount).toString();
7915
+ function darken(color, amount = 20) {
7916
+ return color.mix("#141414", amount).toString();
7917
7917
  }
7918
7918
  function useButtonCustomStyle(props) {
7919
7919
  const _disabled = useDisabled();
@@ -7922,13 +7922,13 @@ function useButtonCustomStyle(props) {
7922
7922
  let styles = {};
7923
7923
  const buttonColor = props.color;
7924
7924
  if (buttonColor) {
7925
- const color2 = new TinyColor(buttonColor);
7926
- const activeBgColor = props.dark ? color2.tint(20).toString() : darken(color2, 20);
7925
+ const color = new TinyColor(buttonColor);
7926
+ const activeBgColor = props.dark ? color.tint(20).toString() : darken(color, 20);
7927
7927
  if (props.plain) {
7928
7928
  styles = ns2.cssVarBlock({
7929
- "bg-color": props.dark ? darken(color2, 90) : color2.tint(90).toString(),
7929
+ "bg-color": props.dark ? darken(color, 90) : color.tint(90).toString(),
7930
7930
  "text-color": buttonColor,
7931
- "border-color": props.dark ? darken(color2, 50) : color2.tint(50).toString(),
7931
+ "border-color": props.dark ? darken(color, 50) : color.tint(50).toString(),
7932
7932
  "hover-text-color": `var(${ns2.cssVarName("color-white")})`,
7933
7933
  "hover-bg-color": buttonColor,
7934
7934
  "hover-border-color": buttonColor,
@@ -7937,13 +7937,13 @@ function useButtonCustomStyle(props) {
7937
7937
  "active-border-color": activeBgColor
7938
7938
  });
7939
7939
  if (_disabled.value) {
7940
- styles[ns2.cssVarBlockName("disabled-bg-color")] = props.dark ? darken(color2, 90) : color2.tint(90).toString();
7941
- styles[ns2.cssVarBlockName("disabled-text-color")] = props.dark ? darken(color2, 50) : color2.tint(50).toString();
7942
- styles[ns2.cssVarBlockName("disabled-border-color")] = props.dark ? darken(color2, 80) : color2.tint(80).toString();
7940
+ styles[ns2.cssVarBlockName("disabled-bg-color")] = props.dark ? darken(color, 90) : color.tint(90).toString();
7941
+ styles[ns2.cssVarBlockName("disabled-text-color")] = props.dark ? darken(color, 50) : color.tint(50).toString();
7942
+ styles[ns2.cssVarBlockName("disabled-border-color")] = props.dark ? darken(color, 80) : color.tint(80).toString();
7943
7943
  }
7944
7944
  } else {
7945
- const hoverBgColor = props.dark ? darken(color2, 30) : color2.tint(30).toString();
7946
- const textColor = color2.isDark() ? `var(${ns2.cssVarName("color-white")})` : `var(${ns2.cssVarName("color-black")})`;
7945
+ const hoverBgColor = props.dark ? darken(color, 30) : color.tint(30).toString();
7946
+ const textColor = color.isDark() ? `var(${ns2.cssVarName("color-white")})` : `var(${ns2.cssVarName("color-black")})`;
7947
7947
  styles = ns2.cssVarBlock({
7948
7948
  "bg-color": buttonColor,
7949
7949
  "text-color": textColor,
@@ -7955,7 +7955,7 @@ function useButtonCustomStyle(props) {
7955
7955
  "active-border-color": activeBgColor
7956
7956
  });
7957
7957
  if (_disabled.value) {
7958
- const disabledButtonColor = props.dark ? darken(color2, 50) : color2.tint(50).toString();
7958
+ const disabledButtonColor = props.dark ? darken(color, 50) : color.tint(50).toString();
7959
7959
  styles[ns2.cssVarBlockName("disabled-bg-color")] = disabledButtonColor;
7960
7960
  styles[ns2.cssVarBlockName("disabled-text-color")] = props.dark ? "rgba(255, 255, 255, 0.5)" : `var(${ns2.cssVarName("color-white")})`;
7961
7961
  styles[ns2.cssVarBlockName("disabled-border-color")] = disabledButtonColor;
@@ -17660,7 +17660,7 @@ const _hoisted_2$B = ["aria-current", "tabindex"];
17660
17660
  const _hoisted_3$t = ["tabindex"];
17661
17661
  const _hoisted_4$l = ["aria-current", "tabindex"];
17662
17662
  const _hoisted_5$f = ["tabindex"];
17663
- const _hoisted_6$8 = ["aria-current", "tabindex"];
17663
+ const _hoisted_6$9 = ["aria-current", "tabindex"];
17664
17664
  const __default__$i = defineComponent({
17665
17665
  name: "ElPaginationPager"
17666
17666
  });
@@ -17850,7 +17850,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
17850
17850
  ], "number"]),
17851
17851
  "aria-current": _ctx.currentPage === _ctx.pageCount,
17852
17852
  tabindex: unref(tabindex)
17853
- }, toDisplayString(_ctx.pageCount), 11, _hoisted_6$8)) : createCommentVNode("v-if", true)
17853
+ }, toDisplayString(_ctx.pageCount), 11, _hoisted_6$9)) : createCommentVNode("v-if", true)
17854
17854
  ], 42, _hoisted_1$J);
17855
17855
  };
17856
17856
  }
@@ -18249,9 +18249,9 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
18249
18249
  return props.type === "line" ? 12 + props.strokeWidth * 0.4 : props.width * 0.111111 + 2;
18250
18250
  });
18251
18251
  const content = computed$1(() => props.format(props.percentage));
18252
- function getColors(color2) {
18253
- const span = 100 / color2.length;
18254
- const seriesColors = color2.map((seriesColor, index) => {
18252
+ function getColors(color) {
18253
+ const span = 100 / color.length;
18254
+ const seriesColors = color.map((seriesColor, index) => {
18255
18255
  if (isString$1(seriesColor)) {
18256
18256
  return {
18257
18257
  color: seriesColor,
@@ -18264,16 +18264,16 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
18264
18264
  }
18265
18265
  const getCurrentColor = (percentage) => {
18266
18266
  var _a2;
18267
- const { color: color2 } = props;
18268
- if (isFunction$1(color2)) {
18269
- return color2(percentage);
18270
- } else if (isString$1(color2)) {
18271
- return color2;
18267
+ const { color } = props;
18268
+ if (isFunction$1(color)) {
18269
+ return color(percentage);
18270
+ } else if (isString$1(color)) {
18271
+ return color;
18272
18272
  } else {
18273
- const colors = getColors(color2);
18274
- for (const color22 of colors) {
18275
- if (color22.percentage > percentage)
18276
- return color22.color;
18273
+ const colors = getColors(color);
18274
+ for (const color2 of colors) {
18275
+ if (color2.percentage > percentage)
18276
+ return color2.color;
18277
18277
  }
18278
18278
  return (_a2 = colors[colors.length - 1]) == null ? void 0 : _a2.color;
18279
18279
  }
@@ -25358,25 +25358,117 @@ const PlCurrencyPlugin = {
25358
25358
  app.component("PlCurrency", _sfc_main$F);
25359
25359
  }
25360
25360
  };
25361
- var form = "";
25362
25361
  const _sfc_main$E = {
25363
25362
  __name: "pl-form",
25363
+ props: {
25364
+ model: {
25365
+ type: Object,
25366
+ required: true
25367
+ },
25368
+ rules: {
25369
+ type: Object,
25370
+ default: () => {
25371
+ }
25372
+ }
25373
+ },
25364
25374
  setup(__props, { expose }) {
25365
- const elFormRef = ref(null);
25366
- expose({
25367
- elFormRef
25375
+ const props = __props;
25376
+ const { model, rules: rules2 } = toRefs(props);
25377
+ const errorsState = ref([]);
25378
+ provide("errorsState", errorsState);
25379
+ const validate = async (callback) => {
25380
+ return new Promise((resolve, reject) => {
25381
+ const validator2 = new Schema(rules2.value);
25382
+ validator2.validate(model.value, (errors, fields) => {
25383
+ if (errors) {
25384
+ errorsState.value = errors;
25385
+ callback == null ? void 0 : callback(false);
25386
+ reject();
25387
+ return;
25388
+ }
25389
+ errorsState.value = [];
25390
+ callback == null ? void 0 : callback(true);
25391
+ resolve();
25392
+ });
25393
+ });
25394
+ };
25395
+ const clearValidate = (props2 = []) => {
25396
+ if (Array.isArray(props2) && props2.length > 0) {
25397
+ props2.forEach((prop) => {
25398
+ errorsState.value = errorsState.value.filter((error2) => error2.field !== prop);
25399
+ });
25400
+ } else if (!Array.isArray(props2)) {
25401
+ errorsState.value = errorsState.value.filter((error2) => error2.field !== props2);
25402
+ } else {
25403
+ errorsState.value = [];
25404
+ }
25405
+ };
25406
+ const resetFields = (props2 = []) => {
25407
+ if (Array.isArray(props2) && props2.length > 0) {
25408
+ props2.forEach((prop) => {
25409
+ clearValidate(prop);
25410
+ model.value[prop] = null;
25411
+ });
25412
+ } else if (!Array.isArray(props2)) {
25413
+ clearValidate(props2);
25414
+ model.value[props2] = null;
25415
+ } else {
25416
+ for (let prop in model.value) {
25417
+ model.value[prop] = null;
25418
+ }
25419
+ clearValidate(props2);
25420
+ }
25421
+ };
25422
+ const validateField = (prop) => {
25423
+ const rulesValidate = {};
25424
+ const source2 = {};
25425
+ rulesValidate[prop] = rules2.value[prop];
25426
+ source2[prop] = model.value[prop];
25427
+ const validator2 = new Schema(rulesValidate);
25428
+ validator2.validate(source2, (errors, fields) => {
25429
+ errorsState.value = errorsState.value.filter((error2) => error2.field !== prop);
25430
+ if (errors) {
25431
+ errorsState.value = errorsState.value.concat(errors);
25432
+ }
25433
+ });
25434
+ };
25435
+ const plFormRef = ref(null);
25436
+ onMounted(() => {
25437
+ const ref2 = plFormRef.value;
25438
+ for (let index = 0; index < ref2.length; index++) {
25439
+ const element = ref2[index];
25440
+ const prop = element.__vueParentComponent.ctx.prop;
25441
+ if (prop in rules2.value) {
25442
+ rules2.value[prop].forEach((rule) => {
25443
+ if (rule.trigger) {
25444
+ const triggers = rule.trigger.replace(/\s/g, "").split(",");
25445
+ triggers.forEach((trigger) => {
25446
+ useEventListener(element, trigger, (evt) => {
25447
+ validateField(prop);
25448
+ });
25449
+ });
25450
+ } else {
25451
+ const triggers = ["blur", "change", "input"];
25452
+ triggers.forEach((trigger) => {
25453
+ useEventListener(element, trigger, (evt) => {
25454
+ validateField(prop);
25455
+ });
25456
+ });
25457
+ }
25458
+ });
25459
+ }
25460
+ }
25368
25461
  });
25462
+ expose({ validate, validateField, clearValidate, resetFields });
25369
25463
  return (_ctx, _cache) => {
25370
- const _component_el_form = ElForm;
25371
- return openBlock(), createBlock(_component_el_form, mergeProps({
25372
- ref_key: "elFormRef",
25373
- ref: elFormRef
25374
- }, _ctx.$attrs), {
25375
- default: withCtx(() => [
25376
- renderSlot(_ctx.$slots, "default")
25377
- ]),
25378
- _: 3
25379
- }, 16);
25464
+ return openBlock(), createElementBlock("form", {
25465
+ ref_key: "plFormRef",
25466
+ ref: plFormRef,
25467
+ onSubmit: _cache[0] || (_cache[0] = withModifiers(() => {
25468
+ }, ["prevent"]))
25469
+ }, [
25470
+ renderSlot(_ctx.$slots, "default")
25471
+ ], 544);
25380
25472
  };
25381
25473
  }
25382
25474
  };
@@ -25385,6 +25477,7 @@ const PlFormPlugin = {
25385
25477
  app.component("PlForm", _sfc_main$E);
25386
25478
  }
25387
25479
  };
25480
+ var form = "";
25388
25481
  var formItem = "";
25389
25482
  var _imports_0$9 = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMi41OTk5IDguMDAwMzlDMi41OTk5IDUuMDE3NzYgNS4wMTcyNyAyLjYwMDM5IDcuOTk5OSAyLjYwMDM5QzEwLjk4MjUgMi42MDAzOSAxMy4zOTk5IDUuMDE3NzYgMTMuMzk5OSA4LjAwMDM5QzEzLjM5OTkgMTAuOTgzIDEwLjk4MjUgMTMuNDAwNCA3Ljk5OTkgMTMuNDAwNEM1LjAxNzI3IDEzLjQwMDQgMi41OTk5IDEwLjk4MyAyLjU5OTkgOC4wMDAzOVpNNy45OTk5IDEuNDAwMzlDNC4zNTQ1MyAxLjQwMDM5IDEuMzk5OSA0LjM1NTAyIDEuMzk5OSA4LjAwMDM5QzEuMzk5OSAxMS42NDU4IDQuMzU0NTMgMTQuNjAwNCA3Ljk5OTkgMTQuNjAwNEMxMS42NDUzIDE0LjYwMDQgMTQuNTk5OSAxMS42NDU4IDE0LjU5OTkgOC4wMDAzOUMxNC41OTk5IDQuMzU1MDIgMTEuNjQ1MyAxLjQwMDM5IDcuOTk5OSAxLjQwMDM5Wk04LjU5OTkgNS4wMDAzOUM4LjU5OTkgNC42NjkwMiA4LjMzMTI3IDQuNDAwMzkgNy45OTk5IDQuNDAwMzlDNy42Njg1MyA0LjQwMDM5IDcuMzk5OSA0LjY2OTAyIDcuMzk5OSA1LjAwMDM5VjguMzMzNzJDNy4zOTk5IDguNjY1MDkgNy42Njg1MyA4LjkzMzcyIDcuOTk5OSA4LjkzMzcyQzguMzMxMjcgOC45MzM3MiA4LjU5OTkgOC42NjUwOSA4LjU5OTkgOC4zMzM3MlY1LjAwMDM5Wk03Ljk5OTkgMTEuNDkyNkM4LjM4NTYxIDExLjQ5MjYgOC42OTgyOCAxMS4xNzk5IDguNjk4MjggMTAuNzk0MkM4LjY5ODI4IDEwLjQwODUgOC4zODU2MSAxMC4wOTU4IDcuOTk5OSAxMC4wOTU4QzcuNjE0MiAxMC4wOTU4IDcuMzAxNTIgMTAuNDA4NSA3LjMwMTUyIDEwLjc5NDJDNy4zMDE1MiAxMS4xNzk5IDcuNjE0MiAxMS40OTI2IDcuOTk5OSAxMS40OTI2WiIgZmlsbD0iIzY1NjU2NyIvPg0KPC9zdmc+DQo=";
25390
25483
  var _imports_2$3 = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik03Ljk5OTAyIDhMMTUuOTk5IDE2IiBzdHJva2U9IiM1MDUwNTEiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4NCjxwYXRoIGQ9Ik0xNS45OTkgOEw3Ljk5OTAyIDE2IiBzdHJva2U9IiM1MDUwNTEiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4NCjwvc3ZnPg0K";
@@ -25808,7 +25901,7 @@ var _export_sfc = (sfc, props) => {
25808
25901
  }
25809
25902
  return target;
25810
25903
  };
25811
- const _withScopeId$1 = (n2) => (pushScopeId("data-v-134b1af5"), n2 = n2(), popScopeId(), n2);
25904
+ const _withScopeId$1 = (n2) => (pushScopeId("data-v-50fa79da"), n2 = n2(), popScopeId(), n2);
25812
25905
  const _hoisted_1$y = { class: "pl-input__container" };
25813
25906
  const _hoisted_2$t = {
25814
25907
  key: 0,
@@ -25820,12 +25913,25 @@ const _hoisted_3$o = {
25820
25913
  };
25821
25914
  const _hoisted_4$i = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("span", { class: "pl-input__currency" }, "\u20BD", -1));
25822
25915
  const _hoisted_5$c = {
25916
+ key: 1,
25917
+ class: "el-input"
25918
+ };
25919
+ const _hoisted_6$8 = { class: "el-input__wrapper" };
25920
+ const _hoisted_7$6 = ["type"];
25921
+ const _hoisted_8$5 = {
25823
25922
  key: 0,
25824
25923
  class: "pl-input__eye-container"
25825
25924
  };
25925
+ const _hoisted_9$5 = { class: "pl-input__helpertext" };
25926
+ const _hoisted_10$4 = { key: 0 };
25927
+ const _hoisted_11$4 = { key: 1 };
25826
25928
  const _sfc_main$B = {
25827
25929
  __name: "pl-input-plus",
25828
25930
  props: {
25931
+ prop: {
25932
+ type: String,
25933
+ default: ""
25934
+ },
25829
25935
  modelValue: {
25830
25936
  required: true
25831
25937
  },
@@ -25873,6 +25979,10 @@ const _sfc_main$B = {
25873
25979
  type: Object,
25874
25980
  default: () => ({ min: 0 })
25875
25981
  },
25982
+ id: {
25983
+ type: String,
25984
+ default: ""
25985
+ },
25876
25986
  currencyInputOptions: {
25877
25987
  type: Object,
25878
25988
  default: () => ({})
@@ -25882,9 +25992,14 @@ const _sfc_main$B = {
25882
25992
  setup(__props, { emit: emit2 }) {
25883
25993
  const props = __props;
25884
25994
  useCssVars((_ctx) => ({
25885
- "4828fd83": props.width
25995
+ "56b7b87d": props.width
25886
25996
  }));
25887
25997
  const attrs = useAttrs$1();
25998
+ const errors = ref([]);
25999
+ const errorsState = inject("errorsState");
26000
+ watch(errorsState, () => {
26001
+ errors.value = errorsState.value.filter((error2) => error2.field === props.prop);
26002
+ }, { deep: true });
25888
26003
  const id = `id-${Math.random()}`;
25889
26004
  const options = reactive({
25890
26005
  currency: "RUB",
@@ -25964,27 +26079,23 @@ const _sfc_main$B = {
25964
26079
  _hoisted_4$i
25965
26080
  ])
25966
26081
  } : void 0
25967
- ]), 1040, ["modelValue"])) : (openBlock(), createBlock(_component_el_input, mergeProps({
25968
- key: 1,
25969
- id,
25970
- name: id,
25971
- type: unref(passwordType) ? "password" : "text"
25972
- }, unref(attrs), {
25973
- modelValue: unref(modelValue),
25974
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(modelValue) ? modelValue.value = $event : null)
25975
- }), createSlots({ _: 2 }, [
25976
- props.leftIcon ? {
25977
- name: "prefix",
25978
- fn: withCtx(() => [
25979
- createVNode(_component_inline_svg, {
25980
- src: props.leftIcon
25981
- }, null, 8, ["src"])
25982
- ])
25983
- } : void 0,
25984
- props.password || unref(showRightIcon) ? {
25985
- name: "suffix",
25986
- fn: withCtx(() => [
25987
- props.password ? (openBlock(), createElementBlock("div", _hoisted_5$c, [
26082
+ ]), 1040, ["modelValue"])) : (openBlock(), createElementBlock("div", _hoisted_5$c, [
26083
+ createElementVNode("div", _hoisted_6$8, [
26084
+ props.leftIcon ? (openBlock(), createBlock(_component_inline_svg, {
26085
+ key: 0,
26086
+ src: props.leftIcon
26087
+ }, null, 8, ["src"])) : createCommentVNode("", true),
26088
+ withDirectives(createElementVNode("input", mergeProps({
26089
+ id,
26090
+ name: id,
26091
+ type: unref(passwordType) ? "password" : "text"
26092
+ }, unref(attrs), {
26093
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(modelValue) ? modelValue.value = $event : null)
26094
+ }), null, 16, _hoisted_7$6), [
26095
+ [vModelDynamic, unref(modelValue)]
26096
+ ]),
26097
+ props.password || unref(showRightIcon) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
26098
+ props.password ? (openBlock(), createElementBlock("div", _hoisted_8$5, [
25988
26099
  createVNode(Transition, { name: "el-zoom-in-top" }, {
25989
26100
  default: withCtx(() => [
25990
26101
  unref(passwordType) ? (openBlock(), createBlock(_component_inline_svg, {
@@ -26011,17 +26122,19 @@ const _sfc_main$B = {
26011
26122
  key: 1,
26012
26123
  src: props.rightIcon
26013
26124
  }, null, 8, ["src"])) : createCommentVNode("", true)
26014
- ])
26015
- } : void 0
26016
- ]), 1040, ["type", "modelValue"])),
26017
- withDirectives(createElementVNode("span", { class: "pl-input__helpertext" }, toDisplayString(props.helpertext), 513), [
26018
- [vShow, props.helpertext]
26125
+ ], 64)) : createCommentVNode("", true)
26126
+ ])
26127
+ ])),
26128
+ withDirectives(createElementVNode("span", _hoisted_9$5, [
26129
+ errors.value.length > 0 ? (openBlock(), createElementBlock("span", _hoisted_10$4, toDisplayString(errors.value[0].message), 1)) : props.helpertext ? (openBlock(), createElementBlock("span", _hoisted_11$4, toDisplayString(props.helpertext), 1)) : createCommentVNode("", true)
26130
+ ], 512), [
26131
+ [vShow, props.helpertext || errors.value.length > 0]
26019
26132
  ])
26020
26133
  ]);
26021
26134
  };
26022
26135
  }
26023
26136
  };
26024
- var PlInputPlus = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-134b1af5"]]);
26137
+ var PlInputPlus = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-50fa79da"]]);
26025
26138
  const PlInputPlusPlugin = {
26026
26139
  install(app) {
26027
26140
  app.component("PlInputPlus", PlInputPlus);
@@ -38913,7 +39026,7 @@ const _hoisted_4$b = { class: "demo-progress" };
38913
39026
  const _sfc_main$k = /* @__PURE__ */ defineComponent({
38914
39027
  __name: "pl-form-progress",
38915
39028
  setup(__props) {
38916
- const color2 = "#FF7D1F";
39029
+ const color = "#FF7D1F";
38917
39030
  return (_ctx, _cache) => {
38918
39031
  const _component_el_progress = ElProgress;
38919
39032
  return openBlock(), createElementBlock("div", _hoisted_1$k, [
@@ -38921,7 +39034,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
38921
39034
  _hoisted_3$g,
38922
39035
  createElementVNode("div", _hoisted_4$b, [
38923
39036
  createVNode(_component_el_progress, {
38924
- color: color2,
39037
+ color,
38925
39038
  percentage: 50
38926
39039
  })
38927
39040
  ])
@@ -42796,7 +42909,6 @@ const PlTooltipPlugin = {
42796
42909
  var bootstrapCustom = "";
42797
42910
  var root = "";
42798
42911
  var inter = "";
42799
- var color = "";
42800
42912
  const PlPlugin = {
42801
42913
  install(app) {
42802
42914
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t2, _u, _v, _w;