@retailcrm/embed-ui-v1-components 0.9.15 → 0.9.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.
Files changed (70) hide show
  1. package/assets/sprites/map-and-places/navigate.svg +3 -0
  2. package/dist/host.cjs +993 -516
  3. package/dist/host.css +261 -0
  4. package/dist/host.d.ts +222 -112
  5. package/dist/host.js +993 -516
  6. package/dist/remote.cjs +446 -60
  7. package/dist/remote.d.ts +573 -81
  8. package/dist/remote.js +447 -61
  9. package/docs/COMPONENTS.md +3 -0
  10. package/docs/FORMAT.md +19 -0
  11. package/docs/PROFILES.md +2 -0
  12. package/docs/profiles/UiAddButton.yml +12 -0
  13. package/docs/profiles/UiAlert.yml +12 -0
  14. package/docs/profiles/UiAvatar.yml +12 -0
  15. package/docs/profiles/UiAvatarList.yml +12 -0
  16. package/docs/profiles/UiButton.yml +8 -0
  17. package/docs/profiles/UiCalendar.yml +12 -0
  18. package/docs/profiles/UiCheckbox.yml +12 -0
  19. package/docs/profiles/UiCollapse.yml +12 -0
  20. package/docs/profiles/UiCollapseBox.yml +12 -0
  21. package/docs/profiles/UiCollapseGroup.yml +12 -0
  22. package/docs/profiles/UiCopyButton.yml +12 -0
  23. package/docs/profiles/UiDate.yml +12 -0
  24. package/docs/profiles/UiDatePicker.yml +12 -0
  25. package/docs/profiles/UiError.yml +12 -0
  26. package/docs/profiles/UiField.yml +5 -1
  27. package/docs/profiles/UiImage.yml +12 -0
  28. package/docs/profiles/UiInfobox.yml +12 -0
  29. package/docs/profiles/UiLink.yml +12 -0
  30. package/docs/profiles/UiLoader.yml +12 -0
  31. package/docs/profiles/UiMenuItem.yml +12 -0
  32. package/docs/profiles/UiMenuItemGroup.yml +12 -0
  33. package/docs/profiles/UiModalSidebar.yml +12 -0
  34. package/docs/profiles/UiModalWindow.yml +12 -0
  35. package/docs/profiles/UiModalWindowSurface.yml +12 -0
  36. package/docs/profiles/UiNumberStepper.yml +12 -0
  37. package/docs/profiles/UiPageHeader.yml +5 -1
  38. package/docs/profiles/UiPopper.yml +5 -1
  39. package/docs/profiles/UiPopperConnector.yml +6 -0
  40. package/docs/profiles/UiPopperTarget.yml +6 -0
  41. package/docs/profiles/UiRadio.yml +12 -0
  42. package/docs/profiles/UiRadioSwitch.yml +7 -0
  43. package/docs/profiles/UiRadioSwitchOption.yml +8 -0
  44. package/docs/profiles/UiScrollBox.yml +12 -0
  45. package/docs/profiles/UiSelect.yml +9 -0
  46. package/docs/profiles/UiSelectOption.yml +12 -0
  47. package/docs/profiles/UiSelectOptionGroup.yml +12 -0
  48. package/docs/profiles/UiSlider.yml +12 -0
  49. package/docs/profiles/UiSwitch.yml +12 -0
  50. package/docs/profiles/UiTab.yml +5 -0
  51. package/docs/profiles/UiTabGroup.yml +5 -0
  52. package/docs/profiles/UiTable.yml +5 -1
  53. package/docs/profiles/UiTableBodyCell.yml +12 -0
  54. package/docs/profiles/UiTableColumn.yml +12 -0
  55. package/docs/profiles/UiTableFooterButton.yml +12 -0
  56. package/docs/profiles/UiTableFooterSection.yml +12 -0
  57. package/docs/profiles/UiTableHeadCell.yml +12 -0
  58. package/docs/profiles/UiTableSorter.yml +12 -0
  59. package/docs/profiles/UiTag.yml +12 -0
  60. package/docs/profiles/UiTextbox.yml +5 -1
  61. package/docs/profiles/UiTimePicker.yml +12 -0
  62. package/docs/profiles/UiToggleButton.yml +211 -0
  63. package/docs/profiles/UiToggleGroup.yml +211 -0
  64. package/docs/profiles/UiToggleGroupOption.yml +116 -0
  65. package/docs/profiles/UiToolbarButton.yml +12 -0
  66. package/docs/profiles/UiToolbarLink.yml +12 -0
  67. package/docs/profiles/UiTooltip.yml +12 -0
  68. package/docs/profiles/UiTransition.yml +12 -0
  69. package/docs/profiles/UiYandexMap.yml +12 -0
  70. package/package.json +2 -2
package/dist/remote.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineRemoteComponent, defineRemoteMethod, withKeys, withModifiers, nextTick, createRemoteRoot } from "@omnicajs/vue-remote/remote";
2
- import { openBlock, createElementBlock, createElementVNode, defineComponent, mergeProps, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, unref, withCtx, useTemplateRef, ref, computed, watch, createBlock, inject, useSlots, onBeforeMount, onBeforeUnmount, Fragment, provide, renderList, createSlots, isVNode, Comment, Text, getCurrentInstance, h, reactive, onMounted } from "vue";
2
+ import { openBlock, createElementBlock, createElementVNode, defineComponent, mergeProps, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, unref, withCtx, useTemplateRef, ref, computed, watch, createBlock, inject, onBeforeMount, onBeforeUnmount, Fragment, provide, renderList, createSlots, isVNode, Comment, Text, getCurrentInstance, h, reactive, onMounted } from "vue";
3
3
  import isEqual from "lodash.isequal";
4
4
  import { preview } from "@retailcrm/image-preview";
5
5
  import { ru, es, enGB } from "date-fns/locale";
@@ -161,7 +161,7 @@ const _hoisted_5$1 = {
161
161
  class: "ui-v1-field__addon"
162
162
  };
163
163
  const _hoisted_6 = { class: "ui-v1-field__control" };
164
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
164
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
165
165
  ...{
166
166
  inheritAttrs: false
167
167
  },
@@ -411,7 +411,7 @@ const _hoisted_3$2 = {
411
411
  key: 0,
412
412
  class: "ui-v1-page-header__actions"
413
413
  };
414
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
414
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
415
415
  ...{
416
416
  inheritAttrs: false
417
417
  },
@@ -573,27 +573,27 @@ function render$1(_ctx, _cache) {
573
573
  ])]);
574
574
  }
575
575
  const IconCheckmarkCircle = { render: render$1 };
576
- var APPEARANCE = /* @__PURE__ */ ((APPEARANCE2) => {
576
+ var APPEARANCE$1 = /* @__PURE__ */ ((APPEARANCE2) => {
577
577
  APPEARANCE2["DEFAULT"] = "default";
578
578
  APPEARANCE2["SECTION"] = "section";
579
579
  return APPEARANCE2;
580
- })(APPEARANCE || {});
581
- var SIZE$2 = /* @__PURE__ */ ((SIZE2) => {
580
+ })(APPEARANCE$1 || {});
581
+ var SIZE$3 = /* @__PURE__ */ ((SIZE2) => {
582
582
  SIZE2["SM"] = "sm";
583
583
  SIZE2["MD"] = "md";
584
584
  SIZE2["LG"] = "lg";
585
585
  return SIZE2;
586
- })(SIZE$2 || {});
586
+ })(SIZE$3 || {});
587
587
  const AppearanceKey = Symbol("UiRadioSwitchAppearance");
588
- const SizeKey = Symbol("UiRadioSwitchSize");
589
- const RegistryKey = Symbol("UiRadioSwitchRegistry");
588
+ const SizeKey$1 = Symbol("UiRadioSwitchSize");
589
+ const RegistryKey$1 = Symbol("UiRadioSwitchRegistry");
590
590
  const UpdateKey = Symbol("UiRadioSwitchUpdate");
591
- const FocusableIdKey = Symbol("UiRadioSwitchFocusableId");
592
- const SetFocusableIdKey = Symbol("UiRadioSwitchSetFocusableId");
593
- const MoveFocusKey = Symbol("UiRadioSwitchMoveFocus");
594
- const useAppearance = () => inject(AppearanceKey, computed(() => APPEARANCE.DEFAULT));
595
- const useSize = () => inject(SizeKey, computed(() => SIZE$2.MD));
596
- const useRegistry = () => inject(RegistryKey, {
591
+ const FocusableIdKey$1 = Symbol("UiRadioSwitchFocusableId");
592
+ const SetFocusableIdKey$1 = Symbol("UiRadioSwitchSetFocusableId");
593
+ const MoveFocusKey$1 = Symbol("UiRadioSwitchMoveFocus");
594
+ const useAppearance = () => inject(AppearanceKey, computed(() => APPEARANCE$1.DEFAULT));
595
+ const useSize$1 = () => inject(SizeKey$1, computed(() => SIZE$3.MD));
596
+ const useRegistry$1 = () => inject(RegistryKey$1, {
597
597
  register: () => {
598
598
  },
599
599
  unregister: () => {
@@ -601,10 +601,10 @@ const useRegistry = () => inject(RegistryKey, {
601
601
  });
602
602
  const useUpdate = () => inject(UpdateKey, () => {
603
603
  });
604
- const useFocusableId = () => inject(FocusableIdKey, computed(() => null));
605
- const useSetFocusableId = () => inject(SetFocusableIdKey, () => {
604
+ const useFocusableId$1 = () => inject(FocusableIdKey$1, computed(() => null));
605
+ const useSetFocusableId$1 = () => inject(SetFocusableIdKey$1, () => {
606
606
  });
607
- const useMoveFocus = () => inject(MoveFocusKey, () => {
607
+ const useMoveFocus$1 = () => inject(MoveFocusKey$1, () => {
608
608
  });
609
609
  const UiRadioSwitchRootType = "UiRadioSwitchRoot";
610
610
  const UiRadioSwitchRoot = defineRemoteComponent(UiRadioSwitchRootType);
@@ -638,10 +638,10 @@ const _hoisted_5 = {
638
638
  key: 1,
639
639
  class: "ui-v1-radio-switch-option__done"
640
640
  };
641
- let counter$1 = 0;
642
- const __default__ = {};
643
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
644
- ...__default__,
641
+ let counter$2 = 0;
642
+ const __default__$1 = {};
643
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
644
+ ...__default__$1,
645
645
  ...{
646
646
  inheritAttrs: false
647
647
  },
@@ -650,7 +650,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
650
650
  /** Идентификатор */
651
651
  id: {
652
652
  type: String,
653
- default: () => "ui-v1-radio-switch-option-" + ++counter$1
653
+ default: () => "ui-v1-radio-switch-option-" + ++counter$2
654
654
  },
655
655
  /** Заголовок */
656
656
  label: {
@@ -675,14 +675,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
675
675
  },
676
676
  setup(__props) {
677
677
  const props = __props;
678
- const slots = useSlots();
679
678
  const appearance = useAppearance();
680
- const focusableId = useFocusableId();
681
- const moveFocus = useMoveFocus();
679
+ const focusableId = useFocusableId$1();
680
+ const moveFocus = useMoveFocus$1();
682
681
  const shell = useTemplateRef("shell");
683
- const size = useSize();
684
- const registry = useRegistry();
685
- const setFocusableId = useSetFocusableId();
682
+ const size = useSize$1();
683
+ const registry = useRegistry$1();
684
+ const setFocusableId = useSetFocusableId$1();
686
685
  const update = useUpdate();
687
686
  const checked = ref(false);
688
687
  const tabIndex = computed(() => {
@@ -763,17 +762,17 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
763
762
  default: withCtx(() => [
764
763
  renderSlot(_ctx.$slots, "default", {}, () => [
765
764
  createElementVNode("div", _hoisted_1$3, [
766
- "icon" in unref(slots) ? (openBlock(), createElementBlock("span", _hoisted_2$1, [
765
+ _ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_2$1, [
767
766
  renderSlot(_ctx.$slots, "icon")
768
767
  ])) : createCommentVNode("", true),
769
- "label" in unref(slots) || __props.label ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
768
+ _ctx.$slots.label || __props.label ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
770
769
  renderSlot(_ctx.$slots, "label", {}, () => [
771
770
  createTextVNode(toDisplayString(__props.label), 1)
772
771
  ])
773
772
  ])) : createCommentVNode("", true)
774
773
  ]),
775
- unref(appearance) === unref(APPEARANCE).SECTION ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
776
- "description" in unref(slots) || __props.description ? (openBlock(), createElementBlock("div", _hoisted_4, [
774
+ unref(appearance) === unref(APPEARANCE$1).SECTION ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
775
+ _ctx.$slots.description || __props.description ? (openBlock(), createElementBlock("div", _hoisted_4, [
777
776
  renderSlot(_ctx.$slots, "description", {}, () => [
778
777
  createTextVNode(toDisplayString(__props.description), 1)
779
778
  ])
@@ -791,7 +790,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
791
790
  };
792
791
  }
793
792
  });
794
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
793
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
795
794
  ...{
796
795
  inheritAttrs: false
797
796
  },
@@ -815,14 +814,14 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
815
814
  /** Внешний вид */
816
815
  appearance: {
817
816
  type: String,
818
- default: APPEARANCE.DEFAULT,
819
- validator: (appearance) => Object.values(APPEARANCE).includes(appearance)
817
+ default: APPEARANCE$1.DEFAULT,
818
+ validator: (appearance) => Object.values(APPEARANCE$1).includes(appearance)
820
819
  },
821
820
  /** Размер */
822
821
  size: {
823
822
  type: String,
824
- default: SIZE$2.MD,
825
- validator: (size) => Object.values(SIZE$2).includes(size)
823
+ default: SIZE$3.MD,
824
+ validator: (size) => Object.values(SIZE$3).includes(size)
826
825
  },
827
826
  /** Растягивание контейнера в зависимости от контента */
828
827
  rubber: {
@@ -853,12 +852,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
853
852
  focusableId.value = selectedEntry?.[0] ?? enabledEntries[0]?.[0] ?? null;
854
853
  };
855
854
  provide(AppearanceKey, computed(() => props.appearance));
856
- provide(FocusableIdKey, computed(() => focusableId.value));
857
- provide(SizeKey, computed(() => props.size));
858
- provide(SetFocusableIdKey, (id) => {
855
+ provide(FocusableIdKey$1, computed(() => focusableId.value));
856
+ provide(SizeKey$1, computed(() => props.size));
857
+ provide(SetFocusableIdKey$1, (id) => {
859
858
  syncFocusableId(id);
860
859
  });
861
- provide(RegistryKey, {
860
+ provide(RegistryKey$1, {
862
861
  register: (id, option) => {
863
862
  if (registry.has(id)) {
864
863
  return;
@@ -878,7 +877,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
878
877
  emit("change", newValue);
879
878
  emit("update:value", newValue);
880
879
  });
881
- provide(MoveFocusKey, async (id, direction) => {
880
+ provide(MoveFocusKey$1, async (id, direction) => {
882
881
  const enabledEntries = getEnabledEntries();
883
882
  if (!enabledEntries.length) {
884
883
  focusableId.value = null;
@@ -925,7 +924,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
925
924
  default: withCtx(() => [
926
925
  renderSlot(_ctx.$slots, "default", {}, () => [
927
926
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
928
- return openBlock(), createBlock(_sfc_main$7, {
927
+ return openBlock(), createBlock(_sfc_main$9, {
929
928
  key: `${option.label}-${index}`,
930
929
  label: option.label,
931
930
  value: option.value,
@@ -1014,7 +1013,7 @@ const byRowKey = (key) => {
1014
1013
  };
1015
1014
  const asRowClass = (value) => value;
1016
1015
  const asRowAttrs = (value) => value;
1017
- const _sfc_main$5 = defineComponent({
1016
+ const _sfc_main$7 = defineComponent({
1018
1017
  name: "UiTableColumn",
1019
1018
  props: {
1020
1019
  label: {
@@ -1094,7 +1093,7 @@ const isNamedComponent = (node, name) => {
1094
1093
  return "name" in node.type && node.type.name === name;
1095
1094
  };
1096
1095
  const isTableColumnVNode = (node) => {
1097
- return node.type === _sfc_main$5 || isNamedComponent(node, "UiTableColumn");
1096
+ return node.type === _sfc_main$7 || isNamedComponent(node, "UiTableColumn");
1098
1097
  };
1099
1098
  const isWhitespaceText = (value) => value.trim().length === 0;
1100
1099
  const normalizeNodes = (children) => {
@@ -1299,7 +1298,7 @@ const withoutClass = (attrs) => {
1299
1298
  delete next.class;
1300
1299
  return next;
1301
1300
  };
1302
- const _sfc_main$4 = defineComponent({
1301
+ const _sfc_main$6 = defineComponent({
1303
1302
  name: "UiTable",
1304
1303
  inheritAttrs: false,
1305
1304
  props: {
@@ -1568,14 +1567,14 @@ const UiTag = defineRemoteComponent(
1568
1567
  UiTagType,
1569
1568
  ["click", "focus", "blur", "remove"]
1570
1569
  );
1571
- var SIZE$1 = /* @__PURE__ */ ((SIZE2) => {
1570
+ var SIZE$2 = /* @__PURE__ */ ((SIZE2) => {
1572
1571
  SIZE2["XS"] = "xs";
1573
1572
  SIZE2["SM"] = "sm";
1574
1573
  SIZE2["MD"] = "md";
1575
1574
  SIZE2["LG"] = "lg";
1576
1575
  SIZE2["XL"] = "xl";
1577
1576
  return SIZE2;
1578
- })(SIZE$1 || {});
1577
+ })(SIZE$2 || {});
1579
1578
  const events = [
1580
1579
  "input",
1581
1580
  "keydown",
@@ -1615,6 +1614,371 @@ const UiTimePicker = defineRemoteComponent(UiTimePickerType, {
1615
1614
  focus: defineRemoteMethod()
1616
1615
  }
1617
1616
  });
1617
+ const UiToggleButtonType = "UiToggleButton";
1618
+ const UiToggleButton = defineRemoteComponent(
1619
+ UiToggleButtonType,
1620
+ {
1621
+ emits: [
1622
+ "click",
1623
+ "focus",
1624
+ "blur",
1625
+ "keydown"
1626
+ ],
1627
+ methods: {
1628
+ focus: defineRemoteMethod(),
1629
+ blur: defineRemoteMethod(),
1630
+ click: defineRemoteMethod()
1631
+ }
1632
+ }
1633
+ );
1634
+ var UiToggleButtonSize = /* @__PURE__ */ ((UiToggleButtonSize2) => {
1635
+ UiToggleButtonSize2["LG"] = "lg";
1636
+ UiToggleButtonSize2["MD"] = "md";
1637
+ UiToggleButtonSize2["SM"] = "sm";
1638
+ UiToggleButtonSize2["XS"] = "xs";
1639
+ return UiToggleButtonSize2;
1640
+ })(UiToggleButtonSize || {});
1641
+ const FocusableIdKey = Symbol("UiToggleGroupFocusableId");
1642
+ const MoveFocusKey = Symbol("UiToggleGroupMoveFocus");
1643
+ const RegistryKey = Symbol("UiToggleGroupRegistry");
1644
+ const SetFocusableIdKey = Symbol("UiToggleGroupSetFocusableId");
1645
+ const SizeKey = Symbol("UiToggleGroupSize");
1646
+ const DisabledKey = Symbol("UiToggleGroupDisabled");
1647
+ const ToggleKey$1 = Symbol("UiToggleGroupToggle");
1648
+ const useFocusableId = () => inject(FocusableIdKey, computed(() => null));
1649
+ const useMoveFocus = () => inject(MoveFocusKey, () => {
1650
+ });
1651
+ const useRegistry = () => inject(RegistryKey, {
1652
+ register: () => {
1653
+ },
1654
+ unregister: () => {
1655
+ }
1656
+ });
1657
+ const useSetFocusableId = () => inject(SetFocusableIdKey, () => {
1658
+ });
1659
+ const useSize = () => inject(SizeKey, computed(() => UiToggleButtonSize.SM));
1660
+ const useDisabled = () => inject(DisabledKey, computed(() => false));
1661
+ const useToggle = () => inject(ToggleKey$1, () => {
1662
+ });
1663
+ let counter$1 = 0;
1664
+ const __default__ = {};
1665
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1666
+ ...__default__,
1667
+ ...{
1668
+ inheritAttrs: false
1669
+ },
1670
+ __name: "UiToggleGroupOption",
1671
+ props: {
1672
+ id: {
1673
+ type: String,
1674
+ default: () => "ui-v1-toggle-group-option-" + ++counter$1
1675
+ },
1676
+ label: {
1677
+ type: String,
1678
+ default: ""
1679
+ },
1680
+ value: {
1681
+ type: null,
1682
+ required: true
1683
+ },
1684
+ disabled: {
1685
+ type: Boolean,
1686
+ default: false
1687
+ }
1688
+ },
1689
+ setup(__props) {
1690
+ const props = __props;
1691
+ const button = useTemplateRef("button");
1692
+ const groupDisabled = useDisabled();
1693
+ const focusableId = useFocusableId();
1694
+ const moveFocus = useMoveFocus();
1695
+ const registry = useRegistry();
1696
+ const setFocusableId = useSetFocusableId();
1697
+ const size = useSize();
1698
+ const toggle = useToggle();
1699
+ const focused = ref(false);
1700
+ const disabled = computed(() => groupDisabled.value || props.disabled);
1701
+ const pressed = ref(false);
1702
+ const tabIndex = computed(() => {
1703
+ return !disabled.value && focusableId.value === props.id ? 0 : -1;
1704
+ });
1705
+ const onClick = () => {
1706
+ if (disabled.value) {
1707
+ return;
1708
+ }
1709
+ setFocusableId(props.id);
1710
+ toggle(props.value);
1711
+ };
1712
+ const onFocus = () => {
1713
+ if (!disabled.value) {
1714
+ focused.value = true;
1715
+ setFocusableId(props.id);
1716
+ }
1717
+ };
1718
+ const onBlur = () => {
1719
+ focused.value = false;
1720
+ };
1721
+ const onKeyDown = (event) => {
1722
+ if (disabled.value) {
1723
+ return;
1724
+ }
1725
+ switch (event.key) {
1726
+ case " ":
1727
+ case "Enter":
1728
+ setFocusableId(props.id);
1729
+ toggle(props.value);
1730
+ return;
1731
+ case "ArrowDown":
1732
+ case "ArrowRight":
1733
+ void moveFocus(props.id, "next");
1734
+ return;
1735
+ case "ArrowUp":
1736
+ case "ArrowLeft":
1737
+ void moveFocus(props.id, "prev");
1738
+ return;
1739
+ case "Home":
1740
+ void moveFocus(props.id, "first");
1741
+ return;
1742
+ case "End":
1743
+ void moveFocus(props.id, "last");
1744
+ return;
1745
+ }
1746
+ };
1747
+ onBeforeMount(() => {
1748
+ registry.register(props.id, {
1749
+ getValue: () => props.value,
1750
+ pressed,
1751
+ disabled: () => disabled.value,
1752
+ focus: () => button.value?.focus()
1753
+ });
1754
+ });
1755
+ onBeforeUnmount(() => {
1756
+ registry.unregister(props.id);
1757
+ });
1758
+ return (_ctx, _cache) => {
1759
+ return openBlock(), createBlock(unref(UiToggleButton), mergeProps({
1760
+ id: __props.id,
1761
+ ref_key: "button",
1762
+ ref: button,
1763
+ size: unref(size),
1764
+ pressed: pressed.value,
1765
+ disabled: disabled.value,
1766
+ focused: focused.value,
1767
+ grouped: true,
1768
+ tabindex: tabIndex.value,
1769
+ role: "checkbox",
1770
+ "aria-checked": `${pressed.value}`,
1771
+ "aria-disabled": `${disabled.value}`
1772
+ }, _ctx.$attrs, {
1773
+ onClick,
1774
+ onFocus,
1775
+ onBlur,
1776
+ onKeydown: [
1777
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["space"]),
1778
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["enter"]),
1779
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["left"]),
1780
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["right"]),
1781
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["up"]),
1782
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["down"]),
1783
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["home"]),
1784
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["end"])
1785
+ ]
1786
+ }), {
1787
+ default: withCtx(() => [
1788
+ renderSlot(_ctx.$slots, "default", {}, () => [
1789
+ _ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", { key: 0 }) : createCommentVNode("", true),
1790
+ _ctx.$slots.label || __props.label ? renderSlot(_ctx.$slots, "label", { key: 1 }, () => [
1791
+ createTextVNode(toDisplayString(__props.label), 1)
1792
+ ]) : createCommentVNode("", true)
1793
+ ])
1794
+ ]),
1795
+ _: 3
1796
+ }, 16, ["id", "size", "pressed", "disabled", "focused", "tabindex", "aria-checked", "aria-disabled", "onKeydown"]);
1797
+ };
1798
+ }
1799
+ });
1800
+ const UiToggleGroupRootType = "UiToggleGroupRoot";
1801
+ const UiToggleGroupRoot = defineRemoteComponent(UiToggleGroupRootType);
1802
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1803
+ ...{
1804
+ inheritAttrs: false
1805
+ },
1806
+ __name: "UiToggleGroup",
1807
+ props: {
1808
+ model: {
1809
+ type: Array,
1810
+ default: () => []
1811
+ },
1812
+ options: {
1813
+ type: Array,
1814
+ default: () => []
1815
+ },
1816
+ equalFn: {
1817
+ type: Function,
1818
+ default: (a, b) => a === b
1819
+ },
1820
+ size: {
1821
+ type: String,
1822
+ default: UiToggleButtonSize.SM,
1823
+ validator: (size) => {
1824
+ return Object.values(UiToggleButtonSize).includes(size);
1825
+ }
1826
+ },
1827
+ rubber: {
1828
+ type: Boolean,
1829
+ default: false
1830
+ },
1831
+ disabled: {
1832
+ type: Boolean,
1833
+ default: false
1834
+ },
1835
+ ariaLabel: {
1836
+ type: String,
1837
+ default: void 0
1838
+ },
1839
+ ariaLabelledby: {
1840
+ type: String,
1841
+ default: void 0
1842
+ },
1843
+ ariaDescribedby: {
1844
+ type: String,
1845
+ default: void 0
1846
+ },
1847
+ ariaOrientation: {
1848
+ type: String,
1849
+ default: "horizontal"
1850
+ }
1851
+ },
1852
+ emits: ["change", "update:model"],
1853
+ setup(__props, { emit: __emit }) {
1854
+ const props = __props;
1855
+ const emit = __emit;
1856
+ const registry = /* @__PURE__ */ new Map();
1857
+ const focusableId = ref(null);
1858
+ const isPressed = (value) => {
1859
+ return props.model.some((entry) => props.equalFn(entry, value));
1860
+ };
1861
+ const getEnabledEntries = () => {
1862
+ return Array.from(registry.entries()).filter(([, option]) => !option.disabled());
1863
+ };
1864
+ const syncFocusableId = (preferredId) => {
1865
+ const enabledEntries = getEnabledEntries();
1866
+ const enabledIds = new Set(enabledEntries.map(([id]) => id));
1867
+ const pressedEntry = enabledEntries.find(([, option]) => option.pressed.value);
1868
+ if (preferredId && enabledIds.has(preferredId)) {
1869
+ focusableId.value = preferredId;
1870
+ return;
1871
+ }
1872
+ if (focusableId.value && enabledIds.has(focusableId.value)) {
1873
+ return;
1874
+ }
1875
+ focusableId.value = pressedEntry?.[0] ?? enabledEntries[0]?.[0] ?? null;
1876
+ };
1877
+ const updatePressedStates = () => {
1878
+ Array.from(registry.values()).forEach((option) => {
1879
+ option.pressed.value = isPressed(option.getValue());
1880
+ });
1881
+ };
1882
+ provide(FocusableIdKey, computed(() => focusableId.value));
1883
+ provide(DisabledKey, computed(() => props.disabled));
1884
+ provide(SizeKey, computed(() => props.size));
1885
+ provide(SetFocusableIdKey, (id) => {
1886
+ syncFocusableId(id);
1887
+ });
1888
+ provide(RegistryKey, {
1889
+ register: (id, option) => {
1890
+ if (registry.has(id)) {
1891
+ return;
1892
+ }
1893
+ option.pressed.value = isPressed(option.getValue());
1894
+ registry.set(id, option);
1895
+ syncFocusableId(option.pressed.value ? id : focusableId.value);
1896
+ },
1897
+ unregister: (id) => {
1898
+ registry.delete(id);
1899
+ if (focusableId.value === id) {
1900
+ syncFocusableId();
1901
+ }
1902
+ }
1903
+ });
1904
+ provide(ToggleKey$1, (value) => {
1905
+ if (props.disabled) {
1906
+ return;
1907
+ }
1908
+ const nextModel = isPressed(value) ? props.model.filter((entry) => !props.equalFn(entry, value)) : [...props.model, value];
1909
+ emit("change", nextModel);
1910
+ emit("update:model", nextModel);
1911
+ });
1912
+ provide(MoveFocusKey, async (id, direction) => {
1913
+ const enabledEntries = getEnabledEntries();
1914
+ if (!enabledEntries.length) {
1915
+ focusableId.value = null;
1916
+ return;
1917
+ }
1918
+ let targetEntry = enabledEntries[0];
1919
+ if (direction === "first") {
1920
+ targetEntry = enabledEntries[0];
1921
+ } else if (direction === "last") {
1922
+ targetEntry = enabledEntries.at(-1) ?? enabledEntries[0];
1923
+ } else {
1924
+ const currentIndex = enabledEntries.findIndex(([entryId]) => entryId === id);
1925
+ const fallbackIndex = focusableId.value ? enabledEntries.findIndex(([entryId]) => entryId === focusableId.value) : -1;
1926
+ const baseIndex = currentIndex === -1 ? Math.max(fallbackIndex, 0) : currentIndex;
1927
+ const offset = direction === "next" ? 1 : -1;
1928
+ const nextIndex = (baseIndex + offset + enabledEntries.length) % enabledEntries.length;
1929
+ targetEntry = enabledEntries[nextIndex] ?? enabledEntries[0];
1930
+ }
1931
+ if (!targetEntry) {
1932
+ return;
1933
+ }
1934
+ const [targetId, target] = targetEntry;
1935
+ focusableId.value = targetId;
1936
+ await target.focus();
1937
+ });
1938
+ watch([() => props.model, () => props.equalFn], () => {
1939
+ updatePressedStates();
1940
+ syncFocusableId();
1941
+ }, {
1942
+ deep: true
1943
+ });
1944
+ watch(() => props.disabled, () => {
1945
+ syncFocusableId();
1946
+ });
1947
+ return (_ctx, _cache) => {
1948
+ return openBlock(), createBlock(unref(UiToggleGroupRoot), mergeProps({
1949
+ size: __props.size,
1950
+ rubber: __props.rubber,
1951
+ disabled: __props.disabled,
1952
+ "aria-label": props.ariaLabel,
1953
+ "aria-labelledby": props.ariaLabelledby,
1954
+ "aria-describedby": props.ariaDescribedby,
1955
+ "aria-orientation": props.ariaOrientation
1956
+ }, _ctx.$attrs), {
1957
+ default: withCtx(() => [
1958
+ renderSlot(_ctx.$slots, "default", {}, () => [
1959
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
1960
+ return openBlock(), createBlock(_sfc_main$5, {
1961
+ key: `${option.label}-${index}`,
1962
+ label: option.label,
1963
+ value: option.value,
1964
+ disabled: option.disabled
1965
+ }, createSlots({ _: 2 }, [
1966
+ _ctx.$slots.icon ? {
1967
+ name: "icon",
1968
+ fn: withCtx(() => [
1969
+ renderSlot(_ctx.$slots, "icon", { option })
1970
+ ]),
1971
+ key: "0"
1972
+ } : void 0
1973
+ ]), 1032, ["label", "value", "disabled"]);
1974
+ }), 128))
1975
+ ])
1976
+ ]),
1977
+ _: 3
1978
+ }, 16, ["size", "rubber", "disabled", "aria-label", "aria-labelledby", "aria-describedby", "aria-orientation"]);
1979
+ };
1980
+ }
1981
+ });
1618
1982
  const UiToolbarButtonType = "UiToolbarButton";
1619
1983
  const UiToolbarButton = defineRemoteComponent(
1620
1984
  UiToolbarButtonType,
@@ -1996,8 +2360,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1996
2360
  /** Размер поля ввода */
1997
2361
  textboxSize: {
1998
2362
  type: String,
1999
- validator: (size) => Object.values(SIZE$1).includes(size),
2000
- default: SIZE$1.SM
2363
+ validator: (size) => Object.values(SIZE$2).includes(size),
2364
+ default: SIZE$2.SM
2001
2365
  },
2002
2366
  /** Наличие множественного выбора среди элементов выпадающего списка */
2003
2367
  multiple: {
@@ -2319,13 +2683,13 @@ function render(_ctx, _cache) {
2319
2683
  ])]);
2320
2684
  }
2321
2685
  const IconAddCircleOutlined = { render };
2322
- var SIZE = /* @__PURE__ */ ((SIZE2) => {
2686
+ var SIZE$1 = /* @__PURE__ */ ((SIZE2) => {
2323
2687
  SIZE2["XS"] = "xs";
2324
2688
  SIZE2["SM"] = "sm";
2325
2689
  SIZE2["MD"] = "md";
2326
2690
  SIZE2["LG"] = "lg";
2327
2691
  return SIZE2;
2328
- })(SIZE || {});
2692
+ })(SIZE$1 || {});
2329
2693
  const _hoisted_1 = ["id", "aria-selected", "aria-current"];
2330
2694
  const _hoisted_2 = ["innerHTML"];
2331
2695
  const _hoisted_3 = ["innerHTML"];
@@ -2360,8 +2724,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2360
2724
  /** Размер шрифта, иконок и внутренних отступов компонента */
2361
2725
  size: {
2362
2726
  type: String,
2363
- validator: (size) => Object.values(SIZE).includes(size),
2364
- default: SIZE.MD
2727
+ validator: (size) => Object.values(SIZE$1).includes(size),
2728
+ default: SIZE$1.MD
2365
2729
  },
2366
2730
  /** Счетчик количества */
2367
2731
  counter: {
@@ -2689,6 +3053,8 @@ const createEndpointRoot = async (channel) => {
2689
3053
  "UiTag",
2690
3054
  "UiTextbox",
2691
3055
  "UiTimePicker",
3056
+ "UiToggleButton",
3057
+ "UiToggleGroupRoot",
2692
3058
  "UiToolbarButton",
2693
3059
  "UiToolbarLink",
2694
3060
  "UiTooltip",
@@ -2712,6 +3078,17 @@ const usePreview = (workers = ref([])) => {
2712
3078
  preview: (url, resize = void 0, crop = void 0) => preview(_workers.value, url, resize, crop)
2713
3079
  };
2714
3080
  };
3081
+ var SIZE = /* @__PURE__ */ ((SIZE2) => {
3082
+ SIZE2["SM"] = "sm";
3083
+ SIZE2["MD"] = "md";
3084
+ SIZE2["LG"] = "lg";
3085
+ return SIZE2;
3086
+ })(SIZE || {});
3087
+ var APPEARANCE = /* @__PURE__ */ ((APPEARANCE2) => {
3088
+ APPEARANCE2["TEXT"] = "text";
3089
+ APPEARANCE2["FILLED"] = "filled";
3090
+ return APPEARANCE2;
3091
+ })(APPEARANCE || {});
2715
3092
  const formatDateLat = (date) => format(date, "dd/MM/yyyy", { locale: enGB });
2716
3093
  const formatDateEs = (date) => format(date, "dd.MM.yyyy", { locale: es });
2717
3094
  const formatDateRu = (date) => format(date, "dd.MM.yyyy", { locale: ru });
@@ -2752,6 +3129,10 @@ export {
2752
3129
  ALIGN,
2753
3130
  DIRECTION,
2754
3131
  ImageWorkersKey,
3132
+ APPEARANCE$1 as RADIO_SWITCH_APPEARANCE,
3133
+ SIZE$3 as RADIO_SWITCH_SIZE,
3134
+ APPEARANCE as TAB_APPEARANCE,
3135
+ SIZE as TAB_SIZE,
2755
3136
  UiAddButton,
2756
3137
  UiAddButtonType,
2757
3138
  UiAlert,
@@ -2780,7 +3161,7 @@ export {
2780
3161
  UiDateType,
2781
3162
  UiError,
2782
3163
  UiErrorType,
2783
- _sfc_main$9 as UiField,
3164
+ _sfc_main$b as UiField,
2784
3165
  UiInfobox,
2785
3166
  UiInfoboxType,
2786
3167
  UiLink,
@@ -2799,7 +3180,7 @@ export {
2799
3180
  UiModalWindowType,
2800
3181
  UiNumberStepper,
2801
3182
  UiNumberStepperType,
2802
- _sfc_main$8 as UiPageHeader,
3183
+ _sfc_main$a as UiPageHeader,
2803
3184
  UiPopper,
2804
3185
  UiPopperConnector,
2805
3186
  UiPopperConnectorType,
@@ -2807,8 +3188,8 @@ export {
2807
3188
  UiPopperTargetType,
2808
3189
  UiPopperType,
2809
3190
  UiRadio,
2810
- _sfc_main$6 as UiRadioSwitch,
2811
- _sfc_main$7 as UiRadioSwitchOption,
3191
+ _sfc_main$8 as UiRadioSwitch,
3192
+ _sfc_main$9 as UiRadioSwitchOption,
2812
3193
  UiRadioType,
2813
3194
  UiScrollBox,
2814
3195
  UiScrollBoxType,
@@ -2823,9 +3204,9 @@ export {
2823
3204
  UiTabGroup,
2824
3205
  UiTabGroupType,
2825
3206
  UiTabType,
2826
- _sfc_main$4 as UiTable,
3207
+ _sfc_main$6 as UiTable,
2827
3208
  UiTableBodyCell,
2828
- _sfc_main$5 as UiTableColumn,
3209
+ _sfc_main$7 as UiTableColumn,
2829
3210
  UiTableFooterButton,
2830
3211
  UiTableFooterSection,
2831
3212
  UiTableHeadCell,
@@ -2836,6 +3217,11 @@ export {
2836
3217
  UiTextboxType,
2837
3218
  UiTimePicker,
2838
3219
  UiTimePickerType,
3220
+ UiToggleButton,
3221
+ UiToggleButtonSize,
3222
+ UiToggleButtonType,
3223
+ _sfc_main$4 as UiToggleGroup,
3224
+ _sfc_main$5 as UiToggleGroupOption,
2839
3225
  UiToolbarButton,
2840
3226
  UiToolbarButtonType,
2841
3227
  UiToolbarLink,