@machinerd/js-module 0.5.3 → 0.6.0
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/README.md +10 -101
- package/dist/common-CQWUs1nE.cjs +1 -0
- package/dist/common-DbEp6YNc.mjs +1 -0
- package/dist/file-5mweNdAM.cjs +1 -0
- package/dist/file-DShNxIW4.mjs +1 -0
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.cts +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/hooks--O5RcEJq.cjs +1 -0
- package/dist/hooks-C9rXWkfW.mjs +1 -0
- package/dist/{index-ComhjQ-q.d.cts → index-BFHrNSKP.d.mts} +4 -4
- package/dist/{index-ByfkW7VU.d.mts → index-BQHtVz_S.d.cts} +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/providers/index.cjs +1 -1
- package/dist/providers/index.d.cts +3 -3
- package/dist/providers/index.d.mts +3 -3
- package/dist/providers/index.mjs +1 -1
- package/dist/{providers-5JCPezAS.mjs → providers-zftmvT1z.mjs} +1 -1
- package/dist/skeleton-6QtpIO7l.mjs +1 -0
- package/dist/skeleton-DBha34Cx.cjs +1 -0
- package/dist/styles/index.css +6 -25
- package/dist/ui/carousel/index.cjs +1 -0
- package/dist/ui/carousel/index.d.cts +95 -0
- package/dist/ui/carousel/index.d.mts +95 -0
- package/dist/ui/carousel/index.mjs +1 -0
- package/dist/ui/dialog/index.cjs +1 -0
- package/dist/ui/dialog/index.d.cts +30 -0
- package/dist/ui/dialog/index.d.mts +30 -0
- package/dist/ui/dialog/index.mjs +1 -0
- package/dist/ui/image/index.cjs +1 -0
- package/dist/ui/image/index.d.cts +45 -0
- package/dist/ui/image/index.d.mts +45 -0
- package/dist/ui/image/index.mjs +1 -0
- package/dist/ui/index.cjs +1 -1
- package/dist/ui/index.d.cts +9 -9
- package/dist/ui/index.d.mts +9 -9
- package/dist/ui/index.mjs +1 -1
- package/dist/ui/sheet/index.cjs +1 -0
- package/dist/ui/sheet/index.d.cts +28 -0
- package/dist/ui/sheet/index.d.mts +28 -0
- package/dist/ui/sheet/index.mjs +1 -0
- package/dist/ui/tooltip/index.cjs +1 -0
- package/dist/ui/tooltip/index.d.cts +16 -0
- package/dist/ui/tooltip/index.d.mts +16 -0
- package/dist/ui/tooltip/index.mjs +1 -0
- package/dist/use-subset-image-DhX5WmYG.cjs +1 -0
- package/dist/use-subset-image-DvV5Mlkc.mjs +1 -0
- package/dist/util/browser.cjs +1 -0
- package/dist/util/browser.d.cts +16 -0
- package/dist/util/browser.d.mts +16 -0
- package/dist/util/browser.mjs +1 -0
- package/dist/util/common.cjs +1 -0
- package/dist/util/common.d.cts +56 -0
- package/dist/util/common.d.mts +56 -0
- package/dist/util/common.mjs +1 -0
- package/dist/util/date.cjs +1 -0
- package/dist/util/date.d.cts +4 -0
- package/dist/util/date.d.mts +6 -0
- package/dist/util/date.mjs +1 -0
- package/dist/util/file.cjs +1 -0
- package/dist/util/file.d.cts +15 -0
- package/dist/util/file.d.mts +15 -0
- package/dist/util/file.mjs +1 -0
- package/dist/util/format.cjs +1 -0
- package/dist/util/format.d.cts +6 -0
- package/dist/util/format.d.mts +6 -0
- package/dist/util/format.mjs +1 -0
- package/dist/util/generator.cjs +1 -0
- package/dist/util/generator.d.cts +18 -0
- package/dist/util/generator.d.mts +18 -0
- package/dist/util/generator.mjs +1 -0
- package/dist/util/phone.cjs +1 -0
- package/dist/util/phone.d.cts +22 -0
- package/dist/util/phone.d.mts +22 -0
- package/dist/util/phone.mjs +1 -0
- package/package.json +48 -8
- package/dist/hooks-DBo6LQrH.mjs +0 -1
- package/dist/hooks-DqgWx1Fa.cjs +0 -1
- package/dist/skeleton-S6S1ZnCy.mjs +0 -1
- package/dist/skeleton-g6yXh6D9.cjs +0 -1
- package/dist/ui-client/index.cjs +0 -1
- package/dist/ui-client/index.d.cts +0 -192
- package/dist/ui-client/index.d.mts +0 -192
- package/dist/ui-client/index.mjs +0 -1
- package/dist/util/index.cjs +0 -1
- package/dist/util/index.d.cts +0 -129
- package/dist/util/index.d.mts +0 -130
- package/dist/util/index.mjs +0 -1
- package/dist/util-o7fjt7iK.cjs +0 -1
- package/dist/util-zXJA6Gnc.mjs +0 -1
- /package/dist/{index-CH1uVFqx.d.cts → index-B3fFA21M.d.mts} +0 -0
- /package/dist/{index-D6Jzsxc-.d.mts → index-CeiAF-WU.d.cts} +0 -0
- /package/dist/{providers-BNK8Fisc.cjs → providers-CkXkdYcB.cjs} +0 -0
- /package/dist/{src-C_FmOyer.mjs → src-CukOR3K2.mjs} +0 -0
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { a as UseSubsetImageProps, n as BaseProps } from "../index-ComhjQ-q.cjs";
|
|
2
|
-
import * as react1 from "react";
|
|
3
|
-
import React$1, { ComponentProps, HTMLAttributes, ReactNode } from "react";
|
|
4
|
-
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
5
|
-
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
6
|
-
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
7
|
-
import { VariantProps } from "class-variance-authority";
|
|
8
|
-
|
|
9
|
-
//#region src/ui-client/carousel/carousel-context.d.ts
|
|
10
|
-
type CarouselApi = UseEmblaCarouselType[1];
|
|
11
|
-
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
12
|
-
type CarouselOptions = UseCarouselParameters[0];
|
|
13
|
-
type CarouselPlugin = UseCarouselParameters[1];
|
|
14
|
-
interface CarouselProps {
|
|
15
|
-
options?: CarouselOptions;
|
|
16
|
-
plugins?: CarouselPlugin;
|
|
17
|
-
orientation?: 'horizontal' | 'vertical';
|
|
18
|
-
setApi?: (api: CarouselApi) => void;
|
|
19
|
-
}
|
|
20
|
-
type CarouselContextProps = {
|
|
21
|
-
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
22
|
-
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
23
|
-
scrollPrev: () => void;
|
|
24
|
-
scrollNext: () => void;
|
|
25
|
-
canScrollPrev: boolean;
|
|
26
|
-
canScrollNext: boolean;
|
|
27
|
-
scrollTo: (index: number) => void;
|
|
28
|
-
dots: number;
|
|
29
|
-
selectedScrollSnap: number;
|
|
30
|
-
} & CarouselProps;
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/ui-client/carousel/carousel.d.ts
|
|
33
|
-
interface CarouselProps$1 extends ComponentProps<'div'>, CarouselProps {
|
|
34
|
-
orientation?: 'horizontal' | 'vertical';
|
|
35
|
-
options?: CarouselProps['options'];
|
|
36
|
-
setApi?: CarouselProps['setApi'];
|
|
37
|
-
plugins?: CarouselProps['plugins'];
|
|
38
|
-
}
|
|
39
|
-
declare function Carousel({
|
|
40
|
-
orientation,
|
|
41
|
-
options,
|
|
42
|
-
setApi,
|
|
43
|
-
plugins,
|
|
44
|
-
className,
|
|
45
|
-
children,
|
|
46
|
-
...props
|
|
47
|
-
}: CarouselProps$1): react_jsx_runtime10.JSX.Element;
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/ui-client/carousel/carousel-wrapper.d.ts
|
|
50
|
-
declare function CarouselWrapper({
|
|
51
|
-
className,
|
|
52
|
-
...props
|
|
53
|
-
}: React$1.ComponentProps<'div'>): react_jsx_runtime10.JSX.Element;
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/ui-client/carousel/carousel-item.d.ts
|
|
56
|
-
declare function CarouselItem({
|
|
57
|
-
className,
|
|
58
|
-
...props
|
|
59
|
-
}: React$1.ComponentProps<'div'>): react_jsx_runtime10.JSX.Element;
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/ui-client/carousel/carousel-previous.d.ts
|
|
62
|
-
declare function CarouselPrevious({
|
|
63
|
-
children,
|
|
64
|
-
className,
|
|
65
|
-
...props
|
|
66
|
-
}: React$1.ComponentProps<'button'>): react_jsx_runtime10.JSX.Element;
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region src/ui-client/carousel/carousel-next.d.ts
|
|
69
|
-
declare function CarouselNext({
|
|
70
|
-
children,
|
|
71
|
-
className,
|
|
72
|
-
...props
|
|
73
|
-
}: React$1.ComponentProps<'button'>): react_jsx_runtime10.JSX.Element;
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/ui-client/carousel/carousel-dots.d.ts
|
|
76
|
-
declare function CarouselDots$1({
|
|
77
|
-
children,
|
|
78
|
-
...props
|
|
79
|
-
}: Omit<React$1.ComponentProps<'button'>, 'children'> & {
|
|
80
|
-
children?: (index: number) => React$1.ReactNode;
|
|
81
|
-
}): react_jsx_runtime10.JSX.Element;
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region src/ui-client/carousel/carousel-dot.d.ts
|
|
84
|
-
declare function CarouselDots({
|
|
85
|
-
index,
|
|
86
|
-
children,
|
|
87
|
-
...props
|
|
88
|
-
}: React$1.ComponentProps<'button'> & {
|
|
89
|
-
index: number;
|
|
90
|
-
}): react_jsx_runtime10.JSX.Element;
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/ui-client/dialog/dialog.d.ts
|
|
93
|
-
declare const classes: (props?: ({
|
|
94
|
-
padding?: "none" | "sm" | "md" | "lg" | null | undefined;
|
|
95
|
-
maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null | undefined;
|
|
96
|
-
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
97
|
-
interface DialogProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
98
|
-
closeOnBackdropClick?: boolean;
|
|
99
|
-
isOpen: boolean;
|
|
100
|
-
zIndex?: number;
|
|
101
|
-
onClose: () => void;
|
|
102
|
-
children: ReactNode;
|
|
103
|
-
}
|
|
104
|
-
declare function Dialog({
|
|
105
|
-
closeOnBackdropClick,
|
|
106
|
-
isOpen,
|
|
107
|
-
zIndex,
|
|
108
|
-
padding,
|
|
109
|
-
maxWidth,
|
|
110
|
-
className,
|
|
111
|
-
onClose,
|
|
112
|
-
children,
|
|
113
|
-
...rest
|
|
114
|
-
}: DialogProps): react_jsx_runtime10.JSX.Element | null;
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region src/ui-client/image/image.d.ts
|
|
117
|
-
type ImageSubsetProps = {
|
|
118
|
-
layout?: 'intrinsic' | 'stretch';
|
|
119
|
-
skeleton?: boolean;
|
|
120
|
-
emptyNode?: React.ReactNode;
|
|
121
|
-
emptyNodeClassName?: string;
|
|
122
|
-
skeletonClassName?: string;
|
|
123
|
-
};
|
|
124
|
-
type ImageProps = UseSubsetImageProps & ImageSubsetProps;
|
|
125
|
-
declare const BaseImage: react1.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
126
|
-
fill: true;
|
|
127
|
-
sizes: string;
|
|
128
|
-
width?: never;
|
|
129
|
-
height?: never;
|
|
130
|
-
}, "ref"> | Omit<BaseProps & {
|
|
131
|
-
fill?: false;
|
|
132
|
-
sizes?: never;
|
|
133
|
-
width: number;
|
|
134
|
-
height: number;
|
|
135
|
-
}, "ref">) & react1.RefAttributes<HTMLImageElement>>;
|
|
136
|
-
declare const Image: react1.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
137
|
-
fill: true;
|
|
138
|
-
sizes: string;
|
|
139
|
-
width?: never;
|
|
140
|
-
height?: never;
|
|
141
|
-
} & ImageSubsetProps, "ref"> | Omit<BaseProps & {
|
|
142
|
-
fill?: false;
|
|
143
|
-
sizes?: never;
|
|
144
|
-
width: number;
|
|
145
|
-
height: number;
|
|
146
|
-
} & ImageSubsetProps, "ref">) & react1.RefAttributes<HTMLImageElement>>;
|
|
147
|
-
interface EmptyNodeProps {
|
|
148
|
-
children: React.ReactNode;
|
|
149
|
-
className?: string;
|
|
150
|
-
}
|
|
151
|
-
declare const EmptyNode: ({
|
|
152
|
-
children,
|
|
153
|
-
className
|
|
154
|
-
}: EmptyNodeProps) => react_jsx_runtime10.JSX.Element;
|
|
155
|
-
//#endregion
|
|
156
|
-
//#region src/ui-client/sheet/sheet.d.ts
|
|
157
|
-
type Direction = 'top' | 'bottom' | 'left' | 'right';
|
|
158
|
-
type Size = 'full' | 'half' | 'auto';
|
|
159
|
-
interface SheetProps {
|
|
160
|
-
isOpen: boolean;
|
|
161
|
-
onClose: () => void;
|
|
162
|
-
direction?: Direction;
|
|
163
|
-
size?: Size;
|
|
164
|
-
children: React$1.ReactNode;
|
|
165
|
-
className?: string;
|
|
166
|
-
closeOnBackdropClick?: boolean;
|
|
167
|
-
zIndex?: number;
|
|
168
|
-
}
|
|
169
|
-
declare function Sheet({
|
|
170
|
-
isOpen,
|
|
171
|
-
onClose,
|
|
172
|
-
direction,
|
|
173
|
-
size,
|
|
174
|
-
children,
|
|
175
|
-
className,
|
|
176
|
-
closeOnBackdropClick,
|
|
177
|
-
zIndex
|
|
178
|
-
}: SheetProps): react_jsx_runtime10.JSX.Element | null;
|
|
179
|
-
//#endregion
|
|
180
|
-
//#region src/ui-client/tooltip/tooltip-container.d.ts
|
|
181
|
-
type SubPlacement = 'start' | 'end';
|
|
182
|
-
type MainPlacement = 'top' | 'bottom';
|
|
183
|
-
type TooltipPlacement = MainPlacement | `${MainPlacement}-${SubPlacement}`;
|
|
184
|
-
interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
185
|
-
children: React.ReactNode;
|
|
186
|
-
content: string;
|
|
187
|
-
placement?: TooltipPlacement;
|
|
188
|
-
defaultOpen?: boolean;
|
|
189
|
-
}
|
|
190
|
-
declare const TooltipContainer: react1.ForwardRefExoticComponent<TooltipContainerProps & react1.RefAttributes<HTMLDivElement>>;
|
|
191
|
-
//#endregion
|
|
192
|
-
export { BaseImage, Carousel, type CarouselApi, type CarouselContextProps, CarouselDots as CarouselDot, CarouselDots$1 as CarouselDots, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, Dialog, type DialogProps, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps, Sheet, type SheetProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { a as UseSubsetImageProps, n as BaseProps } from "../index-ByfkW7VU.mjs";
|
|
2
|
-
import * as react3 from "react";
|
|
3
|
-
import React$1, { ComponentProps, HTMLAttributes, ReactNode } from "react";
|
|
4
|
-
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
5
|
-
import { VariantProps } from "class-variance-authority";
|
|
6
|
-
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
7
|
-
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
8
|
-
|
|
9
|
-
//#region src/ui-client/carousel/carousel-context.d.ts
|
|
10
|
-
type CarouselApi = UseEmblaCarouselType[1];
|
|
11
|
-
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
12
|
-
type CarouselOptions = UseCarouselParameters[0];
|
|
13
|
-
type CarouselPlugin = UseCarouselParameters[1];
|
|
14
|
-
interface CarouselProps {
|
|
15
|
-
options?: CarouselOptions;
|
|
16
|
-
plugins?: CarouselPlugin;
|
|
17
|
-
orientation?: 'horizontal' | 'vertical';
|
|
18
|
-
setApi?: (api: CarouselApi) => void;
|
|
19
|
-
}
|
|
20
|
-
type CarouselContextProps = {
|
|
21
|
-
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
22
|
-
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
23
|
-
scrollPrev: () => void;
|
|
24
|
-
scrollNext: () => void;
|
|
25
|
-
canScrollPrev: boolean;
|
|
26
|
-
canScrollNext: boolean;
|
|
27
|
-
scrollTo: (index: number) => void;
|
|
28
|
-
dots: number;
|
|
29
|
-
selectedScrollSnap: number;
|
|
30
|
-
} & CarouselProps;
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/ui-client/carousel/carousel.d.ts
|
|
33
|
-
interface CarouselProps$1 extends ComponentProps<'div'>, CarouselProps {
|
|
34
|
-
orientation?: 'horizontal' | 'vertical';
|
|
35
|
-
options?: CarouselProps['options'];
|
|
36
|
-
setApi?: CarouselProps['setApi'];
|
|
37
|
-
plugins?: CarouselProps['plugins'];
|
|
38
|
-
}
|
|
39
|
-
declare function Carousel({
|
|
40
|
-
orientation,
|
|
41
|
-
options,
|
|
42
|
-
setApi,
|
|
43
|
-
plugins,
|
|
44
|
-
className,
|
|
45
|
-
children,
|
|
46
|
-
...props
|
|
47
|
-
}: CarouselProps$1): react_jsx_runtime1.JSX.Element;
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/ui-client/carousel/carousel-wrapper.d.ts
|
|
50
|
-
declare function CarouselWrapper({
|
|
51
|
-
className,
|
|
52
|
-
...props
|
|
53
|
-
}: React$1.ComponentProps<'div'>): react_jsx_runtime1.JSX.Element;
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/ui-client/carousel/carousel-item.d.ts
|
|
56
|
-
declare function CarouselItem({
|
|
57
|
-
className,
|
|
58
|
-
...props
|
|
59
|
-
}: React$1.ComponentProps<'div'>): react_jsx_runtime1.JSX.Element;
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/ui-client/carousel/carousel-previous.d.ts
|
|
62
|
-
declare function CarouselPrevious({
|
|
63
|
-
children,
|
|
64
|
-
className,
|
|
65
|
-
...props
|
|
66
|
-
}: React$1.ComponentProps<'button'>): react_jsx_runtime1.JSX.Element;
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region src/ui-client/carousel/carousel-next.d.ts
|
|
69
|
-
declare function CarouselNext({
|
|
70
|
-
children,
|
|
71
|
-
className,
|
|
72
|
-
...props
|
|
73
|
-
}: React$1.ComponentProps<'button'>): react_jsx_runtime1.JSX.Element;
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/ui-client/carousel/carousel-dots.d.ts
|
|
76
|
-
declare function CarouselDots$1({
|
|
77
|
-
children,
|
|
78
|
-
...props
|
|
79
|
-
}: Omit<React$1.ComponentProps<'button'>, 'children'> & {
|
|
80
|
-
children?: (index: number) => React$1.ReactNode;
|
|
81
|
-
}): react_jsx_runtime1.JSX.Element;
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region src/ui-client/carousel/carousel-dot.d.ts
|
|
84
|
-
declare function CarouselDots({
|
|
85
|
-
index,
|
|
86
|
-
children,
|
|
87
|
-
...props
|
|
88
|
-
}: React$1.ComponentProps<'button'> & {
|
|
89
|
-
index: number;
|
|
90
|
-
}): react_jsx_runtime1.JSX.Element;
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/ui-client/dialog/dialog.d.ts
|
|
93
|
-
declare const classes: (props?: ({
|
|
94
|
-
padding?: "none" | "sm" | "md" | "lg" | null | undefined;
|
|
95
|
-
maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null | undefined;
|
|
96
|
-
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
97
|
-
interface DialogProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
98
|
-
closeOnBackdropClick?: boolean;
|
|
99
|
-
isOpen: boolean;
|
|
100
|
-
zIndex?: number;
|
|
101
|
-
onClose: () => void;
|
|
102
|
-
children: ReactNode;
|
|
103
|
-
}
|
|
104
|
-
declare function Dialog({
|
|
105
|
-
closeOnBackdropClick,
|
|
106
|
-
isOpen,
|
|
107
|
-
zIndex,
|
|
108
|
-
padding,
|
|
109
|
-
maxWidth,
|
|
110
|
-
className,
|
|
111
|
-
onClose,
|
|
112
|
-
children,
|
|
113
|
-
...rest
|
|
114
|
-
}: DialogProps): react_jsx_runtime1.JSX.Element | null;
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region src/ui-client/image/image.d.ts
|
|
117
|
-
type ImageSubsetProps = {
|
|
118
|
-
layout?: 'intrinsic' | 'stretch';
|
|
119
|
-
skeleton?: boolean;
|
|
120
|
-
emptyNode?: React.ReactNode;
|
|
121
|
-
emptyNodeClassName?: string;
|
|
122
|
-
skeletonClassName?: string;
|
|
123
|
-
};
|
|
124
|
-
type ImageProps = UseSubsetImageProps & ImageSubsetProps;
|
|
125
|
-
declare const BaseImage: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
126
|
-
fill: true;
|
|
127
|
-
sizes: string;
|
|
128
|
-
width?: never;
|
|
129
|
-
height?: never;
|
|
130
|
-
}, "ref"> | Omit<BaseProps & {
|
|
131
|
-
fill?: false;
|
|
132
|
-
sizes?: never;
|
|
133
|
-
width: number;
|
|
134
|
-
height: number;
|
|
135
|
-
}, "ref">) & react3.RefAttributes<HTMLImageElement>>;
|
|
136
|
-
declare const Image: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
137
|
-
fill: true;
|
|
138
|
-
sizes: string;
|
|
139
|
-
width?: never;
|
|
140
|
-
height?: never;
|
|
141
|
-
} & ImageSubsetProps, "ref"> | Omit<BaseProps & {
|
|
142
|
-
fill?: false;
|
|
143
|
-
sizes?: never;
|
|
144
|
-
width: number;
|
|
145
|
-
height: number;
|
|
146
|
-
} & ImageSubsetProps, "ref">) & react3.RefAttributes<HTMLImageElement>>;
|
|
147
|
-
interface EmptyNodeProps {
|
|
148
|
-
children: React.ReactNode;
|
|
149
|
-
className?: string;
|
|
150
|
-
}
|
|
151
|
-
declare const EmptyNode: ({
|
|
152
|
-
children,
|
|
153
|
-
className
|
|
154
|
-
}: EmptyNodeProps) => react_jsx_runtime1.JSX.Element;
|
|
155
|
-
//#endregion
|
|
156
|
-
//#region src/ui-client/sheet/sheet.d.ts
|
|
157
|
-
type Direction = 'top' | 'bottom' | 'left' | 'right';
|
|
158
|
-
type Size = 'full' | 'half' | 'auto';
|
|
159
|
-
interface SheetProps {
|
|
160
|
-
isOpen: boolean;
|
|
161
|
-
onClose: () => void;
|
|
162
|
-
direction?: Direction;
|
|
163
|
-
size?: Size;
|
|
164
|
-
children: React$1.ReactNode;
|
|
165
|
-
className?: string;
|
|
166
|
-
closeOnBackdropClick?: boolean;
|
|
167
|
-
zIndex?: number;
|
|
168
|
-
}
|
|
169
|
-
declare function Sheet({
|
|
170
|
-
isOpen,
|
|
171
|
-
onClose,
|
|
172
|
-
direction,
|
|
173
|
-
size,
|
|
174
|
-
children,
|
|
175
|
-
className,
|
|
176
|
-
closeOnBackdropClick,
|
|
177
|
-
zIndex
|
|
178
|
-
}: SheetProps): react_jsx_runtime1.JSX.Element | null;
|
|
179
|
-
//#endregion
|
|
180
|
-
//#region src/ui-client/tooltip/tooltip-container.d.ts
|
|
181
|
-
type SubPlacement = 'start' | 'end';
|
|
182
|
-
type MainPlacement = 'top' | 'bottom';
|
|
183
|
-
type TooltipPlacement = MainPlacement | `${MainPlacement}-${SubPlacement}`;
|
|
184
|
-
interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
185
|
-
children: React.ReactNode;
|
|
186
|
-
content: string;
|
|
187
|
-
placement?: TooltipPlacement;
|
|
188
|
-
defaultOpen?: boolean;
|
|
189
|
-
}
|
|
190
|
-
declare const TooltipContainer: react3.ForwardRefExoticComponent<TooltipContainerProps & react3.RefAttributes<HTMLDivElement>>;
|
|
191
|
-
//#endregion
|
|
192
|
-
export { BaseImage, Carousel, type CarouselApi, type CarouselContextProps, CarouselDots as CarouselDot, CarouselDots$1 as CarouselDots, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, Dialog, type DialogProps, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps, Sheet, type SheetProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
package/dist/ui-client/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../src-C_FmOyer.mjs";import{y as e}from"../util-zXJA6Gnc.mjs";import{t}from"../skeleton-S6S1ZnCy.mjs";import{c as n,o as r,r as i}from"../hooks-DBo6LQrH.mjs";import"../providers-5JCPezAS.mjs";import a from"clsx";import o,{forwardRef as s,useCallback as c,useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{cva as g}from"class-variance-authority";import _ from"embla-carousel-react";import{createPortal as v}from"react-dom";const y=o.createContext(null);function b(){let e=o.useContext(y);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function x({orientation:t=`horizontal`,options:n,setApi:r,plugins:i,className:a,children:o,...s}){let[u,d]=_({...n,axis:t===`horizontal`?`x`:`y`},i),[p,h]=f(!1),[g,v]=f(!1),[b,x]=f(0),[S,C]=f(0),w=c(e=>{e&&(h(e.canScrollPrev()),v(e.canScrollNext()),C(e.selectedScrollSnap()))},[]),T=c(()=>{d?.scrollPrev()},[d]),E=c(()=>{d?.scrollNext()},[d]),D=c(e=>{d?.scrollTo(e)},[d]),O=c(()=>{x(d?.scrollSnapList().length||0)},[d]),k=c(e=>{t===`horizontal`?e.key===`ArrowLeft`?(e.preventDefault(),T()):e.key===`ArrowRight`&&(e.preventDefault(),E()):e.key===`ArrowUp`?(e.preventDefault(),T()):e.key===`ArrowDown`&&(e.preventDefault(),E())},[T,E,t]);return l(()=>{!d||!r||r(d)},[d,r]),l(()=>{if(d)return w(d),O(),d.on(`reInit`,O),d.on(`reInit`,w),d.on(`select`,w),()=>{d?.off(`select`,w)}},[d,w]),m(y.Provider,{value:{carouselRef:u,api:d,options:n,orientation:t||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:T,scrollNext:E,canScrollPrev:p,canScrollNext:g,scrollTo:D,dots:b,selectedScrollSnap:S},children:m(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:k,className:e(`komc:relative`,a),...s,children:o})})}function S({className:t,...n}){let{carouselRef:r,orientation:i}=b();return m(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:m(`div`,{className:e(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,t),...n})})}function C({className:t,...n}){let{orientation:r}=b();return m(`div`,{"data-komc":!0,className:e(`komc:min-w-0 komc:shrink-0 komc:grow-0 komc:basis-full`,r===`horizontal`?`komc:pl-4`:`komc:pt-4`,t),...n})}function w({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:i}=b();return m(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`previous slide`,className:a(`komc:w-full`,t),onClick:r,...n,children:e})}function T({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:i}=b();return m(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`next slide`,className:a(`komc:w-full`,t),onClick:r,...n,children:e})}function E({children:e,...t}){let{dots:n,selectedScrollSnap:r,scrollTo:i}=b();return m(p,{children:Array.from({length:n}).map((n,a)=>m(`button`,{type:`button`,"data-komc":!0,"data-selected":r===a,"aria-label":`go to slide ${a+1}`,onClick:()=>i(a),...t,children:e?.(a)},a))})}function D({index:e,children:t,...n}){let{selectedScrollSnap:r,scrollTo:i}=b();return m(`button`,{type:`button`,"data-komc":!0,"data-selected":r===e,"aria-label":`go to slide ${e+1}`,onClick:()=>i(e),...n,children:t})}const O=g(`komc:relative komc:z-10 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden komc:w-full komc:max-h-full komc:min-w-0 komc:transition-all komc:duration-300 komc:ease-in-out`,{variants:{padding:{sm:`komc:p-2`,md:`komc:p-4`,lg:`komc:p-6`,none:`komc:p-0`},maxWidth:{sm:`komc:max-w-sm`,md:`komc:max-w-md`,lg:`komc:max-w-lg`,xl:`komc:max-w-xl`,"2xl":`komc:max-w-2xl`,full:`komc:max-w-full`}},defaultVariants:{padding:`sm`,maxWidth:`md`}});function k({closeOnBackdropClick:e=!0,isOpen:t,zIndex:r=1e4,padding:i,maxWidth:a,className:o,onClose:s,children:u,...d}){let p=n(t,300),[g,_]=f(!1);l(()=>{if(t&&p){let e=setTimeout(()=>_(!0),10);return()=>clearTimeout(e)}else t||_(!1)},[t,p]);let v=c(e=>{e.key===`Escape`&&s()},[s]),y=c(()=>{e&&s()},[e,s]);return l(()=>(t?(document.addEventListener(`keydown`,v),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,v),document.body.style.overflow=`unset`}),[t,v]),p?m(`div`,{"data-komc":!0,className:`komc:fixed komc:inset-0 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden`,style:{zIndex:r},children:h(`div`,{className:`komc:relative komc:flex komc:min-h-0 komc:flex-1 komc:w-full komc:items-center komc:justify-center`,children:[m(`button`,{type:`button`,"data-state":g?`open`:`closed`,className:`komc:fixed komc:inset-0 komc:z-0 komc:cursor-default komc:bg-black/50 komc:transition-opacity komc:duration-300 komc:ease-in-out komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100`,onClick:y,"aria-label":`close dialog`}),m(`div`,{"data-state":g?`open`:`closed`,className:`${O({padding:i,maxWidth:a,className:o})} komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100 komc:data-[state=closed]:scale-95 komc:data-[state=open]:scale-100`,role:`dialog`,"aria-modal":`true`,...d,children:u})]})}):null}const A=g(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),j=s(({...e},t)=>{let{ref:n,imageProps:r}=i({ref:t,...e});return m(`img`,{ref:n,...r})}),M=s(({skeleton:e=!0,layout:n=`stretch`,fallbackSrc:r,className:o,emptyNode:s,emptyNodeClassName:c,skeletonClassName:l,...u},d)=>{let{ref:f,isLoad:g,isError:_,imageProps:v}=i({ref:d,fallbackSrc:r,forceLoad:!e,...u}),y=!u.fill&&n===`intrinsic`?{width:`${u.width}px`,height:`${u.height}px`}:void 0,b=a(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!u.fill&&n===`stretch`&&`komc:w-full komc:h-full`);return!r&&_&&s?u.fill?m(N,{className:c,children:s}):m(`div`,{"data-komc":!0,style:y,className:b,children:m(N,{className:c,children:s})}):u.fill?h(p,{children:[m(`img`,{ref:f,...v,className:a(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:invisible`:`komc:visible`,o)}),m(`div`,{"data-komc":!0,className:a(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:block`:`komc:hidden`),children:m(t,{size:`full`,className:l})})]}):h(`div`,{"data-komc":!0,style:y,className:b,children:[m(`img`,{ref:f,...v,className:a(A({fill:u.fill,className:o}),e&&!g?`komc:invisible`:`komc:visible`)}),m(`div`,{className:a(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:block`:`komc:hidden`),children:m(t,{size:`full`,className:l})})]})}),N=({children:e,className:t})=>m(`div`,{"data-komc":!0,role:`alert`,className:a(`komc:flex komc:justify-center komc:items-center komc:w-full komc:h-full komc:bg-gray-100 komc:absolute komc:inset-0 komc:p-1`,t),children:e});var P=M;const F=g(a(`komc:absolute komc:bg-white komc:flex komc:flex-col komc:shadow-2xl`,`komc:transition-transform komc:duration-300 komc:ease-in-out`),{variants:{direction:{top:`komc:top-0 komc:left-0 komc:right-0 komc:-translate-y-full komc:data-[state=open]:translate-y-0`,bottom:`komc:bottom-0 komc:left-0 komc:right-0 komc:translate-y-full komc:data-[state=open]:translate-y-0`,left:`komc:top-0 komc:bottom-0 komc:left-0 komc:-translate-x-full komc:data-[state=open]:translate-x-0`,right:`komc:top-0 komc:bottom-0 komc:right-0 komc:translate-x-full komc:data-[state=open]:translate-x-0`}}}),I=g(``,{variants:{size:{full:``,half:``,auto:``},direction:{top:``,bottom:``,left:``,right:``}},compoundVariants:[{size:`full`,direction:`top`,className:`komc:h-full`},{size:`full`,direction:`bottom`,className:`komc:h-full`},{size:`full`,direction:`left`,className:`komc:w-full`},{size:`full`,direction:`right`,className:`komc:w-full`},{size:`half`,direction:`top`,className:`komc:h-[50dvh]`},{size:`half`,direction:`bottom`,className:`komc:h-[50dvh]`},{size:`half`,direction:`left`,className:`komc:w-[50dvw]`},{size:`half`,direction:`right`,className:`komc:w-[50dvw]`},{size:`auto`,direction:`top`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`bottom`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`left`,className:`komc:w-auto komc:max-w-[90dvw]`},{size:`auto`,direction:`right`,className:`komc:w-auto komc:max-w-[90dvw]`}]});function L({isOpen:e,onClose:t,direction:r=`bottom`,size:i=`full`,children:o,className:s,closeOnBackdropClick:u=!0,zIndex:d=1001}){let p=n(e,300),[g,_]=f(!1);l(()=>{if(e&&p){let e=setTimeout(()=>_(!0),10);return()=>clearTimeout(e)}else e||_(!1)},[e,p]);let v=c(e=>{e.key===`Escape`&&t()},[t]),y=c(()=>{u&&t()},[u,t]);return l(()=>(e?(document.addEventListener(`keydown`,v),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,v),document.body.style.overflow=`unset`}),[e,v]),p?h(`div`,{className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:d},children:[m(`button`,{type:`button`,"data-state":g?`open`:`closed`,className:a(`komc:absolute komc:inset-0 komc:w-full komc:h-full komc:bg-black/40 komc:cursor-default`,`komc:transition-opacity komc:duration-300 komc:ease-in-out`,`komc:opacity-0 komc:data-[state=open]:opacity-100`),onClick:y,"aria-label":`close sheet`}),m(`div`,{"data-state":g?`open`:`closed`,className:a(F({direction:r,className:s}),I({direction:r,size:i})),role:`dialog`,"aria-modal":`true`,children:o})]}):null}function R({children:e,setOpen:t}){return m(`div`,{"data-komc":!0,className:a(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const z=g(e(`komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:`komc:fixed`,false:`komc:absolute`},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}});var B=s(({portal:e,children:t,className:n,placement:r,...i},a)=>m(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:z({portal:e,placement:r,className:n}),...i,children:t}));const V=g(e(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:e(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:e(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":e(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":e(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":e(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":e(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}});var H=({placement:e,className:t,offset:n,style:r,...i})=>{let a=u(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return m(`div`,{className:V({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${a}`},...i})};const U=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function W({placement:e,className:t,content:n,open:r,hiddenRef:i,containerRef:o}){let[s,u]=f(!1),[d,p]=f(e),[g,_]=f({top:0,left:0}),[y,b]=f({x:0,y:0});l(()=>{u(!0)},[]);let x=c(()=>{let t=o.current,n=i.current;if(!t||!n)return;let r=t.getBoundingClientRect(),a=n.getBoundingClientRect(),s=e,[c]=s.split(`-`),l=r.top,u=window.innerHeight-r.bottom;c===`bottom`&&u<a.height&&l>=a.height?s=U(s,`top`):c===`top`&&l<a.height&&u>=a.height&&(s=U(s,`bottom`)),p(s);let[d,f]=s.split(`-`),m=r.top,h=r.left+r.width/2-a.width/2;switch(d){case`top`:m-=a.height;break;case`bottom`:m+=r.height;break}switch(f){case`start`:h+=a.width/2-24;break;case`end`:h-=a.width/2-24;break}let g=h,v=window.innerWidth;g+a.width>v-4&&(g=v-a.width-4),g<4&&(g=4),_({top:m,left:g}),b({x:h-g,y:0})},[e,o,i]);return l(()=>{if(!s||!r)return;console.log(`updateLayout`);let e=!1,t=0,n=0,i=!1;x();let a=()=>{i||=(t=requestAnimationFrame(()=>{e||x(),i=!1}),!0)};window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a);let c=0,l=0,u=``,d=()=>{if(e||c>=180)return;let t=o.current;if(t){let e=t.getBoundingClientRect(),n=`${e.top.toFixed(4)},${e.left.toFixed(4)},${e.width.toFixed(4)},${e.height.toFixed(4)}`;n===u?l+=1:(l=0,u=n,x())}l<2&&(c+=1,n=requestAnimationFrame(d))};return n=requestAnimationFrame(d),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[s,r,x,o]),s?v(h(B,{portal:!0,"data-komc":!0,placement:d,className:a(t,r?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...g},children:[m(`span`,{children:n}),m(H,{placement:d,offset:y})]}),document.body):null}var G=s(({children:e,content:t,defaultOpen:n=!1,className:i,placement:o=`top`},s)=>{let[c,l]=f(n),u=d(null),p=d(null);return r({ref:u,setOpen:l}),h(`div`,{ref:u,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[m(R,{setOpen:l,children:e}),m(W,{placement:o,className:i,open:c,content:t,hiddenRef:p,containerRef:u}),m(B,{ref:p,role:`presentation`,"aria-hidden":`true`,placement:o,className:a(`komc:opacity-0 komc:invisible`,i),children:m(`span`,{children:t})})]})});export{j as BaseImage,x as Carousel,D as CarouselDot,E as CarouselDots,C as CarouselItem,T as CarouselNext,w as CarouselPrevious,S as CarouselWrapper,k as Dialog,N as EmptyNode,P as Image,L as Sheet,G as Tooltip};
|
package/dist/util/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../util-o7fjt7iK.cjs`);exports.appendSearchPath=e.z,exports.calcPageCount=e.v,exports.clearQueryByKey=e.B,exports.clearSearchPath=e.V,exports.cn=e.y,exports.comparePriorityAsc=e.b,exports.composeKey=e.x,exports.deleteAllSearchHistory=e.H,exports.deleteSearchHistory=e.U,exports.displayDatetime=e._,exports.existLeastOne=e.S,exports.formatBytes=e.d,exports.formatCompactNumber=e.o,exports.formatExceedNumber=e.s,exports.formatI18nNumber=e.c,exports.formatKoNumber=e.l,exports.genNanoID=e.t,exports.generatePage=e.n,exports.generatePageGroup=e.r,exports.getCookie=e.W,exports.getFileExtension=e.f,exports.getFilename=e.p,exports.getFirstLocationAddress=e.C,exports.getFullAddress=e.w,exports.getI18nKey=e.T,exports.getI18nValue=e.E,exports.getI18nValues=e.D,exports.getModelName=e.O,exports.getSearchHistory=e.G,exports.getYoutubeVideoId=e.K,exports.insertSearchHistory=e.q,exports.isExternalSrc=e.m,exports.isSearchPage=e.J,exports.isSrcSetCompatible=e.h,exports.link=e.k,exports.loadExLib=e.A,exports.parsePath=e.g,exports.parseQuery=e.j,exports.printNanoID=e.i,exports.productSlugify=e.M,exports.randomNum=e.a,exports.recomposeI18nNumber=e.u,exports.selectItemByWeight=e.N,exports.setCookies=e.Y,exports.shuffle=e.P,exports.sleep=e.F,exports.slugify=e.I,exports.withoutProperties=e.L,exports.withoutProperty=e.R;
|
package/dist/util/index.d.cts
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import lib from "google-libphonenumber";
|
|
2
|
-
|
|
3
|
-
//#region src/util/browser.d.ts
|
|
4
|
-
declare const getCookie: (key: string) => string | undefined;
|
|
5
|
-
declare const setCookies: (key: string, value: string, options?: Cookies.CookieAttributes) => string | undefined;
|
|
6
|
-
declare const getSearchHistory: () => string[];
|
|
7
|
-
declare const insertSearchHistory: (item: string) => string[];
|
|
8
|
-
declare const deleteSearchHistory: (index: number) => string[];
|
|
9
|
-
declare const deleteAllSearchHistory: () => void;
|
|
10
|
-
declare const isSearchPage: (pathname: string) => boolean;
|
|
11
|
-
declare const appendSearchPath: (pathname: string) => string;
|
|
12
|
-
declare const clearSearchPath: (pathname: string) => string;
|
|
13
|
-
declare const clearQueryByKey: (query: Record<string, any>, key: string) => {
|
|
14
|
-
[k: string]: string;
|
|
15
|
-
};
|
|
16
|
-
declare const getYoutubeVideoId: (youtubeURL?: string | null) => string;
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/util/common.d.ts
|
|
19
|
-
declare const link: (param: Record<string, string>, deleteKeys?: string[]) => string;
|
|
20
|
-
declare const calcPageCount: (total: number, perPage: number) => number;
|
|
21
|
-
declare const shuffle: <T>(arr: T[]) => T[];
|
|
22
|
-
declare const loadExLib: (callback: () => void) => void;
|
|
23
|
-
declare const slugify: (base: string | number, ...args: Array<string | undefined>) => string;
|
|
24
|
-
interface Product<I extends I18n = I18n> {
|
|
25
|
-
id: number;
|
|
26
|
-
stockNo?: string[];
|
|
27
|
-
series?: Series<I> | null;
|
|
28
|
-
i18n: I[];
|
|
29
|
-
}
|
|
30
|
-
interface Series<I extends I18n = I18n> {
|
|
31
|
-
i18n: I[];
|
|
32
|
-
}
|
|
33
|
-
interface I18n {
|
|
34
|
-
name?: string | null;
|
|
35
|
-
locale: string;
|
|
36
|
-
priority: number;
|
|
37
|
-
}
|
|
38
|
-
declare const productSlugify: (product: Product) => string;
|
|
39
|
-
declare const getModelName: (modelName: string[]) => string;
|
|
40
|
-
declare const getI18nValues: <T extends {
|
|
41
|
-
locale: string;
|
|
42
|
-
priority: number;
|
|
43
|
-
}, K extends keyof T>(locale: string | undefined, values: T[], key: K) => T[K];
|
|
44
|
-
declare const getI18nValue: <T extends {
|
|
45
|
-
locale: string;
|
|
46
|
-
priority: number;
|
|
47
|
-
[key: string]: string | number | null | undefined;
|
|
48
|
-
}>(locale?: string, values?: T[], key?: keyof T) => string;
|
|
49
|
-
declare const comparePriorityAsc: <T extends {
|
|
50
|
-
priority: number;
|
|
51
|
-
}>(a: T, b: T) => 0 | 1 | -1;
|
|
52
|
-
declare const parseQuery: <T, F = T>(q: string | string[] | undefined | null, conv: (v: string) => T, fallback: F) => T | F;
|
|
53
|
-
declare const withoutProperty: <T, K extends keyof T>(obj: T, property: K) => Omit<T, K>;
|
|
54
|
-
declare const withoutProperties: <T extends Record<string, unknown>>(obj: T, properties: Array<keyof T>) => T;
|
|
55
|
-
declare const existLeastOne: <T>(a: T[], b: T[]) => boolean;
|
|
56
|
-
declare const getI18nKey: (key: string) => string | undefined;
|
|
57
|
-
declare const composeKey: (prefix?: Array<string | number> | string, ...keys: Array<string | number>) => string;
|
|
58
|
-
interface Location<I extends LocationI18n = LocationI18n> {
|
|
59
|
-
i18n: I[];
|
|
60
|
-
}
|
|
61
|
-
interface LocationI18n extends I18n {
|
|
62
|
-
address1?: string | null;
|
|
63
|
-
address2?: string | null;
|
|
64
|
-
}
|
|
65
|
-
declare const getFirstLocationAddress: (locale: string | undefined, locations: Location[]) => string;
|
|
66
|
-
declare const getFullAddress: (locale: string | undefined, values: LocationI18n[]) => string;
|
|
67
|
-
declare const selectItemByWeight: <T extends {
|
|
68
|
-
weight: number;
|
|
69
|
-
}>(itemsWithWeights: T[]) => T;
|
|
70
|
-
declare const sleep: (ms: number) => Promise<unknown>;
|
|
71
|
-
declare const cn: (...classes: Array<string | false | null | undefined>) => string;
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/util/date.d.ts
|
|
74
|
-
declare const displayDatetime: (date: string, format?: string, locale?: string) => string;
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region src/util/file.d.ts
|
|
77
|
-
declare function formatBytes(bytes: number, decimals?: number): string;
|
|
78
|
-
declare const getFilename: (s: string) => string;
|
|
79
|
-
declare const getFileExtension: (s: string) => string | undefined;
|
|
80
|
-
interface PathInfo {
|
|
81
|
-
directory: string;
|
|
82
|
-
filename: string;
|
|
83
|
-
extension: string;
|
|
84
|
-
filenameWithoutExtension: string;
|
|
85
|
-
}
|
|
86
|
-
declare const parsePath: (filepath: string, folder?: string) => PathInfo;
|
|
87
|
-
declare const isExternalSrc: (src: string) => boolean;
|
|
88
|
-
declare const isSrcSetCompatible: (src: string) => boolean;
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region src/util/format.d.ts
|
|
91
|
-
declare const PhoneNumberFormat: typeof lib.PhoneNumberFormat;
|
|
92
|
-
declare const formatCompactNumber: (number: number, locale?: string, options?: Intl.NumberFormatOptions) => string;
|
|
93
|
-
declare const formatExceedNumber: (number: number, threshold: number, suffix?: string) => string;
|
|
94
|
-
declare const formatKoNumber: (number?: number | string | null) => string;
|
|
95
|
-
declare const recomposeI18nNumber: (locale: string, number?: string | null, i18nNumber?: string | null) => string;
|
|
96
|
-
type PhoneFormatType = 'international' | 'national' | 'rfc3966';
|
|
97
|
-
interface I18nNumberProps {
|
|
98
|
-
phone?: string | null;
|
|
99
|
-
alpha2Code?: string;
|
|
100
|
-
callingCode?: string;
|
|
101
|
-
format?: keyof typeof PhoneNumberFormat;
|
|
102
|
-
locale?: string;
|
|
103
|
-
}
|
|
104
|
-
declare const formatI18nNumber: ({
|
|
105
|
-
phone,
|
|
106
|
-
alpha2Code,
|
|
107
|
-
callingCode,
|
|
108
|
-
format,
|
|
109
|
-
locale
|
|
110
|
-
}: I18nNumberProps) => string;
|
|
111
|
-
//#endregion
|
|
112
|
-
//#region src/util/generator.d.ts
|
|
113
|
-
declare const randomNum: (min: number, max: number, count?: number) => number[];
|
|
114
|
-
declare const genNanoID: () => string;
|
|
115
|
-
declare const printNanoID: (cnt: number) => void;
|
|
116
|
-
declare const generatePage: (count: number, page: number, pagePerView: number) => {
|
|
117
|
-
current: number;
|
|
118
|
-
start: number;
|
|
119
|
-
end: number;
|
|
120
|
-
};
|
|
121
|
-
declare const generatePageGroup: (count: number, page: number, pagePerView: number) => {
|
|
122
|
-
prev: number;
|
|
123
|
-
next: number;
|
|
124
|
-
isPrev: boolean;
|
|
125
|
-
isNext: boolean;
|
|
126
|
-
items: number[];
|
|
127
|
-
};
|
|
128
|
-
//#endregion
|
|
129
|
-
export { I18nNumberProps, PhoneFormatType, appendSearchPath, calcPageCount, clearQueryByKey, clearSearchPath, cn, comparePriorityAsc, composeKey, deleteAllSearchHistory, deleteSearchHistory, displayDatetime, existLeastOne, formatBytes, formatCompactNumber, formatExceedNumber, formatI18nNumber, formatKoNumber, genNanoID, generatePage, generatePageGroup, getCookie, getFileExtension, getFilename, getFirstLocationAddress, getFullAddress, getI18nKey, getI18nValue, getI18nValues, getModelName, getSearchHistory, getYoutubeVideoId, insertSearchHistory, isExternalSrc, isSearchPage, isSrcSetCompatible, link, loadExLib, parsePath, parseQuery, printNanoID, productSlugify, randomNum, recomposeI18nNumber, selectItemByWeight, setCookies, shuffle, sleep, slugify, withoutProperties, withoutProperty };
|