@eightshift/ui-components 5.0.4 → 5.0.6
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/{ComboBox-D7KpCYaK.js → ComboBox-BANSEKnb.js} +2 -2
- package/dist/{Dialog-CJVCRT8_.js → Dialog-CmAxaSUv.js} +2 -1
- package/dist/{OverlayArrow-CjvnevpX.js → OverlayArrow-BUfV-5P3.js} +6 -12
- package/dist/PortalProvider---wyKpMr.js +19 -0
- package/dist/components/index.js +2 -0
- package/dist/components/link-input/link-input.js +2 -2
- package/dist/components/menu/menu.js +15 -2
- package/dist/components/modal/modal.js +2 -2
- package/dist/components/option-select/option-select.js +130 -7
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/portal-provider/portal-provider.js +24 -0
- package/dist/components/select/v2/async-select.js +2 -2
- package/dist/components/select/v2/single-select.js +2 -2
- package/dist/components/tooltip/tooltip.js +2 -1
- package/dist/index.js +2 -0
- package/package.json +1 -1
|
@@ -7,11 +7,11 @@ import { a as $a049562f99e7db0e$export$f9c6924e160136d1 } from "./Group-DDPhPPTQ
|
|
|
7
7
|
import { b as $2d73ec29415bd339$export$712718f7aec83d5, a as $3985021b0ad6602f$export$37fb8590cf2c088c } from "./Input-BmDS8Juy.js";
|
|
8
8
|
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "./Label-JS_ob-kh.js";
|
|
9
9
|
import { d as $b1f0cad8af73213b$export$3585ede4d035bf14, e as $b1f0cad8af73213b$export$9145995848b05025, b as $eed445e0843c11d0$export$7ff8f37d2d81a48d, c as $eed445e0843c11d0$export$7c5906fe4f1f2af2 } from "./ListBox-_nDFq8-H.js";
|
|
10
|
-
import { o as $168583247155ddda$export$dc9c12ed27dd1b49, k as $5e3802645cc19319$export$1c3ebcada18427bf, l as $de32f1b87079253c$export$d2f961adcb0afbe, p as $07b14b47974efb58$export$9b9a0cd73afb7ca4 } from "./Dialog-
|
|
10
|
+
import { o as $168583247155ddda$export$dc9c12ed27dd1b49, k as $5e3802645cc19319$export$1c3ebcada18427bf, l as $de32f1b87079253c$export$d2f961adcb0afbe, p as $07b14b47974efb58$export$9b9a0cd73afb7ca4 } from "./Dialog-CmAxaSUv.js";
|
|
11
11
|
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "./Text-BuJgePCv.js";
|
|
12
12
|
import { i as $ae20dd8cbca75726$export$d6daf82dcd84e87c, n as $c5a24bc478652b5f$export$1005530eda016c13, p as $55f9b1ae81f22853$export$2b35b76d2e30e129, e as $e1995378a142960e$export$bf788dd355e3a401 } from "./Collection-uTAXq9Br.js";
|
|
13
13
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
|
|
14
|
-
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6,
|
|
14
|
+
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, f as $9daab02d461809db$export$683480f191c0e3ea } from "./OverlayArrow-BUfV-5P3.js";
|
|
15
15
|
import { f as $325a3faab7a68acd$export$a16aca283550c30d, g as $2a25aae57d74318e$export$a05409b8bb224a5a, d as $453cc9f0df89c0a5$export$77d5aafae4e095b2 } from "./Separator-BN3mjL6q.js";
|
|
16
16
|
import { b as $e5be200c675c3b3a$export$a763b9476acd3eb, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "./useFormValidation-Dy0PXJg5.js";
|
|
17
17
|
import { $ as $a0d645289fe9b86b$export$e7f05e985daf4b5f } from "./useSingleSelectListState-DqhemUIh.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "./Button-DH22t_SM.js";
|
|
2
2
|
import { l as $df56164dff5785e2$export$4338b53315abf666, d as $3ef42575df84b30b$export$9d1611c77c2fe928, f as $8ae05eaa5c114e9c$export$7f54fc3180508a52, e as $bdb11010cef70236$export$f680877a34711e37, k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, p as $ff5963eb1fccf552$export$e08e3b67e392101e, n as $b5e257d569688ac6$export$535bd6ca7f90a273, j as $bdb11010cef70236$export$b4cc09c592e8fdb8, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, o as $64fa3d84918910a7$export$c62b8e45d58ddad9, m as $5dc95899b306f630$export$c9058316764c140e, g as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8 } from "./utils-CZt7LCbO.js";
|
|
3
3
|
import { $ as $4e85f108e88277b8$export$d688439359537581 } from "./RSPContexts-2lR5GG9p.js";
|
|
4
|
-
import {
|
|
4
|
+
import { g as $dd149f63282afbbf$export$f6211563215e3b37, c as $2a41e45df1593e64$export$d39e1813b3bdd0e1, f as $9daab02d461809db$export$683480f191c0e3ea, $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, b as $d3f049242431219c$export$6d3443f2c48bfc20, d as $44f671af83e7d9e0$export$2de4954e8ae13b9f } from "./OverlayArrow-BUfV-5P3.js";
|
|
5
5
|
import { q as $8a26561d2877236e$export$c24ed0104d07eab9, c as $880e95eb8b93ba9a$export$ecf600387e221c37, $ as $7af3f5b51489e0b5$export$253fe78d46329472, a as $7613b1592d41b092$export$6cd28814d92fa9c9, b as $d496c0a20b6e58ec$export$6c8a5aaad13c9852, d as $e1995378a142960e$export$18af5c7a9e9b3664, r as $e1995378a142960e$export$e953bb1cd0f19726, e as $e1995378a142960e$export$bf788dd355e3a401, f as $e1995378a142960e$export$fb8073518f34e6ec, g as $7135fc7d473fd974$export$4feb769f8ddf26c5, h as $7135fc7d473fd974$export$d40e14dec8b060a8, k as $7135fc7d473fd974$export$90e00781bc59d8f9 } from "./Collection-uTAXq9Br.js";
|
|
6
6
|
import { b as $62d8ded9296f3872$export$cfa2225e87938781, c as $982254629710d113$export$b95089534ab7c1fd, d as $453cc9f0df89c0a5$export$77d5aafae4e095b2, e as $d2f53cda644affe3$export$65d2a03b8800d6e3, h as $431f98aba6844401$export$6615d83f6de245ce, i as $72a5793c14baf454$export$e0e4026c12a8bdbb } from "./Separator-BN3mjL6q.js";
|
|
7
7
|
import React__default, { useRef, useContext, useEffect, useMemo, useState, useCallback, forwardRef, createContext } from "react";
|
|
@@ -12,6 +12,7 @@ import { I as $e7801be82b4b2a53$export$4debdb1a3f0fa79e, d as $431fbd86ca7dc216$
|
|
|
12
12
|
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-C9GO0IDB.js";
|
|
13
13
|
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-BbYZoHvX.js";
|
|
14
14
|
import { c as $9bf71ea28793e738$export$1258395f99bf9cbf, b as $9bf71ea28793e738$export$20e40289641fbbb6 } from "./FocusScope-BEPI2m7u.js";
|
|
15
|
+
import { a as $96b38030c423d352$export$9fc1347d4195ccb3 } from "./PortalProvider---wyKpMr.js";
|
|
15
16
|
import { $ as $dbSRa$reactdom } from "./index-CFozsmNS.js";
|
|
16
17
|
import { b as $f39a9eba43920ace$export$b5d7cc18bb8d2b59 } from "./Hidden-rE6uR-lr.js";
|
|
17
18
|
import { a as $9ab94262bd0047c7$export$420e68273165f4ec } from "./useFocusRing-Bv0UJQl8.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "./utils-CZt7LCbO.js";
|
|
2
2
|
import { r as reactDomExports } from "./index-CFozsmNS.js";
|
|
3
|
-
import React__default, { useEffect, useState, useCallback, useRef,
|
|
3
|
+
import React__default, { useEffect, useState, useCallback, useRef, forwardRef, createContext } from "react";
|
|
4
4
|
import { C as $c87311424ea30a05$export$78551043582a6a98, b as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./useHover-C2SkI1Fn.js";
|
|
5
5
|
import { $ as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "./number-CHmNj-oR.js";
|
|
6
6
|
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-BbYZoHvX.js";
|
|
@@ -562,11 +562,6 @@ function $2a41e45df1593e64$var$translateRTL(position, direction) {
|
|
|
562
562
|
if (direction === "rtl") return position.replace("start", "right").replace("end", "left");
|
|
563
563
|
return position.replace("start", "left").replace("end", "right");
|
|
564
564
|
}
|
|
565
|
-
const $96b38030c423d352$export$60d741e20e0aa309 = /* @__PURE__ */ createContext({});
|
|
566
|
-
function $96b38030c423d352$export$9fc1347d4195ccb3() {
|
|
567
|
-
var _useContext;
|
|
568
|
-
return (_useContext = useContext($96b38030c423d352$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {};
|
|
569
|
-
}
|
|
570
565
|
function $fc909762b330b746$export$61c6a8c84e605fb6(props) {
|
|
571
566
|
let [isOpen, setOpen] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(props.isOpen, props.defaultOpen || false, props.onOpenChange);
|
|
572
567
|
const open = useCallback(() => {
|
|
@@ -628,10 +623,9 @@ export {
|
|
|
628
623
|
$fc909762b330b746$export$61c6a8c84e605fb6 as $,
|
|
629
624
|
$d3f049242431219c$export$45fda7c47f93fd48 as a,
|
|
630
625
|
$d3f049242431219c$export$6d3443f2c48bfc20 as b,
|
|
631
|
-
$
|
|
632
|
-
$
|
|
633
|
-
$44f671af83e7d9e0$export$
|
|
634
|
-
$
|
|
635
|
-
$
|
|
636
|
-
$dd149f63282afbbf$export$f6211563215e3b37 as h
|
|
626
|
+
$2a41e45df1593e64$export$d39e1813b3bdd0e1 as c,
|
|
627
|
+
$44f671af83e7d9e0$export$2de4954e8ae13b9f as d,
|
|
628
|
+
$44f671af83e7d9e0$export$746d02f47f4d381 as e,
|
|
629
|
+
$9daab02d461809db$export$683480f191c0e3ea as f,
|
|
630
|
+
$dd149f63282afbbf$export$f6211563215e3b37 as g
|
|
637
631
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React__default, { createContext, useContext } from "react";
|
|
2
|
+
const $96b38030c423d352$export$60d741e20e0aa309 = /* @__PURE__ */ createContext({});
|
|
3
|
+
function $96b38030c423d352$export$78efe591171d7d45(props) {
|
|
4
|
+
let { getContainer } = props;
|
|
5
|
+
let { getContainer: ctxGetContainer } = $96b38030c423d352$export$9fc1347d4195ccb3();
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement($96b38030c423d352$export$60d741e20e0aa309.Provider, {
|
|
7
|
+
value: {
|
|
8
|
+
getContainer: getContainer === null ? void 0 : getContainer !== null && getContainer !== void 0 ? getContainer : ctxGetContainer
|
|
9
|
+
}
|
|
10
|
+
}, props.children);
|
|
11
|
+
}
|
|
12
|
+
function $96b38030c423d352$export$9fc1347d4195ccb3() {
|
|
13
|
+
var _useContext;
|
|
14
|
+
return (_useContext = useContext($96b38030c423d352$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {};
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
$96b38030c423d352$export$78efe591171d7d45 as $,
|
|
18
|
+
$96b38030c423d352$export$9fc1347d4195ccb3 as a
|
|
19
|
+
};
|
package/dist/components/index.js
CHANGED
|
@@ -29,6 +29,7 @@ import { MiniResponsive } from "./responsive/mini-responsive.js";
|
|
|
29
29
|
import { Notice } from "./notice/notice.js";
|
|
30
30
|
import { NumberPicker } from "./number-picker/number-picker.js";
|
|
31
31
|
import { Popover, TriggeredPopover } from "./popover/popover.js";
|
|
32
|
+
import { PortalProvider } from "./portal-provider/portal-provider.js";
|
|
32
33
|
import { RadioButton, RadioButtonGroup } from "./radio/radio.js";
|
|
33
34
|
import { Repeater } from "./repeater/repeater.js";
|
|
34
35
|
import { RepeaterItem } from "./repeater/repeater-item.js";
|
|
@@ -101,6 +102,7 @@ export {
|
|
|
101
102
|
OptionsPanelIntro,
|
|
102
103
|
OptionsPanelSection,
|
|
103
104
|
Popover,
|
|
105
|
+
PortalProvider,
|
|
104
106
|
RSClearIndicator,
|
|
105
107
|
RSDropdownIndicator,
|
|
106
108
|
RSMultiValue,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-DH22t_SM.js";
|
|
3
|
-
import { $ as $f86e6c1ec7da6ebb$export$bc3384a35de93d66, a as $d01f2c01039c0eec$export$72b9695b8216309a } from "../../ComboBox-
|
|
3
|
+
import { $ as $f86e6c1ec7da6ebb$export$bc3384a35de93d66, a as $d01f2c01039c0eec$export$72b9695b8216309a } from "../../ComboBox-BANSEKnb.js";
|
|
4
4
|
import { $ as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 } from "../../Group-DDPhPPTQ.js";
|
|
5
5
|
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-BmDS8Juy.js";
|
|
6
6
|
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-JS_ob-kh.js";
|
|
7
7
|
import { $ as $eed445e0843c11d0$export$41f133550aa26f48, a as $eed445e0843c11d0$export$a11e76429ed99b4 } from "../../ListBox-_nDFq8-H.js";
|
|
8
|
-
import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-
|
|
8
|
+
import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-CmAxaSUv.js";
|
|
9
9
|
import { _ as __ } from "../../default-i18n-CT_oS1Fy.js";
|
|
10
10
|
import { icons } from "../../icons/icons.js";
|
|
11
11
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { $ as $72a5793c14baf454$export$8b251419efc915eb, a as $431f98aba6844401$export$1ff3c3f08ae963c0 } from "../../Separator-BN3mjL6q.js";
|
|
3
|
-
import { a as $3674c52c6b3c5bce$export$27d2ad3c5815583e, b as $3674c52c6b3c5bce$export$d9b273488cd8ce6f, c as $3674c52c6b3c5bce$export$2ce376c2cc3355c8, d as $3674c52c6b3c5bce$export$4b1545b4f2016d26, e as $3674c52c6b3c5bce$export$ecabc99eeffab7ca } from "../../Dialog-
|
|
3
|
+
import { a as $3674c52c6b3c5bce$export$27d2ad3c5815583e, b as $3674c52c6b3c5bce$export$d9b273488cd8ce6f, c as $3674c52c6b3c5bce$export$2ce376c2cc3355c8, d as $3674c52c6b3c5bce$export$4b1545b4f2016d26, e as $3674c52c6b3c5bce$export$ecabc99eeffab7ca } from "../../Dialog-CmAxaSUv.js";
|
|
4
4
|
import { icons } from "../../icons/icons.js";
|
|
5
5
|
import { Button } from "../button/button.js";
|
|
6
6
|
import { Popover } from "../popover/popover.js";
|
|
@@ -242,6 +242,7 @@ const MenuItem = (props) => {
|
|
|
242
242
|
* @component
|
|
243
243
|
* @param {Object} props - Component props.
|
|
244
244
|
* @param {JSX.Element} props.trigger - The trigger button for the submenu. **This should be a `MenuItem`.**
|
|
245
|
+
* @param {boolean} [props.keepOpen=false] - If `true`, the submenu will not close when an item is selected.
|
|
245
246
|
* @param {Object} [props.popoverProps] - Props to pass to the popover.
|
|
246
247
|
*
|
|
247
248
|
* @returns {JSX.Element} The SubMenuItem component.
|
|
@@ -251,7 +252,18 @@ const MenuItem = (props) => {
|
|
|
251
252
|
* @preserve
|
|
252
253
|
*/
|
|
253
254
|
const SubMenuItem = (props) => {
|
|
254
|
-
const { children, trigger, popoverProps } = props;
|
|
255
|
+
const { children, trigger, popoverProps, keepOpen } = props;
|
|
256
|
+
let additionalProps = {};
|
|
257
|
+
if (keepOpen) {
|
|
258
|
+
additionalProps = {
|
|
259
|
+
...additionalProps,
|
|
260
|
+
selectionMode: "multiple",
|
|
261
|
+
selectedKeys: [],
|
|
262
|
+
onSelectionChange: () => {
|
|
263
|
+
},
|
|
264
|
+
items: []
|
|
265
|
+
};
|
|
266
|
+
}
|
|
255
267
|
return /* @__PURE__ */ jsxs($3674c52c6b3c5bce$export$ecabc99eeffab7ca, { children: [
|
|
256
268
|
cloneElement(trigger, {
|
|
257
269
|
endIcon: /* @__PURE__ */ jsx("span", { className: "es:text-secondary-400", children: icons.caretRightFill })
|
|
@@ -268,6 +280,7 @@ const SubMenuItem = (props) => {
|
|
|
268
280
|
{
|
|
269
281
|
"aria-label": props["aria-label"] ?? __("Submenu", "eightshift-ui-components"),
|
|
270
282
|
className: "es:any-focus:outline-hidden",
|
|
283
|
+
...additionalProps,
|
|
271
284
|
children
|
|
272
285
|
}
|
|
273
286
|
)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { h as $a11501f3d1d39e6c$export$ea8f71083e90600f, i as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18, j as $337b884510726a0d$export$14c98a7594375490, k as $5e3802645cc19319$export$1c3ebcada18427bf, l as $de32f1b87079253c$export$d2f961adcb0afbe, m as $86ea4cb521eb2e37$export$2317d149ed6f78c4, n as $337b884510726a0d$export$c6fdb837b070b4ff, g as $de32f1b87079253c$export$2e1e1122cf0cba88, f as $de32f1b87079253c$export$3ddf2d174ce01153 } from "../../Dialog-
|
|
2
|
+
import { h as $a11501f3d1d39e6c$export$ea8f71083e90600f, i as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18, j as $337b884510726a0d$export$14c98a7594375490, k as $5e3802645cc19319$export$1c3ebcada18427bf, l as $de32f1b87079253c$export$d2f961adcb0afbe, m as $86ea4cb521eb2e37$export$2317d149ed6f78c4, n as $337b884510726a0d$export$c6fdb837b070b4ff, g as $de32f1b87079253c$export$2e1e1122cf0cba88, f as $de32f1b87079253c$export$3ddf2d174ce01153 } from "../../Dialog-CmAxaSUv.js";
|
|
3
3
|
import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-ba38ScjJ.js";
|
|
4
4
|
import { n as $b5e257d569688ac6$export$535bd6ca7f90a273, d as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, b as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-CZt7LCbO.js";
|
|
5
5
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
6
6
|
import React__default, { useState, useEffect, forwardRef, useContext, createContext, useRef, useMemo } from "react";
|
|
7
|
-
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, b as $d3f049242431219c$export$6d3443f2c48bfc20 } from "../../OverlayArrow-
|
|
7
|
+
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, b as $d3f049242431219c$export$6d3443f2c48bfc20 } from "../../OverlayArrow-BUfV-5P3.js";
|
|
8
8
|
import { Button } from "../button/button.js";
|
|
9
9
|
import { _ as __ } from "../../default-i18n-CT_oS1Fy.js";
|
|
10
10
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment } from "react";
|
|
3
3
|
import { icons } from "../../icons/icons.js";
|
|
4
4
|
import { BaseControl } from "../base-control/base-control.js";
|
|
5
5
|
import { ButtonGroup } from "../button/button.js";
|
|
6
|
-
import {
|
|
6
|
+
import { SubMenuItem, MenuSeparator, MenuItem, Menu } from "../menu/menu.js";
|
|
7
7
|
import { RadioButtonGroup, RadioButton } from "../radio/radio.js";
|
|
8
8
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
9
9
|
import { ToggleButton } from "../toggle-button/toggle-button.js";
|
|
@@ -38,7 +38,7 @@ import { _ as __ } from "../../default-i18n-CT_oS1Fy.js";
|
|
|
38
38
|
*
|
|
39
39
|
* @returns {JSX.Element} The OptionSelect component.
|
|
40
40
|
*
|
|
41
|
-
* @typedef {'toggleButtons' | 'toggleButtonsSplit' | 'radios' | 'radiosSegmented' | 'menu'} OptionSelectType
|
|
41
|
+
* @typedef {'toggleButtons' | 'toggleButtonsSplit' | 'radios' | 'radiosSegmented' | 'menu' | 'submenu' | 'standaloneMenuItems'} OptionSelectType
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
44
|
* <OptionSelect
|
|
@@ -55,7 +55,7 @@ import { _ as __ } from "../../default-i18n-CT_oS1Fy.js";
|
|
|
55
55
|
* @preserve
|
|
56
56
|
*/
|
|
57
57
|
const OptionSelect = (props) => {
|
|
58
|
-
var _a;
|
|
58
|
+
var _a, _b;
|
|
59
59
|
const {
|
|
60
60
|
icon,
|
|
61
61
|
label,
|
|
@@ -96,6 +96,129 @@ const OptionSelect = (props) => {
|
|
|
96
96
|
if (type === "radiosSegmented") {
|
|
97
97
|
radioDesign = "segmented";
|
|
98
98
|
}
|
|
99
|
+
if (type === "submenu") {
|
|
100
|
+
return /* @__PURE__ */ jsxs(
|
|
101
|
+
SubMenuItem,
|
|
102
|
+
{
|
|
103
|
+
trigger: /* @__PURE__ */ jsx(
|
|
104
|
+
MenuItem,
|
|
105
|
+
{
|
|
106
|
+
icon: !noTriggerIcon && (icon ?? // eslint-disable-next-line no-nested-ternary
|
|
107
|
+
(currentItem ? typeof (currentItem == null ? void 0 : currentItem.icon) === "string" ? (_a = icons) == null ? void 0 : _a[currentItem == null ? void 0 : currentItem.icon] : currentItem == null ? void 0 : currentItem.icon : (noTriggerLabel || noTriggerIcon) && notSetLabel)),
|
|
108
|
+
children: /* @__PURE__ */ jsx(
|
|
109
|
+
RichLabel,
|
|
110
|
+
{
|
|
111
|
+
label: noTriggerLabel ? null : label ?? (currentItem == null ? void 0 : currentItem.label) ?? notSetLabel,
|
|
112
|
+
subtitle: subtitle === true ? currentItem == null ? void 0 : currentItem.label : subtitle,
|
|
113
|
+
noColor: true
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
...wrapperProps,
|
|
119
|
+
children: [
|
|
120
|
+
options.map(
|
|
121
|
+
({
|
|
122
|
+
label: optionLabel,
|
|
123
|
+
value: optionValue,
|
|
124
|
+
icon: optionIcon,
|
|
125
|
+
endIcon: optionEndIcon,
|
|
126
|
+
ariaLabel: optionAriaLabel,
|
|
127
|
+
subtitle: optionSubtitle,
|
|
128
|
+
separator: optionHasSeparator,
|
|
129
|
+
sectionTitle: optionSectionTitle,
|
|
130
|
+
shortcut: optionShortcut,
|
|
131
|
+
disabled: optionDisabled
|
|
132
|
+
}) => {
|
|
133
|
+
var _a2, _b2;
|
|
134
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
135
|
+
(optionHasSeparator === true || optionHasSeparator === "above") && /* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
136
|
+
optionSectionTitle && /* @__PURE__ */ jsx(MenuItem, { disabled: true, children: optionSectionTitle }),
|
|
137
|
+
/* @__PURE__ */ jsxs(
|
|
138
|
+
MenuItem,
|
|
139
|
+
{
|
|
140
|
+
selected: value === optionValue,
|
|
141
|
+
disabled: optionDisabled || disabled,
|
|
142
|
+
className: itemClassName,
|
|
143
|
+
icon: !noItemIcon && (typeof optionIcon === "string" ? (_a2 = icons) == null ? void 0 : _a2[optionIcon] : optionIcon),
|
|
144
|
+
endIcon: !noItemIcon && (typeof optionEndIcon === "string" ? (_b2 = icons) == null ? void 0 : _b2[optionEndIcon] : optionEndIcon),
|
|
145
|
+
"aria-label": optionAriaLabel ?? optionLabel,
|
|
146
|
+
onClick: () => onChange(optionValue),
|
|
147
|
+
shortcut: optionShortcut,
|
|
148
|
+
...itemProps,
|
|
149
|
+
children: [
|
|
150
|
+
!noItemLabel && !optionSubtitle && optionLabel,
|
|
151
|
+
!noItemLabel && optionSubtitle && /* @__PURE__ */ jsx(
|
|
152
|
+
RichLabel,
|
|
153
|
+
{
|
|
154
|
+
label: optionLabel,
|
|
155
|
+
subtitle: optionSubtitle,
|
|
156
|
+
noColor: true
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
optionHasSeparator === "below" && /* @__PURE__ */ jsx(MenuSeparator, {})
|
|
163
|
+
] }, optionValue);
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
children
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
if (type === "standaloneMenuItems") {
|
|
172
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
173
|
+
options.map(
|
|
174
|
+
({
|
|
175
|
+
label: optionLabel,
|
|
176
|
+
value: optionValue,
|
|
177
|
+
icon: optionIcon,
|
|
178
|
+
endIcon: optionEndIcon,
|
|
179
|
+
ariaLabel: optionAriaLabel,
|
|
180
|
+
subtitle: optionSubtitle,
|
|
181
|
+
separator: optionHasSeparator,
|
|
182
|
+
sectionTitle: optionSectionTitle,
|
|
183
|
+
shortcut: optionShortcut,
|
|
184
|
+
disabled: optionDisabled
|
|
185
|
+
}) => {
|
|
186
|
+
var _a2, _b2;
|
|
187
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
188
|
+
(optionHasSeparator === true || optionHasSeparator === "above") && /* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
189
|
+
optionSectionTitle && /* @__PURE__ */ jsx(MenuItem, { disabled: true, children: optionSectionTitle }),
|
|
190
|
+
/* @__PURE__ */ jsxs(
|
|
191
|
+
MenuItem,
|
|
192
|
+
{
|
|
193
|
+
selected: value === optionValue,
|
|
194
|
+
disabled: optionDisabled || disabled,
|
|
195
|
+
className: itemClassName,
|
|
196
|
+
icon: !noItemIcon && (typeof optionIcon === "string" ? (_a2 = icons) == null ? void 0 : _a2[optionIcon] : optionIcon),
|
|
197
|
+
endIcon: !noItemIcon && (typeof optionEndIcon === "string" ? (_b2 = icons) == null ? void 0 : _b2[optionEndIcon] : optionEndIcon),
|
|
198
|
+
"aria-label": optionAriaLabel ?? optionLabel,
|
|
199
|
+
onClick: () => onChange(optionValue),
|
|
200
|
+
shortcut: optionShortcut,
|
|
201
|
+
...itemProps,
|
|
202
|
+
children: [
|
|
203
|
+
!noItemLabel && !optionSubtitle && optionLabel,
|
|
204
|
+
!noItemLabel && optionSubtitle && /* @__PURE__ */ jsx(
|
|
205
|
+
RichLabel,
|
|
206
|
+
{
|
|
207
|
+
label: optionLabel,
|
|
208
|
+
subtitle: optionSubtitle,
|
|
209
|
+
noColor: true
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
optionHasSeparator === "below" && /* @__PURE__ */ jsx(MenuSeparator, {})
|
|
216
|
+
] }, optionValue);
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
children
|
|
220
|
+
] });
|
|
221
|
+
}
|
|
99
222
|
return /* @__PURE__ */ jsxs(
|
|
100
223
|
BaseControl,
|
|
101
224
|
{
|
|
@@ -188,7 +311,7 @@ const OptionSelect = (props) => {
|
|
|
188
311
|
{
|
|
189
312
|
triggerLabel: noTriggerLabel ? null : (currentItem == null ? void 0 : currentItem.label) ?? notSetLabel,
|
|
190
313
|
triggerIcon: !noTriggerIcon && // eslint-disable-next-line no-nested-ternary
|
|
191
|
-
(currentItem ? typeof (currentItem == null ? void 0 : currentItem.icon) === "string" ? (
|
|
314
|
+
(currentItem ? typeof (currentItem == null ? void 0 : currentItem.icon) === "string" ? (_b = icons) == null ? void 0 : _b[currentItem == null ? void 0 : currentItem.icon] : currentItem == null ? void 0 : currentItem.icon : (noTriggerLabel || noTriggerIcon) && notSetLabel),
|
|
192
315
|
tooltip: noTriggerLabel ? /* @__PURE__ */ jsx(
|
|
193
316
|
RichLabel,
|
|
194
317
|
{
|
|
@@ -218,7 +341,7 @@ const OptionSelect = (props) => {
|
|
|
218
341
|
shortcut: optionShortcut,
|
|
219
342
|
disabled: optionDisabled
|
|
220
343
|
}) => {
|
|
221
|
-
var _a2,
|
|
344
|
+
var _a2, _b2;
|
|
222
345
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
223
346
|
(optionHasSeparator === true || optionHasSeparator === "above") && /* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
224
347
|
optionSectionTitle && /* @__PURE__ */ jsx(MenuItem, { disabled: true, children: optionSectionTitle }),
|
|
@@ -229,7 +352,7 @@ const OptionSelect = (props) => {
|
|
|
229
352
|
disabled: optionDisabled || disabled,
|
|
230
353
|
className: itemClassName,
|
|
231
354
|
icon: !noItemIcon && (typeof optionIcon === "string" ? (_a2 = icons) == null ? void 0 : _a2[optionIcon] : optionIcon),
|
|
232
|
-
endIcon: !noItemIcon && (typeof optionEndIcon === "string" ? (
|
|
355
|
+
endIcon: !noItemIcon && (typeof optionEndIcon === "string" ? (_b2 = icons) == null ? void 0 : _b2[optionEndIcon] : optionEndIcon),
|
|
233
356
|
"aria-label": optionAriaLabel ?? optionLabel,
|
|
234
357
|
onClick: () => onChange(optionValue),
|
|
235
358
|
shortcut: optionShortcut,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d, f as $de32f1b87079253c$export$3ddf2d174ce01153, g as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-
|
|
2
|
+
import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d, f as $de32f1b87079253c$export$3ddf2d174ce01153, g as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-CmAxaSUv.js";
|
|
3
3
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
4
4
|
import { _ as __ } from "../../default-i18n-CT_oS1Fy.js";
|
|
5
5
|
import { Button } from "../button/button.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { $ as $96b38030c423d352$export$78efe591171d7d45 } from "../../PortalProvider---wyKpMr.js";
|
|
3
|
+
/**
|
|
4
|
+
* Component that allows changing the default target for transient components like `Menu`, `Popover`, etc.
|
|
5
|
+
*
|
|
6
|
+
* @component
|
|
7
|
+
* @param {Object} props - Component props.
|
|
8
|
+
* @param {JSX.Element|null} [props.portalElement] - Element to use as the portal container.
|
|
9
|
+
*
|
|
10
|
+
* @returns {JSX.Element} The Menu component.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <PortalProvider>
|
|
14
|
+
* ...
|
|
15
|
+
* </PortalProvider>
|
|
16
|
+
*
|
|
17
|
+
* @preserve
|
|
18
|
+
*/
|
|
19
|
+
const PortalProvider = ({ children, portalElement }) => {
|
|
20
|
+
return /* @__PURE__ */ jsx($96b38030c423d352$export$78efe591171d7d45, { getContainer: () => portalElement, children });
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
PortalProvider
|
|
24
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { _ as __ } from "../../../default-i18n-CT_oS1Fy.js";
|
|
3
3
|
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../../Button-DH22t_SM.js";
|
|
4
|
-
import { $ as $f86e6c1ec7da6ebb$export$bc3384a35de93d66, a as $d01f2c01039c0eec$export$72b9695b8216309a, b as $d01f2c01039c0eec$export$c02625b26074192c } from "../../../ComboBox-
|
|
4
|
+
import { $ as $f86e6c1ec7da6ebb$export$bc3384a35de93d66, a as $d01f2c01039c0eec$export$72b9695b8216309a, b as $d01f2c01039c0eec$export$c02625b26074192c } from "../../../ComboBox-BANSEKnb.js";
|
|
5
5
|
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../../Input-BmDS8Juy.js";
|
|
6
6
|
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../../Label-JS_ob-kh.js";
|
|
7
7
|
import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../../ListBox-_nDFq8-H.js";
|
|
8
|
-
import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-
|
|
8
|
+
import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-CmAxaSUv.js";
|
|
9
9
|
import { $ as $514c0188e459b4c0$export$5f1af8db9871e1d6 } from "../../../Text-BuJgePCv.js";
|
|
10
10
|
import { OptionItemBase } from "./shared.js";
|
|
11
11
|
import { RichLabel } from "../../rich-label/rich-label.js";
|
|
@@ -4,14 +4,14 @@ import { BaseControl } from "../../base-control/base-control.js";
|
|
|
4
4
|
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1, $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../../Button-DH22t_SM.js";
|
|
5
5
|
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../../Label-JS_ob-kh.js";
|
|
6
6
|
import { b as $eed445e0843c11d0$export$7ff8f37d2d81a48d, c as $eed445e0843c11d0$export$7c5906fe4f1f2af2, $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../../ListBox-_nDFq8-H.js";
|
|
7
|
-
import { o as $168583247155ddda$export$dc9c12ed27dd1b49, l as $de32f1b87079253c$export$d2f961adcb0afbe, p as $07b14b47974efb58$export$9b9a0cd73afb7ca4, $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-
|
|
7
|
+
import { o as $168583247155ddda$export$dc9c12ed27dd1b49, l as $de32f1b87079253c$export$d2f961adcb0afbe, p as $07b14b47974efb58$export$9b9a0cd73afb7ca4, $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-CmAxaSUv.js";
|
|
8
8
|
import { d as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $bdb11010cef70236$export$f680877a34711e37, p as $ff5963eb1fccf552$export$e08e3b67e392101e, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, b as $64fa3d84918910a7$export$4d86445c2cf5e3, g as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, h as $64fa3d84918910a7$export$ef03459518577ad4, i as $64fa3d84918910a7$export$2881499e37b75b9a, c as clsx } from "../../../utils-CZt7LCbO.js";
|
|
9
9
|
import { a as $2baaea4c71418dea$export$294aa081a6c6f55d, $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../../FieldError-DHrSdE_Q.js";
|
|
10
10
|
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../../Form-Cq3fu75_.js";
|
|
11
11
|
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../../Text-BuJgePCv.js";
|
|
12
12
|
import { o as $fb3050f43d946246$export$e32c88dfddc6e1d8, e as $e1995378a142960e$export$bf788dd355e3a401 } from "../../../Collection-uTAXq9Br.js";
|
|
13
13
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../../filterDOMProps-EDDcM64A.js";
|
|
14
|
-
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6,
|
|
14
|
+
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, f as $9daab02d461809db$export$683480f191c0e3ea } from "../../../OverlayArrow-BUfV-5P3.js";
|
|
15
15
|
import React__default, { useMemo, useRef, useState, forwardRef, createContext, useContext, useCallback, cloneElement } from "react";
|
|
16
16
|
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../../useLocalizedStringFormatter-C9GO0IDB.js";
|
|
17
17
|
import { a as $e93e671b31057976$export$b8473d3665f3a75a, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "../../../useFormValidation-Dy0PXJg5.js";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, c as $2a41e45df1593e64$export$d39e1813b3bdd0e1, b as $d3f049242431219c$export$6d3443f2c48bfc20, d as $44f671af83e7d9e0$export$2de4954e8ae13b9f, e as $44f671af83e7d9e0$export$746d02f47f4d381 } from "../../OverlayArrow-BUfV-5P3.js";
|
|
3
3
|
import { n as $b5e257d569688ac6$export$535bd6ca7f90a273, d as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $bdb11010cef70236$export$f680877a34711e37, i as $64fa3d84918910a7$export$2881499e37b75b9a, a as $64fa3d84918910a7$export$29f1550f4b0d4415, k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, b as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../../utils-CZt7LCbO.js";
|
|
4
4
|
import { $ as $6179b936705e76d3$export$ae780daf29e6d456, a as $f645667febf57a63$export$4c014de7c8940b4c, x as $507fabe10e71c6fb$export$630ff653c5ada6a9, n as $507fabe10e71c6fb$export$b9b3dfddab17db27, y as $f645667febf57a63$export$13f3202a3e5ddd5 } from "../../useHover-C2SkI1Fn.js";
|
|
5
5
|
import React__default, { useContext, useState, useMemo, useRef, useEffect, forwardRef, createContext } from "react";
|
|
6
6
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
7
|
+
import { a as $96b38030c423d352$export$9fc1347d4195ccb3 } from "../../PortalProvider---wyKpMr.js";
|
|
7
8
|
import { $ as $dbSRa$reactdom } from "../../index-CFozsmNS.js";
|
|
8
9
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
9
10
|
const $f57aed4a881a3485$var$Context = /* @__PURE__ */ React__default.createContext(null);
|
package/dist/index.js
CHANGED
|
@@ -29,6 +29,7 @@ import { MiniResponsive } from "./components/responsive/mini-responsive.js";
|
|
|
29
29
|
import { Notice } from "./components/notice/notice.js";
|
|
30
30
|
import { NumberPicker } from "./components/number-picker/number-picker.js";
|
|
31
31
|
import { Popover, TriggeredPopover } from "./components/popover/popover.js";
|
|
32
|
+
import { PortalProvider } from "./components/portal-provider/portal-provider.js";
|
|
32
33
|
import { RadioButton, RadioButtonGroup } from "./components/radio/radio.js";
|
|
33
34
|
import { Repeater } from "./components/repeater/repeater.js";
|
|
34
35
|
import { RepeaterItem } from "./components/repeater/repeater-item.js";
|
|
@@ -102,6 +103,7 @@ export {
|
|
|
102
103
|
OptionsPanelIntro,
|
|
103
104
|
OptionsPanelSection,
|
|
104
105
|
Popover,
|
|
106
|
+
PortalProvider,
|
|
105
107
|
RSClearIndicator,
|
|
106
108
|
RSDropdownIndicator,
|
|
107
109
|
RSMultiValue,
|