@milaboratories/uikit 2.10.40 → 2.10.42
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/.turbo/turbo-build.log +21 -21
- package/.turbo/turbo-formatter$colon$check.log +2 -2
- package/.turbo/turbo-linter$colon$check.log +2 -2
- package/.turbo/turbo-types$colon$check.log +1 -1
- package/CHANGELOG.md +15 -0
- package/dist/components/PlAlert/PlAlert.js.map +1 -1
- package/dist/components/PlAlert/PlAlert.vue.d.ts.map +1 -1
- package/dist/components/PlAlert/PlAlert.vue2.js +19 -20
- package/dist/components/PlAlert/PlAlert.vue2.js.map +1 -1
- package/dist/components/PlAlert/pl-alert.css +1 -1
- package/dist/components/PlDialogModal/PlDialogModal.vue2.js +1 -1
- package/dist/components/PlSlideModal/PlPureSlideModal.js.map +1 -1
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.d.ts.map +1 -1
- package/dist/components/PlSlideModal/PlPureSlideModal.vue2.js +13 -13
- package/dist/components/PlSlideModal/PlPureSlideModal.vue2.js.map +1 -1
- package/dist/components/PlSlideModal/pl-slide-modal.css +1 -1
- package/dist/components/PlTextField/PlTextField.js.map +1 -1
- package/dist/components/PlTextField/PlTextField.vue.d.ts +118 -74
- package/dist/components/PlTextField/PlTextField.vue.d.ts.map +1 -1
- package/dist/components/PlTextField/PlTextField.vue2.js +41 -60
- package/dist/components/PlTextField/PlTextField.vue2.js.map +1 -1
- package/dist/index.js +20 -20
- package/package.json +5 -5
- package/src/components/PlAlert/PlAlert.vue +3 -3
- package/src/components/PlAlert/pl-alert.scss +0 -7
- package/src/components/PlSlideModal/PlPureSlideModal.vue +5 -2
- package/src/components/PlSlideModal/pl-slide-modal.scss +0 -8
- package/src/components/PlTextField/PlTextField.vue +9 -62
- package/src/components/PlTextField/__tests__/TextField.spec.ts +3 -3
|
@@ -1,80 +1,124 @@
|
|
|
1
|
-
import { Equal } from '@milaboratories/helpers';
|
|
2
1
|
/**
|
|
3
2
|
* Component for one-line string data manipulation
|
|
4
3
|
*/
|
|
5
|
-
declare const _default: <
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
4
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
5
|
+
modelValue?: string;
|
|
6
|
+
} & {
|
|
7
|
+
/**
|
|
8
|
+
* The label to display above the input field.
|
|
9
|
+
*/
|
|
10
|
+
label?: string;
|
|
11
|
+
/**
|
|
12
|
+
* If `true`, a clear icon will appear in the input field to clear the value (set it to empty string).
|
|
13
|
+
*/
|
|
14
|
+
clearable?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* If `true`, the input field is marked as required.
|
|
17
|
+
*/
|
|
18
|
+
required?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* An error message to display below the input field.
|
|
21
|
+
*/
|
|
22
|
+
error?: unknown;
|
|
23
|
+
/**
|
|
24
|
+
* A helper text to display below the input field when there are no errors.
|
|
25
|
+
*/
|
|
26
|
+
helper?: string;
|
|
27
|
+
/**
|
|
28
|
+
* A placeholder text to display inside the input field when it is empty.
|
|
29
|
+
*/
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
/**
|
|
32
|
+
* If `true`, the input field is disabled and cannot be interacted with.
|
|
33
|
+
*/
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* If `true`, the input field has a dashed border.
|
|
37
|
+
*/
|
|
38
|
+
dashed?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* A prefix text to display inside the input field before the value.
|
|
41
|
+
*/
|
|
42
|
+
prefix?: string;
|
|
43
|
+
/**
|
|
44
|
+
* An array of validation rules to apply to the input field. Each rule is a function that takes the current value and returns `true` if valid or an error message if invalid.
|
|
45
|
+
*/
|
|
46
|
+
rules?: ((v: string) => boolean | string)[];
|
|
47
|
+
/**
|
|
48
|
+
* The string specifies whether the field should be a password or not, value could be "password" or undefined.
|
|
49
|
+
*/
|
|
50
|
+
type?: "password";
|
|
51
|
+
/**
|
|
52
|
+
* Makes some of corners not rounded
|
|
53
|
+
* */
|
|
54
|
+
groupPosition?: "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "middle";
|
|
55
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
56
|
+
"update:modelValue": (value: string) => any;
|
|
57
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
58
|
+
modelValue?: string;
|
|
59
|
+
} & {
|
|
60
|
+
/**
|
|
61
|
+
* The label to display above the input field.
|
|
62
|
+
*/
|
|
63
|
+
label?: string;
|
|
64
|
+
/**
|
|
65
|
+
* If `true`, a clear icon will appear in the input field to clear the value (set it to empty string).
|
|
66
|
+
*/
|
|
67
|
+
clearable?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* If `true`, the input field is marked as required.
|
|
70
|
+
*/
|
|
71
|
+
required?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* An error message to display below the input field.
|
|
74
|
+
*/
|
|
75
|
+
error?: unknown;
|
|
76
|
+
/**
|
|
77
|
+
* A helper text to display below the input field when there are no errors.
|
|
78
|
+
*/
|
|
79
|
+
helper?: string;
|
|
80
|
+
/**
|
|
81
|
+
* A placeholder text to display inside the input field when it is empty.
|
|
82
|
+
*/
|
|
83
|
+
placeholder?: string;
|
|
84
|
+
/**
|
|
85
|
+
* If `true`, the input field is disabled and cannot be interacted with.
|
|
86
|
+
*/
|
|
87
|
+
disabled?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* If `true`, the input field has a dashed border.
|
|
90
|
+
*/
|
|
91
|
+
dashed?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* A prefix text to display inside the input field before the value.
|
|
94
|
+
*/
|
|
95
|
+
prefix?: string;
|
|
96
|
+
/**
|
|
97
|
+
* An array of validation rules to apply to the input field. Each rule is a function that takes the current value and returns `true` if valid or an error message if invalid.
|
|
98
|
+
*/
|
|
99
|
+
rules?: ((v: string) => boolean | string)[];
|
|
100
|
+
/**
|
|
101
|
+
* The string specifies whether the field should be a password or not, value could be "password" or undefined.
|
|
102
|
+
*/
|
|
103
|
+
type?: "password";
|
|
104
|
+
/**
|
|
105
|
+
* Makes some of corners not rounded
|
|
106
|
+
* */
|
|
107
|
+
groupPosition?: "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "middle";
|
|
108
|
+
}> & Readonly<{
|
|
109
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
110
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
111
|
+
rootRef: HTMLDivElement;
|
|
112
|
+
label: HTMLLabelElement;
|
|
113
|
+
inputRef: HTMLInputElement;
|
|
114
|
+
}, HTMLDivElement>, {
|
|
115
|
+
tooltip?(_: {}): any;
|
|
116
|
+
append?(_: {}): any;
|
|
117
|
+
}>;
|
|
118
|
+
export default _default;
|
|
119
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
120
|
+
new (): {
|
|
121
|
+
$slots: S;
|
|
71
122
|
};
|
|
72
|
-
emit: (evt: "update:modelValue", value: Equal<M, E | C> extends true ? M : never) => void;
|
|
73
|
-
}>) => import('vue').VNode & {
|
|
74
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
75
123
|
};
|
|
76
|
-
export default _default;
|
|
77
|
-
type __VLS_PrettifyLocal<T> = {
|
|
78
|
-
[K in keyof T]: T[K];
|
|
79
|
-
} & {};
|
|
80
124
|
//# sourceMappingURL=PlTextField.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTextField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlTextField/PlTextField.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlTextField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlTextField/PlTextField.vue"],"names":[],"mappings":"AAmNA,OAAO,sBAAsB,CAAC;AAG9B;;GAEG;;iBAiIU,MAAM;;IArHjB;;OAEG;YACK,MAAM;IACd;;OAEG;gBACS,OAAO;IACnB;;OAEG;eACQ,OAAO;IAClB;;OAEG;YACK,OAAO;IACf;;OAEG;aACM,MAAM;IACf;;OAEG;kBACW,MAAM;IACpB;;OAEG;eACQ,OAAO;IAClB;;OAEG;aACM,OAAO;IAChB;;OAEG;aACM,MAAM;IACf;;OAEG;YACK,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,CAAC,EAAE;IAC3C;;OAEG;WACI,UAAU;IACjB;;SAEK;oBAED,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,GACd,QAAQ;;;;iBA6DD,MAAM;;IArHjB;;OAEG;YACK,MAAM;IACd;;OAEG;gBACS,OAAO;IACnB;;OAEG;eACQ,OAAO;IAClB;;OAEG;YACK,OAAO;IACf;;OAEG;aACM,MAAM;IACf;;OAEG;kBACW,MAAM;IACpB;;OAEG;eACQ,OAAO;IAClB;;OAEG;aACM,OAAO;IAChB;;OAEG;aACM,MAAM;IACf;;OAEG;YACK,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,CAAC,EAAE;IAC3C;;OAEG;WACI,UAAU;IACjB;;SAEK;oBAED,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,GACd,QAAQ;;;;;;;;qBA4NgB,GAAG;oBACJ,GAAG;;AAhShC,wBA8VK;AASL,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -12,29 +12,28 @@ import "../PlIcon16/index.js";
|
|
|
12
12
|
import s from "../../assets/images/required.js";
|
|
13
13
|
import { useValidation as c } from "../../utils/useValidation.js";
|
|
14
14
|
import './pl-text-field.css';/* empty css */
|
|
15
|
-
import { computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, mergeModels as g, normalizeClass as _, openBlock as v,
|
|
16
|
-
var
|
|
15
|
+
import { computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, mergeModels as g, normalizeClass as _, openBlock as v, ref as y, renderSlot as b, toDisplayString as x, unref as S, useModel as C, useSlots as w, vModelDynamic as T, withCtx as E, withDirectives as D, withModifiers as O } from "vue";
|
|
16
|
+
var k = { class: "pl-text-field__envelope" }, A = {
|
|
17
17
|
key: 0,
|
|
18
18
|
ref: "label"
|
|
19
|
-
},
|
|
19
|
+
}, j = {
|
|
20
20
|
key: 1,
|
|
21
21
|
class: "pl-text-field__prefix"
|
|
22
|
-
},
|
|
22
|
+
}, M = [
|
|
23
23
|
"disabled",
|
|
24
24
|
"placeholder",
|
|
25
25
|
"type"
|
|
26
|
-
],
|
|
26
|
+
], N = {
|
|
27
27
|
key: 0,
|
|
28
28
|
class: "pl-text-field__error"
|
|
29
|
-
},
|
|
29
|
+
}, P = {
|
|
30
30
|
key: 1,
|
|
31
31
|
class: "pl-text-field__helper"
|
|
32
|
-
},
|
|
32
|
+
}, F = /* @__PURE__ */ h({
|
|
33
33
|
name: "PlTextField",
|
|
34
34
|
props: /* @__PURE__ */ g({
|
|
35
35
|
label: {},
|
|
36
|
-
clearable: { type:
|
|
37
|
-
parse: { type: Function },
|
|
36
|
+
clearable: { type: Boolean },
|
|
38
37
|
required: { type: Boolean },
|
|
39
38
|
error: {},
|
|
40
39
|
helper: {},
|
|
@@ -46,95 +45,77 @@ var A = { class: "pl-text-field__envelope" }, j = {
|
|
|
46
45
|
type: {},
|
|
47
46
|
groupPosition: {}
|
|
48
47
|
}, {
|
|
49
|
-
modelValue: {
|
|
48
|
+
modelValue: { default: "" },
|
|
50
49
|
modelModifiers: {}
|
|
51
50
|
}),
|
|
52
51
|
emits: ["update:modelValue"],
|
|
53
52
|
setup(h) {
|
|
54
|
-
let g =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} catch (t) {
|
|
62
|
-
V.cached = {
|
|
63
|
-
error: t instanceof Error ? t.message : String(t),
|
|
64
|
-
value: e
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
else I.value = e;
|
|
68
|
-
}
|
|
69
|
-
}), U = l(() => L.type && L.type === "password" ? B.value ? "text" : L.type : "text"), W = l(() => B.value ? "view-show" : "view-hide"), G = () => {
|
|
70
|
-
L.clearable && (V.cached = void 0, I.value = L.clearable === !0 ? "" : L.clearable());
|
|
71
|
-
}, K = c(H, L.rules || []), q = l(() => L.clearable ? L.clearable === !0 ? I.value === "" : I.value === L.clearable() : I.value === ""), J = l(() => !q.value), Y = l(() => {
|
|
72
|
-
let e = [], n = t(L.error);
|
|
73
|
-
return n && e.push(n), V.cached && e.push(V.cached.error), K.value.isValid || e.push(...K.value.errors), e;
|
|
74
|
-
}), X = l(() => Y.value.length > 0), Z = l(() => L.clearable && J.value && L.type !== "password" && !L.disabled), Q = () => B.value = !B.value, $ = () => {
|
|
75
|
-
V.cached = void 0;
|
|
76
|
-
}, ee = () => z.value?.focus();
|
|
77
|
-
return o(R), (t, o) => (v(), f("div", A, [p("div", {
|
|
53
|
+
let g = w(), F = C(h, "modelValue"), I = h, L = y(void 0), R = y(), z = y(!1), B = l(() => I.type && I.type === "password" ? z.value ? "text" : I.type : "text"), V = l(() => z.value ? "view-show" : "view-hide"), H = () => {
|
|
54
|
+
I.clearable && (F.value = "");
|
|
55
|
+
}, U = c(F, I.rules || []), W = l(() => F.value === ""), G = l(() => !W.value), K = l(() => {
|
|
56
|
+
let e = [], n = t(I.error);
|
|
57
|
+
return n && e.push(n), U.value.isValid || e.push(...U.value.errors), e;
|
|
58
|
+
}), q = l(() => K.value.length > 0), J = l(() => I.clearable && G.value && I.type !== "password" && !I.disabled), Y = () => z.value = !z.value, X = () => R.value?.focus();
|
|
59
|
+
return o(L), (t, o) => (v(), f("div", k, [p("div", {
|
|
78
60
|
ref_key: "rootRef",
|
|
79
|
-
ref:
|
|
61
|
+
ref: L,
|
|
80
62
|
class: _(["pl-text-field", {
|
|
81
|
-
error:
|
|
63
|
+
error: q.value,
|
|
82
64
|
disabled: h.disabled,
|
|
83
65
|
dashed: h.dashed,
|
|
84
|
-
nonEmpty:
|
|
66
|
+
nonEmpty: G.value
|
|
85
67
|
}])
|
|
86
68
|
}, [
|
|
87
|
-
h.label ? (v(), f("label",
|
|
88
|
-
h.required ? (v(), u(
|
|
69
|
+
h.label ? (v(), f("label", A, [
|
|
70
|
+
h.required ? (v(), u(S(n), {
|
|
89
71
|
key: 0,
|
|
90
|
-
uri:
|
|
72
|
+
uri: S(s)
|
|
91
73
|
}, null, 8, ["uri"])) : d("", !0),
|
|
92
|
-
p("span", null,
|
|
93
|
-
|
|
74
|
+
p("span", null, x(h.label), 1),
|
|
75
|
+
S(g).tooltip ? (v(), u(S(e), {
|
|
94
76
|
key: 1,
|
|
95
77
|
class: "info",
|
|
96
78
|
position: "top"
|
|
97
79
|
}, {
|
|
98
|
-
tooltip:
|
|
80
|
+
tooltip: E(() => [b(t.$slots, "tooltip")]),
|
|
99
81
|
_: 3
|
|
100
82
|
})) : d("", !0)
|
|
101
83
|
], 512)) : d("", !0),
|
|
102
|
-
h.prefix ? (v(), f("div",
|
|
103
|
-
|
|
84
|
+
h.prefix ? (v(), f("div", j, x(h.prefix), 1)) : d("", !0),
|
|
85
|
+
D(p("input", {
|
|
104
86
|
ref_key: "inputRef",
|
|
105
|
-
ref:
|
|
106
|
-
"onUpdate:modelValue": o[0] ||= (e) =>
|
|
87
|
+
ref: R,
|
|
88
|
+
"onUpdate:modelValue": o[0] ||= (e) => F.value = e,
|
|
107
89
|
disabled: h.disabled,
|
|
108
90
|
placeholder: h.placeholder || "...",
|
|
109
|
-
type:
|
|
110
|
-
spellcheck: "false"
|
|
111
|
-
|
|
112
|
-
}, null, 40, N), [[E, H.value]]),
|
|
91
|
+
type: B.value,
|
|
92
|
+
spellcheck: "false"
|
|
93
|
+
}, null, 8, M), [[T, F.value]]),
|
|
113
94
|
p("div", {
|
|
114
95
|
class: "pl-text-field__append",
|
|
115
|
-
onClick:
|
|
96
|
+
onClick: X
|
|
116
97
|
}, [
|
|
117
|
-
|
|
98
|
+
J.value ? (v(), u(S(i), {
|
|
118
99
|
key: 0,
|
|
119
100
|
class: "pl-text-field__clearable",
|
|
120
101
|
name: "delete-clear",
|
|
121
|
-
onClick:
|
|
102
|
+
onClick: O(H, ["stop"])
|
|
122
103
|
})) : d("", !0),
|
|
123
|
-
h.type === "password" ? (v(), u(
|
|
104
|
+
h.type === "password" ? (v(), u(S(r), {
|
|
124
105
|
key: 1,
|
|
125
|
-
name:
|
|
106
|
+
name: V.value,
|
|
126
107
|
style: { cursor: "pointer" },
|
|
127
|
-
onClick:
|
|
108
|
+
onClick: O(Y, ["stop"])
|
|
128
109
|
}, null, 8, ["name"])) : d("", !0),
|
|
129
|
-
|
|
110
|
+
b(t.$slots, "append")
|
|
130
111
|
]),
|
|
131
112
|
m(a, {
|
|
132
113
|
class: "pl-text-field__contour",
|
|
133
114
|
"group-position": h.groupPosition
|
|
134
115
|
}, null, 8, ["group-position"])
|
|
135
|
-
], 2),
|
|
116
|
+
], 2), q.value ? (v(), f("div", N, x(K.value.join(" ")), 1)) : h.helper ? (v(), f("div", P, x(h.helper), 1)) : d("", !0)]));
|
|
136
117
|
}
|
|
137
118
|
});
|
|
138
|
-
export {
|
|
119
|
+
export { F as default };
|
|
139
120
|
|
|
140
121
|
//# sourceMappingURL=PlTextField.vue2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTextField.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlTextField/PlTextField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Component for one-line string data manipulation\n */\nexport default {\n name: \"PlTextField\",\n};\n</script>\n\n<script lang=\"ts\" setup
|
|
1
|
+
{"version":3,"file":"PlTextField.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlTextField/PlTextField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Component for one-line string data manipulation\n */\nexport default {\n name: \"PlTextField\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, useSlots } from \"vue\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { useValidation } from \"../../utils/useValidation\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { PlSvg } from \"../PlSvg\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport \"./pl-text-field.scss\";\n\nconst slots = useSlots();\n\n/**\n * The current value of the input field.\n */\nconst model = defineModel<string>({\n default: \"\",\n});\n\nconst props = defineProps<{\n /**\n * The label to display above the input field.\n */\n label?: string;\n /**\n * If `true`, a clear icon will appear in the input field to clear the value (set it to empty string).\n */\n clearable?: boolean;\n /**\n * If `true`, the input field is marked as required.\n */\n required?: boolean;\n /**\n * An error message to display below the input field.\n */\n error?: unknown;\n /**\n * A helper text to display below the input field when there are no errors.\n */\n helper?: string;\n /**\n * A placeholder text to display inside the input field when it is empty.\n */\n placeholder?: string;\n /**\n * If `true`, the input field is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * If `true`, the input field has a dashed border.\n */\n dashed?: boolean;\n /**\n * A prefix text to display inside the input field before the value.\n */\n prefix?: string;\n /**\n * An array of validation rules to apply to the input field. Each rule is a function that takes the current value and returns `true` if valid or an error message if invalid.\n */\n rules?: ((v: string) => boolean | string)[];\n /**\n * The string specifies whether the field should be a password or not, value could be \"password\" or undefined.\n */\n type?: \"password\";\n /**\n * Makes some of corners not rounded\n * */\n groupPosition?:\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"middle\";\n}>();\n\nconst rootRef = ref<HTMLInputElement | undefined>(undefined);\n\nconst inputRef = ref<HTMLInputElement | undefined>();\n\nconst showPassword = ref(false);\n\nconst fieldType = computed(() => {\n if (props.type && props.type === \"password\") {\n return showPassword.value ? \"text\" : props.type;\n } else {\n return \"text\";\n }\n});\n\nconst passwordIcon = computed(() => (showPassword.value ? \"view-show\" : \"view-hide\"));\n\nconst clear = () => {\n if (props.clearable) {\n model.value = \"\";\n }\n};\n\nconst validationData = useValidation(model, props.rules || []);\n\nconst isEmpty = computed(() => model.value === \"\");\n\nconst nonEmpty = computed(() => !isEmpty.value);\n\nconst displayErrors = computed(() => {\n const errors: string[] = [];\n const propsError = getErrorMessage(props.error);\n if (propsError) {\n errors.push(propsError);\n }\n if (!validationData.value.isValid) {\n errors.push(...validationData.value.errors);\n }\n return errors;\n});\n\nconst hasErrors = computed(() => displayErrors.value.length > 0);\n\nconst canShowClearable = computed(\n () => props.clearable && nonEmpty.value && props.type !== \"password\" && !props.disabled,\n);\n\nconst togglePasswordVisibility = () => (showPassword.value = !showPassword.value);\n\nconst setFocusOnInput = () => inputRef.value?.focus();\n\nuseLabelNotch(rootRef);\n</script>\n\n<template>\n <div class=\"pl-text-field__envelope\">\n <div\n ref=\"rootRef\"\n class=\"pl-text-field\"\n :class=\"{\n error: hasErrors,\n disabled,\n dashed,\n nonEmpty,\n }\"\n >\n <label v-if=\"label\" ref=\"label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" />\n <span>{{ label }}</span>\n <PlTooltip v-if=\"slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <div v-if=\"prefix\" class=\"pl-text-field__prefix\">\n {{ prefix }}\n </div>\n <input\n ref=\"inputRef\"\n v-model=\"model\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder || '...'\"\n :type=\"fieldType\"\n spellcheck=\"false\"\n />\n <div class=\"pl-text-field__append\" @click=\"setFocusOnInput\">\n <PlIcon16\n v-if=\"canShowClearable\"\n class=\"pl-text-field__clearable\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n <PlIcon24\n v-if=\"type === 'password'\"\n :name=\"passwordIcon\"\n style=\"cursor: pointer\"\n @click.stop=\"togglePasswordVisibility\"\n />\n <slot name=\"append\" />\n </div>\n <DoubleContour class=\"pl-text-field__contour\" :group-position=\"groupPosition\" />\n </div>\n <div v-if=\"hasErrors\" class=\"pl-text-field__error\">\n {{ displayErrors.join(\" \") }}\n </div>\n <div v-else-if=\"helper\" class=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SectionSeparator/index.js";
|
|
54
54
|
import re from "./components/PlAccordion/PlAccordionSection.js";
|
|
55
55
|
import "./components/PlAccordion/index.js";
|
|
56
|
-
import ie from "./
|
|
56
|
+
import ie from "./utils/PlCloseModalBtn.js";
|
|
57
|
+
import ae from "./components/PlAlert/PlAlert.js";
|
|
57
58
|
import "./components/PlAlert/index.js";
|
|
58
|
-
import { useLabelNotch as
|
|
59
|
+
import { useLabelNotch as oe } from "./utils/useLabelNotch.js";
|
|
59
60
|
import "./components/PlIcon16/index.js";
|
|
60
61
|
import "./components/PlMaskIcon24/index.js";
|
|
61
|
-
import { useElementPosition as
|
|
62
|
-
import
|
|
62
|
+
import { useElementPosition as se } from "./composition/usePosition.js";
|
|
63
|
+
import ce from "./utils/DropdownOverlay/DropdownOverlay.js";
|
|
63
64
|
import "./utils/DropdownOverlay/index.js";
|
|
64
|
-
import { useWatchFetch as
|
|
65
|
-
import
|
|
65
|
+
import { useWatchFetch as le } from "./composition/useWatchFetch.js";
|
|
66
|
+
import ue from "./components/PlAutocomplete/PlAutocomplete.js";
|
|
66
67
|
import "./components/PlAutocomplete/index.js";
|
|
67
|
-
import
|
|
68
|
+
import de from "./components/PlChip/PlChip.js";
|
|
68
69
|
import "./components/PlChip/index.js";
|
|
69
|
-
import
|
|
70
|
+
import fe from "./components/PlAutocompleteMulti/PlAutocompleteMulti.js";
|
|
70
71
|
import "./components/PlAutocompleteMulti/index.js";
|
|
71
|
-
import
|
|
72
|
+
import pe from "./components/PlBtnAccent/PlBtnAccent.js";
|
|
72
73
|
import "./components/PlBtnAccent/index.js";
|
|
73
|
-
import
|
|
74
|
+
import me from "./components/PlBtnDanger/PlBtnDanger.js";
|
|
74
75
|
import "./components/PlBtnDanger/index.js";
|
|
75
|
-
import
|
|
76
|
+
import he from "./components/PlBtnGhost/PlBtnGhost.js";
|
|
76
77
|
import "./components/PlBtnGhost/index.js";
|
|
77
|
-
import
|
|
78
|
+
import ge from "./components/PlBtnGroup/PlBtnGroup.js";
|
|
78
79
|
import "./components/PlBtnGroup/index.js";
|
|
79
|
-
import
|
|
80
|
-
import
|
|
80
|
+
import _e from "./components/PlBtnSecondary/PlBtnSecondary.js";
|
|
81
|
+
import ve from "./components/PlBtnLink/PlBtnLink.js";
|
|
81
82
|
import "./components/PlBtnLink/index.js";
|
|
82
|
-
import
|
|
83
|
+
import $ from "./components/PlBtnPrimary/PlBtnPrimary.js";
|
|
83
84
|
import "./components/PlBtnPrimary/index.js";
|
|
84
85
|
import "./components/PlBtnSecondary/index.js";
|
|
85
|
-
import
|
|
86
|
+
import ye from "./components/PlBtnSplit/PlBtnSplit.js";
|
|
86
87
|
import "./components/PlBtnSplit/index.js";
|
|
87
|
-
import
|
|
88
|
+
import be from "./components/PlCheckbox/PlCheckbox.js";
|
|
88
89
|
import "./components/PlCheckbox/index.js";
|
|
89
|
-
import
|
|
90
|
+
import xe from "./components/PlCheckboxGroup/PlCheckboxGroup.js";
|
|
90
91
|
import "./components/PlCheckboxGroup/index.js";
|
|
91
|
-
import xe from "./utils/PlCloseModalBtn.js";
|
|
92
92
|
import Se from "./components/PlDialogModal/PlDialogModal.js";
|
|
93
93
|
import "./components/PlDialogModal/index.js";
|
|
94
94
|
import Ce from "./components/PlDropdown/PlDropdown.js";
|
|
@@ -168,6 +168,6 @@ import { watchCached as xt } from "./composition/watchCached.js";
|
|
|
168
168
|
import { icons16 as St } from "./generated/icons-16.js";
|
|
169
169
|
import { icons24 as Ct } from "./generated/icons-24.js";
|
|
170
170
|
var wt = { allCssVariables: I() };
|
|
171
|
-
export { rt as Color, c as ContextProvider, r as DataTable, wt as DemoData, s as DropdownListItem,
|
|
171
|
+
export { rt as Color, c as ContextProvider, r as DataTable, wt as DemoData, s as DropdownListItem, ce as DropdownOverlay, it as Gradient, T as LongText, V as PL_PLACEHOLDER_TEXTS, Q as PlAccordion, re as PlAccordionSection, ae as PlAlert, ue as PlAutocomplete, fe as PlAutocompleteMulti, H as PlBlockPage, pe as PlBtnAccent, me as PlBtnDanger, he as PlBtnGhost, ge as PlBtnGroup, ve as PlBtnLink, $ as PlBtnPrimary, _e as PlBtnSecondary, ye as PlBtnSplit, Je as PlChartHistogram, Ye as PlChartStackedBar, Xe as PlChartStackedBarCompact, be as PlCheckbox, xe as PlCheckboxGroup, de as PlChip, ie as PlCloseModalBtn, K as PlContainer, Se as PlDialogModal, Ce as PlDropdown, we as PlDropdownLegacy, Te as PlDropdownLine, Ee as PlDropdownMulti, De as PlDropdownMultiRef, Oe as PlDropdownRef, ke as PlEditableTitle, Ae as PlElementList, Z as PlErrorBoundary, Ue as PlFileDialog, We as PlFileInput, q as PlGrid, X as PlIcon16, R as PlIcon24, W as PlLoaderCircular, z as PlLoaderLogo, je as PlLogView, X as PlMaskIcon16, R as PlMaskIcon24, Ge as PlNotificationAlert, Me as PlNumberField, B as PlPlaceholder, Ne as PlProgressBar, Pe as PlProgressCell, Ie as PlPureSlideModal, Ze as PlRadio, Qe as PlRadioGroup, J as PlRow, Fe as PlSearchField, ne as PlSectionSeparator, Ke as PlSidebarGroup, qe as PlSidebarItem, Le as PlSlideModal, Y as PlSpacer, G as PlSplash, Re as PlStatusTag, L as PlSvg, ze as PlTabs, Be as PlTextArea, Ve as PlTextField, He as PlToggleSwitch, C as PlTooltip, N as Scrollable, w as Slider, P as SliderRange, F as SliderRangeTriple, o as ThemeSwitcher, l as animate, u as animateInfinite, d as call, $e as categoricalColors, _t as computedCached, f as delay, D as detectOutside, E as downloadContent, O as eventListener, vt as filterUiMetadata, k as getElementScrollPosition, yt as getFilterUiMetadata, bt as getFilterUiTypeOptions, St as icons16, Ct as icons24, at as interpolateColor, A as isElementVisible, p as listToOptions, et as magma, m as makeEaseInOut, h as makeEaseOut, ot as normalizeGradient, g as normalizeListOptions, tt as palettes, _ as randomInt, v as randomString, y as requestTick, j as scrollIntoView, ee as showContextMenu, b as throttle, x as timeout, S as useClickOutside, st as useComponentProp, ct as useConfirm, lt as useDraggable, te as useEventListener, ut as useFormState, t as useHover, dt as useInterval, oe as useLabelNotch, i as useLocalStorage, e as useMouse, n as useMouseCapture, U as usePlBlockPageTitleTeleportTarget, ft as usePollingQuery, se as usePosition, pt as useQuery, M as useResizeObserver, mt as useScroll, ht as useSortable, gt as useSortable2, a as useTheme, le as useWatchFetch, nt as viridis, xt as watchCached };
|
|
172
172
|
|
|
173
173
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/uikit",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.42",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"resize-observer-polyfill": "^1.5.1",
|
|
32
32
|
"sortablejs": "^1.15.6",
|
|
33
33
|
"vue": "^3.5.24",
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
34
|
+
"@platforma-sdk/model": "1.58.19",
|
|
35
|
+
"@milaboratories/helpers": "1.13.7"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@vitest/coverage-istanbul": "^4.0.18",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"svgo": "^3.3.2",
|
|
41
41
|
"typescript": "~5.9.3",
|
|
42
42
|
"vitest": "^4.0.18",
|
|
43
|
-
"@milaboratories/build-configs": "1.5.2",
|
|
44
43
|
"@milaboratories/ts-builder": "1.3.0",
|
|
45
|
-
"@milaboratories/ts-configs": "1.2.2"
|
|
44
|
+
"@milaboratories/ts-configs": "1.2.2",
|
|
45
|
+
"@milaboratories/build-configs": "1.5.2"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"dev": "ts-builder serve --target browser-lib --build-config ./build.browser-lib.config.js",
|
|
@@ -7,6 +7,8 @@ export default {
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
8
|
import "./pl-alert.scss";
|
|
9
9
|
|
|
10
|
+
import PlCloseModalBtn from "../../utils/PlCloseModalBtn.vue";
|
|
11
|
+
|
|
10
12
|
defineEmits<{
|
|
11
13
|
/**
|
|
12
14
|
* Emitted when the model value is updated, typically when the close button is clicked.
|
|
@@ -89,11 +91,9 @@ const iconMap = {
|
|
|
89
91
|
<label v-if="label">{{ label }}</label>
|
|
90
92
|
<div class="pl-alert__main__text"><slot /></div>
|
|
91
93
|
</div>
|
|
92
|
-
<
|
|
94
|
+
<PlCloseModalBtn
|
|
93
95
|
v-if="closeable"
|
|
94
96
|
class="pl-alert__close-btn"
|
|
95
|
-
aria-label="Close alert"
|
|
96
|
-
role="button"
|
|
97
97
|
@click="$emit('update:modelValue', false)"
|
|
98
98
|
/>
|
|
99
99
|
</div>
|
|
@@ -72,12 +72,5 @@
|
|
|
72
72
|
position: absolute;
|
|
73
73
|
top: 10px;
|
|
74
74
|
right: 12px;
|
|
75
|
-
cursor: pointer;
|
|
76
|
-
background-color: #d3d7e0;
|
|
77
|
-
@include mask(url(../../assets/images/24_close.svg), 24px);
|
|
78
|
-
transition: all 0.1s ease-in-out;
|
|
79
|
-
&:hover {
|
|
80
|
-
background-color: var(--main-dark-color);
|
|
81
|
-
}
|
|
82
75
|
}
|
|
83
76
|
}
|
|
@@ -7,9 +7,12 @@ export default {
|
|
|
7
7
|
|
|
8
8
|
<script lang="ts" setup>
|
|
9
9
|
import "./pl-slide-modal.scss";
|
|
10
|
+
|
|
10
11
|
import { ref, useAttrs } from "vue";
|
|
12
|
+
import { useClickOutside } from "../../composition/useClickOutside";
|
|
13
|
+
import { useEventListener } from "../../composition/useEventListener";
|
|
14
|
+
import PlCloseModalBtn from "../../utils/PlCloseModalBtn.vue";
|
|
11
15
|
import TransitionSlidePanel from "../TransitionSlidePanel.vue";
|
|
12
|
-
import { useClickOutside, useEventListener } from "../../index";
|
|
13
16
|
import type { Props } from "./props";
|
|
14
17
|
import { defaultProps } from "./props";
|
|
15
18
|
|
|
@@ -45,7 +48,7 @@ useEventListener(document, "keydown", (evt: KeyboardEvent) => {
|
|
|
45
48
|
v-bind="attrs"
|
|
46
49
|
@keyup.esc="emit('update:modelValue', false)"
|
|
47
50
|
>
|
|
48
|
-
<
|
|
51
|
+
<PlCloseModalBtn class="close-dialog-btn" @click="emit('update:modelValue', false)" />
|
|
49
52
|
<slot />
|
|
50
53
|
</div>
|
|
51
54
|
</TransitionSlidePanel>
|
|
@@ -29,16 +29,8 @@
|
|
|
29
29
|
|
|
30
30
|
.close-dialog-btn {
|
|
31
31
|
position: absolute;
|
|
32
|
-
z-index: 1;
|
|
33
32
|
top: 12px;
|
|
34
33
|
right: 12px;
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
background-color: #d3d7e0;
|
|
37
|
-
@include mask(url("../../assets/images/24_close.svg"), 24px);
|
|
38
|
-
|
|
39
|
-
&:hover {
|
|
40
|
-
background-color: var(--main-dark-color);
|
|
41
|
-
}
|
|
42
34
|
}
|
|
43
35
|
|
|
44
36
|
&.has-title {
|