oziko-ui-kit 0.0.34 → 0.0.36
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/atoms/inputs/normal/chip/ChipInput.d.ts +3 -1
- package/dist/components/atoms/relation-input/RelationInput.d.ts +19 -0
- package/dist/components/atoms/relation-input/relation-select/RelationSelect.d.ts +34 -0
- package/dist/custom-hooks/useInputRepresenter.d.ts +17 -2
- package/dist/index.css +71 -0
- package/dist/index.export.d.ts +2 -0
- package/dist/index.mjs +16 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
|
@@ -3,7 +3,9 @@ import { TypeFlexElement } from "../../../flex-element/FlexElement";
|
|
|
3
3
|
export type TypeChipInput = {
|
|
4
4
|
label?: string[];
|
|
5
5
|
placeholder?: string;
|
|
6
|
-
onChange
|
|
6
|
+
onChange: (value: string[]) => void;
|
|
7
|
+
value: string[];
|
|
8
|
+
allowDuplicateValues?: boolean;
|
|
7
9
|
} & TypeFlexElement;
|
|
8
10
|
declare const _default: React.NamedExoticComponent<TypeChipInput>;
|
|
9
11
|
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TypeFlexElement } from "../flex-element/FlexElement";
|
|
3
|
+
import { TypeFluidContainer } from "../fluid-container/FluidContainer";
|
|
4
|
+
import { TypeLabeledValue } from "../../../index.export";
|
|
5
|
+
export type TypeRelationInput<T = TypeLabeledValue> = {
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
value?: T | T[];
|
|
9
|
+
onChange?: (value: T[]) => void;
|
|
10
|
+
selectProps?: TypeFluidContainer;
|
|
11
|
+
inputContainerClassName?: string;
|
|
12
|
+
getOptions: () => Promise<TypeLabeledValue[]>;
|
|
13
|
+
loadMoreOptions: () => Promise<TypeLabeledValue[]>;
|
|
14
|
+
searchOptions: (value: string) => Promise<TypeLabeledValue[]>;
|
|
15
|
+
totalOptionsLength: number;
|
|
16
|
+
multiple?: boolean;
|
|
17
|
+
} & TypeFlexElement;
|
|
18
|
+
declare const _default: React.MemoExoticComponent<(<T extends TypeLabeledValue>({ label, description, value, onChange, selectProps, inputContainerClassName, getOptions, loadMoreOptions, searchOptions, totalOptionsLength, multiple, ...props }: TypeRelationInput<T>) => import("react/jsx-runtime").JSX.Element)>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Ref } from "react";
|
|
2
|
+
import { TypeFluidContainer } from "../../fluid-container/FluidContainer";
|
|
3
|
+
import { TypeLabeledValue } from "../../select-option/SelectOption";
|
|
4
|
+
export type TypeRelationSelectRef = {
|
|
5
|
+
toggleDropdown: (toggleValue?: boolean) => void;
|
|
6
|
+
clear: () => void;
|
|
7
|
+
};
|
|
8
|
+
export type TypeRelationSelect = {
|
|
9
|
+
options: TypeLabeledValue[];
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
placement?: "bottom" | "top";
|
|
12
|
+
multiple?: boolean;
|
|
13
|
+
maxCount?: number;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
popupClassName?: string;
|
|
16
|
+
optionProps?: TypeFluidContainer;
|
|
17
|
+
selectRef?: Ref<TypeRelationSelectRef>;
|
|
18
|
+
disableClick?: boolean;
|
|
19
|
+
onChange?: (value: TypeLabeledValue | TypeLabeledValue[]) => void;
|
|
20
|
+
loadMoreOptions: () => void;
|
|
21
|
+
searchOptions: (value: string) => void;
|
|
22
|
+
totalOptionsLength: number;
|
|
23
|
+
selectedOption: TypeLabeledValue | TypeLabeledValue[] | null;
|
|
24
|
+
setSelectedOption: React.Dispatch<React.SetStateAction<TypeLabeledValue | TypeLabeledValue[] | null>>;
|
|
25
|
+
};
|
|
26
|
+
declare const _default: import("react").NamedExoticComponent<TypeRelationSelect & {
|
|
27
|
+
prefix?: import("../../../../index.export").TypeFlexElement;
|
|
28
|
+
root?: import("../../../../index.export").TypeFlexElement;
|
|
29
|
+
suffix?: import("../../../../index.export").TypeFlexElement;
|
|
30
|
+
mode?: "hug" | "fill" | "middle";
|
|
31
|
+
} & {
|
|
32
|
+
ref?: import("react").RefObject<HTMLDivElement | null>;
|
|
33
|
+
} & import("../../../../index.export").TypeFlexContainer & import("../../../../index.export").TypeFlexDimension & Omit<import("react").HTMLAttributes<HTMLDivElement>, "prefix" | "onChange">>;
|
|
34
|
+
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TypeCoordinates } from "../components/atoms/map/Map";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { utils } from "../utils";
|
|
4
|
+
import { TypeLabeledValue } from "../index.export";
|
|
4
5
|
export type TypeProperties = {
|
|
5
6
|
[key: string]: {
|
|
6
7
|
type: keyof typeof types;
|
|
@@ -15,6 +16,7 @@ export type TypeProperties = {
|
|
|
15
16
|
locationType?: string;
|
|
16
17
|
className?: string;
|
|
17
18
|
properties?: TypeProperties;
|
|
19
|
+
requires?: string;
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
export type TypeValueType = string | number | boolean | string[] | number[] | boolean[] | TypeRepresenterValue | TypeRepresenterValue[];
|
|
@@ -44,6 +46,9 @@ export type TypeInputProps<T> = {
|
|
|
44
46
|
className?: string;
|
|
45
47
|
onChange?: ({ key, value }: TypeChangeEvent<T>) => void;
|
|
46
48
|
};
|
|
49
|
+
export type TypeInputRepresenterError = {
|
|
50
|
+
[key: string]: string | null;
|
|
51
|
+
};
|
|
47
52
|
type TypeObjectInputProps<T> = {
|
|
48
53
|
key?: string;
|
|
49
54
|
properties?: TypeProperties;
|
|
@@ -59,6 +64,12 @@ type TypeArrayInputProps<T> = {
|
|
|
59
64
|
maxItems?: number;
|
|
60
65
|
items?: TypeArrayItems;
|
|
61
66
|
} & TypeInputProps<T[]>;
|
|
67
|
+
type TypeRelationInputProps<T> = {
|
|
68
|
+
getOptions: () => Promise<TypeLabeledValue[]>;
|
|
69
|
+
loadMoreOptions: () => Promise<TypeLabeledValue[]>;
|
|
70
|
+
searchOptions: (value: string) => Promise<TypeLabeledValue[]>;
|
|
71
|
+
totalOptionsLength: number;
|
|
72
|
+
} & TypeInputProps<T>;
|
|
62
73
|
export type TypeInputTypeMap = {
|
|
63
74
|
string: (props: TypeSelectInputProps<string>) => ReactNode;
|
|
64
75
|
number: (props: TypeSelectInputProps<number>) => ReactNode;
|
|
@@ -72,13 +83,17 @@ export type TypeInputTypeMap = {
|
|
|
72
83
|
richtext: (props: TypeInputProps<string>) => ReactNode;
|
|
73
84
|
object: (props: TypeObjectInputProps<TypeRepresenterValue>) => ReactNode;
|
|
74
85
|
array: (props: TypeArrayInputProps<TypeValueType>) => ReactNode;
|
|
75
|
-
chip: (props: TypeInputProps<string>) => ReactNode;
|
|
86
|
+
chip: (props: TypeInputProps<string[]>) => ReactNode;
|
|
87
|
+
relation: (props: TypeRelationInputProps<TypeLabeledValue[] | TypeLabeledValue>) => ReactNode;
|
|
76
88
|
};
|
|
77
89
|
declare const types: TypeInputTypeMap;
|
|
78
90
|
type TypeUseInputRepresenter = {
|
|
79
91
|
properties: TypeProperties;
|
|
80
92
|
value?: TypeValueType | TypeRepresenterValue;
|
|
93
|
+
error?: TypeInputRepresenterError;
|
|
81
94
|
onChange?: (value: any) => void;
|
|
95
|
+
containerClassName?: string;
|
|
96
|
+
errorClassName?: string;
|
|
82
97
|
};
|
|
83
|
-
declare const useInputRepresenter: ({ properties, value, onChange }: TypeUseInputRepresenter) => import("react/jsx-runtime").JSX.Element[];
|
|
98
|
+
declare const useInputRepresenter: ({ properties, value, error, onChange, containerClassName, errorClassName, }: TypeUseInputRepresenter) => (import("react/jsx-runtime").JSX.Element | null)[];
|
|
84
99
|
export default useInputRepresenter;
|
package/dist/index.css
CHANGED
|
@@ -2967,6 +2967,77 @@ button.font-increment {
|
|
|
2967
2967
|
.ChipInput-module_chipInputContainer__qkZtV input {
|
|
2968
2968
|
padding: 0;
|
|
2969
2969
|
}
|
|
2970
|
+
.RelationInput-module_icon__folVL {
|
|
2971
|
+
color: var(--oziko-color-font-primary) !important;
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
.RelationInput-module_text__h8Gq5 {
|
|
2975
|
+
color: var(--oziko-color-input-placeholder) !important;
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
.RelationInput-module_select__H7bRO {
|
|
2979
|
+
background: none !important;
|
|
2980
|
+
padding: var(--oziko-padding-md) 0 !important;
|
|
2981
|
+
height: 100% !important;
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
.RelationInput-module_baseInput__9cDeK {
|
|
2985
|
+
padding: 0 var(--oziko-padding-lg) !important;
|
|
2986
|
+
}
|
|
2987
|
+
.RelationSelect-module_container__nwkcp {
|
|
2988
|
+
background: var(--oziko-color-zebra);
|
|
2989
|
+
padding: var(--oziko-padding-md) var(--oziko-padding-lg);
|
|
2990
|
+
border-radius: var(--oziko-border-radius-md);
|
|
2991
|
+
cursor: pointer;
|
|
2992
|
+
}
|
|
2993
|
+
.RelationSelect-module_container__nwkcp.RelationSelect-module_disabled__37hiQ {
|
|
2994
|
+
cursor: default;
|
|
2995
|
+
opacity: var(--oziko-disabled-opacity);
|
|
2996
|
+
}
|
|
2997
|
+
.RelationSelect-module_container__nwkcp .RelationSelect-module_displayer__-ispL {
|
|
2998
|
+
display: -webkit-box;
|
|
2999
|
+
-webkit-box-orient: vertical;
|
|
3000
|
+
overflow: hidden;
|
|
3001
|
+
text-overflow: ellipsis;
|
|
3002
|
+
width: unset;
|
|
3003
|
+
-webkit-line-clamp: 1;
|
|
3004
|
+
width: 100%;
|
|
3005
|
+
max-height: 100px;
|
|
3006
|
+
overflow-y: auto;
|
|
3007
|
+
display: flex;
|
|
3008
|
+
flex-wrap: wrap;
|
|
3009
|
+
gap: var(--oziko-gap-sm);
|
|
3010
|
+
}
|
|
3011
|
+
|
|
3012
|
+
.RelationSelect-module_selectDropdown__HAwgv {
|
|
3013
|
+
position: fixed;
|
|
3014
|
+
border-radius: var(--oziko-border-radius-md);
|
|
3015
|
+
z-index: 1000;
|
|
3016
|
+
height: 100%;
|
|
3017
|
+
max-height: 200px;
|
|
3018
|
+
overflow-y: auto;
|
|
3019
|
+
box-shadow: var(--oziko-box-shadow);
|
|
3020
|
+
background: var(--oziko-color-menu-background);
|
|
3021
|
+
}
|
|
3022
|
+
|
|
3023
|
+
.RelationSelect-module_searchInputWrapper__2XT5T {
|
|
3024
|
+
display: flex;
|
|
3025
|
+
align-items: center;
|
|
3026
|
+
justify-content: center;
|
|
3027
|
+
gap: var(--oziko-gap-sm);
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
.RelationSelect-module_searchIcon__Wpvzz {
|
|
3031
|
+
color: var(--oziko-color-font-primary);
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
.RelationSelect-module_searchInput__Aihgm {
|
|
3035
|
+
border: 0;
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
.RelationSelect-module_deleteIcon__l6plf {
|
|
3039
|
+
color: var(--oziko-color-danger);
|
|
3040
|
+
}
|
|
2970
3041
|
.ColorMinimized-module_colorMinimized__CnRpu {
|
|
2971
3042
|
background-color: var(--oziko-color-input-background);
|
|
2972
3043
|
border-radius: var(--oziko-border-radius-md);
|
package/dist/index.export.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export { default as Drawer } from "./components/atoms/drawer/Drawer";
|
|
|
69
69
|
export { default as Backdrop } from "./components/atoms/backdrop/Backdrop";
|
|
70
70
|
export { default as Portal } from "./components/atoms/portal/Portal";
|
|
71
71
|
export { default as Tab } from "./components/atoms/tab/Tab";
|
|
72
|
+
export { default as RelationInput } from "./components/atoms/relation-input/RelationInput";
|
|
72
73
|
export { default as useInputRepresenter } from "./custom-hooks/useInputRepresenter";
|
|
73
74
|
export { default as useKeyDown } from "./custom-hooks/useKeyDown";
|
|
74
75
|
export { useOnClickOutside } from "./custom-hooks/useOnClickOutside";
|
|
@@ -147,6 +148,7 @@ export { type TypePopover } from "./components/atoms/popover/Popover";
|
|
|
147
148
|
export { type TypePortalProps } from "./components/atoms/portal/Portal";
|
|
148
149
|
export { type TypeSelectOption } from "./components/atoms/select-option/SelectOption";
|
|
149
150
|
export { type TypeTab } from "./components/atoms/tab/Tab";
|
|
151
|
+
export { type TypeRelationInput } from "./components/atoms/relation-input/RelationInput";
|
|
150
152
|
export { type TypeAccordionGroup } from "./components/molecules/accordion/Accordion";
|
|
151
153
|
export { type TypeNavigatorItem } from "./components/molecules/navigator-item/NavigatorItem";
|
|
152
154
|
export { type TypeSSOButton } from "./components/molecules/sso-button/SSOButton";
|