grommet 2.35.0 → 2.36.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/components/Anchor/Anchor.js +1 -4
- package/components/Anchor/StyledAnchor.js +1 -1
- package/components/Box/Box.js +2 -2
- package/components/Box/StyledBox.js +18 -1
- package/components/Box/index.d.ts +1 -1
- package/components/Box/propTypes.js +4 -1
- package/components/Cards/stories/Simple.js +1 -4
- package/components/Data/stories/Cards.js +9 -19
- package/components/Data/stories/Complex.js +1 -4
- package/components/Data/stories/ComposedToolbar.js +74 -0
- package/components/Data/stories/Infinite.js +29 -64
- package/components/Data/stories/Inline.js +1 -9
- package/components/Data/stories/List.js +3 -9
- package/components/Data/stories/Properties.js +17 -22
- package/components/Data/stories/Simple.js +4 -10
- package/components/Data/stories/SpaceX.js +9 -11
- package/components/Data/stories/StarWars.js +6 -12
- package/components/Data/stories/Views.js +4 -11
- package/components/DataFilter/DataFilter.js +1 -0
- package/components/DataFilter/stories/Simple.js +2 -6
- package/components/DataFilters/stories/Drop.js +2 -6
- package/components/DataFilters/stories/Layer.js +2 -6
- package/components/DataFilters/stories/Simple.js +2 -6
- package/components/DataSearch/stories/Drop.js +6 -11
- package/components/DataSearch/stories/Responsive.js +6 -12
- package/components/DataSearch/stories/Simple.js +5 -10
- package/components/DataSearch/stories/UpdateOnSubmit.js +5 -7
- package/components/DataSort/stories/Drop.js +2 -6
- package/components/DataSort/stories/Simple.js +2 -6
- package/components/DataSummary/stories/Simple.js +2 -6
- package/components/DataTableColumns/stories/Simple.js +2 -6
- package/components/DataTableGroupBy/stories/Simple.js +5 -7
- package/components/DataView/stories/Simple.js +4 -6
- package/components/DateInput/DateInput.js +61 -17
- package/components/DateInput/index.d.ts +1 -0
- package/components/DateInput/propTypes.js +1 -0
- package/components/DateInput/stories/ReadOnly.js +36 -0
- package/components/DateInput/utils.js +2 -2
- package/components/Form/Form.js +34 -1
- package/components/FormField/FormField.js +20 -1
- package/components/FormField/README.md +1 -644
- package/components/FormField/index.d.ts +5 -1
- package/components/FormField/propTypes.js +4 -1
- package/components/FormField/stories/ThresholdValidation.js +51 -0
- package/components/Grommet/Grommet.js +1 -1
- package/components/Grommet/index.d.ts +12 -0
- package/components/Grommet/propTypes.js +12 -0
- package/components/Layer/LayerContainer.js +1 -1
- package/components/List/List.js +33 -30
- package/components/Pagination/Pagination.js +52 -9
- package/components/Pagination/PaginationStep.js +41 -0
- package/components/Pagination/PaginationSummary.js +33 -0
- package/components/Pagination/index.d.ts +2 -0
- package/components/Pagination/propTypes.js +3 -1
- package/components/Pagination/stories/Steps.js +40 -0
- package/components/RangeInput/RangeInput.js +19 -12
- package/components/TextInput/CopyButton.js +54 -0
- package/components/TextInput/StyledTextInput.js +13 -2
- package/components/TextInput/TextInput.js +46 -12
- package/components/TextInput/index.d.ts +1 -0
- package/components/TextInput/propTypes.js +1 -0
- package/components/TextInput/stories/ReadOnly.js +43 -0
- package/components/Toolbar/stories/Simple.js +1 -4
- package/es6/components/Anchor/Anchor.js +1 -4
- package/es6/components/Anchor/StyledAnchor.js +1 -1
- package/es6/components/Box/Box.js +2 -2
- package/es6/components/Box/StyledBox.js +18 -1
- package/es6/components/Box/index.d.ts +1 -1
- package/es6/components/Box/propTypes.js +4 -1
- package/es6/components/Cards/stories/Simple.js +2 -5
- package/es6/components/Data/stories/Cards.js +10 -20
- package/es6/components/Data/stories/Complex.js +2 -5
- package/es6/components/Data/stories/ComposedToolbar.js +69 -0
- package/es6/components/Data/stories/Infinite.js +32 -66
- package/es6/components/Data/stories/Inline.js +2 -10
- package/es6/components/Data/stories/List.js +4 -10
- package/es6/components/Data/stories/Properties.js +18 -23
- package/es6/components/Data/stories/Simple.js +5 -11
- package/es6/components/Data/stories/SpaceX.js +11 -13
- package/es6/components/Data/stories/StarWars.js +7 -13
- package/es6/components/Data/stories/Views.js +5 -12
- package/es6/components/DataFilter/DataFilter.js +1 -0
- package/es6/components/DataFilter/stories/Simple.js +2 -6
- package/es6/components/DataFilters/stories/Drop.js +2 -6
- package/es6/components/DataFilters/stories/Layer.js +2 -6
- package/es6/components/DataFilters/stories/Simple.js +2 -6
- package/es6/components/DataSearch/stories/Drop.js +7 -12
- package/es6/components/DataSearch/stories/Responsive.js +7 -13
- package/es6/components/DataSearch/stories/Simple.js +6 -11
- package/es6/components/DataSearch/stories/UpdateOnSubmit.js +6 -8
- package/es6/components/DataSort/stories/Drop.js +2 -6
- package/es6/components/DataSort/stories/Simple.js +2 -6
- package/es6/components/DataSummary/stories/Simple.js +2 -6
- package/es6/components/DataTableColumns/stories/Simple.js +2 -6
- package/es6/components/DataTableGroupBy/stories/Simple.js +5 -7
- package/es6/components/DataView/stories/Simple.js +6 -8
- package/es6/components/DateInput/DateInput.js +61 -17
- package/es6/components/DateInput/index.d.ts +1 -0
- package/es6/components/DateInput/propTypes.js +1 -0
- package/es6/components/DateInput/stories/ReadOnly.js +31 -0
- package/es6/components/DateInput/utils.js +2 -2
- package/es6/components/Form/Form.js +34 -1
- package/es6/components/FormField/FormField.js +21 -2
- package/es6/components/FormField/README.md +1 -644
- package/es6/components/FormField/index.d.ts +5 -1
- package/es6/components/FormField/propTypes.js +4 -1
- package/es6/components/FormField/stories/ThresholdValidation.js +46 -0
- package/es6/components/Grommet/Grommet.js +1 -1
- package/es6/components/Grommet/index.d.ts +12 -0
- package/es6/components/Grommet/propTypes.js +12 -0
- package/es6/components/Layer/LayerContainer.js +1 -1
- package/es6/components/List/List.js +33 -30
- package/es6/components/Pagination/Pagination.js +52 -9
- package/es6/components/Pagination/PaginationStep.js +35 -0
- package/es6/components/Pagination/PaginationSummary.js +27 -0
- package/es6/components/Pagination/index.d.ts +2 -0
- package/es6/components/Pagination/propTypes.js +3 -1
- package/es6/components/Pagination/stories/Steps.js +35 -0
- package/es6/components/RangeInput/RangeInput.js +19 -12
- package/es6/components/TextInput/CopyButton.js +49 -0
- package/es6/components/TextInput/StyledTextInput.js +14 -3
- package/es6/components/TextInput/TextInput.js +46 -12
- package/es6/components/TextInput/index.d.ts +1 -0
- package/es6/components/TextInput/propTypes.js +1 -0
- package/es6/components/TextInput/stories/ReadOnly.js +38 -0
- package/es6/components/Toolbar/stories/Simple.js +2 -5
- package/es6/languages/default.json +23 -0
- package/es6/themes/base.d.ts +8 -0
- package/es6/themes/base.js +12 -1
- package/es6/utils/index.js +1 -0
- package/es6/utils/readOnly.js +10 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +23 -0
- package/package.json +31 -32
- package/themes/base.d.ts +8 -0
- package/themes/base.js +12 -1
- package/utils/index.js +6 -0
- package/utils/readOnly.js +14 -0
- package/components/Data/stories/Controlled.js +0 -92
- package/components/Data/stories/DataTable.js +0 -49
- package/components/DataFilters/stories/Inline.js +0 -53
- package/es6/components/Data/stories/Controlled.js +0 -86
- package/es6/components/Data/stories/DataTable.js +0 -44
- package/es6/components/DataFilters/stories/Inline.js +0 -48
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["a11yTitle", "defaultSuggestion", "defaultValue", "dropAlign", "dropHeight", "dropTarget", "dropProps", "focusIndicator", "icon", "id", "messages", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onSuggestionSelect", "onSuggestionsClose", "onSuggestionsOpen", "placeholder", "plain", "readOnly", "reverse", "suggestions", "textAlign", "value", "width"];
|
|
1
|
+
var _excluded = ["a11yTitle", "defaultSuggestion", "defaultValue", "dropAlign", "dropHeight", "dropTarget", "dropProps", "focusIndicator", "icon", "id", "messages", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onSuggestionSelect", "onSuggestionsClose", "onSuggestionsOpen", "placeholder", "plain", "readOnly", "readOnlyCopy", "reverse", "suggestions", "textAlign", "value", "width"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
3
3
|
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; }
|
|
4
4
|
import React, { forwardRef, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
@@ -15,6 +15,7 @@ import { isNodeAfterScroll, isNodeBeforeScroll, sizeStyle, useForwardedRef, useS
|
|
|
15
15
|
import { StyledTextInput, StyledTextInputContainer, StyledPlaceholder, StyledIcon, StyledSuggestions } from './StyledTextInput';
|
|
16
16
|
import { MessageContext } from '../../contexts/MessageContext';
|
|
17
17
|
import { TextInputPropTypes } from './propTypes';
|
|
18
|
+
import { CopyButton } from './CopyButton';
|
|
18
19
|
var renderLabel = function renderLabel(suggestion) {
|
|
19
20
|
if (suggestion && typeof suggestion === 'object') {
|
|
20
21
|
return suggestion.label || suggestion.value;
|
|
@@ -66,7 +67,8 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
66
67
|
onSuggestionsOpen = _ref.onSuggestionsOpen,
|
|
67
68
|
placeholder = _ref.placeholder,
|
|
68
69
|
plain = _ref.plain,
|
|
69
|
-
|
|
70
|
+
readOnlyProp = _ref.readOnly,
|
|
71
|
+
readOnlyCopy = _ref.readOnlyCopy,
|
|
70
72
|
reverse = _ref.reverse,
|
|
71
73
|
suggestions = _ref.suggestions,
|
|
72
74
|
textAlign = _ref.textAlign,
|
|
@@ -81,6 +83,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
81
83
|
var inputRef = useForwardedRef(ref);
|
|
82
84
|
var dropRef = useRef();
|
|
83
85
|
var suggestionsRef = useRef();
|
|
86
|
+
var readOnly = readOnlyProp || readOnlyCopy;
|
|
84
87
|
// if this is a readOnly property, don't set a name with the form context
|
|
85
88
|
// this allows Select to control the form context for the name.
|
|
86
89
|
var _formContext$useFormI = formContext.useFormInput({
|
|
@@ -104,6 +107,25 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
104
107
|
var _useState3 = useState(),
|
|
105
108
|
suggestionsAtClose = _useState3[0],
|
|
106
109
|
setSuggestionsAtClose = _useState3[1];
|
|
110
|
+
var readOnlyCopyValidation = format({
|
|
111
|
+
id: 'input.readOnlyCopy.validation',
|
|
112
|
+
messages: messages
|
|
113
|
+
});
|
|
114
|
+
var readOnlyCopyPrompt = format({
|
|
115
|
+
id: 'input.readOnlyCopy.prompt',
|
|
116
|
+
messages: messages
|
|
117
|
+
});
|
|
118
|
+
var _useState4 = useState(readOnlyCopyPrompt),
|
|
119
|
+
tip = _useState4[0],
|
|
120
|
+
setTip = _useState4[1];
|
|
121
|
+
var onClickCopy = function onClickCopy() {
|
|
122
|
+
global.navigator.clipboard.writeText(value);
|
|
123
|
+
announce(readOnlyCopyValidation, 'assertive');
|
|
124
|
+
setTip(readOnlyCopyValidation);
|
|
125
|
+
};
|
|
126
|
+
var onBlurCopy = function onBlurCopy() {
|
|
127
|
+
if (tip === readOnlyCopyValidation) setTip(readOnlyCopyPrompt);
|
|
128
|
+
};
|
|
107
129
|
var openDrop = useCallback(function () {
|
|
108
130
|
setShowDrop(true);
|
|
109
131
|
announce(format({
|
|
@@ -160,15 +182,15 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
160
182
|
|
|
161
183
|
// activeSuggestionIndex unifies mouse and keyboard interaction of
|
|
162
184
|
// the suggestions
|
|
163
|
-
var
|
|
164
|
-
activeSuggestionIndex =
|
|
165
|
-
setActiveSuggestionIndex =
|
|
185
|
+
var _useState5 = useState(resetSuggestionIndex),
|
|
186
|
+
activeSuggestionIndex = _useState5[0],
|
|
187
|
+
setActiveSuggestionIndex = _useState5[1];
|
|
166
188
|
|
|
167
189
|
// Only update active suggestion index when the mouse actually moves,
|
|
168
190
|
// not when suggestions are moving under the mouse.
|
|
169
|
-
var
|
|
170
|
-
mouseMovedSinceLastKey =
|
|
171
|
-
setMouseMovedSinceLastKey =
|
|
191
|
+
var _useState6 = useState(),
|
|
192
|
+
mouseMovedSinceLastKey = _useState6[0],
|
|
193
|
+
setMouseMovedSinceLastKey = _useState6[1];
|
|
172
194
|
|
|
173
195
|
// set activeSuggestionIndex when value changes
|
|
174
196
|
useEffect(function () {
|
|
@@ -346,9 +368,20 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
346
368
|
// primarily for tests.
|
|
347
369
|
|
|
348
370
|
var textInputIcon = useSizedIcon(icon, rest.size, theme);
|
|
371
|
+
var ReadOnlyCopyButton = /*#__PURE__*/React.createElement(CopyButton, {
|
|
372
|
+
onBlurCopy: onBlurCopy,
|
|
373
|
+
onClickCopy: onClickCopy,
|
|
374
|
+
readOnlyCopyPrompt: readOnlyCopyPrompt,
|
|
375
|
+
tip: tip,
|
|
376
|
+
value: value
|
|
377
|
+
});
|
|
349
378
|
return /*#__PURE__*/React.createElement(StyledTextInputContainer, {
|
|
350
|
-
|
|
351
|
-
|
|
379
|
+
readOnlyProp: readOnly // readOnlyProp to avoid passing to DOM
|
|
380
|
+
,
|
|
381
|
+
readOnlyCopy: readOnlyCopy,
|
|
382
|
+
plain: plain,
|
|
383
|
+
border: !plain
|
|
384
|
+
}, reverse && readOnlyCopy && ReadOnlyCopyButton, showStyledPlaceholder && /*#__PURE__*/React.createElement(StyledPlaceholder, null, placeholder), textInputIcon && !readOnly && /*#__PURE__*/React.createElement(StyledIcon, {
|
|
352
385
|
reverse: reverse,
|
|
353
386
|
theme: theme
|
|
354
387
|
}, textInputIcon), /*#__PURE__*/React.createElement(Keyboard, _extends({
|
|
@@ -361,7 +394,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
361
394
|
autoComplete: "off",
|
|
362
395
|
plain: plain,
|
|
363
396
|
placeholder: typeof placeholder === 'string' ? placeholder : undefined,
|
|
364
|
-
icon: icon,
|
|
397
|
+
icon: !readOnly && icon,
|
|
365
398
|
reverse: reverse,
|
|
366
399
|
focus: focus,
|
|
367
400
|
focusIndicator: focusIndicator,
|
|
@@ -371,6 +404,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
371
404
|
defaultValue: renderLabel(defaultValue),
|
|
372
405
|
value: renderLabel(value),
|
|
373
406
|
readOnly: readOnly,
|
|
407
|
+
readOnlyCopy: readOnlyCopy,
|
|
374
408
|
onFocus: function onFocus(event) {
|
|
375
409
|
// Don't do anything if we are acting like we already have
|
|
376
410
|
// focus. This can happen when this input loses focus temporarily
|
|
@@ -409,7 +443,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
409
443
|
setActiveSuggestionIndex(resetSuggestionIndex);
|
|
410
444
|
if (onChange) onChange(event);
|
|
411
445
|
}
|
|
412
|
-
}))), drop);
|
|
446
|
+
}))), !reverse && readOnlyCopy && ReadOnlyCopyButton, !readOnly && drop);
|
|
413
447
|
});
|
|
414
448
|
TextInput.displayName = 'TextInput';
|
|
415
449
|
TextInput.propTypes = TextInputPropTypes;
|
|
@@ -46,6 +46,7 @@ export interface TextInputProps
|
|
|
46
46
|
onSuggestionsClose?: () => void;
|
|
47
47
|
placeholder?: PlaceHolderType;
|
|
48
48
|
plain?: boolean | 'full';
|
|
49
|
+
readOnlyCopy?: boolean;
|
|
49
50
|
reverse?: boolean;
|
|
50
51
|
size?: 'small' | 'medium' | 'large' | 'xlarge' | string;
|
|
51
52
|
suggestions?: ({ label?: React.ReactNode; value?: any } | string)[];
|
|
@@ -31,6 +31,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
31
31
|
onSuggestionsClose: PropTypes.func,
|
|
32
32
|
placeholder: PropTypes.node,
|
|
33
33
|
plain: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['full'])]),
|
|
34
|
+
readOnlyCopy: PropTypes.bool,
|
|
34
35
|
reverse: PropTypes.bool,
|
|
35
36
|
size: PropTypes.oneOfType([PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge', 'xxlarge', '2xl', '3xl', '4xl', '5xl', '6xl']), PropTypes.string]),
|
|
36
37
|
suggestions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, TextInput, Form, FormField } from 'grommet';
|
|
3
|
+
export var ReadOnly = function ReadOnly() {
|
|
4
|
+
return (
|
|
5
|
+
/*#__PURE__*/
|
|
6
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
7
|
+
// <Grommet theme={...}>
|
|
8
|
+
React.createElement(Box, {
|
|
9
|
+
fill: true,
|
|
10
|
+
align: "center",
|
|
11
|
+
justify: "start",
|
|
12
|
+
pad: "large"
|
|
13
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
14
|
+
width: "medium",
|
|
15
|
+
gap: "medium"
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(FormField, null, /*#__PURE__*/React.createElement(TextInput, {
|
|
17
|
+
readOnlyCopy: true,
|
|
18
|
+
value: "Read only with copy button",
|
|
19
|
+
"aria-label": "read only"
|
|
20
|
+
})), /*#__PURE__*/React.createElement(FormField, null, /*#__PURE__*/React.createElement(TextInput, {
|
|
21
|
+
readOnly: true,
|
|
22
|
+
value: "Read only",
|
|
23
|
+
"aria-label": "read only"
|
|
24
|
+
}))), /*#__PURE__*/React.createElement(TextInput, {
|
|
25
|
+
readOnlyCopy: true,
|
|
26
|
+
value: "Read only with copy button",
|
|
27
|
+
"aria-label": "read only"
|
|
28
|
+
}), /*#__PURE__*/React.createElement(TextInput, {
|
|
29
|
+
readOnly: true,
|
|
30
|
+
value: "Read only",
|
|
31
|
+
"aria-label": "read only"
|
|
32
|
+
})))
|
|
33
|
+
// </Grommet>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
export default {
|
|
37
|
+
title: 'Input/TextInput/ReadOnly'
|
|
38
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Box, Button, Data, DataFilters, DataSearch
|
|
2
|
+
import { Box, Button, Data, DataFilters, DataSearch } from 'grommet';
|
|
3
3
|
import { Toolbar } from '../Toolbar';
|
|
4
4
|
import { DATA } from '../../DataTable/stories/data';
|
|
5
5
|
export var Simple = function Simple() {
|
|
@@ -13,10 +13,7 @@ export var Simple = function Simple() {
|
|
|
13
13
|
justify: "start",
|
|
14
14
|
pad: "large",
|
|
15
15
|
gap: "large"
|
|
16
|
-
}, /*#__PURE__*/React.createElement(
|
|
17
|
-
status: "info",
|
|
18
|
-
message: "Toolbar is in 'beta'. The API surface is subject to change."
|
|
19
|
-
}), /*#__PURE__*/React.createElement(Box, {
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
20
17
|
width: "large"
|
|
21
18
|
}, /*#__PURE__*/React.createElement(Data, {
|
|
22
19
|
data: DATA
|
|
@@ -82,10 +82,33 @@
|
|
|
82
82
|
"invalid": "invalid",
|
|
83
83
|
"required": "required"
|
|
84
84
|
},
|
|
85
|
+
"formField": {
|
|
86
|
+
"maxCharacters": {
|
|
87
|
+
"remaining": {
|
|
88
|
+
"singular": "{number} character left",
|
|
89
|
+
"plural": "{number} characters left"
|
|
90
|
+
},
|
|
91
|
+
"overLimit": {
|
|
92
|
+
"singular": "{number} character over limit",
|
|
93
|
+
"plural": "{number} characters over limit"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"input": {
|
|
98
|
+
"readOnlyCopy": {
|
|
99
|
+
"prompt": "Copy to clipboard",
|
|
100
|
+
"validation": "Copied"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
85
103
|
"menu": {
|
|
86
104
|
"openMenu": "Open Menu",
|
|
87
105
|
"closeMenu": "Close Menu"
|
|
88
106
|
},
|
|
107
|
+
"pagination": {
|
|
108
|
+
"stepLabel": "Items per page",
|
|
109
|
+
"summary": "Showing {start}-{end} of {total}",
|
|
110
|
+
"summaryNoItems": "0 items"
|
|
111
|
+
},
|
|
89
112
|
"rangeSelector": {
|
|
90
113
|
"lower": "Lower Bounds",
|
|
91
114
|
"upper": "Upper Bounds"
|
package/es6/themes/base.d.ts
CHANGED
|
@@ -438,6 +438,12 @@ export interface ThemeType {
|
|
|
438
438
|
size?: string;
|
|
439
439
|
weight?: number | string;
|
|
440
440
|
};
|
|
441
|
+
readOnly?: {
|
|
442
|
+
background?: BackgroundType;
|
|
443
|
+
border?: {
|
|
444
|
+
color?: ColorType;
|
|
445
|
+
};
|
|
446
|
+
};
|
|
441
447
|
weight?: number | string;
|
|
442
448
|
};
|
|
443
449
|
opacity?: {
|
|
@@ -1076,6 +1082,7 @@ export interface ThemeType {
|
|
|
1076
1082
|
pad?: PadType;
|
|
1077
1083
|
extend?: ExtendType;
|
|
1078
1084
|
};
|
|
1085
|
+
primaryKey?: TextProps;
|
|
1079
1086
|
icons?: {
|
|
1080
1087
|
down?: React.ReactNode | Icon;
|
|
1081
1088
|
up?: React.ReactNode | Icon;
|
|
@@ -1415,6 +1422,7 @@ export interface ThemeType {
|
|
|
1415
1422
|
color?: ColorType;
|
|
1416
1423
|
extend?: ExtendType;
|
|
1417
1424
|
};
|
|
1425
|
+
wheel?: boolean;
|
|
1418
1426
|
extend?: ExtendType;
|
|
1419
1427
|
};
|
|
1420
1428
|
rangeSelector?: {
|
package/es6/themes/base.js
CHANGED
|
@@ -314,9 +314,15 @@ export var generate = function generate(baseSpacing, scale) {
|
|
|
314
314
|
// size: undefined,
|
|
315
315
|
// height: undefined,
|
|
316
316
|
weight: 600
|
|
317
|
-
}
|
|
317
|
+
},
|
|
318
318
|
// deprecate in v3
|
|
319
319
|
// weight: undefined,
|
|
320
|
+
readOnly: {
|
|
321
|
+
// background: undefined,
|
|
322
|
+
// border: {
|
|
323
|
+
// color: undefined,
|
|
324
|
+
// },
|
|
325
|
+
}
|
|
320
326
|
},
|
|
321
327
|
opacity: {
|
|
322
328
|
strong: 0.8,
|
|
@@ -1198,6 +1204,10 @@ export var generate = function generate(baseSpacing, scale) {
|
|
|
1198
1204
|
}
|
|
1199
1205
|
// extend: undefined,
|
|
1200
1206
|
},
|
|
1207
|
+
primaryKey: {
|
|
1208
|
+
// any text props
|
|
1209
|
+
weight: 'bold'
|
|
1210
|
+
},
|
|
1201
1211
|
icons: {
|
|
1202
1212
|
down: FormDown,
|
|
1203
1213
|
up: FormUp,
|
|
@@ -1765,6 +1775,7 @@ export var generate = function generate(baseSpacing, scale) {
|
|
|
1765
1775
|
// color: { dark: undefined, light: undefined },
|
|
1766
1776
|
// extend: undefined
|
|
1767
1777
|
}
|
|
1778
|
+
// wheel: undefined
|
|
1768
1779
|
},
|
|
1769
1780
|
rangeSelector: {
|
|
1770
1781
|
background: {
|
package/es6/utils/index.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
import { backgroundStyle } from './background';
|
|
3
|
+
import { normalizeColor } from './colors';
|
|
4
|
+
export var readOnlyStyle = function readOnlyStyle(theme) {
|
|
5
|
+
var _theme$global$input$r, _theme$global$input$r2, _theme$global$input$r3;
|
|
6
|
+
var styles = [];
|
|
7
|
+
if (theme != null && (_theme$global$input$r = theme.global.input.readOnly) != null && (_theme$global$input$r = _theme$global$input$r.border) != null && _theme$global$input$r.color) styles.push(css(["border-color:", ";"], normalizeColor(theme.global.input.readOnly.border.color, theme)));
|
|
8
|
+
if (theme != null && (_theme$global$input$r2 = theme.global.input.readOnly) != null && _theme$global$input$r2.background) styles.push(backgroundStyle((_theme$global$input$r3 = theme.global.input.readOnly) == null ? void 0 : _theme$global$input$r3.background, theme));
|
|
9
|
+
return styles;
|
|
10
|
+
};
|