@topvisor/ui 0.0.36 → 0.0.38
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-ad465c48.es.js → datepicker-778ddcc5.es.js} +2 -2
- package/.chunks/{datepicker-ad465c48.es.js.map → datepicker-778ddcc5.es.js.map} +1 -1
- package/.chunks/{datepicker-1e725859.amd.js → datepicker-80599025.amd.js} +3 -3
- package/.chunks/{datepicker-1e725859.amd.js.map → datepicker-80599025.amd.js.map} +1 -1
- package/.chunks/forms-58420e52.amd.js +3 -0
- package/.chunks/forms-58420e52.amd.js.map +1 -0
- package/.chunks/forms-779fee37.es.js +1107 -0
- package/.chunks/forms-779fee37.es.js.map +1 -0
- package/.chunks/{popup-0f540839.es.js → popup-672d6531.es.js} +120 -85
- package/.chunks/popup-672d6531.es.js.map +1 -0
- package/.chunks/popup-d53450b6.amd.js +377 -0
- package/.chunks/popup-d53450b6.amd.js.map +1 -0
- package/{core.css → assets/core.css} +1 -1
- package/assets/forms.css +1 -0
- package/{formsExt.css → assets/formsExt.css} +1 -1
- package/assets/popup.css +1 -0
- package/common/common.amd.js +1 -1
- package/core/core.amd.js +1 -1
- package/core/core.js +1 -1
- package/forms/forms.amd.js +1 -1
- package/forms/forms.js +9 -7
- package/forms/helpers.amd.js +1 -1
- package/forms/helpers.amd.js.map +1 -1
- package/forms/helpers.js +1 -0
- package/forms/helpers.js.map +1 -1
- package/formsExt/formsExt.amd.js +1 -2
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +97 -80
- package/formsExt/formsExt.js.map +1 -1
- package/package.json +17 -17
- package/popup/popup.amd.js +1 -2
- package/popup/popup.amd.js.map +1 -1
- package/popup/popup.js +74 -68
- 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 -2
- package/tabs/tabs.amd.js.map +1 -1
- package/tabs/tabs.js +30 -26
- package/tabs/tabs.js.map +1 -1
- package/utils/date.amd.js +1 -1
- package/utils/date.js +1 -1
- package/utils/device.amd.js +1 -1
- package/utils/device.js +2 -2
- package/utils/dom.amd.js +1 -1
- package/utils/dom.amd.js.map +1 -1
- package/utils/dom.js +3 -61
- package/utils/dom.js.map +1 -1
- package/.chunks/forms-2891e074.amd.js +0 -3
- package/.chunks/forms-2891e074.amd.js.map +0 -1
- package/.chunks/forms-db4cb24d.es.js +0 -946
- package/.chunks/forms-db4cb24d.es.js.map +0 -1
- package/.chunks/popup-0f540839.es.js.map +0 -1
- package/.chunks/popup-e49a9bab.amd.js +0 -341
- package/.chunks/popup-e49a9bab.amd.js.map +0 -1
- package/forms.css +0 -1
- package/popup.css +0 -1
- /package/{dark.css → assets/dark.css} +0 -0
- /package/{light.css → assets/light.css} +0 -0
- /package/{tabs.css → assets/tabs.css} +0 -0
package/formsExt/formsExt.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { T as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as G, ref as f, watch as w, toRef as k, computed as C, openBlock as n, createElementBlock as m, normalizeClass as v, toDisplayString as y, createCommentVNode as b, createElementVNode as h, createVNode as A, withKeys as V, withModifiers as _, createBlock as E, withCtx as $, createTextVNode as T, mergeProps as g, renderSlot as I, Fragment as M, renderList as H, withDirectives as z, vModelRadio as N } from "vue";
|
|
2
|
+
import { T as P, B, _ as K, I as R } from "../.chunks/forms-779fee37.es.js";
|
|
3
|
+
import("../core/core.js").then((u) => {
|
|
4
|
+
const p = ["../assets/formsExt.css"].map((t) => import.meta.resolve(t));
|
|
5
|
+
u.default.Page.addCss(p);
|
|
6
|
+
});
|
|
7
|
+
const U = {
|
|
4
8
|
key: 0,
|
|
5
9
|
class: "top-editArea_title"
|
|
6
|
-
},
|
|
10
|
+
}, X = { class: "top-editArea_footer" }, D = /* @__PURE__ */ G({
|
|
7
11
|
__name: "editArea",
|
|
8
12
|
props: {
|
|
9
13
|
modelValue: {},
|
|
@@ -22,33 +26,33 @@ const N = {
|
|
|
22
26
|
hint: {}
|
|
23
27
|
},
|
|
24
28
|
emits: ["update:modelValue", "cancel"],
|
|
25
|
-
setup(
|
|
26
|
-
const r = p,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
setup(u, { emit: p }) {
|
|
30
|
+
const t = u, r = p, d = f(""), l = f(t.modelValue);
|
|
31
|
+
w(k(t, "modelValue"), () => {
|
|
32
|
+
l.value = t.modelValue;
|
|
29
33
|
});
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
+
const o = C(() => l.value !== t.modelValue), s = (e) => {
|
|
35
|
+
r("update:modelValue", e);
|
|
36
|
+
}, a = () => {
|
|
37
|
+
r("cancel"), l.value = t.modelValue;
|
|
34
38
|
};
|
|
35
|
-
return (e,
|
|
36
|
-
class:
|
|
39
|
+
return (e, i) => (n(), m("div", {
|
|
40
|
+
class: v({
|
|
37
41
|
"top-editArea": !0,
|
|
38
42
|
"top-editArea-attachedToKeyboard": e.attachToKeyboard
|
|
39
43
|
})
|
|
40
44
|
}, [
|
|
41
|
-
e.title ? (
|
|
42
|
-
|
|
43
|
-
class:
|
|
45
|
+
e.title ? (n(), m("div", U, y(e.title), 1)) : b("", !0),
|
|
46
|
+
h("div", {
|
|
47
|
+
class: v({
|
|
44
48
|
"top-editArea_form": !0,
|
|
45
49
|
"top-error": e.isError,
|
|
46
|
-
"top-focus":
|
|
50
|
+
"top-focus": d.value == "focus"
|
|
47
51
|
})
|
|
48
52
|
}, [
|
|
49
|
-
|
|
50
|
-
modelValue:
|
|
51
|
-
"onUpdate:modelValue":
|
|
53
|
+
A(P, {
|
|
54
|
+
modelValue: l.value,
|
|
55
|
+
"onUpdate:modelValue": i[0] || (i[0] = (c) => l.value = c),
|
|
52
56
|
name: e.name,
|
|
53
57
|
placeholder: e.placeholder,
|
|
54
58
|
rows: e.rows,
|
|
@@ -59,33 +63,33 @@ const N = {
|
|
|
59
63
|
isError: e.isError,
|
|
60
64
|
hint: e.hint,
|
|
61
65
|
class: "top-editArea_element",
|
|
62
|
-
onFocus:
|
|
63
|
-
onBlur:
|
|
66
|
+
onFocus: i[1] || (i[1] = (c) => d.value = "focus"),
|
|
67
|
+
onBlur: i[2] || (i[2] = (c) => d.value = ""),
|
|
64
68
|
onKeyup: [
|
|
65
|
-
V(
|
|
66
|
-
|
|
69
|
+
V(a, ["esc"]),
|
|
70
|
+
i[3] || (i[3] = V(_((c) => s(l.value), ["ctrl"]), ["enter"]))
|
|
67
71
|
]
|
|
68
72
|
}, null, 8, ["modelValue", "name", "placeholder", "rows", "minHeight", "expandable", "disabled", "readonly", "isError", "hint", "onKeyup"]),
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
h("div", X, [
|
|
74
|
+
o.value && (!e.attachToKeyboard || e.modelValue) ? (n(), E(B, {
|
|
71
75
|
key: 0,
|
|
72
76
|
class: "top-editArea_button",
|
|
73
77
|
color: "theme",
|
|
74
78
|
icon: e.attachToKeyboard ? "" : "",
|
|
75
|
-
onClick:
|
|
79
|
+
onClick: a
|
|
76
80
|
}, {
|
|
77
|
-
default:
|
|
78
|
-
|
|
81
|
+
default: $(() => [
|
|
82
|
+
T(y(e.attachToKeyboard ? "" : e.cancelText), 1)
|
|
79
83
|
]),
|
|
80
84
|
_: 1
|
|
81
|
-
}, 8, ["icon"])) :
|
|
82
|
-
|
|
85
|
+
}, 8, ["icon"])) : b("", !0),
|
|
86
|
+
A(B, {
|
|
83
87
|
class: "top-editArea_button",
|
|
84
88
|
icon: e.attachToKeyboard ? "" : "",
|
|
85
|
-
onClick:
|
|
89
|
+
onClick: i[4] || (i[4] = (c) => s(l.value))
|
|
86
90
|
}, {
|
|
87
|
-
default:
|
|
88
|
-
|
|
91
|
+
default: $(() => [
|
|
92
|
+
T(y(e.attachToKeyboard ? "" : e.submitText), 1)
|
|
89
93
|
]),
|
|
90
94
|
_: 1
|
|
91
95
|
}, 8, ["icon"])
|
|
@@ -102,9 +106,9 @@ const N = {
|
|
|
102
106
|
"top-textarea_textarea": "top-textarea_textarea",
|
|
103
107
|
"top-editArea_footer": "top-editArea_footer",
|
|
104
108
|
"top-editArea-attachedToKeyboard": "top-editArea-attachedToKeyboard"
|
|
105
|
-
},
|
|
109
|
+
}, S = {
|
|
106
110
|
$style: F
|
|
107
|
-
},
|
|
111
|
+
}, te = /* @__PURE__ */ K(D, [["__cssModules", S]]), L = { class: "top-editInput" }, j = /* @__PURE__ */ G({
|
|
108
112
|
__name: "editInput",
|
|
109
113
|
props: {
|
|
110
114
|
modelValue: {},
|
|
@@ -112,42 +116,42 @@ const N = {
|
|
|
112
116
|
button: {}
|
|
113
117
|
},
|
|
114
118
|
emits: ["update:modelValue"],
|
|
115
|
-
setup(
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
setup(u, { emit: p }) {
|
|
120
|
+
const t = u, r = f(t.modelValue);
|
|
121
|
+
w(k(t.modelValue), () => {
|
|
122
|
+
r.value = t.modelValue;
|
|
119
123
|
});
|
|
120
|
-
const
|
|
121
|
-
|
|
124
|
+
const d = p, l = () => {
|
|
125
|
+
d("update:modelValue", r.value);
|
|
122
126
|
};
|
|
123
|
-
return (
|
|
124
|
-
|
|
125
|
-
onKeydownCapture:
|
|
126
|
-
onKeydown: V(
|
|
127
|
-
modelValue:
|
|
128
|
-
"onUpdate:modelValue":
|
|
127
|
+
return (o, s) => (n(), m("div", L, [
|
|
128
|
+
A(R, g(o.input, {
|
|
129
|
+
onKeydownCapture: s[0] || (s[0] = V(_((a) => r.value = o.modelValue, ["stop"]), ["esc"])),
|
|
130
|
+
onKeydown: V(_(l, ["stop"]), ["enter"]),
|
|
131
|
+
modelValue: r.value,
|
|
132
|
+
"onUpdate:modelValue": s[1] || (s[1] = (a) => r.value = a)
|
|
129
133
|
}), null, 16, ["onKeydown", "modelValue"]),
|
|
130
|
-
|
|
134
|
+
r.value !== o.modelValue ? (n(), E(B, g({
|
|
131
135
|
key: 0,
|
|
132
136
|
icon: "",
|
|
133
137
|
styling: "soft"
|
|
134
|
-
},
|
|
135
|
-
default:
|
|
136
|
-
|
|
138
|
+
}, o.button, { onClick: l }), {
|
|
139
|
+
default: $(() => [
|
|
140
|
+
I(o.$slots, "default")
|
|
137
141
|
]),
|
|
138
142
|
_: 3
|
|
139
|
-
}, 16)) :
|
|
143
|
+
}, 16)) : b("", !0)
|
|
140
144
|
]));
|
|
141
145
|
}
|
|
142
|
-
}),
|
|
146
|
+
}), q = {
|
|
143
147
|
"top-editInput": "top-editInput",
|
|
144
148
|
"top-input": "top-input"
|
|
145
|
-
},
|
|
146
|
-
$style:
|
|
147
|
-
},
|
|
149
|
+
}, J = {
|
|
150
|
+
$style: q
|
|
151
|
+
}, ae = /* @__PURE__ */ K(j, [["__cssModules", J]]), O = ["data-top-icon", "onClick"], Q = {
|
|
148
152
|
key: 0,
|
|
149
153
|
class: "top-radioGroup_circle"
|
|
150
|
-
},
|
|
154
|
+
}, W = ["value", "disabled"], Y = /* @__PURE__ */ G({
|
|
151
155
|
__name: "radioGroup",
|
|
152
156
|
props: {
|
|
153
157
|
modelValue: {},
|
|
@@ -157,38 +161,51 @@ const N = {
|
|
|
157
161
|
isError: { type: Boolean }
|
|
158
162
|
},
|
|
159
163
|
emits: ["update:modelValue"],
|
|
160
|
-
setup(
|
|
161
|
-
const r = p,
|
|
164
|
+
setup(u, { emit: p }) {
|
|
165
|
+
const t = u, r = p, d = C({
|
|
162
166
|
get() {
|
|
163
|
-
return
|
|
167
|
+
return t.modelValue;
|
|
164
168
|
},
|
|
165
169
|
set(o) {
|
|
166
|
-
|
|
170
|
+
r("update:modelValue", o);
|
|
167
171
|
}
|
|
168
|
-
});
|
|
169
|
-
return (o, s) => (
|
|
170
|
-
class:
|
|
172
|
+
}), l = "radioGroup-" + Math.random();
|
|
173
|
+
return (o, s) => (n(), m("div", {
|
|
174
|
+
class: v({
|
|
171
175
|
"top-radioGroup": !0,
|
|
172
176
|
"top-scrollBarXHidding": !0,
|
|
173
177
|
["top-size_" + o.size]: !!o.size,
|
|
174
178
|
"top-error": o.isError
|
|
175
179
|
})
|
|
176
180
|
}, [
|
|
177
|
-
(
|
|
178
|
-
class:
|
|
179
|
-
"top-radioGroup_item-selected": a.value ===
|
|
181
|
+
(n(!0), m(M, null, H(o.radiosProps, (a) => (n(), m("label", {
|
|
182
|
+
class: v({
|
|
183
|
+
"top-radioGroup_item-selected": a.value === d.value,
|
|
180
184
|
"top-radioGroup_item": !0,
|
|
185
|
+
"top-forms-focusable": !0,
|
|
181
186
|
"top-disabled": a.disabled
|
|
182
187
|
}),
|
|
183
188
|
"data-top-icon": a.icon,
|
|
184
|
-
onClick: (
|
|
189
|
+
onClick: (e) => d.value = a.value
|
|
185
190
|
}, [
|
|
186
|
-
|
|
187
|
-
o.showIndicator ? (
|
|
188
|
-
|
|
191
|
+
T(y(a.title) + " ", 1),
|
|
192
|
+
o.showIndicator ? (n(), m("span", Q)) : b("", !0),
|
|
193
|
+
z(h("input", {
|
|
194
|
+
"onUpdate:modelValue": s[0] || (s[0] = (e) => d.value = e),
|
|
195
|
+
name: l,
|
|
196
|
+
type: "radio",
|
|
197
|
+
class: v({
|
|
198
|
+
"top-unvisible": !0
|
|
199
|
+
}),
|
|
200
|
+
value: a.value,
|
|
201
|
+
disabled: a.disabled
|
|
202
|
+
}, null, 8, W), [
|
|
203
|
+
[N, d.value]
|
|
204
|
+
])
|
|
205
|
+
], 10, O))), 256))
|
|
189
206
|
], 2));
|
|
190
207
|
}
|
|
191
|
-
}),
|
|
208
|
+
}), Z = {
|
|
192
209
|
"top-scrollBarXHidding": "top-scrollBarXHidding",
|
|
193
210
|
"top-radioGroup": "top-radioGroup",
|
|
194
211
|
"top-radioGroup_item": "top-radioGroup_item",
|
|
@@ -196,12 +213,12 @@ const N = {
|
|
|
196
213
|
"top-radioGroup_circle": "top-radioGroup_circle",
|
|
197
214
|
"top-disabled": "top-disabled",
|
|
198
215
|
"top-error": "top-error"
|
|
199
|
-
},
|
|
200
|
-
$style:
|
|
201
|
-
},
|
|
216
|
+
}, x = {
|
|
217
|
+
$style: Z
|
|
218
|
+
}, le = /* @__PURE__ */ K(Y, [["__cssModules", x]]);
|
|
202
219
|
export {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
220
|
+
te as EditArea,
|
|
221
|
+
ae as EditInput,
|
|
222
|
+
le as RadioGroup
|
|
206
223
|
};
|
|
207
224
|
//# sourceMappingURL=formsExt.js.map
|
package/formsExt/formsExt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formsExt.js","sources":["../../src/components/formsExt/editArea/editArea.vue","../../src/components/formsExt/editInput/editInput.vue","../../src/components/formsExt/radioGroup/radioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, toRef, watch, computed } from 'vue';\nimport Button from '@/components/forms/button/button.vue';\nimport type { Props, Emits } from './editArea';\nimport Textarea from '@/components/forms/textarea/textarea.vue';\n\n// TODO: добавить переменную top-forms-fixed-height и использовать ее при добавлении отступов у страницы\n\nconst props = withDefaults(defineProps<Props>(), {\n\tcancelText: 'Отмена',\n\tsubmitText: 'Отправить',\n\texpandable: true,\n});\n\nconst emit = defineEmits<Emits>();\n\nconst state = ref('');\n\n/**\n * Локальное значение modelValue, будет проброшено вверх только в случае отправки формы\n */\nconst localValue = ref(props.modelValue);\n\nwatch(toRef(props, 'modelValue'), () => {\n\tlocalValue.value = props.modelValue;\n});\n\nconst isChanged = computed(() => localValue.value !== props.modelValue);\n\nconst submit = (value: string) => {\n\temit('update:modelValue', value);\n};\n\nconst cancel = () => {\n\temit('cancel');\n\n\t// сброс введенного значения\n\tlocalValue.value = props.modelValue;\n};\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t'top-editArea': true,\n\t\t\t'top-editArea-attachedToKeyboard': attachToKeyboard,\n\t\t}\"\n\t>\n\t\t<div\n\t\t\tv-if=\"title\"\n\t\t\tclass=\"top-editArea_title\"\n\t\t>\n\t\t\t{{ title }}\n\t\t</div>\n\n\t\t<div\n\t\t\t:class=\"{\n\t\t\t\t'top-editArea_form': true,\n\t\t\t\t'top-error': isError,\n\t\t\t\t'top-focus': state == 'focus',\n\t\t\t}\"\n\t\t>\n\t\t\t<Textarea\n\t\t\t\tv-model=\"localValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:rows=\"rows\"\n\t\t\t\t:minHeight=\"minHeight\"\n\t\t\t\t:expandable=\"expandable\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:isError=\"isError\"\n\t\t\t\t:hint=\"hint\"\n\t\t\t\tclass=\"top-editArea_element\"\n\t\t\t\t@focus=\"state = 'focus'\"\n\t\t\t\t@blur=\"state = ''\"\n\t\t\t\t@keyup.esc=\"cancel\"\n\t\t\t\t@keyup.ctrl.enter=\"submit(localValue)\"\n\t\t\t/>\n\n\t\t\t<div class=\"top-editArea_footer\">\n\t\t\t\t<Button\n\t\t\t\t\tv-if=\"isChanged && (!attachToKeyboard || modelValue)\"\n\t\t\t\t\tclass=\"top-editArea_button\"\n\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\n\t\t\t\t\t@click=\"cancel\"\n\t\t\t\t>\n\t\t\t\t\t{{ attachToKeyboard ? '' : cancelText }}\n\t\t\t\t</Button>\n\n\t\t\t\t<Button\n\t\t\t\t\tclass=\"top-editArea_button\"\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\n\t\t\t\t\t@click=\"submit(localValue)\"\n\t\t\t\t>\n\t\t\t\t\t{{ attachToKeyboard ? '' : submitText }}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<style module>\n.top-editArea {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.top-editArea_title {\n\tfont-size: 12px;\n}\n\n.top-editArea_form {\n\tbackground: var(--top-forms-background-color);\n\toutline-color: var(--color-theme-75);\n\toutline-offset: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.top-editArea_form:hover {\n\tbackground: var(--top-forms-background-color-hover);\n}\n\n/* textarea в EditArea */\n.top-textarea {\n\twidth: 100%;\n}\n\n.top-editArea_element.top-textarea_textarea {\n\tborder: none;\n\toutline: none;\n\tanimation: none;\n}\n\n/* footer */\n.top-editArea_footer {\n\tpadding: var(--top-forms-padding);\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: var(--top-forms-padding);\n}\n\n/* attachedToKeyboard */\n.top-editArea-attachedToKeyboard {\n\tbackground: var(--top-forms-background-color);\n\tmargin-bottom: env(keyboard-inset-height, 0);\n\tposition: fixed;\n\tbottom: 0;\n\tright: 0;\n\tleft: 0;\n\tz-index: 2;\n\tgap: 0;\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_form {\n\tborder-radius: 0;\n\tborder: none;\n\tborder-top: 1px solid var(--top-forms-border-color);\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_title {\n\tborder-top: 1px solid var(--color-line-2-opacity);\n\tpadding: var(--top-forms-padding);\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_footer > [data-top-icon] {\n\tborder-radius: 100%;\n}\n</style>","<script setup lang=\"ts\">\nimport { ref, toRef, watch } from 'vue';\nimport type { Props, Emits } from './editInput';\nimport Input from '@/components/forms/input/input.vue';\nimport Button from '@/components/forms/button/button.vue';\n\nconst props = defineProps<Props>();\n\nconst intermediateValue = ref(props.modelValue);\n\nwatch(toRef(props.modelValue), () => {\n\tintermediateValue.value = props.modelValue;\n});\n\nconst emit = defineEmits<Emits>();\n\nconst submit = () => {\n\temit('update:modelValue', intermediateValue.value);\n};\n</script>\n\n<template>\n\t<div class=\"top-editInput\">\n\t\t<Input\n\t\t\t:=\"input\"\n\t\t\t@keydown.esc.capture.stop=\"intermediateValue = modelValue\"\n\t\t\t@keydown.enter.stop=\"submit\"\n\t\t\tv-model=\"intermediateValue\"\n\t\t/>\n\n\t\t<Button\n\t\t\tv-if=\"intermediateValue !== modelValue\"\n\t\t\ticon=\"\"\n\t\t\tstyling=\"soft\"\n\t\t\t:=\"button\"\n\t\t\t@click=\"submit\"\n\t\t>\n\t\t\t<!-- @slot Слот Button -->\n\t\t\t<slot></slot>\n\t\t</Button>\n\t</div>\n</template>\n\n<style module>\n.top-editInput {\n\twidth: 220px;\n\tflex-grow: 1;\n\tdisplay: flex;\n\talign-items: flex-end;\n\tgap: var(--top-gap-1);\n}\n\n.top-editInput .top-input {\n\twidth: unset;\n\tflex-grow: 1;\n}\n</style>","<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Props, Emits } from './radioGroup';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tsize: 's',\n});\n\nconst emit = defineEmits<Emits>();\n\nconst localValue = computed({\n\tget() {\n\t\treturn props.modelValue;\n\t},\n\n\tset(value) {\n\t\temit('update:modelValue', value);\n\t},\n});\n\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t['top-radioGroup']: true,\n\t\t\t['top-scrollBarXHidding']: true,\n\t\t\t['top-size_' + size]: !!size,\n\t\t\t['top-error']: isError,\n\t\t}\"\n\t>\n\t\t<div\n\t\t\tv-for=\"item of radiosProps\"\n\t\t\t:class=\"{\n\t\t\t\t['top-radioGroup_item-selected']: item.value === localValue,\n\t\t\t\t['top-radioGroup_item']: true,\n\t\t\t\t['top-disabled']: item.disabled,\n\t\t\t}\"\n\t\t\t:data-top-icon=\"item.icon\"\n\t\t\t@click=\"localValue = item.value\"\n\t\t>\n\t\t\t{{ item.title }}\n\n\t\t\t<span\n\t\t\t\tv-if=\"showIndicator\"\n\t\t\t\tclass=\"top-radioGroup_circle\"\n\t\t\t></span>\n\t\t</div>\n\t</div>\n</template>\n\n<style module>\n@import \"./styles/top-scrollBar.css\";\n\n.top-radioGroup {\n\tuser-select: none;\n\tbox-sizing: border-box;\n\tborder-radius: 8px;\n\tbackground-color: var(--color-theme-50);\n\theight: var(--top-forms-base-height);\n\tpadding: 2px;\n\tgap: 2px;\n\tdisplay: flex;\n\talign-items: flex-start;\n}\n\n.top-radioGroup_item {\n\tcursor: pointer;\n\tbox-sizing: border-box;\n\tborder-radius: 6px;\n\theight: calc(var(--top-forms-base-height) - 4px);\n\tpadding: 0 16px;\n\tfont-weight: 600;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tflex-grow: 1;\n\tgap: 4px;\n}\n\n.top-radioGroup_item:hover {\n\tbackground-color: var(--color-theme-25);\n\tbox-shadow: 0px 4px 32px 0px rgba(4, 9, 84, 0.10), 0px 0px 4px 0px rgba(4, 9, 84, 0.08);\n}\n\n/* selected */\n.top-radioGroup_item-selected {\n\tpointer-events: none;\n\tbackground-color: var(--color-bg-3);\n\tbox-shadow: 0px 4px 32px 0px rgba(4, 9, 84, 0.10), 0px 0px 4px 0px rgba(4, 9, 84, 0.08);\n}\n\n/* circle */\n.top-radioGroup_circle {\n\tpadding: 3px;\n\tmargin-left: auto;\n\tdisplay: flex;\n}\n\n.top-radioGroup_circle:before {\n\tcontent: \"\";\n\tborder: 1px solid var(--color-line-3-opacity);\n\tborder-radius: 50%;\n\tbox-sizing: border-box;\n\twidth: calc(var(--top-forms-option-height) - 3px * 2);\n\theight: calc(var(--top-forms-option-height) - 3px * 2);\n}\n\n.top-radioGroup_item:hover .top-radioGroup_circle:before {\n\tborder-color: var(--color-primary);\n}\n\n/* circle selected */\n.top-radioGroup_item-selected .top-radioGroup_circle:before {\n\tborder-color: var(--color-primary);\n\tborder-width: 5px;\n}\n\n.top-radioGroup_item-selected:hover .top-radioGroup_circle:before {\n\tborder-color: var(--color-primary-2);\n}\n\n/* top-disabled */\n.top-radioGroup_item.top-disabled {\n\t--top-icon-color: var(--color-text-3);\n\n\tcolor: var(--color-text-3);\n}\n\n.top-radioGroup_item.top-disabled .top-radioGroup_circle:before {\n\tborder-color: var(--color-theme-400);\n\tbackground-color: var(--color-theme-50);\n}\n\n/* top-error */\n.top-radioGroup.top-error .top-radioGroup_item:not(.top-disabled) .top-radioGroup_circle:before {\n\tborder-color: var(--color-negative);\n}\n\n.top-radioGroup.top-error .top-radioGroup_item:hover .top-radioGroup_circle:before {\n\tborder-color: var(--color-negative-2);\n}\n</style>"],"names":["state","ref","localValue","props","watch","toRef","isChanged","computed","submit","value","emit","cancel","intermediateValue"],"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC7BpBS,IAAoBX,EAAIE,EAAM,UAAU;AAE9C,IAAAC,EAAMC,EAAMF,EAAM,UAAU,GAAG,MAAM;AACpC,MAAAS,EAAkB,QAAQT,EAAM;AAAA,IAAA,CAChC;AAID,UAAMK,IAAS,MAAM;AACf,MAAAE,EAAA,qBAAqBE,EAAkB,KAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCP5CV,IAAaK,EAAS;AAAA,MAC3B,MAAM;AACL,eAAOJ,EAAM;AAAA,MACd;AAAA,MAEA,IAAIM,GAAO;AACV,QAAAC,EAAK,qBAAqBD,CAAK;AAAA,MAChC;AAAA,IAAA,CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"formsExt.js","sources":["../../src/components/formsExt/editArea/editArea.vue","../../src/components/formsExt/editInput/editInput.vue","../../src/components/formsExt/radioGroup/radioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, toRef, watch, computed } from 'vue';\nimport Button from '@/components/forms/button/button.vue';\nimport type { Props, Emits } from './editArea';\nimport Textarea from '@/components/forms/textarea/textarea.vue';\n\n// TODO: добавить переменную top-forms-fixed-height и использовать ее при добавлении отступов у страницы\n\nconst props = withDefaults(defineProps<Props>(), {\n\tcancelText: 'Отмена',\n\tsubmitText: 'Отправить',\n\texpandable: true,\n});\n\nconst emit = defineEmits<Emits>();\n\nconst state = ref('');\n\n/**\n * Локальное значение modelValue, будет проброшено вверх только в случае отправки формы\n */\nconst localValue = ref(props.modelValue);\n\nwatch(toRef(props, 'modelValue'), () => {\n\tlocalValue.value = props.modelValue;\n});\n\nconst isChanged = computed(() => localValue.value !== props.modelValue);\n\nconst submit = (value: string) => {\n\temit('update:modelValue', value);\n};\n\nconst cancel = () => {\n\temit('cancel');\n\n\t// сброс введенного значения\n\tlocalValue.value = props.modelValue;\n};\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t'top-editArea': true,\n\t\t\t'top-editArea-attachedToKeyboard': attachToKeyboard,\n\t\t}\"\n\t>\n\t\t<div\n\t\t\tv-if=\"title\"\n\t\t\tclass=\"top-editArea_title\"\n\t\t>\n\t\t\t{{ title }}\n\t\t</div>\n\n\t\t<div\n\t\t\t:class=\"{\n\t\t\t\t'top-editArea_form': true,\n\t\t\t\t'top-error': isError,\n\t\t\t\t'top-focus': state == 'focus',\n\t\t\t}\"\n\t\t>\n\t\t\t<Textarea\n\t\t\t\tv-model=\"localValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:rows=\"rows\"\n\t\t\t\t:minHeight=\"minHeight\"\n\t\t\t\t:expandable=\"expandable\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:isError=\"isError\"\n\t\t\t\t:hint=\"hint\"\n\t\t\t\tclass=\"top-editArea_element\"\n\t\t\t\t@focus=\"state = 'focus'\"\n\t\t\t\t@blur=\"state = ''\"\n\t\t\t\t@keyup.esc=\"cancel\"\n\t\t\t\t@keyup.ctrl.enter=\"submit(localValue)\"\n\t\t\t/>\n\n\t\t\t<div class=\"top-editArea_footer\">\n\t\t\t\t<Button\n\t\t\t\t\tv-if=\"isChanged && (!attachToKeyboard || modelValue)\"\n\t\t\t\t\tclass=\"top-editArea_button\"\n\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\n\t\t\t\t\t@click=\"cancel\"\n\t\t\t\t>\n\t\t\t\t\t{{ attachToKeyboard ? '' : cancelText }}\n\t\t\t\t</Button>\n\n\t\t\t\t<Button\n\t\t\t\t\tclass=\"top-editArea_button\"\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\n\t\t\t\t\t@click=\"submit(localValue)\"\n\t\t\t\t>\n\t\t\t\t\t{{ attachToKeyboard ? '' : submitText }}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<style module>\n.top-editArea {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.top-editArea_title {\n\tfont-size: 12px;\n}\n\n.top-editArea_form {\n\tbackground: var(--top-forms-background-color);\n\toutline-color: var(--color-theme-75);\n\toutline-offset: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.top-editArea_form:hover {\n\tbackground: var(--top-forms-background-color-hover);\n}\n\n/* textarea в EditArea */\n.top-textarea {\n\twidth: 100%;\n}\n\n.top-editArea_element.top-textarea_textarea {\n\tborder: none;\n\toutline: none;\n\tanimation: none;\n}\n\n/* footer */\n.top-editArea_footer {\n\tpadding: var(--top-forms-padding);\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: var(--top-forms-padding);\n}\n\n/* attachedToKeyboard */\n.top-editArea-attachedToKeyboard {\n\tbackground: var(--top-forms-background-color);\n\tmargin-bottom: env(keyboard-inset-height, 0);\n\tposition: fixed;\n\tbottom: 0;\n\tright: 0;\n\tleft: 0;\n\tz-index: 2;\n\tgap: 0;\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_form {\n\tborder-radius: 0;\n\tborder: none;\n\tborder-top: 1px solid var(--top-forms-border-color);\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_title {\n\tborder-top: 1px solid var(--color-line-2-opacity);\n\tpadding: var(--top-forms-padding);\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_footer > [data-top-icon] {\n\tborder-radius: 100%;\n}\n</style>","<script setup lang=\"ts\">\nimport { ref, toRef, watch } from 'vue';\nimport type { Props, Emits } from './editInput';\nimport Input from '@/components/forms/input/input.vue';\nimport Button from '@/components/forms/button/button.vue';\n\nconst props = defineProps<Props>();\n\nconst intermediateValue = ref(props.modelValue);\n\nwatch(toRef(props.modelValue), () => {\n\tintermediateValue.value = props.modelValue;\n});\n\nconst emit = defineEmits<Emits>();\n\nconst submit = () => {\n\temit('update:modelValue', intermediateValue.value);\n};\n</script>\n\n<template>\n\t<div class=\"top-editInput\">\n\t\t<Input\n\t\t\t:=\"input\"\n\t\t\t@keydown.esc.capture.stop=\"intermediateValue = modelValue\"\n\t\t\t@keydown.enter.stop=\"submit\"\n\t\t\tv-model=\"intermediateValue\"\n\t\t/>\n\n\t\t<Button\n\t\t\tv-if=\"intermediateValue !== modelValue\"\n\t\t\ticon=\"\"\n\t\t\tstyling=\"soft\"\n\t\t\t:=\"button\"\n\t\t\t@click=\"submit\"\n\t\t>\n\t\t\t<!-- @slot Слот Button -->\n\t\t\t<slot></slot>\n\t\t</Button>\n\t</div>\n</template>\n\n<style module>\n.top-editInput {\n\twidth: 220px;\n\tflex-grow: 1;\n\tdisplay: flex;\n\talign-items: flex-end;\n\tgap: var(--top-gap-1);\n}\n\n.top-editInput .top-input {\n\twidth: unset;\n\tflex-grow: 1;\n}\n</style>","<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Props, Emits } from './radioGroup';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tsize: 's',\n});\n\nconst emit = defineEmits<Emits>();\n\nconst localValue = computed({\n\tget() {\n\t\treturn props.modelValue;\n\t},\n\n\tset(value) {\n\t\temit('update:modelValue', value);\n\t},\n});\n\nconst uid = 'radioGroup-' + Math.random();\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t['top-radioGroup']: true,\n\t\t\t['top-scrollBarXHidding']: true,\n\t\t\t['top-size_' + size]: !!size,\n\t\t\t['top-error']: isError,\n\t\t}\"\n\t>\n\t\t<label\n\t\t\tv-for=\"item of radiosProps\"\n\t\t\t:class=\"{\n\t\t\t\t['top-radioGroup_item-selected']: item.value === localValue,\n\t\t\t\t['top-radioGroup_item']: true,\n\t\t\t\t['top-forms-focusable']: true,\n\t\t\t\t['top-disabled']: item.disabled,\n\t\t\t}\"\n\t\t\t:data-top-icon=\"item.icon\"\n\t\t\t@click=\"localValue = item.value\"\n\t\t>\n\t\t\t{{ item.title }}\n\n\t\t\t<span\n\t\t\t\tv-if=\"showIndicator\"\n\t\t\t\tclass=\"top-radioGroup_circle\"\n\t\t\t></span>\n\n\t\t\t<!-- Для нативной навигации -->\n\t\t\t<input\n\t\t\t\tv-model=\"localValue\"\n\t\t\t\t:name=\"uid\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t['top-unvisible']: true,\n\t\t\t\t}\"\n\t\t\t\t:value=\"item.value\"\n\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t/>\n\t\t</label>\n\t</div>\n</template>\n\n<style module>\n@import \"./styles/top-scrollBar.css\";\n\n.top-radioGroup {\n\tuser-select: none;\n\tbox-sizing: border-box;\n\tborder-radius: 8px;\n\tbackground-color: var(--color-theme-50);\n\theight: var(--top-forms-base-height);\n\tpadding: 2px;\n\tgap: 2px;\n\tdisplay: flex;\n\talign-items: flex-start;\n}\n\n.top-radioGroup_item {\n\tcursor: pointer;\n\tbox-sizing: border-box;\n\tborder-radius: 6px;\n\theight: calc(var(--top-forms-base-height) - 4px);\n\tpadding: 0 16px;\n\tfont-weight: 600;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tflex-grow: 1;\n\tgap: 4px;\n}\n\n.top-radioGroup_item:hover {\n\tbackground-color: var(--color-theme-25);\n\tbox-shadow: 0px 4px 32px 0px rgba(4, 9, 84, 0.10), 0px 0px 4px 0px rgba(4, 9, 84, 0.08);\n}\n\n/* selected */\n.top-radioGroup_item-selected {\n\tpointer-events: none;\n\tbackground-color: var(--color-bg-3);\n\tbox-shadow: 0px 4px 32px 0px rgba(4, 9, 84, 0.10), 0px 0px 4px 0px rgba(4, 9, 84, 0.08);\n}\n\n/* circle */\n.top-radioGroup_circle {\n\tcontent: \"\";\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--color-line-3-opacity);\n\tborder-radius: 50%;\n\tpadding: 3px;\n\tmargin-left: auto;\n\twidth: calc(var(--top-forms-option-height) - 3px * 2);\n\theight: calc(var(--top-forms-option-height) - 3px * 2);\n}\n\n.top-radioGroup_item:hover .top-radioGroup_circle:before {\n\tborder-color: var(--color-primary);\n}\n\n/* circle selected */\n.top-radioGroup_item-selected .top-radioGroup_circle {\n\tborder-color: var(--color-primary);\n\tborder-width: 5px;\n}\n\n.top-radioGroup_item-selected:hover .top-radioGroup_circle {\n\tborder-color: var(--color-primary-2);\n}\n\n/* top-disabled */\n.top-radioGroup_item.top-disabled {\n\t--top-icon-color: var(--color-text-3);\n\n\tcolor: var(--color-text-3);\n}\n\n.top-radioGroup_item.top-disabled .top-radioGroup_circle {\n\tborder-color: var(--color-theme-400);\n\tbackground-color: var(--color-theme-50);\n}\n\n/* top-error */\n.top-radioGroup.top-error .top-radioGroup_item:not(.top-disabled) .top-radioGroup_circle {\n\tborder-color: var(--color-negative);\n}\n</style>"],"names":["props","__props","emit","__emit","state","ref","localValue","watch","toRef","isChanged","computed","submit","value","cancel","intermediateValue","uid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,UAAAA,IAAAC,GAMAC,IAAAC,GAEAC,IAAAC,EAAA,EAAA,GAKAC,IAAAD,EAAAL,EAAA,UAAA;AAEA,IAAAO,EAAAC,EAAAR,GAAA,YAAA,GAAA,MAAA;AACC,MAAAM,EAAA,QAAAN,EAAA;AAAA,IAAyB,CAAA;AAG1B,UAAAS,IAAAC,EAAA,MAAAJ,EAAA,UAAAN,EAAA,UAAA,GAEAW,IAAA,CAAAC,MAAA;AACC,MAAAV,EAAA,qBAAAU,CAAA;AAAA,IAA+B,GAGhCC,IAAA,MAAA;AACC,MAAAX,EAAA,QAAA,GAGAI,EAAA,QAAAN,EAAA;AAAA,IAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/B1B,UAAAA,IAAAC,GAEAa,IAAAT,EAAAL,EAAA,UAAA;AAEA,IAAAO,EAAAC,EAAAR,EAAA,UAAA,GAAA,MAAA;AACC,MAAAc,EAAA,QAAAd,EAAA;AAAA,IAAgC,CAAA;AAGjC,UAAAE,IAAAC,GAEAQ,IAAA,MAAA;AACC,MAAAT,EAAA,qBAAAY,EAAA,KAAA;AAAA,IAAiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACblD,UAAAd,IAAAC,GAIAC,IAAAC,GAEAG,IAAAI,EAAA;AAAA,MAA4B,MAAA;AAE1B,eAAAV,EAAA;AAAA,MAAa;AAAA,MACd,IAAAY,GAAA;AAGC,QAAAV,EAAA,qBAAAU,CAAA;AAAA,MAA+B;AAAA,IAChC,CAAA,GAGDG,IAAA,gBAAA,KAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
"name": "@topvisor/ui",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.38",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Topvisor UI-kit Vue",
|
|
7
|
+
"author": "Topvisor",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"topvisor",
|
|
10
|
+
"vue",
|
|
11
|
+
"ui framework",
|
|
12
|
+
"component framework",
|
|
13
|
+
"component library"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"vue": "^3.3.4"
|
|
18
|
+
}
|
|
19
19
|
}
|
package/popup/popup.amd.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
define(["
|
|
2
|
-
`,document.head.appendChild(m);const u=e.defineComponent({__name:"opener",props:{id:{},pos:{default:"3"},notch:{type:Boolean,default:!0},openByHover:{type:Boolean},posBy:{default:"fixed"}},setup(a){const t=a,n=t.id||Math.random()+"";let l;function s(p){setTimeout(()=>{l=p.nextElementSibling,l&&c(l)})}e.onUpdated(()=>{l&&c(l)});function c(p){p.dataset.topPopup="vue-"+n,p.dataset.topPopupId=n,p.dataset.topPopupP=t.pos,p.dataset.topPopupPosBy=t.posBy,p.dataset.topPopupNotch=t.notch?"true":"",p.dataset.topPopupOpenByHover=t.openByHover?"true":""}return(p,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("template",{ref:s}),e.renderSlot(p.$slots,"default")],64))}}),$="",y={key:0,class:"top-popup_header"},f={key:1,class:"top-popup_content"},B={key:2,class:"top-popup_content"},k={key:3,class:"top-popup_footer"},_=e.defineComponent({__name:"popup",props:{id:{default:""},class:{},pos:{default:"3"},notch:{type:Boolean,default:!0},openByHover:{type:Boolean},posBy:{default:"fixed"}},emits:["open","close"],setup(a,{emit:t}){const n=a,l=n.id||Math.random()+"",s=e.ref(null),r={onOpen:async o=>{o.elPopupInner.innerText="",s.value=o.elPopupInner,r.opened=!0,r.popup=o,t("open")},onClose:o=>{s.value=null,r.opened=!1,r.popup=null,t("close")},classRef:e.toRef(n,"class"),opened:!1,popup:null};return i.regVueComponent(l,r),e.onUnmounted(()=>{i.unregVueComponent(l)}),(o,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.$slots.opener?(e.openBlock(),e.createBlock(u,{key:0,id:e.unref(l),pos:o.pos,posBy:o.posBy,notch:o.notch,openByHover:o.openByHover},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"opener")]),_:3},8,["id","pos","posBy","notch","openByHover"])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createBlock(e.Teleport,{key:1,to:s.value},[o.$slots.header?(e.openBlock(),e.createElementBlock("div",y,[e.renderSlot(o.$slots,"header")])):e.createCommentVNode("",!0),o.$slots.content?(e.openBlock(),e.createElementBlock("div",f,[e.renderSlot(o.$slots,"content")])):e.createCommentVNode("",!0),o.$slots.contentList?(e.openBlock(),e.createElementBlock("ul",B,[e.renderSlot(o.$slots,"contentList")])):e.createCommentVNode("",!0),o.$slots.footer?(e.openBlock(),e.createElementBlock("div",k,[e.renderSlot(o.$slots,"footer")])):e.createCommentVNode("",!0)],8,["to"])):e.createCommentVNode("",!0)],64))}}),h=e.defineComponent({inheritAttrs:!1,__name:"listItem",props:{type:{default:"simple"},closeByClick:{type:Boolean,default:!0}},setup(a){const t=a;return(n,l)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass({"top-popup_listDelimiter":n.type==="delimiter","top-popup_listTitle":n.type==="title"})},[t.type==="simple"||t.type==="link"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.type==="link"?"a":"i"),e.mergeProps({key:0,class:{"top-popup_item":!0,"top-popup_item-a":t.type==="simple",a:!0,"top-popup-noCloser":!n.closeByClick}},n.$attrs),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16,["class"])):e.createCommentVNode("",!0),t.type==="title"||t.type==="control"?e.renderSlot(n.$slots,"default",{key:1}):e.createCommentVNode("",!0)],2))}});d.Popup=_,d.PopupListItem=h,d.PopupOpener=u,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
define(["require","exports","vue","../.chunks/forms-58420e52.amd","./worker.amd"],function(i,d,e,m,f){"use strict";i(["../core/core.amd"],l=>{const t=["../assets/popup.css"].map(n=>i.toUrl(n));l.Page.addCss(t)});const y=e.defineComponent({__name:"opener",props:{id:{},pos:{default:"3"},notch:{type:Boolean,default:!0},openByHover:{type:Boolean},posBy:{default:"fixed"}},setup(l){const t=l,n=t.id||Math.random()+"";let s;function c(p){setTimeout(()=>{s=p.nextElementSibling,s&&r(s)})}e.onUpdated(()=>{s&&r(s)});function r(p){p.dataset.topPopup="vue-"+n,p.dataset.topPopupId=n,p.dataset.topPopupP=t.pos,p.dataset.topPopupPosBy=t.posBy,p.dataset.topPopupNotch=t.notch?"true":"",p.dataset.topPopupOpenByHover=t.openByHover?"true":""}return(p,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("template",{ref:c}),e.renderSlot(p.$slots,"default")],64))}}),S="",u={key:0,class:"top-popup_header"},B={key:0,class:"top-as-a closer"},k={key:1,class:"top-popup_content"},C={key:2,class:"top-popup_content"},_={key:3,class:"top-popup_footer"},h=e.defineComponent({__name:"popup",props:{id:{default:""},class:{},pos:{default:"3"},notch:{type:Boolean,default:!0},openByHover:{type:Boolean},posBy:{default:"fixed"}},emits:["open","close"],setup(l,{emit:t}){const n=l,s=t,c=n.id||Math.random()+"",r=e.ref(null),a={onOpen:async o=>{o.elPopupInner.innerText="",r.value=o.elPopupInner,a.opened=!0,a.popup=o,s("open")},onClose:o=>{r.value=null,a.opened=!1,a.popup=null,s("close")},classRef:e.toRef(n,"class"),opened:!1,popup:null};return f.regVueComponent(c,a),e.onUnmounted(()=>{f.unregVueComponent(c)}),(o,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.$slots.opener?(e.openBlock(),e.createBlock(y,{key:0,id:e.unref(c),pos:o.pos,posBy:o.posBy,notch:o.notch,openByHover:o.openByHover},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"opener")]),_:3},8,["id","pos","posBy","notch","openByHover"])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createBlock(e.Teleport,{key:1,to:r.value},[o.$slots.header||e.unref(m.Core).state.isMobile?(e.openBlock(),e.createElementBlock("div",u,[e.unref(m.Core).state.isMobile?(e.openBlock(),e.createElementBlock("span",B,e.toDisplayString(a.popup.options.i18n.Close),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"header")])):e.createCommentVNode("",!0),o.$slots.content?(e.openBlock(),e.createElementBlock("div",k,[e.renderSlot(o.$slots,"content")])):e.createCommentVNode("",!0),o.$slots.contentList?(e.openBlock(),e.createElementBlock("ul",C,[e.renderSlot(o.$slots,"contentList")])):e.createCommentVNode("",!0),o.$slots.footer?(e.openBlock(),e.createElementBlock("div",_,[e.renderSlot(o.$slots,"footer")])):e.createCommentVNode("",!0)],8,["to"])):e.createCommentVNode("",!0)],64))}}),P=e.defineComponent({inheritAttrs:!1,__name:"listItem",props:{type:{default:"button"},closeByClick:{type:Boolean,default:!0}},setup(l){const t=l;return(n,s)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass({"top-popup_liNoSelectable":t.type!=="button"&&t.type!=="link"})},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.$attrs.href?"a":"div"),e.mergeProps({class:{"top-popup_listItem":!0,"top-popup_listItem-button":t.type==="button"||t.type==="link",a:t.type==="button"||t.type==="link","top-popup_listItem-title":t.type==="title","top-popup_listItem-delimiter":t.type==="delimiter","top-popup-noCloser":!n.closeByClick}},n.$attrs),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16,["class"]))],2))}});d.Popup=h,d.PopupListItem=P,d.PopupOpener=y,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
3
2
|
//# sourceMappingURL=popup.amd.js.map
|
package/popup/popup.amd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popup.amd.js","sources":["../../src/components/popup/popup/opener.vue","../../src/components/popup/popup/popup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onUpdated, ref } from 'vue';\nimport type { OpenerProps } from './popup';\n\nconst props = withDefaults(defineProps<OpenerProps>(), {\n\tpos: '3',\n\tnotch: true,\n\tposBy: 'fixed',\n});\n\nconst id = props.id || Math.random() + '';\n\nlet elOpener: Element;\n\n/**\n * Необычная функция для проброски props внтурь элемента слота\n *\n * @param el - вспомогательрный элемент для доступа к элементам слота\n */\nfunction render (el: any) {\n\tsetTimeout(() => {\n\t\telOpener = el.nextElementSibling;\n\n\t\tif (elOpener) {\n\t\t\trenderOpener(elOpener);\n\t\t}\n\t});\n}\n\nonUpdated(() => {\n\tif (elOpener) {\n\t\trenderOpener(elOpener);\n\t}\n});\n\nfunction renderOpener (elOpener: any) {\n\telOpener.dataset.topPopup = 'vue-' + id;\n\telOpener.dataset.topPopupId = id;\n\telOpener.dataset.topPopupP = props.pos;\n\telOpener.dataset.topPopupPosBy = props.posBy;\n\telOpener.dataset.topPopupNotch = props.notch ? 'true' : '';\n\telOpener.dataset.topPopupOpenByHover = props.openByHover ? 'true' : '';\n}\n</script>\n\n<template>\n\t<template :ref=\"render\"></template>\n\n\t<!-- @slot элемент для открытия Popup -->\n\t<slot></slot>\n</template>\n\n<style>\nh3[data-top-popup],\ndiv[data-top-popup],\ni[data-top-popup]:not(.btn)
|
|
1
|
+
{"version":3,"file":"popup.amd.js","sources":["../../src/components/popup/popup/opener.vue","../../src/components/popup/popup/popup.vue","../../src/components/popup/popup/listItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onUpdated, ref } from 'vue';\nimport type { OpenerProps } from './popup';\n\nconst props = withDefaults(defineProps<OpenerProps>(), {\n\tpos: '3',\n\tnotch: true,\n\tposBy: 'fixed',\n});\n\nconst id = props.id || Math.random() + '';\n\nlet elOpener: Element;\n\n/**\n * Необычная функция для проброски props внтурь элемента слота\n *\n * @param el - вспомогательрный элемент для доступа к элементам слота\n */\nfunction render (el: any) {\n\tsetTimeout(() => {\n\t\telOpener = el.nextElementSibling;\n\n\t\tif (elOpener) {\n\t\t\trenderOpener(elOpener);\n\t\t}\n\t});\n}\n\nonUpdated(() => {\n\tif (elOpener) {\n\t\trenderOpener(elOpener);\n\t}\n});\n\nfunction renderOpener (elOpener: any) {\n\telOpener.dataset.topPopup = 'vue-' + id;\n\telOpener.dataset.topPopupId = id;\n\telOpener.dataset.topPopupP = props.pos;\n\telOpener.dataset.topPopupPosBy = props.posBy;\n\telOpener.dataset.topPopupNotch = props.notch ? 'true' : '';\n\telOpener.dataset.topPopupOpenByHover = props.openByHover ? 'true' : '';\n}\n</script>\n\n<template>\n\t<template :ref=\"render\"></template>\n\n\t<!-- @slot элемент для открытия Popup -->\n\t<slot></slot>\n</template>\n\n<!-- Использует общий deprecated класс .btn -->\n<style>\nh3[data-top-popup],\ndiv[data-top-popup],\ni[data-top-popup]:not(.btn),\nb[data-top-popup]:not(.btn) {\n\tcursor: pointer;\n\tuser-select: none;\n\tfont-style: normal;\n\ttext-decoration: none;\n\tdisplay: inline-flex;\n\talign-items: center;\n}\n\n[data-top-popup][data-top-popup-disabled] {\n\tpointer-events: none;\n\tcursor: auto !important;\n}\n\ni[contenteditable] {\n\tcursor: text !important;\n}\n</style>","<script setup lang=\"ts\">\nimport { ref, toRef, onUnmounted } from 'vue';\nimport type { Props, Emits } from './popup';\nimport Core from '@/core/core/core';\nimport Opener from './opener.vue';\nimport Worker from '@/components/popup/lib/worker';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tid: '',\n\tpos: '3',\n\tnotch: true,\n\tposBy: 'fixed',\n});\n\nconst emit = defineEmits<Emits>();\n\nconst id = props.id || Math.random() + '';\nconst elPopupRef = ref(null);\n\n// см. lib/popup\nconst onOpen = async (popup: any) => {\n\tpopup.elPopupInner.innerText = '';\n\n\telPopupRef.value = popup.elPopupInner;\n\n\tvueConnector.opened = true;\n\tvueConnector.popup = popup;\n\n\temit('open');\n};\n\n// см. lib/popup\nconst onClose = (popup: any) => {\n\telPopupRef.value = null;\n\n\tvueConnector.opened = false;\n\tvueConnector.popup = null;\n\n\temit('close');\n};\n\nconst vueConnector = {\n\tonOpen,\n\tonClose,\n\tclassRef: toRef(props, 'class'),\n\topened: false,\n\tpopup: null,\n};\n\nWorker.regVueComponent(id, vueConnector);\n\nonUnmounted(() => {\n\tWorker.unregVueComponent(id);\n});\n</script>\n\n<template>\n\t<Opener\n\t\tv-if=\"$slots.opener\"\n\t\t:id=\"id\"\n\t\t:pos=\"pos\"\n\t\t:posBy=\"posBy\"\n\t\t:notch=\"notch\"\n\t\t:openByHover=\"openByHover\"\n\t>\n\t\t<!-- @slot элемент для открытия Popup -->\n\t\t<slot name=\"opener\"></slot>\n\t</Opener>\n\n\t<!-- Это шаблон для компонента Popup, сам Popup генерируется в js и может находиться где угодно -->\n\t<!-- elPopupRef будет установлен только после открытия и будет сброшен сразу после закрытия Popup -->\n\t<teleport\n\t\tv-if=\"elPopupRef\"\n\t\t:to=\"elPopupRef\"\n\t>\n\t\t<div v-if=\"$slots.header || Core.state.isMobile\" class=\"top-popup_header\">\n\t\t\t<span\n\t\t\t\tv-if=\"Core.state.isMobile\"\n\t\t\t\tclass=\"top-as-a closer\"\n\t\t\t>\n\t\t\t\t{{ vueConnector.popup.options.i18n.Close }}\n\t\t\t</span>\n\n\t\t\t<!-- @slot Шапка -->\n\t\t\t<slot name=\"header\"></slot>\n\t\t</div>\n\n\t\t<div v-if=\"$slots.content\" class=\"top-popup_content\">\n\t\t\t<!-- @slot Контент в свободной форме -->\n\t\t\t<slot name=\"content\"></slot>\n\t\t</div>\n\n\t\t<ul v-if=\"$slots.contentList\" class=\"top-popup_content\">\n\t\t\t<!-- @slot Контент в виде списка, для вставки элементов списка испоьзуйте компонент popup/listItem -->\n\t\t\t<slot name=\"contentList\"></slot>\n\t\t</ul>\n\n\t\t<div v-if=\"$slots.footer\" class=\"top-popup_footer\">\n\t\t\t<!-- @slot Футер -->\n\t\t\t<slot name=\"footer\"></slot>\n\t\t</div>\n\t</teleport>\n</template>","<script setup lang=\"ts\">\nimport type { ListItemProps } from './popup';\n\ndefineOptions({\n\tinheritAttrs: false,\n});\n\nconst props = withDefaults(defineProps<ListItemProps>(), {\n\ttype: 'button',\n\tcloseByClick: true,\n});\n</script>\n\n<template>\n\t<li :class=\"{\n\t\t'top-popup_liNoSelectable': props.type !== 'button' && props.type !== 'link'\n\t}\">\n\t\t<component\n\t\t\t:is=\"$attrs.href ? 'a' : 'div'\"\n\t\t\t:class=\"{\n\t\t\t\t'top-popup_listItem': true,\n\t\t\t\t'top-popup_listItem-button': props.type === 'button' || props.type === 'link', // оформления кнопки\n\t\t\t\t'a': props.type === 'button' || props.type === 'link', // оформления кнопки, deprecated\n\t\t\t\t'top-popup_listItem-title': props.type === 'title',\n\t\t\t\t'top-popup_listItem-delimiter': props.type === 'delimiter',\n\t\t\t\t'top-popup-noCloser': !closeByClick\n\t\t\t}\"\n\t\t\t:=$attrs\n\t\t>\n\t\t\t<slot></slot>\n\t\t</component>\n\t</li>\n</template>"],"names":["props","__props","id","render","el","elOpener","renderOpener","elOpener2","emit","__emit","elPopupRef","vue","popup","vueConnector","popup_worker"],"mappings":"2XAIA,MAAAA,EAAAC,EAMAC,EAAAF,EAAA,IAAA,KAAA,OAAA,EAAA,SASA,SAAAG,EAAAC,EAAA,iBAEEC,EAAAD,EAAA,sBAGCE,EAAAD,CAAA,CACD,CAAA,sBAMAC,EAAAD,CAAA,CACD,CAAA,EAGD,SAAAC,EAAAC,EAAA,6BAECA,EAAA,QAAA,WAAAL,4DAGAK,EAAA,QAAA,cAAAP,EAAA,MAAA,OAAA,GACAO,EAAA,QAAA,oBAAAP,EAAA,YAAA,OAAA,giBClCD,MAAAA,EAAAC,EAOAO,EAAAC,EAEAP,EAAAF,EAAA,IAAA,KAAA,OAAA,EAAA,GACAU,EAAAC,EAAA,IAAA,IAAA,KAwBqB,OArBrB,MAAAC,GAAA,CACCA,EAAA,aAAA,UAAA,GAEAF,EAAA,MAAAE,EAAA,aAEAC,EAAA,OAAA,GACAA,EAAA,MAAAD,EAEAJ,EAAA,MAAA,CAAW,EAcX,QAVDI,GAAA,CACCF,EAAA,MAAA,KAEAG,EAAA,OAAA,GACAA,EAAA,MAAA,KAEAL,EAAA,OAAA,CAAY,EAKZ,SAAAG,EAAA,MAAAX,EAAA,OAAA,sBAGO,mDAMPc,EAAA,kBAAAZ,CAAA,CAA2B,CAAA,8vCC7C5B,MAAAF,EAAAC"}
|