@alfalab/core-components-picker-button 7.4.3 → 7.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/Component.d.ts +28 -6
- package/dist/Component.js +13 -7
- package/dist/cssm/Component.d.ts +28 -6
- package/dist/cssm/Component.js +13 -6
- package/dist/cssm/field/Component.d.ts +10 -0
- package/dist/cssm/field/Component.js +25 -8
- package/dist/cssm/field/index.d.ts +1 -1
- package/dist/cssm/field/index.js +7 -3
- package/dist/cssm/index.js +9 -3
- package/dist/cssm/index.module.css +4 -0
- package/dist/cssm/option/Component.d.ts +11 -0
- package/dist/cssm/option/Component.js +25 -0
- package/dist/cssm/option/index.d.ts +1 -0
- package/dist/cssm/option/index.js +13 -0
- package/dist/cssm/option/index.module.css +24 -0
- package/dist/cssm/tslib.es6-ce870b46.d.ts +32 -0
- package/dist/cssm/tslib.es6-ce870b46.js +42 -0
- package/dist/{Component-52c236b9.d.ts → cssm/typings-a22d6eaf.d.ts} +180 -187
- package/dist/cssm/utils/index.d.ts +4 -0
- package/dist/cssm/utils/index.js +17 -0
- package/dist/esm/Component.d.ts +28 -6
- package/dist/esm/Component.js +14 -8
- package/dist/esm/field/Component.d.ts +10 -0
- package/dist/esm/field/Component.js +24 -6
- package/dist/esm/field/index.css +3 -3
- package/dist/esm/field/index.d.ts +1 -1
- package/dist/esm/field/index.js +7 -3
- package/dist/esm/index.css +9 -5
- package/dist/esm/index.js +8 -3
- package/dist/esm/option/Component.d.ts +11 -0
- package/dist/esm/option/Component.js +18 -0
- package/dist/esm/option/index.css +25 -0
- package/dist/esm/option/index.d.ts +1 -0
- package/dist/esm/option/index.js +4 -0
- package/dist/esm/tslib.es6-bb0d3a15.d.ts +32 -0
- package/dist/esm/tslib.es6-bb0d3a15.js +40 -0
- package/dist/esm/{Component-d3b8be4d.d.ts → typings-a22d6eaf.d.ts} +180 -187
- package/dist/esm/utils/index.d.ts +4 -0
- package/dist/esm/utils/index.js +13 -0
- package/dist/field/Component.d.ts +10 -0
- package/dist/field/Component.js +26 -7
- package/dist/field/index.css +3 -3
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.js +7 -3
- package/dist/index.css +9 -5
- package/dist/index.js +8 -3
- package/dist/modern/Component.d.ts +28 -6
- package/dist/modern/Component.js +12 -7
- package/dist/modern/field/Component.d.ts +5 -707
- package/dist/modern/field/Component.js +10 -7
- package/dist/modern/field/index.css +3 -3
- package/dist/modern/field/index.js +5 -2
- package/dist/modern/index.css +9 -5
- package/dist/modern/index.js +6 -2
- package/dist/modern/option/Component.d.ts +11 -0
- package/dist/modern/option/Component.js +16 -0
- package/dist/modern/option/index.css +25 -0
- package/dist/modern/option/index.d.ts +1 -0
- package/dist/modern/option/index.js +3 -0
- package/dist/{cssm/Component-aeb02c1b.d.ts → modern/typings-a22d6eaf.d.ts} +180 -187
- package/dist/modern/utils/index.d.ts +4 -0
- package/dist/modern/utils/index.js +13 -0
- package/dist/option/Component.d.ts +11 -0
- package/dist/option/Component.js +26 -0
- package/dist/option/index.css +25 -0
- package/dist/option/index.d.ts +1 -0
- package/dist/option/index.js +12 -0
- package/dist/tslib.es6-b5c82847.d.ts +32 -0
- package/dist/tslib.es6-b5c82847.js +42 -0
- package/dist/typings-a22d6eaf.d.ts +867 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +17 -0
- package/package.json +4 -4
- package/dist/Component-52c236b9.js +0 -67
- package/dist/cssm/Component-aeb02c1b.js +0 -66
- package/dist/esm/Component-d3b8be4d.js +0 -59
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Button } from '@alfalab/core-components-button/dist/modern';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
5
|
+
import '@alfalab/icons-glyph/ChevronDownCompactSIcon';
|
|
6
|
+
import '@alfalab/icons-glyph/MoreMIcon';
|
|
7
|
+
import '@alfalab/icons-glyph/MoreSIcon';
|
|
8
|
+
import { getIcon } from '../utils/index.js';
|
|
6
9
|
|
|
7
|
-
var styles = {"iconContainer":"picker-
|
|
10
|
+
var styles = {"iconContainer":"picker-button__iconContainer_18u4x","open":"picker-button__open_18u4x"};
|
|
8
11
|
require('./index.css')
|
|
9
12
|
|
|
10
|
-
const Field = ({ buttonSize = 'm', view, label, open, multiple, rightAddons, Arrow, innerProps, className, selected, selectedMultiple, valueRenderer, ...restProps }) => {
|
|
11
|
-
const Icon = buttonSize
|
|
13
|
+
const Field = ({ buttonSize = 'm', buttonVariant = 'default', view, label, open, multiple, rightAddons, Arrow, innerProps, className, selected, selectedMultiple, valueRenderer, ...restProps }) => {
|
|
14
|
+
const Icon = getIcon(buttonVariant, buttonSize);
|
|
12
15
|
const { ref, ...restInnerProps } = innerProps;
|
|
13
16
|
const buttonProps = {
|
|
14
17
|
...restProps,
|
|
15
18
|
...restInnerProps,
|
|
16
19
|
};
|
|
17
20
|
return (React.createElement("div", { ref: ref },
|
|
18
|
-
React.createElement(Button, Object.assign({}, buttonProps, { rightAddons: rightAddons ?? (React.createElement("span", { className: cn(styles.iconContainer, open && styles.open) },
|
|
19
|
-
React.createElement(Icon, { "data-test-id": 'picker-button-icon' }))), block: true, view: view, size: buttonSize, className: cn(styles.component, view === 'primary' && styles.primary, className) }), label)));
|
|
21
|
+
React.createElement(Button, Object.assign({}, buttonProps, { rightAddons: rightAddons ?? (React.createElement("span", { className: cn(styles.iconContainer, buttonVariant !== 'compact' && open && styles.open) },
|
|
22
|
+
React.createElement(Icon, { "data-test-id": 'picker-button-icon' }))), block: true, view: view, size: buttonSize, className: cn(styles.component, view === 'primary' && styles.primary, className) }), buttonVariant !== 'compact' && label)));
|
|
20
23
|
};
|
|
21
24
|
|
|
22
25
|
export { Field };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 4hptb */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
:root {
|
|
11
11
|
--arrow-transform: rotate(180deg);
|
|
12
12
|
}
|
|
13
|
-
.picker-
|
|
13
|
+
.picker-button__iconContainer_18u4x {
|
|
14
14
|
display: flex;
|
|
15
15
|
transition: transform 0.15s ease-in-out;
|
|
16
16
|
}
|
|
17
|
-
.picker-
|
|
17
|
+
.picker-button__open_18u4x {
|
|
18
18
|
transform: var(--arrow-transform);
|
|
19
19
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import 'classnames';
|
|
3
3
|
import '@alfalab/core-components-button/dist/modern';
|
|
4
|
-
import '@alfalab/icons-
|
|
5
|
-
import '@alfalab/icons-
|
|
4
|
+
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
5
|
+
import '@alfalab/icons-glyph/ChevronDownCompactSIcon';
|
|
6
|
+
import '@alfalab/icons-glyph/MoreMIcon';
|
|
7
|
+
import '@alfalab/icons-glyph/MoreSIcon';
|
|
8
|
+
import '../utils/index.js';
|
|
6
9
|
export { Field } from './Component.js';
|
package/dist/modern/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: z84rf */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -9,19 +9,23 @@
|
|
|
9
9
|
}
|
|
10
10
|
:root {
|
|
11
11
|
--gap-xs: 8px;
|
|
12
|
+
--gap-m: 16px;
|
|
12
13
|
}
|
|
13
14
|
:root {
|
|
14
15
|
--border-radius-s: 4px;
|
|
15
16
|
}
|
|
16
|
-
.picker-
|
|
17
|
+
.picker-button__container_1mcgq {
|
|
17
18
|
min-width: auto;
|
|
18
19
|
}
|
|
19
|
-
.picker-
|
|
20
|
+
.picker-button__optionsPopover_1mcgq {
|
|
20
21
|
padding: var(--gap-xs) 0
|
|
21
22
|
}
|
|
22
|
-
.picker-
|
|
23
|
+
.picker-button__optionsPopover_1mcgq.picker-button__sideGap_1mcgq {
|
|
23
24
|
padding: 0 var(--gap-xs);
|
|
24
25
|
}
|
|
25
|
-
.picker-
|
|
26
|
+
.picker-button__optionsListContainer_1mcgq {
|
|
26
27
|
border-radius: var(--border-radius-s);
|
|
27
28
|
}
|
|
29
|
+
.picker-button__option_1mcgq {
|
|
30
|
+
padding: 0 var(--gap-m);
|
|
31
|
+
}
|
package/dist/modern/index.js
CHANGED
|
@@ -2,7 +2,11 @@ import 'react';
|
|
|
2
2
|
import 'classnames';
|
|
3
3
|
import '@alfalab/core-components-select/dist/modern';
|
|
4
4
|
import '@alfalab/core-components-button/dist/modern';
|
|
5
|
-
import '@alfalab/icons-
|
|
6
|
-
import '@alfalab/icons-
|
|
5
|
+
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
6
|
+
import '@alfalab/icons-glyph/ChevronDownCompactSIcon';
|
|
7
|
+
import '@alfalab/icons-glyph/MoreMIcon';
|
|
8
|
+
import '@alfalab/icons-glyph/MoreSIcon';
|
|
9
|
+
import './utils/index.js';
|
|
7
10
|
import './field/Component.js';
|
|
11
|
+
import './option/Component.js';
|
|
8
12
|
export { PickerButton } from './Component.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FC, SVGProps } from 'react';
|
|
3
|
+
import { OptionShape } from "../typings-a22d6eaf";
|
|
4
|
+
import { OptionProps as BaseOptionProps } from "../typings-a22d6eaf";
|
|
5
|
+
type OptionProps = Omit<BaseOptionProps, 'option'> & {
|
|
6
|
+
option: OptionShape & {
|
|
7
|
+
icon?: FC<SVGProps<SVGSVGElement>>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
declare const Option: ({ option, children, ...restProps }: OptionProps) => JSX.Element;
|
|
11
|
+
export { Option };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Option as Option$1 } from '@alfalab/core-components-select/dist/modern';
|
|
3
|
+
|
|
4
|
+
var styles = {"container":"picker-button__container_ez0vh","icon":"picker-button__icon_ez0vh","content":"picker-button__content_ez0vh"};
|
|
5
|
+
require('./index.css')
|
|
6
|
+
|
|
7
|
+
const Option = ({ option, children, ...restProps }) => {
|
|
8
|
+
const content = children || option.content || option.key;
|
|
9
|
+
const Icon = option.icon;
|
|
10
|
+
return (React.createElement(Option$1, Object.assign({ option: option }, restProps),
|
|
11
|
+
React.createElement("div", { className: styles.container },
|
|
12
|
+
Icon && React.createElement(Icon, { className: styles.icon }),
|
|
13
|
+
React.createElement("div", { className: styles.content }, content))));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { Option };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* hash: wiwip */
|
|
2
|
+
:root {
|
|
3
|
+
|
|
4
|
+
/* Hard */
|
|
5
|
+
|
|
6
|
+
/* Up */
|
|
7
|
+
|
|
8
|
+
/* Hard up */
|
|
9
|
+
}
|
|
10
|
+
:root {
|
|
11
|
+
--gap-s: 12px;
|
|
12
|
+
}
|
|
13
|
+
.picker-button__container_ez0vh {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
}
|
|
17
|
+
.picker-button__icon_ez0vh {
|
|
18
|
+
display: flex;
|
|
19
|
+
margin-right: var(--gap-s);
|
|
20
|
+
}
|
|
21
|
+
.picker-button__content_ez0vh {
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
flex: 1;
|
|
24
|
+
text-overflow: ellipsis;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|