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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/AGENTS.md +126 -0
  2. package/README.md +24 -0
  3. package/assets/stylesheets/palette.less +11 -6
  4. package/bin/embed-ui-v1-components.mjs +209 -0
  5. package/bin/postinstall.mjs +37 -0
  6. package/dist/host.cjs +1899 -590
  7. package/dist/host.css +659 -6
  8. package/dist/host.d.ts +2374 -50
  9. package/dist/host.js +1900 -591
  10. package/dist/remote.cjs +610 -33
  11. package/dist/remote.d.ts +729 -48
  12. package/dist/remote.js +612 -35
  13. package/docs/AI.md +106 -0
  14. package/docs/COMPONENTS.md +96 -0
  15. package/docs/FORMAT.md +248 -0
  16. package/docs/PROFILES.md +64 -0
  17. package/docs/README.md +65 -0
  18. package/docs/STYLING.md +156 -0
  19. package/docs/profiles/UiAddButton.yml +45 -0
  20. package/docs/profiles/UiAlert.yml +36 -0
  21. package/docs/profiles/UiAvatar.yml +36 -0
  22. package/docs/profiles/UiAvatarList.yml +30 -0
  23. package/docs/profiles/UiButton.yml +221 -0
  24. package/docs/profiles/UiCalendar.yml +36 -0
  25. package/docs/profiles/UiCheckbox.yml +41 -0
  26. package/docs/profiles/UiCollapse.yml +28 -0
  27. package/docs/profiles/UiCollapseBox.yml +39 -0
  28. package/docs/profiles/UiCollapseGroup.yml +27 -0
  29. package/docs/profiles/UiCopyButton.yml +40 -0
  30. package/docs/profiles/UiDate.yml +26 -0
  31. package/docs/profiles/UiDatePicker.yml +47 -0
  32. package/docs/profiles/UiError.yml +20 -0
  33. package/docs/profiles/UiField.yml +229 -0
  34. package/docs/profiles/UiImage.yml +27 -0
  35. package/docs/profiles/UiInfobox.yml +33 -0
  36. package/docs/profiles/UiLink.yml +39 -0
  37. package/docs/profiles/UiLoader.yml +26 -0
  38. package/docs/profiles/UiMenuItem.yml +45 -0
  39. package/docs/profiles/UiMenuItemGroup.yml +38 -0
  40. package/docs/profiles/UiModalSidebar.yml +34 -0
  41. package/docs/profiles/UiModalWindow.yml +32 -0
  42. package/docs/profiles/UiModalWindowSurface.yml +29 -0
  43. package/docs/profiles/UiNumberStepper.yml +40 -0
  44. package/docs/profiles/UiPageHeader.yml +240 -0
  45. package/docs/profiles/UiPopper.yml +197 -0
  46. package/docs/profiles/UiPopperConnector.yml +109 -0
  47. package/docs/profiles/UiPopperTarget.yml +112 -0
  48. package/docs/profiles/UiRadio.yml +26 -0
  49. package/docs/profiles/UiRadioSwitch.yml +224 -0
  50. package/docs/profiles/UiRadioSwitchOption.yml +113 -0
  51. package/docs/profiles/UiScrollBox.yml +19 -0
  52. package/docs/profiles/UiSelect.yml +318 -0
  53. package/docs/profiles/UiSelectOption.yml +32 -0
  54. package/docs/profiles/UiSelectOptionGroup.yml +26 -0
  55. package/docs/profiles/UiSlider.yml +26 -0
  56. package/docs/profiles/UiSwitch.yml +25 -0
  57. package/docs/profiles/UiTab.yml +114 -0
  58. package/docs/profiles/UiTabGroup.yml +233 -0
  59. package/docs/profiles/UiTable.yml +148 -0
  60. package/docs/profiles/UiTableBodyCell.yml +35 -0
  61. package/docs/profiles/UiTableColumn.yml +38 -0
  62. package/docs/profiles/UiTableFooterButton.yml +32 -0
  63. package/docs/profiles/UiTableFooterSection.yml +26 -0
  64. package/docs/profiles/UiTableHeadCell.yml +32 -0
  65. package/docs/profiles/UiTableSorter.yml +33 -0
  66. package/docs/profiles/UiTag.yml +29 -0
  67. package/docs/profiles/UiTextbox.yml +388 -0
  68. package/docs/profiles/UiTimePicker.yml +34 -0
  69. package/docs/profiles/UiToolbarButton.yml +25 -0
  70. package/docs/profiles/UiToolbarLink.yml +20 -0
  71. package/docs/profiles/UiTooltip.yml +31 -0
  72. package/docs/profiles/UiTransition.yml +15 -0
  73. package/docs/profiles/UiYandexMap.yml +17 -0
  74. package/package.json +7 -2
package/dist/remote.js CHANGED
@@ -1,5 +1,5 @@
1
- import { defineRemoteComponent, defineRemoteMethod, nextTick, createRemoteRoot } from "@omnicajs/vue-remote/remote";
2
- import { openBlock, createElementBlock, createElementVNode, defineComponent, mergeProps, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, unref, withCtx, isVNode, Comment, Text, Fragment, getCurrentInstance, ref, computed, watch, h, reactive, inject, useTemplateRef, provide, createBlock, onBeforeMount, onBeforeUnmount, createSlots, onMounted } from "vue";
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";
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";
@@ -122,13 +122,13 @@ const UiError = defineRemoteComponent(
122
122
  UiErrorType,
123
123
  ["click", "focus", "blur"]
124
124
  );
125
- const _hoisted_1$5 = {
125
+ const _hoisted_1$7 = {
126
126
  xmlns: "http://www.w3.org/2000/svg",
127
127
  fill: "currentColor",
128
128
  viewBox: "0 0 24 24"
129
129
  };
130
130
  function render$2(_ctx, _cache) {
131
- return openBlock(), createElementBlock("svg", _hoisted_1$5, [..._cache[0] || (_cache[0] = [
131
+ return openBlock(), createElementBlock("svg", _hoisted_1$7, [..._cache[0] || (_cache[0] = [
132
132
  createElementVNode("path", {
133
133
  "fill-rule": "evenodd",
134
134
  d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10A10 10 0 0 0 12 2m1 15.5a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5zm.88-5.21a2.89 2.89 0 0 0 2-2.73V9A2.88 2.88 0 0 0 13 6.12h-2A2.88 2.88 0 0 0 8.12 9v.5a.5.5 0 0 0 .5.5h.76a.5.5 0 0 0 .5-.5V9c0-.619.501-1.12 1.12-1.12h2A1.12 1.12 0 0 1 14.16 9v.56a1.13 1.13 0 0 1-.76 1.07l-.95.31a1.88 1.88 0 0 0-1.29 1.78v.78a.5.5 0 0 0 .5.5h.76a.5.5 0 0 0 .5-.5v-.78c0-.053.032-.1.08-.12z",
@@ -145,23 +145,23 @@ const UiPopperTargetType = "UiPopperTarget";
145
145
  const UiPopperTarget = defineRemoteComponent(UiPopperTargetType);
146
146
  const UiTooltipType = "UiTooltip";
147
147
  const UiTooltip = defineRemoteComponent(UiTooltipType);
148
- const _hoisted_1$4 = { class: "ui-v1-field__headline" };
149
- const _hoisted_2$1 = ["id", "for"];
150
- const _hoisted_3$1 = {
148
+ const _hoisted_1$6 = { class: "ui-v1-field__headline" };
149
+ const _hoisted_2$3 = ["id", "for"];
150
+ const _hoisted_3$3 = {
151
151
  key: 0,
152
152
  class: "ui-v1-field__required-mark",
153
153
  "aria-hidden": "true"
154
154
  };
155
- const _hoisted_4 = {
155
+ const _hoisted_4$1 = {
156
156
  key: 1,
157
157
  class: "ui-v1-field__hint"
158
158
  };
159
- const _hoisted_5 = {
159
+ const _hoisted_5$1 = {
160
160
  key: 2,
161
161
  class: "ui-v1-field__addon"
162
162
  };
163
163
  const _hoisted_6 = { class: "ui-v1-field__control" };
164
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
164
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
165
165
  ...{
166
166
  inheritAttrs: false
167
167
  },
@@ -219,7 +219,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
219
219
  "ui-v1-field_readonly": __props.readonly
220
220
  }
221
221
  }, _ctx.$attrs), [
222
- createElementVNode("div", _hoisted_1$4, [
222
+ createElementVNode("div", _hoisted_1$6, [
223
223
  __props.label || _ctx.$slots.label ? (openBlock(), createElementBlock("label", {
224
224
  key: 0,
225
225
  id: `${__props.id}-label`,
@@ -229,9 +229,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
229
229
  renderSlot(_ctx.$slots, "label", {}, () => [
230
230
  createTextVNode(toDisplayString(__props.label), 1)
231
231
  ]),
232
- __props.required ? (openBlock(), createElementBlock("span", _hoisted_3$1, " * ")) : createCommentVNode("", true)
233
- ], 8, _hoisted_2$1)) : createCommentVNode("", true),
234
- __props.hint || _ctx.$slots.hint ? (openBlock(), createElementBlock("span", _hoisted_4, [
232
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_3$3, " * ")) : createCommentVNode("", true)
233
+ ], 8, _hoisted_2$3)) : createCommentVNode("", true),
234
+ __props.hint || _ctx.$slots.hint ? (openBlock(), createElementBlock("span", _hoisted_4$1, [
235
235
  createVNode(unref(UiPopperConnector), null, {
236
236
  default: withCtx(() => [
237
237
  createVNode(unref(UiPopperTarget), {
@@ -269,7 +269,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
269
269
  _: 3
270
270
  })
271
271
  ])) : createCommentVNode("", true),
272
- _ctx.$slots.addon ? (openBlock(), createElementBlock("div", _hoisted_5, [
272
+ _ctx.$slots.addon ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
273
273
  renderSlot(_ctx.$slots, "addon")
274
274
  ])) : createCommentVNode("", true)
275
275
  ]),
@@ -387,11 +387,566 @@ const UiNumberStepper = defineRemoteComponent(
387
387
  "violation"
388
388
  ]
389
389
  );
390
+ const events$1 = [
391
+ "blur",
392
+ "change",
393
+ "focus",
394
+ "keydown",
395
+ "update:value"
396
+ ];
397
+ const UiPageHeaderTitleType = "UiPageHeaderTitle";
398
+ const UiPageHeaderTitle = defineRemoteComponent(UiPageHeaderTitleType, {
399
+ emits: events$1,
400
+ methods: {
401
+ focus: defineRemoteMethod(),
402
+ blur: defineRemoteMethod()
403
+ }
404
+ });
405
+ const _hoisted_1$5 = { class: "ui-v1-page-header__main" };
406
+ const _hoisted_2$2 = {
407
+ key: 0,
408
+ class: "ui-v1-page-header__addon"
409
+ };
410
+ const _hoisted_3$2 = {
411
+ key: 0,
412
+ class: "ui-v1-page-header__actions"
413
+ };
414
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
415
+ ...{
416
+ inheritAttrs: false
417
+ },
418
+ __name: "UiPageHeader",
419
+ props: {
420
+ /** Уникальный идентификатор корневого элемента */
421
+ id: {
422
+ type: null,
423
+ default: void 0
424
+ },
425
+ /** Текст заголовка */
426
+ value: {
427
+ type: null,
428
+ default: ""
429
+ },
430
+ /** Плейсхолдер, отображаемый при отсутствии текста */
431
+ placeholder: {
432
+ type: String,
433
+ default: ""
434
+ },
435
+ /** Текст ошибки для tooltip при пустом невалидном заголовке */
436
+ error: {
437
+ type: String,
438
+ default: ""
439
+ },
440
+ /** Разрешает перейти в режим редактирования по клику */
441
+ editable: {
442
+ type: Boolean,
443
+ default: false
444
+ },
445
+ /** Автоматически переводит фокус во встроенный UiTextbox при входе в режим редактирования */
446
+ autofocus: {
447
+ type: Boolean,
448
+ default: false
449
+ },
450
+ /** Автоматически выделяет текст заголовка при фокусе на встроенном поле */
451
+ autoselect: {
452
+ type: Boolean,
453
+ default: true
454
+ },
455
+ /** Делает встроенное поле только для чтения */
456
+ readonly: {
457
+ type: Boolean,
458
+ default: false
459
+ },
460
+ /** Полностью отключает заголовок */
461
+ disabled: {
462
+ type: Boolean,
463
+ default: false
464
+ },
465
+ /** Помечает встроенное поле как невалидное */
466
+ invalid: {
467
+ type: Boolean,
468
+ default: false
469
+ }
470
+ },
471
+ emits: ["blur", "change", "focus", "keydown", "update:value"],
472
+ setup(__props, { expose: __expose, emit: __emit }) {
473
+ const props = __props;
474
+ const emit = __emit;
475
+ const header = useTemplateRef("header");
476
+ const valueState = ref(props.value === null ? "" : String(props.value));
477
+ const displayInvalid = computed(() => props.invalid && valueState.value === "");
478
+ watch(() => props.value, (nextValue) => {
479
+ valueState.value = nextValue === null ? "" : String(nextValue);
480
+ });
481
+ const onUpdateValue = (value) => {
482
+ valueState.value = String(value);
483
+ emit("update:value", value);
484
+ };
485
+ __expose({
486
+ focus: () => header.value?.focus(),
487
+ blur: () => header.value?.blur()
488
+ });
489
+ return (_ctx, _cache) => {
490
+ return openBlock(), createElementBlock("div", mergeProps({
491
+ class: {
492
+ "ui-v1-page-header": true,
493
+ "ui-v1-page-header_disabled": __props.disabled,
494
+ "ui-v1-page-header_invalid": displayInvalid.value,
495
+ "ui-v1-page-header_readonly": __props.readonly
496
+ }
497
+ }, _ctx.$attrs), [
498
+ createElementVNode("div", _hoisted_1$5, [
499
+ createVNode(unref(UiPopperConnector), null, {
500
+ default: withCtx(() => [
501
+ createVNode(unref(UiPopperTarget), {
502
+ tag: "div",
503
+ class: "ui-v1-page-header__title"
504
+ }, {
505
+ default: withCtx(() => [
506
+ createVNode(unref(UiPageHeaderTitle), {
507
+ id: __props.id,
508
+ ref_key: "header",
509
+ ref: header,
510
+ value: valueState.value,
511
+ placeholder: __props.placeholder,
512
+ error: __props.error,
513
+ invalid: __props.invalid,
514
+ editable: __props.editable,
515
+ autofocus: __props.autofocus,
516
+ autoselect: __props.autoselect,
517
+ readonly: __props.readonly,
518
+ disabled: __props.disabled,
519
+ onBlur: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("blur", $event)),
520
+ onChange: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("change", $event)),
521
+ onFocus: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("focus", $event)),
522
+ onKeydown: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("keydown", $event)),
523
+ "onUpdate:value": onUpdateValue
524
+ }, null, 8, ["id", "value", "placeholder", "error", "invalid", "editable", "autofocus", "autoselect", "readonly", "disabled"])
525
+ ]),
526
+ _: 1
527
+ }),
528
+ displayInvalid.value && __props.error ? (openBlock(), createBlock(unref(UiTooltip), {
529
+ key: 0,
530
+ "target-triggers": {
531
+ hide: [""]
532
+ },
533
+ "offset-main-axis": 8,
534
+ visible: "",
535
+ placement: "right"
536
+ }, {
537
+ default: withCtx(() => [
538
+ createTextVNode(toDisplayString(__props.error), 1)
539
+ ]),
540
+ _: 1
541
+ })) : createCommentVNode("", true)
542
+ ]),
543
+ _: 1
544
+ }),
545
+ _ctx.$slots.addon ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
546
+ renderSlot(_ctx.$slots, "addon")
547
+ ])) : createCommentVNode("", true)
548
+ ]),
549
+ _ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
550
+ renderSlot(_ctx.$slots, "actions")
551
+ ])) : createCommentVNode("", true)
552
+ ], 16);
553
+ };
554
+ }
555
+ });
390
556
  const UiRadioType = "UiRadio";
391
557
  const UiRadio = defineRemoteComponent(
392
558
  UiRadioType,
393
559
  ["click", "focus", "blur"]
394
560
  );
561
+ const _hoisted_1$4 = {
562
+ xmlns: "http://www.w3.org/2000/svg",
563
+ viewBox: "0 0 24 24"
564
+ };
565
+ function render$1(_ctx, _cache) {
566
+ return openBlock(), createElementBlock("svg", _hoisted_1$4, [..._cache[0] || (_cache[0] = [
567
+ createElementVNode("path", {
568
+ fill: "currentColor",
569
+ "fill-rule": "evenodd",
570
+ d: "M2 12C2 6.477 6.477 2 12 2A10 10 0 1 1 2 12m8.73 3.35 5.62-5.62a.5.5 0 0 0 0-.69l-.53-.53a.5.5 0 0 0-.7 0l-4.74 4.74-1.5-1.49a.48.48 0 0 0-.7 0l-.53.53a.5.5 0 0 0 0 .71l2.38 2.35a.48.48 0 0 0 .7 0",
571
+ "clip-rule": "evenodd"
572
+ }, null, -1)
573
+ ])]);
574
+ }
575
+ const IconCheckmarkCircle = { render: render$1 };
576
+ var APPEARANCE = /* @__PURE__ */ ((APPEARANCE2) => {
577
+ APPEARANCE2["DEFAULT"] = "default";
578
+ APPEARANCE2["SECTION"] = "section";
579
+ return APPEARANCE2;
580
+ })(APPEARANCE || {});
581
+ var SIZE$2 = /* @__PURE__ */ ((SIZE2) => {
582
+ SIZE2["SM"] = "sm";
583
+ SIZE2["MD"] = "md";
584
+ SIZE2["LG"] = "lg";
585
+ return SIZE2;
586
+ })(SIZE$2 || {});
587
+ const AppearanceKey = Symbol("UiRadioSwitchAppearance");
588
+ const SizeKey = Symbol("UiRadioSwitchSize");
589
+ const RegistryKey = Symbol("UiRadioSwitchRegistry");
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, {
597
+ register: () => {
598
+ },
599
+ unregister: () => {
600
+ }
601
+ });
602
+ const useUpdate = () => inject(UpdateKey, () => {
603
+ });
604
+ const useFocusableId = () => inject(FocusableIdKey, computed(() => null));
605
+ const useSetFocusableId = () => inject(SetFocusableIdKey, () => {
606
+ });
607
+ const useMoveFocus = () => inject(MoveFocusKey, () => {
608
+ });
609
+ const UiRadioSwitchRootType = "UiRadioSwitchRoot";
610
+ const UiRadioSwitchRoot = defineRemoteComponent(UiRadioSwitchRootType);
611
+ const UiRadioSwitchOptionShellType = "UiRadioSwitchOptionShell";
612
+ const UiRadioSwitchOptionShell = defineRemoteComponent(UiRadioSwitchOptionShellType, {
613
+ emits: [
614
+ "click",
615
+ "focus",
616
+ "blur",
617
+ "keydown"
618
+ ],
619
+ methods: {
620
+ focus: defineRemoteMethod(),
621
+ blur: defineRemoteMethod()
622
+ }
623
+ });
624
+ const _hoisted_1$3 = { class: "ui-v1-radio-switch-option__head" };
625
+ const _hoisted_2$1 = {
626
+ key: 0,
627
+ class: "ui-v1-radio-switch-option__icon"
628
+ };
629
+ const _hoisted_3$1 = {
630
+ key: 1,
631
+ class: "ui-v1-radio-switch-option__label"
632
+ };
633
+ const _hoisted_4 = {
634
+ key: 0,
635
+ class: "ui-v1-radio-switch-option__description"
636
+ };
637
+ const _hoisted_5 = {
638
+ key: 1,
639
+ class: "ui-v1-radio-switch-option__done"
640
+ };
641
+ let counter$1 = 0;
642
+ const __default__ = {};
643
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
644
+ ...__default__,
645
+ ...{
646
+ inheritAttrs: false
647
+ },
648
+ __name: "UiRadioSwitchOption",
649
+ props: {
650
+ /** Идентификатор */
651
+ id: {
652
+ type: String,
653
+ default: () => "ui-v1-radio-switch-option-" + ++counter$1
654
+ },
655
+ /** Заголовок */
656
+ label: {
657
+ type: String,
658
+ default: ""
659
+ },
660
+ /** Значение опции */
661
+ value: {
662
+ type: null,
663
+ required: true
664
+ },
665
+ /** Используется только c appearance=section */
666
+ description: {
667
+ type: String,
668
+ default: ""
669
+ },
670
+ /** Индикатор, заблокирована опция или нет */
671
+ disabled: {
672
+ type: Boolean,
673
+ default: false
674
+ }
675
+ },
676
+ setup(__props) {
677
+ const props = __props;
678
+ const slots = useSlots();
679
+ const appearance = useAppearance();
680
+ const focusableId = useFocusableId();
681
+ const moveFocus = useMoveFocus();
682
+ const shell = useTemplateRef("shell");
683
+ const size = useSize();
684
+ const registry = useRegistry();
685
+ const setFocusableId = useSetFocusableId();
686
+ const update = useUpdate();
687
+ const checked = ref(false);
688
+ const tabIndex = computed(() => {
689
+ return !props.disabled && focusableId.value === props.id ? 0 : -1;
690
+ });
691
+ const onClick = () => {
692
+ if (!props.disabled) {
693
+ setFocusableId(props.id);
694
+ update(props.value);
695
+ }
696
+ };
697
+ const onFocus = () => {
698
+ if (!props.disabled) {
699
+ setFocusableId(props.id);
700
+ }
701
+ };
702
+ const onKeyDown = (event) => {
703
+ if (props.disabled) {
704
+ return;
705
+ }
706
+ switch (event.key) {
707
+ case " ":
708
+ case "Enter":
709
+ setFocusableId(props.id);
710
+ update(props.value);
711
+ return;
712
+ case "ArrowDown":
713
+ case "ArrowRight":
714
+ void moveFocus(props.id, "next");
715
+ return;
716
+ case "ArrowUp":
717
+ case "ArrowLeft":
718
+ void moveFocus(props.id, "prev");
719
+ return;
720
+ case "Home":
721
+ void moveFocus(props.id, "first");
722
+ return;
723
+ case "End":
724
+ void moveFocus(props.id, "last");
725
+ return;
726
+ }
727
+ };
728
+ onBeforeMount(() => {
729
+ registry.register(props.id, {
730
+ getValue: () => props.value,
731
+ checked,
732
+ disabled: () => props.disabled,
733
+ focus: () => shell.value?.focus()
734
+ });
735
+ });
736
+ onBeforeUnmount(() => {
737
+ registry.unregister(props.id);
738
+ });
739
+ return (_ctx, _cache) => {
740
+ return openBlock(), createBlock(unref(UiRadioSwitchOptionShell), mergeProps({
741
+ id: __props.id,
742
+ ref_key: "shell",
743
+ ref: shell,
744
+ appearance: unref(appearance),
745
+ size: unref(size),
746
+ checked: checked.value,
747
+ disabled: __props.disabled,
748
+ tabindex: tabIndex.value
749
+ }, _ctx.$attrs, {
750
+ onClick,
751
+ onFocus,
752
+ onKeydown: [
753
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["space"]),
754
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["enter"]),
755
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["left"]),
756
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["right"]),
757
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["up"]),
758
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["down"]),
759
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["home"]),
760
+ withKeys(withModifiers(onKeyDown, ["prevent"]), ["end"])
761
+ ]
762
+ }), {
763
+ default: withCtx(() => [
764
+ renderSlot(_ctx.$slots, "default", {}, () => [
765
+ createElementVNode("div", _hoisted_1$3, [
766
+ "icon" in unref(slots) ? (openBlock(), createElementBlock("span", _hoisted_2$1, [
767
+ renderSlot(_ctx.$slots, "icon")
768
+ ])) : createCommentVNode("", true),
769
+ "label" in unref(slots) || __props.label ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
770
+ renderSlot(_ctx.$slots, "label", {}, () => [
771
+ createTextVNode(toDisplayString(__props.label), 1)
772
+ ])
773
+ ])) : createCommentVNode("", true)
774
+ ]),
775
+ unref(appearance) === unref(APPEARANCE).SECTION ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
776
+ "description" in unref(slots) || __props.description ? (openBlock(), createElementBlock("div", _hoisted_4, [
777
+ renderSlot(_ctx.$slots, "description", {}, () => [
778
+ createTextVNode(toDisplayString(__props.description), 1)
779
+ ])
780
+ ])) : createCommentVNode("", true),
781
+ checked.value ? (openBlock(), createElementBlock("div", _hoisted_5, [
782
+ renderSlot(_ctx.$slots, "checkmark", {}, () => [
783
+ createVNode(unref(IconCheckmarkCircle))
784
+ ])
785
+ ])) : createCommentVNode("", true)
786
+ ], 64)) : createCommentVNode("", true)
787
+ ])
788
+ ]),
789
+ _: 3
790
+ }, 16, ["id", "appearance", "size", "checked", "disabled", "tabindex", "onKeydown"]);
791
+ };
792
+ }
793
+ });
794
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
795
+ ...{
796
+ inheritAttrs: false
797
+ },
798
+ __name: "UiRadioSwitch",
799
+ props: {
800
+ /** Выбранное значение */
801
+ value: {
802
+ type: null,
803
+ default: null
804
+ },
805
+ /** Список опций */
806
+ options: {
807
+ type: Array,
808
+ default: () => []
809
+ },
810
+ /** Предикат равенства */
811
+ equalFn: {
812
+ type: Function,
813
+ default: (a, b) => a === b
814
+ },
815
+ /** Внешний вид */
816
+ appearance: {
817
+ type: String,
818
+ default: APPEARANCE.DEFAULT,
819
+ validator: (appearance) => Object.values(APPEARANCE).includes(appearance)
820
+ },
821
+ /** Размер */
822
+ size: {
823
+ type: String,
824
+ default: SIZE$2.MD,
825
+ validator: (size) => Object.values(SIZE$2).includes(size)
826
+ },
827
+ /** Растягивание контейнера в зависимости от контента */
828
+ rubber: {
829
+ type: Boolean,
830
+ default: false
831
+ }
832
+ },
833
+ emits: ["change", "update:value"],
834
+ setup(__props, { emit: __emit }) {
835
+ const props = __props;
836
+ const emit = __emit;
837
+ const registry = /* @__PURE__ */ new Map();
838
+ const focusableId = ref(null);
839
+ const getEnabledEntries = () => {
840
+ return Array.from(registry.entries()).filter(([, option]) => !option.disabled());
841
+ };
842
+ const syncFocusableId = (preferredId) => {
843
+ const enabledEntries = getEnabledEntries();
844
+ const enabledIds = new Set(enabledEntries.map(([id]) => id));
845
+ const selectedEntry = enabledEntries.find(([, option]) => option.checked.value);
846
+ if (preferredId && enabledIds.has(preferredId)) {
847
+ focusableId.value = preferredId;
848
+ return;
849
+ }
850
+ if (focusableId.value && enabledIds.has(focusableId.value)) {
851
+ return;
852
+ }
853
+ focusableId.value = selectedEntry?.[0] ?? enabledEntries[0]?.[0] ?? null;
854
+ };
855
+ provide(AppearanceKey, computed(() => props.appearance));
856
+ provide(FocusableIdKey, computed(() => focusableId.value));
857
+ provide(SizeKey, computed(() => props.size));
858
+ provide(SetFocusableIdKey, (id) => {
859
+ syncFocusableId(id);
860
+ });
861
+ provide(RegistryKey, {
862
+ register: (id, option) => {
863
+ if (registry.has(id)) {
864
+ return;
865
+ }
866
+ option.checked.value = props.equalFn(option.getValue(), props.value);
867
+ registry.set(id, option);
868
+ syncFocusableId(option.checked.value ? id : focusableId.value);
869
+ },
870
+ unregister: (id) => {
871
+ registry.delete(id);
872
+ if (focusableId.value === id) {
873
+ syncFocusableId();
874
+ }
875
+ }
876
+ });
877
+ provide(UpdateKey, (newValue) => {
878
+ emit("change", newValue);
879
+ emit("update:value", newValue);
880
+ });
881
+ provide(MoveFocusKey, async (id, direction) => {
882
+ const enabledEntries = getEnabledEntries();
883
+ if (!enabledEntries.length) {
884
+ focusableId.value = null;
885
+ return;
886
+ }
887
+ let targetEntry = enabledEntries[0];
888
+ if (direction === "first") {
889
+ targetEntry = enabledEntries[0];
890
+ } else if (direction === "last") {
891
+ targetEntry = enabledEntries.at(-1) ?? enabledEntries[0];
892
+ } else {
893
+ const currentIndex = enabledEntries.findIndex(([entryId]) => entryId === id);
894
+ const fallbackIndex = focusableId.value ? enabledEntries.findIndex(([entryId]) => entryId === focusableId.value) : -1;
895
+ const baseIndex = currentIndex === -1 ? Math.max(fallbackIndex, 0) : currentIndex;
896
+ const offset = direction === "next" ? 1 : -1;
897
+ const nextIndex = (baseIndex + offset + enabledEntries.length) % enabledEntries.length;
898
+ targetEntry = enabledEntries[nextIndex] ?? enabledEntries[0];
899
+ }
900
+ if (!targetEntry) {
901
+ return;
902
+ }
903
+ const [targetId, target] = targetEntry;
904
+ focusableId.value = targetId;
905
+ emit("change", target.getValue());
906
+ emit("update:value", target.getValue());
907
+ await target.focus();
908
+ });
909
+ watch([() => props.value, () => props.equalFn], ([newValue]) => {
910
+ let selectedId = null;
911
+ Array.from(registry.values()).forEach((option) => {
912
+ option.checked.value = props.equalFn(option.getValue(), newValue);
913
+ });
914
+ selectedId = Array.from(registry.entries()).find(([, option]) => {
915
+ return option.checked.value && !option.disabled();
916
+ })?.[0] ?? null;
917
+ syncFocusableId(selectedId);
918
+ });
919
+ return (_ctx, _cache) => {
920
+ return openBlock(), createBlock(unref(UiRadioSwitchRoot), mergeProps({
921
+ appearance: __props.appearance,
922
+ size: __props.size,
923
+ rubber: __props.rubber
924
+ }, _ctx.$attrs), {
925
+ default: withCtx(() => [
926
+ renderSlot(_ctx.$slots, "default", {}, () => [
927
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
928
+ return openBlock(), createBlock(_sfc_main$7, {
929
+ key: `${option.label}-${index}`,
930
+ label: option.label,
931
+ value: option.value,
932
+ disabled: option.disabled
933
+ }, createSlots({ _: 2 }, [
934
+ _ctx.$slots.icon ? {
935
+ name: "icon",
936
+ fn: withCtx(() => [
937
+ renderSlot(_ctx.$slots, "icon", { option })
938
+ ]),
939
+ key: "0"
940
+ } : void 0
941
+ ]), 1032, ["label", "value", "disabled"]);
942
+ }), 128))
943
+ ])
944
+ ]),
945
+ _: 3
946
+ }, 16, ["appearance", "size", "rubber"]);
947
+ };
948
+ }
949
+ });
395
950
  const UiScrollBoxType = "UiScrollBox";
396
951
  const UiScrollBox = defineRemoteComponent(
397
952
  UiScrollBoxType,
@@ -413,6 +968,30 @@ const UiSwitch = defineRemoteComponent(
413
968
  UiSwitchType,
414
969
  ["click", "focus", "blur"]
415
970
  );
971
+ const UiTabGroupType = "UiTabGroup";
972
+ const UiTabType = "UiTab";
973
+ const UiTab = defineRemoteComponent(
974
+ UiTabType,
975
+ [],
976
+ [
977
+ "default",
978
+ "icon",
979
+ "label",
980
+ "counter",
981
+ "content"
982
+ ]
983
+ );
984
+ const UiTabGroup = defineRemoteComponent(
985
+ UiTabGroupType,
986
+ [
987
+ "layout",
988
+ "change",
989
+ "update:activeId",
990
+ "update:focusableId",
991
+ "update:menuExpanded"
992
+ ],
993
+ ["default"]
994
+ );
416
995
  var ALIGN = /* @__PURE__ */ ((ALIGN2) => {
417
996
  ALIGN2["LEFT"] = "left";
418
997
  ALIGN2["CENTER"] = "center";
@@ -1321,7 +1900,7 @@ const UiSelectOptionType = "UiSelectOption";
1321
1900
  defineRemoteComponent(
1322
1901
  UiSelectOptionType
1323
1902
  );
1324
- const _hoisted_1$3 = {
1903
+ const _hoisted_1$2 = {
1325
1904
  key: 0,
1326
1905
  class: "ui-v1-select__no-results-text"
1327
1906
  };
@@ -1714,7 +2293,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1714
2293
  onHide: close
1715
2294
  }, {
1716
2295
  default: withCtx(() => [
1717
- __props.filterable && optionsRegistry.value.every((o) => !o.isMatched()) && noResult.value ? (openBlock(), createElementBlock("div", _hoisted_1$3, toDisplayString(noResult.value), 1)) : createCommentVNode("", true),
2296
+ __props.filterable && optionsRegistry.value.every((o) => !o.isMatched()) && noResult.value ? (openBlock(), createElementBlock("div", _hoisted_1$2, toDisplayString(noResult.value), 1)) : createCommentVNode("", true),
1718
2297
  renderSlot(_ctx.$slots, "default")
1719
2298
  ]),
1720
2299
  _: 3
@@ -1725,21 +2304,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1725
2304
  };
1726
2305
  }
1727
2306
  });
1728
- const _hoisted_1$2 = {
1729
- xmlns: "http://www.w3.org/2000/svg",
1730
- viewBox: "0 0 24 24"
1731
- };
1732
- function render$1(_ctx, _cache) {
1733
- return openBlock(), createElementBlock("svg", _hoisted_1$2, [..._cache[0] || (_cache[0] = [
1734
- createElementVNode("path", {
1735
- fill: "currentColor",
1736
- "fill-rule": "evenodd",
1737
- d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10A10 10 0 0 0 12 2m0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16m1-9h2.5a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5H13v2.5a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5V13H8.5a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5H11V8.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5z",
1738
- "clip-rule": "evenodd"
1739
- }, null, -1)
1740
- ])]);
1741
- }
1742
- const IconAddCircleOutlined = { render: render$1 };
1743
2307
  const _hoisted_1$1 = {
1744
2308
  xmlns: "http://www.w3.org/2000/svg",
1745
2309
  viewBox: "0 0 24 24"
@@ -1749,12 +2313,12 @@ function render(_ctx, _cache) {
1749
2313
  createElementVNode("path", {
1750
2314
  fill: "currentColor",
1751
2315
  "fill-rule": "evenodd",
1752
- d: "M2 12C2 6.477 6.477 2 12 2A10 10 0 1 1 2 12m8.73 3.35 5.62-5.62a.5.5 0 0 0 0-.69l-.53-.53a.5.5 0 0 0-.7 0l-4.74 4.74-1.5-1.49a.48.48 0 0 0-.7 0l-.53.53a.5.5 0 0 0 0 .71l2.38 2.35a.48.48 0 0 0 .7 0",
2316
+ d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10A10 10 0 0 0 12 2m0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16m1-9h2.5a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5H13v2.5a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5V13H8.5a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5H11V8.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5z",
1753
2317
  "clip-rule": "evenodd"
1754
2318
  }, null, -1)
1755
2319
  ])]);
1756
2320
  }
1757
- const IconCheckmarkCircle = { render };
2321
+ const IconAddCircleOutlined = { render };
1758
2322
  var SIZE = /* @__PURE__ */ ((SIZE2) => {
1759
2323
  SIZE2["XS"] = "xs";
1760
2324
  SIZE2["SM"] = "sm";
@@ -2098,13 +2662,19 @@ const createEndpointRoot = async (channel) => {
2098
2662
  "UiModalWindow",
2099
2663
  "UiModalWindowSurface",
2100
2664
  "UiNumberStepper",
2665
+ "UiPageHeader",
2666
+ "UiPageHeaderTitle",
2101
2667
  "UiPopper",
2102
2668
  "UiPopperConnector",
2103
2669
  "UiPopperTarget",
2104
2670
  "UiRadio",
2671
+ "UiRadioSwitchOptionShell",
2672
+ "UiRadioSwitchRoot",
2105
2673
  "UiScrollBox",
2106
2674
  "UiSlider",
2107
2675
  "UiSwitch",
2676
+ "UiTab",
2677
+ "UiTabGroup",
2108
2678
  "UiSelectPopper",
2109
2679
  "UiSelectTrigger",
2110
2680
  "UiTableBodyCell",
@@ -2210,7 +2780,7 @@ export {
2210
2780
  UiDateType,
2211
2781
  UiError,
2212
2782
  UiErrorType,
2213
- _sfc_main$6 as UiField,
2783
+ _sfc_main$9 as UiField,
2214
2784
  UiInfobox,
2215
2785
  UiInfoboxType,
2216
2786
  UiLink,
@@ -2229,6 +2799,7 @@ export {
2229
2799
  UiModalWindowType,
2230
2800
  UiNumberStepper,
2231
2801
  UiNumberStepperType,
2802
+ _sfc_main$8 as UiPageHeader,
2232
2803
  UiPopper,
2233
2804
  UiPopperConnector,
2234
2805
  UiPopperConnectorType,
@@ -2236,6 +2807,8 @@ export {
2236
2807
  UiPopperTargetType,
2237
2808
  UiPopperType,
2238
2809
  UiRadio,
2810
+ _sfc_main$6 as UiRadioSwitch,
2811
+ _sfc_main$7 as UiRadioSwitchOption,
2239
2812
  UiRadioType,
2240
2813
  UiScrollBox,
2241
2814
  UiScrollBoxType,
@@ -2246,6 +2819,10 @@ export {
2246
2819
  UiSliderType,
2247
2820
  UiSwitch,
2248
2821
  UiSwitchType,
2822
+ UiTab,
2823
+ UiTabGroup,
2824
+ UiTabGroupType,
2825
+ UiTabType,
2249
2826
  _sfc_main$4 as UiTable,
2250
2827
  UiTableBodyCell,
2251
2828
  _sfc_main$5 as UiTableColumn,