@qiwi/pijma-desktop 1.159.0 → 1.159.2

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@qiwi/pijma-desktop",
3
- "version": "1.159.0",
3
+ "version": "1.159.2",
4
4
  "type": "module",
5
5
  "main": "./target/es5/index.js",
6
6
  "module": "./target/es6/index.js",
@@ -1 +1,3 @@
1
1
  export * from './SuggestField';
2
+ export * from './SuggestFieldProps';
3
+ export * from './SuggestFieldOptionModel';
@@ -14,14 +14,16 @@ var _pijmaCore = require("@qiwi/pijma-core");
14
14
  var _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
15
15
  var _typography = require("../typography/index.js");
16
16
  var ExtendedProgressBar = function(param) {
17
- var value = param.value, _maxValue = param.maxValue, maxValue = _maxValue === void 0 ? 1 : _maxValue, titleStart = param.titleStart, titleEnd = param.titleEnd, _stub = param.stub, stub = _stub === void 0 ? false : _stub, _disabled = param.disabled, disabled = _disabled === void 0 ? false : _disabled, formatValue = param.formatValue;
17
+ var value = param.value, _maxValue = param.maxValue, maxValue = _maxValue === void 0 ? 1 : _maxValue, titleStart = param.titleStart, titleEnd = param.titleEnd, _stub = param.stub, stub = _stub === void 0 ? false : _stub, _disabled = param.disabled, disabled = _disabled === void 0 ? false : _disabled, _formatValue = param.formatValue, formatValue = _formatValue === void 0 ? function(v) {
18
+ return v;
19
+ } : _formatValue;
18
20
  return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_pijmaCore.Spacer, {
19
21
  size: "xs",
20
22
  children: [
21
23
  /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_pijmaCore.Flex, {
22
24
  children: [
23
25
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
24
- width: stub || disabled || maxValue === 0 ? 1 : value / maxValue,
26
+ width: stub || disabled || maxValue === 0 || value >= maxValue ? 1 : value / maxValue,
25
27
  minWidth: 2,
26
28
  transition: "width 300ms cubic-bezier(0.4, 0.0, 0.2, 1)",
27
29
  children: stub ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Stub, {
@@ -71,7 +73,7 @@ var ExtendedProgressBar = function(param) {
71
73
  ]
72
74
  }),
73
75
  value !== undefined ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_typography.Text, {
74
- children: formatValue !== undefined ? formatValue(value) : value
76
+ children: formatValue(value)
75
77
  }) : null
76
78
  ]
77
79
  }) : null
@@ -95,7 +97,7 @@ var ExtendedProgressBar = function(param) {
95
97
  ]
96
98
  }),
97
99
  value !== undefined && maxValue !== undefined ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_typography.Text, {
98
- children: formatValue !== undefined ? formatValue(maxValue - value) : maxValue - value
100
+ children: formatValue(Math.max(maxValue - value, 0))
99
101
  }) : null
100
102
  ]
101
103
  }) : null
@@ -4,3 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  var _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
6
  _exportStar(require("./SuggestField.js"), exports);
7
+ _exportStar(require("./SuggestFieldProps.js"), exports);
8
+ _exportStar(require("./SuggestFieldOptionModel.js"), exports);
@@ -2,13 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Card, Flex, FlexItem, Spacer, Stub } from '@qiwi/pijma-core';
3
3
  import React from 'react';
4
4
  import { Paragraph, Text } from '../typography/index.js';
5
- export const ExtendedProgressBar = ({ value , maxValue =1 , titleStart , titleEnd , stub =false , disabled =false , formatValue , })=>/*#__PURE__*/ _jsxs(Spacer, {
5
+ export const ExtendedProgressBar = ({ value , maxValue =1 , titleStart , titleEnd , stub =false , disabled =false , formatValue =(v)=>v , })=>/*#__PURE__*/ _jsxs(Spacer, {
6
6
  size: "xs",
7
7
  children: [
8
8
  /*#__PURE__*/ _jsxs(Flex, {
9
9
  children: [
10
10
  /*#__PURE__*/ _jsx(FlexItem, {
11
- width: stub || disabled || maxValue === 0 ? 1 : value / maxValue,
11
+ width: stub || disabled || maxValue === 0 || value >= maxValue ? 1 : value / maxValue,
12
12
  minWidth: 2,
13
13
  transition: "width 300ms cubic-bezier(0.4, 0.0, 0.2, 1)",
14
14
  children: stub ? /*#__PURE__*/ _jsx(Stub, {
@@ -58,7 +58,7 @@ export const ExtendedProgressBar = ({ value , maxValue =1 , titleStart , titleEn
58
58
  ]
59
59
  }),
60
60
  value !== undefined ? /*#__PURE__*/ _jsx(Text, {
61
- children: formatValue !== undefined ? formatValue(value) : value
61
+ children: formatValue(value)
62
62
  }) : null
63
63
  ]
64
64
  }) : null
@@ -82,7 +82,7 @@ export const ExtendedProgressBar = ({ value , maxValue =1 , titleStart , titleEn
82
82
  ]
83
83
  }),
84
84
  value !== undefined && maxValue !== undefined ? /*#__PURE__*/ _jsx(Text, {
85
- children: formatValue !== undefined ? formatValue(maxValue - value) : maxValue - value
85
+ children: formatValue(Math.max(maxValue - value, 0))
86
86
  }) : null
87
87
  ]
88
88
  }) : null
@@ -1 +1,3 @@
1
1
  export * from './SuggestField.js';
2
+ export * from './SuggestFieldProps.js';
3
+ export * from './SuggestFieldOptionModel.js';