@topvisor/ui 0.0.16 → 0.0.17

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 (72) hide show
  1. package/.chunks/core-0b2c7817.es.js +152 -0
  2. package/.chunks/{core-c3afa109.es.js.map → core-0b2c7817.es.js.map} +1 -1
  3. package/.chunks/core-51f7b679.amd.js +151 -0
  4. package/.chunks/{core-97b070be.amd.js.map → core-51f7b679.amd.js.map} +1 -1
  5. package/.chunks/forms-245e3bc0.es.js +565 -0
  6. package/.chunks/forms-245e3bc0.es.js.map +1 -0
  7. package/.chunks/forms-f7b7b259.amd.js +568 -0
  8. package/.chunks/forms-f7b7b259.amd.js.map +1 -0
  9. package/.chunks/popup-8f650530.amd.js +728 -0
  10. package/.chunks/{popup-6d1d8097.amd.js.map → popup-8f650530.amd.js.map} +1 -1
  11. package/.chunks/popup-d240ed19.es.js +731 -0
  12. package/.chunks/{popup-95d27020.es.js.map → popup-d240ed19.es.js.map} +1 -1
  13. package/common/common.amd.js +21 -1
  14. package/common/common.amd.js.map +1 -1
  15. package/common/common.js +11 -8
  16. package/common/common.js.map +1 -1
  17. package/core/core.amd.js +4 -1
  18. package/core/core.amd.js.map +1 -1
  19. package/core/core.js +2 -2
  20. package/core.css +648 -1
  21. package/dark.css +136 -1
  22. package/editArea/editArea.amd.js +125 -2
  23. package/editArea/editArea.amd.js.map +1 -1
  24. package/editArea/editArea.js +88 -76
  25. package/editArea/editArea.js.map +1 -1
  26. package/editArea.css +61 -1
  27. package/forms/forms.amd.js +12 -1
  28. package/forms/forms.amd.js.map +1 -1
  29. package/forms/forms.js +9 -9
  30. package/forms/helpers.amd.js +5 -1
  31. package/forms/helpers.amd.js.map +1 -1
  32. package/forms/helpers.js +2 -2
  33. package/forms.css +505 -1
  34. package/icomoon/demo.html +15 -1
  35. package/icomoon/fonts/Topvisor-2.svg +1 -0
  36. package/icomoon/fonts/Topvisor-2.ttf +0 -0
  37. package/icomoon/fonts/Topvisor-2.woff +0 -0
  38. package/icomoon/selection.json +1 -1
  39. package/icomoon/style.css +6 -3
  40. package/light.css +136 -1
  41. package/package.json +1 -1
  42. package/popup/popup.amd.js +197 -2
  43. package/popup/popup.amd.js.map +1 -1
  44. package/popup/popup.js +157 -105
  45. package/popup/popup.js.map +1 -1
  46. package/popup/worker.amd.js +233 -1
  47. package/popup/worker.amd.js.map +1 -1
  48. package/popup/worker.js +146 -67
  49. package/popup/worker.js.map +1 -1
  50. package/popup.css +19 -1
  51. package/tabs/tabs.amd.js +123 -0
  52. package/tabs/tabs.amd.js.map +1 -0
  53. package/tabs/tabs.js +120 -0
  54. package/tabs/tabs.js.map +1 -0
  55. package/tabs.css +60 -0
  56. package/utils/device.amd.js +41 -1
  57. package/utils/device.amd.js.map +1 -1
  58. package/utils/device.js +13 -6
  59. package/utils/device.js.map +1 -1
  60. package/utils/dom.amd.js +94 -1
  61. package/utils/dom.amd.js.map +1 -1
  62. package/utils/dom.js +77 -47
  63. package/utils/dom.js.map +1 -1
  64. package/.chunks/core-97b070be.amd.js +0 -2
  65. package/.chunks/core-c3afa109.es.js +0 -121
  66. package/.chunks/forms-6a6b0b80.es.js +0 -436
  67. package/.chunks/forms-6a6b0b80.es.js.map +0 -1
  68. package/.chunks/forms-7119886a.amd.js +0 -3
  69. package/.chunks/forms-7119886a.amd.js.map +0 -1
  70. package/.chunks/popup-6d1d8097.amd.js +0 -342
  71. package/.chunks/popup-95d27020.es.js +0 -720
  72. package/icomoon/demo-files/Read Me.txt +0 -7
package/dark.css CHANGED
@@ -1 +1,136 @@
1
- :root{--color-primary: var(--color-blue-450);--color-primary-light: var(--color-blue-800);--color-primary-light-opacity: rgba(1, 40, 100, .75);--color-primary-2: var(--color-blue-500);--color-primary-2-light: var(--color-blue-750);--color-primary-2-light-opacity: rgba(0, 59, 146, .64);--color-secondary-opacity: rgba(193, 203, 215, .16);--color-secondary-2-opacity: rgba(193, 203, 215, .32);--color-secondary-3-opacity: rgba(193, 203, 215, .38);--color-positive: var(--color-green-450);--color-positive-opacity: rgba(0, 102, 44, .75);--color-positive-light: var(--color-green-800);--color-positive-light-opacity: rgba(0, 89, 38, .47);--color-positive-2: var(--color-green-500);--color-positive-2-light: var(--color-green-750);--color-positive-2-light-opacity: rgba(0, 102, 44, .75);--color-warning: var(--color-orange-450);--color-warning-opacity: rgba(255, 170, 51, .3);--color-warning-light: var(--color-orange-800);--color-warning-light-opacity: rgba(109, 64, 1, .61);--color-warning-2: var(--color-orange-500);--color-warning-2-light: var(--color-orange-750);--color-warning-2-light-opacity: rgba(161, 97, 0, .58);--color-negative: var(--color-red-450);--color-negative-opacity: rgba(234, 65, 50, .3);--color-negative-light: var(--color-red-800);--color-negative-light-opacity: rgba(117, 10, 0, .5);--color-negative-2: var(--color-red-500);--color-negative-2-light: var(--color-red-750);--color-negative-2-light-opacity: rgba(136, 23, 0, .66);--color-text-1: var(--color-theme-975);--color-text-2: var(--color-theme-750);--color-text-3: var(--color-theme-550);--color-text-4: var(--color-theme-450);--color-text: var(--color-text-1);--color-text-secondary: var(--color-gray-750);--color-text-secondary-2: var(--color-gray-650);--color-text-link: var(--color-blue-500);--color-text-link-hover: var(--color-blue-450);--color-overlay: rgba(0, 0, 0, .3);--color-placeholder: var(--color-gray-350);--color-placeholder-active: var(--color-gray-450);--color-bg-1: rgba(21, 23, 25, 1);--color-bg-2: rgba(26, 28, 31, 1);--color-bg-3: rgba(38, 41, 46, 1);--color-line-1-opacity: rgba(193, 203, 215, .1);--color-line-2-opacity: rgba(68, 74, 87, .67);--color-line-3-opacity: rgba(104, 110, 126, .67);--scroll-thumb-color: var(--color-gray-750);--scroll-thumb-color-hover: var(--color-gray-700);--scroll-thumb-color-active: var(--color-gray-650);--body-background-color: var(--content-background-color);--content-background-color: var(--color-bg-3);--color-theme-0: var(--color-bg-3);--color-theme-25: rgba(40, 43, 48, 1);--color-theme-50: rgba(41, 45, 51, 1);--color-theme-75: rgba(44, 49, 56, 1);--color-theme-100: rgba(48, 52, 59, 1);--color-theme-125: rgba(52, 56, 64, 1);--color-theme-150: rgba(54, 59, 69, 1);--color-theme-200: rgba(58, 63, 74, 1);--color-theme-250: rgba(61, 66, 77, 1);--color-theme-300: rgba(64, 70, 82, 1);--color-theme-350: rgba(68, 74, 87, 1);--color-theme-400: rgba(75, 81, 94, 1);--color-theme-450: rgba(82, 87, 99, 1);--color-theme-500: rgba(90, 95, 107, 1);--color-theme-525: rgba(98, 103, 115, 1);--color-theme-550: rgba(108, 112, 122, 1);--color-theme-600: rgba(116, 120, 130, 1);--color-theme-650: rgba(128, 131, 140, 1);--color-theme-700: rgba(142, 145, 153, 1);--color-theme-750: rgba(157, 160, 166, 1);--color-theme-800: rgba(174, 177, 184, 1);--color-theme-850: rgba(193, 196, 201, 1);--color-theme-875: rgba(211, 214, 219, 1);--color-theme-900: rgba(235, 237, 240, 1);--color-theme-925: rgba(240, 242, 245, 1);--color-theme-950: rgba(245, 246, 247, 1);--color-theme-975: rgba(250, 251, 252, 1);--color-theme-1000: rgba(255, 255, 255, 1);--top-shadow-s: 0px 0px 3px rgba(0, 0, 0, .11), 0px 5px 25px rgba(0, 0, 0, .17);--top-shadow: 0px 0px 4px rgba(0, 0, 0, .14), 0px 4px 32px rgba(0, 0, 0, .2);--top-shadow-b: 0px 0px 4px rgba(0, 0, 0, .15), 0px 18px 32px rgba(0, 0, 0, .34);--top-shadow-darken: inset 1000px 1000px 1000px 1000px rgba(0, 0, 0, .03);--top-shadow-darken-2: inset 1000px 1000px 1000px 1000px rgba(0, 0, 0, .07);--top-shadow-darken-3: inset 1000px 1000px 1000px 1000px rgba(0, 0, 0, .14)}:root{--top-forms-color: var(--color-text-1);--top-forms-color-disabled: var(--color-text-3);--top-forms-border-color: var(--color-line-2-opacity);--top-forms-border-color-hover: var(--color-primary);--top-forms-border-color-disabled: var(--color-line-1-opacity);--top-forms-placeholder-color: var(--color-text-3);--top-forms-placeholder-color-disabled: var(--color-text-4);--top-forms-background-color: var(--color-bg-3);--top-forms-background-color-hover: var(--color-bg-3)}
1
+ :root {
2
+ /* Main */
3
+ --color-primary: var(--color-blue-450);
4
+ --color-primary-light: var(--color-blue-800);
5
+ --color-primary-light-opacity: rgba(1, 40, 100, 0.75);
6
+ --color-primary-2: var(--color-blue-500);
7
+ --color-primary-2-light: var(--color-blue-750);
8
+ --color-primary-2-light-opacity: rgba(0, 59, 146, 0.64);
9
+
10
+ --color-secondary-opacity: rgba(193, 203, 215, 0.16);
11
+ --color-secondary-2-opacity: rgba(193, 203, 215, 0.32);
12
+ --color-secondary-3-opacity: rgba(193, 203, 215, 0.38);
13
+
14
+ --color-positive: var(--color-green-450);
15
+ --color-positive-opacity: rgba(0, 102, 44, 0.75);
16
+ --color-positive-light: var(--color-green-800);
17
+ --color-positive-light-opacity: rgba(0, 89, 38, 0.47);
18
+ --color-positive-2: var(--color-green-500);
19
+ --color-positive-2-light: var(--color-green-750);
20
+ --color-positive-2-light-opacity: rgba(0, 102, 44, 0.75);
21
+
22
+ --color-warning: var(--color-orange-450);
23
+ --color-warning-opacity: rgba(255, 170, 51, 0.3);
24
+ --color-warning-light: var(--color-orange-800);
25
+ --color-warning-light-opacity: rgba(109, 64, 1, 0.61);
26
+ --color-warning-2: var(--color-orange-500);
27
+ --color-warning-2-light: var(--color-orange-750);
28
+ --color-warning-2-light-opacity: rgba(161, 97, 0, 0.58);
29
+
30
+ --color-negative: var(--color-red-450);
31
+ --color-negative-opacity: rgba(234, 65, 50, 0.3);
32
+ --color-negative-light: var(--color-red-800);
33
+ --color-negative-light-opacity: rgba(117, 10, 0, 0.50);
34
+ --color-negative-2: var(--color-red-500);
35
+ --color-negative-2-light: var(--color-red-750);
36
+ --color-negative-2-light-opacity: rgba(136, 23, 0, 0.66);
37
+
38
+ /* Text */
39
+ --color-text-1: var(--color-theme-975);
40
+ --color-text-2: var(--color-theme-750);
41
+ --color-text-3: var(--color-theme-550);
42
+ --color-text-4: var(--color-theme-450);
43
+ --color-text: var(--color-text-1);
44
+
45
+ --color-text-secondary: var(--color-gray-750);
46
+ --color-text-secondary-2: var(--color-gray-650);
47
+
48
+ --color-text-link: var(--color-blue-500);
49
+ --color-text-link-hover: var(--color-blue-450);
50
+
51
+ --color-overlay: rgba(0, 0, 0, 0.3);
52
+
53
+ --color-placeholder: var(--color-gray-350);
54
+ --color-placeholder-active: var(--color-gray-450);
55
+
56
+ /* Background colors */
57
+ --color-bg-1: rgba(21, 23, 25, 1);
58
+ --color-bg-2: rgba(26, 28, 31, 1);
59
+ --color-bg-3: rgba(38, 41, 46, 1);
60
+
61
+ /* Line colors */
62
+ --color-line-1-opacity: rgba(193, 203, 215, 0.1);
63
+ --color-line-2-opacity: rgba(68, 74, 87, 0.67);
64
+ --color-line-3-opacity: rgba(104, 110, 126, 0.67);
65
+
66
+ /* Scroll */
67
+ --scroll-thumb-color: var(--color-gray-750);
68
+ --scroll-thumb-color-hover: var(--color-gray-700);
69
+ --scroll-thumb-color-active: var(--color-gray-650);
70
+
71
+ /* Page */
72
+ --body-background-color: var(--content-background-color);
73
+ --content-background-color: var(--color-bg-3);
74
+
75
+ /* Theme */
76
+ --color-theme-0: var(--color-bg-3);
77
+ --color-theme-25: rgba(40, 43, 48, 1);
78
+ --color-theme-50: rgba(41, 45, 51, 1);
79
+ --color-theme-75: rgba(44, 49, 56, 1);
80
+ --color-theme-100: rgba(48, 52, 59, 1);
81
+ --color-theme-125: rgba(52, 56, 64, 1);
82
+ --color-theme-150: rgba(54, 59, 69, 1);
83
+ --color-theme-200: rgba(58, 63, 74, 1);
84
+ --color-theme-250: rgba(61, 66, 77, 1);
85
+ --color-theme-300: rgba(64, 70, 82, 1);
86
+ --color-theme-350: rgba(68, 74, 87, 1);
87
+ --color-theme-400: rgba(75, 81, 94, 1);
88
+ --color-theme-450: rgba(82, 87, 99, 1);
89
+ --color-theme-500: rgba(90, 95, 107, 1);
90
+ --color-theme-525: rgba(98, 103, 115, 1);
91
+ --color-theme-550: rgba(108, 112, 122, 1);
92
+ --color-theme-600: rgba(116, 120, 130, 1);
93
+ --color-theme-650: rgba(128, 131, 140, 1);
94
+ --color-theme-700: rgba(142, 145, 153, 1);
95
+ --color-theme-750: rgba(157, 160, 166, 1);
96
+ --color-theme-800: rgba(174, 177, 184, 1);
97
+ --color-theme-850: rgba(193, 196, 201, 1);
98
+ --color-theme-875: rgba(211, 214, 219, 1);
99
+ --color-theme-900: rgba(235, 237, 240, 1);
100
+ --color-theme-925: rgba(240, 242, 245, 1);
101
+ --color-theme-950: rgba(245, 246, 247, 1);
102
+ --color-theme-975: rgba(250, 251, 252, 1);
103
+ --color-theme-1000: rgba(255, 255, 255, 1);
104
+
105
+ /* top-shadow */
106
+ --top-shadow-s:
107
+ 0px 0px 3px rgba(0, 0, 0, 0.11),
108
+ 0px 5px 25px rgba(0, 0, 0, 0.17);
109
+ --top-shadow:
110
+ 0px 0px 4px rgba(0, 0, 0, 0.14),
111
+ 0px 4px 32px rgba(0, 0, 0, 0.2);
112
+ --top-shadow-b:
113
+ 0px 0px 4px rgba(0, 0, 0, 0.15),
114
+ 0px 18px 32px rgba(0, 0, 0, 0.34);
115
+
116
+ --top-shadow-darken: inset 1000px 1000px 1000px 1000px rgba(0, 0, 0, 0.03);
117
+ --top-shadow-darken-2: inset 1000px 1000px 1000px 1000px rgba(0, 0, 0, 0.07);
118
+ --top-shadow-darken-3: inset 1000px 1000px 1000px 1000px rgba(0, 0, 0, 0.14);
119
+ }
120
+
121
+ /* forms */
122
+ :root {
123
+ /* for text */
124
+ --top-forms-color: var(--color-text-1);
125
+ --top-forms-color-disabled: var(--color-text-3);
126
+ /* for border */
127
+ --top-forms-border-color: var(--color-line-2-opacity);
128
+ --top-forms-border-color-hover: var(--color-primary);
129
+ --top-forms-border-color-disabled: var(--color-line-1-opacity);
130
+ /* for placeholder */
131
+ --top-forms-placeholder-color: var(--color-text-3);
132
+ --top-forms-placeholder-color-disabled: var(--color-text-4);
133
+ /* for background */
134
+ --top-forms-background-color: var(--color-bg-3);
135
+ --top-forms-background-color-hover: var(--color-bg-3);
136
+ }
@@ -1,3 +1,126 @@
1
- define(["exports","vue","../.chunks/forms-7119886a.amd"],function(i,e,r){"use strict"; if(typeof vue === "undefined") var vue = window.Vue;var p=document.createElement("style");p.textContent=`.top-editArea{display:flex;flex-direction:column;gap:6px}.top-editArea_title{font-size:12px}.top-editArea_form{background:var(--top-forms-background-color);outline-color:var(--color-theme-75);outline-offset:0;display:flex;flex-direction:column}.top-editArea_form:hover{background:var(--top-forms-background-color-hover)}.top-editArea_element.top-textarea{width:100%}.top-editArea_element.top-textarea_textarea{border:none;outline:none;animation:none}.top-editArea_footer{padding:var(--top-forms-padding);display:flex;justify-content:flex-end;gap:var(--top-forms-padding)}.top-editArea-attachedToKeyboard{background:var(--top-forms-background-color);margin-bottom:env(keyboard-inset-height,0);position:fixed;bottom:0;right:0;left:0;z-index:2;gap:0}.top-editArea-attachedToKeyboard .top-editArea_form{border-radius:0;border:none;border-top:1px solid var(--top-forms-border-color)}.top-editArea-attachedToKeyboard .top-editArea_title{border-top:1px solid var(--color-line-2-opacity);padding:var(--top-forms-padding)}.top-editArea-attachedToKeyboard .top-editArea_footer>[data-top-icon]{border-radius:100%}
2
- `,document.head.appendChild(p);const u={key:0,class:"top-editArea_title"},f={class:"top-editArea_footer"},b=e.defineComponent({__name:"editArea",props:{modelValue:{},title:{},cancelText:{default:"Отмена"},submitText:{default:"Отправить"},attachToKeyboard:{type:Boolean},name:{},placeholder:{},rows:{},minHeight:{},expandable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},isError:{type:Boolean},hint:{}},emits:["update:modelValue","cancel"],setup(A,{emit:s}){const d=A,n=e.ref(""),a=e.ref(d.modelValue);e.watch(e.toRef(d,"modelValue"),()=>{a.value=d.modelValue});const g=e.computed(()=>a.value!==d.modelValue),c=t=>{s("update:modelValue",t)},m=()=>{s("cancel"),a.value=d.modelValue};return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"top-editArea":!0,"top-editArea-attachedToKeyboard":t.attachToKeyboard})},[t.title?(e.openBlock(),e.createElementBlock("div",u,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass({"top-editArea_form":!0,"top-error":t.isError,"top-focus":n.value=="focus"})},[e.createVNode(r.Textarea,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=l=>a.value=l),name:t.name,placeholder:t.placeholder,rows:t.rows,minHeight:t.minHeight,expandable:t.expandable,disabled:t.disabled,readonly:t.readonly,isError:t.isError,hint:t.hint,class:"top-editArea_element",onFocus:o[1]||(o[1]=l=>n.value="focus"),onBlur:o[2]||(o[2]=l=>n.value=""),onKeyup:[e.withKeys(m,["esc"]),o[3]||(o[3]=e.withKeys(e.withModifiers(l=>c(a.value),["ctrl"]),["enter"]))]},null,8,["modelValue","name","placeholder","rows","minHeight","expandable","disabled","readonly","isError","hint","onKeyup"]),e.createElementVNode("div",f,[g.value&&(!t.attachToKeyboard||t.modelValue)?(e.openBlock(),e.createBlock(r.Button,{key:0,class:"top-editArea_button",color:e.unref(r.COLOR).Theme,icon:t.attachToKeyboard?"":"",onClick:m},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.attachToKeyboard?"":t.cancelText),1)]),_:1},8,["color","icon"])):e.createCommentVNode("",!0),e.createVNode(r.Button,{class:"top-editArea_button",icon:t.attachToKeyboard?"":"",onClick:o[4]||(o[4]=l=>c(a.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.attachToKeyboard?"":t.submitText),1)]),_:1},8,["icon"])])],2)],2))}}),y={$style:{"top-editArea":"top-editArea","top-editArea_title":"top-editArea_title","top-editArea_form":"top-editArea_form","top-editArea_element":"top-editArea_element","top-textarea":"top-textarea","top-textarea_textarea":"top-textarea_textarea","top-editArea_footer":"top-editArea_footer","top-editArea-attachedToKeyboard":"top-editArea-attachedToKeyboard"}},h=r._export_sfc(b,[["__cssModules",y]]);i.EditArea=h,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
1
+ define(["exports", "vue", "../.chunks/forms-f7b7b259.amd"], function(exports, vue, forms) {
2
+ "use strict"; if(typeof vue === "undefined") var vue = window.Vue;
3
+ var __vite_style__ = document.createElement("style");
4
+ __vite_style__.textContent = "\n.top-editArea {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.top-editArea_title {\n font-size: 12px;\n}\n.top-editArea_form {\n background: var(--top-forms-background-color);\n outline-color: var(--color-theme-75);\n outline-offset: 0;\n display: flex;\n flex-direction: column;\n}\n.top-editArea_form:hover {\n background: var(--top-forms-background-color-hover);\n}\n\n/* textarea в EditArea */\n.top-editArea_element.top-textarea {\n width: 100%;\n}\n.top-editArea_element.top-textarea_textarea {\n border: none;\n outline: none;\n animation: none;\n}\n\n/* footer */\n.top-editArea_footer {\n padding: var(--top-forms-padding);\n display: flex;\n justify-content: flex-end;\n gap: var(--top-forms-padding);\n}\n\n/* attachedToKeyboard */\n.top-editArea-attachedToKeyboard {\n background: var(--top-forms-background-color);\n margin-bottom: env(keyboard-inset-height, 0);\n position: fixed;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 2;\n gap: 0;\n}\n.top-editArea-attachedToKeyboard .top-editArea_form {\n border-radius: 0;\n border: none;\n border-top: 1px solid var(--top-forms-border-color);\n}\n.top-editArea-attachedToKeyboard .top-editArea_title {\n border-top: 1px solid var(--color-line-2-opacity);\n padding: var(--top-forms-padding);\n}\n.top-editArea-attachedToKeyboard .top-editArea_footer > [data-top-icon] {\n border-radius: 100%;\n}\n";
5
+ document.head.appendChild(__vite_style__);
6
+ const _hoisted_1 = {
7
+ key: 0,
8
+ class: "top-editArea_title"
9
+ };
10
+ const _hoisted_2 = { class: "top-editArea_footer" };
11
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
12
+ __name: "editArea",
13
+ props: {
14
+ modelValue: {},
15
+ title: {},
16
+ cancelText: { default: "Отмена" },
17
+ submitText: { default: "Отправить" },
18
+ attachToKeyboard: { type: Boolean },
19
+ name: {},
20
+ placeholder: {},
21
+ rows: {},
22
+ minHeight: {},
23
+ expandable: { type: Boolean, default: true },
24
+ disabled: { type: Boolean },
25
+ readonly: { type: Boolean },
26
+ isError: { type: Boolean },
27
+ hint: {}
28
+ },
29
+ emits: ["update:modelValue", "cancel"],
30
+ setup(__props, { emit }) {
31
+ const props = __props;
32
+ const state = vue.ref("");
33
+ const localValue = vue.ref(props.modelValue);
34
+ vue.watch(vue.toRef(props, "modelValue"), () => {
35
+ localValue.value = props.modelValue;
36
+ });
37
+ const isChanged = vue.computed(() => localValue.value !== props.modelValue);
38
+ const submit = (value) => {
39
+ emit("update:modelValue", value);
40
+ };
41
+ const cancel = () => {
42
+ emit("cancel");
43
+ localValue.value = props.modelValue;
44
+ };
45
+ return (_ctx, _cache) => {
46
+ return vue.openBlock(), vue.createElementBlock("div", {
47
+ class: vue.normalizeClass({
48
+ "top-editArea": true,
49
+ "top-editArea-attachedToKeyboard": _ctx.attachToKeyboard
50
+ })
51
+ }, [
52
+ _ctx.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, vue.toDisplayString(_ctx.title), 1)) : vue.createCommentVNode("", true),
53
+ vue.createElementVNode("div", {
54
+ class: vue.normalizeClass({
55
+ "top-editArea_form": true,
56
+ "top-error": _ctx.isError,
57
+ "top-focus": state.value == "focus"
58
+ })
59
+ }, [
60
+ vue.createVNode(forms.Textarea, {
61
+ modelValue: localValue.value,
62
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => localValue.value = $event),
63
+ name: _ctx.name,
64
+ placeholder: _ctx.placeholder,
65
+ rows: _ctx.rows,
66
+ minHeight: _ctx.minHeight,
67
+ expandable: _ctx.expandable,
68
+ disabled: _ctx.disabled,
69
+ readonly: _ctx.readonly,
70
+ isError: _ctx.isError,
71
+ hint: _ctx.hint,
72
+ class: "top-editArea_element",
73
+ onFocus: _cache[1] || (_cache[1] = ($event) => state.value = "focus"),
74
+ onBlur: _cache[2] || (_cache[2] = ($event) => state.value = ""),
75
+ onKeyup: [
76
+ vue.withKeys(cancel, ["esc"]),
77
+ _cache[3] || (_cache[3] = vue.withKeys(vue.withModifiers(($event) => submit(localValue.value), ["ctrl"]), ["enter"]))
78
+ ]
79
+ }, null, 8, ["modelValue", "name", "placeholder", "rows", "minHeight", "expandable", "disabled", "readonly", "isError", "hint", "onKeyup"]),
80
+ vue.createElementVNode("div", _hoisted_2, [
81
+ isChanged.value && (!_ctx.attachToKeyboard || _ctx.modelValue) ? (vue.openBlock(), vue.createBlock(forms.Button, {
82
+ key: 0,
83
+ class: "top-editArea_button",
84
+ color: vue.unref(forms.COLOR).Theme,
85
+ icon: _ctx.attachToKeyboard ? "" : "",
86
+ onClick: cancel
87
+ }, {
88
+ default: vue.withCtx(() => [
89
+ vue.createTextVNode(vue.toDisplayString(_ctx.attachToKeyboard ? "" : _ctx.cancelText), 1)
90
+ ]),
91
+ _: 1
92
+ }, 8, ["color", "icon"])) : vue.createCommentVNode("", true),
93
+ vue.createVNode(forms.Button, {
94
+ class: "top-editArea_button",
95
+ icon: _ctx.attachToKeyboard ? "" : "",
96
+ onClick: _cache[4] || (_cache[4] = ($event) => submit(localValue.value))
97
+ }, {
98
+ default: vue.withCtx(() => [
99
+ vue.createTextVNode(vue.toDisplayString(_ctx.attachToKeyboard ? "" : _ctx.submitText), 1)
100
+ ]),
101
+ _: 1
102
+ }, 8, ["icon"])
103
+ ])
104
+ ], 2)
105
+ ], 2);
106
+ };
107
+ }
108
+ });
109
+ const style0 = {
110
+ "top-editArea": "top-editArea",
111
+ "top-editArea_title": "top-editArea_title",
112
+ "top-editArea_form": "top-editArea_form",
113
+ "top-editArea_element": "top-editArea_element",
114
+ "top-textarea": "top-textarea",
115
+ "top-textarea_textarea": "top-textarea_textarea",
116
+ "top-editArea_footer": "top-editArea_footer",
117
+ "top-editArea-attachedToKeyboard": "top-editArea-attachedToKeyboard"
118
+ };
119
+ const cssModules = {
120
+ "$style": style0
121
+ };
122
+ const editArea = /* @__PURE__ */ forms._export_sfc(_sfc_main, [["__cssModules", cssModules]]);
123
+ exports.EditArea = editArea;
124
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
125
+ });
3
126
  //# sourceMappingURL=editArea.amd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editArea.amd.js","sources":["../../src/components/editArea/editArea/editArea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, toRef, watch, computed } from 'vue';\nimport { COLOR as BUTTON_COLOR } from '@/components/forms/button/button';\nimport Button from '@/components/forms/button/button.vue';\nimport type { Props, Emits } from './editArea';\nimport Textarea from '@/components/forms/textarea/textarea.vue';\n\n// TODO: добавить переменную top-forms-fixed-height и использовать ее при добавлении отступов у страницы\n\nconst props = withDefaults(defineProps<Props>(), {\n\tcancelText: 'Отмена',\n\tsubmitText: 'Отправить',\n\texpandable: true,\n});\n\nconst emit = defineEmits<Emits>();\n\nconst state = ref('');\n\n/**\n * Локальное значение modelValue, будет проброшено вверх только в случае отправки формы\n */\nconst localValue = ref(props.modelValue);\n\nwatch(toRef(props, 'modelValue'), () => {\n\tlocalValue.value = props.modelValue;\n});\n\nconst isChanged = computed(() => localValue.value !== props.modelValue);\n\nconst submit = (value: string) => {\n\temit('update:modelValue', value);\n};\n\nconst cancel = () => {\n\temit('cancel');\n\n\t// сброс введенного значения\n\tlocalValue.value = props.modelValue;\n};\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t'top-editArea': true,\n\t\t\t'top-editArea-attachedToKeyboard': attachToKeyboard,\n\t\t}\"\n\t>\n\t\t<div\n\t\t\tv-if=\"title\"\n\t\t\tclass=\"top-editArea_title\"\n\t\t>\n\t\t\t{{ title }}\n\t\t</div>\n\n\t\t<div\n\t\t\t:class=\"{\n\t\t\t\t'top-editArea_form': true,\n\t\t\t\t'top-error': isError,\n\t\t\t\t'top-focus': state == 'focus',\n\t\t\t}\"\n\t\t>\n\t\t\t<Textarea\n\t\t\t\tv-model=\"localValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:rows=\"rows\"\n\t\t\t\t:minHeight=\"minHeight\"\n\t\t\t\t:expandable=\"expandable\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:isError=\"isError\"\n\t\t\t\t:hint=\"hint\"\n\t\t\t\tclass=\"top-editArea_element\"\n\t\t\t\t@focus=\"state = 'focus'\"\n\t\t\t\t@blur=\"state = ''\"\n\t\t\t\t@keyup.esc=\"cancel\"\n\t\t\t\t@keyup.ctrl.enter=\"submit(localValue)\"\n\t\t\t/>\n\n\t\t\t<div class=\"top-editArea_footer\">\n\t\t\t\t<Button\n\t\t\t\t\tv-if=\"isChanged && (!attachToKeyboard || modelValue)\"\n\t\t\t\t\tclass=\"top-editArea_button\"\n\t\t\t\t\t:color=\"BUTTON_COLOR.Theme\"\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\n\t\t\t\t\t@click=\"cancel\"\n\t\t\t\t>\n\t\t\t\t\t{{ attachToKeyboard ? '' : cancelText }}\n\t\t\t\t</Button>\n\n\t\t\t\t<Button\n\t\t\t\t\tclass=\"top-editArea_button\"\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\n\t\t\t\t\t@click=\"submit(localValue)\"\n\t\t\t\t>\n\t\t\t\t\t{{ attachToKeyboard ? '' : submitText }}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<style module>\n.top-editArea {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.top-editArea_title {\n\tfont-size: 12px;\n}\n\n.top-editArea_form {\n\tbackground: var(--top-forms-background-color);\n\toutline-color: var(--color-theme-75);\n\toutline-offset: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.top-editArea_form:hover {\n\tbackground: var(--top-forms-background-color-hover);\n}\n\n/* textarea в EditArea */\n.top-editArea_element.top-textarea {\n\twidth: 100%;\n}\n\n.top-editArea_element.top-textarea_textarea {\n\tborder: none;\n\toutline: none;\n\tanimation: none;\n}\n\n/* footer */\n.top-editArea_footer {\n\tpadding: var(--top-forms-padding);\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: var(--top-forms-padding);\n}\n\n/* attachedToKeyboard */\n.top-editArea-attachedToKeyboard {\n\tbackground: var(--top-forms-background-color);\n\tmargin-bottom: env(keyboard-inset-height, 0);\n\tposition: fixed;\n\tbottom: 0;\n\tright: 0;\n\tleft: 0;\n\tz-index: 2;\n\tgap: 0;\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_form {\n\tborder-radius: 0;\n\tborder: none;\n\tborder-top: 1px solid var(--top-forms-border-color);\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_title {\n\tborder-top: 1px solid var(--color-line-2-opacity);\n\tpadding: var(--top-forms-padding);\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_footer > [data-top-icon] {\n\tborder-radius: 100%;\n}\n</style>"],"names":["state","ref","localValue","props","watch","toRef","isChanged","computed","submit","value","emit","cancel"],"mappings":";gfAiBMA,EAAQC,MAAI,EAAE,EAKdC,EAAaD,EAAAA,IAAIE,EAAM,UAAU,EAEvCC,EAAAA,MAAMC,EAAM,MAAAF,EAAO,YAAY,EAAG,IAAM,CACvCD,EAAW,MAAQC,EAAM,UAAA,CACzB,EAED,MAAMG,EAAYC,EAAAA,SAAS,IAAML,EAAW,QAAUC,EAAM,UAAU,EAEhEK,EAAUC,GAAkB,CACjCC,EAAK,oBAAqBD,CAAK,CAAA,EAG1BE,EAAS,IAAM,CACpBD,EAAK,QAAQ,EAGbR,EAAW,MAAQC,EAAM,UAAA"}
1
+ {"version":3,"file":"editArea.amd.js","sources":["../../src/components/editArea/editArea/editArea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, toRef, watch, computed } from 'vue';\nimport { COLOR as BUTTON_COLOR } from '@/components/forms/button/button';\nimport Button from '@/components/forms/button/button.vue';\nimport type { Props, Emits } from './editArea';\nimport Textarea from '@/components/forms/textarea/textarea.vue';\n\n// TODO: добавить переменную top-forms-fixed-height и использовать ее при добавлении отступов у страницы\n\nconst props = withDefaults(defineProps<Props>(), {\n\tcancelText: 'Отмена',\n\tsubmitText: 'Отправить',\n\texpandable: true,\n});\n\nconst emit = defineEmits<Emits>();\n\nconst state = ref('');\n\n/**\n * Локальное значение modelValue, будет проброшено вверх только в случае отправки формы\n */\nconst localValue = ref(props.modelValue);\n\nwatch(toRef(props, 'modelValue'), () => {\n\tlocalValue.value = props.modelValue;\n});\n\nconst isChanged = computed(() => localValue.value !== props.modelValue);\n\nconst submit = (value: string) => {\n\temit('update:modelValue', value);\n};\n\nconst cancel = () => {\n\temit('cancel');\n\n\t// сброс введенного значения\n\tlocalValue.value = props.modelValue;\n};\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t'top-editArea': true,\n\t\t\t'top-editArea-attachedToKeyboard': attachToKeyboard,\n\t\t}\"\n\t>\n\t\t<div\n\t\t\tv-if=\"title\"\n\t\t\tclass=\"top-editArea_title\"\n\t\t>\n\t\t\t{{ title }}\n\t\t</div>\n\n\t\t<div\n\t\t\t:class=\"{\n\t\t\t\t'top-editArea_form': true,\n\t\t\t\t'top-error': isError,\n\t\t\t\t'top-focus': state == 'focus',\n\t\t\t}\"\n\t\t>\n\t\t\t<Textarea\n\t\t\t\tv-model=\"localValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:rows=\"rows\"\n\t\t\t\t:minHeight=\"minHeight\"\n\t\t\t\t:expandable=\"expandable\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:isError=\"isError\"\n\t\t\t\t:hint=\"hint\"\n\t\t\t\tclass=\"top-editArea_element\"\n\t\t\t\t@focus=\"state = 'focus'\"\n\t\t\t\t@blur=\"state = ''\"\n\t\t\t\t@keyup.esc=\"cancel\"\n\t\t\t\t@keyup.ctrl.enter=\"submit(localValue)\"\n\t\t\t/>\n\n\t\t\t<div class=\"top-editArea_footer\">\n\t\t\t\t<Button\n\t\t\t\t\tv-if=\"isChanged && (!attachToKeyboard || modelValue)\"\n\t\t\t\t\tclass=\"top-editArea_button\"\n\t\t\t\t\t:color=\"BUTTON_COLOR.Theme\"\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\n\t\t\t\t\t@click=\"cancel\"\n\t\t\t\t>\n\t\t\t\t\t{{ attachToKeyboard ? '' : cancelText }}\n\t\t\t\t</Button>\n\n\t\t\t\t<Button\n\t\t\t\t\tclass=\"top-editArea_button\"\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\n\t\t\t\t\t@click=\"submit(localValue)\"\n\t\t\t\t>\n\t\t\t\t\t{{ attachToKeyboard ? '' : submitText }}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<style module>\n.top-editArea {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.top-editArea_title {\n\tfont-size: 12px;\n}\n\n.top-editArea_form {\n\tbackground: var(--top-forms-background-color);\n\toutline-color: var(--color-theme-75);\n\toutline-offset: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.top-editArea_form:hover {\n\tbackground: var(--top-forms-background-color-hover);\n}\n\n/* textarea в EditArea */\n.top-editArea_element.top-textarea {\n\twidth: 100%;\n}\n\n.top-editArea_element.top-textarea_textarea {\n\tborder: none;\n\toutline: none;\n\tanimation: none;\n}\n\n/* footer */\n.top-editArea_footer {\n\tpadding: var(--top-forms-padding);\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: var(--top-forms-padding);\n}\n\n/* attachedToKeyboard */\n.top-editArea-attachedToKeyboard {\n\tbackground: var(--top-forms-background-color);\n\tmargin-bottom: env(keyboard-inset-height, 0);\n\tposition: fixed;\n\tbottom: 0;\n\tright: 0;\n\tleft: 0;\n\tz-index: 2;\n\tgap: 0;\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_form {\n\tborder-radius: 0;\n\tborder: none;\n\tborder-top: 1px solid var(--top-forms-border-color);\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_title {\n\tborder-top: 1px solid var(--color-line-2-opacity);\n\tpadding: var(--top-forms-padding);\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_footer > [data-top-icon] {\n\tborder-radius: 100%;\n}\n</style>"],"names":["ref","watch","toRef","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBM,YAAA,QAAQA,QAAI,EAAE;AAKd,YAAA,aAAaA,IAAAA,IAAI,MAAM,UAAU;AAEvCC,UAAAA,MAAMC,IAAM,MAAA,OAAO,YAAY,GAAG,MAAM;AACvC,mBAAW,QAAQ,MAAM;AAAA,MAAA,CACzB;AAED,YAAM,YAAYC,IAAAA,SAAS,MAAM,WAAW,UAAU,MAAM,UAAU;AAEhE,YAAA,SAAS,CAAC,UAAkB;AACjC,aAAK,qBAAqB,KAAK;AAAA,MAAA;AAGhC,YAAM,SAAS,MAAM;AACpB,aAAK,QAAQ;AAGb,mBAAW,QAAQ,MAAM;AAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,9 +1,11 @@
1
- import { defineComponent as B, ref as u, watch as C, toRef as w, computed as E, openBlock as d, createElementBlock as m, normalizeClass as c, toDisplayString as n, createCommentVNode as y, createElementVNode as b, createVNode as f, withKeys as A, withModifiers as k, createBlock as g, unref as $, withCtx as h, createTextVNode as v } from "vue";
2
- import { T as H, B as T, C as N, _ as M } from "../.chunks/forms-6a6b0b80.es.js";
3
- const O = {
1
+ import { defineComponent, ref, watch, toRef, computed, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createElementVNode, createVNode, withKeys, withModifiers, createBlock, unref, withCtx, createTextVNode } from "vue";
2
+ import { T as Textarea, B as Button, C as COLOR, _ as _export_sfc } from "../.chunks/forms-245e3bc0.es.js";
3
+ const _hoisted_1 = {
4
4
  key: 0,
5
5
  class: "top-editArea_title"
6
- }, R = { class: "top-editArea_footer" }, _ = /* @__PURE__ */ B({
6
+ };
7
+ const _hoisted_2 = { class: "top-editArea_footer" };
8
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
9
  __name: "editArea",
8
10
  props: {
9
11
  modelValue: {},
@@ -15,85 +17,93 @@ const O = {
15
17
  placeholder: {},
16
18
  rows: {},
17
19
  minHeight: {},
18
- expandable: { type: Boolean, default: !0 },
20
+ expandable: { type: Boolean, default: true },
19
21
  disabled: { type: Boolean },
20
22
  readonly: { type: Boolean },
21
23
  isError: { type: Boolean },
22
24
  hint: {}
23
25
  },
24
26
  emits: ["update:modelValue", "cancel"],
25
- setup(V, { emit: i }) {
26
- const a = V, r = u(""), o = u(a.modelValue);
27
- C(w(a, "modelValue"), () => {
28
- o.value = a.modelValue;
27
+ setup(__props, { emit }) {
28
+ const props = __props;
29
+ const state = ref("");
30
+ const localValue = ref(props.modelValue);
31
+ watch(toRef(props, "modelValue"), () => {
32
+ localValue.value = props.modelValue;
29
33
  });
30
- const K = E(() => o.value !== a.modelValue), s = (e) => {
31
- i("update:modelValue", e);
32
- }, p = () => {
33
- i("cancel"), o.value = a.modelValue;
34
+ const isChanged = computed(() => localValue.value !== props.modelValue);
35
+ const submit = (value) => {
36
+ emit("update:modelValue", value);
37
+ };
38
+ const cancel = () => {
39
+ emit("cancel");
40
+ localValue.value = props.modelValue;
34
41
  };
35
- return (e, t) => (d(), m("div", {
36
- class: c({
37
- "top-editArea": !0,
38
- "top-editArea-attachedToKeyboard": e.attachToKeyboard
39
- })
40
- }, [
41
- e.title ? (d(), m("div", O, n(e.title), 1)) : y("", !0),
42
- b("div", {
43
- class: c({
44
- "top-editArea_form": !0,
45
- "top-error": e.isError,
46
- "top-focus": r.value == "focus"
42
+ return (_ctx, _cache) => {
43
+ return openBlock(), createElementBlock("div", {
44
+ class: normalizeClass({
45
+ "top-editArea": true,
46
+ "top-editArea-attachedToKeyboard": _ctx.attachToKeyboard
47
47
  })
48
48
  }, [
49
- f(H, {
50
- modelValue: o.value,
51
- "onUpdate:modelValue": t[0] || (t[0] = (l) => o.value = l),
52
- name: e.name,
53
- placeholder: e.placeholder,
54
- rows: e.rows,
55
- minHeight: e.minHeight,
56
- expandable: e.expandable,
57
- disabled: e.disabled,
58
- readonly: e.readonly,
59
- isError: e.isError,
60
- hint: e.hint,
61
- class: "top-editArea_element",
62
- onFocus: t[1] || (t[1] = (l) => r.value = "focus"),
63
- onBlur: t[2] || (t[2] = (l) => r.value = ""),
64
- onKeyup: [
65
- A(p, ["esc"]),
66
- t[3] || (t[3] = A(k((l) => s(o.value), ["ctrl"]), ["enter"]))
67
- ]
68
- }, null, 8, ["modelValue", "name", "placeholder", "rows", "minHeight", "expandable", "disabled", "readonly", "isError", "hint", "onKeyup"]),
69
- b("div", R, [
70
- K.value && (!e.attachToKeyboard || e.modelValue) ? (d(), g(T, {
71
- key: 0,
72
- class: "top-editArea_button",
73
- color: $(N).Theme,
74
- icon: e.attachToKeyboard ? "" : "",
75
- onClick: p
76
- }, {
77
- default: h(() => [
78
- v(n(e.attachToKeyboard ? "" : e.cancelText), 1)
79
- ]),
80
- _: 1
81
- }, 8, ["color", "icon"])) : y("", !0),
82
- f(T, {
83
- class: "top-editArea_button",
84
- icon: e.attachToKeyboard ? "" : "",
85
- onClick: t[4] || (t[4] = (l) => s(o.value))
86
- }, {
87
- default: h(() => [
88
- v(n(e.attachToKeyboard ? "" : e.submitText), 1)
89
- ]),
90
- _: 1
91
- }, 8, ["icon"])
92
- ])
93
- ], 2)
94
- ], 2));
49
+ _ctx.title ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
50
+ createElementVNode("div", {
51
+ class: normalizeClass({
52
+ "top-editArea_form": true,
53
+ "top-error": _ctx.isError,
54
+ "top-focus": state.value == "focus"
55
+ })
56
+ }, [
57
+ createVNode(Textarea, {
58
+ modelValue: localValue.value,
59
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => localValue.value = $event),
60
+ name: _ctx.name,
61
+ placeholder: _ctx.placeholder,
62
+ rows: _ctx.rows,
63
+ minHeight: _ctx.minHeight,
64
+ expandable: _ctx.expandable,
65
+ disabled: _ctx.disabled,
66
+ readonly: _ctx.readonly,
67
+ isError: _ctx.isError,
68
+ hint: _ctx.hint,
69
+ class: "top-editArea_element",
70
+ onFocus: _cache[1] || (_cache[1] = ($event) => state.value = "focus"),
71
+ onBlur: _cache[2] || (_cache[2] = ($event) => state.value = ""),
72
+ onKeyup: [
73
+ withKeys(cancel, ["esc"]),
74
+ _cache[3] || (_cache[3] = withKeys(withModifiers(($event) => submit(localValue.value), ["ctrl"]), ["enter"]))
75
+ ]
76
+ }, null, 8, ["modelValue", "name", "placeholder", "rows", "minHeight", "expandable", "disabled", "readonly", "isError", "hint", "onKeyup"]),
77
+ createElementVNode("div", _hoisted_2, [
78
+ isChanged.value && (!_ctx.attachToKeyboard || _ctx.modelValue) ? (openBlock(), createBlock(Button, {
79
+ key: 0,
80
+ class: "top-editArea_button",
81
+ color: unref(COLOR).Theme,
82
+ icon: _ctx.attachToKeyboard ? "" : "",
83
+ onClick: cancel
84
+ }, {
85
+ default: withCtx(() => [
86
+ createTextVNode(toDisplayString(_ctx.attachToKeyboard ? "" : _ctx.cancelText), 1)
87
+ ]),
88
+ _: 1
89
+ }, 8, ["color", "icon"])) : createCommentVNode("", true),
90
+ createVNode(Button, {
91
+ class: "top-editArea_button",
92
+ icon: _ctx.attachToKeyboard ? "" : "",
93
+ onClick: _cache[4] || (_cache[4] = ($event) => submit(localValue.value))
94
+ }, {
95
+ default: withCtx(() => [
96
+ createTextVNode(toDisplayString(_ctx.attachToKeyboard ? "" : _ctx.submitText), 1)
97
+ ]),
98
+ _: 1
99
+ }, 8, ["icon"])
100
+ ])
101
+ ], 2)
102
+ ], 2);
103
+ };
95
104
  }
96
- }), z = {
105
+ });
106
+ const style0 = {
97
107
  "top-editArea": "top-editArea",
98
108
  "top-editArea_title": "top-editArea_title",
99
109
  "top-editArea_form": "top-editArea_form",
@@ -102,10 +112,12 @@ const O = {
102
112
  "top-textarea_textarea": "top-textarea_textarea",
103
113
  "top-editArea_footer": "top-editArea_footer",
104
114
  "top-editArea-attachedToKeyboard": "top-editArea-attachedToKeyboard"
105
- }, D = {
106
- $style: z
107
- }, S = /* @__PURE__ */ M(_, [["__cssModules", D]]);
115
+ };
116
+ const cssModules = {
117
+ "$style": style0
118
+ };
119
+ const editArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
108
120
  export {
109
- S as EditArea
121
+ editArea as EditArea
110
122
  };
111
123
  //# sourceMappingURL=editArea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editArea.js","sources":["../../src/components/editArea/editArea/editArea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, toRef, watch, computed } from 'vue';\nimport { COLOR as BUTTON_COLOR } from '@/components/forms/button/button';\nimport Button from '@/components/forms/button/button.vue';\nimport type { Props, Emits } from './editArea';\nimport Textarea from '@/components/forms/textarea/textarea.vue';\n\n// TODO: добавить переменную top-forms-fixed-height и использовать ее при добавлении отступов у страницы\n\nconst props = withDefaults(defineProps<Props>(), {\n\tcancelText: 'Отмена',\n\tsubmitText: 'Отправить',\n\texpandable: true,\n});\n\nconst emit = defineEmits<Emits>();\n\nconst state = ref('');\n\n/**\n * Локальное значение modelValue, будет проброшено вверх только в случае отправки формы\n */\nconst localValue = ref(props.modelValue);\n\nwatch(toRef(props, 'modelValue'), () => {\n\tlocalValue.value = props.modelValue;\n});\n\nconst isChanged = computed(() => localValue.value !== props.modelValue);\n\nconst submit = (value: string) => {\n\temit('update:modelValue', value);\n};\n\nconst cancel = () => {\n\temit('cancel');\n\n\t// сброс введенного значения\n\tlocalValue.value = props.modelValue;\n};\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t'top-editArea': true,\n\t\t\t'top-editArea-attachedToKeyboard': attachToKeyboard,\n\t\t}\"\n\t>\n\t\t<div\n\t\t\tv-if=\"title\"\n\t\t\tclass=\"top-editArea_title\"\n\t\t>\n\t\t\t{{ title }}\n\t\t</div>\n\n\t\t<div\n\t\t\t:class=\"{\n\t\t\t\t'top-editArea_form': true,\n\t\t\t\t'top-error': isError,\n\t\t\t\t'top-focus': state == 'focus',\n\t\t\t}\"\n\t\t>\n\t\t\t<Textarea\n\t\t\t\tv-model=\"localValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:rows=\"rows\"\n\t\t\t\t:minHeight=\"minHeight\"\n\t\t\t\t:expandable=\"expandable\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:isError=\"isError\"\n\t\t\t\t:hint=\"hint\"\n\t\t\t\tclass=\"top-editArea_element\"\n\t\t\t\t@focus=\"state = 'focus'\"\n\t\t\t\t@blur=\"state = ''\"\n\t\t\t\t@keyup.esc=\"cancel\"\n\t\t\t\t@keyup.ctrl.enter=\"submit(localValue)\"\n\t\t\t/>\n\n\t\t\t<div class=\"top-editArea_footer\">\n\t\t\t\t<Button\n\t\t\t\t\tv-if=\"isChanged && (!attachToKeyboard || modelValue)\"\n\t\t\t\t\tclass=\"top-editArea_button\"\n\t\t\t\t\t:color=\"BUTTON_COLOR.Theme\"\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\n\t\t\t\t\t@click=\"cancel\"\n\t\t\t\t>\n\t\t\t\t\t{{ attachToKeyboard ? '' : cancelText }}\n\t\t\t\t</Button>\n\n\t\t\t\t<Button\n\t\t\t\t\tclass=\"top-editArea_button\"\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\n\t\t\t\t\t@click=\"submit(localValue)\"\n\t\t\t\t>\n\t\t\t\t\t{{ attachToKeyboard ? '' : submitText }}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<style module>\n.top-editArea {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.top-editArea_title {\n\tfont-size: 12px;\n}\n\n.top-editArea_form {\n\tbackground: var(--top-forms-background-color);\n\toutline-color: var(--color-theme-75);\n\toutline-offset: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.top-editArea_form:hover {\n\tbackground: var(--top-forms-background-color-hover);\n}\n\n/* textarea в EditArea */\n.top-editArea_element.top-textarea {\n\twidth: 100%;\n}\n\n.top-editArea_element.top-textarea_textarea {\n\tborder: none;\n\toutline: none;\n\tanimation: none;\n}\n\n/* footer */\n.top-editArea_footer {\n\tpadding: var(--top-forms-padding);\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: var(--top-forms-padding);\n}\n\n/* attachedToKeyboard */\n.top-editArea-attachedToKeyboard {\n\tbackground: var(--top-forms-background-color);\n\tmargin-bottom: env(keyboard-inset-height, 0);\n\tposition: fixed;\n\tbottom: 0;\n\tright: 0;\n\tleft: 0;\n\tz-index: 2;\n\tgap: 0;\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_form {\n\tborder-radius: 0;\n\tborder: none;\n\tborder-top: 1px solid var(--top-forms-border-color);\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_title {\n\tborder-top: 1px solid var(--color-line-2-opacity);\n\tpadding: var(--top-forms-padding);\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_footer > [data-top-icon] {\n\tborder-radius: 100%;\n}\n</style>"],"names":["state","ref","localValue","props","watch","toRef","isChanged","computed","submit","value","emit","cancel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;iBAiBMA,IAAQC,EAAI,EAAE,GAKdC,IAAaD,EAAIE,EAAM,UAAU;AAEvC,IAAAC,EAAMC,EAAMF,GAAO,YAAY,GAAG,MAAM;AACvC,MAAAD,EAAW,QAAQC,EAAM;AAAA,IAAA,CACzB;AAED,UAAMG,IAAYC,EAAS,MAAML,EAAW,UAAUC,EAAM,UAAU,GAEhEK,IAAS,CAACC,MAAkB;AACjC,MAAAC,EAAK,qBAAqBD,CAAK;AAAA,IAAA,GAG1BE,IAAS,MAAM;AACpB,MAAAD,EAAK,QAAQ,GAGbR,EAAW,QAAQC,EAAM;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"editArea.js","sources":["../../src/components/editArea/editArea/editArea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, toRef, watch, computed } from 'vue';\nimport { COLOR as BUTTON_COLOR } from '@/components/forms/button/button';\nimport Button from '@/components/forms/button/button.vue';\nimport type { Props, Emits } from './editArea';\nimport Textarea from '@/components/forms/textarea/textarea.vue';\n\n// TODO: добавить переменную top-forms-fixed-height и использовать ее при добавлении отступов у страницы\n\nconst props = withDefaults(defineProps<Props>(), {\n\tcancelText: 'Отмена',\n\tsubmitText: 'Отправить',\n\texpandable: true,\n});\n\nconst emit = defineEmits<Emits>();\n\nconst state = ref('');\n\n/**\n * Локальное значение modelValue, будет проброшено вверх только в случае отправки формы\n */\nconst localValue = ref(props.modelValue);\n\nwatch(toRef(props, 'modelValue'), () => {\n\tlocalValue.value = props.modelValue;\n});\n\nconst isChanged = computed(() => localValue.value !== props.modelValue);\n\nconst submit = (value: string) => {\n\temit('update:modelValue', value);\n};\n\nconst cancel = () => {\n\temit('cancel');\n\n\t// сброс введенного значения\n\tlocalValue.value = props.modelValue;\n};\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t'top-editArea': true,\n\t\t\t'top-editArea-attachedToKeyboard': attachToKeyboard,\n\t\t}\"\n\t>\n\t\t<div\n\t\t\tv-if=\"title\"\n\t\t\tclass=\"top-editArea_title\"\n\t\t>\n\t\t\t{{ title }}\n\t\t</div>\n\n\t\t<div\n\t\t\t:class=\"{\n\t\t\t\t'top-editArea_form': true,\n\t\t\t\t'top-error': isError,\n\t\t\t\t'top-focus': state == 'focus',\n\t\t\t}\"\n\t\t>\n\t\t\t<Textarea\n\t\t\t\tv-model=\"localValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:rows=\"rows\"\n\t\t\t\t:minHeight=\"minHeight\"\n\t\t\t\t:expandable=\"expandable\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:isError=\"isError\"\n\t\t\t\t:hint=\"hint\"\n\t\t\t\tclass=\"top-editArea_element\"\n\t\t\t\t@focus=\"state = 'focus'\"\n\t\t\t\t@blur=\"state = ''\"\n\t\t\t\t@keyup.esc=\"cancel\"\n\t\t\t\t@keyup.ctrl.enter=\"submit(localValue)\"\n\t\t\t/>\n\n\t\t\t<div class=\"top-editArea_footer\">\n\t\t\t\t<Button\n\t\t\t\t\tv-if=\"isChanged && (!attachToKeyboard || modelValue)\"\n\t\t\t\t\tclass=\"top-editArea_button\"\n\t\t\t\t\t:color=\"BUTTON_COLOR.Theme\"\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\n\t\t\t\t\t@click=\"cancel\"\n\t\t\t\t>\n\t\t\t\t\t{{ attachToKeyboard ? '' : cancelText }}\n\t\t\t\t</Button>\n\n\t\t\t\t<Button\n\t\t\t\t\tclass=\"top-editArea_button\"\n\t\t\t\t\t:icon=\"attachToKeyboard ? '': ''\"\n\t\t\t\t\t@click=\"submit(localValue)\"\n\t\t\t\t>\n\t\t\t\t\t{{ attachToKeyboard ? '' : submitText }}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<style module>\n.top-editArea {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.top-editArea_title {\n\tfont-size: 12px;\n}\n\n.top-editArea_form {\n\tbackground: var(--top-forms-background-color);\n\toutline-color: var(--color-theme-75);\n\toutline-offset: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.top-editArea_form:hover {\n\tbackground: var(--top-forms-background-color-hover);\n}\n\n/* textarea в EditArea */\n.top-editArea_element.top-textarea {\n\twidth: 100%;\n}\n\n.top-editArea_element.top-textarea_textarea {\n\tborder: none;\n\toutline: none;\n\tanimation: none;\n}\n\n/* footer */\n.top-editArea_footer {\n\tpadding: var(--top-forms-padding);\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: var(--top-forms-padding);\n}\n\n/* attachedToKeyboard */\n.top-editArea-attachedToKeyboard {\n\tbackground: var(--top-forms-background-color);\n\tmargin-bottom: env(keyboard-inset-height, 0);\n\tposition: fixed;\n\tbottom: 0;\n\tright: 0;\n\tleft: 0;\n\tz-index: 2;\n\tgap: 0;\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_form {\n\tborder-radius: 0;\n\tborder: none;\n\tborder-top: 1px solid var(--top-forms-border-color);\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_title {\n\tborder-top: 1px solid var(--color-line-2-opacity);\n\tpadding: var(--top-forms-padding);\n}\n\n.top-editArea-attachedToKeyboard .top-editArea_footer > [data-top-icon] {\n\tborder-radius: 100%;\n}\n</style>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBM,UAAA,QAAQ,IAAI,EAAE;AAKd,UAAA,aAAa,IAAI,MAAM,UAAU;AAEvC,UAAM,MAAM,OAAO,YAAY,GAAG,MAAM;AACvC,iBAAW,QAAQ,MAAM;AAAA,IAAA,CACzB;AAED,UAAM,YAAY,SAAS,MAAM,WAAW,UAAU,MAAM,UAAU;AAEhE,UAAA,SAAS,CAAC,UAAkB;AACjC,WAAK,qBAAqB,KAAK;AAAA,IAAA;AAGhC,UAAM,SAAS,MAAM;AACpB,WAAK,QAAQ;AAGb,iBAAW,QAAQ,MAAM;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/editArea.css CHANGED
@@ -1 +1,61 @@
1
- .top-editArea{display:flex;flex-direction:column;gap:6px}.top-editArea_title{font-size:12px}.top-editArea_form{background:var(--top-forms-background-color);outline-color:var(--color-theme-75);outline-offset:0;display:flex;flex-direction:column}.top-editArea_form:hover{background:var(--top-forms-background-color-hover)}.top-editArea_element.top-textarea{width:100%}.top-editArea_element.top-textarea_textarea{border:none;outline:none;animation:none}.top-editArea_footer{padding:var(--top-forms-padding);display:flex;justify-content:flex-end;gap:var(--top-forms-padding)}.top-editArea-attachedToKeyboard{background:var(--top-forms-background-color);margin-bottom:env(keyboard-inset-height,0);position:fixed;bottom:0;right:0;left:0;z-index:2;gap:0}.top-editArea-attachedToKeyboard .top-editArea_form{border-radius:0;border:none;border-top:1px solid var(--top-forms-border-color)}.top-editArea-attachedToKeyboard .top-editArea_title{border-top:1px solid var(--color-line-2-opacity);padding:var(--top-forms-padding)}.top-editArea-attachedToKeyboard .top-editArea_footer>[data-top-icon]{border-radius:100%}
1
+
2
+ .top-editArea {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: 6px;
6
+ }
7
+ .top-editArea_title {
8
+ font-size: 12px;
9
+ }
10
+ .top-editArea_form {
11
+ background: var(--top-forms-background-color);
12
+ outline-color: var(--color-theme-75);
13
+ outline-offset: 0;
14
+ display: flex;
15
+ flex-direction: column;
16
+ }
17
+ .top-editArea_form:hover {
18
+ background: var(--top-forms-background-color-hover);
19
+ }
20
+
21
+ /* textarea в EditArea */
22
+ .top-editArea_element.top-textarea {
23
+ width: 100%;
24
+ }
25
+ .top-editArea_element.top-textarea_textarea {
26
+ border: none;
27
+ outline: none;
28
+ animation: none;
29
+ }
30
+
31
+ /* footer */
32
+ .top-editArea_footer {
33
+ padding: var(--top-forms-padding);
34
+ display: flex;
35
+ justify-content: flex-end;
36
+ gap: var(--top-forms-padding);
37
+ }
38
+
39
+ /* attachedToKeyboard */
40
+ .top-editArea-attachedToKeyboard {
41
+ background: var(--top-forms-background-color);
42
+ margin-bottom: env(keyboard-inset-height, 0);
43
+ position: fixed;
44
+ bottom: 0;
45
+ right: 0;
46
+ left: 0;
47
+ z-index: 2;
48
+ gap: 0;
49
+ }
50
+ .top-editArea-attachedToKeyboard .top-editArea_form {
51
+ border-radius: 0;
52
+ border: none;
53
+ border-top: 1px solid var(--top-forms-border-color);
54
+ }
55
+ .top-editArea-attachedToKeyboard .top-editArea_title {
56
+ border-top: 1px solid var(--color-line-2-opacity);
57
+ padding: var(--top-forms-padding);
58
+ }
59
+ .top-editArea-attachedToKeyboard .top-editArea_footer > [data-top-icon] {
60
+ border-radius: 100%;
61
+ }
@@ -1,2 +1,13 @@
1
- define(["exports","../.chunks/forms-7119886a.amd","vue"],function(e,n,t){"use strict"; if(typeof vue === "undefined") var vue = window.Vue;e.Button=n.Button,e.Checkbox=n.checkbox,e.ControlLabel=n.ControlLabel,e.Hint=n.Hint,e.Input=n.input,e.Radio=n.radio,e.Switcher=n.switcher,e.Textarea=n.Textarea,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
1
+ define(["exports", "../.chunks/forms-f7b7b259.amd", "vue"], function(exports, forms, vue) {
2
+ "use strict"; if(typeof vue === "undefined") var vue = window.Vue;
3
+ exports.Button = forms.Button;
4
+ exports.Checkbox = forms.checkbox;
5
+ exports.ControlLabel = forms.ControlLabel;
6
+ exports.Hint = forms.Hint;
7
+ exports.Input = forms.input;
8
+ exports.Radio = forms.radio;
9
+ exports.Switcher = forms.switcher;
10
+ exports.Textarea = forms.Textarea;
11
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
12
+ });
2
13
  //# sourceMappingURL=forms.amd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"forms.amd.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"forms.amd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}