@gisce/react-ooui 1.1.65 → 1.1.66
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/react-ooui.es.js +61 -51
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +1 -1
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/widgets/custom/ButtonGroup.d.ts +1 -1
- package/dist/widgets/custom/ButtonGroup.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/widgets/custom/ButtonGroup.tsx +31 -21
package/dist/react-ooui.es.js
CHANGED
|
@@ -669,78 +669,88 @@ const Button = (e) => {
|
|
|
669
669
|
}
|
|
670
670
|
b();
|
|
671
671
|
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
onClick: C,
|
|
679
|
-
icon: /* @__PURE__ */ jsx(DownOutlined, {}),
|
|
680
|
-
type: d ? "primary" : void 0,
|
|
681
|
-
overlay: Items({
|
|
682
|
-
ooui: n
|
|
672
|
+
if (t.buttons.length === 0)
|
|
673
|
+
return null;
|
|
674
|
+
if (t.buttons.length > 1)
|
|
675
|
+
return /* @__PURE__ */ jsx(Field$1, {
|
|
676
|
+
ooui: new Field$2({
|
|
677
|
+
ooui: t
|
|
683
678
|
}),
|
|
684
|
-
children:
|
|
685
|
-
|
|
686
|
-
|
|
679
|
+
children: /* @__PURE__ */ jsxs(Dropdown.Button, {
|
|
680
|
+
disabled: !s || h,
|
|
681
|
+
onClick: C,
|
|
682
|
+
icon: /* @__PURE__ */ jsx(DownOutlined, {}),
|
|
683
|
+
type: d ? "primary" : void 0,
|
|
684
|
+
overlay: /* @__PURE__ */ jsx(Items, {
|
|
685
|
+
ooui: n,
|
|
686
|
+
executeButtonAction: y,
|
|
687
|
+
lang: g
|
|
688
|
+
}),
|
|
689
|
+
children: [x(), o]
|
|
690
|
+
})
|
|
691
|
+
});
|
|
692
|
+
if (r)
|
|
693
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
694
|
+
ooui: r
|
|
695
|
+
});
|
|
687
696
|
}, Items = (e) => {
|
|
688
697
|
const {
|
|
689
|
-
ooui: t
|
|
690
|
-
|
|
698
|
+
ooui: t,
|
|
699
|
+
executeButtonAction: r,
|
|
700
|
+
lang: n
|
|
701
|
+
} = e;
|
|
702
|
+
if (!t)
|
|
703
|
+
return null;
|
|
704
|
+
const a = t.map((o) => {
|
|
691
705
|
const {
|
|
692
|
-
id:
|
|
693
|
-
caption:
|
|
694
|
-
activated:
|
|
695
|
-
buttonType:
|
|
696
|
-
confirmMessage:
|
|
697
|
-
icon:
|
|
698
|
-
context:
|
|
699
|
-
readOnly:
|
|
700
|
-
danger:
|
|
701
|
-
} =
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
_(!0), await v({
|
|
708
|
-
type: u,
|
|
709
|
-
action: a,
|
|
710
|
-
context: d
|
|
706
|
+
id: s,
|
|
707
|
+
caption: u,
|
|
708
|
+
activated: l,
|
|
709
|
+
buttonType: c,
|
|
710
|
+
confirmMessage: d,
|
|
711
|
+
icon: f,
|
|
712
|
+
context: p,
|
|
713
|
+
readOnly: h,
|
|
714
|
+
danger: v
|
|
715
|
+
} = o, [y, _] = useState(!1);
|
|
716
|
+
async function m() {
|
|
717
|
+
_(!0), await r({
|
|
718
|
+
type: c,
|
|
719
|
+
action: s,
|
|
720
|
+
context: p
|
|
711
721
|
}), _(!1);
|
|
712
722
|
}
|
|
713
|
-
function
|
|
714
|
-
if (
|
|
723
|
+
function g() {
|
|
724
|
+
if (d) {
|
|
715
725
|
showDialog$9({
|
|
716
|
-
confirmMessage:
|
|
717
|
-
lang:
|
|
726
|
+
confirmMessage: d,
|
|
727
|
+
lang: n,
|
|
718
728
|
onOk: () => {
|
|
719
|
-
|
|
729
|
+
m();
|
|
720
730
|
}
|
|
721
731
|
});
|
|
722
732
|
return;
|
|
723
733
|
}
|
|
724
|
-
|
|
734
|
+
m();
|
|
725
735
|
}
|
|
726
|
-
function
|
|
736
|
+
function x() {
|
|
727
737
|
if (y)
|
|
728
738
|
return /* @__PURE__ */ jsx(LoadingOutlined$3, {});
|
|
729
|
-
if (
|
|
730
|
-
const
|
|
731
|
-
return
|
|
739
|
+
if (f) {
|
|
740
|
+
const b = iconMapper(f);
|
|
741
|
+
return b && /* @__PURE__ */ jsx(b, {});
|
|
732
742
|
}
|
|
733
743
|
}
|
|
734
744
|
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
735
|
-
disabled: !
|
|
736
|
-
onClick:
|
|
737
|
-
icon:
|
|
738
|
-
danger:
|
|
739
|
-
children:
|
|
745
|
+
disabled: !l || h,
|
|
746
|
+
onClick: g,
|
|
747
|
+
icon: x(),
|
|
748
|
+
danger: v,
|
|
749
|
+
children: u
|
|
740
750
|
});
|
|
741
751
|
});
|
|
742
752
|
return /* @__PURE__ */ jsx(Menu, {
|
|
743
|
-
children:
|
|
753
|
+
children: a
|
|
744
754
|
});
|
|
745
755
|
}, Config = {
|
|
746
756
|
requiredClass: "bg-blue-100",
|