@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.
- package/dist/pl-components-pack-v3.es.js +242 -130
- package/dist/pl-components-pack-v3.umd.js +3 -3
- package/dist/style.css +2 -2
- package/package.json +4 -2
|
@@ -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
|
|
3837
|
-
if (!size && !
|
|
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":
|
|
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(
|
|
7241
|
+
function numberInputToObject(color) {
|
|
7242
7242
|
return {
|
|
7243
|
-
r:
|
|
7244
|
-
g: (
|
|
7245
|
-
b:
|
|
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(
|
|
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
|
|
7407
|
-
|
|
7406
|
+
if (typeof color === "string") {
|
|
7407
|
+
color = stringInputToObject(color);
|
|
7408
7408
|
}
|
|
7409
|
-
if (typeof
|
|
7410
|
-
if (isValidCSSUnit(
|
|
7411
|
-
rgb = rgbToRgb(
|
|
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(
|
|
7414
|
-
} else if (isValidCSSUnit(
|
|
7415
|
-
s2 = convertToPercentage(
|
|
7416
|
-
v2 = convertToPercentage(
|
|
7417
|
-
rgb = hsvToRgb(
|
|
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(
|
|
7421
|
-
s2 = convertToPercentage(
|
|
7422
|
-
l2 = convertToPercentage(
|
|
7423
|
-
rgb = hslToRgb(
|
|
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(
|
|
7428
|
-
a2 =
|
|
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:
|
|
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(
|
|
7460
|
-
|
|
7461
|
-
if (
|
|
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[
|
|
7466
|
-
|
|
7465
|
+
if (names[color]) {
|
|
7466
|
+
color = names[color];
|
|
7467
7467
|
named = true;
|
|
7468
|
-
} else if (
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
7536
|
-
return Boolean(matchers.CSS_UNIT.exec(String(
|
|
7535
|
+
function isValidCSSUnit(color) {
|
|
7536
|
+
return Boolean(matchers.CSS_UNIT.exec(String(color)));
|
|
7537
7537
|
}
|
|
7538
7538
|
var TinyColor = function() {
|
|
7539
|
-
function TinyColor2(
|
|
7540
|
-
if (
|
|
7541
|
-
|
|
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 (
|
|
7548
|
-
return
|
|
7547
|
+
if (color instanceof TinyColor2) {
|
|
7548
|
+
return color;
|
|
7549
7549
|
}
|
|
7550
|
-
if (typeof
|
|
7551
|
-
|
|
7550
|
+
if (typeof color === "number") {
|
|
7551
|
+
color = numberInputToObject(color);
|
|
7552
7552
|
}
|
|
7553
|
-
this.originalInput =
|
|
7554
|
-
var rgb = inputToRGB(
|
|
7555
|
-
this.originalInput =
|
|
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(
|
|
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(
|
|
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(
|
|
7911
|
-
return this.toRgbString() === new TinyColor2(
|
|
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(
|
|
7916
|
-
return
|
|
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
|
|
7926
|
-
const activeBgColor = props.dark ?
|
|
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(
|
|
7929
|
+
"bg-color": props.dark ? darken(color, 90) : color.tint(90).toString(),
|
|
7930
7930
|
"text-color": buttonColor,
|
|
7931
|
-
"border-color": props.dark ? darken(
|
|
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(
|
|
7941
|
-
styles[ns2.cssVarBlockName("disabled-text-color")] = props.dark ? darken(
|
|
7942
|
-
styles[ns2.cssVarBlockName("disabled-border-color")] = props.dark ? darken(
|
|
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(
|
|
7946
|
-
const textColor =
|
|
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(
|
|
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$
|
|
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$
|
|
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(
|
|
18253
|
-
const span = 100 /
|
|
18254
|
-
const seriesColors =
|
|
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
|
|
18268
|
-
if (isFunction$1(
|
|
18269
|
-
return
|
|
18270
|
-
} else if (isString$1(
|
|
18271
|
-
return
|
|
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(
|
|
18274
|
-
for (const
|
|
18275
|
-
if (
|
|
18276
|
-
return
|
|
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
|
|
25366
|
-
|
|
25367
|
-
|
|
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
|
-
|
|
25371
|
-
|
|
25372
|
-
|
|
25373
|
-
|
|
25374
|
-
|
|
25375
|
-
|
|
25376
|
-
|
|
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-
|
|
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
|
-
"
|
|
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(),
|
|
25968
|
-
|
|
25969
|
-
|
|
25970
|
-
|
|
25971
|
-
|
|
25972
|
-
|
|
25973
|
-
|
|
25974
|
-
|
|
25975
|
-
|
|
25976
|
-
|
|
25977
|
-
|
|
25978
|
-
|
|
25979
|
-
|
|
25980
|
-
|
|
25981
|
-
|
|
25982
|
-
|
|
25983
|
-
|
|
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
|
-
|
|
26016
|
-
])
|
|
26017
|
-
withDirectives(createElementVNode("span",
|
|
26018
|
-
[
|
|
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-
|
|
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
|
|
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
|
|
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;
|