@gisce/react-ooui 1.2.0-rc.82 → 1.2.0-rc.84

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.
@@ -689,78 +689,88 @@ const Button = (e) => {
689
689
  }
690
690
  $();
691
691
  }
692
- return /* @__PURE__ */ jsx(Field$1, {
693
- ooui: new Field$2({
694
- ooui: t
695
- }),
696
- children: /* @__PURE__ */ jsxs(Dropdown.Button, {
697
- disabled: !s || y,
698
- onClick: _,
699
- icon: /* @__PURE__ */ jsx(DownOutlined, {}),
700
- type: d ? "primary" : void 0,
701
- overlay: Items({
702
- ooui: n
692
+ if (t.buttons.length === 0)
693
+ return null;
694
+ if (t.buttons.length > 1)
695
+ return /* @__PURE__ */ jsx(Field$1, {
696
+ ooui: new Field$2({
697
+ ooui: t
703
698
  }),
704
- children: [x(), a]
705
- })
706
- });
699
+ children: /* @__PURE__ */ jsxs(Dropdown.Button, {
700
+ disabled: !s || y,
701
+ onClick: _,
702
+ icon: /* @__PURE__ */ jsx(DownOutlined, {}),
703
+ type: d ? "primary" : void 0,
704
+ overlay: /* @__PURE__ */ jsx(Items, {
705
+ ooui: n,
706
+ executeButtonAction: h,
707
+ lang: v
708
+ }),
709
+ children: [x(), a]
710
+ })
711
+ });
712
+ if (r)
713
+ return /* @__PURE__ */ jsx(Button, {
714
+ ooui: r
715
+ });
707
716
  }, Items = (e) => {
708
717
  const {
709
- ooui: t
710
- } = e, r = t.map((n) => {
718
+ ooui: t,
719
+ executeButtonAction: r,
720
+ lang: n
721
+ } = e;
722
+ if (!t)
723
+ return null;
724
+ const o = t.map((a) => {
711
725
  const {
712
- id: o,
713
- caption: a,
714
- activated: s,
715
- buttonType: l,
716
- confirmMessage: c,
717
- icon: u,
718
- context: d,
719
- readOnly: f,
720
- danger: p
721
- } = n, y = useContext(FormContext$2), {
722
- executeButtonAction: m
723
- } = y || {}, [h, b] = useState$1(!1), {
724
- lang: g
725
- } = useContext(LocaleContext$1);
726
- async function v() {
727
- b(!0), await m({
728
- type: l,
729
- action: o,
730
- context: d
726
+ id: s,
727
+ caption: l,
728
+ activated: c,
729
+ buttonType: u,
730
+ confirmMessage: d,
731
+ icon: f,
732
+ context: p,
733
+ readOnly: y,
734
+ danger: m
735
+ } = a, [h, b] = useState$1(!1);
736
+ async function g() {
737
+ b(!0), await r({
738
+ type: u,
739
+ action: s,
740
+ context: p
731
741
  }), b(!1);
732
742
  }
733
- function x() {
734
- if (c) {
743
+ function v() {
744
+ if (d) {
735
745
  showDialog$9({
736
- confirmMessage: c,
737
- lang: g,
746
+ confirmMessage: d,
747
+ lang: n,
738
748
  onOk: () => {
739
- v();
749
+ g();
740
750
  }
741
751
  });
742
752
  return;
743
753
  }
744
- v();
754
+ g();
745
755
  }
746
- function $() {
756
+ function x() {
747
757
  if (h)
748
758
  return /* @__PURE__ */ jsx(LoadingOutlined, {});
749
- if (u) {
750
- const _ = iconMapper(u);
751
- return _ && /* @__PURE__ */ jsx(_, {});
759
+ if (f) {
760
+ const $ = iconMapper(f);
761
+ return $ && /* @__PURE__ */ jsx($, {});
752
762
  }
753
763
  }
754
764
  return /* @__PURE__ */ jsx(Menu.Item, {
755
- disabled: !s || f,
756
- onClick: x,
757
- icon: $(),
758
- danger: p,
759
- children: a
765
+ disabled: !c || y,
766
+ onClick: v,
767
+ icon: x(),
768
+ danger: m,
769
+ children: l
760
770
  });
761
771
  });
762
772
  return /* @__PURE__ */ jsx(Menu, {
763
- children: r
773
+ children: o
764
774
  });
765
775
  }, MODAL_WIDTH_CONSTANT = 0.7;
766
776
  function getWindowDimensions() {
@@ -24158,17 +24168,14 @@ const One2manyInput = (e) => {
24158
24168
  }
24159
24169
  };
24160
24170
  async function Z() {
24161
- k && (B.current = transformDomainForChildWidget({
24162
- domain: await ConnectionProvider.getHandler().evalDomain({
24163
- domain: k,
24164
- values: transformPlainMany2Ones({
24165
- fields: p(),
24166
- values: y()
24167
- }),
24171
+ k && (B.current = await ConnectionProvider.getHandler().evalDomain({
24172
+ domain: k,
24173
+ values: transformPlainMany2Ones({
24168
24174
  fields: p(),
24169
- context: m()
24175
+ values: y()
24170
24176
  }),
24171
- widgetFieldName: X
24177
+ fields: p(),
24178
+ context: m()
24172
24179
  })), h && h.length > 0 && (B.current = B.current.concat(transformDomainForChildWidget({
24173
24180
  domain: h,
24174
24181
  widgetFieldName: X