@wireapp/react-ui-kit 8.14.4 → 8.14.7
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"@emotion/react": "11.9.0",
|
|
4
|
-
"bazinga64": "5.11.
|
|
4
|
+
"bazinga64": "5.11.6",
|
|
5
5
|
"color": "3.1.3",
|
|
6
6
|
"emotion-normalize": "11.0.1",
|
|
7
7
|
"react-select": "5.4.0",
|
|
@@ -70,9 +70,8 @@
|
|
|
70
70
|
"test:coverage": "yarn test --coverage",
|
|
71
71
|
"test:watch": "yarn test --watch",
|
|
72
72
|
"test:update": "yarn test --updateSnapshot",
|
|
73
|
-
"test:project": "yarn dist && yarn test"
|
|
74
|
-
"prepare": "yarn dist"
|
|
73
|
+
"test:project": "yarn dist && yarn test"
|
|
75
74
|
},
|
|
76
|
-
"version": "8.14.
|
|
77
|
-
"gitHead": "
|
|
75
|
+
"version": "8.14.7",
|
|
76
|
+
"gitHead": "0deb05875d2b6a3045ed58906a6254e28125e81f"
|
|
78
77
|
}
|
package/src/Form/RangeInput.js
CHANGED
|
@@ -21,15 +21,14 @@ var _InputLabel = _interopRequireDefault(require("./InputLabel"));
|
|
|
21
21
|
|
|
22
22
|
var _RangeInput = require("./RangeInput.styles");
|
|
23
23
|
|
|
24
|
-
var _excluded = ["
|
|
24
|
+
var _excluded = ["id", "label", "minValueLabel", "maxValueLabel", "min", "max", "value", "onChange", "wrapperCSS"];
|
|
25
25
|
|
|
26
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
27
|
|
|
28
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
29
|
|
|
30
|
-
var RangeInput = /*#__PURE__*/(0, _react2.forwardRef)(function (_ref) {
|
|
31
|
-
var
|
|
32
|
-
_ref$id = _ref.id,
|
|
30
|
+
var RangeInput = /*#__PURE__*/(0, _react2.forwardRef)(function (_ref, ref) {
|
|
31
|
+
var _ref$id = _ref.id,
|
|
33
32
|
id = _ref$id === void 0 ? Math.random().toString() : _ref$id,
|
|
34
33
|
label = _ref.label,
|
|
35
34
|
minValueLabel = _ref.minValueLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RangeInput.tsx"],"names":["RangeInput","ref","id","Math","random","toString","label","minValueLabel","maxValueLabel","min","max","value","onChange","wrapperCSS","inputProps","minNum","Number","maxNum","valueNum","backgroundSize","rangeInputWrapperStyles","ValueLabelPosition","LEFT","RIGHT","theme"],"mappings":";;;;;;;;;;;;;;;AAoBA;;AACA;;AAGA;;AACA;;;;;;;;AAcO,IAAMA,UAA+B,gBAAG,wBAC7C,
|
|
1
|
+
{"version":3,"sources":["RangeInput.tsx"],"names":["RangeInput","ref","id","Math","random","toString","label","minValueLabel","maxValueLabel","min","max","value","onChange","wrapperCSS","inputProps","minNum","Number","maxNum","valueNum","backgroundSize","rangeInputWrapperStyles","ValueLabelPosition","LEFT","RIGHT","theme"],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AkB,6CAA4BA,KAA5B,EAAmCL,cAAnC,CAAlB;AAAA,KAFP;AAGE,IAAA,EAAE,EAAEjB,EAHN;AAIE,IAAA,IAAI,EAAEA,EAJR;AAKE,IAAA,GAAG,EAAEO,GALP;AAME,IAAA,GAAG,EAAEC,GANP;AAOE,IAAA,KAAK,EAAEC,KAPT;AAQE,IAAA,QAAQ,EAAEC,QARZ;AASE,IAAA,IAAI,EAAC;AATP,KAUME,UAVN,EAHF,CAFF,CADF;AAqBD,CA3C4C,CAAxC","sourcesContent":["/*\n * Wire\n * Copyright (C) 2022 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/** @jsx jsx */\nimport {CSSObject, jsx} from '@emotion/react';\nimport React, {FC, forwardRef} from 'react';\nimport {TextProps} from '../Text';\nimport {Theme} from '../Layout';\nimport InputLabel from './InputLabel';\nimport {\n getImageCropZoomInputStyles,\n getValueLabelStyles,\n rangeInputWrapperStyles,\n ValueLabelPosition,\n} from './RangeInput.styles';\n\nexport interface RangeInputProps<T = HTMLInputElement> extends TextProps<T> {\n label?: string;\n minValueLabel?: string;\n maxValueLabel?: string;\n wrapperCSS?: CSSObject;\n}\n\nexport const RangeInput: FC<RangeInputProps> = forwardRef<HTMLInputElement, RangeInputProps<HTMLInputElement>>(\n (\n {\n id = Math.random().toString(),\n label,\n minValueLabel,\n maxValueLabel,\n min = '0',\n max = '100',\n value = '0',\n onChange,\n wrapperCSS,\n ...inputProps\n },\n ref,\n ) => {\n const minNum = Number(min);\n const maxNum = Number(max);\n const valueNum = Number(value);\n\n const backgroundSize = `${((valueNum - minNum) * 100) / (maxNum - minNum)}% 100%` as const;\n\n return (\n <div css={wrapperCSS}>\n {label && <InputLabel htmlFor={id}>{label}</InputLabel>}\n <div css={rangeInputWrapperStyles}>\n {minValueLabel && <span css={getValueLabelStyles(ValueLabelPosition.LEFT)}>{minValueLabel}</span>}\n {maxValueLabel && <span css={getValueLabelStyles(ValueLabelPosition.RIGHT)}>{maxValueLabel}</span>}\n <input\n ref={ref}\n css={(theme: Theme) => getImageCropZoomInputStyles(theme, backgroundSize)}\n id={id}\n name={id}\n min={min}\n max={max}\n value={value}\n onChange={onChange}\n type=\"range\"\n {...inputProps}\n />\n </div>\n </div>\n );\n },\n);\n"],"file":"RangeInput.js"}
|