@topvisor/ui 0.0.43 → 0.9.3

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 (106) hide show
  1. package/.chunks/{datepicker-92744062.es.js → datepicker-78c2af5a.es.js} +3 -3
  2. package/.chunks/{datepicker-92744062.es.js.map → datepicker-78c2af5a.es.js.map} +1 -1
  3. package/.chunks/{datepicker-a9226b0f.amd.js → datepicker-d67bd339.amd.js} +3 -3
  4. package/.chunks/{datepicker-a9226b0f.amd.js.map → datepicker-d67bd339.amd.js.map} +1 -1
  5. package/.chunks/forms-9284b6d9.amd.js +3 -0
  6. package/.chunks/forms-9284b6d9.amd.js.map +1 -0
  7. package/.chunks/forms-9516aa6c.es.js +1000 -0
  8. package/.chunks/forms-9516aa6c.es.js.map +1 -0
  9. package/.chunks/{popup-a622fe31.es.js → popup-3054fcc1.es.js} +27 -16
  10. package/.chunks/popup-3054fcc1.es.js.map +1 -0
  11. package/.chunks/{popup-de28e508.amd.js → popup-c85f28bf.amd.js} +7 -6
  12. package/.chunks/popup-c85f28bf.amd.js.map +1 -0
  13. package/assets/core.css +1 -1
  14. package/assets/forms.css +1 -1
  15. package/assets/tabsView.css +1 -0
  16. package/core/core.amd.js +1 -1
  17. package/core/core.d.ts +2 -2
  18. package/core/core.js +1 -1
  19. package/forms/forms.amd.js +1 -1
  20. package/forms/forms.js +8 -8
  21. package/formsExt/formsExt.amd.js +1 -1
  22. package/formsExt/formsExt.amd.js.map +1 -1
  23. package/formsExt/formsExt.js +83 -84
  24. package/formsExt/formsExt.js.map +1 -1
  25. package/package.json +4 -1
  26. package/popup/popup.amd.js +1 -1
  27. package/popup/popup.amd.js.map +1 -1
  28. package/popup/popup.js +52 -52
  29. package/popup/worker.amd.js +1 -1
  30. package/popup/worker.amd.js.map +1 -1
  31. package/popup/worker.js +14 -10
  32. package/popup/worker.js.map +1 -1
  33. package/src/components/forms/button/button.stories.d.ts +97 -140
  34. package/src/components/forms/checkbox/checkbox.stories.d.ts +61 -100
  35. package/src/components/forms/controlLabel/controlLabel.stories.d.ts +20 -53
  36. package/src/components/forms/input/input.stories.d.ts +101 -145
  37. package/src/components/forms/inputRange/inputRange.stories.d.ts +117 -221
  38. package/src/components/forms/radio/radio.stories.d.ts +57 -95
  39. package/src/components/forms/switcher/switcher.stories.d.ts +55 -93
  40. package/src/components/formsExt/editInput/editInput.stories.d.ts +34 -69
  41. package/src/components/popup/popup/popup.stories.d.ts +242 -363
  42. package/src/components/tabs/tabs/tabs.stories.d.ts +195 -370
  43. package/src/components/tabsView/tabsView/_MenuItem.stories.d.ts +255 -0
  44. package/src/components/tabsView/tabsView/_MenuTitle.stories.d.ts +180 -0
  45. package/src/components/tabsView/tabsView/content.vue.d.ts +19 -0
  46. package/src/components/tabsView/tabsView/menu.vue.d.ts +19 -0
  47. package/src/components/tabsView/tabsView/menuDelimeter.vue.d.ts +2 -0
  48. package/src/components/tabsView/tabsView/menuItem.vue.d.ts +19 -0
  49. package/src/components/tabsView/tabsView/menuTitle.vue.d.ts +19 -0
  50. package/src/components/tabsView/tabsView/state.d.ts +14 -0
  51. package/src/components/tabsView/tabsView/tabsView.d.ts +69 -0
  52. package/src/components/tabsView/tabsView/tabsView.stories.d.ts +358 -0
  53. package/src/components/tabsView/tabsView/tabsView.vue.d.ts +38 -0
  54. package/src/components/tabsView/tabsView.d.ts +4 -0
  55. package/src/core/core/page.d.ts +0 -7
  56. package/src/core/utils/css.d.ts +5 -0
  57. package/src/core/utils/date.d.ts +25 -27
  58. package/src/core/utils/device.d.ts +10 -13
  59. package/tabs/tabs.amd.js +1 -1
  60. package/tabs/tabs.js +37 -38
  61. package/tabs/tabs.js.map +1 -1
  62. package/tabsView/tabsView.amd.js +2 -0
  63. package/tabsView/tabsView.amd.js.map +1 -0
  64. package/tabsView/tabsView.d.ts +1 -0
  65. package/tabsView/tabsView.js +275 -0
  66. package/tabsView/tabsView.js.map +1 -0
  67. package/utils/css.amd.js +2 -0
  68. package/utils/css.amd.js.map +1 -0
  69. package/utils/css.d.ts +1 -0
  70. package/utils/css.js +35 -0
  71. package/utils/css.js.map +1 -0
  72. package/utils/date.amd.js +1 -1
  73. package/utils/date.d.ts +0 -2
  74. package/utils/date.js +5 -2
  75. package/utils/device.amd.js +1 -1
  76. package/utils/device.d.ts +0 -2
  77. package/utils/device.js +7 -2
  78. package/utils/dom.amd.js +1 -1
  79. package/utils/dom.amd.js.map +1 -1
  80. package/utils/dom.d.ts +2 -2
  81. package/utils/dom.js +61 -3
  82. package/utils/dom.js.map +1 -1
  83. package/.chunks/forms-727cc6aa.es.js +0 -1112
  84. package/.chunks/forms-727cc6aa.es.js.map +0 -1
  85. package/.chunks/forms-771091d4.amd.js +0 -3
  86. package/.chunks/forms-771091d4.amd.js.map +0 -1
  87. package/.chunks/popup-a622fe31.es.js.map +0 -1
  88. package/.chunks/popup-de28e508.amd.js.map +0 -1
  89. package/build/cssModules.d.ts +0 -13
  90. package/build/plugin/amdFix.d.ts +0 -8
  91. package/build/plugin/autoloadCSS.d.ts +0 -19
  92. package/build/rollup.config.d.ts +0 -15
  93. package/src/components/component.d.ts +0 -25
  94. package/src/components/helpersStories.d.ts +0 -28
  95. package/src/core/base/Colors.stories.d.ts +0 -19
  96. package/src/core/base/Layout.stories.d.ts +0 -19
  97. package/src/core/base/Properties.stories.d.ts +0 -19
  98. package/src/core/directives/tooltip.d.ts +0 -7
  99. package/src/core/theme/Colors.stories.d.ts +0 -19
  100. package/src/core/theme/Properties.stories.d.ts +0 -19
  101. package/src/core//320/235/320/260/320/261/320/276/321/200 /320/270/320/272/320/276/320/275/320/276/320/272//320/235/320/260/320/261/320/276/321/200 /320/270/320/272/320/276/320/275/320/276/320/272.stories.d.ts" +0 -6
  102. package/src/d.d.ts +0 -4
  103. package/src/resources/styles/core/core.d.ts +0 -0
  104. package/src/resources/styles/themes/dark.d.ts +0 -0
  105. package/src/resources/styles/themes/light.d.ts +0 -0
  106. package/src/storybook/components/icomoon.d.ts +0 -2
@@ -1,13 +1,12 @@
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-727cc6aa.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 = {
1
+ import { insertToPage as I } from "../utils/css.js";
2
+ import { defineComponent as G, ref as f, watch as K, toRef as k, computed as C, openBlock as n, createElementBlock as p, 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 T, createTextVNode as $, mergeProps as w, renderSlot as H, Fragment as z, renderList as N, withDirectives as P, vModelRadio as S } from "vue";
3
+ import { T as U, B, _ as g, I as R } from "../.chunks/forms-9516aa6c.es.js";
4
+ const M = ["../assets/formsExt.css"].map((u) => import.meta.resolve(u));
5
+ await I(M);
6
+ const X = {
8
7
  key: 0,
9
8
  class: "top-editArea_title"
10
- }, X = { class: "top-editArea_footer" }, D = /* @__PURE__ */ G({
9
+ }, D = { class: "top-editArea_footer" }, F = /* @__PURE__ */ G({
11
10
  __name: "editArea",
12
11
  props: {
13
12
  modelValue: {},
@@ -26,33 +25,33 @@ const U = {
26
25
  hint: {}
27
26
  },
28
27
  emits: ["update:modelValue", "cancel"],
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;
28
+ setup(u, { emit: m }) {
29
+ const l = u, r = m, s = f(""), a = f(l.modelValue);
30
+ K(k(l, "modelValue"), () => {
31
+ a.value = l.modelValue;
33
32
  });
34
- const o = C(() => l.value !== t.modelValue), s = (e) => {
33
+ const o = C(() => a.value !== l.modelValue), d = (e) => {
35
34
  r("update:modelValue", e);
36
- }, a = () => {
37
- r("cancel"), l.value = t.modelValue;
35
+ }, t = () => {
36
+ r("cancel"), a.value = l.modelValue;
38
37
  };
39
- return (e, i) => (n(), m("div", {
38
+ return (e, i) => (n(), p("div", {
40
39
  class: v({
41
40
  "top-editArea": !0,
42
41
  "top-editArea-attachedToKeyboard": e.attachToKeyboard
43
42
  })
44
43
  }, [
45
- e.title ? (n(), m("div", U, y(e.title), 1)) : b("", !0),
44
+ e.title ? (n(), p("div", X, y(e.title), 1)) : b("", !0),
46
45
  h("div", {
47
46
  class: v({
48
47
  "top-editArea_form": !0,
49
48
  "top-error": e.isError,
50
- "top-focus": d.value == "focus"
49
+ "top-focus": s.value == "focus"
51
50
  })
52
51
  }, [
53
- A(P, {
54
- modelValue: l.value,
55
- "onUpdate:modelValue": i[0] || (i[0] = (c) => l.value = c),
52
+ A(U, {
53
+ modelValue: a.value,
54
+ "onUpdate:modelValue": i[0] || (i[0] = (c) => a.value = c),
56
55
  name: e.name,
57
56
  placeholder: e.placeholder,
58
57
  rows: e.rows,
@@ -63,33 +62,33 @@ const U = {
63
62
  isError: e.isError,
64
63
  hint: e.hint,
65
64
  class: "top-editArea_element",
66
- onFocus: i[1] || (i[1] = (c) => d.value = "focus"),
67
- onBlur: i[2] || (i[2] = (c) => d.value = ""),
65
+ onFocus: i[1] || (i[1] = (c) => s.value = "focus"),
66
+ onBlur: i[2] || (i[2] = (c) => s.value = ""),
68
67
  onKeyup: [
69
- V(a, ["esc"]),
70
- i[3] || (i[3] = V(_((c) => s(l.value), ["ctrl"]), ["enter"]))
68
+ V(t, ["esc"]),
69
+ i[3] || (i[3] = V(_((c) => d(a.value), ["ctrl"]), ["enter"]))
71
70
  ]
72
- }, null, 8, ["modelValue", "name", "placeholder", "rows", "minHeight", "expandable", "disabled", "readonly", "isError", "hint", "onKeyup"]),
73
- h("div", X, [
71
+ }, null, 8, ["modelValue", "name", "placeholder", "rows", "minHeight", "expandable", "disabled", "readonly", "isError", "hint"]),
72
+ h("div", D, [
74
73
  o.value && (!e.attachToKeyboard || e.modelValue) ? (n(), E(B, {
75
74
  key: 0,
76
75
  class: "top-editArea_button",
77
76
  color: "theme",
78
77
  icon: e.attachToKeyboard ? "" : "",
79
- onClick: a
78
+ onClick: t
80
79
  }, {
81
- default: $(() => [
82
- T(y(e.attachToKeyboard ? "" : e.cancelText), 1)
80
+ default: T(() => [
81
+ $(y(e.attachToKeyboard ? "" : e.cancelText), 1)
83
82
  ]),
84
83
  _: 1
85
84
  }, 8, ["icon"])) : b("", !0),
86
85
  A(B, {
87
86
  class: "top-editArea_button",
88
87
  icon: e.attachToKeyboard ? "" : "",
89
- onClick: i[4] || (i[4] = (c) => s(l.value))
88
+ onClick: i[4] || (i[4] = (c) => d(a.value))
90
89
  }, {
91
- default: $(() => [
92
- T(y(e.attachToKeyboard ? "" : e.submitText), 1)
90
+ default: T(() => [
91
+ $(y(e.attachToKeyboard ? "" : e.submitText), 1)
93
92
  ]),
94
93
  _: 1
95
94
  }, 8, ["icon"])
@@ -97,7 +96,7 @@ const U = {
97
96
  ], 2)
98
97
  ], 2));
99
98
  }
100
- }), F = {
99
+ }), L = {
101
100
  "top-editArea": "top-editArea",
102
101
  "top-editArea_title": "top-editArea_title",
103
102
  "top-editArea_form": "top-editArea_form",
@@ -106,9 +105,9 @@ const U = {
106
105
  "top-textarea_textarea": "top-textarea_textarea",
107
106
  "top-editArea_footer": "top-editArea_footer",
108
107
  "top-editArea-attachedToKeyboard": "top-editArea-attachedToKeyboard"
109
- }, S = {
110
- $style: F
111
- }, te = /* @__PURE__ */ K(D, [["__cssModules", S]]), L = { class: "top-editInput" }, j = /* @__PURE__ */ G({
108
+ }, j = {
109
+ $style: L
110
+ }, re = /* @__PURE__ */ g(F, [["__cssModules", j]]), q = { class: "top-editInput" }, J = /* @__PURE__ */ G({
112
111
  __name: "editInput",
113
112
  props: {
114
113
  modelValue: {},
@@ -116,42 +115,42 @@ const U = {
116
115
  button: {}
117
116
  },
118
117
  emits: ["update:modelValue"],
119
- setup(u, { emit: p }) {
120
- const t = u, r = f(t.modelValue);
121
- w(k(t.modelValue), () => {
122
- r.value = t.modelValue;
118
+ setup(u, { emit: m }) {
119
+ const l = u, r = f(l.modelValue);
120
+ K(k(l.modelValue), () => {
121
+ r.value = l.modelValue;
123
122
  });
124
- const d = p, l = () => {
125
- d("update:modelValue", r.value);
123
+ const s = m, a = () => {
124
+ s("update:modelValue", r.value);
126
125
  };
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"]),
126
+ return (o, d) => (n(), p("div", q, [
127
+ A(R, w(o.input, {
128
+ onKeydownCapture: d[0] || (d[0] = V(_((t) => r.value = o.modelValue, ["stop"]), ["esc"])),
129
+ onKeydown: V(_(a, ["stop"]), ["enter"]),
131
130
  modelValue: r.value,
132
- "onUpdate:modelValue": s[1] || (s[1] = (a) => r.value = a)
131
+ "onUpdate:modelValue": d[1] || (d[1] = (t) => r.value = t)
133
132
  }), null, 16, ["onKeydown", "modelValue"]),
134
- r.value !== o.modelValue ? (n(), E(B, g({
133
+ r.value !== o.modelValue ? (n(), E(B, w({
135
134
  key: 0,
136
135
  icon: "",
137
136
  styling: "soft"
138
- }, o.button, { onClick: l }), {
139
- default: $(() => [
140
- I(o.$slots, "default")
137
+ }, o.button, { onClick: a }), {
138
+ default: T(() => [
139
+ H(o.$slots, "default")
141
140
  ]),
142
141
  _: 3
143
142
  }, 16)) : b("", !0)
144
143
  ]));
145
144
  }
146
- }), q = {
145
+ }), O = {
147
146
  "top-editInput": "top-editInput",
148
147
  "top-input": "top-input"
149
- }, J = {
150
- $style: q
151
- }, ae = /* @__PURE__ */ K(j, [["__cssModules", J]]), O = ["data-top-icon", "onClick"], Q = {
148
+ }, Q = {
149
+ $style: O
150
+ }, se = /* @__PURE__ */ g(J, [["__cssModules", Q]]), W = ["data-top-icon", "onClick"], Y = {
152
151
  key: 0,
153
152
  class: "top-radioGroup_circle"
154
- }, W = ["value", "disabled"], Y = /* @__PURE__ */ G({
153
+ }, Z = ["value", "disabled"], x = /* @__PURE__ */ G({
155
154
  __name: "radioGroup",
156
155
  props: {
157
156
  modelValue: {},
@@ -161,16 +160,16 @@ const U = {
161
160
  isError: { type: Boolean }
162
161
  },
163
162
  emits: ["update:modelValue"],
164
- setup(u, { emit: p }) {
165
- const t = u, r = p, d = C({
163
+ setup(u, { emit: m }) {
164
+ const l = u, r = m, s = C({
166
165
  get() {
167
- return t.modelValue;
166
+ return l.modelValue;
168
167
  },
169
168
  set(o) {
170
169
  r("update:modelValue", o);
171
170
  }
172
- }), l = "radioGroup-" + Math.random();
173
- return (o, s) => (n(), m("div", {
171
+ }), a = "radioGroup-" + Math.random();
172
+ return (o, d) => (n(), p("div", {
174
173
  class: v({
175
174
  "top-radioGroup": !0,
176
175
  "top-scrollBarXHidding": !0,
@@ -178,34 +177,34 @@ const U = {
178
177
  "top-error": o.isError
179
178
  })
180
179
  }, [
181
- (n(!0), m(M, null, H(o.radiosProps, (a) => (n(), m("label", {
180
+ (n(!0), p(z, null, N(o.radiosProps, (t) => (n(), p("label", {
182
181
  class: v({
183
- "top-radioGroup_item-selected": a.value === d.value,
182
+ "top-radioGroup_item-selected": t.value === s.value,
184
183
  "top-radioGroup_item": !0,
185
184
  "top-forms-focusable": !0,
186
- "top-disabled": a.disabled
185
+ "top-disabled": t.disabled
187
186
  }),
188
- "data-top-icon": a.icon,
189
- onClick: (e) => d.value = a.value
187
+ "data-top-icon": t.icon,
188
+ onClick: (e) => s.value = t.value
190
189
  }, [
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,
190
+ $(y(t.title) + " ", 1),
191
+ o.showIndicator ? (n(), p("span", Y)) : b("", !0),
192
+ P(h("input", {
193
+ "onUpdate:modelValue": d[0] || (d[0] = (e) => s.value = e),
194
+ name: a,
196
195
  type: "radio",
197
196
  class: v({
198
197
  "top-unvisible": !0
199
198
  }),
200
- value: a.value,
201
- disabled: a.disabled
202
- }, null, 8, W), [
203
- [N, d.value]
199
+ value: t.value,
200
+ disabled: t.disabled
201
+ }, null, 8, Z), [
202
+ [S, s.value]
204
203
  ])
205
- ], 10, O))), 256))
204
+ ], 10, W))), 256))
206
205
  ], 2));
207
206
  }
208
- }), Z = {
207
+ }), ee = {
209
208
  "top-scrollBarXHidding": "top-scrollBarXHidding",
210
209
  "top-radioGroup": "top-radioGroup",
211
210
  "top-radioGroup_item": "top-radioGroup_item",
@@ -213,12 +212,12 @@ const U = {
213
212
  "top-radioGroup_circle": "top-radioGroup_circle",
214
213
  "top-disabled": "top-disabled",
215
214
  "top-error": "top-error"
216
- }, x = {
217
- $style: Z
218
- }, le = /* @__PURE__ */ K(Y, [["__cssModules", x]]);
215
+ }, oe = {
216
+ $style: ee
217
+ }, de = /* @__PURE__ */ g(x, [["__cssModules", oe]]);
219
218
  export {
220
- te as EditArea,
221
- ae as EditInput,
222
- le as RadioGroup
219
+ re as EditArea,
220
+ se as EditInput,
221
+ de as RadioGroup
223
222
  };
224
223
  //# 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\">\r\nimport { ref, toRef, watch, computed } from 'vue';\r\nimport Button from '@/components/forms/button/button.vue';\r\nimport type { Props, Emits } from './editArea';\r\nimport Textarea from '@/components/forms/textarea/textarea.vue';\r\n\r\n// TODO: добавить переменную top-forms-fixed-height и использовать ее при добавлении отступов у страницы\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tcancelText: 'Отмена',\r\n\tsubmitText: 'Отправить',\r\n\texpandable: true,\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst state = ref('');\r\n\r\n/**\r\n * Локальное значение modelValue, будет проброшено вверх только в случае отправки формы\r\n */\r\nconst localValue = ref(props.modelValue);\r\n\r\nwatch(toRef(props, 'modelValue'), () => {\r\n\tlocalValue.value = props.modelValue;\r\n});\r\n\r\nconst isChanged = computed(() => localValue.value !== props.modelValue);\r\n\r\nconst submit = (value: string) => {\r\n\temit('update:modelValue', value);\r\n};\r\n\r\nconst cancel = () => {\r\n\temit('cancel');\r\n\r\n\t// сброс введенного значения\r\n\tlocalValue.value = props.modelValue;\r\n};\r\n</script>\r\n\r\n<template>\r\n\t<div\r\n\t\t:class=\"{\r\n\t\t\t'top-editArea': true,\r\n\t\t\t'top-editArea-attachedToKeyboard': attachToKeyboard,\r\n\t\t}\"\r\n\t>\r\n\t\t<div\r\n\t\t\tv-if=\"title\"\r\n\t\t\tclass=\"top-editArea_title\"\r\n\t\t>\r\n\t\t\t{{ title }}\r\n\t\t</div>\r\n\r\n\t\t<div\r\n\t\t\t:class=\"{\r\n\t\t\t\t'top-editArea_form': true,\r\n\t\t\t\t'top-error': isError,\r\n\t\t\t\t'top-focus': state == 'focus',\r\n\t\t\t}\"\r\n\t\t>\r\n\t\t\t<Textarea\r\n\t\t\t\tv-model=\"localValue\"\r\n\t\t\t\t:name=\"name\"\r\n\t\t\t\t:placeholder=\"placeholder\"\r\n\t\t\t\t:rows=\"rows\"\r\n\t\t\t\t:minHeight=\"minHeight\"\r\n\t\t\t\t:expandable=\"expandable\"\r\n\t\t\t\t:disabled=\"disabled\"\r\n\t\t\t\t:readonly=\"readonly\"\r\n\t\t\t\t:isError=\"isError\"\r\n\t\t\t\t:hint=\"hint\"\r\n\t\t\t\tclass=\"top-editArea_element\"\r\n\t\t\t\t@focus=\"state = 'focus'\"\r\n\t\t\t\t@blur=\"state = ''\"\r\n\t\t\t\t@keyup.esc=\"cancel\"\r\n\t\t\t\t@keyup.ctrl.enter=\"submit(localValue)\"\r\n\t\t\t/>\r\n\r\n\t\t\t<div class=\"top-editArea_footer\">\r\n\t\t\t\t<Button\r\n\t\t\t\t\tv-if=\"isChanged && (!attachToKeyboard || modelValue)\"\r\n\t\t\t\t\tclass=\"top-editArea_button\"\r\n\t\t\t\t\tcolor=\"theme\"\r\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\r\n\t\t\t\t\t@click=\"cancel\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ attachToKeyboard ? '' : cancelText }}\r\n\t\t\t\t</Button>\r\n\r\n\t\t\t\t<Button\r\n\t\t\t\t\tclass=\"top-editArea_button\"\r\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\r\n\t\t\t\t\t@click=\"submit(localValue)\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ attachToKeyboard ? '' : submitText }}\r\n\t\t\t\t</Button>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n.top-editArea {\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n\tgap: 6px;\r\n}\r\n\r\n.top-editArea_title {\r\n\tfont-size: 12px;\r\n}\r\n\r\n.top-editArea_form {\r\n\tbackground: var(--top-forms-background-color);\r\n\toutline-color: var(--color-theme-75);\r\n\toutline-offset: 0;\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n}\r\n\r\n.top-editArea_form:hover {\r\n\tbackground: var(--top-forms-background-color-hover);\r\n}\r\n\r\n/* textarea в EditArea */\r\n.top-textarea {\r\n\twidth: 100%;\r\n}\r\n\r\n.top-editArea_element.top-textarea_textarea {\r\n\tborder: none;\r\n\toutline: none;\r\n\tanimation: none;\r\n}\r\n\r\n/* footer */\r\n.top-editArea_footer {\r\n\tpadding: var(--top-forms-padding);\r\n\tdisplay: flex;\r\n\tjustify-content: flex-end;\r\n\tgap: var(--top-forms-padding);\r\n}\r\n\r\n/* attachedToKeyboard */\r\n.top-editArea-attachedToKeyboard {\r\n\tbackground: var(--top-forms-background-color);\r\n\tmargin-bottom: env(keyboard-inset-height, 0);\r\n\tposition: fixed;\r\n\tbottom: 0;\r\n\tright: 0;\r\n\tleft: 0;\r\n\tz-index: 2;\r\n\tgap: 0;\r\n}\r\n\r\n.top-editArea-attachedToKeyboard .top-editArea_form {\r\n\tborder-radius: 0;\r\n\tborder: none;\r\n\tborder-top: 1px solid var(--top-forms-border-color);\r\n}\r\n\r\n.top-editArea-attachedToKeyboard .top-editArea_title {\r\n\tborder-top: 1px solid var(--color-line-2-opacity);\r\n\tpadding: var(--top-forms-padding);\r\n}\r\n\r\n.top-editArea-attachedToKeyboard .top-editArea_footer > [data-top-icon] {\r\n\tborder-radius: 100%;\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { ref, toRef, watch } from 'vue';\r\nimport type { Props, Emits } from './editInput';\r\nimport Input from '@/components/forms/input/input.vue';\r\nimport Button from '@/components/forms/button/button.vue';\r\n\r\nconst props = defineProps<Props>();\r\n\r\nconst intermediateValue = ref(props.modelValue);\r\n\r\nwatch(toRef(props.modelValue), () => {\r\n\tintermediateValue.value = props.modelValue;\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst submit = () => {\r\n\temit('update:modelValue', intermediateValue.value);\r\n};\r\n</script>\r\n\r\n<template>\r\n\t<div class=\"top-editInput\">\r\n\t\t<Input\r\n\t\t\t:=\"input\"\r\n\t\t\t@keydown.esc.capture.stop=\"intermediateValue = modelValue\"\r\n\t\t\t@keydown.enter.stop=\"submit\"\r\n\t\t\tv-model=\"intermediateValue\"\r\n\t\t/>\r\n\r\n\t\t<Button\r\n\t\t\tv-if=\"intermediateValue !== modelValue\"\r\n\t\t\ticon=\"\"\r\n\t\t\tstyling=\"soft\"\r\n\t\t\t:=\"button\"\r\n\t\t\t@click=\"submit\"\r\n\t\t>\r\n\t\t\t<!-- @slot Слот Button -->\r\n\t\t\t<slot></slot>\r\n\t\t</Button>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n.top-editInput {\r\n\twidth: 220px;\r\n\tflex-grow: 1;\r\n\tdisplay: flex;\r\n\talign-items: flex-end;\r\n\tgap: var(--top-gap-1);\r\n}\r\n\r\n.top-editInput .top-input {\r\n\twidth: unset;\r\n\tflex-grow: 1;\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport type { Props, Emits } from './radioGroup';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tsize: 's',\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst localValue = computed({\r\n\tget() {\r\n\t\treturn props.modelValue;\r\n\t},\r\n\r\n\tset(value) {\r\n\t\temit('update:modelValue', value);\r\n\t},\r\n});\r\n\r\nconst uid = 'radioGroup-' + Math.random();\r\n</script>\r\n\r\n<template>\r\n\t<div\r\n\t\t:class=\"{\r\n\t\t\t['top-radioGroup']: true,\r\n\t\t\t['top-scrollBarXHidding']: true,\r\n\t\t\t['top-size_' + size]: !!size,\r\n\t\t\t['top-error']: isError,\r\n\t\t}\"\r\n\t>\r\n\t\t<label\r\n\t\t\tv-for=\"item of radiosProps\"\r\n\t\t\t:class=\"{\r\n\t\t\t\t['top-radioGroup_item-selected']: item.value === localValue,\r\n\t\t\t\t['top-radioGroup_item']: true,\r\n\t\t\t\t['top-forms-focusable']: true,\r\n\t\t\t\t['top-disabled']: item.disabled,\r\n\t\t\t}\"\r\n\t\t\t:data-top-icon=\"item.icon\"\r\n\t\t\t@click=\"localValue = item.value\"\r\n\t\t>\r\n\t\t\t{{ item.title }}\r\n\r\n\t\t\t<span\r\n\t\t\t\tv-if=\"showIndicator\"\r\n\t\t\t\tclass=\"top-radioGroup_circle\"\r\n\t\t\t></span>\r\n\r\n\t\t\t<!-- Для нативной навигации -->\r\n\t\t\t<input\r\n\t\t\t\tv-model=\"localValue\"\r\n\t\t\t\t:name=\"uid\"\r\n\t\t\t\ttype=\"radio\"\r\n\t\t\t\t:class=\"{\r\n\t\t\t\t\t['top-unvisible']: true,\r\n\t\t\t\t}\"\r\n\t\t\t\t:value=\"item.value\"\r\n\t\t\t\t:disabled=\"item.disabled\"\r\n\t\t\t/>\r\n\t\t</label>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n@import \"./styles/top-scrollBar.css\";\r\n\r\n.top-radioGroup {\r\n\tuser-select: none;\r\n\tbox-sizing: border-box;\r\n\tborder-radius: 8px;\r\n\tbackground-color: var(--color-theme-50);\r\n\theight: var(--top-forms-base-height);\r\n\tpadding: 2px;\r\n\tgap: 2px;\r\n\tdisplay: flex;\r\n\talign-items: flex-start;\r\n}\r\n\r\n.top-radioGroup_item {\r\n\tcursor: pointer;\r\n\tbox-sizing: border-box;\r\n\tborder-radius: 6px;\r\n\theight: calc(var(--top-forms-base-height) - 4px);\r\n\tpadding: 0 16px;\r\n\tfont-weight: 600;\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tjustify-content: center;\r\n\tflex-grow: 1;\r\n\tgap: 4px;\r\n}\r\n\r\n.top-radioGroup_item:hover {\r\n\tbackground-color: var(--color-theme-25);\r\n\tbox-shadow: 0px 4px 32px 0px rgba(4, 9, 84, 0.10), 0px 0px 4px 0px rgba(4, 9, 84, 0.08);\r\n}\r\n\r\n/* selected */\r\n.top-radioGroup_item-selected {\r\n\tpointer-events: none;\r\n\tbackground-color: var(--color-bg-3);\r\n\tbox-shadow: 0px 4px 32px 0px rgba(4, 9, 84, 0.10), 0px 0px 4px 0px rgba(4, 9, 84, 0.08);\r\n}\r\n\r\n/* circle */\r\n.top-radioGroup_circle {\r\n\tcontent: \"\";\r\n\tbox-sizing: border-box;\r\n\tborder: 1px solid var(--color-line-3-opacity);\r\n\tborder-radius: 50%;\r\n\tpadding: 3px;\r\n\tmargin-left: auto;\r\n\twidth: calc(var(--top-forms-option-height) - 3px * 2);\r\n\theight: calc(var(--top-forms-option-height) - 3px * 2);\r\n}\r\n\r\n.top-radioGroup_item:hover .top-radioGroup_circle:before {\r\n\tborder-color: var(--color-primary);\r\n}\r\n\r\n/* circle selected */\r\n.top-radioGroup_item-selected .top-radioGroup_circle {\r\n\tborder-color: var(--color-primary);\r\n\tborder-width: 5px;\r\n}\r\n\r\n.top-radioGroup_item-selected:hover .top-radioGroup_circle {\r\n\tborder-color: var(--color-primary-2);\r\n}\r\n\r\n/* top-disabled */\r\n.top-radioGroup_item.top-disabled {\r\n\t--top-icon-color: var(--color-text-3);\r\n\r\n\tcolor: var(--color-text-3);\r\n}\r\n\r\n.top-radioGroup_item.top-disabled .top-radioGroup_circle {\r\n\tborder-color: var(--color-theme-400);\r\n\tbackground-color: var(--color-theme-50);\r\n}\r\n\r\n/* top-error */\r\n.top-radioGroup.top-error .top-radioGroup_item:not(.top-disabled) .top-radioGroup_circle {\r\n\tborder-color: var(--color-negative);\r\n}\r\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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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\">\r\nimport { ref, toRef, watch, computed } from 'vue';\r\nimport Button from '@/components/forms/button/button.vue';\r\nimport type { Props, Emits } from './editArea';\r\nimport Textarea from '@/components/forms/textarea/textarea.vue';\r\n\r\n// TODO: добавить переменную top-forms-fixed-height и использовать ее при добавлении отступов у страницы\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tcancelText: 'Отмена',\r\n\tsubmitText: 'Отправить',\r\n\texpandable: true,\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst state = ref('');\r\n\r\n/**\r\n * Локальное значение modelValue, будет проброшено вверх только в случае отправки формы\r\n */\r\nconst localValue = ref(props.modelValue);\r\n\r\nwatch(toRef(props, 'modelValue'), () => {\r\n\tlocalValue.value = props.modelValue;\r\n});\r\n\r\nconst isChanged = computed(() => localValue.value !== props.modelValue);\r\n\r\nconst submit = (value: string) => {\r\n\temit('update:modelValue', value);\r\n};\r\n\r\nconst cancel = () => {\r\n\temit('cancel');\r\n\r\n\t// сброс введенного значения\r\n\tlocalValue.value = props.modelValue;\r\n};\r\n</script>\r\n\r\n<template>\r\n\t<div\r\n\t\t:class=\"{\r\n\t\t\t'top-editArea': true,\r\n\t\t\t'top-editArea-attachedToKeyboard': attachToKeyboard,\r\n\t\t}\"\r\n\t>\r\n\t\t<div\r\n\t\t\tv-if=\"title\"\r\n\t\t\tclass=\"top-editArea_title\"\r\n\t\t>\r\n\t\t\t{{ title }}\r\n\t\t</div>\r\n\r\n\t\t<div\r\n\t\t\t:class=\"{\r\n\t\t\t\t'top-editArea_form': true,\r\n\t\t\t\t'top-error': isError,\r\n\t\t\t\t'top-focus': state == 'focus',\r\n\t\t\t}\"\r\n\t\t>\r\n\t\t\t<Textarea\r\n\t\t\t\tv-model=\"localValue\"\r\n\t\t\t\t:name=\"name\"\r\n\t\t\t\t:placeholder=\"placeholder\"\r\n\t\t\t\t:rows=\"rows\"\r\n\t\t\t\t:minHeight=\"minHeight\"\r\n\t\t\t\t:expandable=\"expandable\"\r\n\t\t\t\t:disabled=\"disabled\"\r\n\t\t\t\t:readonly=\"readonly\"\r\n\t\t\t\t:isError=\"isError\"\r\n\t\t\t\t:hint=\"hint\"\r\n\t\t\t\tclass=\"top-editArea_element\"\r\n\t\t\t\t@focus=\"state = 'focus'\"\r\n\t\t\t\t@blur=\"state = ''\"\r\n\t\t\t\t@keyup.esc=\"cancel\"\r\n\t\t\t\t@keyup.ctrl.enter=\"submit(localValue)\"\r\n\t\t\t/>\r\n\r\n\t\t\t<div class=\"top-editArea_footer\">\r\n\t\t\t\t<Button\r\n\t\t\t\t\tv-if=\"isChanged && (!attachToKeyboard || modelValue)\"\r\n\t\t\t\t\tclass=\"top-editArea_button\"\r\n\t\t\t\t\tcolor=\"theme\"\r\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\r\n\t\t\t\t\t@click=\"cancel\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ attachToKeyboard ? '' : cancelText }}\r\n\t\t\t\t</Button>\r\n\r\n\t\t\t\t<Button\r\n\t\t\t\t\tclass=\"top-editArea_button\"\r\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\r\n\t\t\t\t\t@click=\"submit(localValue)\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ attachToKeyboard ? '' : submitText }}\r\n\t\t\t\t</Button>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n.top-editArea {\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n\tgap: 6px;\r\n}\r\n\r\n.top-editArea_title {\r\n\tfont-size: 12px;\r\n}\r\n\r\n.top-editArea_form {\r\n\tbackground: var(--top-forms-background-color);\r\n\toutline-color: var(--color-theme-75);\r\n\toutline-offset: 0;\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n}\r\n\r\n.top-editArea_form:hover {\r\n\tbackground: var(--top-forms-background-color-hover);\r\n}\r\n\r\n/* textarea в EditArea */\r\n.top-textarea {\r\n\twidth: 100%;\r\n}\r\n\r\n.top-editArea_element.top-textarea_textarea {\r\n\tborder: none;\r\n\toutline: none;\r\n\tanimation: none;\r\n}\r\n\r\n/* footer */\r\n.top-editArea_footer {\r\n\tpadding: var(--top-forms-padding);\r\n\tdisplay: flex;\r\n\tjustify-content: flex-end;\r\n\tgap: var(--top-forms-padding);\r\n}\r\n\r\n/* attachedToKeyboard */\r\n.top-editArea-attachedToKeyboard {\r\n\tbackground: var(--top-forms-background-color);\r\n\tmargin-bottom: env(keyboard-inset-height, 0);\r\n\tposition: fixed;\r\n\tbottom: 0;\r\n\tright: 0;\r\n\tleft: 0;\r\n\tz-index: 2;\r\n\tgap: 0;\r\n}\r\n\r\n.top-editArea-attachedToKeyboard .top-editArea_form {\r\n\tborder-radius: 0;\r\n\tborder: none;\r\n\tborder-top: 1px solid var(--top-forms-border-color);\r\n}\r\n\r\n.top-editArea-attachedToKeyboard .top-editArea_title {\r\n\tborder-top: 1px solid var(--color-line-2-opacity);\r\n\tpadding: var(--top-forms-padding);\r\n}\r\n\r\n.top-editArea-attachedToKeyboard .top-editArea_footer > [data-top-icon] {\r\n\tborder-radius: 100%;\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { ref, toRef, watch } from 'vue';\r\nimport type { Props, Emits } from './editInput';\r\nimport Input from '@/components/forms/input/input.vue';\r\nimport Button from '@/components/forms/button/button.vue';\r\n\r\nconst props = defineProps<Props>();\r\n\r\nconst intermediateValue = ref(props.modelValue);\r\n\r\nwatch(toRef(props.modelValue), () => {\r\n\tintermediateValue.value = props.modelValue;\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst submit = () => {\r\n\temit('update:modelValue', intermediateValue.value);\r\n};\r\n</script>\r\n\r\n<template>\r\n\t<div class=\"top-editInput\">\r\n\t\t<Input\r\n\t\t\t:=\"input\"\r\n\t\t\t@keydown.esc.capture.stop=\"intermediateValue = modelValue\"\r\n\t\t\t@keydown.enter.stop=\"submit\"\r\n\t\t\tv-model=\"intermediateValue\"\r\n\t\t/>\r\n\r\n\t\t<Button\r\n\t\t\tv-if=\"intermediateValue !== modelValue\"\r\n\t\t\ticon=\"\"\r\n\t\t\tstyling=\"soft\"\r\n\t\t\t:=\"button\"\r\n\t\t\t@click=\"submit\"\r\n\t\t>\r\n\t\t\t<!-- @slot Слот Button -->\r\n\t\t\t<slot></slot>\r\n\t\t</Button>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n.top-editInput {\r\n\twidth: 220px;\r\n\tflex-grow: 1;\r\n\tdisplay: flex;\r\n\talign-items: flex-end;\r\n\tgap: var(--top-gap-1);\r\n}\r\n\r\n.top-editInput .top-input {\r\n\twidth: unset;\r\n\tflex-grow: 1;\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport type { Props, Emits } from './radioGroup';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tsize: 's',\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst localValue = computed({\r\n\tget() {\r\n\t\treturn props.modelValue;\r\n\t},\r\n\r\n\tset(value) {\r\n\t\temit('update:modelValue', value);\r\n\t},\r\n});\r\n\r\nconst uid = 'radioGroup-' + Math.random();\r\n</script>\r\n\r\n<template>\r\n\t<div\r\n\t\t:class=\"{\r\n\t\t\t['top-radioGroup']: true,\r\n\t\t\t['top-scrollBarXHidding']: true,\r\n\t\t\t['top-size_' + size]: !!size,\r\n\t\t\t['top-error']: isError,\r\n\t\t}\"\r\n\t>\r\n\t\t<label\r\n\t\t\tv-for=\"item of radiosProps\"\r\n\t\t\t:class=\"{\r\n\t\t\t\t['top-radioGroup_item-selected']: item.value === localValue,\r\n\t\t\t\t['top-radioGroup_item']: true,\r\n\t\t\t\t['top-forms-focusable']: true,\r\n\t\t\t\t['top-disabled']: item.disabled,\r\n\t\t\t}\"\r\n\t\t\t:data-top-icon=\"item.icon\"\r\n\t\t\t@click=\"localValue = item.value\"\r\n\t\t>\r\n\t\t\t{{ item.title }}\r\n\r\n\t\t\t<span\r\n\t\t\t\tv-if=\"showIndicator\"\r\n\t\t\t\tclass=\"top-radioGroup_circle\"\r\n\t\t\t></span>\r\n\r\n\t\t\t<!-- Для нативной навигации -->\r\n\t\t\t<input\r\n\t\t\t\tv-model=\"localValue\"\r\n\t\t\t\t:name=\"uid\"\r\n\t\t\t\ttype=\"radio\"\r\n\t\t\t\t:class=\"{\r\n\t\t\t\t\t['top-unvisible']: true,\r\n\t\t\t\t}\"\r\n\t\t\t\t:value=\"item.value\"\r\n\t\t\t\t:disabled=\"item.disabled\"\r\n\t\t\t/>\r\n\t\t</label>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n@import \"./styles/top-scrollBar.css\";\r\n\r\n.top-radioGroup {\r\n\tuser-select: none;\r\n\tbox-sizing: border-box;\r\n\tborder-radius: 8px;\r\n\tbackground-color: var(--color-theme-50);\r\n\theight: var(--top-forms-base-height);\r\n\tpadding: 2px;\r\n\tgap: 2px;\r\n\tdisplay: flex;\r\n\talign-items: flex-start;\r\n}\r\n\r\n.top-radioGroup_item {\r\n\tcursor: pointer;\r\n\tbox-sizing: border-box;\r\n\tborder-radius: 6px;\r\n\theight: calc(var(--top-forms-base-height) - 4px);\r\n\tpadding: 0 16px;\r\n\tfont-weight: 600;\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tjustify-content: center;\r\n\tflex-grow: 1;\r\n\tgap: 4px;\r\n}\r\n\r\n.top-radioGroup_item:hover {\r\n\tbackground-color: var(--color-theme-25);\r\n\tbox-shadow: 0px 4px 32px 0px rgba(4, 9, 84, 0.10), 0px 0px 4px 0px rgba(4, 9, 84, 0.08);\r\n}\r\n\r\n/* selected */\r\n.top-radioGroup_item-selected {\r\n\tpointer-events: none;\r\n\tbackground-color: var(--color-bg-3);\r\n\tbox-shadow: 0px 4px 32px 0px rgba(4, 9, 84, 0.10), 0px 0px 4px 0px rgba(4, 9, 84, 0.08);\r\n}\r\n\r\n/* circle */\r\n.top-radioGroup_circle {\r\n\tcontent: \"\";\r\n\tbox-sizing: border-box;\r\n\tborder: 1px solid var(--color-line-3-opacity);\r\n\tborder-radius: 50%;\r\n\tpadding: 3px;\r\n\tmargin-left: auto;\r\n\twidth: calc(var(--top-forms-option-height) - 3px * 2);\r\n\theight: calc(var(--top-forms-option-height) - 3px * 2);\r\n}\r\n\r\n.top-radioGroup_item:hover .top-radioGroup_circle:before {\r\n\tborder-color: var(--color-primary);\r\n}\r\n\r\n/* circle selected */\r\n.top-radioGroup_item-selected .top-radioGroup_circle {\r\n\tborder-color: var(--color-primary);\r\n\tborder-width: 5px;\r\n}\r\n\r\n.top-radioGroup_item-selected:hover .top-radioGroup_circle {\r\n\tborder-color: var(--color-primary-2);\r\n}\r\n\r\n/* top-disabled */\r\n.top-radioGroup_item.top-disabled {\r\n\t--top-icon-color: var(--color-text-3);\r\n\r\n\tcolor: var(--color-text-3);\r\n}\r\n\r\n.top-radioGroup_item.top-disabled .top-radioGroup_circle {\r\n\tborder-color: var(--color-theme-400);\r\n\tbackground-color: var(--color-theme-50);\r\n}\r\n\r\n/* top-error */\r\n.top-radioGroup.top-error .top-radioGroup_item:not(.top-disabled) .top-radioGroup_circle {\r\n\tborder-color: var(--color-negative);\r\n}\r\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,7 +1,7 @@
1
1
  {
2
2
  "name": "@topvisor/ui",
3
3
  "private": false,
4
- "version": "0.0.43",
4
+ "version": "0.9.3",
5
5
  "type": "module",
6
6
  "description": "Topvisor UI-kit Vue",
7
7
  "author": "Topvisor",
@@ -15,5 +15,8 @@
15
15
  "license": "MIT",
16
16
  "peerDependencies": {
17
17
  "vue": "^3.3.4"
18
+ },
19
+ "dependencies": {
20
+ "@topvisor/ui": "^0.9.2"
18
21
  }
19
22
  }
@@ -1,2 +1,2 @@
1
- define(["require","exports","vue","../.chunks/forms-771091d4.amd","./worker.amd"],function(i,d,e,m,u){"use strict";i(["../core/core.amd"],l=>{const t=["../assets/popup.css"].map(n=>i.toUrl(n));l.Page.addCss(t)});const f=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="",B={key:0,class:"top-popup_header"},y={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 u.PopupWorker.regVueComponent(c,a),e.onUnmounted(()=>{u.PopupWorker.unregVueComponent(c)}),(o,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.$slots.opener?(e.openBlock(),e.createBlock(f,{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",B,[e.unref(m.Core).state.isMobile?(e.openBlock(),e.createElementBlock("span",y,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"})},[(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",a:t.type==="button","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=f,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
1
+ define(["require","exports","vue","../.chunks/forms-9284b6d9.amd","./worker.amd","../utils/dom.amd"],function(i,d,e,m,u,S){"use strict";i(["../utils/css.amd"],({insertToPage:l})=>{const t=["../assets/popup.css"].map(n=>i.toUrl(n));l(t)});const f=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))}}),b="",B={key:0,class:"top-popup_header"},y={key:0,class:"top-as-a closer"},k={key:1,class:"top-popup_content"},_={key:2,class:"top-popup_content"},h={key:3,class:"top-popup_footer"},C=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 u.PopupWorker.regVueComponent(c,a),e.onUnmounted(()=>{u.PopupWorker.unregVueComponent(c)}),(o,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.$slots.opener?(e.openBlock(),e.createBlock(f,{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",B,[e.unref(m.Core).state.isMobile?(e.openBlock(),e.createElementBlock("span",y,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",_,[e.renderSlot(o.$slots,"contentList")])):e.createCommentVNode("",!0),o.$slots.footer?(e.openBlock(),e.createElementBlock("div",h,[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"})},[(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",a:t.type==="button","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=C,d.PopupListItem=P,d.PopupOpener=f,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
2
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","../../src/components/popup/popup/listItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { onUpdated, ref } from 'vue';\r\nimport type { OpenerProps } from './popup';\r\n\r\nconst props = withDefaults(defineProps<OpenerProps>(), {\r\n\tpos: '3',\r\n\tnotch: true,\r\n\tposBy: 'fixed',\r\n});\r\n\r\nconst id = props.id || Math.random() + '';\r\n\r\nlet elOpener: Element;\r\n\r\n/**\r\n * Необычная функция для проброски props внтурь элемента слота\r\n *\r\n * @param el - вспомогательрный элемент для доступа к элементам слота\r\n */\r\nfunction render (el: any) {\r\n\tsetTimeout(() => {\r\n\t\telOpener = el.nextElementSibling;\r\n\r\n\t\tif (elOpener) {\r\n\t\t\trenderOpener(elOpener);\r\n\t\t}\r\n\t});\r\n}\r\n\r\nonUpdated(() => {\r\n\tif (elOpener) {\r\n\t\trenderOpener(elOpener);\r\n\t}\r\n});\r\n\r\nfunction renderOpener (elOpener: any) {\r\n\telOpener.dataset.topPopup = 'vue-' + id;\r\n\telOpener.dataset.topPopupId = id;\r\n\telOpener.dataset.topPopupP = props.pos;\r\n\telOpener.dataset.topPopupPosBy = props.posBy;\r\n\telOpener.dataset.topPopupNotch = props.notch ? 'true' : '';\r\n\telOpener.dataset.topPopupOpenByHover = props.openByHover ? 'true' : '';\r\n}\r\n</script>\r\n\r\n<template>\r\n\t<template :ref=\"render\"></template>\r\n\r\n\t<!-- @slot элемент для открытия Popup -->\r\n\t<slot></slot>\r\n</template>\r\n\r\n<!-- Использует общий deprecated класс .btn -->\r\n<style>\r\nh3[data-top-popup],\r\ndiv[data-top-popup],\r\ni[data-top-popup]:not(.btn),\r\nb[data-top-popup]:not(.btn) {\r\n\tcursor: pointer;\r\n\tuser-select: none;\r\n\tfont-style: normal;\r\n\ttext-decoration: none;\r\n\tdisplay: inline-flex;\r\n\talign-items: center;\r\n}\r\n\r\n[data-top-popup][data-top-popup-disabled] {\r\n\tpointer-events: none;\r\n\tcursor: auto !important;\r\n}\r\n\r\ni[contenteditable] {\r\n\tcursor: text !important;\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { ref, toRef, onUnmounted } from 'vue';\r\nimport type { Props, Emits } from './popup';\r\nimport Core from '@/core/core/core';\r\nimport Opener from './opener.vue';\r\nimport Worker from '@/components/popup/lib/worker';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tid: '',\r\n\tpos: '3',\r\n\tnotch: true,\r\n\tposBy: 'fixed',\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst id = props.id || Math.random() + '';\r\nconst elPopupRef = ref(null);\r\n\r\n// см. lib/popup\r\nconst onOpen = async (popup: any) => {\r\n\tpopup.elPopupInner.innerText = '';\r\n\r\n\telPopupRef.value = popup.elPopupInner;\r\n\r\n\tvueConnector.opened = true;\r\n\tvueConnector.popup = popup;\r\n\r\n\temit('open');\r\n};\r\n\r\n// см. lib/popup\r\nconst onClose = (popup: any) => {\r\n\telPopupRef.value = null;\r\n\r\n\tvueConnector.opened = false;\r\n\tvueConnector.popup = null;\r\n\r\n\temit('close');\r\n};\r\n\r\nconst vueConnector = {\r\n\tonOpen,\r\n\tonClose,\r\n\tclassRef: toRef(props, 'class'),\r\n\topened: false,\r\n\tpopup: null,\r\n};\r\n\r\nWorker.regVueComponent(id, vueConnector);\r\n\r\nonUnmounted(() => {\r\n\tWorker.unregVueComponent(id);\r\n});\r\n</script>\r\n\r\n<template>\r\n\t<Opener\r\n\t\tv-if=\"$slots.opener\"\r\n\t\t:id=\"id\"\r\n\t\t:pos=\"pos\"\r\n\t\t:posBy=\"posBy\"\r\n\t\t:notch=\"notch\"\r\n\t\t:openByHover=\"openByHover\"\r\n\t>\r\n\t\t<!-- @slot элемент для открытия Popup -->\r\n\t\t<slot name=\"opener\"></slot>\r\n\t</Opener>\r\n\r\n\t<!-- Это шаблон для компонента Popup, сам Popup генерируется в js и может находиться где угодно -->\r\n\t<!-- elPopupRef будет установлен только после открытия и будет сброшен сразу после закрытия Popup -->\r\n\t<teleport\r\n\t\tv-if=\"elPopupRef\"\r\n\t\t:to=\"elPopupRef\"\r\n\t>\r\n\t\t<div v-if=\"$slots.header || Core.state.isMobile\" class=\"top-popup_header\">\r\n\t\t\t<span\r\n\t\t\t\tv-if=\"Core.state.isMobile\"\r\n\t\t\t\tclass=\"top-as-a closer\"\r\n\t\t\t>\r\n\t\t\t\t{{ vueConnector.popup.options.i18n.Close }}\r\n\t\t\t</span>\r\n\r\n\t\t\t<!-- @slot Шапка -->\r\n\t\t\t<slot name=\"header\"></slot>\r\n\t\t</div>\r\n\r\n\t\t<div v-if=\"$slots.content\" class=\"top-popup_content\">\r\n\t\t\t<!-- @slot Контент в свободной форме -->\r\n\t\t\t<slot name=\"content\"></slot>\r\n\t\t</div>\r\n\r\n\t\t<ul v-if=\"$slots.contentList\" class=\"top-popup_content\">\r\n\t\t\t<!-- @slot Контент в виде списка, для вставки элементов списка испоьзуйте компонент popup/listItem -->\r\n\t\t\t<slot name=\"contentList\"></slot>\r\n\t\t</ul>\r\n\r\n\t\t<div v-if=\"$slots.footer\" class=\"top-popup_footer\">\r\n\t\t\t<!-- @slot Футер -->\r\n\t\t\t<slot name=\"footer\"></slot>\r\n\t\t</div>\r\n\t</teleport>\r\n</template>","<script setup lang=\"ts\">\r\nimport type { ListItemProps } from './popup';\r\n\r\ndefineOptions({\r\n\tinheritAttrs: false,\r\n});\r\n\r\nconst props = withDefaults(defineProps<ListItemProps>(), {\r\n\ttype: 'button',\r\n\tcloseByClick: true,\r\n});\r\n</script>\r\n\r\n<template>\r\n\t<li :class=\"{\r\n\t\t'top-popup_liNoSelectable': props.type !== 'button'\r\n\t}\">\r\n\t\t<component\r\n\t\t\t:is=\"$attrs.href ? 'a' : 'div'\"\r\n\t\t\t:class=\"{\r\n\t\t\t\t'top-popup_listItem': true,\r\n\t\t\t\t'top-popup_listItem-button': props.type === 'button', // оформления кнопки\r\n\t\t\t\t'a': props.type === 'button', // оформления кнопки, deprecated\r\n\t\t\t\t'top-popup_listItem-title': props.type === 'title',\r\n\t\t\t\t'top-popup_listItem-delimiter': props.type === 'delimiter',\r\n\t\t\t\t'top-popup-noCloser': !closeByClick\r\n\t\t\t}\"\r\n\t\t\t:=$attrs\r\n\t\t>\r\n\t\t\t<slot></slot>\r\n\t\t</component>\r\n\t</li>\r\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,+DAMPc,EAAA,YAAA,kBAAAZ,CAAA,CAA2B,CAAA,8vCC7C5B,MAAAF,EAAAC"}
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\">\r\nimport { onUpdated, ref } from 'vue';\r\nimport type { OpenerProps } from './popup';\r\n\r\nconst props = withDefaults(defineProps<OpenerProps>(), {\r\n\tpos: '3',\r\n\tnotch: true,\r\n\tposBy: 'fixed',\r\n});\r\n\r\nconst id = props.id || Math.random() + '';\r\n\r\nlet elOpener: Element;\r\n\r\n/**\r\n * Необычная функция для проброски props внтурь элемента слота\r\n *\r\n * @param el - вспомогательрный элемент для доступа к элементам слота\r\n */\r\nfunction render (el: any) {\r\n\tsetTimeout(() => {\r\n\t\telOpener = el.nextElementSibling;\r\n\r\n\t\tif (elOpener) {\r\n\t\t\trenderOpener(elOpener);\r\n\t\t}\r\n\t});\r\n}\r\n\r\nonUpdated(() => {\r\n\tif (elOpener) {\r\n\t\trenderOpener(elOpener);\r\n\t}\r\n});\r\n\r\nfunction renderOpener (elOpener: any) {\r\n\telOpener.dataset.topPopup = 'vue-' + id;\r\n\telOpener.dataset.topPopupId = id;\r\n\telOpener.dataset.topPopupP = props.pos;\r\n\telOpener.dataset.topPopupPosBy = props.posBy;\r\n\telOpener.dataset.topPopupNotch = props.notch ? 'true' : '';\r\n\telOpener.dataset.topPopupOpenByHover = props.openByHover ? 'true' : '';\r\n}\r\n</script>\r\n\r\n<template>\r\n\t<template :ref=\"render\"></template>\r\n\r\n\t<!-- @slot элемент для открытия Popup -->\r\n\t<slot></slot>\r\n</template>\r\n\r\n<!-- Использует общий deprecated класс .btn -->\r\n<style>\r\nh3[data-top-popup],\r\ndiv[data-top-popup],\r\ni[data-top-popup]:not(.btn),\r\nb[data-top-popup]:not(.btn) {\r\n\tcursor: pointer;\r\n\tuser-select: none;\r\n\tfont-style: normal;\r\n\ttext-decoration: none;\r\n\tdisplay: inline-flex;\r\n\talign-items: center;\r\n}\r\n\r\n[data-top-popup][data-top-popup-disabled] {\r\n\tpointer-events: none;\r\n\tcursor: auto !important;\r\n}\r\n\r\ni[contenteditable] {\r\n\tcursor: text !important;\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { ref, toRef, onUnmounted } from 'vue';\r\nimport type { Props, Emits } from './popup';\r\nimport Core from '@/core/core/core';\r\nimport Opener from './opener.vue';\r\nimport Worker from '@/components/popup/lib/worker';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tid: '',\r\n\tpos: '3',\r\n\tnotch: true,\r\n\tposBy: 'fixed',\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst id = props.id || Math.random() + '';\r\nconst elPopupRef = ref(null);\r\n\r\n// см. lib/popup\r\nconst onOpen = async (popup: any) => {\r\n\tpopup.elPopupInner.innerText = '';\r\n\r\n\telPopupRef.value = popup.elPopupInner;\r\n\r\n\tvueConnector.opened = true;\r\n\tvueConnector.popup = popup;\r\n\r\n\temit('open');\r\n};\r\n\r\n// см. lib/popup\r\nconst onClose = (popup: any) => {\r\n\telPopupRef.value = null;\r\n\r\n\tvueConnector.opened = false;\r\n\tvueConnector.popup = null;\r\n\r\n\temit('close');\r\n};\r\n\r\nconst vueConnector = {\r\n\tonOpen,\r\n\tonClose,\r\n\tclassRef: toRef(props, 'class'),\r\n\topened: false,\r\n\tpopup: null,\r\n};\r\n\r\nWorker.regVueComponent(id, vueConnector);\r\n\r\nonUnmounted(() => {\r\n\tWorker.unregVueComponent(id);\r\n});\r\n</script>\r\n\r\n<template>\r\n\t<Opener\r\n\t\tv-if=\"$slots.opener\"\r\n\t\t:id=\"id\"\r\n\t\t:pos=\"pos\"\r\n\t\t:posBy=\"posBy\"\r\n\t\t:notch=\"notch\"\r\n\t\t:openByHover=\"openByHover\"\r\n\t>\r\n\t\t<!-- @slot элемент для открытия Popup -->\r\n\t\t<slot name=\"opener\"></slot>\r\n\t</Opener>\r\n\r\n\t<!-- Это шаблон для компонента Popup, сам Popup генерируется в js и может находиться где угодно -->\r\n\t<!-- elPopupRef будет установлен только после открытия и будет сброшен сразу после закрытия Popup -->\r\n\t<teleport\r\n\t\tv-if=\"elPopupRef\"\r\n\t\t:to=\"elPopupRef\"\r\n\t>\r\n\t\t<div v-if=\"$slots.header || Core.state.isMobile\" class=\"top-popup_header\">\r\n\t\t\t<span\r\n\t\t\t\tv-if=\"Core.state.isMobile\"\r\n\t\t\t\tclass=\"top-as-a closer\"\r\n\t\t\t>\r\n\t\t\t\t{{ vueConnector.popup.options.i18n.Close }}\r\n\t\t\t</span>\r\n\r\n\t\t\t<!-- @slot Шапка -->\r\n\t\t\t<slot name=\"header\"></slot>\r\n\t\t</div>\r\n\r\n\t\t<div v-if=\"$slots.content\" class=\"top-popup_content\">\r\n\t\t\t<!-- @slot Контент в свободной форме -->\r\n\t\t\t<slot name=\"content\"></slot>\r\n\t\t</div>\r\n\r\n\t\t<ul v-if=\"$slots.contentList\" class=\"top-popup_content\">\r\n\t\t\t<!-- @slot Контент в виде списка, для вставки элементов списка испоьзуйте компонент popup/listItem -->\r\n\t\t\t<slot name=\"contentList\"></slot>\r\n\t\t</ul>\r\n\r\n\t\t<div v-if=\"$slots.footer\" class=\"top-popup_footer\">\r\n\t\t\t<!-- @slot Футер -->\r\n\t\t\t<slot name=\"footer\"></slot>\r\n\t\t</div>\r\n\t</teleport>\r\n</template>","<script setup lang=\"ts\">\r\nimport type { ListItemProps } from './popup';\r\n\r\ndefineOptions({\r\n\tinheritAttrs: false,\r\n});\r\n\r\nconst props = withDefaults(defineProps<ListItemProps>(), {\r\n\ttype: 'button',\r\n\tcloseByClick: true,\r\n});\r\n</script>\r\n\r\n<template>\r\n\t<li :class=\"{\r\n\t\t'top-popup_liNoSelectable': props.type !== 'button'\r\n\t}\">\r\n\t\t<component\r\n\t\t\t:is=\"$attrs.href ? 'a' : 'div'\"\r\n\t\t\t:class=\"{\r\n\t\t\t\t'top-popup_listItem': true,\r\n\t\t\t\t'top-popup_listItem-button': props.type === 'button', // оформления кнопки\r\n\t\t\t\t'a': props.type === 'button', // оформления кнопки, deprecated\r\n\t\t\t\t'top-popup_listItem-title': props.type === 'title',\r\n\t\t\t\t'top-popup_listItem-delimiter': props.type === 'delimiter',\r\n\t\t\t\t'top-popup-noCloser': !closeByClick\r\n\t\t\t}\"\r\n\t\t\t:=$attrs\r\n\t\t>\r\n\t\t\t<slot></slot>\r\n\t\t</component>\r\n\t</li>\r\n</template>"],"names":["props","__props","id","render","el","elOpener","renderOpener","elOpener2","emit","__emit","elPopupRef","vue","popup","vueConnector","popup_worker"],"mappings":"qZAIA,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,+DAMPc,EAAA,YAAA,kBAAAZ,CAAA,CAA2B,CAAA,8vCC7C5B,MAAAF,EAAAC"}
package/popup/popup.js CHANGED
@@ -1,11 +1,11 @@
1
- import { defineComponent as y, onUpdated as P, openBlock as s, createElementBlock as l, Fragment as B, createElementVNode as $, renderSlot as i, ref as k, toRef as b, onUnmounted as I, createBlock as f, unref as m, withCtx as v, createCommentVNode as u, Teleport as g, toDisplayString as H, normalizeClass as N, resolveDynamicComponent as M, mergeProps as S } from "vue";
2
- import { C as _ } from "../.chunks/forms-727cc6aa.es.js";
3
- import { PopupWorker as h } from "./worker.js";
4
- import("../core/core.js").then((a) => {
5
- const o = ["../assets/popup.css"].map((t) => import.meta.resolve(t));
6
- a.default.Page.addCss(o);
7
- });
8
- const V = /* @__PURE__ */ y({
1
+ import { insertToPage as C } from "../utils/css.js";
2
+ import { defineComponent as y, onUpdated as k, openBlock as p, createElementBlock as l, Fragment as h, createElementVNode as I, renderSlot as i, ref as b, toRef as g, onUnmounted as H, createBlock as f, unref as m, withCtx as v, createCommentVNode as u, Teleport as S, toDisplayString as N, normalizeClass as T, resolveDynamicComponent as M, mergeProps as V } from "vue";
3
+ import { C as _ } from "../.chunks/forms-9516aa6c.es.js";
4
+ import { PopupWorker as B } from "./worker.js";
5
+ import "../utils/dom.js";
6
+ const $ = ["../assets/popup.css"].map((r) => import.meta.resolve(r));
7
+ await C($);
8
+ const E = /* @__PURE__ */ y({
9
9
  __name: "opener",
10
10
  props: {
11
11
  id: {},
@@ -14,42 +14,42 @@ const V = /* @__PURE__ */ y({
14
14
  openByHover: { type: Boolean },
15
15
  posBy: { default: "fixed" }
16
16
  },
17
- setup(a) {
18
- const o = a, t = o.id || Math.random() + "";
17
+ setup(r) {
18
+ const o = r, s = o.id || Math.random() + "";
19
19
  let n;
20
- function c(p) {
20
+ function c(t) {
21
21
  setTimeout(() => {
22
- n = p.nextElementSibling, n && r(n);
22
+ n = t.nextElementSibling, n && a(n);
23
23
  });
24
24
  }
25
- P(() => {
26
- n && r(n);
25
+ k(() => {
26
+ n && a(n);
27
27
  });
28
- function r(p) {
29
- p.dataset.topPopup = "vue-" + t, p.dataset.topPopupId = t, p.dataset.topPopupP = o.pos, p.dataset.topPopupPosBy = o.posBy, p.dataset.topPopupNotch = o.notch ? "true" : "", p.dataset.topPopupOpenByHover = o.openByHover ? "true" : "";
28
+ function a(t) {
29
+ t.dataset.topPopup = "vue-" + s, t.dataset.topPopupId = s, t.dataset.topPopupP = o.pos, t.dataset.topPopupPosBy = o.posBy, t.dataset.topPopupNotch = o.notch ? "true" : "", t.dataset.topPopupOpenByHover = o.openByHover ? "true" : "";
30
30
  }
31
- return (p, C) => (s(), l(B, null, [
32
- $("template", { ref: c }),
33
- i(p.$slots, "default")
31
+ return (t, P) => (p(), l(h, null, [
32
+ I("template", { ref: c }),
33
+ i(t.$slots, "default")
34
34
  ], 64));
35
35
  }
36
36
  });
37
- const E = {
37
+ const L = {
38
38
  key: 0,
39
39
  class: "top-popup_header"
40
- }, L = {
40
+ }, R = {
41
41
  key: 0,
42
42
  class: "top-as-a closer"
43
- }, R = {
43
+ }, U = {
44
44
  key: 1,
45
45
  class: "top-popup_content"
46
- }, T = {
46
+ }, w = {
47
47
  key: 2,
48
48
  class: "top-popup_content"
49
49
  }, D = {
50
50
  key: 3,
51
51
  class: "top-popup_footer"
52
- }, A = /* @__PURE__ */ y({
52
+ }, q = /* @__PURE__ */ y({
53
53
  __name: "popup",
54
54
  props: {
55
55
  id: { default: "" },
@@ -60,22 +60,22 @@ const E = {
60
60
  posBy: { default: "fixed" }
61
61
  },
62
62
  emits: ["open", "close"],
63
- setup(a, { emit: o }) {
64
- const t = a, n = o, c = t.id || Math.random() + "", r = k(null), d = {
63
+ setup(r, { emit: o }) {
64
+ const s = r, n = o, c = s.id || Math.random() + "", a = b(null), d = {
65
65
  onOpen: async (e) => {
66
- e.elPopupInner.innerText = "", r.value = e.elPopupInner, d.opened = !0, d.popup = e, n("open");
66
+ e.elPopupInner.innerText = "", a.value = e.elPopupInner, d.opened = !0, d.popup = e, n("open");
67
67
  },
68
68
  onClose: (e) => {
69
- r.value = null, d.opened = !1, d.popup = null, n("close");
69
+ a.value = null, d.opened = !1, d.popup = null, n("close");
70
70
  },
71
- classRef: b(t, "class"),
71
+ classRef: g(s, "class"),
72
72
  opened: !1,
73
73
  popup: null
74
74
  };
75
- return h.regVueComponent(c, d), I(() => {
76
- h.unregVueComponent(c);
77
- }), (e, U) => (s(), l(B, null, [
78
- e.$slots.opener ? (s(), f(V, {
75
+ return B.regVueComponent(c, d), H(() => {
76
+ B.unregVueComponent(c);
77
+ }), (e, W) => (p(), l(h, null, [
78
+ e.$slots.opener ? (p(), f(E, {
79
79
  key: 0,
80
80
  id: m(c),
81
81
  pos: e.pos,
@@ -88,41 +88,41 @@ const E = {
88
88
  ]),
89
89
  _: 3
90
90
  }, 8, ["id", "pos", "posBy", "notch", "openByHover"])) : u("", !0),
91
- r.value ? (s(), f(g, {
91
+ a.value ? (p(), f(S, {
92
92
  key: 1,
93
- to: r.value
93
+ to: a.value
94
94
  }, [
95
- e.$slots.header || m(_).state.isMobile ? (s(), l("div", E, [
96
- m(_).state.isMobile ? (s(), l("span", L, H(d.popup.options.i18n.Close), 1)) : u("", !0),
95
+ e.$slots.header || m(_).state.isMobile ? (p(), l("div", L, [
96
+ m(_).state.isMobile ? (p(), l("span", R, N(d.popup.options.i18n.Close), 1)) : u("", !0),
97
97
  i(e.$slots, "header")
98
98
  ])) : u("", !0),
99
- e.$slots.content ? (s(), l("div", R, [
99
+ e.$slots.content ? (p(), l("div", U, [
100
100
  i(e.$slots, "content")
101
101
  ])) : u("", !0),
102
- e.$slots.contentList ? (s(), l("ul", T, [
102
+ e.$slots.contentList ? (p(), l("ul", w, [
103
103
  i(e.$slots, "contentList")
104
104
  ])) : u("", !0),
105
- e.$slots.footer ? (s(), l("div", D, [
105
+ e.$slots.footer ? (p(), l("div", D, [
106
106
  i(e.$slots, "footer")
107
107
  ])) : u("", !0)
108
108
  ], 8, ["to"])) : u("", !0)
109
109
  ], 64));
110
110
  }
111
- }), F = /* @__PURE__ */ y({
111
+ }), G = /* @__PURE__ */ y({
112
112
  inheritAttrs: !1,
113
113
  __name: "listItem",
114
114
  props: {
115
115
  type: { default: "button" },
116
116
  closeByClick: { type: Boolean, default: !0 }
117
117
  },
118
- setup(a) {
119
- const o = a;
120
- return (t, n) => (s(), l("li", {
121
- class: N({
118
+ setup(r) {
119
+ const o = r;
120
+ return (s, n) => (p(), l("li", {
121
+ class: T({
122
122
  "top-popup_liNoSelectable": o.type !== "button"
123
123
  })
124
124
  }, [
125
- (s(), f(M(t.$attrs.href ? "a" : "div"), S({
125
+ (p(), f(M(s.$attrs.href ? "a" : "div"), V({
126
126
  class: {
127
127
  "top-popup_listItem": !0,
128
128
  "top-popup_listItem-button": o.type === "button",
@@ -131,11 +131,11 @@ const E = {
131
131
  // оформления кнопки, deprecated
132
132
  "top-popup_listItem-title": o.type === "title",
133
133
  "top-popup_listItem-delimiter": o.type === "delimiter",
134
- "top-popup-noCloser": !t.closeByClick
134
+ "top-popup-noCloser": !s.closeByClick
135
135
  }
136
- }, t.$attrs), {
136
+ }, s.$attrs), {
137
137
  default: v(() => [
138
- i(t.$slots, "default")
138
+ i(s.$slots, "default")
139
139
  ]),
140
140
  _: 3
141
141
  }, 16, ["class"]))
@@ -143,8 +143,8 @@ const E = {
143
143
  }
144
144
  });
145
145
  export {
146
- A as Popup,
147
- F as PopupListItem,
148
- V as PopupOpener
146
+ q as Popup,
147
+ G as PopupListItem,
148
+ E as PopupOpener
149
149
  };
150
150
  //# sourceMappingURL=popup.js.map