@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.
Files changed (62) hide show
  1. package/.chunks/{datepicker-ad465c48.es.js → datepicker-778ddcc5.es.js} +2 -2
  2. package/.chunks/{datepicker-ad465c48.es.js.map → datepicker-778ddcc5.es.js.map} +1 -1
  3. package/.chunks/{datepicker-1e725859.amd.js → datepicker-80599025.amd.js} +3 -3
  4. package/.chunks/{datepicker-1e725859.amd.js.map → datepicker-80599025.amd.js.map} +1 -1
  5. package/.chunks/forms-58420e52.amd.js +3 -0
  6. package/.chunks/forms-58420e52.amd.js.map +1 -0
  7. package/.chunks/forms-779fee37.es.js +1107 -0
  8. package/.chunks/forms-779fee37.es.js.map +1 -0
  9. package/.chunks/{popup-0f540839.es.js → popup-672d6531.es.js} +120 -85
  10. package/.chunks/popup-672d6531.es.js.map +1 -0
  11. package/.chunks/popup-d53450b6.amd.js +377 -0
  12. package/.chunks/popup-d53450b6.amd.js.map +1 -0
  13. package/{core.css → assets/core.css} +1 -1
  14. package/assets/forms.css +1 -0
  15. package/{formsExt.css → assets/formsExt.css} +1 -1
  16. package/assets/popup.css +1 -0
  17. package/common/common.amd.js +1 -1
  18. package/core/core.amd.js +1 -1
  19. package/core/core.js +1 -1
  20. package/forms/forms.amd.js +1 -1
  21. package/forms/forms.js +9 -7
  22. package/forms/helpers.amd.js +1 -1
  23. package/forms/helpers.amd.js.map +1 -1
  24. package/forms/helpers.js +1 -0
  25. package/forms/helpers.js.map +1 -1
  26. package/formsExt/formsExt.amd.js +1 -2
  27. package/formsExt/formsExt.amd.js.map +1 -1
  28. package/formsExt/formsExt.js +97 -80
  29. package/formsExt/formsExt.js.map +1 -1
  30. package/package.json +17 -17
  31. package/popup/popup.amd.js +1 -2
  32. package/popup/popup.amd.js.map +1 -1
  33. package/popup/popup.js +74 -68
  34. package/popup/popup.js.map +1 -1
  35. package/popup/worker.amd.js +1 -1
  36. package/popup/worker.amd.js.map +1 -1
  37. package/popup/worker.js +2 -3
  38. package/popup/worker.js.map +1 -1
  39. package/tabs/tabs.amd.js +1 -2
  40. package/tabs/tabs.amd.js.map +1 -1
  41. package/tabs/tabs.js +30 -26
  42. package/tabs/tabs.js.map +1 -1
  43. package/utils/date.amd.js +1 -1
  44. package/utils/date.js +1 -1
  45. package/utils/device.amd.js +1 -1
  46. package/utils/device.js +2 -2
  47. package/utils/dom.amd.js +1 -1
  48. package/utils/dom.amd.js.map +1 -1
  49. package/utils/dom.js +3 -61
  50. package/utils/dom.js.map +1 -1
  51. package/.chunks/forms-2891e074.amd.js +0 -3
  52. package/.chunks/forms-2891e074.amd.js.map +0 -1
  53. package/.chunks/forms-db4cb24d.es.js +0 -946
  54. package/.chunks/forms-db4cb24d.es.js.map +0 -1
  55. package/.chunks/popup-0f540839.es.js.map +0 -1
  56. package/.chunks/popup-e49a9bab.amd.js +0 -341
  57. package/.chunks/popup-e49a9bab.amd.js.map +0 -1
  58. package/forms.css +0 -1
  59. package/popup.css +0 -1
  60. /package/{dark.css → assets/dark.css} +0 -0
  61. /package/{light.css → assets/light.css} +0 -0
  62. /package/{tabs.css → assets/tabs.css} +0 -0
@@ -1,9 +1,13 @@
1
- import { defineComponent as T, ref as b, watch as g, toRef as w, computed as k, openBlock as d, createElementBlock as i, normalizeClass as y, toDisplayString as m, createCommentVNode as v, createElementVNode as K, createVNode as f, withKeys as V, withModifiers as h, createBlock as C, withCtx as A, createTextVNode as _, mergeProps as G, renderSlot as E, Fragment as I, renderList as H } from "vue";
2
- import { T as M, B as $, _ as B, I as z } from "../.chunks/forms-db4cb24d.es.js";
3
- const N = {
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
- }, P = { class: "top-editArea_footer" }, X = /* @__PURE__ */ T({
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(p, { emit: n }) {
26
- const r = p, t = b(""), o = b(r.modelValue);
27
- g(w(r, "modelValue"), () => {
28
- o.value = r.modelValue;
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 s = k(() => o.value !== r.modelValue), a = (e) => {
31
- n("update:modelValue", e);
32
- }, u = () => {
33
- n("cancel"), o.value = r.modelValue;
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, l) => (d(), i("div", {
36
- class: y({
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 ? (d(), i("div", N, m(e.title), 1)) : v("", !0),
42
- K("div", {
43
- class: y({
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": t.value == "focus"
50
+ "top-focus": d.value == "focus"
47
51
  })
48
52
  }, [
49
- f(M, {
50
- modelValue: o.value,
51
- "onUpdate:modelValue": l[0] || (l[0] = (c) => o.value = c),
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: l[1] || (l[1] = (c) => t.value = "focus"),
63
- onBlur: l[2] || (l[2] = (c) => t.value = ""),
66
+ onFocus: i[1] || (i[1] = (c) => d.value = "focus"),
67
+ onBlur: i[2] || (i[2] = (c) => d.value = ""),
64
68
  onKeyup: [
65
- V(u, ["esc"]),
66
- l[3] || (l[3] = V(h((c) => a(o.value), ["ctrl"]), ["enter"]))
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
- K("div", P, [
70
- s.value && (!e.attachToKeyboard || e.modelValue) ? (d(), C($, {
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: u
79
+ onClick: a
76
80
  }, {
77
- default: A(() => [
78
- _(m(e.attachToKeyboard ? "" : e.cancelText), 1)
81
+ default: $(() => [
82
+ T(y(e.attachToKeyboard ? "" : e.cancelText), 1)
79
83
  ]),
80
84
  _: 1
81
- }, 8, ["icon"])) : v("", !0),
82
- f($, {
85
+ }, 8, ["icon"])) : b("", !0),
86
+ A(B, {
83
87
  class: "top-editArea_button",
84
88
  icon: e.attachToKeyboard ? "" : "",
85
- onClick: l[4] || (l[4] = (c) => a(o.value))
89
+ onClick: i[4] || (i[4] = (c) => s(l.value))
86
90
  }, {
87
- default: A(() => [
88
- _(m(e.attachToKeyboard ? "" : e.submitText), 1)
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
- }, R = {
109
+ }, S = {
106
110
  $style: F
107
- }, Z = /* @__PURE__ */ B(X, [["__cssModules", R]]), S = { class: "top-editInput" }, U = /* @__PURE__ */ T({
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(p, { emit: n }) {
116
- const r = p, t = b(r.modelValue);
117
- g(w(r.modelValue), () => {
118
- t.value = r.modelValue;
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 o = () => {
121
- n("update:modelValue", t.value);
124
+ const d = p, l = () => {
125
+ d("update:modelValue", r.value);
122
126
  };
123
- return (s, a) => (d(), i("div", S, [
124
- f(z, G(s.input, {
125
- onKeydownCapture: a[0] || (a[0] = V(h((u) => t.value = s.modelValue, ["stop"]), ["esc"])),
126
- onKeydown: V(h(o, ["stop"]), ["enter"]),
127
- modelValue: t.value,
128
- "onUpdate:modelValue": a[1] || (a[1] = (u) => t.value = u)
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
- t.value !== s.modelValue ? (d(), C($, G({
134
+ r.value !== o.modelValue ? (n(), E(B, g({
131
135
  key: 0,
132
136
  icon: "",
133
137
  styling: "soft"
134
- }, s.button, { onClick: o }), {
135
- default: A(() => [
136
- E(s.$slots, "default")
138
+ }, o.button, { onClick: l }), {
139
+ default: $(() => [
140
+ I(o.$slots, "default")
137
141
  ]),
138
142
  _: 3
139
- }, 16)) : v("", !0)
143
+ }, 16)) : b("", !0)
140
144
  ]));
141
145
  }
142
- }), D = {
146
+ }), q = {
143
147
  "top-editInput": "top-editInput",
144
148
  "top-input": "top-input"
145
- }, L = {
146
- $style: D
147
- }, x = /* @__PURE__ */ B(U, [["__cssModules", L]]), j = ["data-top-icon", "onClick"], q = {
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
- }, J = /* @__PURE__ */ T({
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(p, { emit: n }) {
161
- const r = p, t = k({
164
+ setup(u, { emit: p }) {
165
+ const t = u, r = p, d = C({
162
166
  get() {
163
- return r.modelValue;
167
+ return t.modelValue;
164
168
  },
165
169
  set(o) {
166
- n("update:modelValue", o);
170
+ r("update:modelValue", o);
167
171
  }
168
- });
169
- return (o, s) => (d(), i("div", {
170
- class: y({
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
- (d(!0), i(I, null, H(o.radiosProps, (a) => (d(), i("div", {
178
- class: y({
179
- "top-radioGroup_item-selected": a.value === t.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: (u) => t.value = a.value
189
+ onClick: (e) => d.value = a.value
185
190
  }, [
186
- _(m(a.title) + " ", 1),
187
- o.showIndicator ? (d(), i("span", q)) : v("", !0)
188
- ], 10, j))), 256))
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
- }), O = {
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
- }, Q = {
200
- $style: O
201
- }, ee = /* @__PURE__ */ B(J, [["__cssModules", Q]]);
216
+ }, x = {
217
+ $style: Z
218
+ }, le = /* @__PURE__ */ K(Y, [["__cssModules", x]]);
202
219
  export {
203
- Z as EditArea,
204
- x as EditInput,
205
- ee as RadioGroup
220
+ te as EditArea,
221
+ ae as EditInput,
222
+ le as RadioGroup
206
223
  };
207
224
  //# sourceMappingURL=formsExt.js.map
@@ -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
- "name": "@topvisor/ui",
3
- "private": false,
4
- "version": "0.0.36",
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
- }
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
  }
@@ -1,3 +1,2 @@
1
- define(["exports","vue","./worker.amd","../.chunks/forms-2891e074.amd","../utils/dom.amd"],function(d,e,i,C,P){"use strict"; if(typeof vue === "undefined") var vue = window.Vue;var m=document.createElement("style");m.textContent=`h3[data-top-popup],div[data-top-popup],i[data-top-popup]:not(.btn):not(.g_btn),b[data-top-popup]:not(.btn):not(.g_btn){cursor:pointer;-webkit-user-select:none;user-select:none;font-style:normal;text-decoration:none;display:inline-flex;align-items:center}[data-top-popup][data-top-popup-disabled]{pointer-events:none;cursor:auto!important}i[contenteditable]{cursor:text!important}
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
@@ -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):not(.g_btn),\nb[data-top-popup]:not(.btn):not(.g_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 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\" class=\"top-popup_header\">\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>"],"names":["id","props","elOpener","render","el","renderOpener","onUpdated","elPopupRef","ref","vueConnector","popup","emit","toRef","Worker","onUnmounted"],"mappings":";gNAUMA,EAAKC,EAAM,IAAM,KAAK,OAAW,EAAA,GAEnC,IAAAC,EAOJ,SAASC,EAAQC,EAAS,CACzB,WAAW,IAAM,CAChBF,EAAWE,EAAG,mBAEVF,GACHG,EAAaH,CAAQ,CACtB,CACA,CACF,CAEAI,EAAAA,UAAU,IAAM,CACXJ,GACHG,EAAaH,CAAQ,CACtB,CACA,EAED,SAASG,EAAcH,EAAe,CACrCA,EAAS,QAAQ,SAAW,OAASF,EACrCE,EAAS,QAAQ,WAAaF,EAC9BE,EAAS,QAAQ,UAAYD,EAAM,IACnCC,EAAS,QAAQ,cAAgBD,EAAM,MACvCC,EAAS,QAAQ,cAAgBD,EAAM,MAAQ,OAAS,GACxDC,EAAS,QAAQ,oBAAsBD,EAAM,YAAc,OAAS,EACrE,sgBC3BMD,EAAKC,EAAM,IAAM,KAAK,OAAW,EAAA,GACjCM,EAAaC,MAAI,IAAI,EAwBrBC,EAAe,CACpB,OAtBc,MAAOC,GAAe,CACpCA,EAAM,aAAa,UAAY,GAE/BH,EAAW,MAAQG,EAAM,aAEzBD,EAAa,OAAS,GACtBA,EAAa,MAAQC,EAErBC,EAAK,MAAM,CAAA,EAeX,QAXgBD,GAAe,CAC/BH,EAAW,MAAQ,KAEnBE,EAAa,OAAS,GACtBA,EAAa,MAAQ,KAErBE,EAAK,OAAO,CAAA,EAMZ,SAAUC,EAAAA,MAAMX,EAAO,OAAO,EAC9B,OAAQ,GACR,MAAO,IAAA,EAGDY,OAAAA,EAAA,gBAAgBb,EAAIS,CAAY,EAEvCK,EAAAA,YAAY,IAAM,CACjBD,EAAO,kBAAkBb,CAAE,CAAA,CAC3B"}
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"}