@topvisor/ui 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.chunks/core-97b070be.amd.js +2 -0
- package/.chunks/core-97b070be.amd.js.map +1 -0
- package/.chunks/core-c3afa109.es.js +121 -0
- package/.chunks/core-c3afa109.es.js.map +1 -0
- package/.chunks/forms-6a6b0b80.es.js +436 -0
- package/.chunks/forms-6a6b0b80.es.js.map +1 -0
- package/.chunks/forms-7119886a.amd.js +3 -0
- package/.chunks/forms-7119886a.amd.js.map +1 -0
- package/.chunks/popup-6d1d8097.amd.js +342 -0
- package/.chunks/popup-6d1d8097.amd.js.map +1 -0
- package/.chunks/popup-95d27020.es.js +720 -0
- package/.chunks/popup-95d27020.es.js.map +1 -0
- package/README.md +62 -62
- package/common/common.amd.js +1 -21
- package/common/common.amd.js.map +1 -1
- package/common/common.js +8 -11
- package/common/common.js.map +1 -1
- package/core/core.amd.js +2 -0
- package/core/core.amd.js.map +1 -0
- package/core/core.js +7 -0
- package/core/core.js.map +1 -0
- package/core.css +1 -645
- package/dark.css +1 -128
- package/editArea/editArea.amd.js +3 -0
- package/editArea/editArea.amd.js.map +1 -0
- package/editArea/editArea.js +111 -0
- package/editArea/editArea.js.map +1 -0
- package/editArea.css +1 -0
- package/forms/forms.amd.js +1 -10
- package/forms/forms.amd.js.map +1 -1
- package/forms/forms.js +9 -7
- package/forms/helpers.amd.js +2 -0
- package/{helpers → forms}/helpers.amd.js.map +1 -1
- package/forms/helpers.js +6 -0
- package/forms.css +1 -408
- package/icomoon/demo-files/Read Me.txt +7 -7
- package/icomoon/demo-files/demo.css +161 -161
- package/icomoon/demo-files/demo.js +30 -30
- package/icomoon/demo.html +2931 -2931
- package/icomoon/fonts/Topvisor-2.svg +231 -231
- package/icomoon/style.css +644 -644
- package/light.css +1 -128
- package/package.json +19 -19
- package/popup/popup.amd.js +3 -0
- package/popup/popup.amd.js.map +1 -0
- package/popup/popup.js +146 -0
- package/popup/popup.js.map +1 -0
- package/popup/worker.amd.js +2 -0
- package/popup/worker.amd.js.map +1 -0
- package/popup/worker.js +158 -0
- package/popup/worker.js.map +1 -0
- package/popup.css +1 -0
- package/utils/device.amd.js +2 -0
- package/utils/device.amd.js.map +1 -0
- package/utils/device.js +34 -0
- package/utils/device.js.map +1 -0
- package/utils/dom.amd.js +2 -0
- package/utils/dom.amd.js.map +1 -0
- package/utils/dom.js +64 -0
- package/utils/dom.js.map +1 -0
- package/.chunks/forms-1b3f76e9.es.js +0 -410
- package/.chunks/forms-1b3f76e9.es.js.map +0 -1
- package/.chunks/forms-512abfa7.amd.js +0 -413
- package/.chunks/forms-512abfa7.amd.js.map +0 -1
- package/helpers/helpers.amd.js +0 -6
- package/helpers/helpers.js +0 -6
- /package/{helpers → forms}/helpers.js.map +0 -0
package/utils/device.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
class a {
|
|
2
|
+
static isRetina() {
|
|
3
|
+
return "devicePixelRatio" in window && window.devicePixelRatio > 1;
|
|
4
|
+
}
|
|
5
|
+
// определить, является ли устройство мобильным
|
|
6
|
+
static isMobile() {
|
|
7
|
+
return !!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|IEMobile|Opera Mini/i);
|
|
8
|
+
}
|
|
9
|
+
// определить, открыт ли сайт в приложении
|
|
10
|
+
static isApp() {
|
|
11
|
+
return navigator.userAgent.indexOf("Topvisor_App") != -1;
|
|
12
|
+
}
|
|
13
|
+
// определить, является ли OS пользователя macOS
|
|
14
|
+
static isMacOS() {
|
|
15
|
+
return navigator.userAgent.indexOf("Mac OS X") !== -1;
|
|
16
|
+
}
|
|
17
|
+
// определить, является ли текущий браузер пользователя Safari
|
|
18
|
+
static isSafari() {
|
|
19
|
+
const e = /Chrome|Android/.test(navigator.userAgent);
|
|
20
|
+
let i = /Safari/.test(navigator.userAgent);
|
|
21
|
+
return e && i && (i = !1), i;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Вернуть текст для обозначения клавиши Ctrl / Command в зависимости от OS
|
|
25
|
+
* @returns {'Ctrl'|'⌘'}
|
|
26
|
+
*/
|
|
27
|
+
static getCommandKeyLabel() {
|
|
28
|
+
return this.isMacOS() ? "⌘" : "Ctrl";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
a as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device.js","sources":["../../src/core/utils/device.ts"],"sourcesContent":["class Device {\n\n\tstatic isRetina () {\n\t\treturn ('devicePixelRatio' in window && window.devicePixelRatio > 1);\n\t}\n\n\t// определить, является ли устройство мобильным\n\tstatic isMobile (): boolean {\n\t\treturn !!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|IEMobile|Opera Mini/i);\n\t}\n\n\t// определить, открыт ли сайт в приложении\n\tstatic isApp () {\n\t\treturn (navigator.userAgent.indexOf('Topvisor_App') != -1);\n\t}\n\n\t// определить, является ли OS пользователя macOS\n\tstatic isMacOS () {\n\t\treturn navigator.userAgent.indexOf('Mac OS X') !== -1;\n\t}\n\n\t// определить, является ли текущий браузер пользователя Safari\n\tstatic isSafari () {\n\t\tconst isChrome = /Chrome|Android/.test(navigator.userAgent);\n\n\t\tlet isSafari = /Safari/.test(navigator.userAgent);\n\t\tif (isChrome && isSafari) {\n\t\t\tisSafari = false;\n\t\t}\n\n\t\treturn isSafari;\n\t};\n\n\t/**\n\t * Вернуть текст для обозначения клавиши Ctrl / Command в зависимости от OS\n\t * @returns {'Ctrl'|'⌘'}\n\t */\n\tstatic getCommandKeyLabel (): 'Ctrl' | '⌘' {\n\t\tif (this.isMacOS()) {\n\t\t\treturn '⌘';\n\t\t} else {\n\t\t\treturn 'Ctrl';\n\t\t}\n\t}\n\n}\n\nexport default Device;\n"],"names":["Device","isChrome","isSafari"],"mappings":"AAAA,MAAMA,EAAO;AAAA,EAEZ,OAAO,WAAY;AACV,WAAA,sBAAsB,UAAU,OAAO,mBAAmB;AAAA,EACnE;AAAA;AAAA,EAGA,OAAO,WAAqB;AAC3B,WAAO,CAAC,CAAC,UAAU,UAAU,MAAM,0DAA0D;AAAA,EAC9F;AAAA;AAAA,EAGA,OAAO,QAAS;AACf,WAAQ,UAAU,UAAU,QAAQ,cAAc,KAAK;AAAA,EACxD;AAAA;AAAA,EAGA,OAAO,UAAW;AACjB,WAAO,UAAU,UAAU,QAAQ,UAAU,MAAM;AAAA,EACpD;AAAA;AAAA,EAGA,OAAO,WAAY;AAClB,UAAMC,IAAW,iBAAiB,KAAK,UAAU,SAAS;AAE1D,QAAIC,IAAW,SAAS,KAAK,UAAU,SAAS;AAChD,WAAID,KAAYC,MACJA,IAAA,KAGLA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,qBAAoC;AACtC,WAAA,KAAK,YACD,MAEA;AAAA,EAET;AAED;"}
|
package/utils/dom.amd.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(function(){"use strict"; if(typeof vue === "undefined") var vue = window.Vue;function f(t,e,...n){const i=document.createElement(t);for(const r in e)r.indexOf("on")===0?i[r]=e[r]:i.setAttribute(r,e[r]);return n.forEach(r=>{typeof r=="string"?i.insertAdjacentHTML("beforeend",r):i.append(r)}),i}function o(t){if(!t)return!1;const e=t.getBoundingClientRect();return!!(e.width||e.height)}function c(t){const e=t.getBoundingClientRect();return{top:e.top+window.scrollY,left:e.left+window.scrollX}}function l(t,e){return window.getComputedStyle(t).getPropertyValue(e)}function s(t,e){const n=document.createElement(e);return t.after(n),n.append(t),n}function a(t,e){return u(t,e).find(o)||null}function d(t,e){return u(t,e).findLast(o)||null}function p(t,e){return u(t,e).filter(o)}function u(t,e){return t?[...t.querySelectorAll(e)]:[]}function g(t,e="common",n=void 0){if(t)return t.topData||(t.topData={}),n&&(t.topData[e]=n),n===null&&delete t.topData[e],t.topData[e]}function y(t){t&&delete t.topData}return{genEl:f,isVisible:o,offset:c,css:l,wrap:s,querySelectorVisible:a,querySelectorVisibleLast:d,querySelectorAllVisible:p,querySelectorAllArray:u,storage:g,storageClear:y}});
|
|
2
|
+
//# sourceMappingURL=dom.amd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.amd.js","sources":["../../src/core/utils/dom.ts"],"sourcesContent":["/**\n * Функции для работы с работы с Document Object Model (DOM)\n */\n\n/**\n * Создать элемент\n * @param {string} tagName\n * @param {any} attrs - атрибуты\n * @param {Element[]} elsChildrens\n * @returns {Element} - созданный элемент\n */\nfunction genEl (tagName: string, attrs: any, ...elsChildrens: Element[]): Element {\n\tconst el: any = document.createElement(tagName);\n\n\tfor (const name in attrs) {\n\t\tif (name.indexOf('on') === 0) {\n\t\t\t// events\n\t\t\tel[name] = attrs[name];\n\t\t} else {\n\t\t\tel.setAttribute(name, attrs[name]);\n\t\t}\n\t}\n\n\telsChildrens.forEach((elChildren) => {\n\t\tif (typeof (elChildren) === 'string') {\n\t\t\tel.insertAdjacentHTML('beforeend', elChildren);\n\t\t} else {\n\t\t\tel.append(elChildren);\n\t\t}\n\t});\n\n\treturn el;\n}\n\n/**\n * Проверить видимость элемента\n * @param {?Element} el\n * @returns boolean - вернет true, если элемент считается видимым\n */\nfunction isVisible (el?: Element) {\n\tif (!el) {\n\t\treturn false;\n\t}\n\n\tconst boundingClientRect = el.getBoundingClientRect();\n\treturn !!(boundingClientRect.width || boundingClientRect.height);\n}\n\n/**\n * Получить координаты элемента относительно документа\n * @param {Element} el\n * @returns {{top: number, left: number}} - координаты элемента относительно документа\n */\nfunction offset (el: Element): { top: number, left: number } {\n\tconst boundingClientRect = el.getBoundingClientRect();\n\n\treturn {\n\t\ttop: boundingClientRect.top + window.scrollY,\n\t\tleft: boundingClientRect.left + window.scrollX,\n\t};\n}\n\n/**\n * Получить значение css свойства элемента\n * @param {Element} el\n * @param {string} property - имя свойства\n * @return {string} - значение css стиля\n */\nfunction css (el: Element, property: string): string {\n\treturn window.getComputedStyle(el).getPropertyValue(property);\n}\n\n/**\n * Обернуть элемент и вернуть только что созданный элемент\n * @param {Element} el - элемент, который требуется обернуть\n * @param {string} tagName - имя тега элемента, в который треубется обернуть элемент\n * @returns {Element}\n */\nfunction wrap (el: Element, tagName: string): Element {\n\tconst elWrapper = document.createElement(tagName);\n\tel.after(elWrapper);\n\n\telWrapper.append(el);\n\n\treturn elWrapper;\n}\n\n/**\n * Найти и вернуть первый видимый элемент\n * @param {?Document|Element} el - корневой элемент поиска\n * @param selectors - см. параметр selectors в Document.querySelectorAll()\n * @returns {Element|null}\n */\nfunction querySelectorVisible (el: Element, selectors: string): Element | null {\n\treturn querySelectorAllArray(el, selectors).find(isVisible) || null;\n}\n\n/**\n * Найти и вернуть последний видимый элемент\n * @param {?Document|Element} el - корневой элемент поиска\n * @param selectors - см. параметр selectors в Document.querySelectorAll()\n * @returns {Element|null}\n */\nfunction querySelectorVisibleLast (el: Element, selectors: string): Element | null {\n\treturn querySelectorAllArray(el, selectors).findLast(isVisible) || null;\n}\n\n/**\n * Найти видимые элементы\n * @param {?Document|Element} el - корневой элемент поиска\n * @param selectors - см. параметр selectors в Document.querySelectorAll()\n * @returns {Element[]} - обратите внимание, возвращается не NodeList[], а Element[]\n */\nfunction querySelectorAllVisible (el: Element, selectors: string): Element[] {\n\treturn querySelectorAllArray(el, selectors).filter(isVisible);\n}\n\n/**\n * Найти элементы и вернуть в виде массива\n * @param {?Document|Element} el - корневой элемент поиска\n * @param selectors - см. параметр selectors в Document.querySelectorAll()\n * @returns {Element[]}\n */\nfunction querySelectorAllArray (el: Element, selectors: string): Element[] {\n\tif (!el) {\n\t\treturn [];\n\t}\n\n\treturn [...el.querySelectorAll(selectors)];\n}\n\n/**\n * Хранилище данных элемента\n * @param {Element} el\n * @param {string} contextName - контекст, обычно используется имя компонента\n * @param {?object | null} contextData - установить объект с данными, предыдущие данные будут заменены, установите null для удаления данных\n * @returns {?object} - вернет объект контекста или undefined, если данные контекста не найдены\n */\nfunction storage (\n\tel?: Element & { topData?: any },\n\tcontextName: string = 'common', contextData: object | null | undefined = undefined,\n): object | undefined {\n\tif (!el) {\n\t\treturn;\n\t}\n\n\tif (!el.topData) {\n\t\tel.topData = {};\n\t}\n\n\tif (contextData) {\n\t\tel.topData[contextName] = contextData;\n\t}\n\n\tif (contextData === null) {\n\t\tdelete el.topData[contextName];\n\t}\n\n\treturn el.topData[contextName];\n}\n\n/**\n * Очистить хранилище элемента\n */\nfunction storageClear (el?: Element & { topData?: any }) {\n\tif (!el) {\n\t\treturn;\n\t}\n\n\tdelete el.topData;\n}\n\nexport default {\n\tgenEl,\n\tisVisible,\n\toffset,\n\tcss,\n\twrap,\n\tquerySelectorVisible,\n\tquerySelectorVisibleLast,\n\tquerySelectorAllVisible,\n\tquerySelectorAllArray,\n\tstorage,\n\tstorageClear,\n};\n"],"names":["genEl","tagName","attrs","elsChildrens","el","name","elChildren","isVisible","boundingClientRect","offset","css","property","wrap","elWrapper","querySelectorVisible","selectors","querySelectorAllArray","querySelectorVisibleLast","querySelectorAllVisible","storage","contextName","contextData","storageClear"],"mappings":"+BAWA,SAASA,EAAOC,EAAiBC,KAAeC,EAAkC,CAC3E,MAAAC,EAAU,SAAS,cAAcH,CAAO,EAE9C,UAAWI,KAAQH,EACdG,EAAK,QAAQ,IAAI,IAAM,EAEvBD,EAAAC,CAAI,EAAIH,EAAMG,CAAI,EAErBD,EAAG,aAAaC,EAAMH,EAAMG,CAAI,CAAC,EAItB,OAAAF,EAAA,QAASG,GAAe,CAChC,OAAQA,GAAgB,SACxBF,EAAA,mBAAmB,YAAaE,CAAU,EAE7CF,EAAG,OAAOE,CAAU,CACrB,CACA,EAEMF,CACR,CAOA,SAASG,EAAWH,EAAc,CACjC,GAAI,CAACA,EACG,MAAA,GAGF,MAAAI,EAAqBJ,EAAG,wBAC9B,MAAO,CAAC,EAAEI,EAAmB,OAASA,EAAmB,OAC1D,CAOA,SAASC,EAAQL,EAA4C,CACtD,MAAAI,EAAqBJ,EAAG,wBAEvB,MAAA,CACN,IAAKI,EAAmB,IAAM,OAAO,QACrC,KAAMA,EAAmB,KAAO,OAAO,OAAA,CAEzC,CAQA,SAASE,EAAKN,EAAaO,EAA0B,CACpD,OAAO,OAAO,iBAAiBP,CAAE,EAAE,iBAAiBO,CAAQ,CAC7D,CAQA,SAASC,EAAMR,EAAaH,EAA0B,CAC/C,MAAAY,EAAY,SAAS,cAAcZ,CAAO,EAChD,OAAAG,EAAG,MAAMS,CAAS,EAElBA,EAAU,OAAOT,CAAE,EAEZS,CACR,CAQA,SAASC,EAAsBV,EAAaW,EAAmC,CAC9E,OAAOC,EAAsBZ,EAAIW,CAAS,EAAE,KAAKR,CAAS,GAAK,IAChE,CAQA,SAASU,EAA0Bb,EAAaW,EAAmC,CAClF,OAAOC,EAAsBZ,EAAIW,CAAS,EAAE,SAASR,CAAS,GAAK,IACpE,CAQA,SAASW,EAAyBd,EAAaW,EAA8B,CAC5E,OAAOC,EAAsBZ,EAAIW,CAAS,EAAE,OAAOR,CAAS,CAC7D,CAQA,SAASS,EAAuBZ,EAAaW,EAA8B,CAC1E,OAAKX,EAIE,CAAC,GAAGA,EAAG,iBAAiBW,CAAS,CAAC,EAHjC,EAIT,CASA,SAASI,EACRf,EACAgB,EAAsB,SAAUC,EAAyC,OACpD,CACrB,GAAKjB,EAID,OAACA,EAAG,UACPA,EAAG,QAAU,IAGViB,IACAjB,EAAA,QAAQgB,CAAW,EAAIC,GAGvBA,IAAgB,MACZ,OAAAjB,EAAG,QAAQgB,CAAW,EAGvBhB,EAAG,QAAQgB,CAAW,CAC9B,CAKA,SAASE,EAAclB,EAAkC,CACnDA,GAIL,OAAOA,EAAG,OACX,OAEe,CACd,MAAAJ,EACA,UAAAO,EACA,OAAAE,EACA,IAAAC,EACA,KAAAE,EACA,qBAAAE,EACA,yBAAAG,EACA,wBAAAC,EACA,sBAAAF,EACA,QAAAG,EACA,aAAAG,CACD"}
|
package/utils/dom.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
function f(t, e, ...n) {
|
|
2
|
+
const o = document.createElement(t);
|
|
3
|
+
for (const r in e)
|
|
4
|
+
r.indexOf("on") === 0 ? o[r] = e[r] : o.setAttribute(r, e[r]);
|
|
5
|
+
return n.forEach((r) => {
|
|
6
|
+
typeof r == "string" ? o.insertAdjacentHTML("beforeend", r) : o.append(r);
|
|
7
|
+
}), o;
|
|
8
|
+
}
|
|
9
|
+
function i(t) {
|
|
10
|
+
if (!t)
|
|
11
|
+
return !1;
|
|
12
|
+
const e = t.getBoundingClientRect();
|
|
13
|
+
return !!(e.width || e.height);
|
|
14
|
+
}
|
|
15
|
+
function l(t) {
|
|
16
|
+
const e = t.getBoundingClientRect();
|
|
17
|
+
return {
|
|
18
|
+
top: e.top + window.scrollY,
|
|
19
|
+
left: e.left + window.scrollX
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function c(t, e) {
|
|
23
|
+
return window.getComputedStyle(t).getPropertyValue(e);
|
|
24
|
+
}
|
|
25
|
+
function s(t, e) {
|
|
26
|
+
const n = document.createElement(e);
|
|
27
|
+
return t.after(n), n.append(t), n;
|
|
28
|
+
}
|
|
29
|
+
function a(t, e) {
|
|
30
|
+
return u(t, e).find(i) || null;
|
|
31
|
+
}
|
|
32
|
+
function d(t, e) {
|
|
33
|
+
return u(t, e).findLast(i) || null;
|
|
34
|
+
}
|
|
35
|
+
function p(t, e) {
|
|
36
|
+
return u(t, e).filter(i);
|
|
37
|
+
}
|
|
38
|
+
function u(t, e) {
|
|
39
|
+
return t ? [...t.querySelectorAll(e)] : [];
|
|
40
|
+
}
|
|
41
|
+
function g(t, e = "common", n = void 0) {
|
|
42
|
+
if (t)
|
|
43
|
+
return t.topData || (t.topData = {}), n && (t.topData[e] = n), n === null && delete t.topData[e], t.topData[e];
|
|
44
|
+
}
|
|
45
|
+
function y(t) {
|
|
46
|
+
t && delete t.topData;
|
|
47
|
+
}
|
|
48
|
+
const b = {
|
|
49
|
+
genEl: f,
|
|
50
|
+
isVisible: i,
|
|
51
|
+
offset: l,
|
|
52
|
+
css: c,
|
|
53
|
+
wrap: s,
|
|
54
|
+
querySelectorVisible: a,
|
|
55
|
+
querySelectorVisibleLast: d,
|
|
56
|
+
querySelectorAllVisible: p,
|
|
57
|
+
querySelectorAllArray: u,
|
|
58
|
+
storage: g,
|
|
59
|
+
storageClear: y
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
b as default
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=dom.js.map
|
package/utils/dom.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.js","sources":["../../src/core/utils/dom.ts"],"sourcesContent":["/**\n * Функции для работы с работы с Document Object Model (DOM)\n */\n\n/**\n * Создать элемент\n * @param {string} tagName\n * @param {any} attrs - атрибуты\n * @param {Element[]} elsChildrens\n * @returns {Element} - созданный элемент\n */\nfunction genEl (tagName: string, attrs: any, ...elsChildrens: Element[]): Element {\n\tconst el: any = document.createElement(tagName);\n\n\tfor (const name in attrs) {\n\t\tif (name.indexOf('on') === 0) {\n\t\t\t// events\n\t\t\tel[name] = attrs[name];\n\t\t} else {\n\t\t\tel.setAttribute(name, attrs[name]);\n\t\t}\n\t}\n\n\telsChildrens.forEach((elChildren) => {\n\t\tif (typeof (elChildren) === 'string') {\n\t\t\tel.insertAdjacentHTML('beforeend', elChildren);\n\t\t} else {\n\t\t\tel.append(elChildren);\n\t\t}\n\t});\n\n\treturn el;\n}\n\n/**\n * Проверить видимость элемента\n * @param {?Element} el\n * @returns boolean - вернет true, если элемент считается видимым\n */\nfunction isVisible (el?: Element) {\n\tif (!el) {\n\t\treturn false;\n\t}\n\n\tconst boundingClientRect = el.getBoundingClientRect();\n\treturn !!(boundingClientRect.width || boundingClientRect.height);\n}\n\n/**\n * Получить координаты элемента относительно документа\n * @param {Element} el\n * @returns {{top: number, left: number}} - координаты элемента относительно документа\n */\nfunction offset (el: Element): { top: number, left: number } {\n\tconst boundingClientRect = el.getBoundingClientRect();\n\n\treturn {\n\t\ttop: boundingClientRect.top + window.scrollY,\n\t\tleft: boundingClientRect.left + window.scrollX,\n\t};\n}\n\n/**\n * Получить значение css свойства элемента\n * @param {Element} el\n * @param {string} property - имя свойства\n * @return {string} - значение css стиля\n */\nfunction css (el: Element, property: string): string {\n\treturn window.getComputedStyle(el).getPropertyValue(property);\n}\n\n/**\n * Обернуть элемент и вернуть только что созданный элемент\n * @param {Element} el - элемент, который требуется обернуть\n * @param {string} tagName - имя тега элемента, в который треубется обернуть элемент\n * @returns {Element}\n */\nfunction wrap (el: Element, tagName: string): Element {\n\tconst elWrapper = document.createElement(tagName);\n\tel.after(elWrapper);\n\n\telWrapper.append(el);\n\n\treturn elWrapper;\n}\n\n/**\n * Найти и вернуть первый видимый элемент\n * @param {?Document|Element} el - корневой элемент поиска\n * @param selectors - см. параметр selectors в Document.querySelectorAll()\n * @returns {Element|null}\n */\nfunction querySelectorVisible (el: Element, selectors: string): Element | null {\n\treturn querySelectorAllArray(el, selectors).find(isVisible) || null;\n}\n\n/**\n * Найти и вернуть последний видимый элемент\n * @param {?Document|Element} el - корневой элемент поиска\n * @param selectors - см. параметр selectors в Document.querySelectorAll()\n * @returns {Element|null}\n */\nfunction querySelectorVisibleLast (el: Element, selectors: string): Element | null {\n\treturn querySelectorAllArray(el, selectors).findLast(isVisible) || null;\n}\n\n/**\n * Найти видимые элементы\n * @param {?Document|Element} el - корневой элемент поиска\n * @param selectors - см. параметр selectors в Document.querySelectorAll()\n * @returns {Element[]} - обратите внимание, возвращается не NodeList[], а Element[]\n */\nfunction querySelectorAllVisible (el: Element, selectors: string): Element[] {\n\treturn querySelectorAllArray(el, selectors).filter(isVisible);\n}\n\n/**\n * Найти элементы и вернуть в виде массива\n * @param {?Document|Element} el - корневой элемент поиска\n * @param selectors - см. параметр selectors в Document.querySelectorAll()\n * @returns {Element[]}\n */\nfunction querySelectorAllArray (el: Element, selectors: string): Element[] {\n\tif (!el) {\n\t\treturn [];\n\t}\n\n\treturn [...el.querySelectorAll(selectors)];\n}\n\n/**\n * Хранилище данных элемента\n * @param {Element} el\n * @param {string} contextName - контекст, обычно используется имя компонента\n * @param {?object | null} contextData - установить объект с данными, предыдущие данные будут заменены, установите null для удаления данных\n * @returns {?object} - вернет объект контекста или undefined, если данные контекста не найдены\n */\nfunction storage (\n\tel?: Element & { topData?: any },\n\tcontextName: string = 'common', contextData: object | null | undefined = undefined,\n): object | undefined {\n\tif (!el) {\n\t\treturn;\n\t}\n\n\tif (!el.topData) {\n\t\tel.topData = {};\n\t}\n\n\tif (contextData) {\n\t\tel.topData[contextName] = contextData;\n\t}\n\n\tif (contextData === null) {\n\t\tdelete el.topData[contextName];\n\t}\n\n\treturn el.topData[contextName];\n}\n\n/**\n * Очистить хранилище элемента\n */\nfunction storageClear (el?: Element & { topData?: any }) {\n\tif (!el) {\n\t\treturn;\n\t}\n\n\tdelete el.topData;\n}\n\nexport default {\n\tgenEl,\n\tisVisible,\n\toffset,\n\tcss,\n\twrap,\n\tquerySelectorVisible,\n\tquerySelectorVisibleLast,\n\tquerySelectorAllVisible,\n\tquerySelectorAllArray,\n\tstorage,\n\tstorageClear,\n};\n"],"names":["genEl","tagName","attrs","elsChildrens","el","name","elChildren","isVisible","boundingClientRect","offset","css","property","wrap","elWrapper","querySelectorVisible","selectors","querySelectorAllArray","querySelectorVisibleLast","querySelectorAllVisible","storage","contextName","contextData","storageClear","DOM"],"mappings":"AAWA,SAASA,EAAOC,GAAiBC,MAAeC,GAAkC;AAC3E,QAAAC,IAAU,SAAS,cAAcH,CAAO;AAE9C,aAAWI,KAAQH;AAClB,IAAIG,EAAK,QAAQ,IAAI,MAAM,IAEvBD,EAAAC,CAAI,IAAIH,EAAMG,CAAI,IAErBD,EAAG,aAAaC,GAAMH,EAAMG,CAAI,CAAC;AAItB,SAAAF,EAAA,QAAQ,CAACG,MAAe;AAChC,IAAA,OAAQA,KAAgB,WACxBF,EAAA,mBAAmB,aAAaE,CAAU,IAE7CF,EAAG,OAAOE,CAAU;AAAA,EACrB,CACA,GAEMF;AACR;AAOA,SAASG,EAAWH,GAAc;AACjC,MAAI,CAACA;AACG,WAAA;AAGF,QAAAI,IAAqBJ,EAAG;AAC9B,SAAO,CAAC,EAAEI,EAAmB,SAASA,EAAmB;AAC1D;AAOA,SAASC,EAAQL,GAA4C;AACtD,QAAAI,IAAqBJ,EAAG;AAEvB,SAAA;AAAA,IACN,KAAKI,EAAmB,MAAM,OAAO;AAAA,IACrC,MAAMA,EAAmB,OAAO,OAAO;AAAA,EAAA;AAEzC;AAQA,SAASE,EAAKN,GAAaO,GAA0B;AACpD,SAAO,OAAO,iBAAiBP,CAAE,EAAE,iBAAiBO,CAAQ;AAC7D;AAQA,SAASC,EAAMR,GAAaH,GAA0B;AAC/C,QAAAY,IAAY,SAAS,cAAcZ,CAAO;AAChD,SAAAG,EAAG,MAAMS,CAAS,GAElBA,EAAU,OAAOT,CAAE,GAEZS;AACR;AAQA,SAASC,EAAsBV,GAAaW,GAAmC;AAC9E,SAAOC,EAAsBZ,GAAIW,CAAS,EAAE,KAAKR,CAAS,KAAK;AAChE;AAQA,SAASU,EAA0Bb,GAAaW,GAAmC;AAClF,SAAOC,EAAsBZ,GAAIW,CAAS,EAAE,SAASR,CAAS,KAAK;AACpE;AAQA,SAASW,EAAyBd,GAAaW,GAA8B;AAC5E,SAAOC,EAAsBZ,GAAIW,CAAS,EAAE,OAAOR,CAAS;AAC7D;AAQA,SAASS,EAAuBZ,GAAaW,GAA8B;AAC1E,SAAKX,IAIE,CAAC,GAAGA,EAAG,iBAAiBW,CAAS,CAAC,IAHjC;AAIT;AASA,SAASI,EACRf,GACAgB,IAAsB,UAAUC,IAAyC,QACpD;AACrB,MAAKjB;AAID,WAACA,EAAG,YACPA,EAAG,UAAU,KAGViB,MACAjB,EAAA,QAAQgB,CAAW,IAAIC,IAGvBA,MAAgB,QACZ,OAAAjB,EAAG,QAAQgB,CAAW,GAGvBhB,EAAG,QAAQgB,CAAW;AAC9B;AAKA,SAASE,EAAclB,GAAkC;AACxD,EAAKA,KAIL,OAAOA,EAAG;AACX;AAEA,MAAemB,IAAA;AAAA,EACd,OAAAvB;AAAA,EACA,WAAAO;AAAA,EACA,QAAAE;AAAA,EACA,KAAAC;AAAA,EACA,MAAAE;AAAA,EACA,sBAAAE;AAAA,EACA,0BAAAG;AAAA,EACA,yBAAAC;AAAA,EACA,uBAAAF;AAAA,EACA,SAAAG;AAAA,EACA,cAAAG;AACD;"}
|
|
@@ -1,410 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|