@topvisor/ui 0.0.18 → 0.0.33
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/.chunks/datepicker-48f2fa8d.es.js +275 -0
- package/.chunks/datepicker-48f2fa8d.es.js.map +1 -0
- package/.chunks/datepicker-f94ba423.amd.js +234 -0
- package/.chunks/datepicker-f94ba423.amd.js.map +1 -0
- package/.chunks/forms-6c397f5a.es.js +935 -0
- package/.chunks/forms-6c397f5a.es.js.map +1 -0
- package/.chunks/forms-cab135c7.amd.js +3 -0
- package/.chunks/forms-cab135c7.amd.js.map +1 -0
- package/.chunks/{popup-dd9546aa.es.js → popup-04c385e0.es.js} +2 -3
- package/.chunks/{popup-dd9546aa.es.js.map → popup-04c385e0.es.js.map} +1 -1
- package/.chunks/{popup-b891abb1.amd.js → popup-33f53a1c.amd.js} +2 -2
- package/.chunks/{popup-b891abb1.amd.js.map → popup-33f53a1c.amd.js.map} +1 -1
- package/core/core.amd.js +1 -1
- package/core/core.js +2 -3
- package/core/core.js.map +1 -1
- package/core.css +1 -1
- package/forms/forms.amd.js +1 -1
- package/forms/forms.js +9 -7
- package/forms.css +1 -1
- package/formsExt/formsExt.amd.js +3 -0
- package/formsExt/formsExt.amd.js.map +1 -0
- package/formsExt/formsExt.js +152 -0
- package/formsExt/formsExt.js.map +1 -0
- package/{editArea.css → formsExt.css} +1 -1
- package/package.json +1 -1
- package/popup/popup.amd.js +2 -2
- package/popup/popup.js +5 -6
- package/popup/popup.js.map +1 -1
- package/popup/worker.amd.js +1 -1
- package/popup/worker.amd.js.map +1 -1
- package/popup/worker.js +2 -3
- package/popup/worker.js.map +1 -1
- package/tabs/tabs.amd.js +1 -1
- package/tabs/tabs.js +1 -1
- package/utils/date.amd.js +2 -0
- package/utils/date.amd.js.map +1 -0
- package/utils/date.js +6 -0
- package/utils/date.js.map +1 -0
- package/utils/device.amd.js +1 -1
- package/utils/device.amd.js.map +1 -1
- package/utils/device.js +2 -30
- package/utils/device.js.map +1 -1
- package/.chunks/core-96a4bfb4.amd.js +0 -2
- package/.chunks/core-96a4bfb4.amd.js.map +0 -1
- package/.chunks/core-fd9de702.es.js +0 -121
- package/.chunks/core-fd9de702.es.js.map +0 -1
- package/.chunks/forms-1dc7c6f3.amd.js +0 -3
- package/.chunks/forms-1dc7c6f3.amd.js.map +0 -1
- package/.chunks/forms-3575c189.es.js +0 -461
- package/.chunks/forms-3575c189.es.js.map +0 -1
- package/editArea/editArea.amd.js +0 -3
- package/editArea/editArea.amd.js.map +0 -1
- package/editArea/editArea.js +0 -111
- package/editArea/editArea.js.map +0 -1
|
@@ -1,461 +0,0 @@
|
|
|
1
|
-
import { defineComponent as c, computed as u, openBlock as r, createBlock as v, resolveDynamicComponent as B, normalizeClass as i, withCtx as w, renderSlot as _, createTextVNode as C, toDisplayString as f, createElementBlock as p, useCssVars as M, resolveDirective as E, withDirectives as y, createElementVNode as h, mergeProps as L, vModelText as k, createCommentVNode as d, vModelCheckbox as V, withKeys as z, vModelRadio as S } from "vue";
|
|
2
|
-
const T = /* @__PURE__ */ c({
|
|
3
|
-
__name: "button",
|
|
4
|
-
props: {
|
|
5
|
-
color: { default: "blue" },
|
|
6
|
-
styling: { default: "" },
|
|
7
|
-
size: { default: "s" },
|
|
8
|
-
name: {},
|
|
9
|
-
title: {},
|
|
10
|
-
icon: {},
|
|
11
|
-
icon2: {},
|
|
12
|
-
href: {},
|
|
13
|
-
disabled: { type: Boolean },
|
|
14
|
-
isSubmit: { type: Boolean },
|
|
15
|
-
isActive: { type: Boolean },
|
|
16
|
-
isProgress: { type: Boolean }
|
|
17
|
-
},
|
|
18
|
-
setup(l) {
|
|
19
|
-
const t = l, a = u(() => t.href ? "a" : "button"), s = u(() => t.isSubmit ? "submit" : void 0);
|
|
20
|
-
return (e, n) => (r(), v(B(a.value), {
|
|
21
|
-
class: i({
|
|
22
|
-
"top-active": e.isActive,
|
|
23
|
-
"top-disabled": e.disabled,
|
|
24
|
-
"top-forms-focusable": !e.disabled,
|
|
25
|
-
"top-button": !0,
|
|
26
|
-
"top-button-progress": e.isProgress,
|
|
27
|
-
[`top-size_${e.size}`]: !!e.size,
|
|
28
|
-
[`top-color_${e.color}`]: !0,
|
|
29
|
-
[`top-style_${e.styling}`]: !!e.styling
|
|
30
|
-
}),
|
|
31
|
-
name: e.name,
|
|
32
|
-
title: e.title,
|
|
33
|
-
href: e.href,
|
|
34
|
-
type: s.value,
|
|
35
|
-
"data-top-icon": e.icon || void 0,
|
|
36
|
-
"data-top-icon2": e.icon2 || void 0,
|
|
37
|
-
disabled: e.disabled || void 0,
|
|
38
|
-
inProgress: e.isProgress
|
|
39
|
-
}, {
|
|
40
|
-
default: w(() => [
|
|
41
|
-
_(e.$slots, "default", {}, () => [
|
|
42
|
-
C(f(e.icon ? "" : "Button"), 1)
|
|
43
|
-
])
|
|
44
|
-
]),
|
|
45
|
-
_: 3
|
|
46
|
-
}, 8, ["class", "name", "title", "href", "type", "data-top-icon", "data-top-icon2", "disabled", "inProgress"]));
|
|
47
|
-
}
|
|
48
|
-
}), P = "_progress_1f1nw_1", A = {
|
|
49
|
-
"top-button": "top-button",
|
|
50
|
-
"top-active": "top-active",
|
|
51
|
-
"top-button-progress": "top-button-progress",
|
|
52
|
-
progress: P,
|
|
53
|
-
"top-color_blue": "top-color_blue",
|
|
54
|
-
"top-color_green": "top-color_green",
|
|
55
|
-
"top-color_orange": "top-color_orange",
|
|
56
|
-
"top-color_red": "top-color_red",
|
|
57
|
-
"top-color_pink": "top-color_pink",
|
|
58
|
-
"top-color_theme": "top-color_theme",
|
|
59
|
-
"top-style_outline": "top-style_outline",
|
|
60
|
-
"top-style_soft": "top-style_soft",
|
|
61
|
-
"top-style_transparent": "top-style_transparent",
|
|
62
|
-
"top-size_l": "top-size_l",
|
|
63
|
-
"top-size_xl": "top-size_xl"
|
|
64
|
-
}, m = (l, t) => {
|
|
65
|
-
const a = l.__vccOpts || l;
|
|
66
|
-
for (const [s, e] of t)
|
|
67
|
-
a[s] = e;
|
|
68
|
-
return a;
|
|
69
|
-
}, U = {
|
|
70
|
-
$style: A
|
|
71
|
-
}, he = /* @__PURE__ */ m(T, [["__cssModules", U]]), W = ["title"], D = /* @__PURE__ */ c({
|
|
72
|
-
__name: "hint",
|
|
73
|
-
props: {
|
|
74
|
-
hint: {}
|
|
75
|
-
},
|
|
76
|
-
setup(l) {
|
|
77
|
-
return (t, a) => (r(), p("span", {
|
|
78
|
-
class: "top-hint",
|
|
79
|
-
"data-top-icon": "",
|
|
80
|
-
title: t.hint
|
|
81
|
-
}, null, 8, W));
|
|
82
|
-
}
|
|
83
|
-
}), H = {
|
|
84
|
-
"top-hint": "top-hint"
|
|
85
|
-
}, N = {
|
|
86
|
-
$style: H
|
|
87
|
-
}, K = /* @__PURE__ */ m(D, [["__cssModules", N]]), O = ["name", "placeholder", "disabled", "readonly", "rows"], R = {
|
|
88
|
-
key: 0,
|
|
89
|
-
class: "top-textarea_pseudoContent"
|
|
90
|
-
}, j = /* @__PURE__ */ c({
|
|
91
|
-
inheritAttrs: !1,
|
|
92
|
-
__name: "textarea",
|
|
93
|
-
props: {
|
|
94
|
-
modelValue: {},
|
|
95
|
-
name: {},
|
|
96
|
-
placeholder: {},
|
|
97
|
-
rows: { default: 5 },
|
|
98
|
-
minHeight: { default: 120 },
|
|
99
|
-
expandable: { type: Boolean },
|
|
100
|
-
disabled: { type: Boolean },
|
|
101
|
-
readonly: { type: Boolean },
|
|
102
|
-
isError: { type: Boolean },
|
|
103
|
-
hint: {}
|
|
104
|
-
},
|
|
105
|
-
emits: ["update:modelValue"],
|
|
106
|
-
setup(l, { emit: t }) {
|
|
107
|
-
const a = l;
|
|
108
|
-
M((e) => ({
|
|
109
|
-
"17d63e56": e.minHeight + "px"
|
|
110
|
-
}));
|
|
111
|
-
const s = u({
|
|
112
|
-
get() {
|
|
113
|
-
return a.modelValue;
|
|
114
|
-
},
|
|
115
|
-
set(e) {
|
|
116
|
-
t("update:modelValue", e);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
return (e, n) => {
|
|
120
|
-
const o = E("tv-tooltip");
|
|
121
|
-
return r(), p("label", {
|
|
122
|
-
class: i({
|
|
123
|
-
"top-textarea": !0,
|
|
124
|
-
["top-textarea-" + e.name]: e.name,
|
|
125
|
-
"top-disabled": e.disabled
|
|
126
|
-
})
|
|
127
|
-
}, [
|
|
128
|
-
y(h("textarea", L({
|
|
129
|
-
type: "text",
|
|
130
|
-
class: {
|
|
131
|
-
"top-forms-focusable": !e.disabled,
|
|
132
|
-
"top-textarea_textarea": !0,
|
|
133
|
-
"top-textarea_textarea-expandable": e.expandable,
|
|
134
|
-
"top-error": e.isError
|
|
135
|
-
},
|
|
136
|
-
autocomplete: "off_always",
|
|
137
|
-
name: e.name,
|
|
138
|
-
placeholder: e.placeholder,
|
|
139
|
-
disabled: e.disabled,
|
|
140
|
-
readonly: e.readonly,
|
|
141
|
-
rows: e.expandable ? void 0 : e.rows
|
|
142
|
-
}, e.$attrs, {
|
|
143
|
-
"onUpdate:modelValue": n[0] || (n[0] = (b) => s.value = b)
|
|
144
|
-
}), null, 16, O), [
|
|
145
|
-
[k, s.value]
|
|
146
|
-
]),
|
|
147
|
-
e.expandable ? (r(), p("div", R, f(s.value + " "), 1)) : d("", !0),
|
|
148
|
-
e.hint ? y((r(), v(K, {
|
|
149
|
-
key: 1,
|
|
150
|
-
class: "top-textarea_hint",
|
|
151
|
-
hint: e.hint
|
|
152
|
-
}, null, 8, ["hint"])), [
|
|
153
|
-
[o]
|
|
154
|
-
]) : d("", !0)
|
|
155
|
-
], 2);
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
}), q = {
|
|
159
|
-
"top-textarea": "top-textarea",
|
|
160
|
-
"top-textarea_textarea": "top-textarea_textarea",
|
|
161
|
-
"top-textarea_textarea-expandable": "top-textarea_textarea-expandable",
|
|
162
|
-
"top-textarea_pseudoContent": "top-textarea_pseudoContent",
|
|
163
|
-
"top-textarea_hint": "top-textarea_hint"
|
|
164
|
-
}, F = {
|
|
165
|
-
$style: q
|
|
166
|
-
}, fe = /* @__PURE__ */ m(j, [["__cssModules", F]]), G = { class: "top-forms-optionLabel" }, I = {
|
|
167
|
-
key: 0,
|
|
168
|
-
class: "top-forms-optionLabel_description"
|
|
169
|
-
}, J = /* @__PURE__ */ c({
|
|
170
|
-
__name: "controlLabel",
|
|
171
|
-
props: {
|
|
172
|
-
title: {},
|
|
173
|
-
description: {},
|
|
174
|
-
disabled: { type: Boolean }
|
|
175
|
-
},
|
|
176
|
-
setup(l) {
|
|
177
|
-
return (t, a) => (r(), p("div", G, [
|
|
178
|
-
h("div", {
|
|
179
|
-
class: i({
|
|
180
|
-
"top-forms-optionLabel_title": !0,
|
|
181
|
-
"top-forms-optionLabel_title-disabled": t.disabled
|
|
182
|
-
})
|
|
183
|
-
}, f(t.title), 3),
|
|
184
|
-
t.description ? (r(), p("div", I, f(t.description), 1)) : d("", !0)
|
|
185
|
-
]));
|
|
186
|
-
}
|
|
187
|
-
}), Q = {
|
|
188
|
-
"top-forms-optionLabel": "top-forms-optionLabel",
|
|
189
|
-
"top-forms-optionLabel_title": "top-forms-optionLabel_title",
|
|
190
|
-
"top-forms-optionLabel_title-disabled": "top-forms-optionLabel_title-disabled",
|
|
191
|
-
"top-forms-optionLabel_description": "top-forms-optionLabel_description"
|
|
192
|
-
}, X = {
|
|
193
|
-
$style: Q
|
|
194
|
-
}, $ = /* @__PURE__ */ m(J, [["__cssModules", X]]), Y = ["name", "value", "indeterminate", "disabled"], Z = /* @__PURE__ */ c({
|
|
195
|
-
__name: "checkbox",
|
|
196
|
-
props: {
|
|
197
|
-
modelValue: { type: [Boolean, Array, Set] },
|
|
198
|
-
name: {},
|
|
199
|
-
value: {},
|
|
200
|
-
title: {},
|
|
201
|
-
description: {},
|
|
202
|
-
disabled: { type: Boolean },
|
|
203
|
-
indeterminate: { type: Boolean },
|
|
204
|
-
isError: { type: Boolean }
|
|
205
|
-
},
|
|
206
|
-
emits: ["update:modelValue"],
|
|
207
|
-
setup(l, { emit: t }) {
|
|
208
|
-
const a = l, s = u({
|
|
209
|
-
get() {
|
|
210
|
-
return a.modelValue;
|
|
211
|
-
},
|
|
212
|
-
set(e) {
|
|
213
|
-
t("update:modelValue", e);
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
return (e, n) => (r(), p("label", {
|
|
217
|
-
class: i({
|
|
218
|
-
"top-forms-optionWrapper": !0,
|
|
219
|
-
"top-checkbox": !0,
|
|
220
|
-
["top-checkbox_" + e.name]: e.name !== "",
|
|
221
|
-
"top-disabled": e.disabled,
|
|
222
|
-
"top-error": e.isError && !e.disabled
|
|
223
|
-
})
|
|
224
|
-
}, [
|
|
225
|
-
y(h("input", {
|
|
226
|
-
type: "checkbox",
|
|
227
|
-
class: i({
|
|
228
|
-
"top-forms-focusable": !e.disabled,
|
|
229
|
-
"top-forms-option": !0,
|
|
230
|
-
"top-checkbox_input": !0,
|
|
231
|
-
"top-error": e.isError && !e.disabled
|
|
232
|
-
}),
|
|
233
|
-
name: e.name,
|
|
234
|
-
"onUpdate:modelValue": n[0] || (n[0] = (o) => s.value = o),
|
|
235
|
-
value: e.value,
|
|
236
|
-
indeterminate: e.indeterminate,
|
|
237
|
-
disabled: e.disabled
|
|
238
|
-
}, null, 10, Y), [
|
|
239
|
-
[V, s.value]
|
|
240
|
-
]),
|
|
241
|
-
e.title ? (r(), v($, {
|
|
242
|
-
key: 0,
|
|
243
|
-
title: e.title,
|
|
244
|
-
description: e.description,
|
|
245
|
-
disabled: e.disabled
|
|
246
|
-
}, null, 8, ["title", "description", "disabled"])) : d("", !0)
|
|
247
|
-
], 2));
|
|
248
|
-
}
|
|
249
|
-
}), x = {
|
|
250
|
-
"top-checkbox": "top-checkbox",
|
|
251
|
-
"top-checkbox_input": "top-checkbox_input",
|
|
252
|
-
"top-error": "top-error"
|
|
253
|
-
}, ee = {
|
|
254
|
-
$style: x
|
|
255
|
-
}, ve = /* @__PURE__ */ m(Z, [["__cssModules", ee]]), oe = ["data-top-icon"], te = ["name", "title", "placeholder", "disabled", "readonly"], se = {
|
|
256
|
-
key: 2,
|
|
257
|
-
class: "top-formsCaption"
|
|
258
|
-
}, ae = /* @__PURE__ */ c({
|
|
259
|
-
__name: "input",
|
|
260
|
-
props: {
|
|
261
|
-
modelValue: {},
|
|
262
|
-
name: {},
|
|
263
|
-
disabled: { type: Boolean },
|
|
264
|
-
readonly: { type: Boolean },
|
|
265
|
-
title: {},
|
|
266
|
-
captionType: { default: "" },
|
|
267
|
-
size: { default: "s" },
|
|
268
|
-
icon: {},
|
|
269
|
-
addCleaner: { type: Boolean },
|
|
270
|
-
isError: { type: Boolean }
|
|
271
|
-
},
|
|
272
|
-
emits: ["update:modelValue"],
|
|
273
|
-
setup(l, { emit: t }) {
|
|
274
|
-
const a = l, s = u({
|
|
275
|
-
get() {
|
|
276
|
-
return a.modelValue;
|
|
277
|
-
},
|
|
278
|
-
set(o) {
|
|
279
|
-
t("update:modelValue", o);
|
|
280
|
-
}
|
|
281
|
-
}), e = u(() => a.addCleaner && !a.title || a.captionType !== "" ? "" : a.title), n = () => {
|
|
282
|
-
t("update:modelValue", "");
|
|
283
|
-
};
|
|
284
|
-
return (o, b) => (r(), p("label", {
|
|
285
|
-
class: i({
|
|
286
|
-
"top-input": !0,
|
|
287
|
-
["top-input-" + o.name]: o.name,
|
|
288
|
-
["top-size_" + o.size]: !0,
|
|
289
|
-
"top-disabled": o.disabled,
|
|
290
|
-
"top-input-withCleaner": o.addCleaner,
|
|
291
|
-
"top-formsCaptionWrapper": o.captionType !== "",
|
|
292
|
-
"top-formsCaptionWrapper-always": o.captionType === "top",
|
|
293
|
-
"top-input-withButton": !!o.$slots.btn
|
|
294
|
-
}),
|
|
295
|
-
"data-top-icon": o.icon
|
|
296
|
-
}, [
|
|
297
|
-
y(h("input", {
|
|
298
|
-
type: "text",
|
|
299
|
-
class: i({
|
|
300
|
-
"top-forms-focusable": !o.disabled,
|
|
301
|
-
"top-input_input": !0,
|
|
302
|
-
"top-error": o.isError
|
|
303
|
-
}),
|
|
304
|
-
autocomplete: "off_always",
|
|
305
|
-
name: o.name,
|
|
306
|
-
"onUpdate:modelValue": b[0] || (b[0] = (g) => s.value = g),
|
|
307
|
-
title: o.title,
|
|
308
|
-
placeholder: e.value,
|
|
309
|
-
disabled: o.disabled,
|
|
310
|
-
readonly: o.readonly,
|
|
311
|
-
onKeydown: b[1] || (b[1] = z(() => (o.addCleaner || !!o.$slots.btn) && n(), ["esc"]))
|
|
312
|
-
}, null, 42, te), [
|
|
313
|
-
[k, s.value]
|
|
314
|
-
]),
|
|
315
|
-
o.addCleaner && s.value ? (r(), p("span", {
|
|
316
|
-
key: 0,
|
|
317
|
-
class: "top-input_cleaner top-cleaner",
|
|
318
|
-
"data-top-icon": "",
|
|
319
|
-
onClick: n
|
|
320
|
-
})) : d("", !0),
|
|
321
|
-
s.value ? _(o.$slots, "btn", { key: 1 }) : d("", !0),
|
|
322
|
-
_(o.$slots, "default"),
|
|
323
|
-
o.captionType !== "" ? (r(), p("span", se, f(o.title), 1)) : d("", !0)
|
|
324
|
-
], 10, oe));
|
|
325
|
-
}
|
|
326
|
-
}), le = {
|
|
327
|
-
"top-input": "top-input",
|
|
328
|
-
"top-input_input": "top-input_input",
|
|
329
|
-
"top-input-withCleaner": "top-input-withCleaner"
|
|
330
|
-
}, re = {
|
|
331
|
-
$style: le
|
|
332
|
-
}, _e = /* @__PURE__ */ m(ae, [["__cssModules", re]]), ne = ["name", "value", "disabled"], pe = /* @__PURE__ */ c({
|
|
333
|
-
__name: "radio",
|
|
334
|
-
props: {
|
|
335
|
-
modelValue: {},
|
|
336
|
-
value: {},
|
|
337
|
-
name: {},
|
|
338
|
-
title: {},
|
|
339
|
-
description: {},
|
|
340
|
-
disabled: { type: Boolean },
|
|
341
|
-
isError: { type: Boolean }
|
|
342
|
-
},
|
|
343
|
-
emits: ["update:modelValue"],
|
|
344
|
-
setup(l, { emit: t }) {
|
|
345
|
-
const a = l, s = u({
|
|
346
|
-
get() {
|
|
347
|
-
return a.modelValue;
|
|
348
|
-
},
|
|
349
|
-
set(e) {
|
|
350
|
-
t("update:modelValue", e);
|
|
351
|
-
}
|
|
352
|
-
});
|
|
353
|
-
return (e, n) => (r(), p("label", {
|
|
354
|
-
class: i({
|
|
355
|
-
"top-forms-optionWrapper": !0,
|
|
356
|
-
"top-radio": !0,
|
|
357
|
-
["top-radio_" + e.name]: e.name !== "",
|
|
358
|
-
"top-disabled": e.disabled,
|
|
359
|
-
"top-error": e.isError && !e.disabled
|
|
360
|
-
})
|
|
361
|
-
}, [
|
|
362
|
-
y(h("input", {
|
|
363
|
-
type: "radio",
|
|
364
|
-
class: i({
|
|
365
|
-
"top-forms-focusable": !e.disabled,
|
|
366
|
-
"top-forms-option": !0,
|
|
367
|
-
"top-radio_input": !0,
|
|
368
|
-
"top-error": e.isError && !e.disabled
|
|
369
|
-
}),
|
|
370
|
-
"onUpdate:modelValue": n[0] || (n[0] = (o) => s.value = o),
|
|
371
|
-
name: e.name,
|
|
372
|
-
value: e.value,
|
|
373
|
-
disabled: e.disabled
|
|
374
|
-
}, null, 10, ne), [
|
|
375
|
-
[S, s.value]
|
|
376
|
-
]),
|
|
377
|
-
e.title ? (r(), v($, {
|
|
378
|
-
key: 0,
|
|
379
|
-
title: e.title,
|
|
380
|
-
description: e.description,
|
|
381
|
-
disabled: e.disabled
|
|
382
|
-
}, null, 8, ["title", "description", "disabled"])) : d("", !0)
|
|
383
|
-
], 2));
|
|
384
|
-
}
|
|
385
|
-
}), ie = {
|
|
386
|
-
"top-radio": "top-radio",
|
|
387
|
-
"top-radio_input": "top-radio_input",
|
|
388
|
-
"top-error": "top-error"
|
|
389
|
-
}, de = {
|
|
390
|
-
$style: ie
|
|
391
|
-
}, $e = /* @__PURE__ */ m(pe, [["__cssModules", de]]), ue = ["name", "value", "disabled"], ce = /* @__PURE__ */ c({
|
|
392
|
-
__name: "switcher",
|
|
393
|
-
props: {
|
|
394
|
-
modelValue: { type: [Boolean, Array, Set] },
|
|
395
|
-
name: {},
|
|
396
|
-
value: {},
|
|
397
|
-
title: {},
|
|
398
|
-
description: {},
|
|
399
|
-
disabled: { type: Boolean },
|
|
400
|
-
isError: { type: Boolean }
|
|
401
|
-
},
|
|
402
|
-
emits: ["update:modelValue"],
|
|
403
|
-
setup(l, { emit: t }) {
|
|
404
|
-
const a = l, s = u({
|
|
405
|
-
get() {
|
|
406
|
-
return a.modelValue;
|
|
407
|
-
},
|
|
408
|
-
set(e) {
|
|
409
|
-
t("update:modelValue", e);
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
return (e, n) => (r(), p("label", {
|
|
413
|
-
class: i({
|
|
414
|
-
"top-forms-optionWrapper": !0,
|
|
415
|
-
"top-checkboxSwitcher": !0,
|
|
416
|
-
"top-disabled": e.disabled,
|
|
417
|
-
"top-error": e.isError && !e.disabled
|
|
418
|
-
})
|
|
419
|
-
}, [
|
|
420
|
-
y(h("input", {
|
|
421
|
-
type: "checkbox",
|
|
422
|
-
class: i({
|
|
423
|
-
"top-forms-focusable": !e.disabled,
|
|
424
|
-
"top-forms-option": !0,
|
|
425
|
-
"top-checkboxSwitcher_input": !0,
|
|
426
|
-
"top-error": e.isError && !e.disabled
|
|
427
|
-
}),
|
|
428
|
-
"onUpdate:modelValue": n[0] || (n[0] = (o) => s.value = o),
|
|
429
|
-
name: e.name,
|
|
430
|
-
value: e.value,
|
|
431
|
-
disabled: e.disabled
|
|
432
|
-
}, null, 10, ue), [
|
|
433
|
-
[V, s.value]
|
|
434
|
-
]),
|
|
435
|
-
e.title ? (r(), v($, {
|
|
436
|
-
key: 0,
|
|
437
|
-
title: e.title,
|
|
438
|
-
description: e.description,
|
|
439
|
-
disabled: e.disabled
|
|
440
|
-
}, null, 8, ["title", "description", "disabled"])) : d("", !0)
|
|
441
|
-
], 2));
|
|
442
|
-
}
|
|
443
|
-
}), me = {
|
|
444
|
-
"top-checkboxSwitcher": "top-checkboxSwitcher",
|
|
445
|
-
"top-checkboxSwitcher_input": "top-checkboxSwitcher_input",
|
|
446
|
-
"top-error": "top-error"
|
|
447
|
-
}, be = {
|
|
448
|
-
$style: me
|
|
449
|
-
}, ke = /* @__PURE__ */ m(ce, [["__cssModules", be]]);
|
|
450
|
-
export {
|
|
451
|
-
he as B,
|
|
452
|
-
$ as C,
|
|
453
|
-
K as H,
|
|
454
|
-
fe as T,
|
|
455
|
-
m as _,
|
|
456
|
-
ve as c,
|
|
457
|
-
_e as i,
|
|
458
|
-
$e as r,
|
|
459
|
-
ke as s
|
|
460
|
-
};
|
|
461
|
-
//# sourceMappingURL=forms-3575c189.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"forms-3575c189.es.js","sources":["../../src/components/forms/button/button.vue","../../src/components/forms/textarea/textarea.vue","../../src/components/forms/checkbox/checkbox.vue","../../src/components/forms/input/input.vue","../../src/components/forms/radio/radio.vue","../../src/components/forms/switcher/switcher.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport type { Props } from './button';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tcolor: 'blue',\r\n\tstyling: '',\r\n\tsize: 's',\r\n});\r\n\r\nconst tagName = computed(() => props.href ? 'a' : 'button');\r\n\r\nconst type = computed(() => props.isSubmit ? 'submit' : undefined);\r\n</script>\r\n\r\n<template>\r\n\t<component\r\n\t\t:is=\"tagName\"\r\n\t\t:class=\"{\r\n\t\t\t['top-active']: isActive,\r\n\t\t\t['top-disabled']: disabled,\r\n\t\t\t['top-forms-focusable']: !disabled,\r\n\t\t\t['top-button']: true,\r\n\t\t\t['top-button-progress']: isProgress,\r\n\t\t\t[`top-size_${size}`]: !!size,\r\n\t\t\t[`top-color_${color}`]: true,\r\n\t\t\t[`top-style_${styling}`]: !!styling,\r\n\t\t}\"\r\n\t\t:name=\"name\"\r\n\t\t:title=\"title\"\r\n\t\t:href=\"href\"\r\n\t\t:type=\"type\"\r\n\t\t:data-top-icon=\"icon || undefined\"\r\n\t\t:data-top-icon2=\"icon2 || undefined\"\r\n\t\t:disabled=\"disabled || undefined\"\r\n\t\t:inProgress=\"isProgress\"\r\n\t>\r\n\t\t<!-- @slot Текст или HTML в кнопке -->\r\n\t\t<slot>\r\n\t\t\t{{ !icon ? 'Button' : '' }}\r\n\t\t</slot>\r\n\t</component>\r\n</template>\r\n\r\n<style module>\r\n@import \"./style/button.css\";\r\n@import \"./style/style-outline.css\";\r\n@import \"./style/style-soft.css\";\r\n@import \"./style/style-transparent.css\";\r\n\r\n.top-button {\r\n\t--top-button-color: var(--color-white);\r\n\t--top-button-background-color: transparent;\r\n\t--top-button-background-color-hover: var(--top-button-background-color);\r\n\t--top-button-background-color-active: var(--top-button-background-color-hover);\r\n\t--top-button-background-color-selected: var(--top-button-background-color-hover);\r\n\t--top-button-box-shadow: none;\r\n\t--top-button-box-shadow-hover: var(--top-shadow-darken-2);\r\n\t--top-button-box-shadow-active: var(--top-shadow-darken-3);\r\n\t--top-button-box-shadow-selected: var(--top-shadow-darken-3);\r\n\t--top-forms-border-width: 0px;\r\n\t--top-icon-width: calc(var(--top-icon-size) + var(--top-forms-padding));\r\n\t--top-icon2-width: calc(var(--top-icon2-size) + var(--top-forms-padding));\r\n}\r\n\r\n.top-button.top-size_l {\r\n\t--top-forms-padding: var(--top-forms-padding_l);\r\n\t--top-forms-base-height: var(--top-forms-base-height_l);\r\n}\r\n\r\n.top-button.top-size_xl {\r\n\t--top-forms-padding: var(--top-forms-padding_xl);\r\n\t--top-forms-base-height: var(--top-forms-base-height_xl);\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport Hint from '@/components/forms/hint/hint.vue';\r\nimport type { Props, Emits } from './textarea';\r\n\r\ndefineOptions({\r\n\tinheritAttrs: false,\r\n});\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\trows: 5,\r\n\tminHeight: 120,\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst value = computed({\r\n\tget () {\r\n\t\treturn props.modelValue;\r\n\t},\r\n\tset (value) {\r\n\t\temit('update:modelValue', value);\r\n\t},\r\n});\r\n</script>\r\n\r\n<template>\r\n\t<label\r\n\t\t:class=\"{\r\n\t\t\t['top-textarea']: true,\r\n\t\t\t['top-textarea-' + name]: name,\r\n\t\t\t['top-disabled']: disabled,\r\n\t\t}\"\r\n\t>\r\n\t\t<textarea\r\n\t\t\ttype=\"text\"\r\n\t\t\t:class=\"{\r\n\t\t\t\t['top-forms-focusable']: !disabled,\r\n\t\t\t\t['top-textarea_textarea']: true,\r\n\t\t\t\t['top-textarea_textarea-expandable']: expandable,\r\n\t\t\t\t['top-error']: isError,\r\n\t\t\t}\"\r\n\t\t\tautocomplete=\"off_always\"\r\n\t\t\t:name=\"name\"\r\n\t\t\t:placeholder=\"placeholder\"\r\n\t\t\t:disabled=\"disabled\"\r\n\t\t\t:readonly=\"readonly\"\r\n\t\t\t:rows=\"!expandable ? rows : undefined\"\r\n\t\t\t:=\"$attrs\"\r\n\t\t\tv-model=\"value\"\r\n\t\t/>\r\n\r\n\t\t<div\r\n\t\t\tv-if=\"expandable\"\r\n\t\t\tclass=\"top-textarea_pseudoContent\"\r\n\t\t>\r\n\t\t\t{{ value + ' ' }}\r\n\t\t</div>\r\n\r\n\t\t<Hint\r\n\t\t\tv-if=\"hint\"\r\n\t\t\tclass=\"top-textarea_hint\"\r\n\t\t\t:hint=\"hint\"\r\n\t\t\tv-tv-tooltip\r\n\t\t/>\r\n\t</label>\r\n</template>\r\n\r\n<style module>\r\n.top-textarea {\r\n\twidth: 180px;\r\n\tdisplay: inline-flex;\r\n\talign-items: center;\r\n\tposition: relative;\r\n}\r\n\r\n.top-textarea_textarea {\r\n\tbackground: var(--top-forms-background-color);\r\n\twidth: 100%;\r\n\tpadding: var(--top-forms-padding);\r\n\tresize: none;\r\n}\r\n\r\n.top-textarea_textarea:hover {\r\n\tbackground: var(--top-forms-background-color-hover);\r\n}\r\n\r\n.top-textarea_textarea:focus {\r\n\toutline-color: var(--color-theme-75);\r\n\toutline-offset: 0px;\r\n}\r\n\r\n.top-textarea_textarea.top-textarea_textarea-expandable {\r\n\twidth: 100%;\r\n\theight: 100%;\r\n\toverflow: hidden;\r\n\tposition: absolute;\r\n\ttop: 0;\r\n\tleft: 0;\r\n}\r\n\r\n.top-textarea_pseudoContent {\r\n\tbox-sizing: border-box;\r\n\tmin-height: v-bind(minHeight + 'px');\r\n\tpadding: var(--top-forms-padding);\r\n\tfont-size: 14px;\r\n\twhite-space: pre-wrap;\r\n\toverflow-wrap: anywhere;\r\n\tpointer-events: none;\r\n\topacity: 0;\r\n\tz-index: -1;\r\n}\r\n\r\n.top-textarea_hint {\r\n\tposition: absolute;\r\n\ttop: 2px;\r\n\tright: 2px;\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport type { Props, Emits } from './checkbox';\r\nimport ControlLabel from '../controlLabel/controlLabel.vue';\r\n\r\nconst props = defineProps<Props>();\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst localValue = computed({\r\n\tget () {\r\n\t\treturn props.modelValue;\r\n\t},\r\n\tset (value) {\r\n\t\temit('update:modelValue', value);\r\n\t},\r\n});\r\n\r\n</script>\r\n\r\n<template>\r\n\t<label :class=\"{\r\n\t\t['top-forms-optionWrapper']: true,\r\n\t\t['top-checkbox']: true,\r\n\t\t['top-checkbox_' + name]: name !== '',\r\n\t\t['top-disabled']: disabled,\r\n\t\t['top-error']: isError && !disabled,\r\n\t}\">\r\n\t\t<input\r\n\t\t\ttype=\"checkbox\"\r\n\t\t\t:class=\"{\r\n\t\t\t\t['top-forms-focusable']: !disabled,\r\n\t\t\t\t['top-forms-option']: true,\r\n\t\t\t\t['top-checkbox_input']: true,\r\n\t\t\t\t['top-error']: isError && !disabled,\r\n\t\t\t}\"\r\n\t\t\t:name=\"name\"\r\n\t\t\tv-model=\"localValue\"\r\n\t\t\t:value=\"value\"\r\n\t\t\t:indeterminate=\"indeterminate\"\r\n\t\t\t:disabled=\"disabled\"\r\n\t\t>\r\n\r\n\t\t<ControlLabel\r\n\t\t\tv-if=\"title\"\r\n\t\t\t:title=\"title\"\r\n\t\t\t:description=\"description\"\r\n\t\t\t:disabled=\"disabled\"\r\n\t\t/>\r\n\t</label>\r\n</template>\r\n\r\n<style module>\r\n.top-checkbox {\r\n\tcursor: pointer;\r\n\tdisplay: inline-flex;\r\n}\r\n\r\n.top-checkbox_input {\r\n\tcursor: inherit;\r\n\tborder-radius: 4px;\r\n\tbackground: var(--content-background-color);\r\n\tborder: 1px solid var(--top-forms-border-color);\r\n\twidth: calc(var(--top-forms-option-height) - 3px * 2);\r\n\theight: calc(var(--top-forms-option-height) - 3px * 2);\r\n}\r\n\r\n.top-checkbox_input:before {\r\n\tcontent: ' ';\r\n\tcolor: #FFF;\r\n\tfont-family: 'Topvisor-2';\r\n\tfont-size: 16px;\r\n}\r\n\r\n.top-checkbox_input:hover {\r\n\tborder-color: var(--top-forms-option-color);\r\n\tbackground: var(--color-theme-50)\r\n}\r\n\r\n/* checked / indeterminate */\r\n.top-checkbox_input:checked,\r\n.top-checkbox_input:indeterminate {\r\n\tborder-color: var(--top-forms-option-color);\r\n\tbackground: var(--top-forms-option-color);\r\n}\r\n\r\n.top-checkbox_input:checked:before {\r\n\tcontent: '';\r\n}\r\n\r\n.top-checkbox_input:indeterminate:before {\r\n\tcontent: '';\r\n}\r\n\r\n.top-checkbox_input:checked:hover,\r\n.top-checkbox_input:indeterminate:hover {\r\n\tborder-color: var(--top-forms-option-color-hover);\r\n\tbackground: var(--top-forms-option-color-hover);\r\n}\r\n\r\n/* disabled selected */\r\n.top-checkbox_input:disabled {\r\n\tborder-color: var(--color-line-1-opacity);\r\n\tbackground: var(--color-theme-50);\r\n}\r\n\r\n.top-checkbox_input:checked:disabled,\r\n.top-checkbox_input:indeterminate:disabled {\r\n\tborder-color: transparent;\r\n\tbackground: var(--color-theme-400);\r\n}\r\n\r\n/* isError */\r\n.top-checkbox_input.top-error {\r\n\tborder-color: var(--color-negative);\r\n}\r\n\r\n.top-checkbox_input.top-error:hover {\r\n\tborder-color: var(--color-negative-2);\r\n}\r\n\r\n/* isError selected */\r\n.top-checkbox_input:checked.top-error,\r\n.top-checkbox_input:indeterminate.top-error {\r\n\tbackground: var(--color-negative);\r\n}\r\n\r\n.top-checkbox_input:checked.top-error:hover,\r\n.top-checkbox_input:indeterminate.top-error:hover {\r\n\tbackground: var(--color-negative-2);\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport type { Props, Emits } from './input';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tsize: 's',\r\n\tcaptionType: '',\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst modelValue = computed({\r\n\tget() {\r\n\t\treturn props.modelValue;\r\n\t},\r\n\tset(modelValue) {\r\n\t\temit('update:modelValue', modelValue);\r\n\t},\r\n});\r\n\r\nconst placeholder = computed(() => {\r\n\tif (props.addCleaner && !props.title) {\r\n\t\treturn '';\r\n\t}\r\n\tif (props.captionType !== '') {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn props.title;\r\n});\r\n\r\nconst clean = () => {\r\n\temit('update:modelValue', '');\r\n};\r\n</script>\r\n\r\n<template>\r\n\t<label\r\n\t\t:class=\"{\r\n\t\t\t['top-input']: true,\r\n\t\t\t['top-input-' + name]: name,\r\n\t\t\t['top-size_' + size]: true,\r\n\t\t\t['top-disabled']: disabled,\r\n\t\t\t['top-input-withCleaner']: addCleaner,\r\n\t\t\t['top-formsCaptionWrapper']: captionType !== '',\r\n\t\t\t['top-formsCaptionWrapper-always']: captionType === 'top',\r\n\t\t\t['top-input-withButton']: !!$slots.btn,\r\n\t\t}\"\r\n\t\t:data-top-icon=\"icon\"\r\n\t>\r\n\t\t<input\r\n\t\t\ttype=\"text\"\r\n\t\t\t:class=\"{\r\n\t\t\t\t['top-forms-focusable']: !disabled,\r\n\t\t\t\t['top-input_input']: true,\r\n\t\t\t\t['top-error']: isError,\r\n\t\t\t}\"\r\n\t\t\tautocomplete=\"off_always\"\r\n\t\t\t:name=\"name\"\r\n\t\t\tv-model=\"modelValue\"\r\n\t\t\t:title=\"title\"\r\n\t\t\t:placeholder=\"placeholder\"\r\n\t\t\t:disabled=\"disabled\"\r\n\t\t\t:readonly=\"readonly\"\r\n\t\t\t@keydown.esc=\"() => (addCleaner || !!$slots.btn) && clean()\"\r\n\t\t>\r\n\r\n\t\t<span\r\n\t\t\tv-if=\"addCleaner && modelValue\"\r\n\t\t\tclass=\"top-input_cleaner top-cleaner\"\r\n\t\t\tdata-top-icon=\"\"\r\n\t\t\t@click=\"clean\"\r\n\t\t></span>\r\n\r\n\t\t<!-- TODO: кнопка должна отоборажаться только при изменении value -->\r\n\t\t<!-- TODO: до нажатия на кнопку, изменеине не должно применяться -->\r\n\t\t<!-- TODO: при отмене состояние должно возвращаться к первоначальному -->\r\n\t\t<slot\r\n\t\t\tv-if=\"modelValue\"\r\n\t\t\tname=\"btn\"\r\n\t\t/>\r\n\r\n\t\t<slot></slot>\r\n\r\n\t\t<span\r\n\t\t\tv-if=\"captionType !== ''\"\r\n\t\t\tclass=\"top-formsCaption\"\r\n\t\t>\r\n\t\t\t{{ title }}\r\n\t\t</span>\r\n\t</label>\r\n</template>\r\n\r\n<style module>\r\n.top-input {\r\n\twidth: 180px;\r\n\tdisplay: inline-flex;\r\n\talign-items: center;\r\n\tgap: var(--top-gap-1);\r\n}\r\n\r\n.top-input_input {\r\n\tbackground: var(--top-forms-background-color);\r\n}\r\n\r\n.top-input_input:hover {\r\n\tbackground: var(--top-forms-background-color-hover);\r\n}\r\n\r\n.top-input_input:focus {\r\n\toutline-color: var(--color-theme-75);\r\n\toutline-offset: 0px;\r\n}\r\n\r\n.top-input-withCleaner .top-input_input:not(:placeholder-shown) {\r\n\t--top-forms_clear-width: 24px;\r\n}\r\n\r\n/* TODO: перенести в inputsRange */\r\n.top-input_input {\r\n\twidth: 50%;\r\n\tflex-grow: 1;\r\n}\r\n\r\n.top-input[data-top-icon]:before {\r\n\t--top-icon-color: var(--color-text-secondary);\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport type { Props, Emits } from './radio';\r\nimport ControlLabel from '../controlLabel/controlLabel.vue';\r\n\r\nconst props = defineProps<Props>();\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst localValue = computed({\r\n\tget () {\r\n\t\treturn props.modelValue;\r\n\t},\r\n\tset (value) {\r\n\t\temit('update:modelValue', value);\r\n\t},\r\n});\r\n\r\n</script>\r\n\r\n<template>\r\n\t<label\r\n\t\t:class=\"{\r\n\t\t['top-forms-optionWrapper']: true,\r\n\t\t['top-radio']: true,\r\n\t\t['top-radio_' + name]: name !== '',\r\n\t\t['top-disabled']: disabled,\r\n\t\t['top-error']: isError && !disabled,\r\n\t}\"\r\n\t>\r\n\t\t<input\r\n\t\t\ttype=\"radio\"\r\n\t\t\t:class=\"{\r\n\t\t\t\t['top-forms-focusable']: !disabled,\r\n\t\t\t\t['top-forms-option']: true,\r\n\t\t\t\t['top-radio_input']: true,\r\n\t\t\t\t['top-error']: isError && !disabled,\r\n\t\t\t}\"\r\n\t\t\tv-model=\"localValue\"\r\n\t\t\t:name=\"name\"\r\n\t\t\t:value=\"value\"\r\n\t\t\t:disabled=\"disabled\"\r\n\t\t>\r\n\r\n\t\t<ControlLabel\r\n\t\t\tv-if=\"title\"\r\n\t\t\t:title=\"title\"\r\n\t\t\t:description=\"description\"\r\n\t\t\t:disabled=\"disabled\"\r\n\t\t/>\r\n\t</label>\r\n</template>\r\n\r\n<style module>\r\n:root {\r\n\t--top-radio-background-color: var(--content-background-color);\r\n\t--top-radio-background-color-hover: var(--top-radio-background-color);\r\n\t--top-radio-background-color-active: var(--top-radio-background-color);\r\n}\r\n\r\n.top-radio {\r\n\tcursor: pointer;\r\n}\r\n\r\n.top-radio_input {\r\n\tborder-radius: 50%;\r\n\tbackground: var(--content-background-color);\r\n\tborder: 1px solid var(--top-forms-border-color);\r\n\twidth: calc(var(--top-forms-option-height) - 3px * 2);\r\n\theight: calc(var(--top-forms-option-height) - 3px * 2);\r\n}\r\n\r\n.top-radio_input:hover {\r\n\tborder-color: var(--top-forms-option-color);\r\n\tbackground: var(--color-theme-50)\r\n}\r\n\r\n.top-radio_input:checked {\r\n\tborder-color: var(--top-forms-option-color);\r\n\tborder-width: 5px;\r\n}\r\n\r\n.top-radio_input:checked:hover {\r\n\tborder-color: var(--top-forms-option-color-hover);\r\n}\r\n\r\n/* disabled */\r\n.top-radio_input:disabled {\r\n\tborder-color: var(--color-line-1-opacity);\r\n\tbackground: var(--color-theme-50);\r\n}\r\n\r\n/* disabled selected */\r\n.top-radio_input:checked:disabled {\r\n\tborder-color: var(--color-theme-400);\r\n}\r\n\r\n/* isError */\r\n.top-radio_input.top-error {\r\n\tborder-color: var(--color-negative);\r\n}\r\n\r\n.top-radio_input.top-error:hover {\r\n\tborder-color: var(--color-negative-2);\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport type { Props, Emits } from './switcher';\r\nimport ControlLabel from '../controlLabel/controlLabel.vue';\r\n\r\nconst props = defineProps<Props>();\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst localValue = computed({\r\n\tget () {\r\n\t\treturn props.modelValue;\r\n\t},\r\n\tset (value) {\r\n\t\temit('update:modelValue', value);\r\n\t},\r\n});\r\n</script>\r\n\r\n<template>\r\n\t<label\r\n\t\t:class=\"{\r\n\t\t['top-forms-optionWrapper']: true,\r\n\t\t['top-checkboxSwitcher']: true,\r\n\t\t['top-disabled']: disabled,\r\n\t\t['top-error']: isError && !disabled,\r\n\t}\"\r\n\t>\r\n\t\t<input\r\n\t\t\ttype=\"checkbox\"\r\n\t\t\t:class=\"{\r\n\t\t\t\t['top-forms-focusable']: !disabled,\r\n\t\t\t\t['top-forms-option']: true,\r\n\t\t\t\t['top-checkboxSwitcher_input']: true,\r\n\t\t\t\t['top-error']: isError && !disabled,\r\n\t\t\t}\"\r\n\t\t\tv-model=\"localValue\"\r\n\t\t\t:name=\"name\"\r\n\t\t\t:value=\"value\"\r\n\t\t\t:disabled=\"disabled\"\r\n\t\t>\r\n\r\n\t\t<ControlLabel\r\n\t\t\tv-if=\"title\"\r\n\t\t\t:title=\"title\"\r\n\t\t\t:description=\"description\"\r\n\t\t\t:disabled=\"disabled\"\r\n\t\t/>\r\n\t</label>\r\n</template>\r\n\r\n<style module>\r\n.top-checkboxSwitcher {\r\n\tcursor: pointer;\r\n\tdisplay: inline-flex;\r\n\tgap: 4px;\r\n}\r\n\r\n.top-checkboxSwitcher_input {\r\n\tborder-radius: 9px;\r\n\tborder: none;\r\n\tbackground: var(--color-theme-100);\r\n\twidth: 36px;\r\n\theight: 18px;\r\n\tposition: relative;\r\n}\r\n\r\n.top-checkboxSwitcher_input:before {\r\n\tcontent: '';\r\n\tborder-radius: 50%;\r\n\tbackground: var(--color-white);\r\n\twidth: 12px;\r\n\theight: 12px;\r\n\tmargin: 3px;\r\n\tposition: absolute;\r\n\ttop: 0;\r\n\tleft: 0;\r\n\r\n\ttransition: left 0.1s;\r\n}\r\n\r\n.top-checkboxSwitcher_input:hover {\r\n\tbackground: var(--color-theme-150);\r\n}\r\n\r\n/* checked */\r\n.top-checkboxSwitcher_input:checked {\r\n\tbackground: var(--top-forms-option-color);\r\n}\r\n\r\n.top-checkboxSwitcher_input:checked:hover {\r\n\tbackground: var(--top-forms-option-color-hover);\r\n}\r\n\r\n.top-checkboxSwitcher_input:checked:before {\r\n\tleft: 50%;\r\n}\r\n\r\n/* disabled */\r\n.top-checkboxSwitcher_input:disabled {\r\n\tbackground: var(--color-theme-400);\r\n}\r\n\r\n/* isError */\r\n.top-checkboxSwitcher_input.top-error {\r\n\tbackground: var(--color-negative);\r\n}\r\n\r\n.top-checkboxSwitcher_input.top-error:hover {\r\n\tbackground: var(--color-negative-2);\r\n}\r\n</style>"],"names":["tagName","computed","props","type","value","emit","localValue","modelValue","placeholder","clean"],"mappings":";;;;;;;;;;;;;;;;;;iBAUMA,IAAUC,EAAS,MAAMC,EAAM,OAAO,MAAM,QAAQ,GAEpDC,IAAOF,EAAS,MAAMC,EAAM,WAAW,WAAW,MAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACIjE,UAAME,IAAQH,EAAS;AAAA,MACtB,MAAO;AACN,eAAOC,EAAM;AAAA,MACd;AAAA,MACA,IAAKE,GAAO;AACX,QAAAC,EAAK,qBAAqBD,CAAK;AAAA,MAChC;AAAA,IAAA,CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCfKE,IAAaL,EAAS;AAAA,MAC3B,MAAO;AACN,eAAOC,EAAM;AAAA,MACd;AAAA,MACA,IAAKE,GAAO;AACX,QAAAC,EAAK,qBAAqBD,CAAK;AAAA,MAChC;AAAA,IAAA,CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCJKG,IAAaN,EAAS;AAAA,MAC3B,MAAM;AACL,eAAOC,EAAM;AAAA,MACd;AAAA,MACA,IAAIK,GAAY;AACf,QAAAF,EAAK,qBAAqBE,CAAU;AAAA,MACrC;AAAA,IAAA,CACA,GAEKC,IAAcP,EAAS,MACxBC,EAAM,cAAc,CAACA,EAAM,SAG3BA,EAAM,gBAAgB,KAClB,KAGDA,EAAM,KACb,GAEKO,IAAQ,MAAM;AACnB,MAAAJ,EAAK,qBAAqB,EAAE;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCxBvBC,IAAaL,EAAS;AAAA,MAC3B,MAAO;AACN,eAAOC,EAAM;AAAA,MACd;AAAA,MACA,IAAKE,GAAO;AACX,QAAAC,EAAK,qBAAqBD,CAAK;AAAA,MAChC;AAAA,IAAA,CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCPKE,IAAaL,EAAS;AAAA,MAC3B,MAAO;AACN,eAAOC,EAAM;AAAA,MACd;AAAA,MACA,IAAKE,GAAO;AACX,QAAAC,EAAK,qBAAqBD,CAAK;AAAA,MAChC;AAAA,IAAA,CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/editArea/editArea.amd.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
define(["exports","vue","../.chunks/forms-1dc7c6f3.amd"],function(i,e,l){"use strict"; if(typeof vue === "undefined") var vue = window.Vue;var p=document.createElement("style");p.textContent=`.top-editArea{display:flex;flex-direction:column;gap:6px}.top-editArea_title{font-size:12px}.top-editArea_form{background:var(--top-forms-background-color);outline-color:var(--color-theme-75);outline-offset:0;display:flex;flex-direction:column}.top-editArea_form:hover{background:var(--top-forms-background-color-hover)}.top-textarea{width:100%}.top-editArea_element.top-textarea_textarea{border:none;outline:none;animation:none}.top-editArea_footer{padding:var(--top-forms-padding);display:flex;justify-content:flex-end;gap:var(--top-forms-padding)}.top-editArea-attachedToKeyboard{background:var(--top-forms-background-color);margin-bottom:env(keyboard-inset-height,0);position:fixed;bottom:0;right:0;left:0;z-index:2;gap:0}.top-editArea-attachedToKeyboard .top-editArea_form{border-radius:0;border:none;border-top:1px solid var(--top-forms-border-color)}.top-editArea-attachedToKeyboard .top-editArea_title{border-top:1px solid var(--color-line-2-opacity);padding:var(--top-forms-padding)}.top-editArea-attachedToKeyboard .top-editArea_footer>[data-top-icon]{border-radius:100%}
|
|
2
|
-
`,document.head.appendChild(p);const u={key:0,class:"top-editArea_title"},f={class:"top-editArea_footer"},b=e.defineComponent({__name:"editArea",props:{modelValue:{},title:{},cancelText:{default:"Отмена"},submitText:{default:"Отправить"},attachToKeyboard:{type:Boolean},name:{},placeholder:{},rows:{},minHeight:{},expandable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},isError:{type:Boolean},hint:{}},emits:["update:modelValue","cancel"],setup(A,{emit:s}){const r=A,n=e.ref(""),a=e.ref(r.modelValue);e.watch(e.toRef(r,"modelValue"),()=>{a.value=r.modelValue});const g=e.computed(()=>a.value!==r.modelValue),c=t=>{s("update:modelValue",t)},m=()=>{s("cancel"),a.value=r.modelValue};return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"top-editArea":!0,"top-editArea-attachedToKeyboard":t.attachToKeyboard})},[t.title?(e.openBlock(),e.createElementBlock("div",u,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass({"top-editArea_form":!0,"top-error":t.isError,"top-focus":n.value=="focus"})},[e.createVNode(l.Textarea,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=d=>a.value=d),name:t.name,placeholder:t.placeholder,rows:t.rows,minHeight:t.minHeight,expandable:t.expandable,disabled:t.disabled,readonly:t.readonly,isError:t.isError,hint:t.hint,class:"top-editArea_element",onFocus:o[1]||(o[1]=d=>n.value="focus"),onBlur:o[2]||(o[2]=d=>n.value=""),onKeyup:[e.withKeys(m,["esc"]),o[3]||(o[3]=e.withKeys(e.withModifiers(d=>c(a.value),["ctrl"]),["enter"]))]},null,8,["modelValue","name","placeholder","rows","minHeight","expandable","disabled","readonly","isError","hint","onKeyup"]),e.createElementVNode("div",f,[g.value&&(!t.attachToKeyboard||t.modelValue)?(e.openBlock(),e.createBlock(l.Button,{key:0,class:"top-editArea_button",color:"theme",icon:t.attachToKeyboard?"":"",onClick:m},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.attachToKeyboard?"":t.cancelText),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0),e.createVNode(l.Button,{class:"top-editArea_button",icon:t.attachToKeyboard?"":"",onClick:o[4]||(o[4]=d=>c(a.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.attachToKeyboard?"":t.submitText),1)]),_:1},8,["icon"])])],2)],2))}}),y={$style:{"top-editArea":"top-editArea","top-editArea_title":"top-editArea_title","top-editArea_form":"top-editArea_form","top-textarea":"top-textarea","top-editArea_element":"top-editArea_element","top-textarea_textarea":"top-textarea_textarea","top-editArea_footer":"top-editArea_footer","top-editArea-attachedToKeyboard":"top-editArea-attachedToKeyboard"}},h=l._export_sfc(b,[["__cssModules",y]]);i.EditArea=h,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
|
3
|
-
//# sourceMappingURL=editArea.amd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editArea.amd.js","sources":["../../src/components/editArea/editArea/editArea.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { ref, toRef, watch, computed } from 'vue';\r\nimport Button from '@/components/forms/button/button.vue';\r\nimport type { Props, Emits } from './editArea';\r\nimport Textarea from '@/components/forms/textarea/textarea.vue';\r\n\r\n// TODO: добавить переменную top-forms-fixed-height и использовать ее при добавлении отступов у страницы\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tcancelText: 'Отмена',\r\n\tsubmitText: 'Отправить',\r\n\texpandable: true,\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst state = ref('');\r\n\r\n/**\r\n * Локальное значение modelValue, будет проброшено вверх только в случае отправки формы\r\n */\r\nconst localValue = ref(props.modelValue);\r\n\r\nwatch(toRef(props, 'modelValue'), () => {\r\n\tlocalValue.value = props.modelValue;\r\n});\r\n\r\nconst isChanged = computed(() => localValue.value !== props.modelValue);\r\n\r\nconst submit = (value: string) => {\r\n\temit('update:modelValue', value);\r\n};\r\n\r\nconst cancel = () => {\r\n\temit('cancel');\r\n\r\n\t// сброс введенного значения\r\n\tlocalValue.value = props.modelValue;\r\n};\r\n</script>\r\n\r\n<template>\r\n\t<div\r\n\t\t:class=\"{\r\n\t\t\t'top-editArea': true,\r\n\t\t\t'top-editArea-attachedToKeyboard': attachToKeyboard,\r\n\t\t}\"\r\n\t>\r\n\t\t<div\r\n\t\t\tv-if=\"title\"\r\n\t\t\tclass=\"top-editArea_title\"\r\n\t\t>\r\n\t\t\t{{ title }}\r\n\t\t</div>\r\n\r\n\t\t<div\r\n\t\t\t:class=\"{\r\n\t\t\t\t'top-editArea_form': true,\r\n\t\t\t\t'top-error': isError,\r\n\t\t\t\t'top-focus': state == 'focus',\r\n\t\t\t}\"\r\n\t\t>\r\n\t\t\t<Textarea\r\n\t\t\t\tv-model=\"localValue\"\r\n\t\t\t\t:name=\"name\"\r\n\t\t\t\t:placeholder=\"placeholder\"\r\n\t\t\t\t:rows=\"rows\"\r\n\t\t\t\t:minHeight=\"minHeight\"\r\n\t\t\t\t:expandable=\"expandable\"\r\n\t\t\t\t:disabled=\"disabled\"\r\n\t\t\t\t:readonly=\"readonly\"\r\n\t\t\t\t:isError=\"isError\"\r\n\t\t\t\t:hint=\"hint\"\r\n\t\t\t\tclass=\"top-editArea_element\"\r\n\t\t\t\t@focus=\"state = 'focus'\"\r\n\t\t\t\t@blur=\"state = ''\"\r\n\t\t\t\t@keyup.esc=\"cancel\"\r\n\t\t\t\t@keyup.ctrl.enter=\"submit(localValue)\"\r\n\t\t\t/>\r\n\r\n\t\t\t<div class=\"top-editArea_footer\">\r\n\t\t\t\t<Button\r\n\t\t\t\t\tv-if=\"isChanged && (!attachToKeyboard || modelValue)\"\r\n\t\t\t\t\tclass=\"top-editArea_button\"\r\n\t\t\t\t\tcolor=\"theme\"\r\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\r\n\t\t\t\t\t@click=\"cancel\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ attachToKeyboard ? '' : cancelText }}\r\n\t\t\t\t</Button>\r\n\r\n\t\t\t\t<Button\r\n\t\t\t\t\tclass=\"top-editArea_button\"\r\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\r\n\t\t\t\t\t@click=\"submit(localValue)\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ attachToKeyboard ? '' : submitText }}\r\n\t\t\t\t</Button>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n.top-editArea {\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n\tgap: 6px;\r\n}\r\n\r\n.top-editArea_title {\r\n\tfont-size: 12px;\r\n}\r\n\r\n.top-editArea_form {\r\n\tbackground: var(--top-forms-background-color);\r\n\toutline-color: var(--color-theme-75);\r\n\toutline-offset: 0;\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n}\r\n\r\n.top-editArea_form:hover {\r\n\tbackground: var(--top-forms-background-color-hover);\r\n}\r\n\r\n/* textarea в EditArea */\r\n.top-textarea {\r\n\twidth: 100%;\r\n}\r\n\r\n.top-editArea_element.top-textarea_textarea {\r\n\tborder: none;\r\n\toutline: none;\r\n\tanimation: none;\r\n}\r\n\r\n/* footer */\r\n.top-editArea_footer {\r\n\tpadding: var(--top-forms-padding);\r\n\tdisplay: flex;\r\n\tjustify-content: flex-end;\r\n\tgap: var(--top-forms-padding);\r\n}\r\n\r\n/* attachedToKeyboard */\r\n.top-editArea-attachedToKeyboard {\r\n\tbackground: var(--top-forms-background-color);\r\n\tmargin-bottom: env(keyboard-inset-height, 0);\r\n\tposition: fixed;\r\n\tbottom: 0;\r\n\tright: 0;\r\n\tleft: 0;\r\n\tz-index: 2;\r\n\tgap: 0;\r\n}\r\n\r\n.top-editArea-attachedToKeyboard .top-editArea_form {\r\n\tborder-radius: 0;\r\n\tborder: none;\r\n\tborder-top: 1px solid var(--top-forms-border-color);\r\n}\r\n\r\n.top-editArea-attachedToKeyboard .top-editArea_title {\r\n\tborder-top: 1px solid var(--color-line-2-opacity);\r\n\tpadding: var(--top-forms-padding);\r\n}\r\n\r\n.top-editArea-attachedToKeyboard .top-editArea_footer > [data-top-icon] {\r\n\tborder-radius: 100%;\r\n}\r\n</style>"],"names":["state","ref","localValue","props","watch","toRef","isChanged","computed","submit","value","emit","cancel"],"mappings":";gfAgBMA,EAAQC,MAAI,EAAE,EAKdC,EAAaD,EAAAA,IAAIE,EAAM,UAAU,EAEvCC,EAAAA,MAAMC,EAAM,MAAAF,EAAO,YAAY,EAAG,IAAM,CACvCD,EAAW,MAAQC,EAAM,UAAA,CACzB,EAED,MAAMG,EAAYC,EAAAA,SAAS,IAAML,EAAW,QAAUC,EAAM,UAAU,EAEhEK,EAAUC,GAAkB,CACjCC,EAAK,oBAAqBD,CAAK,CAAA,EAG1BE,EAAS,IAAM,CACpBD,EAAK,QAAQ,EAGbR,EAAW,MAAQC,EAAM,UAAA"}
|
package/editArea/editArea.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { defineComponent as B, ref as u, watch as w, toRef as E, computed as k, openBlock as d, createElementBlock as m, normalizeClass as c, toDisplayString as n, createCommentVNode as y, createElementVNode as b, createVNode as A, withKeys as f, withModifiers as C, createBlock as g, withCtx as h, createTextVNode as v } from "vue";
|
|
2
|
-
import { T as $, B as T, _ as H } from "../.chunks/forms-3575c189.es.js";
|
|
3
|
-
const N = {
|
|
4
|
-
key: 0,
|
|
5
|
-
class: "top-editArea_title"
|
|
6
|
-
}, M = { class: "top-editArea_footer" }, _ = /* @__PURE__ */ B({
|
|
7
|
-
__name: "editArea",
|
|
8
|
-
props: {
|
|
9
|
-
modelValue: {},
|
|
10
|
-
title: {},
|
|
11
|
-
cancelText: { default: "Отмена" },
|
|
12
|
-
submitText: { default: "Отправить" },
|
|
13
|
-
attachToKeyboard: { type: Boolean },
|
|
14
|
-
name: {},
|
|
15
|
-
placeholder: {},
|
|
16
|
-
rows: {},
|
|
17
|
-
minHeight: {},
|
|
18
|
-
expandable: { type: Boolean, default: !0 },
|
|
19
|
-
disabled: { type: Boolean },
|
|
20
|
-
readonly: { type: Boolean },
|
|
21
|
-
isError: { type: Boolean },
|
|
22
|
-
hint: {}
|
|
23
|
-
},
|
|
24
|
-
emits: ["update:modelValue", "cancel"],
|
|
25
|
-
setup(V, { emit: i }) {
|
|
26
|
-
const a = V, r = u(""), o = u(a.modelValue);
|
|
27
|
-
w(E(a, "modelValue"), () => {
|
|
28
|
-
o.value = a.modelValue;
|
|
29
|
-
});
|
|
30
|
-
const K = k(() => o.value !== a.modelValue), s = (e) => {
|
|
31
|
-
i("update:modelValue", e);
|
|
32
|
-
}, p = () => {
|
|
33
|
-
i("cancel"), o.value = a.modelValue;
|
|
34
|
-
};
|
|
35
|
-
return (e, t) => (d(), m("div", {
|
|
36
|
-
class: c({
|
|
37
|
-
"top-editArea": !0,
|
|
38
|
-
"top-editArea-attachedToKeyboard": e.attachToKeyboard
|
|
39
|
-
})
|
|
40
|
-
}, [
|
|
41
|
-
e.title ? (d(), m("div", N, n(e.title), 1)) : y("", !0),
|
|
42
|
-
b("div", {
|
|
43
|
-
class: c({
|
|
44
|
-
"top-editArea_form": !0,
|
|
45
|
-
"top-error": e.isError,
|
|
46
|
-
"top-focus": r.value == "focus"
|
|
47
|
-
})
|
|
48
|
-
}, [
|
|
49
|
-
A($, {
|
|
50
|
-
modelValue: o.value,
|
|
51
|
-
"onUpdate:modelValue": t[0] || (t[0] = (l) => o.value = l),
|
|
52
|
-
name: e.name,
|
|
53
|
-
placeholder: e.placeholder,
|
|
54
|
-
rows: e.rows,
|
|
55
|
-
minHeight: e.minHeight,
|
|
56
|
-
expandable: e.expandable,
|
|
57
|
-
disabled: e.disabled,
|
|
58
|
-
readonly: e.readonly,
|
|
59
|
-
isError: e.isError,
|
|
60
|
-
hint: e.hint,
|
|
61
|
-
class: "top-editArea_element",
|
|
62
|
-
onFocus: t[1] || (t[1] = (l) => r.value = "focus"),
|
|
63
|
-
onBlur: t[2] || (t[2] = (l) => r.value = ""),
|
|
64
|
-
onKeyup: [
|
|
65
|
-
f(p, ["esc"]),
|
|
66
|
-
t[3] || (t[3] = f(C((l) => s(o.value), ["ctrl"]), ["enter"]))
|
|
67
|
-
]
|
|
68
|
-
}, null, 8, ["modelValue", "name", "placeholder", "rows", "minHeight", "expandable", "disabled", "readonly", "isError", "hint", "onKeyup"]),
|
|
69
|
-
b("div", M, [
|
|
70
|
-
K.value && (!e.attachToKeyboard || e.modelValue) ? (d(), g(T, {
|
|
71
|
-
key: 0,
|
|
72
|
-
class: "top-editArea_button",
|
|
73
|
-
color: "theme",
|
|
74
|
-
icon: e.attachToKeyboard ? "" : "",
|
|
75
|
-
onClick: p
|
|
76
|
-
}, {
|
|
77
|
-
default: h(() => [
|
|
78
|
-
v(n(e.attachToKeyboard ? "" : e.cancelText), 1)
|
|
79
|
-
]),
|
|
80
|
-
_: 1
|
|
81
|
-
}, 8, ["icon"])) : y("", !0),
|
|
82
|
-
A(T, {
|
|
83
|
-
class: "top-editArea_button",
|
|
84
|
-
icon: e.attachToKeyboard ? "" : "",
|
|
85
|
-
onClick: t[4] || (t[4] = (l) => s(o.value))
|
|
86
|
-
}, {
|
|
87
|
-
default: h(() => [
|
|
88
|
-
v(n(e.attachToKeyboard ? "" : e.submitText), 1)
|
|
89
|
-
]),
|
|
90
|
-
_: 1
|
|
91
|
-
}, 8, ["icon"])
|
|
92
|
-
])
|
|
93
|
-
], 2)
|
|
94
|
-
], 2));
|
|
95
|
-
}
|
|
96
|
-
}), z = {
|
|
97
|
-
"top-editArea": "top-editArea",
|
|
98
|
-
"top-editArea_title": "top-editArea_title",
|
|
99
|
-
"top-editArea_form": "top-editArea_form",
|
|
100
|
-
"top-textarea": "top-textarea",
|
|
101
|
-
"top-editArea_element": "top-editArea_element",
|
|
102
|
-
"top-textarea_textarea": "top-textarea_textarea",
|
|
103
|
-
"top-editArea_footer": "top-editArea_footer",
|
|
104
|
-
"top-editArea-attachedToKeyboard": "top-editArea-attachedToKeyboard"
|
|
105
|
-
}, D = {
|
|
106
|
-
$style: z
|
|
107
|
-
}, S = /* @__PURE__ */ H(_, [["__cssModules", D]]);
|
|
108
|
-
export {
|
|
109
|
-
S as EditArea
|
|
110
|
-
};
|
|
111
|
-
//# sourceMappingURL=editArea.js.map
|
package/editArea/editArea.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editArea.js","sources":["../../src/components/editArea/editArea/editArea.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { ref, toRef, watch, computed } from 'vue';\r\nimport Button from '@/components/forms/button/button.vue';\r\nimport type { Props, Emits } from './editArea';\r\nimport Textarea from '@/components/forms/textarea/textarea.vue';\r\n\r\n// TODO: добавить переменную top-forms-fixed-height и использовать ее при добавлении отступов у страницы\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tcancelText: 'Отмена',\r\n\tsubmitText: 'Отправить',\r\n\texpandable: true,\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst state = ref('');\r\n\r\n/**\r\n * Локальное значение modelValue, будет проброшено вверх только в случае отправки формы\r\n */\r\nconst localValue = ref(props.modelValue);\r\n\r\nwatch(toRef(props, 'modelValue'), () => {\r\n\tlocalValue.value = props.modelValue;\r\n});\r\n\r\nconst isChanged = computed(() => localValue.value !== props.modelValue);\r\n\r\nconst submit = (value: string) => {\r\n\temit('update:modelValue', value);\r\n};\r\n\r\nconst cancel = () => {\r\n\temit('cancel');\r\n\r\n\t// сброс введенного значения\r\n\tlocalValue.value = props.modelValue;\r\n};\r\n</script>\r\n\r\n<template>\r\n\t<div\r\n\t\t:class=\"{\r\n\t\t\t'top-editArea': true,\r\n\t\t\t'top-editArea-attachedToKeyboard': attachToKeyboard,\r\n\t\t}\"\r\n\t>\r\n\t\t<div\r\n\t\t\tv-if=\"title\"\r\n\t\t\tclass=\"top-editArea_title\"\r\n\t\t>\r\n\t\t\t{{ title }}\r\n\t\t</div>\r\n\r\n\t\t<div\r\n\t\t\t:class=\"{\r\n\t\t\t\t'top-editArea_form': true,\r\n\t\t\t\t'top-error': isError,\r\n\t\t\t\t'top-focus': state == 'focus',\r\n\t\t\t}\"\r\n\t\t>\r\n\t\t\t<Textarea\r\n\t\t\t\tv-model=\"localValue\"\r\n\t\t\t\t:name=\"name\"\r\n\t\t\t\t:placeholder=\"placeholder\"\r\n\t\t\t\t:rows=\"rows\"\r\n\t\t\t\t:minHeight=\"minHeight\"\r\n\t\t\t\t:expandable=\"expandable\"\r\n\t\t\t\t:disabled=\"disabled\"\r\n\t\t\t\t:readonly=\"readonly\"\r\n\t\t\t\t:isError=\"isError\"\r\n\t\t\t\t:hint=\"hint\"\r\n\t\t\t\tclass=\"top-editArea_element\"\r\n\t\t\t\t@focus=\"state = 'focus'\"\r\n\t\t\t\t@blur=\"state = ''\"\r\n\t\t\t\t@keyup.esc=\"cancel\"\r\n\t\t\t\t@keyup.ctrl.enter=\"submit(localValue)\"\r\n\t\t\t/>\r\n\r\n\t\t\t<div class=\"top-editArea_footer\">\r\n\t\t\t\t<Button\r\n\t\t\t\t\tv-if=\"isChanged && (!attachToKeyboard || modelValue)\"\r\n\t\t\t\t\tclass=\"top-editArea_button\"\r\n\t\t\t\t\tcolor=\"theme\"\r\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\r\n\t\t\t\t\t@click=\"cancel\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ attachToKeyboard ? '' : cancelText }}\r\n\t\t\t\t</Button>\r\n\r\n\t\t\t\t<Button\r\n\t\t\t\t\tclass=\"top-editArea_button\"\r\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\r\n\t\t\t\t\t@click=\"submit(localValue)\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ attachToKeyboard ? '' : submitText }}\r\n\t\t\t\t</Button>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n.top-editArea {\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n\tgap: 6px;\r\n}\r\n\r\n.top-editArea_title {\r\n\tfont-size: 12px;\r\n}\r\n\r\n.top-editArea_form {\r\n\tbackground: var(--top-forms-background-color);\r\n\toutline-color: var(--color-theme-75);\r\n\toutline-offset: 0;\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n}\r\n\r\n.top-editArea_form:hover {\r\n\tbackground: var(--top-forms-background-color-hover);\r\n}\r\n\r\n/* textarea в EditArea */\r\n.top-textarea {\r\n\twidth: 100%;\r\n}\r\n\r\n.top-editArea_element.top-textarea_textarea {\r\n\tborder: none;\r\n\toutline: none;\r\n\tanimation: none;\r\n}\r\n\r\n/* footer */\r\n.top-editArea_footer {\r\n\tpadding: var(--top-forms-padding);\r\n\tdisplay: flex;\r\n\tjustify-content: flex-end;\r\n\tgap: var(--top-forms-padding);\r\n}\r\n\r\n/* attachedToKeyboard */\r\n.top-editArea-attachedToKeyboard {\r\n\tbackground: var(--top-forms-background-color);\r\n\tmargin-bottom: env(keyboard-inset-height, 0);\r\n\tposition: fixed;\r\n\tbottom: 0;\r\n\tright: 0;\r\n\tleft: 0;\r\n\tz-index: 2;\r\n\tgap: 0;\r\n}\r\n\r\n.top-editArea-attachedToKeyboard .top-editArea_form {\r\n\tborder-radius: 0;\r\n\tborder: none;\r\n\tborder-top: 1px solid var(--top-forms-border-color);\r\n}\r\n\r\n.top-editArea-attachedToKeyboard .top-editArea_title {\r\n\tborder-top: 1px solid var(--color-line-2-opacity);\r\n\tpadding: var(--top-forms-padding);\r\n}\r\n\r\n.top-editArea-attachedToKeyboard .top-editArea_footer > [data-top-icon] {\r\n\tborder-radius: 100%;\r\n}\r\n</style>"],"names":["state","ref","localValue","props","watch","toRef","isChanged","computed","submit","value","emit","cancel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;iBAgBMA,IAAQC,EAAI,EAAE,GAKdC,IAAaD,EAAIE,EAAM,UAAU;AAEvC,IAAAC,EAAMC,EAAMF,GAAO,YAAY,GAAG,MAAM;AACvC,MAAAD,EAAW,QAAQC,EAAM;AAAA,IAAA,CACzB;AAED,UAAMG,IAAYC,EAAS,MAAML,EAAW,UAAUC,EAAM,UAAU,GAEhEK,IAAS,CAACC,MAAkB;AACjC,MAAAC,EAAK,qBAAqBD,CAAK;AAAA,IAAA,GAG1BE,IAAS,MAAM;AACpB,MAAAD,EAAK,QAAQ,GAGbR,EAAW,QAAQC,EAAM;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|