@companix/uikit 0.0.59 → 0.0.61
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/Select/OptionsPopover.d.ts +41 -0
- package/dist/Select/SelectInput.d.ts +2 -1
- package/dist/Select/index.d.ts +5 -8
- package/dist/SelectTags/index.d.ts +7 -10
- package/dist/bundle.es12.js +74 -61
- package/dist/bundle.es13.js +2 -2
- package/dist/bundle.es15.js +1 -1
- package/dist/bundle.es21.js +1 -1
- package/dist/bundle.es22.js +1 -1
- package/dist/bundle.es23.js +1 -1
- package/dist/bundle.es26.js +1 -1
- package/dist/bundle.es27.js +71 -65
- package/dist/bundle.es28.js +4 -4
- package/dist/bundle.es29.js +2 -2
- package/dist/bundle.es32.js +2 -2
- package/dist/bundle.es36.js +1 -1
- package/dist/bundle.es40.js +1 -1
- package/dist/bundle.es41.js +1 -1
- package/dist/bundle.es42.js +1 -1
- package/dist/bundle.es48.js +39 -40
- package/dist/bundle.es50.js +66 -31
- package/dist/bundle.es51.js +24 -4
- package/dist/bundle.es52.js +35 -20
- package/dist/bundle.es53.js +5 -39
- package/dist/bundle.es54.js +14 -5
- package/dist/bundle.es55.js +13 -13
- package/dist/bundle.es56.js +69 -13
- package/dist/bundle.es57.js +66 -68
- package/dist/bundle.es58.js +69 -67
- package/dist/bundle.es59.js +10 -69
- package/dist/bundle.es60.js +42 -10
- package/dist/bundle.es61.js +14 -42
- package/dist/bundle.es62.js +32 -15
- package/dist/bundle.es63.js +61 -23
- package/dist/bundle.es64.js +13 -69
- package/dist/bundle.es65.js +74 -13
- package/dist/bundle.es66.js +45 -71
- package/dist/bundle.es67.js +13 -48
- package/package.json +1 -1
- package/dist/Select/SelectLoader.d.ts +0 -1
- package/dist/Select/SelectOptions.d.ts +0 -19
- package/dist/bundle.es68.js +0 -16
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Option } from '..';
|
|
2
|
+
export interface UseOptionsResponse<T> {
|
|
3
|
+
options: Option<T>[];
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface HookControlled<T> {
|
|
7
|
+
useOptions: () => UseOptionsResponse<T>;
|
|
8
|
+
defaultOptions?: Option<T>[];
|
|
9
|
+
options?: undefined;
|
|
10
|
+
}
|
|
11
|
+
interface PropsProvided<T> {
|
|
12
|
+
defaultOptions?: undefined;
|
|
13
|
+
useOptions?: undefined;
|
|
14
|
+
options: Option<T>[];
|
|
15
|
+
}
|
|
16
|
+
export type OptionsSource<T> = HookControlled<T> | PropsProvided<T>;
|
|
17
|
+
export type OptionsSourceControl<T> = OptionsSource<T> & {
|
|
18
|
+
onOptionsLoaded?: (options: Option<T>[]) => void;
|
|
19
|
+
};
|
|
20
|
+
export interface SelectAddOption {
|
|
21
|
+
text: string;
|
|
22
|
+
closeOnClick?: boolean;
|
|
23
|
+
onClick: () => void;
|
|
24
|
+
}
|
|
25
|
+
interface InternalListProps<T> {
|
|
26
|
+
options: Option<T>[];
|
|
27
|
+
scrollboxRef?: React.RefObject<HTMLDivElement>;
|
|
28
|
+
optionsWrapperRef?: React.RefObject<HTMLDivElement>;
|
|
29
|
+
isActive: (value: T) => boolean;
|
|
30
|
+
onSelect?: (value: T) => void;
|
|
31
|
+
onOpened?: (activeIndex: number) => void;
|
|
32
|
+
filterOptions?: (option: Option<T>) => boolean;
|
|
33
|
+
disableFiltering?: boolean;
|
|
34
|
+
minimalOptions?: boolean;
|
|
35
|
+
addOption?: SelectAddOption;
|
|
36
|
+
emptyText?: string;
|
|
37
|
+
}
|
|
38
|
+
export type OptionsPopoverProps<T> = OptionsSourceControl<T> & Omit<InternalListProps<T>, 'options'>;
|
|
39
|
+
export declare const OptionsPopover: <T>(props: OptionsPopoverProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare const SelectOptionsList: <T>(props: InternalListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface SelectFormProps
|
|
1
|
+
export interface SelectFormProps {
|
|
2
2
|
required?: boolean;
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
className?: string;
|
|
@@ -11,5 +11,6 @@ export interface SelectFormProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
11
11
|
clearButtonIcon?: boolean;
|
|
12
12
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
13
13
|
onClear?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
14
|
+
onClick?: () => void;
|
|
14
15
|
}
|
|
15
16
|
export declare const SelectInput: import('react').ForwardRefExoticComponent<SelectFormProps & import('react').RefAttributes<HTMLDivElement>>;
|
package/dist/Select/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Option } from '../types';
|
|
2
1
|
import { SelectFormProps } from './SelectInput';
|
|
3
|
-
import { SelectAddOption } from './
|
|
2
|
+
import { OptionsSource, SelectAddOption } from './OptionsPopover';
|
|
4
3
|
interface Cleanable<T> {
|
|
5
4
|
clearButton: true;
|
|
6
5
|
onChange: (event: T | null) => void;
|
|
@@ -11,20 +10,18 @@ interface UnCleanable<T> {
|
|
|
11
10
|
}
|
|
12
11
|
type DependedValueType<T> = Cleanable<T> | UnCleanable<T>;
|
|
13
12
|
export interface SelectParams {
|
|
14
|
-
minimalOptions?: boolean;
|
|
15
13
|
matchTarget?: 'width' | 'min-width';
|
|
16
14
|
popoverRef?: React.Ref<HTMLDivElement>;
|
|
17
15
|
scrollRef?: React.Ref<{
|
|
18
16
|
scrollTo: (index: number) => void;
|
|
19
17
|
}>;
|
|
20
|
-
addOption?: SelectAddOption;
|
|
21
|
-
isLoading?: boolean;
|
|
22
18
|
emptyText?: string;
|
|
19
|
+
minimalOptions?: boolean;
|
|
20
|
+
addOption?: SelectAddOption;
|
|
23
21
|
}
|
|
24
|
-
export type SelectProps<T> = Omit<SelectFormProps, 'value' | 'onChange' | 'closeButton'> & DependedValueType<T> & SelectParams & {
|
|
22
|
+
export type SelectProps<T> = Omit<SelectFormProps, 'value' | 'onChange' | 'closeButton'> & DependedValueType<T> & SelectParams & OptionsSource<T> & {
|
|
25
23
|
value: T | null;
|
|
26
|
-
options: Option<T>[];
|
|
27
24
|
children?: React.ReactNode;
|
|
28
25
|
};
|
|
29
|
-
export declare const Select: <T>(props: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const Select: <T extends string | number>(props: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
30
27
|
export {};
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { OptionsSource, SelectAddOption } from '../Select/OptionsPopover';
|
|
2
|
+
export type SelectTagsProps<T> = OptionsSource<T> & {
|
|
3
|
+
closeAfterSelect?: boolean;
|
|
4
|
+
onInputChange?: (text: string) => void;
|
|
5
5
|
onChange: (event: T[]) => void;
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
value: T[];
|
|
8
|
-
children?: React.ReactNode;
|
|
9
8
|
disabled?: boolean;
|
|
10
9
|
readOnly?: boolean;
|
|
11
|
-
closeAfterSelect?: boolean;
|
|
12
|
-
emptyText?: string;
|
|
13
10
|
size?: 'sm' | 'md' | 'lg';
|
|
14
11
|
fill?: boolean;
|
|
15
|
-
minimalOptions?: boolean;
|
|
16
12
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
17
13
|
required?: boolean;
|
|
18
|
-
|
|
14
|
+
minimalOptions?: boolean;
|
|
19
15
|
addOption?: SelectAddOption;
|
|
20
|
-
|
|
16
|
+
emptyText?: string;
|
|
17
|
+
};
|
|
21
18
|
export declare const SelectTags: <T extends string | number>(props: SelectTagsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
package/dist/bundle.es12.js
CHANGED
|
@@ -1,83 +1,96 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { Popover as
|
|
4
|
-
import { useFroozeClosing as
|
|
5
|
-
import { SelectInput as
|
|
6
|
-
import { useScrollListController as
|
|
7
|
-
import {
|
|
8
|
-
import { mergeRefs as
|
|
9
|
-
|
|
10
|
-
const U = (a) => {
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as L, useImperativeHandle as j } from "react";
|
|
3
|
+
import { Popover as k } from "./bundle.es10.js";
|
|
4
|
+
import { useFroozeClosing as q } from "./bundle.es47.js";
|
|
5
|
+
import { SelectInput as w } from "./bundle.es48.js";
|
|
6
|
+
import { useScrollListController as H } from "./bundle.es49.js";
|
|
7
|
+
import { OptionsPopover as M } from "./bundle.es50.js";
|
|
8
|
+
import { mergeRefs as N } from "react-merge-refs";
|
|
9
|
+
const Y = (t) => {
|
|
11
10
|
const {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
disabled: p,
|
|
19
|
-
scrollRef: d,
|
|
20
|
-
popoverRef: v,
|
|
11
|
+
onChange: i,
|
|
12
|
+
value: r,
|
|
13
|
+
matchTarget: u = "width",
|
|
14
|
+
children: f,
|
|
15
|
+
scrollRef: m,
|
|
16
|
+
popoverRef: d,
|
|
21
17
|
clearButton: s,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
// select props
|
|
19
|
+
disabled: a,
|
|
20
|
+
required: v,
|
|
21
|
+
className: h,
|
|
22
|
+
clearButtonIcon: O,
|
|
23
|
+
leftElement: C,
|
|
24
|
+
inputRef: R,
|
|
25
|
+
onClear: W,
|
|
26
|
+
fill: P,
|
|
27
|
+
size: g,
|
|
28
|
+
placeholder: E,
|
|
29
|
+
onClick: A,
|
|
30
|
+
// options popover
|
|
31
|
+
...S
|
|
32
|
+
} = t, p = L(() => {
|
|
33
|
+
const o = {};
|
|
34
|
+
return (t.options ?? t.defaultOptions ?? []).forEach((n) => {
|
|
35
|
+
o[n.value] = n;
|
|
36
|
+
}), o;
|
|
37
|
+
}, [t.options, t.defaultOptions]), x = r === null ? null : p[r] ?? null, { popoverRef: z, froozePopoverPosition: B, handleAnimationEnd: F } = q(), { scrollToElement: c, optionsWrapperRef: I, scrollBoxRef: T } = H();
|
|
38
|
+
j(m, () => ({
|
|
34
39
|
scrollTo: (o) => c(o, "top")
|
|
35
40
|
}));
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
o.stopPropagation(), s &&
|
|
40
|
-
}, F = () => {
|
|
41
|
-
n.index !== -1 && c(n.index, "center");
|
|
41
|
+
const b = (o, e) => {
|
|
42
|
+
B(), i(o), e();
|
|
43
|
+
}, D = (o) => {
|
|
44
|
+
o.stopPropagation(), s && i(null);
|
|
42
45
|
};
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
|
|
46
|
+
return /* @__PURE__ */ l(
|
|
47
|
+
k,
|
|
45
48
|
{
|
|
46
49
|
minimal: !0,
|
|
47
|
-
ref:
|
|
50
|
+
ref: N([z, d]),
|
|
48
51
|
sideOffset: 0,
|
|
49
|
-
matchTarget:
|
|
50
|
-
onAnimationEnd:
|
|
52
|
+
matchTarget: u,
|
|
53
|
+
onAnimationEnd: F,
|
|
51
54
|
onOpenAutoFocus: (o) => o.preventDefault(),
|
|
52
55
|
onCloseAutoFocus: (o) => o.preventDefault(),
|
|
53
|
-
disabled:
|
|
54
|
-
content: ({ close: o }) =>
|
|
55
|
-
|
|
56
|
+
disabled: a,
|
|
57
|
+
content: ({ close: o }) => /* @__PURE__ */ l(
|
|
58
|
+
M,
|
|
56
59
|
{
|
|
57
|
-
|
|
58
|
-
isActive: (e) => e ===
|
|
59
|
-
|
|
60
|
-
scrollboxRef:
|
|
61
|
-
optionsWrapperRef:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
...S,
|
|
61
|
+
isActive: (e) => e === r,
|
|
62
|
+
onSelect: (e) => b(e, o),
|
|
63
|
+
scrollboxRef: T,
|
|
64
|
+
optionsWrapperRef: I,
|
|
65
|
+
onOpened: (e) => c(e, "center"),
|
|
66
|
+
onOptionsLoaded: (e) => {
|
|
67
|
+
e.forEach((n) => {
|
|
68
|
+
p[n.value] = n;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
66
71
|
}
|
|
67
72
|
),
|
|
68
|
-
children:
|
|
69
|
-
|
|
73
|
+
children: f ?? /* @__PURE__ */ l(
|
|
74
|
+
w,
|
|
70
75
|
{
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
required: v,
|
|
77
|
+
className: h,
|
|
78
|
+
leftElement: C,
|
|
79
|
+
inputRef: R,
|
|
80
|
+
onClear: D,
|
|
81
|
+
fill: P,
|
|
82
|
+
size: g,
|
|
83
|
+
placeholder: E,
|
|
84
|
+
onClick: A,
|
|
85
|
+
disabled: a,
|
|
73
86
|
clearButton: s,
|
|
74
|
-
|
|
75
|
-
|
|
87
|
+
clearButtonIcon: O,
|
|
88
|
+
value: x?.title ?? ""
|
|
76
89
|
}
|
|
77
90
|
)
|
|
78
91
|
}
|
|
79
92
|
);
|
|
80
93
|
};
|
|
81
94
|
export {
|
|
82
|
-
|
|
95
|
+
Y as Select
|
|
83
96
|
};
|
package/dist/bundle.es13.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as b, useRef as R } from "react";
|
|
3
3
|
import { mergeRefs as c } from "react-merge-refs";
|
|
4
|
-
import { InputElement as x } from "./bundle.
|
|
5
|
-
import { InputContainer as I } from "./bundle.
|
|
4
|
+
import { InputElement as x } from "./bundle.es51.js";
|
|
5
|
+
import { InputContainer as I } from "./bundle.es52.js";
|
|
6
6
|
import g from "classnames";
|
|
7
7
|
const N = b(
|
|
8
8
|
({
|
package/dist/bundle.es15.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import C from "classnames";
|
|
3
3
|
import { forwardRef as j, useRef as w } from "react";
|
|
4
4
|
import { mergeRefs as y } from "react-merge-refs";
|
|
5
|
-
import { InputContainer as F } from "./bundle.
|
|
5
|
+
import { InputContainer as F } from "./bundle.es52.js";
|
|
6
6
|
import { NumericFormat as V } from "react-number-format";
|
|
7
7
|
const D = j(
|
|
8
8
|
({
|
package/dist/bundle.es21.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
|
2
2
|
import f from "classnames";
|
|
3
3
|
import * as o from "@radix-ui/react-dialog";
|
|
4
4
|
import { VisuallyHidden as a } from "@radix-ui/react-visually-hidden";
|
|
5
|
-
import { RemoveListener as v } from "./bundle.
|
|
5
|
+
import { RemoveListener as v } from "./bundle.es53.js";
|
|
6
6
|
const g = (l) => {
|
|
7
7
|
const { size: n = "s", open: r, onOpenChange: s, children: c, onClosed: t, disableEsc: p, className: d } = l, m = (h) => {
|
|
8
8
|
p && h.preventDefault();
|
package/dist/bundle.es22.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "@radix-ui/react-alert-dialog";
|
|
3
3
|
import { Button as c } from "./bundle.es4.js";
|
|
4
|
-
import { RemoveListener as N } from "./bundle.
|
|
4
|
+
import { RemoveListener as N } from "./bundle.es53.js";
|
|
5
5
|
import { VisuallyHidden as u } from "@radix-ui/react-visually-hidden";
|
|
6
6
|
const C = ({
|
|
7
7
|
open: d,
|
package/dist/bundle.es23.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Button as m } from "./bundle.es4.js";
|
|
3
|
-
import { useLoading as p } from "./bundle.
|
|
3
|
+
import { useLoading as p } from "./bundle.es54.js";
|
|
4
4
|
const g = ({ onClick: o, appearance: r = "primary", ...i }) => {
|
|
5
5
|
const { isLoading: n, isError: t, handleClick: a } = p({ onClick: o });
|
|
6
6
|
return /* @__PURE__ */ e(
|
package/dist/bundle.es26.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import { useResizeTextarea as x } from "./bundle.
|
|
2
|
+
import { useResizeTextarea as x } from "./bundle.es55.js";
|
|
3
3
|
import { attr as e, callMultiple as u } from "@companix/utils-browser";
|
|
4
4
|
import { useEffect as z } from "react";
|
|
5
5
|
import { mergeRefs as R } from "react-merge-refs";
|
package/dist/bundle.es27.js
CHANGED
|
@@ -1,110 +1,116 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useFroozeClosing as
|
|
3
|
-
import { Popover as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { attr as
|
|
7
|
-
import { mergeRefs as
|
|
8
|
-
import { faXmark as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
const se = (g) => {
|
|
1
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useFroozeClosing as M } from "./bundle.es47.js";
|
|
3
|
+
import { Popover as j } from "./bundle.es10.js";
|
|
4
|
+
import { useState as q, useRef as h, useMemo as V } from "react";
|
|
5
|
+
import { Icon as g } from "./bundle.es33.js";
|
|
6
|
+
import { attr as i, getActiveElementByAnotherElement as $, contains as B } from "@companix/utils-browser";
|
|
7
|
+
import { mergeRefs as L } from "react-merge-refs";
|
|
8
|
+
import { faXmark as X, faChevronDown as G } from "@companix/icons-solid";
|
|
9
|
+
import { OptionsPopover as H } from "./bundle.es50.js";
|
|
10
|
+
import { matchPattern as J } from "@companix/utils-js";
|
|
11
|
+
const ne = (a) => {
|
|
13
12
|
const {
|
|
14
|
-
options: r,
|
|
15
13
|
closeAfterSelect: v,
|
|
16
|
-
placeholder:
|
|
17
|
-
onChange:
|
|
18
|
-
|
|
14
|
+
placeholder: C,
|
|
15
|
+
onChange: l,
|
|
16
|
+
onInputChange: x,
|
|
19
17
|
readOnly: c,
|
|
20
18
|
size: N = "md",
|
|
19
|
+
fill: O,
|
|
21
20
|
value: n,
|
|
22
21
|
inputRef: R,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
disabled: u,
|
|
23
|
+
required: A,
|
|
24
|
+
// options popover
|
|
25
|
+
...P
|
|
26
|
+
} = a, [f, b] = q(""), s = h(null), z = h(null), { popoverRef: d, froozePopoverPosition: D, handleAnimationEnd: E } = M(), S = (e) => n.includes(e) ? [...n] : [...n, e], k = (e) => n.filter((t) => e !== t), I = (e, t) => {
|
|
27
|
+
v ? (D(), l(e), t()) : l(e);
|
|
28
|
+
}, w = (e) => {
|
|
29
|
+
if (u) return;
|
|
30
|
+
d.current && d.current.getAttribute("data-state") === "open" && e.preventDefault();
|
|
31
|
+
const t = $(e.currentTarget);
|
|
32
|
+
e.defaultPrevented || B(e.currentTarget, t) || s.current && s.current.focus();
|
|
33
|
+
}, y = (e) => {
|
|
34
|
+
e.target !== s.current && e.preventDefault();
|
|
35
|
+
}, F = (e, t) => {
|
|
36
|
+
e.stopPropagation(), l(k(t));
|
|
37
|
+
}, T = ({ target: e }) => {
|
|
38
|
+
b(e.value), x?.(e.value);
|
|
39
|
+
}, m = V(() => {
|
|
29
40
|
const e = {};
|
|
30
|
-
return
|
|
31
|
-
e[
|
|
41
|
+
return (a.options ?? a.defaultOptions ?? []).forEach((r) => {
|
|
42
|
+
e[r.value] = r;
|
|
32
43
|
}), e;
|
|
33
|
-
}, [
|
|
34
|
-
v ? (E(), s(e), t()) : s(e);
|
|
35
|
-
}, F = p(() => a.trim() ? r.filter(({ title: e }) => K(e, a)) : r, [a, r]), I = (e) => {
|
|
36
|
-
if (m) return;
|
|
37
|
-
l.current && l.current.getAttribute("data-state") === "open" && e.preventDefault();
|
|
38
|
-
const t = B(e.currentTarget);
|
|
39
|
-
e.defaultPrevented || X(e.currentTarget, t) || i.current && i.current.focus();
|
|
40
|
-
}, L = (e) => {
|
|
41
|
-
e.target !== i.current && e.preventDefault();
|
|
42
|
-
}, M = (e, t) => {
|
|
43
|
-
e.stopPropagation(), s(T(t));
|
|
44
|
-
};
|
|
44
|
+
}, [a.options, a.defaultOptions]);
|
|
45
45
|
return /* @__PURE__ */ o(
|
|
46
|
-
|
|
46
|
+
j,
|
|
47
47
|
{
|
|
48
48
|
minimal: !0,
|
|
49
|
-
ref:
|
|
49
|
+
ref: d,
|
|
50
50
|
sideOffset: 0,
|
|
51
51
|
matchTarget: "width",
|
|
52
|
-
onAnimationEnd:
|
|
52
|
+
onAnimationEnd: E,
|
|
53
53
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
54
54
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
55
|
-
content: ({ close: e }) =>
|
|
56
|
-
|
|
55
|
+
content: ({ close: e }) => /* @__PURE__ */ o(
|
|
56
|
+
H,
|
|
57
57
|
{
|
|
58
|
+
...P,
|
|
58
59
|
isActive: (t) => n.includes(t),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
onSelect: (t) => I(S(t), e),
|
|
61
|
+
disableFiltering: !f.trim(),
|
|
62
|
+
filterOptions: ({ title: t }) => J(t, f),
|
|
63
|
+
onOptionsLoaded: (t) => {
|
|
64
|
+
t.forEach((r) => {
|
|
65
|
+
m[r.value] = r;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
64
68
|
}
|
|
65
69
|
),
|
|
66
70
|
children: /* @__PURE__ */ o(
|
|
67
71
|
"div",
|
|
68
72
|
{
|
|
69
73
|
className: "form",
|
|
70
|
-
onClick:
|
|
71
|
-
onMouseDown:
|
|
72
|
-
"data-size": N,
|
|
73
|
-
"data-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
onClick: w,
|
|
75
|
+
onMouseDown: y,
|
|
76
|
+
"data-size": N ?? "md",
|
|
77
|
+
"data-fill": i(O),
|
|
78
|
+
"data-required": i(A),
|
|
79
|
+
"data-disabled": i(u),
|
|
80
|
+
children: /* @__PURE__ */ p("div", { className: "select-tags-container", children: [
|
|
81
|
+
/* @__PURE__ */ p("div", { className: "select-tags", children: [
|
|
76
82
|
n.length > 0 && /* @__PURE__ */ o(
|
|
77
83
|
"div",
|
|
78
84
|
{
|
|
79
85
|
className: "tag-container",
|
|
80
|
-
ref:
|
|
86
|
+
ref: z,
|
|
81
87
|
role: "listbox",
|
|
82
|
-
"data-readonly":
|
|
83
|
-
children: n.map((e, t) => /* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */ o("span", { className: "tag-name", children:
|
|
85
|
-
/* @__PURE__ */ o("button", { className: "tag-close-button", onClick: (
|
|
86
|
-
] }, `tag-option-${e}-${t}`))
|
|
88
|
+
"data-readonly": i(c),
|
|
89
|
+
children: n.map((e, t) => m[e] ? /* @__PURE__ */ p("div", { className: "tag", children: [
|
|
90
|
+
/* @__PURE__ */ o("span", { className: "tag-name", children: m[e].title }),
|
|
91
|
+
/* @__PURE__ */ o("button", { className: "tag-close-button", onClick: (r) => F(r, e), children: /* @__PURE__ */ o(g, { className: "tag-close-icon", icon: X, size: "xxxs" }) })
|
|
92
|
+
] }, `tag-option-${e}-${t}`) : null)
|
|
87
93
|
}
|
|
88
94
|
),
|
|
89
95
|
(!c || n.length === 0) && /* @__PURE__ */ o(
|
|
90
96
|
"input",
|
|
91
97
|
{
|
|
92
|
-
ref:
|
|
98
|
+
ref: L([R, s]),
|
|
93
99
|
type: "text",
|
|
94
100
|
autoCapitalize: "none",
|
|
95
101
|
autoComplete: "off",
|
|
96
102
|
autoCorrect: "off",
|
|
97
103
|
className: "form-input",
|
|
98
104
|
spellCheck: !1,
|
|
99
|
-
value:
|
|
100
|
-
disabled:
|
|
105
|
+
value: f,
|
|
106
|
+
disabled: u,
|
|
101
107
|
readOnly: c,
|
|
102
|
-
placeholder:
|
|
103
|
-
onChange:
|
|
108
|
+
placeholder: C,
|
|
109
|
+
onChange: T
|
|
104
110
|
}
|
|
105
111
|
)
|
|
106
112
|
] }),
|
|
107
|
-
/* @__PURE__ */ o(
|
|
113
|
+
/* @__PURE__ */ o(g, { className: "expand-icon", icon: G, size: "xxxs" })
|
|
108
114
|
] })
|
|
109
115
|
}
|
|
110
116
|
)
|
|
@@ -112,5 +118,5 @@ const se = (g) => {
|
|
|
112
118
|
);
|
|
113
119
|
};
|
|
114
120
|
export {
|
|
115
|
-
|
|
121
|
+
ne as SelectTags
|
|
116
122
|
};
|
package/dist/bundle.es28.js
CHANGED
|
@@ -2,11 +2,11 @@ import { jsx as u } from "react/jsx-runtime";
|
|
|
2
2
|
import { Popover as T } from "./bundle.es10.js";
|
|
3
3
|
import { Input as w } from "./bundle.es13.js";
|
|
4
4
|
import { useState as A, useRef as j } from "react";
|
|
5
|
-
import { Calendar as E } from "./bundle.
|
|
6
|
-
import { useDayDisableCheker as N } from "./bundle.
|
|
5
|
+
import { Calendar as E } from "./bundle.es56.js";
|
|
6
|
+
import { useDayDisableCheker as N } from "./bundle.es57.js";
|
|
7
7
|
import { getNum as h, formatTime as v } from "@companix/utils-js";
|
|
8
|
-
import { removeDigits as O } from "./bundle.
|
|
9
|
-
import { SelectRightElements as Y } from "./bundle.
|
|
8
|
+
import { removeDigits as O } from "./bundle.es58.js";
|
|
9
|
+
import { SelectRightElements as Y } from "./bundle.es59.js";
|
|
10
10
|
const i = {
|
|
11
11
|
char: "-",
|
|
12
12
|
toString: (e) => {
|
package/dist/bundle.es29.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as D, jsx as h } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as M, useEffect as C } from "react";
|
|
3
3
|
import { Select as c } from "./bundle.es12.js";
|
|
4
|
-
import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.
|
|
5
|
-
import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.
|
|
4
|
+
import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es58.js";
|
|
5
|
+
import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es60.js";
|
|
6
6
|
const B = ({
|
|
7
7
|
min: o = j,
|
|
8
8
|
max: e = N,
|
package/dist/bundle.es32.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as g } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as _, useMemo as b, useState as P, useEffect as j } from "react";
|
|
3
3
|
import { getNum as v } from "@companix/utils-js";
|
|
4
|
-
import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.
|
|
5
|
-
import { SelectRightElements as w } from "./bundle.
|
|
4
|
+
import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.es58.js";
|
|
5
|
+
import { SelectRightElements as w } from "./bundle.es59.js";
|
|
6
6
|
import { Select as y } from "./bundle.es12.js";
|
|
7
7
|
import { Input as z } from "./bundle.es13.js";
|
|
8
8
|
const r = {
|
package/dist/bundle.es36.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { useState as h, useEffect as c, createContext as f, useContext as w } from "react";
|
|
3
|
-
import { getColorScheme as v, updateDOM as m } from "./bundle.
|
|
3
|
+
import { getColorScheme as v, updateDOM as m } from "./bundle.es61.js";
|
|
4
4
|
const i = f({
|
|
5
5
|
setColorScheme: () => {
|
|
6
6
|
}
|
package/dist/bundle.es40.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { hash as m } from "@companix/utils-js";
|
|
3
3
|
import { useRef as n, useMemo as s } from "react";
|
|
4
|
-
import { Viewport as p } from "./bundle.
|
|
4
|
+
import { Viewport as p } from "./bundle.es62.js";
|
|
5
5
|
const a = (t = {}) => {
|
|
6
6
|
const e = {
|
|
7
7
|
emit: (r) => {
|
package/dist/bundle.es41.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { hash as r } from "@companix/utils-js";
|
|
3
|
-
import { Viewport as a } from "./bundle.
|
|
3
|
+
import { Viewport as a } from "./bundle.es63.js";
|
|
4
4
|
import { useRef as c, useMemo as h } from "react";
|
|
5
5
|
const m = (i = {}) => {
|
|
6
6
|
const o = {
|
package/dist/bundle.es42.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import * as t from "@radix-ui/react-toast";
|
|
3
3
|
import { attr as T } from "@companix/utils-browser";
|
|
4
4
|
import { useState as d, useRef as b, useEffect as j, useLayoutEffect as E } from "react";
|
|
5
|
-
import { RemoveListener as I } from "./bundle.
|
|
5
|
+
import { RemoveListener as I } from "./bundle.es53.js";
|
|
6
6
|
const m = (o) => {
|
|
7
7
|
const [r, u] = d(!0), [p, f] = d(!1), s = b(null), {
|
|
8
8
|
appearance: C = "neutral",
|