@retailcrm/embed-ui-v1-components 0.9.18 → 0.9.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/remote.cjs CHANGED
@@ -2413,7 +2413,9 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
2413
2413
  default: false
2414
2414
  }
2415
2415
  },
2416
- setup(__props) {
2416
+ emits: ["change", "update:value"],
2417
+ setup(__props, { emit: __emit }) {
2418
+ const emit = __emit;
2417
2419
  const props = __props;
2418
2420
  const state = vue.reactive({
2419
2421
  expanded: props.expanded,
@@ -2442,6 +2444,11 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
2442
2444
  const equals = (a, b) => props.equalsFn(a, b);
2443
2445
  const contains = (array, value) => array.some((v) => equals(v, value));
2444
2446
  const navigableOptions = vue.computed(() => optionsRegistry.value.filter((option) => option.isMatched() && !option.disabled));
2447
+ const setValue = (value) => {
2448
+ state.value = value;
2449
+ emit("change", value);
2450
+ emit("update:value", value);
2451
+ };
2445
2452
  vue.provide(RegisterKey, (option) => {
2446
2453
  if (optionsRegistry.value.some((item) => item.id === option.id)) {
2447
2454
  throw new Error(`[UiSelect] Component with id ${option.id} already registered. Unregister it before using again.`);
@@ -2474,12 +2481,12 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
2474
2481
  } else {
2475
2482
  model.push(value);
2476
2483
  }
2477
- state.value = model;
2484
+ setValue(model);
2478
2485
  if (!props.multiple) {
2479
2486
  close();
2480
2487
  }
2481
2488
  } else {
2482
- state.value = value;
2489
+ setValue(value);
2483
2490
  close();
2484
2491
  }
2485
2492
  });
@@ -2533,9 +2540,9 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
2533
2540
  } else {
2534
2541
  model.push(option.value);
2535
2542
  }
2536
- state.value = model;
2543
+ setValue(model);
2537
2544
  } else {
2538
- state.value = option.value;
2545
+ setValue(option.value);
2539
2546
  close();
2540
2547
  }
2541
2548
  };
@@ -2664,7 +2671,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
2664
2671
  }, _ctx.$attrs, {
2665
2672
  onInput,
2666
2673
  onKeydown: onKeyDown,
2667
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => state.value = $event),
2674
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => setValue($event)),
2668
2675
  "onUpdate:expanded": _cache[1] || (_cache[1] = ($event) => state.expanded = $event)
2669
2676
  }), null, 16, ["id", "value", "multiple", "selection", "filter", "filterable", "clearable", "expanded", "invalid", "disabled", "readonly", "placeholder-only", "placeholder", "textbox-size", "width", "active-descendant"]),
2670
2677
  vue.createVNode(vue.unref(UiSelectPopper), {
package/dist/remote.d.ts CHANGED
@@ -643,7 +643,10 @@ declare const __VLS_component_5: DefineComponent<ExtractPropTypes<{
643
643
  type: BooleanConstructor;
644
644
  default: boolean;
645
645
  };
646
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<{
646
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
647
+ change: (value: unknown) => any;
648
+ "update:value": (value: unknown) => any;
649
+ }, string, PublicProps, Readonly<ExtractPropTypes<{
647
650
  /** Атрибут id корневого элемента выпадающего списка. Должен быть уникальным на странице */
648
651
  id: {
649
652
  type: StringConstructor;
@@ -759,7 +762,10 @@ declare const __VLS_component_5: DefineComponent<ExtractPropTypes<{
759
762
  type: BooleanConstructor;
760
763
  default: boolean;
761
764
  };
762
- }>> & Readonly<{}>, {
765
+ }>> & Readonly<{
766
+ onChange?: ((value: unknown) => any) | undefined;
767
+ "onUpdate:value"?: ((value: unknown) => any) | undefined;
768
+ }>, {
763
769
  id: string;
764
770
  placeholder: string;
765
771
  disabled: boolean;
@@ -842,7 +848,7 @@ declare const __VLS_component_5: DefineComponent<ExtractPropTypes<{
842
848
  R,
843
849
  R,
844
850
  OnCleanup
845
- ]) => any : (... /** @type { [typeof __VLS_components.UiPopperConnector, typeof __VLS_components.UiPopperConnector, ] } */args: [
851
+ ]) => any : (...args: [
846
852
  any,
847
853
  any,
848
854
  OnCleanup
@@ -1186,7 +1192,7 @@ declare function __VLS_template_5(): {
1186
1192
  R,
1187
1193
  R,
1188
1194
  OnCleanup
1189
- ]) => any : (... /** @type { [typeof __VLS_components.UiPopperConnector, typeof __VLS_components.UiPopperConnector, ] } */args: [
1195
+ ]) => any : (...args: [
1190
1196
  any,
1191
1197
  any,
1192
1198
  OnCleanup
package/dist/remote.js CHANGED
@@ -2411,7 +2411,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2411
2411
  default: false
2412
2412
  }
2413
2413
  },
2414
- setup(__props) {
2414
+ emits: ["change", "update:value"],
2415
+ setup(__props, { emit: __emit }) {
2416
+ const emit = __emit;
2415
2417
  const props = __props;
2416
2418
  const state = reactive({
2417
2419
  expanded: props.expanded,
@@ -2440,6 +2442,11 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2440
2442
  const equals = (a, b) => props.equalsFn(a, b);
2441
2443
  const contains = (array, value) => array.some((v) => equals(v, value));
2442
2444
  const navigableOptions = computed(() => optionsRegistry.value.filter((option) => option.isMatched() && !option.disabled));
2445
+ const setValue = (value) => {
2446
+ state.value = value;
2447
+ emit("change", value);
2448
+ emit("update:value", value);
2449
+ };
2443
2450
  provide(RegisterKey, (option) => {
2444
2451
  if (optionsRegistry.value.some((item) => item.id === option.id)) {
2445
2452
  throw new Error(`[UiSelect] Component with id ${option.id} already registered. Unregister it before using again.`);
@@ -2472,12 +2479,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2472
2479
  } else {
2473
2480
  model.push(value);
2474
2481
  }
2475
- state.value = model;
2482
+ setValue(model);
2476
2483
  if (!props.multiple) {
2477
2484
  close();
2478
2485
  }
2479
2486
  } else {
2480
- state.value = value;
2487
+ setValue(value);
2481
2488
  close();
2482
2489
  }
2483
2490
  });
@@ -2531,9 +2538,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2531
2538
  } else {
2532
2539
  model.push(option.value);
2533
2540
  }
2534
- state.value = model;
2541
+ setValue(model);
2535
2542
  } else {
2536
- state.value = option.value;
2543
+ setValue(option.value);
2537
2544
  close();
2538
2545
  }
2539
2546
  };
@@ -2662,7 +2669,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2662
2669
  }, _ctx.$attrs, {
2663
2670
  onInput,
2664
2671
  onKeydown: onKeyDown,
2665
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => state.value = $event),
2672
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => setValue($event)),
2666
2673
  "onUpdate:expanded": _cache[1] || (_cache[1] = ($event) => state.expanded = $event)
2667
2674
  }), null, 16, ["id", "value", "multiple", "selection", "filter", "filterable", "clearable", "expanded", "invalid", "disabled", "readonly", "placeholder-only", "placeholder", "textbox-size", "width", "active-descendant"]),
2668
2675
  createVNode(unref(UiSelectPopper), {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@retailcrm/embed-ui-v1-components",
3
3
  "bin": "./bin/embed-ui-v1-components.mjs",
4
4
  "type": "module",
5
- "version": "0.9.18",
5
+ "version": "0.9.19",
6
6
  "license": "MIT",
7
7
  "author": "RetailDriverLLC <integration@retailcrm.ru>",
8
8
  "repository": "git@github.com:retailcrm/embed-ui.git",