sellmate-design-system-react 0.8.0 → 0.8.1
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/components/SChipInput/SChipInput.cjs +3 -0
- package/dist/components/SChipInput/SChipInput.cjs.map +1 -1
- package/dist/components/SChipInput/SChipInput.js +3 -0
- package/dist/components/SChipInput/SChipInput.js.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs +11 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.js +11 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.js.map +1 -1
- package/dist/components/SPortal/SPortal.cjs +3 -0
- package/dist/components/SPortal/SPortal.cjs.map +1 -1
- package/dist/components/SPortal/SPortal.d.ts +3 -1
- package/dist/components/SPortal/SPortal.js +3 -0
- package/dist/components/SPortal/SPortal.js.map +1 -1
- package/dist/components/SSelect/SSelect.cjs +11 -1
- package/dist/components/SSelect/SSelect.cjs.map +1 -1
- package/dist/components/SSelect/SSelect.js +11 -1
- package/dist/components/SSelect/SSelect.js.map +1 -1
- package/dist/components/STable/STable.cjs +11 -1
- package/dist/components/STable/STable.cjs.map +1 -1
- package/dist/components/STable/STable.js +11 -1
- package/dist/components/STable/STable.js.map +1 -1
- package/dist/index.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -4248,6 +4248,7 @@ function SPortal({
|
|
|
4248
4248
|
viewportPadding = 0,
|
|
4249
4249
|
onOpenAutoFocus,
|
|
4250
4250
|
onCloseAutoFocus,
|
|
4251
|
+
onPointerDownOutside,
|
|
4251
4252
|
children,
|
|
4252
4253
|
className,
|
|
4253
4254
|
style,
|
|
@@ -4276,7 +4277,9 @@ function SPortal({
|
|
|
4276
4277
|
onPointerDownOutside: (e) => {
|
|
4277
4278
|
if (persistent || anchorRef.current?.contains(e.target)) {
|
|
4278
4279
|
e.preventDefault();
|
|
4280
|
+
return;
|
|
4279
4281
|
}
|
|
4282
|
+
onPointerDownOutside?.(e);
|
|
4280
4283
|
},
|
|
4281
4284
|
onFocusOutside: (e) => {
|
|
4282
4285
|
if (persistent || anchorRef.current?.contains(e.target)) {
|
|
@@ -4381,6 +4384,7 @@ var SSelect = forwardRef(function SSelect2({
|
|
|
4381
4384
|
const triggerRef = useRef(null);
|
|
4382
4385
|
const searchInputRef = useRef(null);
|
|
4383
4386
|
const listRef = useRef(null);
|
|
4387
|
+
const dismissedByPointerRef = useRef(false);
|
|
4384
4388
|
const flat = useMemo(() => flattenOptions(options), [options]);
|
|
4385
4389
|
const selectable = useMemo(() => selectableOptions(flat), [flat]);
|
|
4386
4390
|
const hasLeaf = useMemo(() => flat.some((o) => !o.isGroup), [flat]);
|
|
@@ -4410,7 +4414,9 @@ var SSelect = forwardRef(function SSelect2({
|
|
|
4410
4414
|
const commitOpen = (next) => {
|
|
4411
4415
|
setOpen(next);
|
|
4412
4416
|
onOpenChange?.(next);
|
|
4413
|
-
if (
|
|
4417
|
+
if (next) {
|
|
4418
|
+
dismissedByPointerRef.current = false;
|
|
4419
|
+
} else {
|
|
4414
4420
|
setPendingOpen(false);
|
|
4415
4421
|
setSearch("");
|
|
4416
4422
|
if (rules && rules.length > 0) {
|
|
@@ -4634,8 +4640,12 @@ var SSelect = forwardRef(function SSelect2({
|
|
|
4634
4640
|
event.preventDefault();
|
|
4635
4641
|
requestAnimationFrame(() => searchInputRef.current?.focus());
|
|
4636
4642
|
},
|
|
4643
|
+
onPointerDownOutside: () => {
|
|
4644
|
+
dismissedByPointerRef.current = true;
|
|
4645
|
+
},
|
|
4637
4646
|
onCloseAutoFocus: (event) => {
|
|
4638
4647
|
event.preventDefault();
|
|
4648
|
+
if (dismissedByPointerRef.current) return;
|
|
4639
4649
|
triggerRef.current?.focus();
|
|
4640
4650
|
},
|
|
4641
4651
|
className: "rounded-[var(--cmp-listBox-radius)] bg-[var(--cmp-listBox-bg)] shadow-[2px_2px_12px_2px_rgba(0,0,0,0.1)]",
|