@tenancy.nz/ui 1.3.2 → 1.3.3
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/dist/cjs/components/Autocomplete.cjs +11 -25
- package/dist/cjs/components/Tag.cjs +7 -5
- package/dist/cjs/components/TextInput.styled.cjs +1 -1
- package/dist/esm/components/Autocomplete.js +11 -25
- package/dist/esm/components/Tag.js +7 -5
- package/dist/esm/components/TextInput.styled.js +1 -1
- package/package.json +1 -1
|
@@ -6,11 +6,10 @@ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.c
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var PropTypes = require('prop-types');
|
|
8
8
|
var KeyboardArrowDownIcon = require('@mui/icons-material/KeyboardArrowDown');
|
|
9
|
-
var FormControl = require('./FormControl.cjs');
|
|
10
9
|
var Autocomplete_styled = require('./Autocomplete.styled.cjs');
|
|
11
10
|
var TextInput = require('./TextInput.cjs');
|
|
12
11
|
|
|
13
|
-
var _excluded = ["disabled", "edges", "fullWidth", "helperText", "
|
|
12
|
+
var _excluded = ["disabled", "edges", "fullWidth", "helperText", "label", "placeholder", "popupIcon", "required", "size", "variant", "showError", "errorMessage", "name", "hideLabel", "disableIconRotation", "TextInputProps", "onChange", "textInputAttrs"],
|
|
14
13
|
_excluded2 = ["inputProps", "InputProps"];
|
|
15
14
|
function Autocomplete(_ref) {
|
|
16
15
|
var _ref$disabled = _ref.disabled,
|
|
@@ -21,8 +20,6 @@ function Autocomplete(_ref) {
|
|
|
21
20
|
fullWidth = _ref$fullWidth === void 0 ? true : _ref$fullWidth,
|
|
22
21
|
_ref$helperText = _ref.helperText,
|
|
23
22
|
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
24
|
-
_ref$helperTextPlacem = _ref.helperTextPlacement,
|
|
25
|
-
helperTextPlacement = _ref$helperTextPlacem === void 0 ? "below" : _ref$helperTextPlacem,
|
|
26
23
|
_ref$label = _ref.label,
|
|
27
24
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
28
25
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -62,19 +59,7 @@ function Autocomplete(_ref) {
|
|
|
62
59
|
}
|
|
63
60
|
onChange.apply(void 0, [event, val].concat(extras));
|
|
64
61
|
};
|
|
65
|
-
return /* @__PURE__ */React.createElement(
|
|
66
|
-
name: name,
|
|
67
|
-
fullWidth: fullWidth,
|
|
68
|
-
label: label,
|
|
69
|
-
helperText: helperText,
|
|
70
|
-
helperTextPlacement: helperTextPlacement,
|
|
71
|
-
disabled: disabled,
|
|
72
|
-
required: required,
|
|
73
|
-
showError: showError,
|
|
74
|
-
errorMessage: errorMessage,
|
|
75
|
-
hideLabel: hideLabel,
|
|
76
|
-
edges: edges
|
|
77
|
-
}, /* @__PURE__ */React.createElement(Autocomplete_styled.StyledAutocomplete, _rollupPluginBabelHelpers.objectSpread2({
|
|
62
|
+
return /* @__PURE__ */React.createElement(Autocomplete_styled.StyledAutocomplete, _rollupPluginBabelHelpers.objectSpread2({
|
|
78
63
|
disabled: disabled,
|
|
79
64
|
iconrotation: disableIconRotation ? "no" : "yes",
|
|
80
65
|
popupIcon: popupIcon === void 0 ? /* @__PURE__ */React.createElement(KeyboardArrowDownIcon, null) : popupIcon,
|
|
@@ -84,26 +69,31 @@ function Autocomplete(_ref) {
|
|
|
84
69
|
params = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded2);
|
|
85
70
|
return /* @__PURE__ */React.createElement(TextInput.default, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, params), {}, {
|
|
86
71
|
disabled: disabled,
|
|
72
|
+
fullWidth: fullWidth,
|
|
87
73
|
name: name,
|
|
74
|
+
label: label,
|
|
88
75
|
variant: variant,
|
|
89
76
|
size: size,
|
|
90
77
|
edges: edges,
|
|
91
78
|
required: required,
|
|
92
79
|
value: selectedValue,
|
|
93
80
|
placeholder: placeholder,
|
|
81
|
+
helperText: helperText,
|
|
82
|
+
showError: showError,
|
|
83
|
+
errorMessage: errorMessage,
|
|
84
|
+
hideLabel: hideLabel,
|
|
94
85
|
inputProps: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
|
95
86
|
autoComplete: "off"
|
|
96
87
|
}, textInputAttrs), inputProps),
|
|
97
88
|
slotProps: {
|
|
98
|
-
input: _rollupPluginBabelHelpers.objectSpread2(
|
|
89
|
+
input: _rollupPluginBabelHelpers.objectSpread2({}, TextInputProps)
|
|
99
90
|
},
|
|
100
|
-
showError: showError,
|
|
101
91
|
message: errorMessage,
|
|
102
92
|
ref: InputProps.ref
|
|
103
|
-
}));
|
|
93
|
+
}, InputProps));
|
|
104
94
|
},
|
|
105
95
|
onChange: handleChange
|
|
106
|
-
}, rest))
|
|
96
|
+
}, rest));
|
|
107
97
|
}
|
|
108
98
|
Autocomplete.propTypes = {
|
|
109
99
|
/**
|
|
@@ -130,10 +120,6 @@ Autocomplete.propTypes = {
|
|
|
130
120
|
* The helper text content.
|
|
131
121
|
*/
|
|
132
122
|
helperText: PropTypes.string,
|
|
133
|
-
/**
|
|
134
|
-
* Placed the helper text above or below the input.
|
|
135
|
-
*/
|
|
136
|
-
helperTextPlacement: PropTypes.oneOf(["above", "below"]),
|
|
137
123
|
/**
|
|
138
124
|
* The label content.
|
|
139
125
|
*/
|
|
@@ -6,9 +6,11 @@ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.c
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var Tag_styled = require('./Tag.styled.cjs');
|
|
8
8
|
|
|
9
|
-
var _excluded = ["endIcon", "label", "startIcon", "color", "edges", "size", "variant"];
|
|
9
|
+
var _excluded = ["disableIcon", "endIcon", "label", "startIcon", "color", "edges", "size", "variant"];
|
|
10
10
|
function Tag(_ref) {
|
|
11
|
-
var _ref$
|
|
11
|
+
var _ref$disableIcon = _ref.disableIcon,
|
|
12
|
+
disableIcon = _ref$disableIcon === void 0 ? false : _ref$disableIcon,
|
|
13
|
+
_ref$endIcon = _ref.endIcon,
|
|
12
14
|
endIcon = _ref$endIcon === void 0 ? void 0 : _ref$endIcon,
|
|
13
15
|
label = _ref.label,
|
|
14
16
|
_ref$startIcon = _ref.startIcon,
|
|
@@ -27,11 +29,11 @@ function Tag(_ref) {
|
|
|
27
29
|
edges: edges,
|
|
28
30
|
variant: variant,
|
|
29
31
|
size: size
|
|
30
|
-
}, others), startIcon && /* @__PURE__ */React.createElement(Tag_styled.StyledTagIcon, {
|
|
32
|
+
}, others), !disableIcon && startIcon && /* @__PURE__ */React.createElement(Tag_styled.StyledTagIcon, {
|
|
31
33
|
size: size
|
|
32
|
-
}, startIcon), !startIcon && !endIcon && /* @__PURE__ */React.createElement(Tag_styled.StyledTagIcon, {
|
|
34
|
+
}, startIcon), !disableIcon && !startIcon && !endIcon && /* @__PURE__ */React.createElement(Tag_styled.StyledTagIcon, {
|
|
33
35
|
size: size
|
|
34
|
-
}, /* @__PURE__ */React.createElement(Tag_styled.StyledTagIconDot, null)), /* @__PURE__ */React.createElement("span", null, label), endIcon && /* @__PURE__ */React.createElement(Tag_styled.StyledTagIcon, {
|
|
36
|
+
}, /* @__PURE__ */React.createElement(Tag_styled.StyledTagIconDot, null)), /* @__PURE__ */React.createElement("span", null, label), !disableIcon && endIcon && /* @__PURE__ */React.createElement(Tag_styled.StyledTagIcon, {
|
|
35
37
|
size: size
|
|
36
38
|
}, endIcon));
|
|
37
39
|
}
|
|
@@ -51,7 +51,7 @@ var StyledTextInput = styles.styled(InputBase)(_templateObject17 || (_templateOb
|
|
|
51
51
|
readOnly = _ref8.readOnly,
|
|
52
52
|
size = _ref8.size,
|
|
53
53
|
theme = _ref8.theme;
|
|
54
|
-
return react.css(_templateObject18 || (_templateObject18 = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n && {\n background-color: #fff;\n font-weight: 400;\n transition: none;\n color: ", ";\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n > input {\n padding: 0;\n border: 0px;\n margin: 0px;\n box-shadow: none;\n height: 1.4375em;\n font: inherit;\n font-size: inherit;\n line-height: inherit;\n color: currentColor;\n box-sizing: content-box;\n background: none;\n -webkit-tap-highlight-color: transparent;\n display: block;\n min-width: 0px;\n width: 100%;\n }\n }\n "])), object.getObjectProp(theme, "vars.palette.text.primary"), colorStyles({
|
|
54
|
+
return react.css(_templateObject18 || (_templateObject18 = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n && {\n background-color: #fff;\n font-weight: 400;\n transition: none;\n color: ", ";\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .MuiAutocomplete-endAdornment {\n right: 8px;\n }\n\n > input {\n padding: 0;\n border: 0px;\n margin: 0px;\n box-shadow: none;\n height: 1.4375em;\n font: inherit;\n font-size: inherit;\n line-height: inherit;\n color: currentColor;\n box-sizing: content-box;\n background: none;\n -webkit-tap-highlight-color: transparent;\n display: block;\n min-width: 0px;\n width: 100%;\n }\n }\n "])), object.getObjectProp(theme, "vars.palette.text.primary"), colorStyles({
|
|
55
55
|
color: color,
|
|
56
56
|
theme: theme
|
|
57
57
|
}), edgesStyles({
|
|
@@ -2,11 +2,10 @@ import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _
|
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
|
5
|
-
import FormControl from './FormControl.js';
|
|
6
5
|
import { StyledAutocomplete } from './Autocomplete.styled.js';
|
|
7
6
|
import TextInput from './TextInput.js';
|
|
8
7
|
|
|
9
|
-
var _excluded = ["disabled", "edges", "fullWidth", "helperText", "
|
|
8
|
+
var _excluded = ["disabled", "edges", "fullWidth", "helperText", "label", "placeholder", "popupIcon", "required", "size", "variant", "showError", "errorMessage", "name", "hideLabel", "disableIconRotation", "TextInputProps", "onChange", "textInputAttrs"],
|
|
10
9
|
_excluded2 = ["inputProps", "InputProps"];
|
|
11
10
|
function Autocomplete(_ref) {
|
|
12
11
|
var _ref$disabled = _ref.disabled,
|
|
@@ -17,8 +16,6 @@ function Autocomplete(_ref) {
|
|
|
17
16
|
fullWidth = _ref$fullWidth === void 0 ? true : _ref$fullWidth,
|
|
18
17
|
_ref$helperText = _ref.helperText,
|
|
19
18
|
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
20
|
-
_ref$helperTextPlacem = _ref.helperTextPlacement,
|
|
21
|
-
helperTextPlacement = _ref$helperTextPlacem === void 0 ? "below" : _ref$helperTextPlacem,
|
|
22
19
|
_ref$label = _ref.label,
|
|
23
20
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
24
21
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -58,19 +55,7 @@ function Autocomplete(_ref) {
|
|
|
58
55
|
}
|
|
59
56
|
onChange.apply(void 0, [event, val].concat(extras));
|
|
60
57
|
};
|
|
61
|
-
return /* @__PURE__ */React.createElement(
|
|
62
|
-
name: name,
|
|
63
|
-
fullWidth: fullWidth,
|
|
64
|
-
label: label,
|
|
65
|
-
helperText: helperText,
|
|
66
|
-
helperTextPlacement: helperTextPlacement,
|
|
67
|
-
disabled: disabled,
|
|
68
|
-
required: required,
|
|
69
|
-
showError: showError,
|
|
70
|
-
errorMessage: errorMessage,
|
|
71
|
-
hideLabel: hideLabel,
|
|
72
|
-
edges: edges
|
|
73
|
-
}, /* @__PURE__ */React.createElement(StyledAutocomplete, _objectSpread2({
|
|
58
|
+
return /* @__PURE__ */React.createElement(StyledAutocomplete, _objectSpread2({
|
|
74
59
|
disabled: disabled,
|
|
75
60
|
iconrotation: disableIconRotation ? "no" : "yes",
|
|
76
61
|
popupIcon: popupIcon === void 0 ? /* @__PURE__ */React.createElement(KeyboardArrowDownIcon, null) : popupIcon,
|
|
@@ -80,26 +65,31 @@ function Autocomplete(_ref) {
|
|
|
80
65
|
params = _objectWithoutProperties(_ref2, _excluded2);
|
|
81
66
|
return /* @__PURE__ */React.createElement(TextInput, _objectSpread2(_objectSpread2({}, params), {}, {
|
|
82
67
|
disabled: disabled,
|
|
68
|
+
fullWidth: fullWidth,
|
|
83
69
|
name: name,
|
|
70
|
+
label: label,
|
|
84
71
|
variant: variant,
|
|
85
72
|
size: size,
|
|
86
73
|
edges: edges,
|
|
87
74
|
required: required,
|
|
88
75
|
value: selectedValue,
|
|
89
76
|
placeholder: placeholder,
|
|
77
|
+
helperText: helperText,
|
|
78
|
+
showError: showError,
|
|
79
|
+
errorMessage: errorMessage,
|
|
80
|
+
hideLabel: hideLabel,
|
|
90
81
|
inputProps: _objectSpread2(_objectSpread2({
|
|
91
82
|
autoComplete: "off"
|
|
92
83
|
}, textInputAttrs), inputProps),
|
|
93
84
|
slotProps: {
|
|
94
|
-
input: _objectSpread2(
|
|
85
|
+
input: _objectSpread2({}, TextInputProps)
|
|
95
86
|
},
|
|
96
|
-
showError: showError,
|
|
97
87
|
message: errorMessage,
|
|
98
88
|
ref: InputProps.ref
|
|
99
|
-
}));
|
|
89
|
+
}, InputProps));
|
|
100
90
|
},
|
|
101
91
|
onChange: handleChange
|
|
102
|
-
}, rest))
|
|
92
|
+
}, rest));
|
|
103
93
|
}
|
|
104
94
|
Autocomplete.propTypes = {
|
|
105
95
|
/**
|
|
@@ -126,10 +116,6 @@ Autocomplete.propTypes = {
|
|
|
126
116
|
* The helper text content.
|
|
127
117
|
*/
|
|
128
118
|
helperText: PropTypes.string,
|
|
129
|
-
/**
|
|
130
|
-
* Placed the helper text above or below the input.
|
|
131
|
-
*/
|
|
132
|
-
helperTextPlacement: PropTypes.oneOf(["above", "below"]),
|
|
133
119
|
/**
|
|
134
120
|
* The label content.
|
|
135
121
|
*/
|
|
@@ -2,9 +2,11 @@ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import StyledTag, { StyledTagIcon, StyledTagIconDot } from './Tag.styled.js';
|
|
4
4
|
|
|
5
|
-
var _excluded = ["endIcon", "label", "startIcon", "color", "edges", "size", "variant"];
|
|
5
|
+
var _excluded = ["disableIcon", "endIcon", "label", "startIcon", "color", "edges", "size", "variant"];
|
|
6
6
|
function Tag(_ref) {
|
|
7
|
-
var _ref$
|
|
7
|
+
var _ref$disableIcon = _ref.disableIcon,
|
|
8
|
+
disableIcon = _ref$disableIcon === void 0 ? false : _ref$disableIcon,
|
|
9
|
+
_ref$endIcon = _ref.endIcon,
|
|
8
10
|
endIcon = _ref$endIcon === void 0 ? void 0 : _ref$endIcon,
|
|
9
11
|
label = _ref.label,
|
|
10
12
|
_ref$startIcon = _ref.startIcon,
|
|
@@ -23,11 +25,11 @@ function Tag(_ref) {
|
|
|
23
25
|
edges: edges,
|
|
24
26
|
variant: variant,
|
|
25
27
|
size: size
|
|
26
|
-
}, others), startIcon && /* @__PURE__ */React.createElement(StyledTagIcon, {
|
|
28
|
+
}, others), !disableIcon && startIcon && /* @__PURE__ */React.createElement(StyledTagIcon, {
|
|
27
29
|
size: size
|
|
28
|
-
}, startIcon), !startIcon && !endIcon && /* @__PURE__ */React.createElement(StyledTagIcon, {
|
|
30
|
+
}, startIcon), !disableIcon && !startIcon && !endIcon && /* @__PURE__ */React.createElement(StyledTagIcon, {
|
|
29
31
|
size: size
|
|
30
|
-
}, /* @__PURE__ */React.createElement(StyledTagIconDot, null)), /* @__PURE__ */React.createElement("span", null, label), endIcon && /* @__PURE__ */React.createElement(StyledTagIcon, {
|
|
32
|
+
}, /* @__PURE__ */React.createElement(StyledTagIconDot, null)), /* @__PURE__ */React.createElement("span", null, label), !disableIcon && endIcon && /* @__PURE__ */React.createElement(StyledTagIcon, {
|
|
31
33
|
size: size
|
|
32
34
|
}, endIcon));
|
|
33
35
|
}
|
|
@@ -47,7 +47,7 @@ var StyledTextInput = styled(InputBase)(_templateObject17 || (_templateObject17
|
|
|
47
47
|
readOnly = _ref8.readOnly,
|
|
48
48
|
size = _ref8.size,
|
|
49
49
|
theme = _ref8.theme;
|
|
50
|
-
return css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n && {\n background-color: #fff;\n font-weight: 400;\n transition: none;\n color: ", ";\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n > input {\n padding: 0;\n border: 0px;\n margin: 0px;\n box-shadow: none;\n height: 1.4375em;\n font: inherit;\n font-size: inherit;\n line-height: inherit;\n color: currentColor;\n box-sizing: content-box;\n background: none;\n -webkit-tap-highlight-color: transparent;\n display: block;\n min-width: 0px;\n width: 100%;\n }\n }\n "])), getObjectProp(theme, "vars.palette.text.primary"), colorStyles({
|
|
50
|
+
return css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n && {\n background-color: #fff;\n font-weight: 400;\n transition: none;\n color: ", ";\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .MuiAutocomplete-endAdornment {\n right: 8px;\n }\n\n > input {\n padding: 0;\n border: 0px;\n margin: 0px;\n box-shadow: none;\n height: 1.4375em;\n font: inherit;\n font-size: inherit;\n line-height: inherit;\n color: currentColor;\n box-sizing: content-box;\n background: none;\n -webkit-tap-highlight-color: transparent;\n display: block;\n min-width: 0px;\n width: 100%;\n }\n }\n "])), getObjectProp(theme, "vars.palette.text.primary"), colorStyles({
|
|
51
51
|
color: color,
|
|
52
52
|
theme: theme
|
|
53
53
|
}), edgesStyles({
|