@retailcrm/embed-ui-v1-components 0.4.1-alpha.2 → 0.4.1-alpha.20
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/README.md +13 -1
- package/dist/host.cjs +273 -47
- package/dist/host.d.ts +50 -0
- package/dist/host.js +274 -48
- package/dist/remote.cjs +15 -0
- package/dist/remote.d.ts +32 -0
- package/dist/remote.js +15 -0
- package/package.json +8 -8
- /package/{index.mjs → index.js} +0 -0
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
# `@retailcrm/embed-ui-v1-components`
|
|
2
2
|
|
|
3
|
-
Компоненты UI
|
|
3
|
+
Компоненты UI для использования в расширениях
|
|
4
|
+
|
|
5
|
+
Установка:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i --save @retailcrm/embed-ui-v1-components
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
или
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
yarn add @retailcrm/embed-ui-v1-components
|
|
15
|
+
```
|
package/dist/host.cjs
CHANGED
|
@@ -4,6 +4,14 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
6
|
const vue = require("vue");
|
|
7
|
+
const isURL = (href) => {
|
|
8
|
+
try {
|
|
9
|
+
new URL(href);
|
|
10
|
+
return true;
|
|
11
|
+
} catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
7
15
|
const SHAPE_FLAG_ARRAY_CHILDREN = 16;
|
|
8
16
|
const SHAPE_FLAG_TEXT = 8;
|
|
9
17
|
const inlines = ["b", "i", "span", "strong"];
|
|
@@ -39,20 +47,20 @@ var APPEARANCE$2 = /* @__PURE__ */ ((APPEARANCE2) => {
|
|
|
39
47
|
APPEARANCE2["TERTIARY"] = "tertiary";
|
|
40
48
|
return APPEARANCE2;
|
|
41
49
|
})(APPEARANCE$2 || {});
|
|
42
|
-
var SIZE$
|
|
50
|
+
var SIZE$4 = /* @__PURE__ */ ((SIZE2) => {
|
|
43
51
|
SIZE2["LG"] = "lg";
|
|
44
52
|
SIZE2["MD"] = "md";
|
|
45
53
|
SIZE2["SM"] = "sm";
|
|
46
54
|
SIZE2["XS"] = "xs";
|
|
47
55
|
return SIZE2;
|
|
48
|
-
})(SIZE$
|
|
56
|
+
})(SIZE$4 || {});
|
|
49
57
|
var VARIANT = /* @__PURE__ */ ((VARIANT2) => {
|
|
50
58
|
VARIANT2["DEFAULT"] = "default";
|
|
51
59
|
VARIANT2["SUCCESS"] = "success";
|
|
52
60
|
VARIANT2["DANGER"] = "danger";
|
|
53
61
|
return VARIANT2;
|
|
54
62
|
})(VARIANT || {});
|
|
55
|
-
const _sfc_main$
|
|
63
|
+
const _sfc_main$c = vue.defineComponent({
|
|
56
64
|
props: {
|
|
57
65
|
/** Устанавливает тип кнопки */
|
|
58
66
|
type: {
|
|
@@ -62,7 +70,7 @@ const _sfc_main$9 = vue.defineComponent({
|
|
|
62
70
|
/** Устанавливает атрибут href якоря */
|
|
63
71
|
href: {
|
|
64
72
|
type: null,
|
|
65
|
-
validator: (href) => typeof href === "string" || href === null,
|
|
73
|
+
validator: (href) => typeof href === "string" && isURL(href) || href === null,
|
|
66
74
|
default: null
|
|
67
75
|
},
|
|
68
76
|
/** Регулирует внешний вид кнопки: primary, secondary, tertiary or outlined */
|
|
@@ -78,7 +86,7 @@ const _sfc_main$9 = vue.defineComponent({
|
|
|
78
86
|
/** Размер */
|
|
79
87
|
size: {
|
|
80
88
|
type: String,
|
|
81
|
-
default: SIZE$
|
|
89
|
+
default: SIZE$4.SM
|
|
82
90
|
},
|
|
83
91
|
/** Если кнопка активна */
|
|
84
92
|
active: {
|
|
@@ -153,7 +161,7 @@ var ALIGN = /* @__PURE__ */ ((ALIGN2) => {
|
|
|
153
161
|
ALIGN2["RIGHT"] = "right";
|
|
154
162
|
return ALIGN2;
|
|
155
163
|
})(ALIGN || {});
|
|
156
|
-
const _sfc_main$
|
|
164
|
+
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
157
165
|
__name: "UiError",
|
|
158
166
|
props: {
|
|
159
167
|
/** Тест, разметка ошибки */
|
|
@@ -213,7 +221,7 @@ var APPEARANCE$1 = /* @__PURE__ */ ((APPEARANCE2) => {
|
|
|
213
221
|
APPEARANCE2["TITLE"] = "title";
|
|
214
222
|
return APPEARANCE2;
|
|
215
223
|
})(APPEARANCE$1 || {});
|
|
216
|
-
var SIZE$
|
|
224
|
+
var SIZE$3 = /* @__PURE__ */ ((SIZE2) => {
|
|
217
225
|
SIZE2["ARTICLE"] = "article";
|
|
218
226
|
SIZE2["BODY"] = "body";
|
|
219
227
|
SIZE2["PARAGRAPH"] = "paragraph";
|
|
@@ -222,7 +230,7 @@ var SIZE$2 = /* @__PURE__ */ ((SIZE2) => {
|
|
|
222
230
|
SIZE2["TITLE01"] = "title-01";
|
|
223
231
|
SIZE2["TITLE02"] = "title-02";
|
|
224
232
|
return SIZE2;
|
|
225
|
-
})(SIZE$
|
|
233
|
+
})(SIZE$3 || {});
|
|
226
234
|
const _hoisted_1$5 = ["href", "target"];
|
|
227
235
|
const _hoisted_2$2 = {
|
|
228
236
|
key: 0,
|
|
@@ -232,12 +240,13 @@ const _hoisted_3$2 = {
|
|
|
232
240
|
key: 2,
|
|
233
241
|
class: "ui-v1-link__icon"
|
|
234
242
|
};
|
|
235
|
-
const _sfc_main$
|
|
243
|
+
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
236
244
|
__name: "UiLink",
|
|
237
245
|
props: {
|
|
238
246
|
/** Атрибут ссылки */
|
|
239
247
|
href: {
|
|
240
248
|
type: String,
|
|
249
|
+
validator: (href) => typeof href === "string" && isURL(href),
|
|
241
250
|
default: "javascript:void(0);"
|
|
242
251
|
},
|
|
243
252
|
/**
|
|
@@ -257,8 +266,8 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
257
266
|
/** Размер текста */
|
|
258
267
|
size: {
|
|
259
268
|
type: String,
|
|
260
|
-
validator: (size) => Object.values(SIZE$
|
|
261
|
-
default: SIZE$
|
|
269
|
+
validator: (size) => Object.values(SIZE$3).includes(size),
|
|
270
|
+
default: SIZE$3.BODY
|
|
262
271
|
},
|
|
263
272
|
/** Инвертированный цвет ссылок для тёмного фона */
|
|
264
273
|
light: {
|
|
@@ -309,7 +318,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
309
318
|
};
|
|
310
319
|
}
|
|
311
320
|
});
|
|
312
|
-
const _sfc_main$
|
|
321
|
+
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
313
322
|
__name: "UiTransition",
|
|
314
323
|
props: {
|
|
315
324
|
/** Наименование анимации перехода */
|
|
@@ -337,7 +346,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
337
346
|
};
|
|
338
347
|
}
|
|
339
348
|
});
|
|
340
|
-
const _sfc_main$
|
|
349
|
+
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
341
350
|
__name: "UiLoader",
|
|
342
351
|
props: {
|
|
343
352
|
/** Диаметр (размер) окружности индикатора */
|
|
@@ -369,7 +378,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
369
378
|
},
|
|
370
379
|
setup(__props) {
|
|
371
380
|
return (_ctx, _cache) => {
|
|
372
|
-
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.transition ? _sfc_main$
|
|
381
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.transition ? _sfc_main$9 : "div"), vue.normalizeProps(vue.guardReactiveProps(__props.transition ? {
|
|
373
382
|
appear: true,
|
|
374
383
|
class: "ui-v1-loader-wrapper",
|
|
375
384
|
name: __props.transition
|
|
@@ -1521,7 +1530,7 @@ var PerfectScrollbar$1 = {
|
|
|
1521
1530
|
);
|
|
1522
1531
|
}
|
|
1523
1532
|
};
|
|
1524
|
-
const _sfc_main$
|
|
1533
|
+
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
1525
1534
|
__name: "UiScrollBox",
|
|
1526
1535
|
props: {
|
|
1527
1536
|
/** Наименование тэга-обёртки для нативного скролла */
|
|
@@ -1639,7 +1648,7 @@ function render$2(_ctx, _cache) {
|
|
|
1639
1648
|
}
|
|
1640
1649
|
const IconClear = { render: render$2 };
|
|
1641
1650
|
const ModalInjectKey = Symbol("$embedModal");
|
|
1642
|
-
const plugin = {
|
|
1651
|
+
const plugin$1 = {
|
|
1643
1652
|
install(app, options) {
|
|
1644
1653
|
app.provide(ModalInjectKey, vue.reactive({
|
|
1645
1654
|
container: null,
|
|
@@ -1728,12 +1737,12 @@ var SCROLLING$1 = /* @__PURE__ */ ((SCROLLING2) => {
|
|
|
1728
1737
|
SCROLLING2["NONE"] = "none";
|
|
1729
1738
|
return SCROLLING2;
|
|
1730
1739
|
})(SCROLLING$1 || {});
|
|
1731
|
-
var SIZE$
|
|
1740
|
+
var SIZE$2 = /* @__PURE__ */ ((SIZE2) => {
|
|
1732
1741
|
SIZE2["LG"] = "lg";
|
|
1733
1742
|
SIZE2["SM"] = "sm";
|
|
1734
1743
|
return SIZE2;
|
|
1735
|
-
})(SIZE$
|
|
1736
|
-
const _sfc_main$
|
|
1744
|
+
})(SIZE$2 || {});
|
|
1745
|
+
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
1737
1746
|
__name: "UiModalSidebar",
|
|
1738
1747
|
props: {
|
|
1739
1748
|
/** Атрибут id корневого элемента. Должен быть уникальным на странице */
|
|
@@ -1776,7 +1785,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1776
1785
|
/** Размер панели */
|
|
1777
1786
|
size: {
|
|
1778
1787
|
type: String,
|
|
1779
|
-
default: SIZE$
|
|
1788
|
+
default: SIZE$2.SM
|
|
1780
1789
|
}
|
|
1781
1790
|
},
|
|
1782
1791
|
emits: [
|
|
@@ -1963,7 +1972,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1963
1972
|
}))
|
|
1964
1973
|
]);
|
|
1965
1974
|
};
|
|
1966
|
-
const renderBody = () => props.scrolling === SCROLLING$1.NONE ? vue.h("div", { class: "ui-v1-modal-sidebar__body-fixed" }, renderSlot("default")) : vue.h(_sfc_main$
|
|
1975
|
+
const renderBody = () => props.scrolling === SCROLLING$1.NONE ? vue.h("div", { class: "ui-v1-modal-sidebar__body-fixed" }, renderSlot("default")) : vue.h(_sfc_main$7, {
|
|
1967
1976
|
class: "ui-v1-modal-sidebar__body",
|
|
1968
1977
|
native: props.scrolling === SCROLLING$1.NATIVE,
|
|
1969
1978
|
showOnMac: true,
|
|
@@ -1976,7 +1985,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1976
1985
|
const direction = props.direction;
|
|
1977
1986
|
const size = props.size;
|
|
1978
1987
|
const setVisibility = (visibility2) => () => visibilityOfSidebar.value = visibility2;
|
|
1979
|
-
return vue.h(_sfc_main$
|
|
1988
|
+
return vue.h(_sfc_main$9, {
|
|
1980
1989
|
name: `slide-${direction}`,
|
|
1981
1990
|
onBeforeEnter: setVisibility("showing"),
|
|
1982
1991
|
onAfterEnter: setVisibility("shown"),
|
|
@@ -1989,8 +1998,8 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1989
1998
|
class: {
|
|
1990
1999
|
"ui-v1-modal-sidebar": true,
|
|
1991
2000
|
"ui-v1-modal-sidebar_left": direction === DIRECTION.LEFT,
|
|
1992
|
-
"ui-v1-modal-sidebar_size_sm": size === SIZE$
|
|
1993
|
-
"ui-v1-modal-sidebar_size_lg": size === SIZE$
|
|
2001
|
+
"ui-v1-modal-sidebar_size_sm": size === SIZE$2.SM,
|
|
2002
|
+
"ui-v1-modal-sidebar_size_lg": size === SIZE$2.LG
|
|
1994
2003
|
}
|
|
1995
2004
|
}, [
|
|
1996
2005
|
renderHeader(),
|
|
@@ -2004,7 +2013,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2004
2013
|
const setVisibility = (visibility2) => () => visibilityOfOverlay.value = visibility2;
|
|
2005
2014
|
return !state.attached ? void 0 : vue.h(vue.Teleport, {
|
|
2006
2015
|
to: (globals == null ? void 0 : globals.container) ?? document.body
|
|
2007
|
-
}, vue.h(_sfc_main$
|
|
2016
|
+
}, vue.h(_sfc_main$9, {
|
|
2008
2017
|
name: "fade-2",
|
|
2009
2018
|
onBeforeEnter: setVisibility("showing"),
|
|
2010
2019
|
onAfterEnter: setVisibility("shown"),
|
|
@@ -2041,6 +2050,15 @@ const expect = (value) => ({
|
|
|
2041
2050
|
return Object.values(variants).includes(value);
|
|
2042
2051
|
}
|
|
2043
2052
|
});
|
|
2053
|
+
const without = (obj, exclude) => {
|
|
2054
|
+
const newObj = {};
|
|
2055
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
2056
|
+
if (!exclude.includes(key)) {
|
|
2057
|
+
newObj[key] = value;
|
|
2058
|
+
}
|
|
2059
|
+
});
|
|
2060
|
+
return newObj;
|
|
2061
|
+
};
|
|
2044
2062
|
var APPEARANCE = /* @__PURE__ */ ((APPEARANCE2) => {
|
|
2045
2063
|
APPEARANCE2["ALERT"] = "alert";
|
|
2046
2064
|
APPEARANCE2["DIALOG"] = "dialog";
|
|
@@ -2053,7 +2071,7 @@ var SCROLLING = /* @__PURE__ */ ((SCROLLING2) => {
|
|
|
2053
2071
|
SCROLLING2["NATIVE"] = "native";
|
|
2054
2072
|
return SCROLLING2;
|
|
2055
2073
|
})(SCROLLING || {});
|
|
2056
|
-
const _sfc_main$
|
|
2074
|
+
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
2057
2075
|
__name: "UiModalWindowSurface",
|
|
2058
2076
|
props: {
|
|
2059
2077
|
/** Атрибут id корневого элемента модального окна. Должен быть уникальным на странице */
|
|
@@ -2267,7 +2285,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2267
2285
|
const slots = vue.useSlots();
|
|
2268
2286
|
const renderBody = () => {
|
|
2269
2287
|
const appearance = props.appearance;
|
|
2270
|
-
return vue.h(_sfc_main$
|
|
2288
|
+
return vue.h(_sfc_main$9, {
|
|
2271
2289
|
name: "zoom",
|
|
2272
2290
|
onBeforeEnter: () => visibilityOfBody.value = "showing",
|
|
2273
2291
|
onAfterEnter: () => visibilityOfBody.value = "shown",
|
|
@@ -2292,7 +2310,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2292
2310
|
};
|
|
2293
2311
|
const EmbedModalWindowSurface = () => !state.attached ? void 0 : vue.h(vue.Teleport, {
|
|
2294
2312
|
to: (globals == null ? void 0 : globals.container) ?? document.body
|
|
2295
|
-
}, vue.h(_sfc_main$
|
|
2313
|
+
}, vue.h(_sfc_main$9, {
|
|
2296
2314
|
name: "fade-2",
|
|
2297
2315
|
onBeforeEnter: () => visibilityOfOverlay.value = "showing",
|
|
2298
2316
|
onAfterEnter: () => visibilityOfOverlay.value = "shown",
|
|
@@ -2309,7 +2327,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2309
2327
|
"ui-v1-modal_overlapped": state.overlapped
|
|
2310
2328
|
}],
|
|
2311
2329
|
onClick: onOverlayClick
|
|
2312
|
-
}, vue.h(_sfc_main$
|
|
2330
|
+
}, vue.h(_sfc_main$7, {
|
|
2313
2331
|
class: {
|
|
2314
2332
|
"ui-v1-modal-window-container": true,
|
|
2315
2333
|
"ui-v1-modal-window-container_fullscreen": props.fullscreen,
|
|
@@ -2366,7 +2384,7 @@ const _hoisted_5 = {
|
|
|
2366
2384
|
key: 0,
|
|
2367
2385
|
class: "ui-v1-modal-window__footer-text"
|
|
2368
2386
|
};
|
|
2369
|
-
const _sfc_main$
|
|
2387
|
+
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
2370
2388
|
__name: "UiModalWindow",
|
|
2371
2389
|
props: {
|
|
2372
2390
|
/** Атрибут id корневого элемента модального окна. Должен быть уникальным на странице */
|
|
@@ -2480,7 +2498,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2480
2498
|
});
|
|
2481
2499
|
vue.watch(() => props.opened, toggle);
|
|
2482
2500
|
return (_ctx, _cache) => {
|
|
2483
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
2501
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$5, vue.mergeProps({
|
|
2484
2502
|
id: __props.id,
|
|
2485
2503
|
opened: state.opened,
|
|
2486
2504
|
closable: __props.closable,
|
|
@@ -2537,7 +2555,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2537
2555
|
})
|
|
2538
2556
|
])) : vue.createCommentVNode("", true)
|
|
2539
2557
|
], 2),
|
|
2540
|
-
__props.responsive ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
2558
|
+
__props.responsive ? (vue.openBlock(), vue.createBlock(_sfc_main$7, {
|
|
2541
2559
|
key: 0,
|
|
2542
2560
|
class: "ui-v1-modal-window__content",
|
|
2543
2561
|
"show-on-mac": "",
|
|
@@ -2570,7 +2588,24 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2570
2588
|
};
|
|
2571
2589
|
}
|
|
2572
2590
|
});
|
|
2591
|
+
class VueI18n {
|
|
2592
|
+
constructor(locale = void 0) {
|
|
2593
|
+
__publicField(this, "_state");
|
|
2594
|
+
this._state = vue.reactive({ locale });
|
|
2595
|
+
}
|
|
2596
|
+
get locale() {
|
|
2597
|
+
return this._state.locale;
|
|
2598
|
+
}
|
|
2599
|
+
set locale(locale) {
|
|
2600
|
+
this._state.locale = locale;
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2573
2603
|
const VueI18nInjectKey = Symbol("$embedI18n");
|
|
2604
|
+
const plugin = {
|
|
2605
|
+
install(app, options) {
|
|
2606
|
+
app.provide(VueI18nInjectKey, options instanceof VueI18n ? options : new VueI18n(options == null ? void 0 : options.locale));
|
|
2607
|
+
}
|
|
2608
|
+
};
|
|
2574
2609
|
const _hoisted_1$1 = {
|
|
2575
2610
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2576
2611
|
viewBox: "0 0 24 24"
|
|
@@ -2584,13 +2619,13 @@ function render(_ctx, _cache) {
|
|
|
2584
2619
|
]));
|
|
2585
2620
|
}
|
|
2586
2621
|
const IconPinned = { render };
|
|
2587
|
-
var SIZE = /* @__PURE__ */ ((SIZE2) => {
|
|
2622
|
+
var SIZE$1 = /* @__PURE__ */ ((SIZE2) => {
|
|
2588
2623
|
SIZE2["LG"] = "lg";
|
|
2589
2624
|
SIZE2["MD"] = "md";
|
|
2590
2625
|
SIZE2["SM"] = "sm";
|
|
2591
2626
|
SIZE2["XS"] = "xs";
|
|
2592
2627
|
return SIZE2;
|
|
2593
|
-
})(SIZE || {});
|
|
2628
|
+
})(SIZE$1 || {});
|
|
2594
2629
|
function deltaTransition(el) {
|
|
2595
2630
|
const delta = el.scrollWidth - el.clientWidth;
|
|
2596
2631
|
const animationDuration = `${(el.scrollWidth / el.clientWidth * 2).toFixed(2)}s`;
|
|
@@ -2750,13 +2785,13 @@ const _hoisted_1 = {
|
|
|
2750
2785
|
};
|
|
2751
2786
|
const _hoisted_2 = { class: "ui-v1-tag__content-inner" };
|
|
2752
2787
|
const _hoisted_3 = ["aria-label"];
|
|
2753
|
-
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
2788
|
+
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
2754
2789
|
__name: "UiTag",
|
|
2755
2790
|
props: {
|
|
2756
2791
|
/** Рамер */
|
|
2757
2792
|
size: {
|
|
2758
2793
|
type: String,
|
|
2759
|
-
default: SIZE.LG
|
|
2794
|
+
default: SIZE$1.LG
|
|
2760
2795
|
},
|
|
2761
2796
|
/** Слева выводим иконку закреплённого тега */
|
|
2762
2797
|
pinned: {
|
|
@@ -2843,14 +2878,205 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
2843
2878
|
};
|
|
2844
2879
|
}
|
|
2845
2880
|
});
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2881
|
+
var SIZE = /* @__PURE__ */ ((SIZE2) => {
|
|
2882
|
+
SIZE2["SM"] = "sm";
|
|
2883
|
+
SIZE2["MD"] = "md";
|
|
2884
|
+
return SIZE2;
|
|
2885
|
+
})(SIZE || {});
|
|
2886
|
+
const ToolbarInjectKeys = {
|
|
2887
|
+
size: Symbol("UiToolbarSize")
|
|
2888
|
+
};
|
|
2889
|
+
const useToolbarSize = () => vue.inject(ToolbarInjectKeys.size, vue.computed(
|
|
2890
|
+
() => "sm"
|
|
2891
|
+
/* SM */
|
|
2892
|
+
));
|
|
2893
|
+
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
2894
|
+
...{
|
|
2895
|
+
inheritAttrs: false
|
|
2896
|
+
},
|
|
2897
|
+
__name: "UiToolbar",
|
|
2898
|
+
props: {
|
|
2899
|
+
size: {
|
|
2900
|
+
type: String,
|
|
2901
|
+
default: SIZE.SM
|
|
2902
|
+
}
|
|
2903
|
+
},
|
|
2904
|
+
setup(__props) {
|
|
2905
|
+
const props = __props;
|
|
2906
|
+
vue.provide(ToolbarInjectKeys.size, vue.computed(() => props.size));
|
|
2907
|
+
return (_ctx, _cache) => {
|
|
2908
|
+
return vue.renderSlot(_ctx.$slots, "default");
|
|
2909
|
+
};
|
|
2910
|
+
}
|
|
2911
|
+
});
|
|
2912
|
+
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
2913
|
+
...{
|
|
2914
|
+
inheritAttrs: false
|
|
2915
|
+
},
|
|
2916
|
+
__name: "UiToolbarButton",
|
|
2917
|
+
props: {
|
|
2918
|
+
/** Устанавливает атрибут href якоря */
|
|
2919
|
+
href: {
|
|
2920
|
+
type: null,
|
|
2921
|
+
validator: (href) => typeof href === "string" && isURL(href) || href === null,
|
|
2922
|
+
default: null
|
|
2923
|
+
},
|
|
2924
|
+
/** Регулирует цветовую схему кнопки: default, success or danger */
|
|
2925
|
+
variant: {
|
|
2926
|
+
type: String,
|
|
2927
|
+
default: VARIANT.DEFAULT
|
|
2928
|
+
},
|
|
2929
|
+
/** Если кнопка активна */
|
|
2930
|
+
active: {
|
|
2931
|
+
type: Boolean,
|
|
2932
|
+
default: false
|
|
2933
|
+
},
|
|
2934
|
+
/** Если кнопка отключена */
|
|
2935
|
+
disabled: {
|
|
2936
|
+
type: Boolean,
|
|
2937
|
+
default: false
|
|
2938
|
+
},
|
|
2939
|
+
/** Если кнопка заблокирована */
|
|
2940
|
+
locked: {
|
|
2941
|
+
type: Boolean,
|
|
2942
|
+
default: false
|
|
2943
|
+
}
|
|
2944
|
+
},
|
|
2945
|
+
setup(__props, { expose: __expose }) {
|
|
2946
|
+
const root = vue.ref(null);
|
|
2947
|
+
__expose({
|
|
2948
|
+
click: () => {
|
|
2949
|
+
var _a;
|
|
2950
|
+
return (_a = root.value) == null ? void 0 : _a.click();
|
|
2951
|
+
},
|
|
2952
|
+
focus: () => {
|
|
2953
|
+
var _a;
|
|
2954
|
+
return (_a = root.value) == null ? void 0 : _a.focus();
|
|
2955
|
+
},
|
|
2956
|
+
blur: () => {
|
|
2957
|
+
var _a;
|
|
2958
|
+
return (_a = root.value) == null ? void 0 : _a.blur();
|
|
2959
|
+
}
|
|
2960
|
+
});
|
|
2961
|
+
const toolbarSize = useToolbarSize();
|
|
2962
|
+
const size = vue.computed(() => {
|
|
2963
|
+
if (toolbarSize.value === SIZE.SM) {
|
|
2964
|
+
return SIZE$4.XS;
|
|
2965
|
+
}
|
|
2966
|
+
return SIZE$4.SM;
|
|
2967
|
+
});
|
|
2968
|
+
return (_ctx, _cache) => {
|
|
2969
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$c, vue.mergeProps({
|
|
2970
|
+
ref_key: "root",
|
|
2971
|
+
ref: root,
|
|
2972
|
+
href: __props.href,
|
|
2973
|
+
variant: __props.variant,
|
|
2974
|
+
size: size.value,
|
|
2975
|
+
active: __props.active,
|
|
2976
|
+
disabled: __props.disabled,
|
|
2977
|
+
locked: __props.locked,
|
|
2978
|
+
appearance: "secondary"
|
|
2979
|
+
}, vue.unref(without)(_ctx.$attrs, [
|
|
2980
|
+
"appearance",
|
|
2981
|
+
"class",
|
|
2982
|
+
"style",
|
|
2983
|
+
"type"
|
|
2984
|
+
])), {
|
|
2985
|
+
default: vue.withCtx(() => [
|
|
2986
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
2987
|
+
]),
|
|
2988
|
+
_: 3
|
|
2989
|
+
}, 16, ["href", "variant", "size", "active", "disabled", "locked"]);
|
|
2990
|
+
};
|
|
2991
|
+
}
|
|
2992
|
+
});
|
|
2993
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
2994
|
+
...{
|
|
2995
|
+
inheritAttrs: false
|
|
2996
|
+
},
|
|
2997
|
+
__name: "UiToolbarLink",
|
|
2998
|
+
props: {
|
|
2999
|
+
/** Атрибут ссылки */
|
|
3000
|
+
href: {
|
|
3001
|
+
type: String,
|
|
3002
|
+
validator: (href) => typeof href === "string" && isURL(href),
|
|
3003
|
+
default: "javascript:void(0);"
|
|
3004
|
+
},
|
|
3005
|
+
/**
|
|
3006
|
+
* Определяет, нужно ли открывать ссылку в новой вкладке.
|
|
3007
|
+
* Также добавляется иконка внешней ссылки (если компонент UiIcon установлен)
|
|
3008
|
+
*/
|
|
3009
|
+
external: {
|
|
3010
|
+
type: Boolean,
|
|
3011
|
+
default: false
|
|
3012
|
+
},
|
|
3013
|
+
/** Тип ссылок */
|
|
3014
|
+
appearance: {
|
|
3015
|
+
type: String,
|
|
3016
|
+
validator: (appearance) => Object.values(APPEARANCE$1).includes(appearance),
|
|
3017
|
+
default: APPEARANCE$1.DEFAULT
|
|
3018
|
+
},
|
|
3019
|
+
/** Инвертированный цвет ссылок для тёмного фона */
|
|
3020
|
+
light: {
|
|
3021
|
+
type: Boolean,
|
|
3022
|
+
default: false
|
|
3023
|
+
},
|
|
3024
|
+
/** Жирное начертание */
|
|
3025
|
+
accent: {
|
|
3026
|
+
type: Boolean,
|
|
3027
|
+
default: false
|
|
3028
|
+
},
|
|
3029
|
+
/** Подчеркивание dotted вместо стандартного поведения */
|
|
3030
|
+
dotted: {
|
|
3031
|
+
type: Boolean,
|
|
3032
|
+
default: false
|
|
3033
|
+
},
|
|
3034
|
+
/** Определяет, будет ли текст ошибок обрезаться через многоточие или переноситься на следующую строку */
|
|
3035
|
+
ellipsis: {
|
|
3036
|
+
type: Boolean,
|
|
3037
|
+
default: false
|
|
3038
|
+
}
|
|
3039
|
+
},
|
|
3040
|
+
setup(__props) {
|
|
3041
|
+
return (_ctx, _cache) => {
|
|
3042
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$a, vue.mergeProps({
|
|
3043
|
+
href: __props.href,
|
|
3044
|
+
external: __props.external,
|
|
3045
|
+
appearance: __props.appearance,
|
|
3046
|
+
light: __props.light,
|
|
3047
|
+
accent: __props.accent,
|
|
3048
|
+
dotted: __props.dotted,
|
|
3049
|
+
ellipsis: __props.ellipsis,
|
|
3050
|
+
size: "small"
|
|
3051
|
+
}, vue.unref(without)(_ctx.$attrs, ["class", "style"])), vue.createSlots({
|
|
3052
|
+
default: vue.withCtx(() => [
|
|
3053
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
3054
|
+
]),
|
|
3055
|
+
_: 2
|
|
3056
|
+
}, [
|
|
3057
|
+
_ctx.$slots.icon ? {
|
|
3058
|
+
name: "icon",
|
|
3059
|
+
fn: vue.withCtx(() => [
|
|
3060
|
+
vue.renderSlot(_ctx.$slots, "icon")
|
|
3061
|
+
]),
|
|
3062
|
+
key: "0"
|
|
3063
|
+
} : void 0
|
|
3064
|
+
]), 1040, ["href", "external", "appearance", "light", "accent", "dotted", "ellipsis"]);
|
|
3065
|
+
};
|
|
3066
|
+
}
|
|
3067
|
+
});
|
|
3068
|
+
exports.I18nPlugin = plugin;
|
|
3069
|
+
exports.ModalPlugin = plugin$1;
|
|
3070
|
+
exports.UiButton = _sfc_main$c;
|
|
3071
|
+
exports.UiError = _sfc_main$b;
|
|
3072
|
+
exports.UiLink = _sfc_main$a;
|
|
3073
|
+
exports.UiLoader = _sfc_main$8;
|
|
3074
|
+
exports.UiModalSidebar = _sfc_main$6;
|
|
3075
|
+
exports.UiModalWindow = _sfc_main$4;
|
|
3076
|
+
exports.UiModalWindowSurface = _sfc_main$5;
|
|
3077
|
+
exports.UiScrollBox = _sfc_main$7;
|
|
3078
|
+
exports.UiTag = _sfc_main$3;
|
|
3079
|
+
exports.UiToolbar = _sfc_main$2;
|
|
3080
|
+
exports.UiToolbarButton = _sfc_main$1;
|
|
3081
|
+
exports.UiToolbarLink = _sfc_main;
|
|
3082
|
+
exports.UiTransition = _sfc_main$9;
|
package/dist/host.d.ts
CHANGED
|
@@ -146,6 +146,20 @@ fullscreen: boolean;
|
|
|
146
146
|
responsive: boolean;
|
|
147
147
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
148
148
|
|
|
149
|
+
declare const __VLS_component_2: DefineComponent_2<ExtractPropTypes< {
|
|
150
|
+
size: {
|
|
151
|
+
type: PropType<SIZE_5 | `${SIZE_5}`>;
|
|
152
|
+
default: SIZE_5;
|
|
153
|
+
};
|
|
154
|
+
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
155
|
+
size: {
|
|
156
|
+
type: PropType<SIZE_5 | `${SIZE_5}`>;
|
|
157
|
+
default: SIZE_5;
|
|
158
|
+
};
|
|
159
|
+
}>> & Readonly<{}>, {
|
|
160
|
+
size: "md" | "sm" | SIZE_5;
|
|
161
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
162
|
+
|
|
149
163
|
declare function __VLS_template(): {
|
|
150
164
|
slots: {
|
|
151
165
|
icon?(_: {
|
|
@@ -171,14 +185,30 @@ declare function __VLS_template(): {
|
|
|
171
185
|
attrs: Partial<{}>;
|
|
172
186
|
};
|
|
173
187
|
|
|
188
|
+
declare function __VLS_template_2(): {
|
|
189
|
+
slots: {
|
|
190
|
+
default?(_: {}): any;
|
|
191
|
+
};
|
|
192
|
+
refs: {};
|
|
193
|
+
attrs: Partial<{}>;
|
|
194
|
+
};
|
|
195
|
+
|
|
174
196
|
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
175
197
|
|
|
198
|
+
declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
|
|
199
|
+
|
|
176
200
|
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
177
201
|
new (): {
|
|
178
202
|
$slots: S;
|
|
179
203
|
};
|
|
180
204
|
};
|
|
181
205
|
|
|
206
|
+
declare type __VLS_WithTemplateSlots_2<T, S> = T & {
|
|
207
|
+
new (): {
|
|
208
|
+
$slots: S;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
|
|
182
212
|
declare enum ALIGN {
|
|
183
213
|
LEFT = "left",
|
|
184
214
|
RIGHT = "right"
|
|
@@ -213,6 +243,8 @@ declare enum DIRECTION {
|
|
|
213
243
|
RIGHT = "right"
|
|
214
244
|
}
|
|
215
245
|
|
|
246
|
+
export declare const I18nPlugin: Plugin_2;
|
|
247
|
+
|
|
216
248
|
export declare const ModalPlugin: Plugin_2;
|
|
217
249
|
|
|
218
250
|
declare type Numeric = number | string;
|
|
@@ -259,6 +291,11 @@ declare enum SIZE_4 {
|
|
|
259
291
|
XS = "xs"
|
|
260
292
|
}
|
|
261
293
|
|
|
294
|
+
declare enum SIZE_5 {
|
|
295
|
+
SM = "sm",
|
|
296
|
+
MD = "md"
|
|
297
|
+
}
|
|
298
|
+
|
|
262
299
|
export declare const UiButton: DefineComponent<
|
|
263
300
|
UiButtonProperties,
|
|
264
301
|
UiButtonMethods
|
|
@@ -377,6 +414,19 @@ declare type UiTagProperties = {
|
|
|
377
414
|
ticker?: boolean;
|
|
378
415
|
};
|
|
379
416
|
|
|
417
|
+
export declare const UiToolbar: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
|
|
418
|
+
|
|
419
|
+
export declare const UiToolbarButton: DefineComponent<
|
|
420
|
+
UiToolbarButtonProperties,
|
|
421
|
+
UiButtonMethods
|
|
422
|
+
>;
|
|
423
|
+
|
|
424
|
+
declare type UiToolbarButtonProperties = Omit<UiButtonProperties, 'appearance' | 'size' | 'type'>;
|
|
425
|
+
|
|
426
|
+
export declare const UiToolbarLink: DefineComponent<UiToolbarLinkProperties>;
|
|
427
|
+
|
|
428
|
+
declare type UiToolbarLinkProperties = Omit<UiLinkProperties, 'size'>;
|
|
429
|
+
|
|
380
430
|
export declare const UiTransition: DefineComponent<UiTransitionProps>;
|
|
381
431
|
|
|
382
432
|
declare type UiTransitionProps = {
|