@retailcrm/embed-ui-v1-components 0.9.15 → 0.9.17

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 (71) hide show
  1. package/assets/sprites/map-and-places/navigate.svg +3 -0
  2. package/dist/host.cjs +1229 -616
  3. package/dist/host.css +346 -0
  4. package/dist/host.d.ts +300 -118
  5. package/dist/host.js +1229 -616
  6. package/dist/remote.cjs +501 -61
  7. package/dist/remote.d.ts +667 -81
  8. package/dist/remote.js +502 -62
  9. package/docs/COMPONENTS.md +4 -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/UiSkeleton.yml +41 -0
  49. package/docs/profiles/UiSlider.yml +12 -0
  50. package/docs/profiles/UiSwitch.yml +12 -0
  51. package/docs/profiles/UiTab.yml +5 -0
  52. package/docs/profiles/UiTabGroup.yml +5 -0
  53. package/docs/profiles/UiTable.yml +5 -1
  54. package/docs/profiles/UiTableBodyCell.yml +12 -0
  55. package/docs/profiles/UiTableColumn.yml +12 -0
  56. package/docs/profiles/UiTableFooterButton.yml +12 -0
  57. package/docs/profiles/UiTableFooterSection.yml +12 -0
  58. package/docs/profiles/UiTableHeadCell.yml +12 -0
  59. package/docs/profiles/UiTableSorter.yml +12 -0
  60. package/docs/profiles/UiTag.yml +12 -0
  61. package/docs/profiles/UiTextbox.yml +5 -1
  62. package/docs/profiles/UiTimePicker.yml +12 -0
  63. package/docs/profiles/UiToggleButton.yml +211 -0
  64. package/docs/profiles/UiToggleGroup.yml +211 -0
  65. package/docs/profiles/UiToggleGroupOption.yml +116 -0
  66. package/docs/profiles/UiToolbarButton.yml +12 -0
  67. package/docs/profiles/UiToolbarLink.yml +12 -0
  68. package/docs/profiles/UiTooltip.yml +12 -0
  69. package/docs/profiles/UiTransition.yml +12 -0
  70. package/docs/profiles/UiYandexMap.yml +12 -0
  71. 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$2 = /* @__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$2 || {});
581
+ var SIZE$4 = /* @__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$4 || {});
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$2.DEFAULT));
595
+ const useSize$1 = () => inject(SizeKey$1, computed(() => SIZE$4.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$2).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$2.DEFAULT,
818
+ validator: (appearance) => Object.values(APPEARANCE$2).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$4.MD,
824
+ validator: (size) => Object.values(SIZE$4).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,
@@ -958,6 +957,11 @@ const UiScrollBox = defineRemoteComponent(
958
957
  "ps-y-reach-end"
959
958
  ]
960
959
  );
960
+ const UiSkeletonType = "UiSkeleton";
961
+ const UiSkeleton = defineRemoteComponent(
962
+ UiSkeletonType,
963
+ ["click", "focus", "blur"]
964
+ );
961
965
  const UiSliderType = "UiSlider";
962
966
  const UiSlider = defineRemoteComponent(
963
967
  UiSliderType,
@@ -1014,7 +1018,7 @@ const byRowKey = (key) => {
1014
1018
  };
1015
1019
  const asRowClass = (value) => value;
1016
1020
  const asRowAttrs = (value) => value;
1017
- const _sfc_main$5 = defineComponent({
1021
+ const _sfc_main$7 = defineComponent({
1018
1022
  name: "UiTableColumn",
1019
1023
  props: {
1020
1024
  label: {
@@ -1094,7 +1098,7 @@ const isNamedComponent = (node, name) => {
1094
1098
  return "name" in node.type && node.type.name === name;
1095
1099
  };
1096
1100
  const isTableColumnVNode = (node) => {
1097
- return node.type === _sfc_main$5 || isNamedComponent(node, "UiTableColumn");
1101
+ return node.type === _sfc_main$7 || isNamedComponent(node, "UiTableColumn");
1098
1102
  };
1099
1103
  const isWhitespaceText = (value) => value.trim().length === 0;
1100
1104
  const normalizeNodes = (children) => {
@@ -1299,7 +1303,7 @@ const withoutClass = (attrs) => {
1299
1303
  delete next.class;
1300
1304
  return next;
1301
1305
  };
1302
- const _sfc_main$4 = defineComponent({
1306
+ const _sfc_main$6 = defineComponent({
1303
1307
  name: "UiTable",
1304
1308
  inheritAttrs: false,
1305
1309
  props: {
@@ -1568,14 +1572,30 @@ const UiTag = defineRemoteComponent(
1568
1572
  UiTagType,
1569
1573
  ["click", "focus", "blur", "remove"]
1570
1574
  );
1571
- var SIZE$1 = /* @__PURE__ */ ((SIZE2) => {
1575
+ var WIDTH = /* @__PURE__ */ ((WIDTH2) => {
1576
+ WIDTH2["FIT"] = "fit";
1577
+ WIDTH2["FLUID"] = "fluid";
1578
+ return WIDTH2;
1579
+ })(WIDTH || {});
1580
+ const NUMERIC_PATTERN = /^(?:\d+|\d*\.\d+)$/;
1581
+ const UNIT_PATTERN = /^(?:\d+|\d*\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|Q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw)$/i;
1582
+ const isWidthNumeric = (value) => {
1583
+ return typeof value === "number" ? Number.isFinite(value) && value >= 0 : typeof value === "string" && NUMERIC_PATTERN.test(value.trim());
1584
+ };
1585
+ const isWidthToken = (value) => {
1586
+ return typeof value === "string" && Object.values(WIDTH).includes(value);
1587
+ };
1588
+ const isWidth = (value) => {
1589
+ return value === null || value === void 0 || isWidthToken(value) || isWidthNumeric(value) || typeof value === "string" && UNIT_PATTERN.test(value.trim());
1590
+ };
1591
+ var SIZE$3 = /* @__PURE__ */ ((SIZE2) => {
1572
1592
  SIZE2["XS"] = "xs";
1573
1593
  SIZE2["SM"] = "sm";
1574
1594
  SIZE2["MD"] = "md";
1575
1595
  SIZE2["LG"] = "lg";
1576
1596
  SIZE2["XL"] = "xl";
1577
1597
  return SIZE2;
1578
- })(SIZE$1 || {});
1598
+ })(SIZE$3 || {});
1579
1599
  const events = [
1580
1600
  "input",
1581
1601
  "keydown",
@@ -1615,6 +1635,371 @@ const UiTimePicker = defineRemoteComponent(UiTimePickerType, {
1615
1635
  focus: defineRemoteMethod()
1616
1636
  }
1617
1637
  });
1638
+ const UiToggleButtonType = "UiToggleButton";
1639
+ const UiToggleButton = defineRemoteComponent(
1640
+ UiToggleButtonType,
1641
+ {
1642
+ emits: [
1643
+ "click",
1644
+ "focus",
1645
+ "blur",
1646
+ "keydown"
1647
+ ],
1648
+ methods: {
1649
+ focus: defineRemoteMethod(),
1650
+ blur: defineRemoteMethod(),
1651
+ click: defineRemoteMethod()
1652
+ }
1653
+ }
1654
+ );
1655
+ var UiToggleButtonSize = /* @__PURE__ */ ((UiToggleButtonSize2) => {
1656
+ UiToggleButtonSize2["LG"] = "lg";
1657
+ UiToggleButtonSize2["MD"] = "md";
1658
+ UiToggleButtonSize2["SM"] = "sm";
1659
+ UiToggleButtonSize2["XS"] = "xs";
1660
+ return UiToggleButtonSize2;
1661
+ })(UiToggleButtonSize || {});
1662
+ const FocusableIdKey = Symbol("UiToggleGroupFocusableId");
1663
+ const MoveFocusKey = Symbol("UiToggleGroupMoveFocus");
1664
+ const RegistryKey = Symbol("UiToggleGroupRegistry");
1665
+ const SetFocusableIdKey = Symbol("UiToggleGroupSetFocusableId");
1666
+ const SizeKey = Symbol("UiToggleGroupSize");
1667
+ const DisabledKey = Symbol("UiToggleGroupDisabled");
1668
+ const ToggleKey$1 = Symbol("UiToggleGroupToggle");
1669
+ const useFocusableId = () => inject(FocusableIdKey, computed(() => null));
1670
+ const useMoveFocus = () => inject(MoveFocusKey, () => {
1671
+ });
1672
+ const useRegistry = () => inject(RegistryKey, {
1673
+ register: () => {
1674
+ },
1675
+ unregister: () => {
1676
+ }
1677
+ });
1678
+ const useSetFocusableId = () => inject(SetFocusableIdKey, () => {
1679
+ });
1680
+ const useSize = () => inject(SizeKey, computed(() => UiToggleButtonSize.SM));
1681
+ const useDisabled = () => inject(DisabledKey, computed(() => false));
1682
+ const useToggle = () => inject(ToggleKey$1, () => {
1683
+ });
1684
+ let counter$1 = 0;
1685
+ const __default__ = {};
1686
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1687
+ ...__default__,
1688
+ ...{
1689
+ inheritAttrs: false
1690
+ },
1691
+ __name: "UiToggleGroupOption",
1692
+ props: {
1693
+ id: {
1694
+ type: String,
1695
+ default: () => "ui-v1-toggle-group-option-" + ++counter$1
1696
+ },
1697
+ label: {
1698
+ type: String,
1699
+ default: ""
1700
+ },
1701
+ value: {
1702
+ type: null,
1703
+ required: true
1704
+ },
1705
+ disabled: {
1706
+ type: Boolean,
1707
+ default: false
1708
+ }
1709
+ },
1710
+ setup(__props) {
1711
+ const props = __props;
1712
+ const button = useTemplateRef("button");
1713
+ const groupDisabled = useDisabled();
1714
+ const focusableId = useFocusableId();
1715
+ const moveFocus = useMoveFocus();
1716
+ const registry = useRegistry();
1717
+ const setFocusableId = useSetFocusableId();
1718
+ const size = useSize();
1719
+ const toggle = useToggle();
1720
+ const focused = ref(false);
1721
+ const disabled = computed(() => groupDisabled.value || props.disabled);
1722
+ const pressed = ref(false);
1723
+ const tabIndex = computed(() => {
1724
+ return !disabled.value && focusableId.value === props.id ? 0 : -1;
1725
+ });
1726
+ const onClick = () => {
1727
+ if (disabled.value) {
1728
+ return;
1729
+ }
1730
+ setFocusableId(props.id);
1731
+ toggle(props.value);
1732
+ };
1733
+ const onFocus = () => {
1734
+ if (!disabled.value) {
1735
+ focused.value = true;
1736
+ setFocusableId(props.id);
1737
+ }
1738
+ };
1739
+ const onBlur = () => {
1740
+ focused.value = false;
1741
+ };
1742
+ const onKeyDown = (event) => {
1743
+ if (disabled.value) {
1744
+ return;
1745
+ }
1746
+ switch (event.key) {
1747
+ case " ":
1748
+ case "Enter":
1749
+ setFocusableId(props.id);
1750
+ toggle(props.value);
1751
+ return;
1752
+ case "ArrowDown":
1753
+ case "ArrowRight":
1754
+ void moveFocus(props.id, "next");
1755
+ return;
1756
+ case "ArrowUp":
1757
+ case "ArrowLeft":
1758
+ void moveFocus(props.id, "prev");
1759
+ return;
1760
+ case "Home":
1761
+ void moveFocus(props.id, "first");
1762
+ return;
1763
+ case "End":
1764
+ void moveFocus(props.id, "last");
1765
+ return;
1766
+ }
1767
+ };
1768
+ onBeforeMount(() => {
1769
+ registry.register(props.id, {
1770
+ getValue: () => props.value,
1771
+ pressed,
1772
+ disabled: () => disabled.value,
1773
+ focus: () => button.value?.focus()
1774
+ });
1775
+ });
1776
+ onBeforeUnmount(() => {
1777
+ registry.unregister(props.id);
1778
+ });
1779
+ return (_ctx, _cache) => {
1780
+ return openBlock(), createBlock(unref(UiToggleButton), mergeProps({
1781
+ id: __props.id,
1782
+ ref_key: "button",
1783
+ ref: button,
1784
+ size: unref(size),
1785
+ pressed: pressed.value,
1786
+ disabled: disabled.value,
1787
+ focused: focused.value,
1788
+ grouped: true,
1789
+ tabindex: tabIndex.value,
1790
+ role: "checkbox",
1791
+ "aria-checked": `${pressed.value}`,
1792
+ "aria-disabled": `${disabled.value}`
1793
+ }, _ctx.$attrs, {
1794
+ onClick,
1795
+ onFocus,
1796
+ onBlur,
1797
+ onKeydown: [
1798
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["space"]),
1799
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["enter"]),
1800
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["left"]),
1801
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["right"]),
1802
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["up"]),
1803
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["down"]),
1804
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["home"]),
1805
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["end"])
1806
+ ]
1807
+ }), {
1808
+ default: withCtx(() => [
1809
+ renderSlot(_ctx.$slots, "default", {}, () => [
1810
+ _ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", { key: 0 }) : createCommentVNode("", true),
1811
+ _ctx.$slots.label || __props.label ? renderSlot(_ctx.$slots, "label", { key: 1 }, () => [
1812
+ createTextVNode(toDisplayString(__props.label), 1)
1813
+ ]) : createCommentVNode("", true)
1814
+ ])
1815
+ ]),
1816
+ _: 3
1817
+ }, 16, ["id", "size", "pressed", "disabled", "focused", "tabindex", "aria-checked", "aria-disabled", "onKeydown"]);
1818
+ };
1819
+ }
1820
+ });
1821
+ const UiToggleGroupRootType = "UiToggleGroupRoot";
1822
+ const UiToggleGroupRoot = defineRemoteComponent(UiToggleGroupRootType);
1823
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1824
+ ...{
1825
+ inheritAttrs: false
1826
+ },
1827
+ __name: "UiToggleGroup",
1828
+ props: {
1829
+ model: {
1830
+ type: Array,
1831
+ default: () => []
1832
+ },
1833
+ options: {
1834
+ type: Array,
1835
+ default: () => []
1836
+ },
1837
+ equalFn: {
1838
+ type: Function,
1839
+ default: (a, b) => a === b
1840
+ },
1841
+ size: {
1842
+ type: String,
1843
+ default: UiToggleButtonSize.SM,
1844
+ validator: (size) => {
1845
+ return Object.values(UiToggleButtonSize).includes(size);
1846
+ }
1847
+ },
1848
+ rubber: {
1849
+ type: Boolean,
1850
+ default: false
1851
+ },
1852
+ disabled: {
1853
+ type: Boolean,
1854
+ default: false
1855
+ },
1856
+ ariaLabel: {
1857
+ type: String,
1858
+ default: void 0
1859
+ },
1860
+ ariaLabelledby: {
1861
+ type: String,
1862
+ default: void 0
1863
+ },
1864
+ ariaDescribedby: {
1865
+ type: String,
1866
+ default: void 0
1867
+ },
1868
+ ariaOrientation: {
1869
+ type: String,
1870
+ default: "horizontal"
1871
+ }
1872
+ },
1873
+ emits: ["change", "update:model"],
1874
+ setup(__props, { emit: __emit }) {
1875
+ const props = __props;
1876
+ const emit = __emit;
1877
+ const registry = /* @__PURE__ */ new Map();
1878
+ const focusableId = ref(null);
1879
+ const isPressed = (value) => {
1880
+ return props.model.some((entry) => props.equalFn(entry, value));
1881
+ };
1882
+ const getEnabledEntries = () => {
1883
+ return Array.from(registry.entries()).filter(([, option]) => !option.disabled());
1884
+ };
1885
+ const syncFocusableId = (preferredId) => {
1886
+ const enabledEntries = getEnabledEntries();
1887
+ const enabledIds = new Set(enabledEntries.map(([id]) => id));
1888
+ const pressedEntry = enabledEntries.find(([, option]) => option.pressed.value);
1889
+ if (preferredId && enabledIds.has(preferredId)) {
1890
+ focusableId.value = preferredId;
1891
+ return;
1892
+ }
1893
+ if (focusableId.value && enabledIds.has(focusableId.value)) {
1894
+ return;
1895
+ }
1896
+ focusableId.value = pressedEntry?.[0] ?? enabledEntries[0]?.[0] ?? null;
1897
+ };
1898
+ const updatePressedStates = () => {
1899
+ Array.from(registry.values()).forEach((option) => {
1900
+ option.pressed.value = isPressed(option.getValue());
1901
+ });
1902
+ };
1903
+ provide(FocusableIdKey, computed(() => focusableId.value));
1904
+ provide(DisabledKey, computed(() => props.disabled));
1905
+ provide(SizeKey, computed(() => props.size));
1906
+ provide(SetFocusableIdKey, (id) => {
1907
+ syncFocusableId(id);
1908
+ });
1909
+ provide(RegistryKey, {
1910
+ register: (id, option) => {
1911
+ if (registry.has(id)) {
1912
+ return;
1913
+ }
1914
+ option.pressed.value = isPressed(option.getValue());
1915
+ registry.set(id, option);
1916
+ syncFocusableId(option.pressed.value ? id : focusableId.value);
1917
+ },
1918
+ unregister: (id) => {
1919
+ registry.delete(id);
1920
+ if (focusableId.value === id) {
1921
+ syncFocusableId();
1922
+ }
1923
+ }
1924
+ });
1925
+ provide(ToggleKey$1, (value) => {
1926
+ if (props.disabled) {
1927
+ return;
1928
+ }
1929
+ const nextModel = isPressed(value) ? props.model.filter((entry) => !props.equalFn(entry, value)) : [...props.model, value];
1930
+ emit("change", nextModel);
1931
+ emit("update:model", nextModel);
1932
+ });
1933
+ provide(MoveFocusKey, async (id, direction) => {
1934
+ const enabledEntries = getEnabledEntries();
1935
+ if (!enabledEntries.length) {
1936
+ focusableId.value = null;
1937
+ return;
1938
+ }
1939
+ let targetEntry = enabledEntries[0];
1940
+ if (direction === "first") {
1941
+ targetEntry = enabledEntries[0];
1942
+ } else if (direction === "last") {
1943
+ targetEntry = enabledEntries.at(-1) ?? enabledEntries[0];
1944
+ } else {
1945
+ const currentIndex = enabledEntries.findIndex(([entryId]) => entryId === id);
1946
+ const fallbackIndex = focusableId.value ? enabledEntries.findIndex(([entryId]) => entryId === focusableId.value) : -1;
1947
+ const baseIndex = currentIndex === -1 ? Math.max(fallbackIndex, 0) : currentIndex;
1948
+ const offset = direction === "next" ? 1 : -1;
1949
+ const nextIndex = (baseIndex + offset + enabledEntries.length) % enabledEntries.length;
1950
+ targetEntry = enabledEntries[nextIndex] ?? enabledEntries[0];
1951
+ }
1952
+ if (!targetEntry) {
1953
+ return;
1954
+ }
1955
+ const [targetId, target] = targetEntry;
1956
+ focusableId.value = targetId;
1957
+ await target.focus();
1958
+ });
1959
+ watch([() => props.model, () => props.equalFn], () => {
1960
+ updatePressedStates();
1961
+ syncFocusableId();
1962
+ }, {
1963
+ deep: true
1964
+ });
1965
+ watch(() => props.disabled, () => {
1966
+ syncFocusableId();
1967
+ });
1968
+ return (_ctx, _cache) => {
1969
+ return openBlock(), createBlock(unref(UiToggleGroupRoot), mergeProps({
1970
+ size: __props.size,
1971
+ rubber: __props.rubber,
1972
+ disabled: __props.disabled,
1973
+ "aria-label": props.ariaLabel,
1974
+ "aria-labelledby": props.ariaLabelledby,
1975
+ "aria-describedby": props.ariaDescribedby,
1976
+ "aria-orientation": props.ariaOrientation
1977
+ }, _ctx.$attrs), {
1978
+ default: withCtx(() => [
1979
+ renderSlot(_ctx.$slots, "default", {}, () => [
1980
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
1981
+ return openBlock(), createBlock(_sfc_main$5, {
1982
+ key: `${option.label}-${index}`,
1983
+ label: option.label,
1984
+ value: option.value,
1985
+ disabled: option.disabled
1986
+ }, createSlots({ _: 2 }, [
1987
+ _ctx.$slots.icon ? {
1988
+ name: "icon",
1989
+ fn: withCtx(() => [
1990
+ renderSlot(_ctx.$slots, "icon", { option })
1991
+ ]),
1992
+ key: "0"
1993
+ } : void 0
1994
+ ]), 1032, ["label", "value", "disabled"]);
1995
+ }), 128))
1996
+ ])
1997
+ ]),
1998
+ _: 3
1999
+ }, 16, ["size", "rubber", "disabled", "aria-label", "aria-labelledby", "aria-describedby", "aria-orientation"]);
2000
+ };
2001
+ }
2002
+ });
1618
2003
  const UiToolbarButtonType = "UiToolbarButton";
1619
2004
  const UiToolbarButton = defineRemoteComponent(
1620
2005
  UiToolbarButtonType,
@@ -1996,8 +2381,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1996
2381
  /** Размер поля ввода */
1997
2382
  textboxSize: {
1998
2383
  type: String,
1999
- validator: (size) => Object.values(SIZE$1).includes(size),
2000
- default: SIZE$1.SM
2384
+ validator: (size) => Object.values(SIZE$3).includes(size),
2385
+ default: SIZE$3.SM
2386
+ },
2387
+ /** Ширина селекта. fit — по содержимому, fluid — на всю ширину контейнера */
2388
+ width: {
2389
+ type: [Number, String],
2390
+ validator: isWidth,
2391
+ default: WIDTH.FIT
2001
2392
  },
2002
2393
  /** Наличие множественного выбора среди элементов выпадающего списка */
2003
2394
  multiple: {
@@ -2266,13 +2657,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2266
2657
  "placeholder-only": __props.placeholderOnly,
2267
2658
  placeholder: __props.placeholder,
2268
2659
  "textbox-size": __props.textboxSize,
2660
+ width: __props.width,
2269
2661
  "active-descendant": activeOptionId.value
2270
2662
  }, _ctx.$attrs, {
2271
2663
  onInput,
2272
2664
  onKeydown: onKeyDown,
2273
2665
  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => state.value = $event),
2274
2666
  "onUpdate:expanded": _cache[1] || (_cache[1] = ($event) => state.expanded = $event)
2275
- }), null, 16, ["id", "value", "multiple", "selection", "filter", "filterable", "clearable", "expanded", "invalid", "disabled", "readonly", "placeholder-only", "placeholder", "textbox-size", "active-descendant"]),
2667
+ }), null, 16, ["id", "value", "multiple", "selection", "filter", "filterable", "clearable", "expanded", "invalid", "disabled", "readonly", "placeholder-only", "placeholder", "textbox-size", "width", "active-descendant"]),
2276
2668
  createVNode(unref(UiSelectPopper), {
2277
2669
  id: resolvedId.value,
2278
2670
  ref_key: "popper",
@@ -2319,13 +2711,13 @@ function render(_ctx, _cache) {
2319
2711
  ])]);
2320
2712
  }
2321
2713
  const IconAddCircleOutlined = { render };
2322
- var SIZE = /* @__PURE__ */ ((SIZE2) => {
2714
+ var SIZE$2 = /* @__PURE__ */ ((SIZE2) => {
2323
2715
  SIZE2["XS"] = "xs";
2324
2716
  SIZE2["SM"] = "sm";
2325
2717
  SIZE2["MD"] = "md";
2326
2718
  SIZE2["LG"] = "lg";
2327
2719
  return SIZE2;
2328
- })(SIZE || {});
2720
+ })(SIZE$2 || {});
2329
2721
  const _hoisted_1 = ["id", "aria-selected", "aria-current"];
2330
2722
  const _hoisted_2 = ["innerHTML"];
2331
2723
  const _hoisted_3 = ["innerHTML"];
@@ -2360,8 +2752,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2360
2752
  /** Размер шрифта, иконок и внутренних отступов компонента */
2361
2753
  size: {
2362
2754
  type: String,
2363
- validator: (size) => Object.values(SIZE).includes(size),
2364
- default: SIZE.MD
2755
+ validator: (size) => Object.values(SIZE$2).includes(size),
2756
+ default: SIZE$2.MD
2365
2757
  },
2366
2758
  /** Счетчик количества */
2367
2759
  counter: {
@@ -2689,6 +3081,8 @@ const createEndpointRoot = async (channel) => {
2689
3081
  "UiTag",
2690
3082
  "UiTextbox",
2691
3083
  "UiTimePicker",
3084
+ "UiToggleButton",
3085
+ "UiToggleGroupRoot",
2692
3086
  "UiToolbarButton",
2693
3087
  "UiToolbarLink",
2694
3088
  "UiTooltip",
@@ -2712,6 +3106,37 @@ const usePreview = (workers = ref([])) => {
2712
3106
  preview: (url, resize = void 0, crop = void 0) => preview(_workers.value, url, resize, crop)
2713
3107
  };
2714
3108
  };
3109
+ var ANIMATION = /* @__PURE__ */ ((ANIMATION2) => {
3110
+ ANIMATION2["PULSE"] = "pulse";
3111
+ ANIMATION2["SHIMMER"] = "shimmer";
3112
+ return ANIMATION2;
3113
+ })(ANIMATION || {});
3114
+ var APPEARANCE$1 = /* @__PURE__ */ ((APPEARANCE2) => {
3115
+ APPEARANCE2["CIRCLE"] = "circle";
3116
+ APPEARANCE2["RECTANGLE"] = "rectangle";
3117
+ APPEARANCE2["TEXT"] = "text";
3118
+ return APPEARANCE2;
3119
+ })(APPEARANCE$1 || {});
3120
+ var SIZE$1 = /* @__PURE__ */ ((SIZE2) => {
3121
+ SIZE2["SM"] = "sm";
3122
+ SIZE2["MD"] = "md";
3123
+ SIZE2["LG"] = "lg";
3124
+ return SIZE2;
3125
+ })(SIZE$1 || {});
3126
+ function guessDimensionStyleValue(value) {
3127
+ return typeof value === "number" || typeof value === "string" && /^\d*$/.test(value) ? `${value}px` : value;
3128
+ }
3129
+ var SIZE = /* @__PURE__ */ ((SIZE2) => {
3130
+ SIZE2["SM"] = "sm";
3131
+ SIZE2["MD"] = "md";
3132
+ SIZE2["LG"] = "lg";
3133
+ return SIZE2;
3134
+ })(SIZE || {});
3135
+ var APPEARANCE = /* @__PURE__ */ ((APPEARANCE2) => {
3136
+ APPEARANCE2["TEXT"] = "text";
3137
+ APPEARANCE2["FILLED"] = "filled";
3138
+ return APPEARANCE2;
3139
+ })(APPEARANCE || {});
2715
3140
  const formatDateLat = (date) => format(date, "dd/MM/yyyy", { locale: enGB });
2716
3141
  const formatDateEs = (date) => format(date, "dd.MM.yyyy", { locale: es });
2717
3142
  const formatDateRu = (date) => format(date, "dd.MM.yyyy", { locale: ru });
@@ -2752,6 +3177,13 @@ export {
2752
3177
  ALIGN,
2753
3178
  DIRECTION,
2754
3179
  ImageWorkersKey,
3180
+ APPEARANCE$2 as RADIO_SWITCH_APPEARANCE,
3181
+ SIZE$4 as RADIO_SWITCH_SIZE,
3182
+ ANIMATION as SKELETON_ANIMATION,
3183
+ APPEARANCE$1 as SKELETON_APPEARANCE,
3184
+ SIZE$1 as SKELETON_SIZE,
3185
+ APPEARANCE as TAB_APPEARANCE,
3186
+ SIZE as TAB_SIZE,
2755
3187
  UiAddButton,
2756
3188
  UiAddButtonType,
2757
3189
  UiAlert,
@@ -2780,7 +3212,7 @@ export {
2780
3212
  UiDateType,
2781
3213
  UiError,
2782
3214
  UiErrorType,
2783
- _sfc_main$9 as UiField,
3215
+ _sfc_main$b as UiField,
2784
3216
  UiInfobox,
2785
3217
  UiInfoboxType,
2786
3218
  UiLink,
@@ -2799,7 +3231,7 @@ export {
2799
3231
  UiModalWindowType,
2800
3232
  UiNumberStepper,
2801
3233
  UiNumberStepperType,
2802
- _sfc_main$8 as UiPageHeader,
3234
+ _sfc_main$a as UiPageHeader,
2803
3235
  UiPopper,
2804
3236
  UiPopperConnector,
2805
3237
  UiPopperConnectorType,
@@ -2807,14 +3239,16 @@ export {
2807
3239
  UiPopperTargetType,
2808
3240
  UiPopperType,
2809
3241
  UiRadio,
2810
- _sfc_main$6 as UiRadioSwitch,
2811
- _sfc_main$7 as UiRadioSwitchOption,
3242
+ _sfc_main$8 as UiRadioSwitch,
3243
+ _sfc_main$9 as UiRadioSwitchOption,
2812
3244
  UiRadioType,
2813
3245
  UiScrollBox,
2814
3246
  UiScrollBoxType,
2815
3247
  _sfc_main$3 as UiSelect,
2816
3248
  _sfc_main$2 as UiSelectOption,
2817
3249
  _sfc_main as UiSelectOptionGroup,
3250
+ UiSkeleton,
3251
+ UiSkeletonType,
2818
3252
  UiSlider,
2819
3253
  UiSliderType,
2820
3254
  UiSwitch,
@@ -2823,9 +3257,9 @@ export {
2823
3257
  UiTabGroup,
2824
3258
  UiTabGroupType,
2825
3259
  UiTabType,
2826
- _sfc_main$4 as UiTable,
3260
+ _sfc_main$6 as UiTable,
2827
3261
  UiTableBodyCell,
2828
- _sfc_main$5 as UiTableColumn,
3262
+ _sfc_main$7 as UiTableColumn,
2829
3263
  UiTableFooterButton,
2830
3264
  UiTableFooterSection,
2831
3265
  UiTableHeadCell,
@@ -2836,6 +3270,11 @@ export {
2836
3270
  UiTextboxType,
2837
3271
  UiTimePicker,
2838
3272
  UiTimePickerType,
3273
+ UiToggleButton,
3274
+ UiToggleButtonSize,
3275
+ UiToggleButtonType,
3276
+ _sfc_main$4 as UiToggleGroup,
3277
+ _sfc_main$5 as UiToggleGroupOption,
2839
3278
  UiToolbarButton,
2840
3279
  UiToolbarButtonType,
2841
3280
  UiToolbarLink,
@@ -2854,6 +3293,7 @@ export {
2854
3293
  formatDate,
2855
3294
  formatDateTime,
2856
3295
  formatTime,
3296
+ guessDimensionStyleValue as guessSkeletonDimensionStyleValue,
2857
3297
  mountEndpointRoot,
2858
3298
  usePreview
2859
3299
  };