@decisiv/ui-components 2.0.1-alpha.173 → 2.0.1-alpha.175
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/lib/atoms/InputField/index.d.ts +1 -1
- package/lib/atoms/InputField/index.d.ts.map +1 -1
- package/lib/components/Button/StyledButton.d.ts +1 -0
- package/lib/components/Button/StyledButton.d.ts.map +1 -1
- package/lib/components/Button/StyledButton.js +16 -3
- package/lib/components/Button/index.d.ts.map +1 -1
- package/lib/components/Button/index.js +35 -6
- package/lib/components/Button/index.test.js +27 -8
- package/lib/components/Button/schema.d.ts.map +1 -1
- package/lib/components/Button/schema.js +2 -0
- package/lib/components/Button/types.d.ts +2 -0
- package/lib/components/Button/types.d.ts.map +1 -1
- package/lib/components/TagInput/index.d.ts +10 -0
- package/lib/components/TagInput/index.d.ts.map +1 -0
- package/lib/components/TagInput/index.js +217 -0
- package/lib/components/TagInput/index.test.js +1001 -0
- package/lib/components/TagInput/schema.d.ts +3 -0
- package/lib/components/TagInput/schema.d.ts.map +1 -0
- package/lib/components/TagInput/schema.js +30 -0
- package/lib/components/TagInput/styles.d.ts +10 -0
- package/lib/components/TagInput/styles.d.ts.map +1 -0
- package/lib/components/TagInput/styles.js +52 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +16 -0
- package/lib/providers/ConfigProvider/utils/translations.d.ts +7 -0
- package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/translations.js +7 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atoms/InputField/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EACZ,aAAa,EAEb,GAAG,EACH,sBAAsB,EAGvB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;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AAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA2KD,QAAA,MAAM,iBAAiB,EAAE,sBAAsB,CAC7C,GAAG,CAAC,GAAG,CAAC,EACR,mBAAmB,CACK,CAAC;AAQ3B,eAAe,iBAAiB,CAAC"}
|
|
@@ -6,6 +6,7 @@ export interface StyledButtonProps extends React.ButtonHTMLAttributes<HTMLButton
|
|
|
6
6
|
minWidth?: string;
|
|
7
7
|
size: Size;
|
|
8
8
|
variant?: Variant;
|
|
9
|
+
loading?: boolean;
|
|
9
10
|
}
|
|
10
11
|
declare const StyledButton: import("styled-components").StyledComponent<"button", any, StyledButtonProps, never>;
|
|
11
12
|
export default StyledButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledButton.d.ts","sourceRoot":"","sources":["../../../src/components/Button/StyledButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAe,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"StyledButton.d.ts","sourceRoot":"","sources":["../../../src/components/Button/StyledButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAe,MAAM,SAAS,CAAC;AA6LnE,MAAM,WAAW,iBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,YAAY,sFAkBjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -47,8 +47,8 @@ var color = _styledTheming.default.variants(_ConfigProvider.themeKeys.mode, 'var
|
|
|
47
47
|
dark: (0, _styledComponents.css)(["background-color:", ";color:", ";&:focus:not(:active){border-color:", ";", "}&:hover:not(:active){background-color:", ";color:", ";}"], _colors.interactionPrimaryLightFg, _colors.interactionPrimaryLight, _colors.focusRingColors.dark.inverted.primary.border, (0, _focusRingWithColor.default)(_colors.focusRingColors.dark.inverted.primary.shadow), _colors.snowWhiteAlpha, _colors.interactionPrimaryLightFg)
|
|
48
48
|
},
|
|
49
49
|
ghost: {
|
|
50
|
-
light: (0, _styledComponents.css)(["background-color:transparent;color:", ";padding:0;&:focus:not(:active){border-color:", ";", "}&:hover:not(:active){color:", ";}
|
|
51
|
-
dark: (0, _styledComponents.css)(["background-color:transparent;color:", ";padding:0;&:focus:not(:active){border-color:", ";", "}&:hover:not(:active){color:", ";}
|
|
50
|
+
light: (0, _styledComponents.css)(["background-color:transparent;color:", ";padding:0;&:focus:not(:active){border-color:", ";", "}&:hover:not(:active){color:", ";}"], _colors.interactionPrimaryLight, _colors.focusRingColors.light.ghost.border, (0, _focusRingWithColor.default)(_colors.focusRingColors.light.ghost.shadow), _colors.interactionSecondaryLight),
|
|
51
|
+
dark: (0, _styledComponents.css)(["background-color:transparent;color:", ";padding:0;&:focus:not(:active){border-color:", ";", "}&:hover:not(:active){color:", ";}"], _colors.interactionPrimaryDark, _colors.focusRingColors.dark.ghost.border, (0, _focusRingWithColor.default)(_colors.focusRingColors.dark.ghost.shadow), _colors.interactionSecondaryLight)
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
/** map the Button size values to the matching font size scalar values */
|
|
@@ -83,7 +83,20 @@ var buttonSizeModifier = function buttonSizeModifier(_ref) {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
var disabledStyles = function disabledStyles(_ref2) {
|
|
86
|
-
var variant = _ref2.variant
|
|
86
|
+
var variant = _ref2.variant,
|
|
87
|
+
loading = _ref2.loading;
|
|
88
|
+
|
|
89
|
+
if (loading) {
|
|
90
|
+
if (variant === 'ghost') {
|
|
91
|
+
return (0, _styledComponents.css)(["&:disabled:disabled{border-color:transparent;color:", ";cursor:not-allowed;}"], _colors.interactionSecondaryLight);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (variant === 'inverted') {
|
|
95
|
+
return (0, _styledComponents.css)(["&:disabled:disabled{background-color:", ";border-color:transparent;color:", ";cursor:not-allowed;}"], _colors.snowWhiteAlpha, _colors.interactionPrimaryLightFg);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return (0, _styledComponents.css)(["&:disabled:disabled{background-color:", ";border-color:transparent;color:", ";cursor:not-allowed;}"], _colors.interactionSecondaryLight, _colors.interactionPrimaryLightFg);
|
|
99
|
+
}
|
|
87
100
|
|
|
88
101
|
if (variant === 'ghost') {
|
|
89
102
|
return (0, _styledComponents.css)(["&:disabled:disabled{background-color:transparent;color:", ";cursor:not-allowed;}"], (0, _toColorString.default)(opacityColors.charcoal40));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAIA,OAAc,EAA4B,sBAAsB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAIA,OAAc,EAA4B,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAchF,OAAO,EACL,WAAW,EACX,SAAS,EAOV,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAoJrD,QAAA,MAAM,aAAa,EAAE,sBAAsB,CACzC,SAAS,EACT,WAAW,CACS,CAAC;AASvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,eAAe,aAAa,CAAC"}
|
|
@@ -28,6 +28,10 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
28
28
|
|
|
29
29
|
var _propTypes2 = require("@decisiv/prop-types");
|
|
30
30
|
|
|
31
|
+
var _useTranslations = _interopRequireDefault(require("../../utils/useTranslations"));
|
|
32
|
+
|
|
33
|
+
var _Loading = _interopRequireDefault(require("../Loading"));
|
|
34
|
+
|
|
31
35
|
var _StyledButton = _interopRequireDefault(require("./StyledButton"));
|
|
32
36
|
|
|
33
37
|
var _schema = require("./schema");
|
|
@@ -72,7 +76,7 @@ var iconMarginProp = {
|
|
|
72
76
|
left: 'margin-right',
|
|
73
77
|
right: 'margin-left'
|
|
74
78
|
};
|
|
75
|
-
var
|
|
79
|
+
var buttonSizeToSize = {
|
|
76
80
|
small: 'small',
|
|
77
81
|
medium: 'medium',
|
|
78
82
|
large: 'medium',
|
|
@@ -94,24 +98,44 @@ var Button = function Button(props, ref) {
|
|
|
94
98
|
iconPosition = props.iconPosition,
|
|
95
99
|
intent = props.intent,
|
|
96
100
|
kind = props.kind,
|
|
101
|
+
loading = props.loading,
|
|
102
|
+
propLoadingText = props.loadingText,
|
|
97
103
|
minWidth = props.minWidth,
|
|
98
104
|
onClick = props.onClick,
|
|
99
105
|
size = props.size,
|
|
100
106
|
text = props.text,
|
|
101
107
|
variant = props.variant,
|
|
102
|
-
rest = _objectWithoutProperties(props, ["disabled", "icon", "iconPosition", "intent", "kind", "minWidth", "onClick", "size", "text", "variant"]);
|
|
108
|
+
rest = _objectWithoutProperties(props, ["disabled", "icon", "iconPosition", "intent", "kind", "loading", "loadingText", "minWidth", "onClick", "size", "text", "variant"]);
|
|
103
109
|
|
|
110
|
+
var translate = (0, _useTranslations.default)();
|
|
111
|
+
var loadingVariant = (0, _react.useMemo)(function () {
|
|
112
|
+
if (variant === 'ghost') return 'normal';
|
|
113
|
+
return 'inverted';
|
|
114
|
+
}, [variant]);
|
|
104
115
|
var ButtonIcon = (0, _react.useMemo)(function () {
|
|
105
116
|
var Icon = icon;
|
|
106
117
|
return Icon && _react.default.createElement(IconContainer, {
|
|
107
118
|
position: iconPosition,
|
|
108
119
|
iconOnly: !text
|
|
109
120
|
}, _react.default.createElement(Icon, {
|
|
110
|
-
size:
|
|
121
|
+
size: buttonSizeToSize[size]
|
|
111
122
|
}));
|
|
112
123
|
}, [icon, iconPosition, size, text]);
|
|
124
|
+
var ButtonContent = (0, _react.useMemo)(function () {
|
|
125
|
+
if (loading) {
|
|
126
|
+
var loadingText = text ? translate(propLoadingText, 'button.loading') : undefined;
|
|
127
|
+
var showLoadingText = !!text || !!loadingText;
|
|
128
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_Loading.default, {
|
|
129
|
+
variant: loadingVariant,
|
|
130
|
+
size: "small",
|
|
131
|
+
marginRight: showLoadingText ? 0.5 : 0
|
|
132
|
+
}), _react.default.createElement(_react.default.Fragment, null, showLoadingText && loadingText));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return _react.default.createElement(_react.default.Fragment, null, !!icon && iconPosition !== 'right' && ButtonIcon, !!text && text, !!icon && iconPosition === 'right' && ButtonIcon);
|
|
136
|
+
}, [ButtonIcon, icon, iconPosition, loading, loadingVariant, propLoadingText, text, translate]);
|
|
113
137
|
return _react.default.createElement(_StyledButton.default, _extends({
|
|
114
|
-
disabled: disabled,
|
|
138
|
+
disabled: disabled || loading,
|
|
115
139
|
intent: intent,
|
|
116
140
|
kind: kind,
|
|
117
141
|
minWidth: minWidth,
|
|
@@ -119,8 +143,9 @@ var Button = function Button(props, ref) {
|
|
|
119
143
|
ref: ref,
|
|
120
144
|
size: size,
|
|
121
145
|
type: "button",
|
|
122
|
-
variant: variant
|
|
123
|
-
|
|
146
|
+
variant: variant,
|
|
147
|
+
loading: loading
|
|
148
|
+
}, rest), ButtonContent);
|
|
124
149
|
};
|
|
125
150
|
|
|
126
151
|
var propTypes = {
|
|
@@ -133,6 +158,8 @@ var propTypes = {
|
|
|
133
158
|
iconPosition: _propTypes.default.oneOf(['left', 'right']),
|
|
134
159
|
intent: _propTypes.default.oneOf(['success', 'danger']),
|
|
135
160
|
kind: _propTypes.default.oneOf(['primary', 'secondary']),
|
|
161
|
+
loading: _propTypes.default.bool,
|
|
162
|
+
loadingText: _propTypes.default.string,
|
|
136
163
|
minWidth: _propTypes.default.string,
|
|
137
164
|
size: _propTypes.default.oneOf(['small', 'medium', 'large', 'extraLarge']),
|
|
138
165
|
text: _propTypes.default.string,
|
|
@@ -144,6 +171,8 @@ var defaultProps = {
|
|
|
144
171
|
iconPosition: 'left',
|
|
145
172
|
intent: undefined,
|
|
146
173
|
kind: undefined,
|
|
174
|
+
loading: false,
|
|
175
|
+
loadingText: null,
|
|
147
176
|
minWidth: undefined,
|
|
148
177
|
size: 'medium',
|
|
149
178
|
text: undefined,
|
|
@@ -117,39 +117,58 @@ describe('Button', function () {
|
|
|
117
117
|
|
|
118
118
|
expect(container).toMatchSnapshot();
|
|
119
119
|
});
|
|
120
|
+
describe('loading', function () {
|
|
121
|
+
it('renders loading with default text', function () {
|
|
122
|
+
var _renderButton5 = renderButton({
|
|
123
|
+
loading: true
|
|
124
|
+
}),
|
|
125
|
+
container = _renderButton5.container;
|
|
126
|
+
|
|
127
|
+
expect(container).toMatchSnapshot();
|
|
128
|
+
});
|
|
129
|
+
it('renders loading with custom message', function () {
|
|
130
|
+
var _renderButton6 = renderButton({
|
|
131
|
+
loading: true,
|
|
132
|
+
loadingText: 'Action...'
|
|
133
|
+
}),
|
|
134
|
+
container = _renderButton6.container;
|
|
135
|
+
|
|
136
|
+
expect(container).toMatchSnapshot();
|
|
137
|
+
});
|
|
138
|
+
});
|
|
120
139
|
describe('kind=secondary', function () {
|
|
121
140
|
it('renders correctly with the light theme', function () {
|
|
122
|
-
var
|
|
141
|
+
var _renderButton7 = renderButton({
|
|
123
142
|
kind: 'secondary'
|
|
124
143
|
}),
|
|
125
|
-
container =
|
|
144
|
+
container = _renderButton7.container;
|
|
126
145
|
|
|
127
146
|
expect(container).toMatchSnapshot();
|
|
128
147
|
});
|
|
129
148
|
it('renders correctly with the dark theme', function () {
|
|
130
|
-
var
|
|
149
|
+
var _renderButton8 = renderButton({
|
|
131
150
|
kind: 'secondary'
|
|
132
151
|
}, 'dark'),
|
|
133
|
-
container =
|
|
152
|
+
container = _renderButton8.container;
|
|
134
153
|
|
|
135
154
|
expect(container).toMatchSnapshot();
|
|
136
155
|
});
|
|
137
156
|
describe('inverted', function () {
|
|
138
157
|
it('renders correctly with the light theme', function () {
|
|
139
|
-
var
|
|
158
|
+
var _renderButton9 = renderButton({
|
|
140
159
|
kind: 'secondary',
|
|
141
160
|
variant: 'inverted'
|
|
142
161
|
}),
|
|
143
|
-
container =
|
|
162
|
+
container = _renderButton9.container;
|
|
144
163
|
|
|
145
164
|
expect(container).toMatchSnapshot();
|
|
146
165
|
});
|
|
147
166
|
it('renders correctly with the dark theme', function () {
|
|
148
|
-
var
|
|
167
|
+
var _renderButton10 = renderButton({
|
|
149
168
|
kind: 'secondary',
|
|
150
169
|
variant: 'inverted'
|
|
151
170
|
}, 'dark'),
|
|
152
|
-
container =
|
|
171
|
+
container = _renderButton10.container;
|
|
153
172
|
|
|
154
173
|
expect(container).toMatchSnapshot();
|
|
155
174
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Button/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,eAAO,MAAM,yBAAyB;;;;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Button/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,eAAO,MAAM,yBAAyB;;;;CA6CpC,CAAC;AAEH,QAAA,MAAM,MAAM,KAAsC,CAAC;AAInD,eAAe,MAAM,CAAC"}
|
|
@@ -22,6 +22,8 @@ var makeButtonSchemaPropTypes = function makeButtonSchemaPropTypes(extensions) {
|
|
|
22
22
|
iconPosition: _reactDesc.PropTypes.oneOf(['left', 'right']).description('In which side of the text the icon should be rendered').defaultValue('left'),
|
|
23
23
|
intent: _reactDesc.PropTypes.oneOf(['success', 'danger']).description('Applies desired hover state of button'),
|
|
24
24
|
kind: _reactDesc.PropTypes.oneOf(['primary', 'secondary']).description('Applies inverted button styles'),
|
|
25
|
+
loading: _reactDesc.PropTypes.bool.description('Defines if the loading animation within the button should be displayed').defaultValue('false'),
|
|
26
|
+
loadingText: _reactDesc.PropTypes.string.description('Loading animation text'),
|
|
25
27
|
minWidth: _reactDesc.PropTypes.string.description('A pass-through CSS value for the min-width attribute'),
|
|
26
28
|
variant: _reactDesc.PropTypes.oneOf(['normal', 'inverted']).description('Applies secondary button styles')
|
|
27
29
|
}, extensions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Button/types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,oBAAY,SAAS,GAAG,iBAAiB,CAAC;AAC1C,oBAAY,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;AAC/D,oBAAY,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,GAAG,UAAU,GAAG,OAAO,CAAC;AACtD,oBAAY,IAAI,GAAG,SAAS,GAAG,WAAW,CAAC;AAC3C,oBAAY,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAE9D,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseInputFieldProps } from '../../atoms/InputField';
|
|
3
|
+
export interface TagInputProps extends Omit<BaseInputFieldProps, 'onChange' | 'children' | 'value' | 'hideLabel'> {
|
|
4
|
+
hiddenLabel?: boolean;
|
|
5
|
+
defaultTags?: string[];
|
|
6
|
+
tags?: string[];
|
|
7
|
+
onChange?: (value: string[]) => void;
|
|
8
|
+
}
|
|
9
|
+
export default function TagInput({ defaultTags, tags, onChange, disabled, readOnly, label, hiddenLabel, ...props }: TagInputProps): JSX.Element;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TagInput/index.tsx"],"names":[],"mappings":";AAeA,OAAmB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAMzE,MAAM,WAAW,aACf,SAAQ,IAAI,CACV,mBAAmB,EACnB,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,WAAW,CAChD;IACD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,WAAgB,EAChB,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,WAAW,EACX,GAAG,KAAK,EACT,EAAE,aAAa,eAqMf"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = TagInput;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
11
|
+
|
|
12
|
+
var _spacing = _interopRequireDefault(require("@decisiv/design-tokens/lib/spacing"));
|
|
13
|
+
|
|
14
|
+
var _Times = _interopRequireDefault(require("@decisiv/iconix/lib/components/Times"));
|
|
15
|
+
|
|
16
|
+
var _useTranslations = _interopRequireDefault(require("../../utils/useTranslations"));
|
|
17
|
+
|
|
18
|
+
var _InputField = _interopRequireDefault(require("../../atoms/InputField"));
|
|
19
|
+
|
|
20
|
+
var _Tag = _interopRequireDefault(require("../Tag"));
|
|
21
|
+
|
|
22
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
|
23
|
+
|
|
24
|
+
var _styles = require("./styles");
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
29
|
+
|
|
30
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
31
|
+
|
|
32
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
33
|
+
|
|
34
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
35
|
+
|
|
36
|
+
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
37
|
+
|
|
38
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
39
|
+
|
|
40
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
41
|
+
|
|
42
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
43
|
+
|
|
44
|
+
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
45
|
+
|
|
46
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
|
+
|
|
48
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
49
|
+
|
|
50
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
51
|
+
|
|
52
|
+
function TagInput(_ref) {
|
|
53
|
+
var _ref$defaultTags = _ref.defaultTags,
|
|
54
|
+
defaultTags = _ref$defaultTags === void 0 ? [] : _ref$defaultTags,
|
|
55
|
+
tags = _ref.tags,
|
|
56
|
+
onChange = _ref.onChange,
|
|
57
|
+
disabled = _ref.disabled,
|
|
58
|
+
readOnly = _ref.readOnly,
|
|
59
|
+
label = _ref.label,
|
|
60
|
+
hiddenLabel = _ref.hiddenLabel,
|
|
61
|
+
props = _objectWithoutProperties(_ref, ["defaultTags", "tags", "onChange", "disabled", "readOnly", "label", "hiddenLabel"]);
|
|
62
|
+
|
|
63
|
+
var clearButtonRef = (0, _react.useRef)(null);
|
|
64
|
+
var inputRef = (0, _react.useRef)(null);
|
|
65
|
+
|
|
66
|
+
var _useState = (0, _react.useState)(false),
|
|
67
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
68
|
+
inputVisible = _useState2[0],
|
|
69
|
+
setInputVisible = _useState2[1];
|
|
70
|
+
|
|
71
|
+
var _useState3 = (0, _react.useState)(defaultTags),
|
|
72
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
73
|
+
innerTags = _useState4[0],
|
|
74
|
+
setInnerTags = _useState4[1];
|
|
75
|
+
|
|
76
|
+
var translate = (0, _useTranslations.default)();
|
|
77
|
+
var isControlled = (0, _react.useMemo)(function () {
|
|
78
|
+
return !!tags;
|
|
79
|
+
}, [tags]);
|
|
80
|
+
var tagsToRender = (0, _react.useMemo)(function () {
|
|
81
|
+
return tags || innerTags;
|
|
82
|
+
}, [tags, innerTags]);
|
|
83
|
+
var isDisabled = disabled || readOnly;
|
|
84
|
+
var handleNotifyChange = (0, _react.useCallback)(function (value) {
|
|
85
|
+
if (!onChange) return;
|
|
86
|
+
onChange(value);
|
|
87
|
+
}, [onChange]);
|
|
88
|
+
var handleAddTag = (0, _react.useCallback)(function (rawString) {
|
|
89
|
+
var text = rawString.replace(/\s+/g, ' ').trim();
|
|
90
|
+
if (!text || tagsToRender.includes(text)) return;
|
|
91
|
+
|
|
92
|
+
if (isControlled) {
|
|
93
|
+
handleNotifyChange([].concat(_toConsumableArray(tags), [text]));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
setInnerTags(function (oldState) {
|
|
98
|
+
var newState = [].concat(_toConsumableArray(oldState), [text]);
|
|
99
|
+
handleNotifyChange(newState);
|
|
100
|
+
return newState;
|
|
101
|
+
});
|
|
102
|
+
}, [handleNotifyChange, tags, tagsToRender, isControlled]);
|
|
103
|
+
var handleRemoveOnBackspace = (0, _react.useCallback)(function () {
|
|
104
|
+
if (isControlled) {
|
|
105
|
+
handleNotifyChange(_toConsumableArray(tags.slice(0, -1)));
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
setInnerTags(function (oldState) {
|
|
110
|
+
var newState = _toConsumableArray(oldState.slice(0, -1));
|
|
111
|
+
|
|
112
|
+
handleNotifyChange(newState);
|
|
113
|
+
return newState;
|
|
114
|
+
});
|
|
115
|
+
}, [isControlled, handleNotifyChange, tags]);
|
|
116
|
+
var handleRemoveTag = (0, _react.useCallback)(function (text) {
|
|
117
|
+
if (isControlled) {
|
|
118
|
+
handleNotifyChange(tags.filter(function (tag) {
|
|
119
|
+
return tag !== text;
|
|
120
|
+
}));
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
setInnerTags(function (oldState) {
|
|
125
|
+
var newState = oldState.filter(function (tag) {
|
|
126
|
+
return tag !== text;
|
|
127
|
+
});
|
|
128
|
+
handleNotifyChange(newState);
|
|
129
|
+
return newState;
|
|
130
|
+
});
|
|
131
|
+
}, [isControlled, handleNotifyChange, tags]);
|
|
132
|
+
var handleOnKeyUp = (0, _react.useCallback)(function (e) {
|
|
133
|
+
e.stopPropagation();
|
|
134
|
+
var text = e.target.value;
|
|
135
|
+
|
|
136
|
+
if (!text && e.key === 'Backspace') {
|
|
137
|
+
handleRemoveOnBackspace();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (text && e.key === 'Enter') {
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
handleAddTag(text);
|
|
143
|
+
e.target.value = '';
|
|
144
|
+
}
|
|
145
|
+
}, [handleAddTag, handleRemoveOnBackspace]);
|
|
146
|
+
var handleFocus = (0, _react.useCallback)(function () {
|
|
147
|
+
setInputVisible(true);
|
|
148
|
+
}, []);
|
|
149
|
+
var handleBlur = (0, _react.useCallback)(function (e) {
|
|
150
|
+
// Suppress event if clicking in the X button
|
|
151
|
+
if (e.relatedTarget === clearButtonRef.current) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
var text = e.target.value;
|
|
156
|
+
handleAddTag(text);
|
|
157
|
+
e.target.value = '';
|
|
158
|
+
setInputVisible(false);
|
|
159
|
+
}, [handleAddTag]);
|
|
160
|
+
var handleOnClearButtonClick = (0, _react.useCallback)(function () {
|
|
161
|
+
if (inputRef.current) {
|
|
162
|
+
inputRef.current.value = '';
|
|
163
|
+
}
|
|
164
|
+
}, []);
|
|
165
|
+
return _react.default.createElement(_styles.Wrapper, null, _react.default.createElement(_InputField.default, _extends({
|
|
166
|
+
ref: inputRef,
|
|
167
|
+
onFocus: handleFocus,
|
|
168
|
+
onBlur: handleBlur,
|
|
169
|
+
disabled: disabled,
|
|
170
|
+
readOnly: readOnly,
|
|
171
|
+
label: label,
|
|
172
|
+
hideLabel: hiddenLabel
|
|
173
|
+
}, props), function (innerProps) {
|
|
174
|
+
return _react.default.createElement(_styles.Container, null, tagsToRender.map(function (tag) {
|
|
175
|
+
return _react.default.createElement(_Tag.default, {
|
|
176
|
+
key: tag,
|
|
177
|
+
size: "small",
|
|
178
|
+
text: tag,
|
|
179
|
+
palette: "pastel",
|
|
180
|
+
color: isDisabled ? 'licoriceMousse' : 'information',
|
|
181
|
+
action: isDisabled ? undefined : function () {
|
|
182
|
+
return handleRemoveTag(tag);
|
|
183
|
+
},
|
|
184
|
+
actionIntent: "danger",
|
|
185
|
+
actionAttributes: {
|
|
186
|
+
'aria-label': translate(undefined, 'tagInput.tagAriaLabel', {
|
|
187
|
+
tagName: tag
|
|
188
|
+
})
|
|
189
|
+
},
|
|
190
|
+
actionIcon: isDisabled ? undefined : _Times.default
|
|
191
|
+
});
|
|
192
|
+
}), _react.default.createElement(_styles.InputWrapper, null, _react.default.createElement(_styles.Input, _extends({}, innerProps, {
|
|
193
|
+
isVisible: inputVisible,
|
|
194
|
+
onKeyUp: handleOnKeyUp,
|
|
195
|
+
placeholder: " "
|
|
196
|
+
})), _react.default.createElement(_Button.default, {
|
|
197
|
+
ref: clearButtonRef,
|
|
198
|
+
style: {
|
|
199
|
+
display: 'none',
|
|
200
|
+
position: 'absolute',
|
|
201
|
+
right: 0,
|
|
202
|
+
top: 0,
|
|
203
|
+
bottom: 0,
|
|
204
|
+
paddingRight: (0, _rem.default)(_spacing.default.base * 0.8),
|
|
205
|
+
paddingLeft: (0, _rem.default)(_spacing.default.base * 0.8)
|
|
206
|
+
},
|
|
207
|
+
"aria-label": translate(undefined, 'tagInput.clearButton', {
|
|
208
|
+
inputLabel: label
|
|
209
|
+
}),
|
|
210
|
+
intent: "danger",
|
|
211
|
+
icon: _Times.default,
|
|
212
|
+
size: "small",
|
|
213
|
+
variant: "ghost",
|
|
214
|
+
onClick: handleOnClearButtonClick
|
|
215
|
+
})));
|
|
216
|
+
}));
|
|
217
|
+
}
|