@topvisor/ui 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/.chunks/forms-2abb7eaa.amd.js +425 -0
  2. package/.chunks/forms-2abb7eaa.amd.js.map +1 -0
  3. package/.chunks/forms-5e17154c.es.js +422 -0
  4. package/.chunks/forms-5e17154c.es.js.map +1 -0
  5. package/README.md +62 -85
  6. package/{l/common → common}/common.amd.js +0 -1
  7. package/{l/common → common}/common.amd.js.map +1 -1
  8. package/{l/common → common}/common.js +0 -1
  9. package/{l/common → common}/common.js.map +1 -1
  10. package/core.css +659 -574
  11. package/dark.css +135 -115
  12. package/forms/forms.amd.js +11 -0
  13. package/forms/forms.amd.js.map +1 -0
  14. package/forms/forms.js +11 -0
  15. package/forms/forms.js.map +1 -0
  16. package/{c/style.css → forms.css} +307 -251
  17. package/helpers/helpers.amd.js +6 -0
  18. package/helpers/helpers.amd.js.map +1 -0
  19. package/helpers/helpers.js +6 -0
  20. package/helpers/helpers.js.map +1 -0
  21. package/icomoon/demo-files/Read Me.txt +7 -7
  22. package/icomoon/demo-files/demo.css +161 -161
  23. package/icomoon/demo-files/demo.js +30 -30
  24. package/icomoon/demo.html +2931 -2931
  25. package/icomoon/fonts/Topvisor-2.svg +231 -231
  26. package/icomoon/style.css +644 -644
  27. package/light.css +135 -128
  28. package/package.json +19 -19
  29. package/c/_plugin-vue_export-helper-cb5c78ba.js +0 -12
  30. package/c/_plugin-vue_export-helper-cb5c78ba.js.map +0 -1
  31. package/c/_plugin-vue_export-helper-cc2b3d55.js +0 -11
  32. package/c/_plugin-vue_export-helper-cc2b3d55.js.map +0 -1
  33. package/c/button/button.amd.js +0 -99
  34. package/c/button/button.amd.js.map +0 -1
  35. package/c/button/button.js +0 -100
  36. package/c/button/button.js.map +0 -1
  37. package/c/checkbox/checkbox.amd.js +0 -58
  38. package/c/checkbox/checkbox.amd.js.map +0 -1
  39. package/c/checkbox/checkbox.js +0 -59
  40. package/c/checkbox/checkbox.js.map +0 -1
  41. package/c/example/example.amd.js +0 -35
  42. package/c/example/example.amd.js.map +0 -1
  43. package/c/example/example.js +0 -36
  44. package/c/example/example.js.map +0 -1
  45. package/c/icon/icon.amd.js +0 -22
  46. package/c/icon/icon.amd.js.map +0 -1
  47. package/c/icon/icon.js +0 -22
  48. package/c/icon/icon.js.map +0 -1
  49. package/c/radio/radio.amd.js +0 -49
  50. package/c/radio/radio.amd.js.map +0 -1
  51. package/c/radio/radio.js +0 -50
  52. package/c/radio/radio.js.map +0 -1
  53. package/l/forms/forms.amd.js +0 -206
  54. package/l/forms/forms.amd.js.map +0 -1
  55. package/l/forms/forms.js +0 -205
  56. package/l/forms/forms.js.map +0 -1
  57. package/l/style.css +0 -352
@@ -0,0 +1,422 @@
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 = {
106
+ key: 0,
107
+ class: "top-forms-optionLabel_description"
108
+ };
109
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
110
+ __name: "controlLabel",
111
+ props: {
112
+ title: {},
113
+ description: {},
114
+ disabled: { type: Boolean }
115
+ },
116
+ setup(__props) {
117
+ return (_ctx, _cache) => {
118
+ return openBlock(), createElementBlock("div", _hoisted_1$4, [
119
+ createElementVNode("div", {
120
+ class: normalizeClass({
121
+ "top-forms-optionLabel_title": true,
122
+ "top-forms-optionLabel_title-disabled": _ctx.disabled
123
+ })
124
+ }, toDisplayString(_ctx.title), 3),
125
+ _ctx.description ? (openBlock(), createElementBlock("div", _hoisted_2$1, toDisplayString(_ctx.description), 1)) : createCommentVNode("", true)
126
+ ]);
127
+ };
128
+ }
129
+ });
130
+ const style0$4 = {
131
+ "top-forms-optionLabel": "top-forms-optionLabel",
132
+ "top-forms-optionLabel_title": "top-forms-optionLabel_title",
133
+ "top-forms-optionLabel_title-disabled": "top-forms-optionLabel_title-disabled",
134
+ "top-forms-optionLabel_description": "top-forms-optionLabel_description"
135
+ };
136
+ const cssModules$4 = {
137
+ "$style": style0$4
138
+ };
139
+ const ControlLabel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__cssModules", cssModules$4]]);
140
+ const _hoisted_1$3 = ["name", "value", "checked", "indeterminate", "disabled"];
141
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
142
+ __name: "checkbox",
143
+ props: {
144
+ name: {},
145
+ value: {},
146
+ title: {},
147
+ description: {},
148
+ checked: { type: Boolean },
149
+ disabled: { type: Boolean },
150
+ indeterminate: { type: Boolean },
151
+ isError: { type: Boolean }
152
+ },
153
+ setup(__props) {
154
+ return (_ctx, _cache) => {
155
+ return openBlock(), createElementBlock("label", {
156
+ class: normalizeClass({
157
+ ["top-forms-optionWrapper"]: true,
158
+ ["top-checkbox"]: true,
159
+ ["top-checkbox_" + _ctx.name]: _ctx.name !== "",
160
+ ["top-active"]: _ctx.checked,
161
+ ["top-disabled"]: _ctx.disabled,
162
+ ["top-error"]: _ctx.isError && !_ctx.disabled
163
+ })
164
+ }, [
165
+ createElementVNode("input", {
166
+ type: "checkbox",
167
+ class: normalizeClass({
168
+ ["top-forms-focusable"]: !_ctx.disabled,
169
+ ["top-forms-option"]: true,
170
+ ["top-checkbox_input"]: true,
171
+ ["top-error"]: _ctx.isError && !_ctx.disabled
172
+ }),
173
+ name: _ctx.name,
174
+ value: _ctx.value,
175
+ checked: _ctx.checked,
176
+ indeterminate: _ctx.indeterminate,
177
+ disabled: _ctx.disabled
178
+ }, null, 10, _hoisted_1$3),
179
+ _ctx.title ? (openBlock(), createBlock(ControlLabel, {
180
+ key: 0,
181
+ title: _ctx.title,
182
+ description: _ctx.description,
183
+ disabled: _ctx.disabled
184
+ }, null, 8, ["title", "description", "disabled"])) : createCommentVNode("", true)
185
+ ], 2);
186
+ };
187
+ }
188
+ });
189
+ const style0$3 = {
190
+ "top-checkbox": "top-checkbox",
191
+ "top-checkbox_input": "top-checkbox_input",
192
+ "top-error": "top-error"
193
+ };
194
+ const cssModules$3 = {
195
+ "$style": style0$3
196
+ };
197
+ const checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__cssModules", cssModules$3]]);
198
+ var CAPTION_TYPE = /* @__PURE__ */ ((CAPTION_TYPE2) => {
199
+ CAPTION_TYPE2["NONE"] = "";
200
+ CAPTION_TYPE2["SLIDE"] = "slide";
201
+ CAPTION_TYPE2["TOP"] = "top";
202
+ return CAPTION_TYPE2;
203
+ })(CAPTION_TYPE || {});
204
+ const _hoisted_1$2 = ["data-top-icon"];
205
+ const _hoisted_2 = ["name", "title", "placeholder", "disabled", "readonly"];
206
+ const _hoisted_3 = {
207
+ key: 2,
208
+ class: "top-formsCaption"
209
+ };
210
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
211
+ __name: "input",
212
+ props: {
213
+ modelValue: {},
214
+ name: {},
215
+ disabled: { type: Boolean },
216
+ readonly: { type: Boolean },
217
+ title: {},
218
+ captionType: { default: CAPTION_TYPE.NONE },
219
+ size: { default: SIZE.S },
220
+ icon: {},
221
+ addCleaner: { type: Boolean },
222
+ isError: { type: Boolean }
223
+ },
224
+ emits: ["update:modelValue"],
225
+ setup(__props, { emit }) {
226
+ const props = __props;
227
+ const value = computed({
228
+ get() {
229
+ return props.modelValue;
230
+ },
231
+ set(value2) {
232
+ emit("update:modelValue", value2);
233
+ }
234
+ });
235
+ const placeholder = computed(() => {
236
+ if (props.addCleaner && !props.title) {
237
+ return "";
238
+ }
239
+ if (props.captionType !== CAPTION_TYPE.NONE) {
240
+ return "";
241
+ }
242
+ return props.title;
243
+ });
244
+ const clean = () => {
245
+ emit("update:modelValue", "");
246
+ };
247
+ return (_ctx, _cache) => {
248
+ return openBlock(), createElementBlock("label", {
249
+ class: normalizeClass({
250
+ ["top-input"]: true,
251
+ ["top-input-" + _ctx.name]: _ctx.name,
252
+ ["top-size_" + _ctx.size]: true,
253
+ ["top-disabled"]: _ctx.disabled,
254
+ ["top-input-withCleaner"]: _ctx.addCleaner,
255
+ ["top-formsCaptionWrapper"]: _ctx.captionType !== unref(CAPTION_TYPE).NONE,
256
+ ["top-formsCaptionWrapper-always"]: _ctx.captionType === unref(CAPTION_TYPE).TOP,
257
+ ["top-input-withButton"]: !!_ctx.$slots.btn
258
+ }),
259
+ "data-top-icon": _ctx.icon
260
+ }, [
261
+ withDirectives(createElementVNode("input", {
262
+ type: "text",
263
+ class: normalizeClass({
264
+ ["top-forms-focusable"]: !_ctx.disabled,
265
+ ["top-input_input"]: true,
266
+ ["top-error"]: _ctx.isError
267
+ }),
268
+ autocomplete: "off_always",
269
+ name: _ctx.name,
270
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
271
+ title: _ctx.title,
272
+ placeholder: placeholder.value,
273
+ disabled: _ctx.disabled,
274
+ readonly: _ctx.readonly,
275
+ onKeydown: _cache[1] || (_cache[1] = withKeys(() => (_ctx.addCleaner || !!_ctx.$slots.btn) && clean(), ["esc"]))
276
+ }, null, 42, _hoisted_2), [
277
+ [vModelText, value.value]
278
+ ]),
279
+ _ctx.addCleaner && value.value ? (openBlock(), createElementBlock("span", {
280
+ key: 0,
281
+ class: "top-input_cleaner top-cleaner",
282
+ "data-top-icon": "",
283
+ onClick: clean
284
+ })) : createCommentVNode("", true),
285
+ value.value ? renderSlot(_ctx.$slots, "btn", { key: 1 }) : createCommentVNode("", true),
286
+ renderSlot(_ctx.$slots, "default"),
287
+ _ctx.captionType !== unref(CAPTION_TYPE).NONE ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true)
288
+ ], 10, _hoisted_1$2);
289
+ };
290
+ }
291
+ });
292
+ const style0$2 = {
293
+ "top-input": "top-input",
294
+ "top-input_input": "top-input_input",
295
+ "top-input-withCleaner": "top-input-withCleaner"
296
+ };
297
+ const cssModules$2 = {
298
+ "$style": style0$2
299
+ };
300
+ const input = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__cssModules", cssModules$2]]);
301
+ const _hoisted_1$1 = ["name", "value", "checked", "disabled"];
302
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
303
+ __name: "radio",
304
+ props: {
305
+ name: {},
306
+ value: {},
307
+ title: {},
308
+ description: {},
309
+ checked: { type: Boolean },
310
+ disabled: { type: Boolean },
311
+ isError: { type: Boolean }
312
+ },
313
+ setup(__props) {
314
+ return (_ctx, _cache) => {
315
+ return openBlock(), createElementBlock("label", {
316
+ class: normalizeClass({
317
+ ["top-forms-optionWrapper"]: true,
318
+ ["top-radio"]: true,
319
+ ["top-radio_" + _ctx.name]: _ctx.name !== "",
320
+ ["top-active"]: _ctx.checked,
321
+ ["top-disabled"]: _ctx.disabled,
322
+ ["top-error"]: _ctx.isError && !_ctx.disabled
323
+ })
324
+ }, [
325
+ createElementVNode("input", {
326
+ type: "radio",
327
+ class: normalizeClass({
328
+ ["top-forms-focusable"]: !_ctx.disabled,
329
+ ["top-forms-option"]: true,
330
+ ["top-radio_input"]: true,
331
+ ["top-error"]: _ctx.isError && !_ctx.disabled
332
+ }),
333
+ name: _ctx.name,
334
+ value: _ctx.value,
335
+ checked: _ctx.checked,
336
+ disabled: _ctx.disabled
337
+ }, null, 10, _hoisted_1$1),
338
+ _ctx.title ? (openBlock(), createBlock(ControlLabel, {
339
+ key: 0,
340
+ title: _ctx.title,
341
+ description: _ctx.description,
342
+ disabled: _ctx.disabled
343
+ }, null, 8, ["title", "description", "disabled"])) : createCommentVNode("", true)
344
+ ], 2);
345
+ };
346
+ }
347
+ });
348
+ const style0$1 = {
349
+ "top-radio": "top-radio",
350
+ "top-radio_input": "top-radio_input",
351
+ "top-error": "top-error"
352
+ };
353
+ const cssModules$1 = {
354
+ "$style": style0$1
355
+ };
356
+ const radio = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__cssModules", cssModules$1]]);
357
+ const _hoisted_1 = ["name", "value", "checked", "disabled"];
358
+ const _sfc_main = /* @__PURE__ */ defineComponent({
359
+ __name: "switcher",
360
+ props: {
361
+ name: {},
362
+ value: {},
363
+ title: {},
364
+ description: {},
365
+ checked: { type: Boolean },
366
+ disabled: { type: Boolean },
367
+ isError: { type: Boolean },
368
+ isSwitcher: { type: Boolean }
369
+ },
370
+ setup(__props) {
371
+ return (_ctx, _cache) => {
372
+ return openBlock(), createElementBlock("label", {
373
+ class: normalizeClass({
374
+ ["top-forms-optionWrapper"]: true,
375
+ ["top-checkboxSwitcher"]: true,
376
+ ["top-active"]: _ctx.checked,
377
+ ["top-disabled"]: _ctx.disabled,
378
+ ["top-error"]: _ctx.isError && !_ctx.disabled
379
+ })
380
+ }, [
381
+ createElementVNode("input", {
382
+ type: "checkbox",
383
+ class: normalizeClass({
384
+ ["top-forms-focusable"]: !_ctx.disabled,
385
+ ["top-forms-option"]: true,
386
+ ["top-checkboxSwitcher_input"]: true,
387
+ ["top-error"]: _ctx.isError && !_ctx.disabled
388
+ }),
389
+ name: _ctx.name,
390
+ value: _ctx.value,
391
+ checked: _ctx.checked,
392
+ disabled: _ctx.disabled
393
+ }, null, 10, _hoisted_1),
394
+ _ctx.title ? (openBlock(), createBlock(ControlLabel, {
395
+ key: 0,
396
+ title: _ctx.title,
397
+ description: _ctx.description,
398
+ disabled: _ctx.disabled
399
+ }, null, 8, ["title", "description", "disabled"])) : createCommentVNode("", true)
400
+ ], 2);
401
+ };
402
+ }
403
+ });
404
+ const style0 = {
405
+ "top-checkboxSwitcher": "top-checkboxSwitcher",
406
+ "top-checkboxSwitcher_input": "top-checkboxSwitcher_input",
407
+ "top-error": "top-error"
408
+ };
409
+ const cssModules = {
410
+ "$style": style0
411
+ };
412
+ const switcher = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
413
+ export {
414
+ ControlLabel as C,
415
+ SIZE as S,
416
+ button as b,
417
+ checkbox as c,
418
+ input as i,
419
+ radio as r,
420
+ switcher as s
421
+ };
422
+ //# sourceMappingURL=forms-5e17154c.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forms-5e17154c.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';\r\nimport { SIZE } from '@/components/forms/helpers';\r\n\r\n/**\r\n * Определение параметров\r\n */\r\nexport interface Props {\r\n\tcolor?: COLOR\r\n\tstyling?: STYLING // bug: name = style init with object type\r\n\tsize?: SIZE\r\n\r\n\tname?: string\r\n\ttitle?: string\r\n\ticon?: string\r\n\ticon2?: string\r\n\r\n\thref?: string // если установлена ссылка, isSubmit не может быть true\r\n\t// value?: string\r\n\r\n\tdisabled?: boolean\r\n\tisSubmit?: boolean\r\n\tisActive?: boolean\r\n\tisProgress?: 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}\r\n\r\n/**\r\n * Определение событий\r\n */\r\nexport interface Emits { }\r\n\r\n/**\r\n * Цвета\r\n */\r\nexport enum COLOR {\r\n\tTheme = 'theme',\r\n\tBlue = 'blue',\r\n\tGreen = 'green',\r\n\tOrange = 'orange',\r\n\tRed = 'red',\r\n\tPink = 'pink',\r\n}\r\n\r\n/**\r\n * Стили\r\n */\r\nexport enum STYLING {\r\n\tRegular = '',\r\n\tOutline = 'outline',\r\n\tSoft = 'soft',\r\n\tTransparent = 'transparent',\r\n}\r\n\r\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) {\r\n\t\treturn '';\r\n\t}\r\n\tif (props.captionType !== CAPTION_TYPE.NONE) {\r\n\t\treturn '';\r\n\t}\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,MAAO;AACN,eAAO,MAAM;AAAA,MACd;AAAA,MACA,IAAKC,QAAO;AACX,aAAK,qBAAqBA,MAAK;AAAA,MAChC;AAAA,IAAA,CACA;AAEK,UAAA,cAAc,SAAS,MAAM;AAClC,UAAI,MAAM,cAAc,CAAC,MAAM,OAAO;AAC9B,eAAA;AAAA,MACR;AACI,UAAA,MAAM,gBAAgB,aAAa,MAAM;AACrC,eAAA;AAAA,MACR;AAEA,aAAO,MAAM;AAAA,IAAA,CACb;AAED,UAAM,QAAQ,MAAM;AACnB,WAAK,qBAAqB,EAAE;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/README.md CHANGED
@@ -1,86 +1,63 @@
1
- # UI kit Topvisor Vue
2
-
3
- ## Vue компоненты
4
-
5
- Компоненты разделены на библиотеки, чтобы их можно было грузить пачками прямо с CDN.
6
-
7
- Компоненты можно грузить по отдельности.
8
-
9
- Компоненты поставляются в двух форматах:
10
-
11
- - amd (requirejs)
12
- - es
13
-
14
- Расположение компонентов и библиотек:
15
- - /c/ - папка с компонентами
16
- - /l/ - папка с библиотеками
17
-
18
- Список всех компонентов см. на [npmjs](https://www.npmjs.com/package/topvisor-ui?activeTab=code).
19
-
20
- ## Другие ресурсы
21
-
22
- - /core.css - основная палитра цветов и стили компонентов
23
- - /light.css - светлая тема
24
- - /dark.css - темная тема
25
-
26
- ## Подключение стилей
27
-
28
- Подключение базовых стилей и переменных палитры.
29
- Подключение базовых стилей, переменных палитры и основных компонентов.
30
- Подключение базовых стилей и переменных палитры.
31
- Стили сложных компонентов рекомендуется грузить асинхронно.
32
-
33
- ```js
34
- import '@topvisor/ui/core.css';
35
- ```
36
-
37
- Подключение стилей темы на примере светлой темы.
38
-
39
- ```js
40
- import '@topvisor/ui/light.css';
41
- ```
42
-
43
- Для смены темы необходимо подгрузить файл стилей необходимой темы и сразу отключить стили предыдущей темы.
44
-
45
- Подключение стилей основных компонентов.
46
-
47
- ```js
48
- import '@topvisor/ui/l/style.css';
49
- ```
50
-
51
- Подключение набора иконок шрифта icomoon.
52
-
53
- ```js
54
- import '@topvisor/ui/icomoon/style.css';
55
- ```
56
-
57
- ## Подключение компонента
58
-
59
- Пример подключения компонента Button.
60
-
61
- ```javascript
62
- requirejs(['topvisor-ui/c/button/button.amd'], Button => {
63
- console.log(Button);
64
- });
65
- ```
66
-
67
- ## Подключение библиотек компонентов
68
-
69
- В большинстве случаев группы компонентов грузить отдельно нет смысла, поэтому она вынесены в библиотеки.
70
-
71
- Не грузите один и тот же компонент двумя способами, это приведет к тому, что он будет загружен дважды.
72
-
73
- Пример подключения библиотеки Forms со всеми ее компонентами:
74
-
75
- ```javascript
76
- requirejs(['topvisor-ui/l/forms/forms.amd'], ({Button}) => {
77
- console.log(Button);
78
- });
79
-
80
- requirejs(['topvisor-ui/l/forms/forms.amd'], Forms => {
81
- const { Button } = Forms;
82
-
83
- console.log(Forms);
84
- console.log(Button);
85
- });
1
+ # UI kit Topvisor Vue
2
+
3
+ ## Vue компоненты
4
+
5
+ Компоненты поставляются в двух форматах:
6
+
7
+ - amd (requirejs)
8
+ - es
9
+
10
+ Компоненты делятся на разные модули и доступны через импорт этих модулей.
11
+
12
+ Каждый модуль находится в отдельной папке, соответствующей имени модулю.
13
+
14
+ Все стили модулей находятся в корневой папке в файлах соответствующих имени модулю.
15
+
16
+ Список всех компонентов см. на [npmjs](https://www.npmjs.com/package/topvisor-ui?activeTab=code).
17
+
18
+ ## Другие ресурсы
19
+
20
+ - [core.css](core.css) - основная палитра цветов и стили компонентов
21
+ - [light.css](light.css) - светлая тема
22
+ - [dark.css](dark.css) - темная тема
23
+
24
+ ## Подключение стилей
25
+
26
+ Стили компонентов подгружаются автоматически.
27
+
28
+ Стили core.css необходимо подгрузить на страницу.
29
+
30
+ ```js
31
+ import '@topvisor/ui/core.css';
32
+ ```
33
+
34
+ Стили темы необходимо подгрузить на страницу.
35
+
36
+ Для смены темы необходимо подгрузить файл стилей необходимой темы и сразу отключить стили предыдущей темы.
37
+
38
+ ```js
39
+ import '@topvisor/ui/light.css';
40
+ ```
41
+
42
+ Стили icomoon необходимо подгрузить на страницу.
43
+
44
+ ```js
45
+ import '@topvisor/ui/icomoon/style.css';
46
+ ```
47
+
48
+ ## Подключение компонентов
49
+
50
+ Пример подключения библиотеки Forms и компонента Button:
51
+
52
+ ```javascript
53
+ requirejs(['@topvisor/ui/forms/forms.amd'], ({Button}) => {
54
+ console.log(Button);
55
+ });
56
+
57
+ requirejs(['@topvisor/ui/forms/forms.amd'], Forms => {
58
+ const { Button } = Forms;
59
+
60
+ console.log(Forms);
61
+ console.log(Button);
62
+ });
86
63
  ```
@@ -16,7 +16,6 @@ define(["exports", "vue"], function(exports, vue) {
16
16
  };
17
17
  }
18
18
  });
19
- const icon_vue_vue_type_style_index_0_lang = "";
20
19
  exports.Icon = _sfc_main;
21
20
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
22
21
  });
@@ -1 +1 @@
1
- {"version":3,"file":"common.amd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"common.amd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
@@ -15,7 +15,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
15
15
  };
16
16
  }
17
17
  });
18
- const icon_vue_vue_type_style_index_0_lang = "";
19
18
  export {
20
19
  _sfc_main as Icon
21
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"common.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}