@topvisor/ui 0.0.13 → 0.0.14

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 (57) hide show
  1. package/.chunks/forms-1b3f76e9.es.js +410 -0
  2. package/.chunks/forms-1b3f76e9.es.js.map +1 -0
  3. package/.chunks/forms-512abfa7.amd.js +413 -0
  4. package/.chunks/forms-512abfa7.amd.js.map +1 -0
  5. package/README.md +62 -85
  6. package/{l/common → common}/common.amd.js +0 -1
  7. package/{l/common → common}/common.amd.js.map +1 -1
  8. package/{l/common → common}/common.js +0 -1
  9. package/{l/common → common}/common.js.map +1 -1
  10. package/core.css +442 -371
  11. package/dark.css +127 -115
  12. package/forms/forms.amd.js +11 -0
  13. package/forms/forms.amd.js.map +1 -0
  14. package/forms/forms.js +11 -0
  15. package/forms/forms.js.map +1 -0
  16. package/{c/style.css → forms.css} +301 -252
  17. package/helpers/helpers.amd.js +6 -0
  18. package/helpers/helpers.amd.js.map +1 -0
  19. package/helpers/helpers.js +6 -0
  20. package/helpers/helpers.js.map +1 -0
  21. package/icomoon/demo-files/Read Me.txt +7 -7
  22. package/icomoon/demo-files/demo.css +161 -161
  23. package/icomoon/demo-files/demo.js +30 -30
  24. package/icomoon/demo.html +2931 -2931
  25. package/icomoon/fonts/Topvisor-2.svg +231 -231
  26. package/icomoon/style.css +644 -644
  27. package/light.css +127 -128
  28. package/package.json +19 -19
  29. package/c/_plugin-vue_export-helper-cb5c78ba.js +0 -12
  30. package/c/_plugin-vue_export-helper-cb5c78ba.js.map +0 -1
  31. package/c/_plugin-vue_export-helper-cc2b3d55.js +0 -11
  32. package/c/_plugin-vue_export-helper-cc2b3d55.js.map +0 -1
  33. package/c/button/button.amd.js +0 -99
  34. package/c/button/button.amd.js.map +0 -1
  35. package/c/button/button.js +0 -100
  36. package/c/button/button.js.map +0 -1
  37. package/c/checkbox/checkbox.amd.js +0 -58
  38. package/c/checkbox/checkbox.amd.js.map +0 -1
  39. package/c/checkbox/checkbox.js +0 -59
  40. package/c/checkbox/checkbox.js.map +0 -1
  41. package/c/example/example.amd.js +0 -35
  42. package/c/example/example.amd.js.map +0 -1
  43. package/c/example/example.js +0 -36
  44. package/c/example/example.js.map +0 -1
  45. package/c/icon/icon.amd.js +0 -22
  46. package/c/icon/icon.amd.js.map +0 -1
  47. package/c/icon/icon.js +0 -22
  48. package/c/icon/icon.js.map +0 -1
  49. package/c/radio/radio.amd.js +0 -49
  50. package/c/radio/radio.amd.js.map +0 -1
  51. package/c/radio/radio.js +0 -50
  52. package/c/radio/radio.js.map +0 -1
  53. package/l/forms/forms.amd.js +0 -206
  54. package/l/forms/forms.amd.js.map +0 -1
  55. package/l/forms/forms.js +0 -205
  56. package/l/forms/forms.js.map +0 -1
  57. package/l/style.css +0 -352
@@ -0,0 +1,410 @@
1
+ import { defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, withCtx, renderSlot, createTextVNode, toDisplayString, createElementBlock, createElementVNode, createCommentVNode, unref, withDirectives, withKeys, vModelText } from "vue";
2
+ var SIZE = /* @__PURE__ */ ((SIZE2) => {
3
+ SIZE2["S"] = "s";
4
+ SIZE2["L"] = "l";
5
+ SIZE2["XL"] = "xl";
6
+ return SIZE2;
7
+ })(SIZE || {});
8
+ var COLOR = /* @__PURE__ */ ((COLOR2) => {
9
+ COLOR2["Theme"] = "theme";
10
+ COLOR2["Blue"] = "blue";
11
+ COLOR2["Green"] = "green";
12
+ COLOR2["Orange"] = "orange";
13
+ COLOR2["Red"] = "red";
14
+ COLOR2["Pink"] = "pink";
15
+ return COLOR2;
16
+ })(COLOR || {});
17
+ var STYLING = /* @__PURE__ */ ((STYLING2) => {
18
+ STYLING2["Regular"] = "";
19
+ STYLING2["Outline"] = "outline";
20
+ STYLING2["Soft"] = "soft";
21
+ STYLING2["Transparent"] = "transparent";
22
+ return STYLING2;
23
+ })(STYLING || {});
24
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
25
+ __name: "button",
26
+ props: {
27
+ color: { default: COLOR.Blue },
28
+ styling: { default: STYLING.Regular },
29
+ size: { default: SIZE.S },
30
+ name: {},
31
+ title: {},
32
+ icon: {},
33
+ icon2: {},
34
+ href: {},
35
+ disabled: { type: Boolean },
36
+ isSubmit: { type: Boolean },
37
+ isActive: { type: Boolean },
38
+ isProgress: { type: Boolean }
39
+ },
40
+ setup(__props) {
41
+ const props = __props;
42
+ const tagName = computed(() => props.href ? "a" : "button");
43
+ const type = computed(() => props.isSubmit ? "submit" : void 0);
44
+ return (_ctx, _cache) => {
45
+ return openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
46
+ class: normalizeClass({
47
+ ["top-active"]: _ctx.isActive,
48
+ ["top-disabled"]: _ctx.disabled,
49
+ ["top-forms-focusable"]: !_ctx.disabled,
50
+ ["top-button"]: true,
51
+ ["top-button-progress"]: _ctx.isProgress,
52
+ [`top-size_${_ctx.size}`]: !!_ctx.size,
53
+ [`top-color_${_ctx.color}`]: true,
54
+ [`top-style_${_ctx.styling}`]: !!_ctx.styling
55
+ }),
56
+ name: _ctx.name,
57
+ title: _ctx.title,
58
+ href: _ctx.href,
59
+ type: type.value,
60
+ "data-top-icon": _ctx.icon || void 0,
61
+ "data-top-icon2": _ctx.icon2 || void 0,
62
+ disabled: _ctx.disabled || void 0,
63
+ inProgress: _ctx.isProgress
64
+ }, {
65
+ default: withCtx(() => [
66
+ renderSlot(_ctx.$slots, "default", {}, () => [
67
+ createTextVNode(toDisplayString(!_ctx.icon ? "Button" : ""), 1)
68
+ ])
69
+ ]),
70
+ _: 3
71
+ }, 8, ["class", "name", "title", "href", "type", "data-top-icon", "data-top-icon2", "disabled", "inProgress"]);
72
+ };
73
+ }
74
+ });
75
+ const progress = "_progress_1f1nw_1";
76
+ const style0$5 = {
77
+ "top-button": "top-button",
78
+ "top-active": "top-active",
79
+ "top-button-progress": "top-button-progress",
80
+ progress,
81
+ "top-color_blue": "top-color_blue",
82
+ "top-color_green": "top-color_green",
83
+ "top-color_orange": "top-color_orange",
84
+ "top-color_red": "top-color_red",
85
+ "top-color_pink": "top-color_pink",
86
+ "top-color_theme": "top-color_theme",
87
+ "top-style_outline": "top-style_outline",
88
+ "top-style_soft": "top-style_soft",
89
+ "top-style_transparent": "top-style_transparent",
90
+ "top-size_l": "top-size_l",
91
+ "top-size_xl": "top-size_xl"
92
+ };
93
+ const _export_sfc = (sfc, props) => {
94
+ const target = sfc.__vccOpts || sfc;
95
+ for (const [key, val] of props) {
96
+ target[key] = val;
97
+ }
98
+ return target;
99
+ };
100
+ const cssModules$5 = {
101
+ "$style": style0$5
102
+ };
103
+ const button = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__cssModules", cssModules$5]]);
104
+ const _hoisted_1$4 = { class: "top-forms-optionLabel" };
105
+ const _hoisted_2$1 = { class: "top-forms-optionLabel_title" };
106
+ const _hoisted_3$1 = {
107
+ key: 0,
108
+ class: "top-forms-optionLabel_description"
109
+ };
110
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
111
+ __name: "controlLabel",
112
+ props: {
113
+ title: {},
114
+ description: {}
115
+ },
116
+ setup(__props) {
117
+ return (_ctx, _cache) => {
118
+ return openBlock(), createElementBlock("div", _hoisted_1$4, [
119
+ createElementVNode("div", _hoisted_2$1, toDisplayString(_ctx.title), 1),
120
+ _ctx.description ? (openBlock(), createElementBlock("div", _hoisted_3$1, toDisplayString(_ctx.description), 1)) : createCommentVNode("", true)
121
+ ]);
122
+ };
123
+ }
124
+ });
125
+ const style0$4 = {
126
+ "top-forms-optionLabel_title": "top-forms-optionLabel_title",
127
+ "top-forms-optionLabel_description": "top-forms-optionLabel_description"
128
+ };
129
+ const cssModules$4 = {
130
+ "$style": style0$4
131
+ };
132
+ const ControlLabel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__cssModules", cssModules$4]]);
133
+ const _hoisted_1$3 = ["name", "value", "checked", "indeterminate", "disabled"];
134
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
135
+ __name: "checkbox",
136
+ props: {
137
+ name: {},
138
+ value: {},
139
+ title: {},
140
+ description: {},
141
+ checked: { type: Boolean },
142
+ disabled: { type: Boolean },
143
+ indeterminate: { type: Boolean },
144
+ isError: { type: Boolean }
145
+ },
146
+ setup(__props) {
147
+ return (_ctx, _cache) => {
148
+ return openBlock(), createElementBlock("label", {
149
+ class: normalizeClass({
150
+ ["top-forms-optionWrapper"]: true,
151
+ ["top-checkbox"]: true,
152
+ ["top-checkbox_" + _ctx.name]: _ctx.name !== "",
153
+ ["top-active"]: _ctx.checked,
154
+ ["top-disabled"]: _ctx.disabled,
155
+ ["top-error"]: _ctx.isError && !_ctx.disabled
156
+ })
157
+ }, [
158
+ createElementVNode("input", {
159
+ type: "checkbox",
160
+ class: normalizeClass({
161
+ ["top-forms-focusable"]: !_ctx.disabled,
162
+ ["top-forms-option"]: true,
163
+ ["top-checkbox_input"]: true,
164
+ ["top-error"]: _ctx.isError && !_ctx.disabled
165
+ }),
166
+ name: _ctx.name,
167
+ value: _ctx.value,
168
+ checked: _ctx.checked,
169
+ indeterminate: _ctx.indeterminate,
170
+ disabled: _ctx.disabled
171
+ }, null, 10, _hoisted_1$3),
172
+ _ctx.title ? (openBlock(), createBlock(ControlLabel, {
173
+ key: 0,
174
+ title: _ctx.title,
175
+ description: _ctx.description
176
+ }, null, 8, ["title", "description"])) : createCommentVNode("", true)
177
+ ], 2);
178
+ };
179
+ }
180
+ });
181
+ const style0$3 = {
182
+ "top-checkbox": "top-checkbox",
183
+ "top-checkbox_input": "top-checkbox_input",
184
+ "top-error": "top-error"
185
+ };
186
+ const cssModules$3 = {
187
+ "$style": style0$3
188
+ };
189
+ const checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__cssModules", cssModules$3]]);
190
+ var CAPTION_TYPE = /* @__PURE__ */ ((CAPTION_TYPE2) => {
191
+ CAPTION_TYPE2["NONE"] = "";
192
+ CAPTION_TYPE2["SLIDE"] = "slide";
193
+ CAPTION_TYPE2["TOP"] = "top";
194
+ return CAPTION_TYPE2;
195
+ })(CAPTION_TYPE || {});
196
+ const _hoisted_1$2 = ["data-top-icon"];
197
+ const _hoisted_2 = ["name", "title", "placeholder", "disabled", "readonly"];
198
+ const _hoisted_3 = {
199
+ key: 2,
200
+ class: "top-formsCaption"
201
+ };
202
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
203
+ __name: "input",
204
+ props: {
205
+ modelValue: {},
206
+ name: {},
207
+ disabled: { type: Boolean },
208
+ readonly: { type: Boolean },
209
+ title: {},
210
+ captionType: { default: CAPTION_TYPE.NONE },
211
+ size: { default: SIZE.S },
212
+ icon: {},
213
+ addCleaner: { type: Boolean },
214
+ isError: { type: Boolean }
215
+ },
216
+ emits: ["update:modelValue"],
217
+ setup(__props, { emit }) {
218
+ const props = __props;
219
+ const value = computed({
220
+ get() {
221
+ return props.modelValue;
222
+ },
223
+ set(value2) {
224
+ emit("update:modelValue", value2);
225
+ }
226
+ });
227
+ const placeholder = computed(() => {
228
+ if (props.addCleaner && !props.title)
229
+ return "";
230
+ if (props.captionType !== CAPTION_TYPE.NONE)
231
+ return "";
232
+ return props.title;
233
+ });
234
+ const clean = () => {
235
+ emit("update:modelValue", "");
236
+ };
237
+ return (_ctx, _cache) => {
238
+ return openBlock(), createElementBlock("label", {
239
+ class: normalizeClass({
240
+ ["top-input"]: true,
241
+ ["top-input-" + _ctx.name]: _ctx.name,
242
+ ["top-size_" + _ctx.size]: true,
243
+ ["top-disabled"]: _ctx.disabled,
244
+ ["top-input-withCleaner"]: _ctx.addCleaner,
245
+ ["top-formsCaptionWrapper"]: _ctx.captionType !== unref(CAPTION_TYPE).NONE,
246
+ ["top-formsCaptionWrapper-always"]: _ctx.captionType === unref(CAPTION_TYPE).TOP,
247
+ ["top-input-withButton"]: !!_ctx.$slots.btn
248
+ }),
249
+ "data-top-icon": _ctx.icon
250
+ }, [
251
+ withDirectives(createElementVNode("input", {
252
+ type: "text",
253
+ class: normalizeClass({
254
+ ["top-forms-focusable"]: !_ctx.disabled,
255
+ ["top-input_input"]: true,
256
+ ["top-error"]: _ctx.isError
257
+ }),
258
+ autocomplete: "off_always",
259
+ name: _ctx.name,
260
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
261
+ title: _ctx.title,
262
+ placeholder: placeholder.value,
263
+ disabled: _ctx.disabled,
264
+ readonly: _ctx.readonly,
265
+ onKeydown: _cache[1] || (_cache[1] = withKeys(() => (_ctx.addCleaner || !!_ctx.$slots.btn) && clean(), ["esc"]))
266
+ }, null, 42, _hoisted_2), [
267
+ [vModelText, value.value]
268
+ ]),
269
+ _ctx.addCleaner && value.value ? (openBlock(), createElementBlock("span", {
270
+ key: 0,
271
+ class: "top-input_cleaner top-cleaner",
272
+ "data-top-icon": "",
273
+ onClick: clean
274
+ })) : createCommentVNode("", true),
275
+ value.value ? renderSlot(_ctx.$slots, "btn", { key: 1 }) : createCommentVNode("", true),
276
+ renderSlot(_ctx.$slots, "default"),
277
+ _ctx.captionType !== unref(CAPTION_TYPE).NONE ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true)
278
+ ], 10, _hoisted_1$2);
279
+ };
280
+ }
281
+ });
282
+ const style0$2 = {
283
+ "top-input": "top-input",
284
+ "top-input_input": "top-input_input",
285
+ "top-input-withCleaner": "top-input-withCleaner"
286
+ };
287
+ const cssModules$2 = {
288
+ "$style": style0$2
289
+ };
290
+ const input = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__cssModules", cssModules$2]]);
291
+ const _hoisted_1$1 = ["name", "value", "checked", "disabled"];
292
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
293
+ __name: "radio",
294
+ props: {
295
+ name: {},
296
+ value: {},
297
+ title: {},
298
+ description: {},
299
+ checked: { type: Boolean },
300
+ disabled: { type: Boolean },
301
+ isError: { type: Boolean }
302
+ },
303
+ setup(__props) {
304
+ return (_ctx, _cache) => {
305
+ return openBlock(), createElementBlock("label", {
306
+ class: normalizeClass({
307
+ ["top-forms-optionWrapper"]: true,
308
+ ["top-radio"]: true,
309
+ ["top-radio_" + _ctx.name]: _ctx.name !== "",
310
+ ["top-active"]: _ctx.checked,
311
+ ["top-disabled"]: _ctx.disabled,
312
+ ["top-error"]: _ctx.isError && !_ctx.disabled
313
+ })
314
+ }, [
315
+ createElementVNode("input", {
316
+ type: "radio",
317
+ class: normalizeClass({
318
+ ["top-forms-focusable"]: !_ctx.disabled,
319
+ ["top-forms-option"]: true,
320
+ ["top-radio_input"]: true,
321
+ ["top-error"]: _ctx.isError && !_ctx.disabled
322
+ }),
323
+ name: _ctx.name,
324
+ value: _ctx.value,
325
+ checked: _ctx.checked,
326
+ disabled: _ctx.disabled
327
+ }, null, 10, _hoisted_1$1),
328
+ _ctx.title ? (openBlock(), createBlock(ControlLabel, {
329
+ key: 0,
330
+ title: _ctx.title,
331
+ description: _ctx.description
332
+ }, null, 8, ["title", "description"])) : createCommentVNode("", true)
333
+ ], 2);
334
+ };
335
+ }
336
+ });
337
+ const style0$1 = {
338
+ "top-radio": "top-radio",
339
+ "top-radio_input": "top-radio_input",
340
+ "top-error": "top-error"
341
+ };
342
+ const cssModules$1 = {
343
+ "$style": style0$1
344
+ };
345
+ const radio = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__cssModules", cssModules$1]]);
346
+ const _hoisted_1 = ["name", "value", "checked", "disabled"];
347
+ const _sfc_main = /* @__PURE__ */ defineComponent({
348
+ __name: "switcher",
349
+ props: {
350
+ name: {},
351
+ value: {},
352
+ title: {},
353
+ description: {},
354
+ checked: { type: Boolean },
355
+ disabled: { type: Boolean },
356
+ isError: { type: Boolean },
357
+ isSwitcher: { type: Boolean }
358
+ },
359
+ setup(__props) {
360
+ return (_ctx, _cache) => {
361
+ return openBlock(), createElementBlock("label", {
362
+ class: normalizeClass({
363
+ ["top-forms-optionWrapper"]: true,
364
+ ["top-checkboxSwitcher"]: true,
365
+ ["top-active"]: _ctx.checked,
366
+ ["top-disabled"]: _ctx.disabled,
367
+ ["top-error"]: _ctx.isError && !_ctx.disabled
368
+ })
369
+ }, [
370
+ createElementVNode("input", {
371
+ type: "checkbox",
372
+ class: normalizeClass({
373
+ ["top-forms-focusable"]: !_ctx.disabled,
374
+ ["top-forms-option"]: true,
375
+ ["top-checkboxSwitcher_input"]: true,
376
+ ["top-error"]: _ctx.isError && !_ctx.disabled
377
+ }),
378
+ name: _ctx.name,
379
+ value: _ctx.value,
380
+ checked: _ctx.checked,
381
+ disabled: _ctx.disabled
382
+ }, null, 10, _hoisted_1),
383
+ _ctx.title ? (openBlock(), createBlock(ControlLabel, {
384
+ key: 0,
385
+ title: _ctx.title,
386
+ description: _ctx.description
387
+ }, null, 8, ["title", "description"])) : createCommentVNode("", true)
388
+ ], 2);
389
+ };
390
+ }
391
+ });
392
+ const style0 = {
393
+ "top-checkboxSwitcher": "top-checkboxSwitcher",
394
+ "top-checkboxSwitcher_input": "top-checkboxSwitcher_input",
395
+ "top-error": "top-error"
396
+ };
397
+ const cssModules = {
398
+ "$style": style0
399
+ };
400
+ const switcher = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
401
+ export {
402
+ ControlLabel as C,
403
+ SIZE as S,
404
+ button as b,
405
+ checkbox as c,
406
+ input as i,
407
+ radio as r,
408
+ switcher as s
409
+ };
410
+ //# sourceMappingURL=forms-1b3f76e9.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forms-1b3f76e9.es.js","sources":["../../src/components/forms/helpers.ts","../../src/components/forms/button/button.ts","../../src/components/forms/button/button.vue","../../src/components/forms/input/input.ts","../../src/components/forms/input/input.vue"],"sourcesContent":["/**\r\n * Размеры\r\n */\r\nexport enum SIZE {\r\n\tS = 's',\r\n\tL = 'l',\r\n\tXL = 'xl',\r\n}","import type { VNode } from 'vue';\nimport { SIZE } from '@/components/forms/helpers';\n\n/**\n * Определение параметров\n */\nexport interface Props {\n\tcolor?: COLOR\n\tstyling?: STYLING // bug: name = style init with object type\n\tsize?: SIZE\n\n\tname?: string\n\ttitle?: string\n\ticon?: string\n\ticon2?: string\n\n\thref?: string // если установлена ссылка, isSubmit не может быть true\n\t// value?: string\n\n\tdisabled?: boolean\n\tisSubmit?: boolean\n\tisActive?: boolean\n\tisProgress?: boolean\n}\n\n/**\n * Определение слотов\n */\nexport interface Slots {\n\t/**\n\t * Cлот с проивзольным содержимым\n\t */\n\tdefault(): VNode[];\n}\n\n/**\n * Определение событий\n */\nexport interface Emits { }\n\n/**\n * Цвета\n */\nexport enum COLOR {\n\tTheme = 'theme',\n\tBlue = 'blue',\n\tGreen = 'green',\n\tOrange = 'orange',\n\tRed = 'red',\n\tPink = 'pink',\n}\n\n/**\n * Стили\n */\nexport enum STYLING {\n\tRegular = '',\n\tOutline = 'outline',\n\tSoft = 'soft',\n\tTransparent = 'transparent',\n}\n\nexport { SIZE };","<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport type { Props } from './button';\r\nimport { COLOR, STYLING, SIZE } from './button';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tcolor: COLOR.Blue,\r\n\tstyling: STYLING.Regular,\r\n\tsize: SIZE.S,\r\n});\r\n\r\nconst tagName = computed(() => props.href ? 'a' : 'button');\r\n\r\nconst type = computed(() => props.isSubmit ? 'submit' : undefined);\r\n</script>\r\n\r\n<template>\r\n\t<component\r\n\t\t:is=\"tagName\"\r\n\t\t:class=\"{\r\n\t\t\t['top-active']: isActive,\r\n\t\t\t['top-disabled']: disabled,\r\n\t\t\t['top-forms-focusable']: !disabled,\r\n\t\t\t['top-button']: true,\r\n\t\t\t['top-button-progress']: isProgress,\r\n\t\t\t[`top-size_${size}`]: !!size,\r\n\t\t\t[`top-color_${color}`]: true,\r\n\t\t\t[`top-style_${styling}`]: !!styling,\r\n\t\t}\"\r\n\t\t:name=\"name\"\r\n\t\t:title=\"title\"\r\n\t\t:href=\"href\"\r\n\t\t:type=\"type\"\r\n\t\t:data-top-icon=\"icon || undefined\"\r\n\t\t:data-top-icon2=\"icon2 || undefined\"\r\n\t\t:disabled=\"disabled || undefined\"\r\n\t\t:inProgress=\"isProgress\"\r\n\t>\r\n\t\t<slot>{{ !icon ? \"Button\" : \"\" }}</slot>\r\n\t</component>\r\n</template>\r\n\r\n<style module>\r\n@import \"./style/button.css\";\r\n@import \"./style/style-outline.css\";\r\n@import \"./style/style-soft.css\";\r\n@import \"./style/style-transparent.css\";\r\n\r\n.top-button {\r\n\t--top-button-color: var(--color-white);\r\n\t--top-button-background-color: transparent;\r\n\t--top-button-background-color-hover: var(--top-button-background-color);\r\n\t--top-button-background-color-active: var(--top-button-background-color-hover);\r\n\t--top-button-background-color-selected: var(--top-button-background-color-hover);\r\n\t--top-button-box-shadow: none;\r\n\t--top-button-box-shadow-hover: var(--top-shadow-darken-2);\r\n\t--top-button-box-shadow-active: var(--top-shadow-darken-3);\r\n\t--top-button-box-shadow-selected: var(--top-shadow-darken-3);\r\n\t--top-forms-border-width: 0px;\r\n\t--top-icon-width: calc(var(--top-icon-size) + var(--top-forms-padding));\r\n\t--top-icon2-width: calc(var(--top-icon2-size) + var(--top-forms-padding));\r\n}\r\n\r\n.top-button.top-size_l {\r\n\t--top-forms-padding: var(--top-forms-padding_l);\r\n\t--top-forms-base-height: var(--top-forms-base-height_l);\r\n}\r\n\r\n.top-button.top-size_xl {\r\n\t--top-forms-padding: var(--top-forms-padding_xl);\r\n\t--top-forms-base-height: var(--top-forms-base-height_xl);\r\n}\r\n</style>","import type { VNode } from 'vue';\r\nimport { SIZE } from '@/components/forms/helpers';\r\n\r\n/**\r\n * Определение параметров\r\n */\r\nexport interface Props {\r\n\tmodelValue?: string\r\n\r\n\tname?: string\r\n\tdisabled?: boolean\r\n\treadonly?: boolean\r\n\r\n\ttitle?: string\r\n\tcaptionType?: CAPTION_TYPE\r\n\r\n\tsize?: SIZE\r\n\ticon?: string\r\n\taddCleaner?: boolean\r\n\tisError?: boolean\r\n}\r\n\r\n/**\r\n * Определение слотов\r\n */\r\nexport interface Slots {\r\n\t/**\r\n\t * Cлот с проивзольным содержимым\r\n\t */\r\n\tdefault(): VNode[];\r\n\tbtn(): VNode[];\r\n}\r\n\r\n/**\r\n * Определение событий\r\n */\r\nexport interface Emits {\r\n\t(e: 'update:modelValue', value?: string): void\r\n}\r\n\r\n/**\r\n * Типы заголовка\r\n */\r\nexport enum CAPTION_TYPE {\r\n\tNONE = '',\r\n\tSLIDE = 'slide',\r\n\tTOP = 'top',\r\n}\r\n\r\nexport { SIZE };","<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport type { Props, Emits } from './input';\r\nimport { SIZE, CAPTION_TYPE } from './input';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tsize: SIZE.S,\r\n\tcaptionType: CAPTION_TYPE.NONE,\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst value = computed({\r\n\tget() {\r\n\t\treturn props.modelValue;\r\n\t},\r\n\tset(value) {\r\n\t\temit('update:modelValue', value);\r\n\t}\r\n});\r\n\r\nconst placeholder = computed(() => {\r\n\tif (props.addCleaner && !props.title) return '';\r\n\tif (props.captionType !== CAPTION_TYPE.NONE) return '';\r\n\r\n\treturn props.title;\r\n});\r\n\r\nconst clean = () => {\r\n\temit('update:modelValue', '');\r\n}\r\n</script>\r\n\r\n<template>\r\n\t<label\r\n\t\t:class=\"{\r\n\t\t\t['top-input']: true,\r\n\t\t\t['top-input-' + name]: name,\r\n\t\t\t['top-size_' + size]: true,\r\n\t\t\t['top-disabled']: disabled,\r\n\t\t\t['top-input-withCleaner']: addCleaner,\r\n\t\t\t['top-formsCaptionWrapper']: captionType !== CAPTION_TYPE.NONE,\r\n\t\t\t['top-formsCaptionWrapper-always']: captionType === CAPTION_TYPE.TOP,\r\n\t\t\t['top-input-withButton']: !!$slots.btn,\r\n\t\t}\"\r\n\t\t:data-top-icon=\"icon\"\r\n\t>\r\n\t\t<input\r\n\t\t\ttype=\"text\"\r\n\t\t\t:class=\"{\r\n\t\t\t\t['top-forms-focusable']: !disabled,\r\n\t\t\t\t['top-input_input']: true,\r\n\t\t\t\t['top-error']: isError,\r\n\t\t\t}\"\r\n\t\t\tautocomplete=\"off_always\"\r\n\t\t\t:name=\"name\"\r\n\t\t\tv-model=\"value\"\r\n\t\t\t:title=\"title\"\r\n\t\t\t:placeholder=\"placeholder\"\r\n\t\t\t:disabled=\"disabled\"\r\n\t\t\t:readonly=\"readonly\"\r\n\t\t\t@keydown.esc=\"() => (addCleaner || !!$slots.btn) && clean()\"\r\n\t\t>\r\n\r\n\t\t<span\r\n\t\t\tv-if=\"addCleaner && value\"\r\n\t\t\tclass=\"top-input_cleaner top-cleaner\"\r\n\t\t\tdata-top-icon=\"\"\r\n\t\t\t@click=\"clean\"\r\n\t\t></span>\r\n\r\n\t\t<!-- TODO: кнопка должна отоборажаться только при изменении value -->\r\n\t\t<!-- TODO: до нажатия на кнопку, изменеине не должно применяться -->\r\n\t\t<!-- TODO: при отмене состояние должно возвращаться к первоначальному -->\r\n\t\t<slot\r\n\t\t\tv-if=\"value\"\r\n\t\t\tname=\"btn\"\r\n\t\t/>\r\n\r\n\t\t<slot></slot>\r\n\r\n\t\t<span\r\n\t\t\tv-if=\"captionType !== CAPTION_TYPE.NONE\"\r\n\t\t\tclass=\"top-formsCaption\"\r\n\t\t>\r\n\t\t\t{{ title }}\r\n\t\t</span>\r\n\t</label>\r\n</template>\r\n\r\n<style module>\r\n.top-input {\r\n\twidth: 180px;\r\n\tdisplay: inline-flex;\r\n\talign-items: center;\r\n\tgap: var(--top-gap-1);\r\n}\r\n\r\n.top-input_input {\r\n\tbackground: var(--top-forms-background-color);\r\n}\r\n\r\n.top-input_input:hover {\r\n\tbackground: var(--top-forms-background-color-hover);\r\n}\r\n\r\n.top-input_input:focus {\r\n\toutline-color: var(--color-theme-75);\r\n\toutline-offset: 0px;\r\n}\r\n\r\n.top-input-withCleaner .top-input_input:not(:placeholder-shown) {\r\n\t--top-forms_clear-width: 24px;\r\n}\r\n\r\n/* TODO: перенести в inputsRange */\r\n.top-input_input {\r\n\twidth: 50%;\r\n\tflex-grow: 1;\r\n}\r\n\r\n.top-input[data-top-icon]:before {\r\n\t--top-icon-color: var(--color-text-secondary);\r\n}\r\n</style>"],"names":["SIZE","COLOR","STYLING","CAPTION_TYPE","value"],"mappings":";AAGY,IAAA,yBAAAA,UAAL;AACNA,QAAA,GAAI,IAAA;AACJA,QAAA,GAAI,IAAA;AACJA,QAAA,IAAK,IAAA;AAHMA,SAAAA;AAAA,GAAA,QAAA,CAAA,CAAA;ACwCA,IAAA,0BAAAC,WAAL;AACNA,SAAA,OAAQ,IAAA;AACRA,SAAA,MAAO,IAAA;AACPA,SAAA,OAAQ,IAAA;AACRA,SAAA,QAAS,IAAA;AACTA,SAAA,KAAM,IAAA;AACNA,SAAA,MAAO,IAAA;AANIA,SAAAA;AAAA,GAAA,SAAA,CAAA,CAAA;AAYA,IAAA,4BAAAC,aAAL;AACNA,WAAA,SAAU,IAAA;AACVA,WAAA,SAAU,IAAA;AACVA,WAAA,MAAO,IAAA;AACPA,WAAA,aAAc,IAAA;AAJHA,SAAAA;AAAA,GAAA,WAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;AC5CZ,UAAM,UAAU,SAAS,MAAM,MAAM,OAAO,MAAM,QAAQ;AAE1D,UAAM,OAAO,SAAS,MAAM,MAAM,WAAW,WAAW,MAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC8BrD,IAAA,iCAAAC,kBAAL;AACNA,gBAAA,MAAO,IAAA;AACPA,gBAAA,OAAQ,IAAA;AACRA,gBAAA,KAAM,IAAA;AAHKA,SAAAA;AAAA,GAAA,gBAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AC/BZ,UAAM,QAAQ,SAAS;AAAA,MACtB,MAAM;AACL,eAAO,MAAM;AAAA,MACd;AAAA,MACA,IAAIC,QAAO;AACV,aAAK,qBAAqBA,MAAK;AAAA,MAChC;AAAA,IAAA,CACA;AAEK,UAAA,cAAc,SAAS,MAAM;AAC9B,UAAA,MAAM,cAAc,CAAC,MAAM;AAAc,eAAA;AACzC,UAAA,MAAM,gBAAgB,aAAa;AAAa,eAAA;AAEpD,aAAO,MAAM;AAAA,IAAA,CACb;AAED,UAAM,QAAQ,MAAM;AACnB,WAAK,qBAAqB,EAAE;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}