@antscorp/antsomi-ui 1.3.5-beta.956 → 1.3.5-beta.958
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/es/components/atoms/Scrollbars/Scrollbars.d.ts +3 -4
- package/es/components/atoms/SelectAssociatedTag/SelectAssociatedTag.d.ts +5 -0
- package/es/components/atoms/SelectAssociatedTag/SelectAssociatedTag.js +15 -0
- package/es/components/atoms/SelectAssociatedTag/SelectTag.d.ts +4 -0
- package/es/components/atoms/SelectAssociatedTag/SelectTag.js +26 -0
- package/es/components/atoms/SelectAssociatedTag/constants.d.ts +11 -0
- package/es/components/atoms/SelectAssociatedTag/constants.js +43 -0
- package/es/components/atoms/SelectAssociatedTag/index.d.ts +2 -0
- package/es/components/atoms/SelectAssociatedTag/index.js +1 -0
- package/es/components/atoms/SelectAssociatedTag/styled.d.ts +7 -0
- package/es/components/atoms/SelectAssociatedTag/styled.js +46 -0
- package/es/components/atoms/SelectAssociatedTag/types.d.ts +54 -0
- package/es/components/atoms/SelectAssociatedTag/types.js +1 -0
- package/es/components/atoms/index.d.ts +2 -0
- package/es/components/atoms/index.js +1 -0
- package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.d.ts +0 -1
- package/es/components/organism/ModifyColumnModal/styled.d.ts +2 -2
- package/es/components/template/TemplateListing/Loadable.d.ts +0 -1
- package/package.json +8 -8
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ScrollbarProps as CustomScrollbarProps } from 'react-custom-scrollbars';
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export declare const Scrollbars:
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export type ScrollbarsProps = CustomScrollbarProps & {};
|
|
4
|
+
export declare const Scrollbars: FC<ScrollbarsProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Components
|
|
3
|
+
import { StyledSpace } from './styled';
|
|
4
|
+
import { Divider } from 'antd';
|
|
5
|
+
import { Select } from '../../molecules';
|
|
6
|
+
import SelectTag from './SelectTag';
|
|
7
|
+
// Constants
|
|
8
|
+
import { defaultProps } from './constants';
|
|
9
|
+
export const SelectAssociatedTag = (props) => {
|
|
10
|
+
// Props
|
|
11
|
+
const { tagConfigs, selected, options, onSelect } = props;
|
|
12
|
+
const { tag, value } = selected || {};
|
|
13
|
+
return (_jsxs(StyledSpace, { className: "select-associated-tag", children: [_jsx(SelectTag, { ...tagConfigs, selectedTag: tag }), _jsx(Divider, { type: "vertical", style: { margin: '0px 1px 0px 6px' } }), _jsx(Select, { style: { width: '100%', height: '100%' }, value: value, options: options, onChange: onSelect })] }));
|
|
14
|
+
};
|
|
15
|
+
SelectAssociatedTag.defaultProps = defaultProps;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Libraries
|
|
3
|
+
import { memo, useMemo, useState } from 'react';
|
|
4
|
+
import { keyBy } from 'lodash';
|
|
5
|
+
// Components
|
|
6
|
+
import { Flex, Typography } from 'antd';
|
|
7
|
+
import { Popover } from '../Popover';
|
|
8
|
+
import { SelectedTag } from './styled';
|
|
9
|
+
const SelectTag = (props) => {
|
|
10
|
+
// Props
|
|
11
|
+
const { selectedTag, title, options, onSelect } = props;
|
|
12
|
+
// State
|
|
13
|
+
const [open, setOpen] = useState(false);
|
|
14
|
+
// Memoized
|
|
15
|
+
const mapOptsMemo = useMemo(() => keyBy(options, 'value'), [options]);
|
|
16
|
+
const selectedItem = useMemo(() => mapOptsMemo?.[selectedTag] || {}, [selectedTag, mapOptsMemo]);
|
|
17
|
+
const handleOpenChange = () => {
|
|
18
|
+
setOpen(!open);
|
|
19
|
+
};
|
|
20
|
+
const handleClick = (item) => {
|
|
21
|
+
setOpen(false);
|
|
22
|
+
onSelect(item);
|
|
23
|
+
};
|
|
24
|
+
return (_jsx(Popover, { open: open, title: _jsx(Typography.Text, { style: { fontWeight: '400', maxWidth: 130 }, ellipsis: { tooltip: title }, children: title }), content: _jsx(Flex, { wrap: "wrap", gap: 6, style: { padding: '10px 0px' }, children: options.map(item => (_jsx(SelectedTag, { "$color": item.color, "$background": item.background, ellipsis: { tooltip: item.label }, onClick: () => handleClick(item), children: item.label }, item.value))) }), placement: "bottomLeft", trigger: "click", overlayInnerStyle: { padding: 10, maxWidth: 150 }, onOpenChange: handleOpenChange, children: _jsx(SelectedTag, { "$color": selectedItem?.color, "$background": selectedItem?.background, ellipsis: { tooltip: selectedItem?.label }, children: selectedItem?.label }) }));
|
|
25
|
+
};
|
|
26
|
+
export default memo(SelectTag);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SelectAssociatedTagProps, TagItem } from './types';
|
|
2
|
+
export declare const DEFAULT_TAGS: {
|
|
3
|
+
readonly RAW: "RAW";
|
|
4
|
+
readonly md5: "md5";
|
|
5
|
+
readonly sha_256: "sha_256";
|
|
6
|
+
readonly MD5: "MD5";
|
|
7
|
+
readonly SHA_265: "SHA_265";
|
|
8
|
+
};
|
|
9
|
+
export declare const DEFAULT_TAGS_OPTS: Record<string, TagItem>;
|
|
10
|
+
export declare const DEFAULT_TAGS_LIST: TagItem[];
|
|
11
|
+
export declare const defaultProps: SelectAssociatedTagProps;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Constants
|
|
2
|
+
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
3
|
+
// Locales
|
|
4
|
+
// import { translations, translate } from '@antscorp/antsomi-locales';
|
|
5
|
+
export const DEFAULT_TAGS = {
|
|
6
|
+
RAW: 'RAW',
|
|
7
|
+
md5: 'md5',
|
|
8
|
+
sha_256: 'sha_256',
|
|
9
|
+
MD5: 'MD5',
|
|
10
|
+
SHA_265: 'SHA_265',
|
|
11
|
+
};
|
|
12
|
+
export const DEFAULT_TAGS_OPTS = {
|
|
13
|
+
RAW: { label: 'RAW', value: DEFAULT_TAGS.RAW, color: globalToken?.bw0, background: '#4CB4C9' },
|
|
14
|
+
md5: { label: 'md5', value: DEFAULT_TAGS.md5, color: globalToken?.bw0, background: '#3B8FDE' },
|
|
15
|
+
sha_256: {
|
|
16
|
+
label: 'sha-256',
|
|
17
|
+
value: DEFAULT_TAGS.sha_256,
|
|
18
|
+
color: globalToken?.bw0,
|
|
19
|
+
background: '#12B800',
|
|
20
|
+
},
|
|
21
|
+
MD5: { label: 'MD5', value: DEFAULT_TAGS.MD5, color: globalToken?.bw0, background: '#3B8FDE' },
|
|
22
|
+
SHA_265: {
|
|
23
|
+
label: 'SHA265',
|
|
24
|
+
value: DEFAULT_TAGS.SHA_265,
|
|
25
|
+
color: globalToken?.bw0,
|
|
26
|
+
background: '#12B800',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export const DEFAULT_TAGS_LIST = Object.values(DEFAULT_TAGS_OPTS);
|
|
30
|
+
export const defaultProps = {
|
|
31
|
+
tagConfigs: {
|
|
32
|
+
options: DEFAULT_TAGS_LIST,
|
|
33
|
+
// title: translate(translations._, 'Hash Method'),
|
|
34
|
+
title: 'Hash Method',
|
|
35
|
+
onSelect: () => { },
|
|
36
|
+
},
|
|
37
|
+
selected: {
|
|
38
|
+
tag: DEFAULT_TAGS.RAW,
|
|
39
|
+
value: DEFAULT_TAGS.SHA_265,
|
|
40
|
+
},
|
|
41
|
+
options: DEFAULT_TAGS_LIST,
|
|
42
|
+
onSelect: () => { },
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SelectAssociatedTag } from './SelectAssociatedTag';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { TagItem } from './types';
|
|
3
|
+
export declare const StyledSpace: import("styled-components").StyledComponent<import("react").FC<import("antd/es/space/Compact").SpaceCompactProps>, any, {}, never>;
|
|
4
|
+
export declare const SelectedTag: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {
|
|
5
|
+
$background: TagItem['background'];
|
|
6
|
+
$color: TagItem['color'];
|
|
7
|
+
}, never>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
// Components
|
|
4
|
+
import { Space } from '../Space';
|
|
5
|
+
import { Typography } from 'antd';
|
|
6
|
+
// Constants
|
|
7
|
+
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
8
|
+
export const StyledSpace = styled(Space.Compact) `
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 30px;
|
|
11
|
+
padding-left: 5px;
|
|
12
|
+
align-items: center;
|
|
13
|
+
|
|
14
|
+
border-bottom: 1px solid ${globalToken?.blue1};
|
|
15
|
+
|
|
16
|
+
> div:last-child {
|
|
17
|
+
width: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.antsomi-divider.antsomi-divider-vertical {
|
|
21
|
+
height: 20px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.antsomi-select-selector {
|
|
25
|
+
border: none !important;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
export const SelectedTag = styled(Typography.Text) `
|
|
29
|
+
border-radius: 3px;
|
|
30
|
+
height: 16px;
|
|
31
|
+
line-height: 16px;
|
|
32
|
+
padding-left: 3px;
|
|
33
|
+
padding-right: 3px;
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
|
|
37
|
+
background: ${props => props.$background};
|
|
38
|
+
|
|
39
|
+
&.antsomi-typography {
|
|
40
|
+
color: ${props => props.$color};
|
|
41
|
+
|
|
42
|
+
&.antsomi-typography-ellipsis {
|
|
43
|
+
max-width: 50px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Dictionary } from 'lodash';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
export type TagItem = {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
background: CSSProperties['background'];
|
|
7
|
+
color: CSSProperties['color'];
|
|
8
|
+
};
|
|
9
|
+
export interface TagConfigProps {
|
|
10
|
+
selectedTag: TagItem['value'];
|
|
11
|
+
title?: string;
|
|
12
|
+
options: TagItem[];
|
|
13
|
+
onSelect: (newItem: TagItem) => void;
|
|
14
|
+
}
|
|
15
|
+
export type SelectOption = {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Properties for the SelectAssociatedTag component.
|
|
21
|
+
*/
|
|
22
|
+
export interface SelectAssociatedTagProps {
|
|
23
|
+
/**
|
|
24
|
+
* Configuration properties for tag options, excluding the selected tag.
|
|
25
|
+
* @type {Omit<TagConfigProps, 'selectedTag'>}
|
|
26
|
+
*/
|
|
27
|
+
tagConfigs: Omit<TagConfigProps, 'selectedTag'>;
|
|
28
|
+
/**
|
|
29
|
+
* The currently selected tag and its associated value.
|
|
30
|
+
* @type {{ tag: string; value: string; }}
|
|
31
|
+
*/
|
|
32
|
+
selected: {
|
|
33
|
+
/**
|
|
34
|
+
* The identifier for the selected tag.
|
|
35
|
+
* @type {string}
|
|
36
|
+
*/
|
|
37
|
+
tag: string;
|
|
38
|
+
/**
|
|
39
|
+
* The value associated with the selected tag.
|
|
40
|
+
* @type {Dictionary<SelectOption>}
|
|
41
|
+
*/
|
|
42
|
+
value: Dictionary<SelectOption>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* A list of selectable options.
|
|
46
|
+
* @type {SelectOption[]}
|
|
47
|
+
*/
|
|
48
|
+
options: SelectOption[];
|
|
49
|
+
/**
|
|
50
|
+
* Callback function called when an option is selected.
|
|
51
|
+
* @type {(value: Dictionary<SelectOption>, option: SelectOption | SelectOption[]) => void}
|
|
52
|
+
*/
|
|
53
|
+
onSelect: (value: Dictionary<SelectOption>, option: SelectOption | SelectOption[]) => void;
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -34,6 +34,7 @@ export { Image } from './Image';
|
|
|
34
34
|
export { IconField } from './IconField';
|
|
35
35
|
export { Suspense } from './Suspense';
|
|
36
36
|
export { App } from './App';
|
|
37
|
+
export { SelectAssociatedTag } from './SelectAssociatedTag';
|
|
37
38
|
export * from './Flex';
|
|
38
39
|
export * from './PreviewTabs';
|
|
39
40
|
export * from './MobileFrame';
|
|
@@ -54,3 +55,4 @@ export type { PaginationProps } from './Pagination';
|
|
|
54
55
|
export type { InputDynamicProps } from './InputDynamic';
|
|
55
56
|
export type { ImageProps } from './Image';
|
|
56
57
|
export type { AppProps } from './App';
|
|
58
|
+
export type { SelectAssociatedTagProps } from './SelectAssociatedTag';
|
|
@@ -34,6 +34,7 @@ export { Image } from './Image';
|
|
|
34
34
|
export { IconField } from './IconField';
|
|
35
35
|
export { Suspense } from './Suspense';
|
|
36
36
|
export { App } from './App';
|
|
37
|
+
export { SelectAssociatedTag } from './SelectAssociatedTag';
|
|
37
38
|
export * from './Flex';
|
|
38
39
|
export * from './PreviewTabs';
|
|
39
40
|
export * from './MobileFrame';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ModalV2Props } from '../../molecules/ModalV2';
|
|
3
3
|
export declare const StyledModal: import("styled-components").StyledComponent<(props: ModalV2Props) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
|
|
4
|
-
export declare const ParentMetricWrapper: import("styled-components").StyledComponent<import("react").
|
|
5
|
-
export declare const ChildrenMetricWrapper: import("styled-components").StyledComponent<import("react").
|
|
4
|
+
export declare const ParentMetricWrapper: import("styled-components").StyledComponent<import("react").FC<import("react-custom-scrollbars").ScrollbarProps>, any, {}, never>;
|
|
5
|
+
export declare const ChildrenMetricWrapper: import("styled-components").StyledComponent<import("react").FC<import("react-custom-scrollbars").ScrollbarProps>, any, {}, never>;
|
|
6
6
|
export declare const SelectedMetricsWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
7
7
|
export declare const SelectedMetricItem: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {
|
|
8
8
|
disabled?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antscorp/antsomi-ui",
|
|
3
|
-
"version": "1.3.5-beta.
|
|
3
|
+
"version": "1.3.5-beta.958",
|
|
4
4
|
"description": "An enterprise-class UI design language and React UI library.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"dist/*",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@antscorp/antsomi-locales": "1.0.28",
|
|
65
|
+
"@ant-design/cssinjs": "^1.6.2",
|
|
65
66
|
"@antscorp/icons": "0.27.54",
|
|
66
67
|
"@antscorp/image-editor": "1.0.2",
|
|
67
68
|
"@antscorp/processing-notification": "^1.0.3",
|
|
@@ -137,8 +138,7 @@
|
|
|
137
138
|
"use-context-selector": "^1.4.4",
|
|
138
139
|
"use-image": "^1.1.1",
|
|
139
140
|
"use-immer": "^0.4.1",
|
|
140
|
-
"zustand": "^4.5.2"
|
|
141
|
-
"@ant-design/cssinjs": "^1.6.2"
|
|
141
|
+
"zustand": "^4.5.2"
|
|
142
142
|
},
|
|
143
143
|
"devDependencies": {
|
|
144
144
|
"@antscorp/eslint-config-antsomi": "1.0.4",
|
|
@@ -170,6 +170,7 @@
|
|
|
170
170
|
"@testing-library/jest-dom": "^6.5.0",
|
|
171
171
|
"@testing-library/react": "^16.0.0",
|
|
172
172
|
"@testing-library/user-event": "^14.5.2",
|
|
173
|
+
"@types/currency-formatter": "1.5.1",
|
|
173
174
|
"@types/he": "^1.2.3",
|
|
174
175
|
"@types/jest": "^29.5.0",
|
|
175
176
|
"@types/lodash": "^4.17.13",
|
|
@@ -177,19 +178,18 @@
|
|
|
177
178
|
"@types/pako": "2.0.0",
|
|
178
179
|
"@types/react": "^18.0.33",
|
|
179
180
|
"@types/react-beautiful-dnd": "^13.1.8",
|
|
181
|
+
"@types/react-custom-scrollbars": "^4.0.13",
|
|
180
182
|
"@types/react-dom": "^18.0.11",
|
|
183
|
+
"@types/react-frame-component": "^4.1.6",
|
|
181
184
|
"@types/react-helmet": "^6.1.11",
|
|
182
185
|
"@types/react-resizable": "^3.0.7",
|
|
186
|
+
"@types/react-router-dom": "^5.3.3",
|
|
183
187
|
"@types/react-syntax-highlighter": "^15.5.11",
|
|
188
|
+
"@types/react-window": "^1.8.8",
|
|
184
189
|
"@types/styled-components": "^5.1.26",
|
|
185
190
|
"@types/yaireo__tagify": "^4.27.0",
|
|
186
191
|
"@typescript-eslint/eslint-plugin": "^5.55.0",
|
|
187
192
|
"@typescript-eslint/parser": "^5.55.0",
|
|
188
|
-
"@types/currency-formatter": "1.5.1",
|
|
189
|
-
"@types/react-custom-scrollbars": "^4.0.13",
|
|
190
|
-
"@types/react-frame-component": "^4.1.6",
|
|
191
|
-
"@types/react-router-dom": "^5.3.3",
|
|
192
|
-
"@types/react-window": "^1.8.8",
|
|
193
193
|
"@vitejs/plugin-react": "^4.3.1",
|
|
194
194
|
"@vitest/coverage-v8": "^2.0.5",
|
|
195
195
|
"@vitest/ui": "^2.0.5",
|