@telefonica/mistica 10.14.1 → 10.17.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/CHANGELOG.md +34 -0
- package/dist/button.js +16 -26
- package/dist/checkbox.js +11 -7
- package/dist/credit-card-expiration-field.js +2 -7
- package/dist/credit-card-number-field.js +2 -2
- package/dist/cvv-field.js +2 -2
- package/dist/date-field.js +2 -2
- package/dist/date-time-field.js +2 -2
- package/dist/date-time-picker.js +12 -6
- package/dist/decimal-field.js +2 -7
- package/dist/email-field.js +2 -7
- package/dist/feedback.js +5 -8
- package/dist/iban-field.js +2 -7
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -0
- package/dist/index.js.flow +2 -1
- package/dist/integer-field.js +2 -7
- package/dist/list.d.ts +1 -0
- package/dist/list.js +63 -26
- package/dist/list.js.flow +1 -0
- package/dist/menu.d.ts +1 -1
- package/dist/menu.js +34 -27
- package/dist/menu.js.flow +1 -1
- package/dist/month-field.js +2 -2
- package/dist/package-version.js +1 -1
- package/dist/password-field.js +2 -2
- package/dist/phone-number-field.js +2 -7
- package/dist/radio-button.js +13 -9
- package/dist/search-field.js +2 -2
- package/dist/select.js +7 -18
- package/dist/skins/blau.js +0 -24
- package/dist/skins/movistar.js +0 -23
- package/dist/skins/o2-classic.js +0 -24
- package/dist/skins/o2.js +0 -23
- package/dist/skins/types.d.ts +0 -12
- package/dist/skins/types.js.flow +0 -12
- package/dist/skins/vivo.js +0 -23
- package/dist/switch-component.js +12 -9
- package/dist/text-field-base.d.ts +3 -2
- package/dist/text-field-base.js +15 -33
- package/dist/text-field-base.js.flow +6 -2
- package/dist/text-field-components.d.ts +0 -1
- package/dist/text-field-components.js +8 -15
- package/dist/text-field-components.js.flow +0 -1
- package/dist/text-field.d.ts +2 -1
- package/dist/text-field.js +10 -16
- package/dist/text-field.js.flow +5 -1
- package/dist/text-link.d.ts +1 -0
- package/dist/text-link.js +16 -9
- package/dist/text-link.js.flow +1 -0
- package/dist/touchable.js +2 -3
- package/dist-es/button.js +16 -26
- package/dist-es/checkbox.js +11 -7
- package/dist-es/credit-card-expiration-field.js +2 -2
- package/dist-es/credit-card-number-field.js +2 -2
- package/dist-es/cvv-field.js +2 -2
- package/dist-es/date-field.js +2 -2
- package/dist-es/date-time-field.js +2 -2
- package/dist-es/date-time-picker.js +12 -6
- package/dist-es/decimal-field.js +2 -2
- package/dist-es/email-field.js +2 -2
- package/dist-es/feedback.js +5 -8
- package/dist-es/iban-field.js +2 -2
- package/dist-es/index.js +2 -1
- package/dist-es/integer-field.js +2 -2
- package/dist-es/list.js +63 -26
- package/dist-es/menu.js +35 -28
- package/dist-es/month-field.js +2 -2
- package/dist-es/package-version.js +1 -1
- package/dist-es/password-field.js +2 -2
- package/dist-es/phone-number-field.js +2 -2
- package/dist-es/radio-button.js +13 -9
- package/dist-es/search-field.js +2 -2
- package/dist-es/select.js +7 -18
- package/dist-es/skins/blau.js +0 -24
- package/dist-es/skins/movistar.js +0 -23
- package/dist-es/skins/o2-classic.js +0 -24
- package/dist-es/skins/o2.js +0 -23
- package/dist-es/skins/vivo.js +0 -23
- package/dist-es/switch-component.js +12 -9
- package/dist-es/text-field-base.js +15 -32
- package/dist-es/text-field-components.js +8 -15
- package/dist-es/text-field.js +9 -12
- package/dist-es/text-link.js +14 -8
- package/dist-es/touchable.js +2 -3
- package/package.json +12 -3
package/dist-es/cvv-field.js
CHANGED
|
@@ -7,7 +7,7 @@ import Tooltip from './tooltip';
|
|
|
7
7
|
import IconButton from './icon-button';
|
|
8
8
|
import IcnInfo from './icons/icon-info-cvv';
|
|
9
9
|
import { useFieldProps, useForm } from './form-context';
|
|
10
|
-
import
|
|
10
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
11
11
|
import { IntegerInput } from './integer-field';
|
|
12
12
|
function _defineProperty(obj, key, value) {
|
|
13
13
|
if (key in obj) {
|
|
@@ -152,7 +152,7 @@ var CvvField = function(_param) {
|
|
|
152
152
|
onChange: onChange,
|
|
153
153
|
onChangeValue: onChangeValue
|
|
154
154
|
});
|
|
155
|
-
return(/*#__PURE__*/ _jsx(
|
|
155
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
156
156
|
}, rest, fieldProps, {
|
|
157
157
|
maxLength: maxLength,
|
|
158
158
|
onChange: function(event) {
|
package/dist-es/date-field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFieldProps } from './form-context';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
import { isInputTypeSupported } from './utils/dom';
|
|
6
6
|
import { isServerSide } from './utils/environment';
|
|
7
7
|
import IconCalendarRegular from './generated/mistica-icons/icon-calendar-regular';
|
|
@@ -118,7 +118,7 @@ var DateField = function(_param) {
|
|
|
118
118
|
onChange: onChange,
|
|
119
119
|
onChangeValue: onChangeValue
|
|
120
120
|
});
|
|
121
|
-
var nativePicker = /*#__PURE__*/ _jsx(
|
|
121
|
+
var nativePicker = /*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
122
122
|
}, rest, fieldProps, {
|
|
123
123
|
min: min ? getLocalDateString(min) : undefined,
|
|
124
124
|
max: max ? getLocalDateString(max) : undefined,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFieldProps } from './form-context';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
import { isInputTypeSupported } from './utils/dom';
|
|
6
6
|
import { isServerSide } from './utils/environment';
|
|
7
7
|
import { getLocalDateTimeString } from './utils/time';
|
|
@@ -119,7 +119,7 @@ var FormDateField = function(_param) {
|
|
|
119
119
|
onChange: onChange,
|
|
120
120
|
onChangeValue: onChangeValue
|
|
121
121
|
});
|
|
122
|
-
var nativePicker = /*#__PURE__*/ _jsx(
|
|
122
|
+
var nativePicker = /*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
123
123
|
}, rest, fieldProps, {
|
|
124
124
|
min: min ? getLocalDateTimeString(min) : undefined,
|
|
125
125
|
max: max ? getLocalDateTimeString(max) : undefined,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
4
4
|
import IconCalendarRegular from './generated/mistica-icons/icon-calendar-regular';
|
|
5
5
|
import Datetime from 'react-datetime';
|
|
6
6
|
import Overlay from './overlay';
|
|
@@ -182,7 +182,7 @@ var useStyles = createUseStyles(function() {
|
|
|
182
182
|
'& .rdtPicker td.rdtDisabled, & .rdtPicker td.rdtDisabled:hover': {
|
|
183
183
|
background: 'none',
|
|
184
184
|
color: '#999999',
|
|
185
|
-
cursor: '
|
|
185
|
+
cursor: 'default'
|
|
186
186
|
},
|
|
187
187
|
'& .rdtPicker td span.rdtOld': {
|
|
188
188
|
color: '#999999'
|
|
@@ -190,7 +190,7 @@ var useStyles = createUseStyles(function() {
|
|
|
190
190
|
'& .rdtPicker td span.rdtDisabled, & .rdtPicker td span.rdtDisabled:hover': {
|
|
191
191
|
background: 'none',
|
|
192
192
|
color: '#999999',
|
|
193
|
-
cursor: '
|
|
193
|
+
cursor: 'default'
|
|
194
194
|
},
|
|
195
195
|
'& .rdtPicker th': {
|
|
196
196
|
borderBottom: '1px solid #f9f9f9',
|
|
@@ -215,7 +215,7 @@ var useStyles = createUseStyles(function() {
|
|
|
215
215
|
'& .rdtPicker th.rdtDisabled, & .rdtPicker th.rdtDisabled:hover': {
|
|
216
216
|
background: 'none',
|
|
217
217
|
color: '#999999',
|
|
218
|
-
cursor: '
|
|
218
|
+
cursor: 'default'
|
|
219
219
|
},
|
|
220
220
|
'& .rdtPicker thead tr:first-of-type th': {
|
|
221
221
|
cursor: 'pointer'
|
|
@@ -291,11 +291,16 @@ var useStyles = createUseStyles(function() {
|
|
|
291
291
|
});
|
|
292
292
|
var DateTimePicker = function(_param) {
|
|
293
293
|
var withTime = _param.withTime, mode = _param.mode, isValidDate = _param.isValidDate, optional = _param.optional, rest = _objectWithoutProperties(_param, ["withTime", "mode", "isValidDate", "optional"]);
|
|
294
|
-
var ref = _slicedToArray(React.useState(false), 2), showPicker = ref[0],
|
|
294
|
+
var ref = _slicedToArray(React.useState(false), 2), showPicker = ref[0], realSetShowPicker = ref[1];
|
|
295
295
|
var classes = useStyles();
|
|
296
296
|
var ref1 = useTheme(), texts = ref1.texts;
|
|
297
297
|
var fieldRef = React.useRef(null);
|
|
298
298
|
var ref2 = useElementDimensions(), pickerContainerHeight = ref2.height, pickerContainerRef = ref2.ref;
|
|
299
|
+
var setShowPicker = function(show) {
|
|
300
|
+
if (!rest.disabled) {
|
|
301
|
+
realSetShowPicker(show);
|
|
302
|
+
}
|
|
303
|
+
};
|
|
299
304
|
var getPickerContainerStyles = function() {
|
|
300
305
|
var ref;
|
|
301
306
|
var ref3 = ((ref = fieldRef.current) === null || ref === void 0 ? void 0 : ref.getBoundingClientRect()) || {
|
|
@@ -350,6 +355,7 @@ var DateTimePicker = function(_param) {
|
|
|
350
355
|
}));
|
|
351
356
|
}
|
|
352
357
|
return(/*#__PURE__*/ _jsx(IconButton, {
|
|
358
|
+
disabled: rest.disabled,
|
|
353
359
|
"aria-label": "",
|
|
354
360
|
size: 32,
|
|
355
361
|
onPress: function() {
|
|
@@ -361,7 +367,7 @@ var DateTimePicker = function(_param) {
|
|
|
361
367
|
};
|
|
362
368
|
return(/*#__PURE__*/ _jsxs(_Fragment, {
|
|
363
369
|
children: [
|
|
364
|
-
/*#__PURE__*/ _jsx(
|
|
370
|
+
/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
365
371
|
}, rest, {
|
|
366
372
|
style: {
|
|
367
373
|
cursor: 'default'
|
package/dist-es/decimal-field.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFieldProps } from './form-context';
|
|
4
4
|
import { useTheme } from './hooks';
|
|
5
|
-
import
|
|
5
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
6
6
|
import { createChangeEvent } from './utils/dom';
|
|
7
7
|
import { useRifm } from 'rifm';
|
|
8
8
|
import { combineRefs } from './utils/common';
|
|
@@ -191,7 +191,7 @@ var DecimalField = function(_param) {
|
|
|
191
191
|
onChange: onChange,
|
|
192
192
|
onChangeValue: onChangeValue
|
|
193
193
|
});
|
|
194
|
-
return(/*#__PURE__*/ _jsx(
|
|
194
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
195
195
|
}, rest, fieldProps, {
|
|
196
196
|
inputComponent: DecimalInput,
|
|
197
197
|
inputProps: {
|
package/dist-es/email-field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useFieldProps } from './form-context';
|
|
3
3
|
import { useTheme } from './hooks';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
function _defineProperty(obj, key, value) {
|
|
6
6
|
if (key in obj) {
|
|
7
7
|
Object.defineProperty(obj, key, {
|
|
@@ -92,7 +92,7 @@ var EmailField = function(_param) {
|
|
|
92
92
|
onChange: onChange,
|
|
93
93
|
onChangeValue: onChangeValue
|
|
94
94
|
});
|
|
95
|
-
return(/*#__PURE__*/ _jsx(
|
|
95
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
96
96
|
}, rest, fieldProps, {
|
|
97
97
|
type: "email",
|
|
98
98
|
inputMode: "email",
|
package/dist-es/feedback.js
CHANGED
|
@@ -420,13 +420,12 @@ export var SuccessFeedbackScreen = function(props) {
|
|
|
420
420
|
};
|
|
421
421
|
var ErrorFeedbackScreen = function(_param) {
|
|
422
422
|
var children = _param.children, errorReference = _param.errorReference, otherProps = _objectWithoutProperties(_param, ["children", "errorReference"]);
|
|
423
|
-
var ref = useTheme(),
|
|
424
|
-
var hasIcon = skinName !== VIVO_SKIN;
|
|
423
|
+
var ref = useTheme(), colors = ref.colors;
|
|
425
424
|
return(/*#__PURE__*/ _jsxs(FeedbackScreen, _objectSpread({
|
|
426
425
|
}, otherProps, {
|
|
427
426
|
hapticFeedback: "error",
|
|
428
|
-
icon:
|
|
429
|
-
})
|
|
427
|
+
icon: /*#__PURE__*/ _jsx(IcnError, {
|
|
428
|
+
}),
|
|
430
429
|
animateText: true,
|
|
431
430
|
children: [
|
|
432
431
|
children,
|
|
@@ -440,12 +439,10 @@ var ErrorFeedbackScreen = function(_param) {
|
|
|
440
439
|
};
|
|
441
440
|
export { ErrorFeedbackScreen };
|
|
442
441
|
export var InfoFeedbackScreen = function(props) {
|
|
443
|
-
var ref = useTheme(), skinName = ref.skinName;
|
|
444
|
-
var hasIcon = skinName !== VIVO_SKIN;
|
|
445
442
|
return(/*#__PURE__*/ _jsx(FeedbackScreen, _objectSpread({
|
|
446
443
|
}, props, {
|
|
447
|
-
icon:
|
|
448
|
-
})
|
|
444
|
+
icon: /*#__PURE__*/ _jsx(IcnInfo, {
|
|
445
|
+
})
|
|
449
446
|
})));
|
|
450
447
|
};
|
|
451
448
|
export var SuccessFeedback = function(param) {
|
package/dist-es/iban-field.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useRifm } from 'rifm';
|
|
4
4
|
import { useFieldProps } from './form-context';
|
|
5
|
-
import
|
|
5
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
6
6
|
import { createChangeEvent } from './utils/dom';
|
|
7
7
|
import { combineRefs } from './utils/common';
|
|
8
8
|
import { useTheme } from './hooks';
|
|
@@ -246,7 +246,7 @@ var IbanField = function(_param) {
|
|
|
246
246
|
onChange: onChange,
|
|
247
247
|
onChangeValue: onChangeValue
|
|
248
248
|
});
|
|
249
|
-
return(/*#__PURE__*/ _jsx(
|
|
249
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
250
250
|
}, rest, fieldProps, {
|
|
251
251
|
inputComponent: IbanInput
|
|
252
252
|
})));
|
package/dist-es/index.js
CHANGED
|
@@ -60,6 +60,7 @@ export { default as Image } from './image';
|
|
|
60
60
|
export { default as Form } from './form';
|
|
61
61
|
export { default as Select } from './select';
|
|
62
62
|
export { default as TextField } from './text-field';
|
|
63
|
+
export { TextFieldBase } from './text-field-base';
|
|
63
64
|
export { default as SearchField } from './search-field';
|
|
64
65
|
export { default as EmailField } from './email-field';
|
|
65
66
|
export { default as PhoneNumberField } from './phone-number-field';
|
|
@@ -75,7 +76,7 @@ export { default as DecimalField } from './decimal-field';
|
|
|
75
76
|
export { default as PasswordField } from './password-field';
|
|
76
77
|
export { default as DoubleField } from './double-field';
|
|
77
78
|
export { default as IbanField } from './iban-field';
|
|
78
|
-
export { useForm } from './form-context';
|
|
79
|
+
export { useForm, useFieldProps } from './form-context';
|
|
79
80
|
// Icons
|
|
80
81
|
// @deprecated use IconCloseRegular instead
|
|
81
82
|
export { default as IconClose } from './icons/icon-close';
|
package/dist-es/integer-field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useFieldProps } from './form-context';
|
|
3
3
|
import { useTheme } from './hooks';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
function _defineProperty(obj, key, value) {
|
|
6
6
|
if (key in obj) {
|
|
7
7
|
Object.defineProperty(obj, key, {
|
|
@@ -110,7 +110,7 @@ var IntegerField = function(_param) {
|
|
|
110
110
|
onChange: onChange,
|
|
111
111
|
onChangeValue: onChangeValue
|
|
112
112
|
});
|
|
113
|
-
return(/*#__PURE__*/ _jsx(
|
|
113
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
114
114
|
}, rest, fieldProps, {
|
|
115
115
|
inputComponent: IntegerInput
|
|
116
116
|
})));
|
package/dist-es/list.js
CHANGED
|
@@ -16,7 +16,7 @@ import { useAriaId, useTheme } from './hooks';
|
|
|
16
16
|
import { useIsInverseVariant } from './theme-variant-context';
|
|
17
17
|
import IconChevron from './icons/icon-chevron';
|
|
18
18
|
import Switch from './switch-component';
|
|
19
|
-
import RadioButton from './radio-button';
|
|
19
|
+
import RadioButton, { useRadioContext } from './radio-button';
|
|
20
20
|
import Checkbox from './checkbox';
|
|
21
21
|
import { Boxed } from './boxed';
|
|
22
22
|
import Divider from './divider';
|
|
@@ -84,18 +84,24 @@ function _slicedToArray(arr, i) {
|
|
|
84
84
|
var useStyles = createUseStyles(function(param) {
|
|
85
85
|
var colors = param.colors, mq = param.mq;
|
|
86
86
|
return {
|
|
87
|
+
disabled: {
|
|
88
|
+
opacity: 0.5
|
|
89
|
+
},
|
|
87
90
|
hover: _defineProperty({
|
|
88
91
|
}, mq.supportsHover, {
|
|
89
92
|
'&:hover': {
|
|
90
93
|
background: function(param) {
|
|
91
|
-
var isInverse = param.isInverse;
|
|
92
|
-
return isInverse ? 'initial' : colors.backgroundAlternative;
|
|
94
|
+
var isInverse = param.isInverse, disabled = param.disabled;
|
|
95
|
+
return isInverse || disabled ? 'initial' : colors.backgroundAlternative;
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
}),
|
|
96
99
|
rowContent: {
|
|
97
100
|
width: '100%',
|
|
98
|
-
cursor:
|
|
101
|
+
cursor: function(param) {
|
|
102
|
+
var disabled = param.disabled;
|
|
103
|
+
return disabled ? 'default' : 'pointer';
|
|
104
|
+
}
|
|
99
105
|
},
|
|
100
106
|
hoverDisabled: {
|
|
101
107
|
cursor: 'initial',
|
|
@@ -166,8 +172,9 @@ var useStyles = createUseStyles(function(param) {
|
|
|
166
172
|
}
|
|
167
173
|
};
|
|
168
174
|
});
|
|
175
|
+
var _obj;
|
|
169
176
|
var Content = function(param) {
|
|
170
|
-
var headline = param.headline, title = param.title, titleLinesMax = param.titleLinesMax, subtitle = param.subtitle, subtitleLinesMax = param.subtitleLinesMax, description = param.description, descriptionLinesMax = param.descriptionLinesMax, asset = param.asset, _type = param.type, type = _type === void 0 ? 'basic' : _type, badge = param.badge, right = param.right, extra = param.extra, labelId = param.labelId;
|
|
177
|
+
var headline = param.headline, title = param.title, titleLinesMax = param.titleLinesMax, subtitle = param.subtitle, subtitleLinesMax = param.subtitleLinesMax, description = param.description, descriptionLinesMax = param.descriptionLinesMax, asset = param.asset, _type = param.type, type = _type === void 0 ? 'basic' : _type, badge = param.badge, right = param.right, extra = param.extra, labelId = param.labelId, disabled = param.disabled;
|
|
171
178
|
var isInverse = useIsInverseVariant();
|
|
172
179
|
var classes = useStyles({
|
|
173
180
|
isInverse: isInverse
|
|
@@ -188,7 +195,8 @@ var Content = function(param) {
|
|
|
188
195
|
return(/*#__PURE__*/ _jsx(Box, {
|
|
189
196
|
paddingLeft: 16,
|
|
190
197
|
children: /*#__PURE__*/ _jsx("div", {
|
|
191
|
-
className: classNames(classes.center, classes.badge
|
|
198
|
+
className: classNames(classes.center, classes.badge, _defineProperty({
|
|
199
|
+
}, classes.disabled, disabled)),
|
|
192
200
|
children: badge === true ? /*#__PURE__*/ _jsx(Badge, {
|
|
193
201
|
}) : /*#__PURE__*/ _jsx(Badge, {
|
|
194
202
|
value: badge
|
|
@@ -196,21 +204,49 @@ var Content = function(param) {
|
|
|
196
204
|
})
|
|
197
205
|
}));
|
|
198
206
|
};
|
|
207
|
+
var renderRight = function() {
|
|
208
|
+
switch(type){
|
|
209
|
+
case 'chevron':
|
|
210
|
+
return(/*#__PURE__*/ _jsx(Box, {
|
|
211
|
+
paddingLeft: 16,
|
|
212
|
+
className: classNames(classes.center, _defineProperty({
|
|
213
|
+
}, classes.disabled, disabled)),
|
|
214
|
+
children: /*#__PURE__*/ _jsx(IconChevron, {
|
|
215
|
+
color: isInverse ? colors.inverse : colors.neutralMedium,
|
|
216
|
+
direction: "right"
|
|
217
|
+
})
|
|
218
|
+
}));
|
|
219
|
+
case 'control':
|
|
220
|
+
return(/*#__PURE__*/ _jsx("div", {
|
|
221
|
+
className: classes.right,
|
|
222
|
+
children: right
|
|
223
|
+
}));
|
|
224
|
+
case 'custom':
|
|
225
|
+
return(/*#__PURE__*/ _jsx("div", {
|
|
226
|
+
className: classNames(classes.right, _defineProperty({
|
|
227
|
+
}, classes.disabled, disabled)),
|
|
228
|
+
children: right
|
|
229
|
+
}));
|
|
230
|
+
default:
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
199
234
|
return(/*#__PURE__*/ _jsxs(Box, {
|
|
200
235
|
paddingY: 16,
|
|
201
236
|
className: classes.content,
|
|
202
237
|
children: [
|
|
203
238
|
asset && /*#__PURE__*/ _jsx(Box, {
|
|
204
239
|
paddingRight: 16,
|
|
205
|
-
className: classNames(
|
|
206
|
-
}, classes.center, shouldCenter)),
|
|
240
|
+
className: classNames((_obj = {
|
|
241
|
+
}, _defineProperty(_obj, classes.center, shouldCenter), _defineProperty(_obj, classes.disabled, disabled), _obj)),
|
|
207
242
|
children: /*#__PURE__*/ _jsx("div", {
|
|
208
243
|
className: classes.asset,
|
|
209
244
|
children: asset
|
|
210
245
|
})
|
|
211
246
|
}),
|
|
212
247
|
/*#__PURE__*/ _jsx("div", {
|
|
213
|
-
className: classes.rowBody,
|
|
248
|
+
className: classNames(classes.rowBody, _defineProperty({
|
|
249
|
+
}, classes.disabled, disabled)),
|
|
214
250
|
style: {
|
|
215
251
|
justifyContent: shouldCenter ? 'center' : 'flex-start'
|
|
216
252
|
},
|
|
@@ -255,17 +291,7 @@ var Content = function(param) {
|
|
|
255
291
|
})
|
|
256
292
|
}),
|
|
257
293
|
renderBadge(),
|
|
258
|
-
|
|
259
|
-
paddingLeft: 16,
|
|
260
|
-
className: classes.center,
|
|
261
|
-
children: /*#__PURE__*/ _jsx(IconChevron, {
|
|
262
|
-
color: isInverse ? colors.inverse : colors.neutralMedium,
|
|
263
|
-
direction: "right"
|
|
264
|
-
})
|
|
265
|
-
}) : right ? /*#__PURE__*/ _jsx("div", {
|
|
266
|
-
className: classes.right,
|
|
267
|
-
children: right
|
|
268
|
-
}) : null
|
|
294
|
+
renderRight()
|
|
269
295
|
]
|
|
270
296
|
}));
|
|
271
297
|
};
|
|
@@ -295,10 +321,13 @@ var useControlState = function(param) {
|
|
|
295
321
|
var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
296
322
|
var titleId = useAriaId();
|
|
297
323
|
var isInverse = useIsInverseVariant();
|
|
324
|
+
var asset = props.asset, headline = props.headline, title = props.title, titleLinesMax = props.titleLinesMax, subtitle = props.subtitle, subtitleLinesMax = props.subtitleLinesMax, description = props.description, descriptionLinesMax = props.descriptionLinesMax, badge = props.badge, role = props.role, extra = props.extra, dataAttributes = props.dataAttributes;
|
|
325
|
+
var radioContext = useRadioContext();
|
|
326
|
+
var disabled = props.disabled || props.radioValue !== undefined && radioContext.disabled;
|
|
298
327
|
var classes = useStyles({
|
|
299
|
-
isInverse: isInverse
|
|
328
|
+
isInverse: isInverse,
|
|
329
|
+
disabled: disabled
|
|
300
330
|
});
|
|
301
|
-
var asset = props.asset, headline = props.headline, title = props.title, titleLinesMax = props.titleLinesMax, subtitle = props.subtitle, subtitleLinesMax = props.subtitleLinesMax, description = props.description, descriptionLinesMax = props.descriptionLinesMax, badge = props.badge, role = props.role, extra = props.extra, dataAttributes = props.dataAttributes;
|
|
302
331
|
var ref1 = _slicedToArray(useControlState(props.switch || props.checkbox || {
|
|
303
332
|
}), 2), isChecked = ref1[0], toggle = ref1[1];
|
|
304
333
|
var renderContent = function(param) {
|
|
@@ -316,7 +345,8 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
316
345
|
type: type,
|
|
317
346
|
right: right,
|
|
318
347
|
extra: extra,
|
|
319
|
-
labelId: labelId
|
|
348
|
+
labelId: labelId,
|
|
349
|
+
disabled: disabled
|
|
320
350
|
});
|
|
321
351
|
};
|
|
322
352
|
var renderTouchableContent = function(props) {
|
|
@@ -344,6 +374,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
344
374
|
onPress: props.onPress,
|
|
345
375
|
role: role,
|
|
346
376
|
dataAttributes: dataAttributes,
|
|
377
|
+
disabled: disabled,
|
|
347
378
|
children: renderTouchableContent(props)
|
|
348
379
|
}));
|
|
349
380
|
}
|
|
@@ -355,6 +386,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
355
386
|
fullPageOnWebView: props.fullPageOnWebView,
|
|
356
387
|
role: role,
|
|
357
388
|
dataAttributes: dataAttributes,
|
|
389
|
+
disabled: disabled,
|
|
358
390
|
children: renderTouchableContent(props)
|
|
359
391
|
}));
|
|
360
392
|
}
|
|
@@ -366,6 +398,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
366
398
|
newTab: props.newTab,
|
|
367
399
|
role: role,
|
|
368
400
|
dataAttributes: dataAttributes,
|
|
401
|
+
disabled: disabled,
|
|
369
402
|
children: renderTouchableContent(props)
|
|
370
403
|
}));
|
|
371
404
|
}
|
|
@@ -377,19 +410,22 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
377
410
|
className: classes.dualActionContainer,
|
|
378
411
|
children: [
|
|
379
412
|
/*#__PURE__*/ _jsx(Touchable, {
|
|
413
|
+
disabled: disabled,
|
|
380
414
|
onPress: props.onPress,
|
|
381
415
|
role: role,
|
|
382
416
|
className: classNames(classes.dualActionLeft, classes.hover),
|
|
383
417
|
children: renderContent({
|
|
384
|
-
type: '
|
|
418
|
+
type: 'basic',
|
|
385
419
|
labelId: titleId
|
|
386
420
|
})
|
|
387
421
|
}),
|
|
388
422
|
/*#__PURE__*/ _jsx(Touchable, {
|
|
423
|
+
disabled: disabled,
|
|
389
424
|
className: classes.dualActionRight,
|
|
390
425
|
onPress: toggle,
|
|
391
426
|
dataAttributes: dataAttributes,
|
|
392
427
|
children: /*#__PURE__*/ _jsx(Control, {
|
|
428
|
+
disabled: disabled,
|
|
393
429
|
name: name,
|
|
394
430
|
checked: isChecked,
|
|
395
431
|
"aria-labelledby": titleId,
|
|
@@ -402,6 +438,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
402
438
|
}) : /*#__PURE__*/ _jsx("div", {
|
|
403
439
|
className: classNames(classes.rowContent, classes.hover),
|
|
404
440
|
children: /*#__PURE__*/ _jsx(Control, {
|
|
441
|
+
disabled: disabled,
|
|
405
442
|
dataAttributes: dataAttributes,
|
|
406
443
|
name: name,
|
|
407
444
|
checked: isChecked,
|
|
@@ -412,7 +449,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
412
449
|
role: role,
|
|
413
450
|
children: renderContent({
|
|
414
451
|
labelId: labelId,
|
|
415
|
-
type: '
|
|
452
|
+
type: 'control',
|
|
416
453
|
right: /*#__PURE__*/ _jsx(Stack, {
|
|
417
454
|
space: "around",
|
|
418
455
|
children: control
|
|
@@ -442,7 +479,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
442
479
|
/*#__PURE__*/ return _jsx(Box, {
|
|
443
480
|
paddingX: 16,
|
|
444
481
|
children: renderContent({
|
|
445
|
-
type: '
|
|
482
|
+
type: 'control',
|
|
446
483
|
right: /*#__PURE__*/ _jsx(Stack, {
|
|
447
484
|
space: "around",
|
|
448
485
|
children: radio
|
package/dist-es/menu.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ESC, TAB } from './utils/key-codes';
|
|
4
|
-
import Overlay from './overlay';
|
|
5
4
|
import { createUseStyles } from './jss';
|
|
6
5
|
import { cancelEvent } from './utils/dom';
|
|
6
|
+
import Overlay from './overlay';
|
|
7
7
|
function _arrayWithHoles(arr) {
|
|
8
8
|
if (Array.isArray(arr)) return arr;
|
|
9
9
|
}
|
|
@@ -69,6 +69,7 @@ var useStyles = createUseStyles(function(param) {
|
|
|
69
69
|
var colors = param.colors;
|
|
70
70
|
return {
|
|
71
71
|
menuContainer: {
|
|
72
|
+
zIndex: 12,
|
|
72
73
|
margin: 0,
|
|
73
74
|
padding: 0,
|
|
74
75
|
listStyleType: 'none',
|
|
@@ -77,13 +78,17 @@ var useStyles = createUseStyles(function(param) {
|
|
|
77
78
|
var itemsComputedProps = param.itemsComputedProps;
|
|
78
79
|
return itemsComputedProps.top;
|
|
79
80
|
},
|
|
80
|
-
|
|
81
|
+
bottom: function(param) {
|
|
82
|
+
var itemsComputedProps = param.itemsComputedProps;
|
|
83
|
+
return itemsComputedProps.bottom;
|
|
84
|
+
},
|
|
85
|
+
right: function(param) {
|
|
81
86
|
var itemsComputedProps = param.itemsComputedProps;
|
|
82
|
-
return itemsComputedProps.
|
|
87
|
+
return itemsComputedProps.right;
|
|
83
88
|
},
|
|
84
89
|
width: function(param) {
|
|
85
|
-
var
|
|
86
|
-
return width !== null && width !== void 0 ? width :
|
|
90
|
+
var width = param.width;
|
|
91
|
+
return width !== null && width !== void 0 ? width : '100%';
|
|
87
92
|
},
|
|
88
93
|
borderRadius: 4,
|
|
89
94
|
boxShadow: '0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)',
|
|
@@ -124,28 +129,27 @@ var Menu = function(param) {
|
|
|
124
129
|
return;
|
|
125
130
|
}
|
|
126
131
|
var MARGIN_THRESHOLD = 12;
|
|
127
|
-
var topTarget = targetRect.top, widthTarget = targetRect.width,
|
|
132
|
+
var topTarget = targetRect.top, widthTarget = targetRect.width, height = targetRect.height;
|
|
128
133
|
var top = topTarget + height;
|
|
129
134
|
var ref;
|
|
130
135
|
var spaceTaken = (ref = parseInt(window.getComputedStyle(menu).getPropertyValue('height'))) !== null && ref !== void 0 ? ref : 0;
|
|
131
|
-
var
|
|
136
|
+
var rightDirection = position === 'left' ? 'auto' : "calc(100% - ".concat(widthTarget, "px)");
|
|
132
137
|
// if it doesn't fit on bottom
|
|
133
138
|
if (top + spaceTaken + MARGIN_THRESHOLD > window.innerHeight) {
|
|
134
139
|
var availableSpaceBottom = window.innerHeight - top;
|
|
135
140
|
if (topTarget /* this is the available space on top */ > availableSpaceBottom) {
|
|
136
|
-
var newTop = topTarget - spaceTaken;
|
|
137
141
|
setItemsComputedProps({
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
top:
|
|
141
|
-
maxHeight: topTarget
|
|
142
|
+
right: rightDirection,
|
|
143
|
+
bottom: '100%',
|
|
144
|
+
top: 'auto',
|
|
145
|
+
maxHeight: Math.min(topTarget, MAX_HEIGHT_DEFAULT),
|
|
142
146
|
transformOrigin: 'center bottom'
|
|
143
147
|
});
|
|
144
148
|
} else {
|
|
145
149
|
setItemsComputedProps({
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
150
|
+
top: '100%',
|
|
151
|
+
bottom: 'auto',
|
|
152
|
+
right: rightDirection,
|
|
149
153
|
maxHeight: Math.min(window.innerHeight - top - MARGIN_THRESHOLD, MAX_HEIGHT_DEFAULT),
|
|
150
154
|
transformOrigin: 'center top'
|
|
151
155
|
});
|
|
@@ -153,9 +157,9 @@ var Menu = function(param) {
|
|
|
153
157
|
} else {
|
|
154
158
|
// if it fits on bottom
|
|
155
159
|
setItemsComputedProps({
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
top: '100%',
|
|
161
|
+
bottom: 'auto',
|
|
162
|
+
right: rightDirection,
|
|
159
163
|
maxHeight: Math.min(window.innerHeight - top - MARGIN_THRESHOLD, MAX_HEIGHT_DEFAULT),
|
|
160
164
|
transformOrigin: 'center top'
|
|
161
165
|
});
|
|
@@ -223,20 +227,23 @@ var Menu = function(param) {
|
|
|
223
227
|
document.removeEventListener('keydown', handleKeyDown, false);
|
|
224
228
|
};
|
|
225
229
|
});
|
|
226
|
-
return(/*#__PURE__*/ _jsxs(
|
|
230
|
+
return(/*#__PURE__*/ _jsxs("div", {
|
|
231
|
+
style: {
|
|
232
|
+
position: 'relative'
|
|
233
|
+
},
|
|
227
234
|
children: [
|
|
228
|
-
renderTarget(_objectSpread({
|
|
229
|
-
}, targetProps, {
|
|
230
|
-
isMenuOpen: isMenuOpen
|
|
231
|
-
})),
|
|
232
235
|
isMenuOpen ? /*#__PURE__*/ _jsx(Overlay, {
|
|
233
236
|
onPress: function(e) {
|
|
234
|
-
setIsMenuOpen(false);
|
|
235
237
|
cancelEvent(e);
|
|
238
|
+
setIsMenuOpen(false);
|
|
236
239
|
},
|
|
237
|
-
disableScroll: true
|
|
238
|
-
|
|
239
|
-
|
|
240
|
+
disableScroll: true
|
|
241
|
+
}) : null,
|
|
242
|
+
renderTarget(_objectSpread({
|
|
243
|
+
}, targetProps, {
|
|
244
|
+
isMenuOpen: isMenuOpen
|
|
245
|
+
})),
|
|
246
|
+
isMenuOpen ? renderMenu(menuProps) : null
|
|
240
247
|
]
|
|
241
248
|
}));
|
|
242
249
|
};
|
package/dist-es/month-field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFieldProps } from './form-context';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
import { isInputTypeSupported } from './utils/dom';
|
|
6
6
|
import { isServerSide } from './utils/environment';
|
|
7
7
|
import IconCalendarRegular from './generated/mistica-icons/icon-calendar-regular';
|
|
@@ -113,7 +113,7 @@ var DateField = function(_param) {
|
|
|
113
113
|
onChange: onChange,
|
|
114
114
|
onChangeValue: onChangeValue
|
|
115
115
|
});
|
|
116
|
-
var nativePicker = /*#__PURE__*/ _jsx(
|
|
116
|
+
var nativePicker = /*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
117
117
|
}, rest, fieldProps, {
|
|
118
118
|
min: min ? getLocalYearMonthString(min) : undefined,
|
|
119
119
|
max: max ? getLocalYearMonthString(max) : undefined,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// DO NOT EDIT THIS FILE. It's autogenerated by set-version.js
|
|
2
|
-
export var PACKAGE_VERSION = '10.
|
|
2
|
+
export var PACKAGE_VERSION = '10.17.0';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFieldProps } from './form-context';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
import { useTheme } from './hooks';
|
|
6
6
|
import IconButton from './icon-button';
|
|
7
7
|
import Visibility from './icons/icon-visibility';
|
|
@@ -174,7 +174,7 @@ var PasswordField = function(_param) {
|
|
|
174
174
|
onChange: onChange,
|
|
175
175
|
onChangeValue: onChangeValue
|
|
176
176
|
});
|
|
177
|
-
return(/*#__PURE__*/ _jsx(
|
|
177
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
178
178
|
}, rest, fieldProps, {
|
|
179
179
|
type: isVisible ? 'text' : 'password',
|
|
180
180
|
inputRef: function(field) {
|