@retailcrm/embed-ui-v1-components 0.4.1-alpha.2 → 0.4.1-alpha.21

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/dist/host.js CHANGED
@@ -1,7 +1,15 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { Text, Comment, defineComponent, ref, h, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createTextVNode, toDisplayString, createElementVNode, mergeProps, createVNode, createCommentVNode, createBlock, Transition, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps, normalizeStyle, reactive, inject, computed, watch, onMounted, onActivated, onDeactivated, onBeforeUnmount, useAttrs, useSlots, Teleport, withDirectives, vShow, toHandlers, withModifiers } from "vue";
4
+ import { Text, Comment, defineComponent, ref, h, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createTextVNode, toDisplayString, createElementVNode, mergeProps, createVNode, createCommentVNode, createBlock, Transition, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps, normalizeStyle, reactive, inject, computed, watch, onMounted, onActivated, onDeactivated, onBeforeUnmount, useAttrs, useSlots, Teleport, withDirectives, vShow, toHandlers, withModifiers, provide, createSlots } from "vue";
5
+ const isURL = (href) => {
6
+ try {
7
+ new URL(href);
8
+ return true;
9
+ } catch {
10
+ return false;
11
+ }
12
+ };
5
13
  const SHAPE_FLAG_ARRAY_CHILDREN = 16;
6
14
  const SHAPE_FLAG_TEXT = 8;
7
15
  const inlines = ["b", "i", "span", "strong"];
@@ -37,20 +45,20 @@ var APPEARANCE$2 = /* @__PURE__ */ ((APPEARANCE2) => {
37
45
  APPEARANCE2["TERTIARY"] = "tertiary";
38
46
  return APPEARANCE2;
39
47
  })(APPEARANCE$2 || {});
40
- var SIZE$3 = /* @__PURE__ */ ((SIZE2) => {
48
+ var SIZE$4 = /* @__PURE__ */ ((SIZE2) => {
41
49
  SIZE2["LG"] = "lg";
42
50
  SIZE2["MD"] = "md";
43
51
  SIZE2["SM"] = "sm";
44
52
  SIZE2["XS"] = "xs";
45
53
  return SIZE2;
46
- })(SIZE$3 || {});
54
+ })(SIZE$4 || {});
47
55
  var VARIANT = /* @__PURE__ */ ((VARIANT2) => {
48
56
  VARIANT2["DEFAULT"] = "default";
49
57
  VARIANT2["SUCCESS"] = "success";
50
58
  VARIANT2["DANGER"] = "danger";
51
59
  return VARIANT2;
52
60
  })(VARIANT || {});
53
- const _sfc_main$9 = defineComponent({
61
+ const _sfc_main$c = defineComponent({
54
62
  props: {
55
63
  /** Устанавливает тип кнопки */
56
64
  type: {
@@ -60,7 +68,7 @@ const _sfc_main$9 = defineComponent({
60
68
  /** Устанавливает атрибут href якоря */
61
69
  href: {
62
70
  type: null,
63
- validator: (href) => typeof href === "string" || href === null,
71
+ validator: (href) => typeof href === "string" && isURL(href) || href === null,
64
72
  default: null
65
73
  },
66
74
  /** Регулирует внешний вид кнопки: primary, secondary, tertiary or outlined */
@@ -76,7 +84,7 @@ const _sfc_main$9 = defineComponent({
76
84
  /** Размер */
77
85
  size: {
78
86
  type: String,
79
- default: SIZE$3.SM
87
+ default: SIZE$4.SM
80
88
  },
81
89
  /** Если кнопка активна */
82
90
  active: {
@@ -151,7 +159,7 @@ var ALIGN = /* @__PURE__ */ ((ALIGN2) => {
151
159
  ALIGN2["RIGHT"] = "right";
152
160
  return ALIGN2;
153
161
  })(ALIGN || {});
154
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
162
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
155
163
  __name: "UiError",
156
164
  props: {
157
165
  /** Тест, разметка ошибки */
@@ -211,7 +219,7 @@ var APPEARANCE$1 = /* @__PURE__ */ ((APPEARANCE2) => {
211
219
  APPEARANCE2["TITLE"] = "title";
212
220
  return APPEARANCE2;
213
221
  })(APPEARANCE$1 || {});
214
- var SIZE$2 = /* @__PURE__ */ ((SIZE2) => {
222
+ var SIZE$3 = /* @__PURE__ */ ((SIZE2) => {
215
223
  SIZE2["ARTICLE"] = "article";
216
224
  SIZE2["BODY"] = "body";
217
225
  SIZE2["PARAGRAPH"] = "paragraph";
@@ -220,7 +228,7 @@ var SIZE$2 = /* @__PURE__ */ ((SIZE2) => {
220
228
  SIZE2["TITLE01"] = "title-01";
221
229
  SIZE2["TITLE02"] = "title-02";
222
230
  return SIZE2;
223
- })(SIZE$2 || {});
231
+ })(SIZE$3 || {});
224
232
  const _hoisted_1$5 = ["href", "target"];
225
233
  const _hoisted_2$2 = {
226
234
  key: 0,
@@ -230,12 +238,13 @@ const _hoisted_3$2 = {
230
238
  key: 2,
231
239
  class: "ui-v1-link__icon"
232
240
  };
233
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
241
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
234
242
  __name: "UiLink",
235
243
  props: {
236
244
  /** Атрибут ссылки */
237
245
  href: {
238
246
  type: String,
247
+ validator: (href) => typeof href === "string" && isURL(href),
239
248
  default: "javascript:void(0);"
240
249
  },
241
250
  /**
@@ -255,8 +264,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
255
264
  /** Размер текста */
256
265
  size: {
257
266
  type: String,
258
- validator: (size) => Object.values(SIZE$2).includes(size),
259
- default: SIZE$2.BODY
267
+ validator: (size) => Object.values(SIZE$3).includes(size),
268
+ default: SIZE$3.BODY
260
269
  },
261
270
  /** Инвертированный цвет ссылок для тёмного фона */
262
271
  light: {
@@ -307,7 +316,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
307
316
  };
308
317
  }
309
318
  });
310
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
319
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
311
320
  __name: "UiTransition",
312
321
  props: {
313
322
  /** Наименование анимации перехода */
@@ -335,7 +344,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
335
344
  };
336
345
  }
337
346
  });
338
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
347
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
339
348
  __name: "UiLoader",
340
349
  props: {
341
350
  /** Диаметр (размер) окружности индикатора */
@@ -367,7 +376,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
367
376
  },
368
377
  setup(__props) {
369
378
  return (_ctx, _cache) => {
370
- return openBlock(), createBlock(resolveDynamicComponent(__props.transition ? _sfc_main$6 : "div"), normalizeProps(guardReactiveProps(__props.transition ? {
379
+ return openBlock(), createBlock(resolveDynamicComponent(__props.transition ? _sfc_main$9 : "div"), normalizeProps(guardReactiveProps(__props.transition ? {
371
380
  appear: true,
372
381
  class: "ui-v1-loader-wrapper",
373
382
  name: __props.transition
@@ -1519,7 +1528,7 @@ var PerfectScrollbar$1 = {
1519
1528
  );
1520
1529
  }
1521
1530
  };
1522
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1531
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1523
1532
  __name: "UiScrollBox",
1524
1533
  props: {
1525
1534
  /** Наименование тэга-обёртки для нативного скролла */
@@ -1637,7 +1646,7 @@ function render$2(_ctx, _cache) {
1637
1646
  }
1638
1647
  const IconClear = { render: render$2 };
1639
1648
  const ModalInjectKey = Symbol("$embedModal");
1640
- const plugin = {
1649
+ const plugin$1 = {
1641
1650
  install(app, options) {
1642
1651
  app.provide(ModalInjectKey, reactive({
1643
1652
  container: null,
@@ -1726,12 +1735,12 @@ var SCROLLING$1 = /* @__PURE__ */ ((SCROLLING2) => {
1726
1735
  SCROLLING2["NONE"] = "none";
1727
1736
  return SCROLLING2;
1728
1737
  })(SCROLLING$1 || {});
1729
- var SIZE$1 = /* @__PURE__ */ ((SIZE2) => {
1738
+ var SIZE$2 = /* @__PURE__ */ ((SIZE2) => {
1730
1739
  SIZE2["LG"] = "lg";
1731
1740
  SIZE2["SM"] = "sm";
1732
1741
  return SIZE2;
1733
- })(SIZE$1 || {});
1734
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1742
+ })(SIZE$2 || {});
1743
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1735
1744
  __name: "UiModalSidebar",
1736
1745
  props: {
1737
1746
  /** Атрибут id корневого элемента. Должен быть уникальным на странице */
@@ -1774,7 +1783,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1774
1783
  /** Размер панели */
1775
1784
  size: {
1776
1785
  type: String,
1777
- default: SIZE$1.SM
1786
+ default: SIZE$2.SM
1778
1787
  }
1779
1788
  },
1780
1789
  emits: [
@@ -1961,7 +1970,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1961
1970
  }))
1962
1971
  ]);
1963
1972
  };
1964
- const renderBody = () => props.scrolling === SCROLLING$1.NONE ? h("div", { class: "ui-v1-modal-sidebar__body-fixed" }, renderSlot2("default")) : h(_sfc_main$4, {
1973
+ const renderBody = () => props.scrolling === SCROLLING$1.NONE ? h("div", { class: "ui-v1-modal-sidebar__body-fixed" }, renderSlot2("default")) : h(_sfc_main$7, {
1965
1974
  class: "ui-v1-modal-sidebar__body",
1966
1975
  native: props.scrolling === SCROLLING$1.NATIVE,
1967
1976
  showOnMac: true,
@@ -1974,7 +1983,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1974
1983
  const direction = props.direction;
1975
1984
  const size = props.size;
1976
1985
  const setVisibility = (visibility2) => () => visibilityOfSidebar.value = visibility2;
1977
- return h(_sfc_main$6, {
1986
+ return h(_sfc_main$9, {
1978
1987
  name: `slide-${direction}`,
1979
1988
  onBeforeEnter: setVisibility("showing"),
1980
1989
  onAfterEnter: setVisibility("shown"),
@@ -1987,8 +1996,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1987
1996
  class: {
1988
1997
  "ui-v1-modal-sidebar": true,
1989
1998
  "ui-v1-modal-sidebar_left": direction === DIRECTION.LEFT,
1990
- "ui-v1-modal-sidebar_size_sm": size === SIZE$1.SM,
1991
- "ui-v1-modal-sidebar_size_lg": size === SIZE$1.LG
1999
+ "ui-v1-modal-sidebar_size_sm": size === SIZE$2.SM,
2000
+ "ui-v1-modal-sidebar_size_lg": size === SIZE$2.LG
1992
2001
  }
1993
2002
  }, [
1994
2003
  renderHeader(),
@@ -2002,7 +2011,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2002
2011
  const setVisibility = (visibility2) => () => visibilityOfOverlay.value = visibility2;
2003
2012
  return !state.attached ? void 0 : h(Teleport, {
2004
2013
  to: (globals == null ? void 0 : globals.container) ?? document.body
2005
- }, h(_sfc_main$6, {
2014
+ }, h(_sfc_main$9, {
2006
2015
  name: "fade-2",
2007
2016
  onBeforeEnter: setVisibility("showing"),
2008
2017
  onAfterEnter: setVisibility("shown"),
@@ -2039,6 +2048,15 @@ const expect = (value) => ({
2039
2048
  return Object.values(variants).includes(value);
2040
2049
  }
2041
2050
  });
2051
+ const without = (obj, exclude) => {
2052
+ const newObj = {};
2053
+ Object.entries(obj).forEach(([key, value]) => {
2054
+ if (!exclude.includes(key)) {
2055
+ newObj[key] = value;
2056
+ }
2057
+ });
2058
+ return newObj;
2059
+ };
2042
2060
  var APPEARANCE = /* @__PURE__ */ ((APPEARANCE2) => {
2043
2061
  APPEARANCE2["ALERT"] = "alert";
2044
2062
  APPEARANCE2["DIALOG"] = "dialog";
@@ -2051,7 +2069,7 @@ var SCROLLING = /* @__PURE__ */ ((SCROLLING2) => {
2051
2069
  SCROLLING2["NATIVE"] = "native";
2052
2070
  return SCROLLING2;
2053
2071
  })(SCROLLING || {});
2054
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2072
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2055
2073
  __name: "UiModalWindowSurface",
2056
2074
  props: {
2057
2075
  /** Атрибут id корневого элемента модального окна. Должен быть уникальным на странице */
@@ -2265,7 +2283,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2265
2283
  const slots = useSlots();
2266
2284
  const renderBody = () => {
2267
2285
  const appearance = props.appearance;
2268
- return h(_sfc_main$6, {
2286
+ return h(_sfc_main$9, {
2269
2287
  name: "zoom",
2270
2288
  onBeforeEnter: () => visibilityOfBody.value = "showing",
2271
2289
  onAfterEnter: () => visibilityOfBody.value = "shown",
@@ -2290,7 +2308,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2290
2308
  };
2291
2309
  const EmbedModalWindowSurface = () => !state.attached ? void 0 : h(Teleport, {
2292
2310
  to: (globals == null ? void 0 : globals.container) ?? document.body
2293
- }, h(_sfc_main$6, {
2311
+ }, h(_sfc_main$9, {
2294
2312
  name: "fade-2",
2295
2313
  onBeforeEnter: () => visibilityOfOverlay.value = "showing",
2296
2314
  onAfterEnter: () => visibilityOfOverlay.value = "shown",
@@ -2307,7 +2325,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2307
2325
  "ui-v1-modal_overlapped": state.overlapped
2308
2326
  }],
2309
2327
  onClick: onOverlayClick
2310
- }, h(_sfc_main$4, {
2328
+ }, h(_sfc_main$7, {
2311
2329
  class: {
2312
2330
  "ui-v1-modal-window-container": true,
2313
2331
  "ui-v1-modal-window-container_fullscreen": props.fullscreen,
@@ -2364,7 +2382,7 @@ const _hoisted_5 = {
2364
2382
  key: 0,
2365
2383
  class: "ui-v1-modal-window__footer-text"
2366
2384
  };
2367
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2385
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2368
2386
  __name: "UiModalWindow",
2369
2387
  props: {
2370
2388
  /** Атрибут id корневого элемента модального окна. Должен быть уникальным на странице */
@@ -2478,7 +2496,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2478
2496
  });
2479
2497
  watch(() => props.opened, toggle);
2480
2498
  return (_ctx, _cache) => {
2481
- return openBlock(), createBlock(_sfc_main$2, mergeProps({
2499
+ return openBlock(), createBlock(_sfc_main$5, mergeProps({
2482
2500
  id: __props.id,
2483
2501
  opened: state.opened,
2484
2502
  closable: __props.closable,
@@ -2535,7 +2553,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2535
2553
  })
2536
2554
  ])) : createCommentVNode("", true)
2537
2555
  ], 2),
2538
- __props.responsive ? (openBlock(), createBlock(_sfc_main$4, {
2556
+ __props.responsive ? (openBlock(), createBlock(_sfc_main$7, {
2539
2557
  key: 0,
2540
2558
  class: "ui-v1-modal-window__content",
2541
2559
  "show-on-mac": "",
@@ -2568,7 +2586,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2568
2586
  };
2569
2587
  }
2570
2588
  });
2571
- const VueI18nInjectKey = Symbol("$embedI18n");
2572
2589
  const _hoisted_1$1 = {
2573
2590
  xmlns: "http://www.w3.org/2000/svg",
2574
2591
  viewBox: "0 0 24 24"
@@ -2582,13 +2599,31 @@ function render(_ctx, _cache) {
2582
2599
  ]));
2583
2600
  }
2584
2601
  const IconPinned = { render };
2585
- var SIZE = /* @__PURE__ */ ((SIZE2) => {
2602
+ class VueI18n {
2603
+ constructor(locale = void 0) {
2604
+ __publicField(this, "_state");
2605
+ this._state = reactive({ locale });
2606
+ }
2607
+ get locale() {
2608
+ return this._state.locale;
2609
+ }
2610
+ set locale(locale) {
2611
+ this._state.locale = locale;
2612
+ }
2613
+ }
2614
+ const I18nInjectKey = Symbol("$embedI18n");
2615
+ const plugin = {
2616
+ install(app, options) {
2617
+ app.provide(I18nInjectKey, options instanceof VueI18n ? options : new VueI18n(options == null ? void 0 : options.locale));
2618
+ }
2619
+ };
2620
+ var SIZE$1 = /* @__PURE__ */ ((SIZE2) => {
2586
2621
  SIZE2["LG"] = "lg";
2587
2622
  SIZE2["MD"] = "md";
2588
2623
  SIZE2["SM"] = "sm";
2589
2624
  SIZE2["XS"] = "xs";
2590
2625
  return SIZE2;
2591
- })(SIZE || {});
2626
+ })(SIZE$1 || {});
2592
2627
  function deltaTransition(el) {
2593
2628
  const delta = el.scrollWidth - el.clientWidth;
2594
2629
  const animationDuration = `${(el.scrollWidth / el.clientWidth * 2).toFixed(2)}s`;
@@ -2748,13 +2783,13 @@ const _hoisted_1 = {
2748
2783
  };
2749
2784
  const _hoisted_2 = { class: "ui-v1-tag__content-inner" };
2750
2785
  const _hoisted_3 = ["aria-label"];
2751
- const _sfc_main = /* @__PURE__ */ defineComponent({
2786
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2752
2787
  __name: "UiTag",
2753
2788
  props: {
2754
2789
  /** Рамер */
2755
2790
  size: {
2756
2791
  type: String,
2757
- default: SIZE.LG
2792
+ default: SIZE$1.LG
2758
2793
  },
2759
2794
  /** Слева выводим иконку закреплённого тега */
2760
2795
  pinned: {
@@ -2790,8 +2825,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2790
2825
  emits: ["remove"],
2791
2826
  setup(__props) {
2792
2827
  const props = __props;
2793
- const vueI18n = inject(VueI18nInjectKey);
2794
- const i18n2 = computed(() => _i18n.init((vueI18n == null ? void 0 : vueI18n.locale) ?? _i18n.fallback, null));
2828
+ const i18nBus = inject(I18nInjectKey);
2829
+ const i18n2 = computed(() => _i18n.init((i18nBus == null ? void 0 : i18nBus.locale) ?? _i18n.fallback, null));
2795
2830
  const textRef = ref(null);
2796
2831
  const textStyle = ref({});
2797
2832
  const onHover = () => {
@@ -2841,16 +2876,208 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2841
2876
  };
2842
2877
  }
2843
2878
  });
2879
+ var SIZE = /* @__PURE__ */ ((SIZE2) => {
2880
+ SIZE2["SM"] = "sm";
2881
+ SIZE2["MD"] = "md";
2882
+ return SIZE2;
2883
+ })(SIZE || {});
2884
+ const ToolbarInjectKeys = {
2885
+ size: Symbol("UiToolbarSize")
2886
+ };
2887
+ const useToolbarSize = () => inject(ToolbarInjectKeys.size, computed(
2888
+ () => "sm"
2889
+ /* SM */
2890
+ ));
2891
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2892
+ ...{
2893
+ inheritAttrs: false
2894
+ },
2895
+ __name: "UiToolbar",
2896
+ props: {
2897
+ size: {
2898
+ type: String,
2899
+ default: SIZE.SM
2900
+ }
2901
+ },
2902
+ setup(__props) {
2903
+ const props = __props;
2904
+ provide(ToolbarInjectKeys.size, computed(() => props.size));
2905
+ return (_ctx, _cache) => {
2906
+ return renderSlot(_ctx.$slots, "default");
2907
+ };
2908
+ }
2909
+ });
2910
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2911
+ ...{
2912
+ inheritAttrs: false
2913
+ },
2914
+ __name: "UiToolbarButton",
2915
+ props: {
2916
+ /** Устанавливает атрибут href якоря */
2917
+ href: {
2918
+ type: null,
2919
+ validator: (href) => typeof href === "string" && isURL(href) || href === null,
2920
+ default: null
2921
+ },
2922
+ /** Регулирует цветовую схему кнопки: default, success or danger */
2923
+ variant: {
2924
+ type: String,
2925
+ default: VARIANT.DEFAULT
2926
+ },
2927
+ /** Если кнопка активна */
2928
+ active: {
2929
+ type: Boolean,
2930
+ default: false
2931
+ },
2932
+ /** Если кнопка отключена */
2933
+ disabled: {
2934
+ type: Boolean,
2935
+ default: false
2936
+ },
2937
+ /** Если кнопка заблокирована */
2938
+ locked: {
2939
+ type: Boolean,
2940
+ default: false
2941
+ }
2942
+ },
2943
+ setup(__props, { expose: __expose }) {
2944
+ const root = ref(null);
2945
+ __expose({
2946
+ click: () => {
2947
+ var _a;
2948
+ return (_a = root.value) == null ? void 0 : _a.click();
2949
+ },
2950
+ focus: () => {
2951
+ var _a;
2952
+ return (_a = root.value) == null ? void 0 : _a.focus();
2953
+ },
2954
+ blur: () => {
2955
+ var _a;
2956
+ return (_a = root.value) == null ? void 0 : _a.blur();
2957
+ }
2958
+ });
2959
+ const toolbarSize = useToolbarSize();
2960
+ const size = computed(() => {
2961
+ if (toolbarSize.value === SIZE.SM) {
2962
+ return SIZE$4.XS;
2963
+ }
2964
+ return SIZE$4.SM;
2965
+ });
2966
+ return (_ctx, _cache) => {
2967
+ return openBlock(), createBlock(_sfc_main$c, mergeProps({
2968
+ ref_key: "root",
2969
+ ref: root,
2970
+ href: __props.href,
2971
+ variant: __props.variant,
2972
+ size: size.value,
2973
+ active: __props.active,
2974
+ disabled: __props.disabled,
2975
+ locked: __props.locked,
2976
+ appearance: "secondary"
2977
+ }, unref(without)(_ctx.$attrs, [
2978
+ "appearance",
2979
+ "class",
2980
+ "style",
2981
+ "type"
2982
+ ])), {
2983
+ default: withCtx(() => [
2984
+ renderSlot(_ctx.$slots, "default")
2985
+ ]),
2986
+ _: 3
2987
+ }, 16, ["href", "variant", "size", "active", "disabled", "locked"]);
2988
+ };
2989
+ }
2990
+ });
2991
+ const _sfc_main = /* @__PURE__ */ defineComponent({
2992
+ ...{
2993
+ inheritAttrs: false
2994
+ },
2995
+ __name: "UiToolbarLink",
2996
+ props: {
2997
+ /** Атрибут ссылки */
2998
+ href: {
2999
+ type: String,
3000
+ validator: (href) => typeof href === "string" && isURL(href),
3001
+ default: "javascript:void(0);"
3002
+ },
3003
+ /**
3004
+ * Определяет, нужно ли открывать ссылку в новой вкладке.
3005
+ * Также добавляется иконка внешней ссылки (если компонент UiIcon установлен)
3006
+ */
3007
+ external: {
3008
+ type: Boolean,
3009
+ default: false
3010
+ },
3011
+ /** Тип ссылок */
3012
+ appearance: {
3013
+ type: String,
3014
+ validator: (appearance) => Object.values(APPEARANCE$1).includes(appearance),
3015
+ default: APPEARANCE$1.DEFAULT
3016
+ },
3017
+ /** Инвертированный цвет ссылок для тёмного фона */
3018
+ light: {
3019
+ type: Boolean,
3020
+ default: false
3021
+ },
3022
+ /** Жирное начертание */
3023
+ accent: {
3024
+ type: Boolean,
3025
+ default: false
3026
+ },
3027
+ /** Подчеркивание dotted вместо стандартного поведения */
3028
+ dotted: {
3029
+ type: Boolean,
3030
+ default: false
3031
+ },
3032
+ /** Определяет, будет ли текст ошибок обрезаться через многоточие или переноситься на следующую строку */
3033
+ ellipsis: {
3034
+ type: Boolean,
3035
+ default: false
3036
+ }
3037
+ },
3038
+ setup(__props) {
3039
+ return (_ctx, _cache) => {
3040
+ return openBlock(), createBlock(_sfc_main$a, mergeProps({
3041
+ href: __props.href,
3042
+ external: __props.external,
3043
+ appearance: __props.appearance,
3044
+ light: __props.light,
3045
+ accent: __props.accent,
3046
+ dotted: __props.dotted,
3047
+ ellipsis: __props.ellipsis,
3048
+ size: "small"
3049
+ }, unref(without)(_ctx.$attrs, ["class", "style"])), createSlots({
3050
+ default: withCtx(() => [
3051
+ renderSlot(_ctx.$slots, "default")
3052
+ ]),
3053
+ _: 2
3054
+ }, [
3055
+ _ctx.$slots.icon ? {
3056
+ name: "icon",
3057
+ fn: withCtx(() => [
3058
+ renderSlot(_ctx.$slots, "icon")
3059
+ ]),
3060
+ key: "0"
3061
+ } : void 0
3062
+ ]), 1040, ["href", "external", "appearance", "light", "accent", "dotted", "ellipsis"]);
3063
+ };
3064
+ }
3065
+ });
2844
3066
  export {
2845
- plugin as ModalPlugin,
2846
- _sfc_main$9 as UiButton,
2847
- _sfc_main$8 as UiError,
2848
- _sfc_main$7 as UiLink,
2849
- _sfc_main$5 as UiLoader,
2850
- _sfc_main$3 as UiModalSidebar,
2851
- _sfc_main$1 as UiModalWindow,
2852
- _sfc_main$2 as UiModalWindowSurface,
2853
- _sfc_main$4 as UiScrollBox,
2854
- _sfc_main as UiTag,
2855
- _sfc_main$6 as UiTransition
3067
+ plugin as I18nPlugin,
3068
+ plugin$1 as ModalPlugin,
3069
+ _sfc_main$c as UiButton,
3070
+ _sfc_main$b as UiError,
3071
+ _sfc_main$a as UiLink,
3072
+ _sfc_main$8 as UiLoader,
3073
+ _sfc_main$6 as UiModalSidebar,
3074
+ _sfc_main$4 as UiModalWindow,
3075
+ _sfc_main$5 as UiModalWindowSurface,
3076
+ _sfc_main$7 as UiScrollBox,
3077
+ _sfc_main$3 as UiTag,
3078
+ _sfc_main$2 as UiToolbar,
3079
+ _sfc_main$1 as UiToolbarButton,
3080
+ _sfc_main as UiToolbarLink,
3081
+ _sfc_main$9 as UiTransition,
3082
+ VueI18n
2856
3083
  };
package/dist/remote.cjs CHANGED
@@ -99,6 +99,7 @@ const UiModalWindow = defineRemoteComponent(
99
99
  "update:opened"
100
100
  ],
101
101
  [
102
+ "icon",
102
103
  "title",
103
104
  "footer"
104
105
  ]
@@ -136,6 +137,16 @@ const UiTag = defineRemoteComponent(
136
137
  UiTagType,
137
138
  ["click", "focus", "blur", "remove"]
138
139
  );
140
+ const UiToolbarButtonType = "UiToolbarButton";
141
+ const UiToolbarButton = defineRemoteComponent(
142
+ UiToolbarButtonType,
143
+ ["click", "focus", "blur"]
144
+ );
145
+ const UiToolbarLinkType = "UiToolbarLink";
146
+ const UiToolbarLink = defineRemoteComponent(
147
+ UiToolbarLinkType,
148
+ ["click", "focus", "blur"]
149
+ );
139
150
  const UiTransitionType = "UiTransition";
140
151
  const UiTransition = defineRemoteComponent(UiTransitionType);
141
152
  exports.UiButton = UiButton;
@@ -156,5 +167,9 @@ exports.UiScrollBox = UiScrollBox;
156
167
  exports.UiScrollBoxType = UiScrollBoxType;
157
168
  exports.UiTag = UiTag;
158
169
  exports.UiTagType = UiTagType;
170
+ exports.UiToolbarButton = UiToolbarButton;
171
+ exports.UiToolbarButtonType = UiToolbarButtonType;
172
+ exports.UiToolbarLink = UiToolbarLink;
173
+ exports.UiToolbarLinkType = UiToolbarLinkType;
159
174
  exports.UiTransition = UiTransition;
160
175
  exports.UiTransitionType = UiTransitionType;
package/dist/remote.d.ts CHANGED
@@ -340,6 +340,38 @@ declare type UiTagProperties = {
340
340
 
341
341
  export declare const UiTagType: SchemaType<"UiTag", RemoteProperties<UiTagProperties>, Record<string, never>>;
342
342
 
343
+ export declare const UiToolbarButton: Component< {
344
+ [x: string]: unknown;
345
+ }, RemoteProperties<UiToolbarButtonProperties>, {
346
+ [x: string]: never;
347
+ }, {
348
+ [x: string]: never;
349
+ }, MethodOptions, {
350
+ click: (event: SerializedEvent) => boolean;
351
+ focus: (event: SerializedFocusEvent) => boolean;
352
+ blur: (event: SerializedEvent) => boolean;
353
+ }>;
354
+
355
+ declare type UiToolbarButtonProperties = Omit<UiButtonProperties, 'appearance' | 'size' | 'type'>;
356
+
357
+ export declare const UiToolbarButtonType: SchemaType<"UiToolbarButton", RemoteProperties<UiToolbarButtonProperties>, RemoteCallable<UiButtonMethods>>;
358
+
359
+ export declare const UiToolbarLink: Component< {
360
+ [x: string]: unknown;
361
+ }, RemoteProperties<UiToolbarLinkProperties>, {
362
+ [x: string]: never;
363
+ }, {
364
+ [x: string]: never;
365
+ }, MethodOptions, {
366
+ click: (event: SerializedEvent) => boolean;
367
+ focus: (event: SerializedFocusEvent) => boolean;
368
+ blur: (event: SerializedEvent) => boolean;
369
+ }>;
370
+
371
+ declare type UiToolbarLinkProperties = Omit<UiLinkProperties, 'size'>;
372
+
373
+ export declare const UiToolbarLinkType: SchemaType<"UiToolbarLink", RemoteProperties<UiToolbarLinkProperties>, Record<string, never>>;
374
+
343
375
  export declare const UiTransition: Component< {
344
376
  [x: string]: unknown;
345
377
  }, RemoteProperties<UiTransitionProps>, {
package/dist/remote.js CHANGED
@@ -97,6 +97,7 @@ const UiModalWindow = defineRemoteComponent(
97
97
  "update:opened"
98
98
  ],
99
99
  [
100
+ "icon",
100
101
  "title",
101
102
  "footer"
102
103
  ]
@@ -134,6 +135,16 @@ const UiTag = defineRemoteComponent(
134
135
  UiTagType,
135
136
  ["click", "focus", "blur", "remove"]
136
137
  );
138
+ const UiToolbarButtonType = "UiToolbarButton";
139
+ const UiToolbarButton = defineRemoteComponent(
140
+ UiToolbarButtonType,
141
+ ["click", "focus", "blur"]
142
+ );
143
+ const UiToolbarLinkType = "UiToolbarLink";
144
+ const UiToolbarLink = defineRemoteComponent(
145
+ UiToolbarLinkType,
146
+ ["click", "focus", "blur"]
147
+ );
137
148
  const UiTransitionType = "UiTransition";
138
149
  const UiTransition = defineRemoteComponent(UiTransitionType);
139
150
  export {
@@ -155,6 +166,10 @@ export {
155
166
  UiScrollBoxType,
156
167
  UiTag,
157
168
  UiTagType,
169
+ UiToolbarButton,
170
+ UiToolbarButtonType,
171
+ UiToolbarLink,
172
+ UiToolbarLinkType,
158
173
  UiTransition,
159
174
  UiTransitionType
160
175
  };