@dhis2-ui/input 10.16.3-alpha.1 → 10.16.4
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/build/cjs/input/input.js +3 -4
- package/build/cjs/input/input.prod.stories.js +4 -7
- package/build/cjs/input-field/input-field.prod.stories.js +5 -9
- package/build/es/input/input.js +2 -2
- package/build/es/input/input.prod.stories.js +4 -7
- package/build/es/input-field/input-field.prod.stories.js +4 -7
- package/package.json +8 -8
package/build/cjs/input/input.js
CHANGED
|
@@ -12,8 +12,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _inputTypes = require("./inputTypes.js");
|
|
15
|
-
function
|
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
17
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
17
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -21,8 +20,8 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
21
20
|
const styles = [`.input.jsx-4253951613{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;gap:${_uiConstants.spacers.dp8};}`, `input.jsx-4253951613{box-sizing:border-box;font-size:14px;line-height:16px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;color:${_uiConstants.colors.grey900};background-color:white;padding:11px 12px;max-height:40px;outline:0;border:1px solid ${_uiConstants.colors.grey500};border-radius:3px;box-shadow:inset 0 0 1px 0 rgba(48,54,60,0.1);text-overflow:ellipsis;}`, "input.dense.jsx-4253951613{max-height:32px;padding:7px 8px;}", `input.jsx-4253951613:focus{outline:none;box-shadow:inset 0 0 0 2px ${_uiConstants.theme.focus};border-color:${_uiConstants.theme.focus};}`, `input.jsx-4253951613::-webkit-input-placeholder{color:${_uiConstants.colors.grey600};opacity:1;}`, `input.jsx-4253951613::-moz-placeholder{color:${_uiConstants.colors.grey600};opacity:1;}`, `input.jsx-4253951613:-ms-input-placeholder{color:${_uiConstants.colors.grey600};opacity:1;}`, `input.jsx-4253951613::placeholder{color:${_uiConstants.colors.grey600};opacity:1;}`, "input[type='date'].jsx-4253951613::-webkit-inner-spin-button,input[type='date'].jsx-4253951613::-webkit-calendar-picker-indicator,input[type='time'].jsx-4253951613::-webkit-inner-spin-button,input[type='time'].jsx-4253951613::-webkit-calendar-picker-indicator,input[type='datetime-local'].jsx-4253951613::-webkit-inner-spin-button,input[type='datetime-local'].jsx-4253951613::-webkit-calendar-picker-indicator{height:14px;padding-top:1px;padding-bottom:1px;}", "input[type='date'].jsx-4253951613::-webkit-datetime-edit-fields-wrapper,input[type='datetime-local'].jsx-4253951613::-webkit-datetime-edit-fields-wrapper,input[type='time'].jsx-4253951613::-webkit-datetime-edit-fields-wrapper{padding:0;}", `input.warning.jsx-4253951613{border-color:${_uiConstants.theme.warning};}`, `input.error.jsx-4253951613{border-color:${_uiConstants.theme.error};}`, `input.read-only.jsx-4253951613{background-color:${_uiConstants.colors.grey050};border-color:${_uiConstants.colors.grey300};box-shadow:none;cursor:text;}`, `input.disabled.jsx-4253951613{background-color:${_uiConstants.colors.grey100};border-color:${_uiConstants.colors.grey500};color:${_uiConstants.theme.disabled};cursor:not-allowed;}`];
|
|
22
21
|
styles.__hash = "4253951613";
|
|
23
22
|
class Input extends _react.Component {
|
|
24
|
-
constructor() {
|
|
25
|
-
super(...
|
|
23
|
+
constructor(...args) {
|
|
24
|
+
super(...args);
|
|
26
25
|
_defineProperty(this, "inputRef", /*#__PURE__*/_react.default.createRef());
|
|
27
26
|
_defineProperty(this, "handleChange", e => {
|
|
28
27
|
if (this.props.onChange) {
|
|
@@ -32,13 +32,10 @@ const inputTypeArgType = {
|
|
|
32
32
|
options: ['text', 'number', 'password', 'email', 'url', 'tel', 'date', 'datetime', 'datetime-local', 'month', 'week', 'time', 'search']
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
const logger =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} = _ref;
|
|
40
|
-
return console.log(`Name: ${name}, value: ${value}`);
|
|
41
|
-
};
|
|
35
|
+
const logger = ({
|
|
36
|
+
name,
|
|
37
|
+
value
|
|
38
|
+
}) => console.log(`Name: ${name}, value: ${value}`);
|
|
42
39
|
var _default = exports.default = {
|
|
43
40
|
title: 'Input',
|
|
44
41
|
component: _index.Input,
|
|
@@ -8,8 +8,7 @@ var _uiConstants = require("@dhis2/ui-constants");
|
|
|
8
8
|
var _uiIcons = require("@dhis2/ui-icons");
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _index = require("./index.js");
|
|
11
|
-
function
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
12
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
14
13
|
const subtitle = 'Allows a user to enter data, usually text';
|
|
15
14
|
const description = `
|
|
@@ -23,13 +22,10 @@ Please see more about options and features of inputs at [Design System: Input Fi
|
|
|
23
22
|
import { InputField } from '@dhis2/ui'
|
|
24
23
|
\`\`\`
|
|
25
24
|
`;
|
|
26
|
-
const logger =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} = _ref;
|
|
31
|
-
return console.log(`Name: ${name}, value: ${value}`);
|
|
32
|
-
};
|
|
25
|
+
const logger = ({
|
|
26
|
+
name,
|
|
27
|
+
value
|
|
28
|
+
}) => console.log(`Name: ${name}, value: ${value}`);
|
|
33
29
|
const inputTypeArgType = {
|
|
34
30
|
table: {
|
|
35
31
|
type: {
|
package/build/es/input/input.js
CHANGED
|
@@ -12,8 +12,8 @@ import { inputTypes } from './inputTypes.js';
|
|
|
12
12
|
const styles = [`.input.jsx-4253951613{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;gap:${spacers.dp8};}`, `input.jsx-4253951613{box-sizing:border-box;font-size:14px;line-height:16px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;color:${colors.grey900};background-color:white;padding:11px 12px;max-height:40px;outline:0;border:1px solid ${colors.grey500};border-radius:3px;box-shadow:inset 0 0 1px 0 rgba(48,54,60,0.1);text-overflow:ellipsis;}`, "input.dense.jsx-4253951613{max-height:32px;padding:7px 8px;}", `input.jsx-4253951613:focus{outline:none;box-shadow:inset 0 0 0 2px ${theme.focus};border-color:${theme.focus};}`, `input.jsx-4253951613::-webkit-input-placeholder{color:${colors.grey600};opacity:1;}`, `input.jsx-4253951613::-moz-placeholder{color:${colors.grey600};opacity:1;}`, `input.jsx-4253951613:-ms-input-placeholder{color:${colors.grey600};opacity:1;}`, `input.jsx-4253951613::placeholder{color:${colors.grey600};opacity:1;}`, "input[type='date'].jsx-4253951613::-webkit-inner-spin-button,input[type='date'].jsx-4253951613::-webkit-calendar-picker-indicator,input[type='time'].jsx-4253951613::-webkit-inner-spin-button,input[type='time'].jsx-4253951613::-webkit-calendar-picker-indicator,input[type='datetime-local'].jsx-4253951613::-webkit-inner-spin-button,input[type='datetime-local'].jsx-4253951613::-webkit-calendar-picker-indicator{height:14px;padding-top:1px;padding-bottom:1px;}", "input[type='date'].jsx-4253951613::-webkit-datetime-edit-fields-wrapper,input[type='datetime-local'].jsx-4253951613::-webkit-datetime-edit-fields-wrapper,input[type='time'].jsx-4253951613::-webkit-datetime-edit-fields-wrapper{padding:0;}", `input.warning.jsx-4253951613{border-color:${theme.warning};}`, `input.error.jsx-4253951613{border-color:${theme.error};}`, `input.read-only.jsx-4253951613{background-color:${colors.grey050};border-color:${colors.grey300};box-shadow:none;cursor:text;}`, `input.disabled.jsx-4253951613{background-color:${colors.grey100};border-color:${colors.grey500};color:${theme.disabled};cursor:not-allowed;}`];
|
|
13
13
|
styles.__hash = "4253951613";
|
|
14
14
|
export class Input extends Component {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...
|
|
15
|
+
constructor(...args) {
|
|
16
|
+
super(...args);
|
|
17
17
|
_defineProperty(this, "inputRef", /*#__PURE__*/React.createRef());
|
|
18
18
|
_defineProperty(this, "handleChange", e => {
|
|
19
19
|
if (this.props.onChange) {
|
|
@@ -25,13 +25,10 @@ const inputTypeArgType = {
|
|
|
25
25
|
options: ['text', 'number', 'password', 'email', 'url', 'tel', 'date', 'datetime', 'datetime-local', 'month', 'week', 'time', 'search']
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
const logger =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
33
|
-
return console.log(`Name: ${name}, value: ${value}`);
|
|
34
|
-
};
|
|
28
|
+
const logger = ({
|
|
29
|
+
name,
|
|
30
|
+
value
|
|
31
|
+
}) => console.log(`Name: ${name}, value: ${value}`);
|
|
35
32
|
export default {
|
|
36
33
|
title: 'Input',
|
|
37
34
|
component: Input,
|
|
@@ -15,13 +15,10 @@ Please see more about options and features of inputs at [Design System: Input Fi
|
|
|
15
15
|
import { InputField } from '@dhis2/ui'
|
|
16
16
|
\`\`\`
|
|
17
17
|
`;
|
|
18
|
-
const logger =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
23
|
-
return console.log(`Name: ${name}, value: ${value}`);
|
|
24
|
-
};
|
|
18
|
+
const logger = ({
|
|
19
|
+
name,
|
|
20
|
+
value
|
|
21
|
+
}) => console.log(`Name: ${name}, value: ${value}`);
|
|
25
22
|
const inputTypeArgType = {
|
|
26
23
|
table: {
|
|
27
24
|
type: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/input",
|
|
3
|
-
"version": "10.16.
|
|
3
|
+
"version": "10.16.4",
|
|
4
4
|
"description": "UI Input",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@dhis2/prop-types": "^3.1.2",
|
|
36
|
-
"@dhis2-ui/box": "10.16.
|
|
37
|
-
"@dhis2-ui/field": "10.16.
|
|
38
|
-
"@dhis2-ui/input": "10.16.
|
|
39
|
-
"@dhis2-ui/loader": "10.16.
|
|
40
|
-
"@dhis2-ui/status-icon": "10.16.
|
|
41
|
-
"@dhis2/ui-constants": "10.16.
|
|
42
|
-
"@dhis2/ui-icons": "10.16.
|
|
36
|
+
"@dhis2-ui/box": "10.16.4",
|
|
37
|
+
"@dhis2-ui/field": "10.16.4",
|
|
38
|
+
"@dhis2-ui/input": "10.16.4",
|
|
39
|
+
"@dhis2-ui/loader": "10.16.4",
|
|
40
|
+
"@dhis2-ui/status-icon": "10.16.4",
|
|
41
|
+
"@dhis2/ui-constants": "10.16.4",
|
|
42
|
+
"@dhis2/ui-icons": "10.16.4",
|
|
43
43
|
"classnames": "^2.3.1",
|
|
44
44
|
"prop-types": "^15.7.2"
|
|
45
45
|
},
|