@synerise/ds-completed-within 1.0.14 → 1.0.16

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/README.md CHANGED
@@ -6,6 +6,7 @@ title: CompletedWithin
6
6
  CompletedWithin UI Component
7
7
 
8
8
  ## Installation
9
+
9
10
  ```
10
11
  npm i @synerise/ds-completed-within
11
12
  or
@@ -13,6 +14,7 @@ yarn add @synerise/ds-completed-within
13
14
  ```
14
15
 
15
16
  ## Usage
17
+
16
18
  ```
17
19
  import CompletedWithin from '@synerise/ds-completed-within'
18
20
 
@@ -30,7 +32,7 @@ import CompletedWithin from '@synerise/ds-completed-within'
30
32
  ## API
31
33
 
32
34
  | Property | Description | Type | Default |
33
- | --- | --- | --- | --- |
35
+ | ----------- | ---------------------------------------------------------------------------- | ---------------------------- | ------------------------------------ |
34
36
  | text | Custom labels and tooltips | CompletedWithinTexts | - |
35
37
  | value | Selected value | PeriodValue | { value: undefined, period: 'YEARS'} |
36
38
  | maxValue | Max value | PeriodValue[value] | Number.MAX_SAFE_INTEGER |
@@ -43,7 +45,7 @@ import CompletedWithin from '@synerise/ds-completed-within'
43
45
  ### CompletedWithinTexts
44
46
 
45
47
  | Property | Description | Type | Default |
46
- | --- | --- | --- | --- |
48
+ | ----------------- | ----------------------------------- | ---------------------------- | ------------------ |
47
49
  | header | Header of settings | `string` \ `React.ReactNode` | `Completed within` |
48
50
  | completedLabel | Label of button with selected value | `string` \ `React.ReactNode` | `Completed within` |
49
51
  | clear | Clear button tooltip | `string` \ `React.ReactNode` | `Clear` |
@@ -52,14 +54,13 @@ import CompletedWithin from '@synerise/ds-completed-within'
52
54
  ### PeriodValue
53
55
 
54
56
  | Property | Description | Type | Default |
55
- | --- | --- | --- | --- |
57
+ | -------- | ------------------------------------------------------------------------------------- | ---------------------- | ----------- |
56
58
  | value | Numerical value | `number` \ `undefined` | `undefined` |
57
59
  | period | Period key, default options: `SECONDS`, `MINUTES`, `HOURS`, `DAYS`, `MONTHS`, `YEARS` | `string` \ `undefined` | `undefined` |
58
60
 
59
61
  ### CustomPeriod
60
62
 
61
63
  | Property | Description | Type | Default |
62
- | --- | --- | --- | --- |
64
+ | -------- | ---------------------- | -------- | ------- |
63
65
  | value | Key of custom period | `string` | - |
64
66
  | label | Label of custom period | `string` | - |
65
-
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { CompletedWithinProps } from './CompletedWithin.types';
2
+ import { type CompletedWithinProps } from './CompletedWithin.types';
3
3
  export declare const DEFAULT_PERIODS: string[];
4
4
  declare const CompletedWithin: ({ value, maxValue, onSetValue, text, periods, placeholder, tooltip, readOnly, }: CompletedWithinProps) => React.JSX.Element;
5
5
  export default CompletedWithin;
@@ -1,11 +1,11 @@
1
1
  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); }
2
2
  import React, { useCallback, useMemo, useState } from 'react';
3
3
  import { useIntl } from 'react-intl';
4
- import Icon, { ClockM, Close3S } from '@synerise/ds-icon';
5
4
  import Dropdown from '@synerise/ds-dropdown';
5
+ import Icon, { ClockM, Close3S } from '@synerise/ds-icon';
6
6
  import Tooltip from '@synerise/ds-tooltip';
7
- import Settings from './Settings/Settings';
8
7
  import * as S from './CompleteWithin.styles';
8
+ import Settings from './Settings/Settings';
9
9
  export var DEFAULT_PERIODS = ['SECONDS', 'MINUTES', 'HOURS', 'DAYS', 'MONTHS', 'YEARS'];
10
10
  var CompletedWithin = function CompletedWithin(_ref) {
11
11
  var value = _ref.value,
@@ -86,7 +86,9 @@ var CompletedWithin = function CompletedWithin(_ref) {
86
86
  });
87
87
  }, [onSetValue]);
88
88
  var triggerMode = useMemo(function () {
89
- if (hasValue || placeholder) return 'icon-label';
89
+ if (hasValue || placeholder) {
90
+ return 'icon-label';
91
+ }
90
92
  return 'single-icon';
91
93
  }, [hasValue, placeholder]);
92
94
  var triggerLabel = useMemo(function () {
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { SettingsProps } from './Settings.types';
3
- declare const Settings: React.FC<SettingsProps>;
2
+ import { type SettingsProps } from './Settings.types';
3
+ declare const Settings: ({ value, text, onPeriodChange, onValueChange, periods, maxValue, readOnly, }: SettingsProps) => React.JSX.Element;
4
4
  export default Settings;
@@ -26,13 +26,12 @@ var Settings = function Settings(_ref) {
26
26
  onChange: onValueChange,
27
27
  min: 0,
28
28
  max: maxValue != null ? maxValue : Number.MAX_SAFE_INTEGER
29
- }), /*#__PURE__*/React.createElement(Select, {
30
- readOnly: readOnly,
29
+ }), /*#__PURE__*/React.createElement(Select
30
+ // readOnly={readOnly} - STOR-1872: add readOnly prop to select
31
+ , {
31
32
  size: 'default',
32
33
  value: value.period,
33
- placeholder: text.periodPlaceholder
34
- // @ts-ignore
35
- ,
34
+ placeholder: text.periodPlaceholder,
36
35
  onChange: function onChange(option) {
37
36
  onPeriodChange(option);
38
37
  },
@@ -1,7 +1,5 @@
1
1
  import styled from 'styled-components';
2
2
  import { InputGroupWrapper } from '@synerise/ds-input/dist/InputGroup.styles';
3
-
4
- // eslint-disable-next-line import/prefer-default-export
5
3
  export var Settings = styled.div.withConfig({
6
4
  displayName: "Settingsstyles__Settings",
7
5
  componentId: "sc-11xtzjt-0"
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import InputNumber from '@synerise/ds-input-number';
3
- import { CompletedWithinProps, CompletedWithinTexts, CustomPeriod, Period, PeriodValue } from '../CompletedWithin.types';
2
+ import type InputNumber from '@synerise/ds-input-number';
3
+ import { type CompletedWithinProps, type CompletedWithinTexts, type CustomPeriod, type Period, type PeriodValue } from '../CompletedWithin.types';
4
4
  type InputProps = React.ComponentProps<typeof InputNumber>;
5
5
  export type SettingsProps = Omit<CompletedWithinProps, 'onClear' | 'onSetValue' | 'periods' | 'text'> & {
6
6
  onValueChange: InputProps['onChange'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-completed-within",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "CompletedWithin UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,14 +34,14 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-button": "^1.4.0",
38
- "@synerise/ds-dropdown": "^1.0.13",
39
- "@synerise/ds-icon": "^1.5.3",
40
- "@synerise/ds-input": "^1.3.0",
41
- "@synerise/ds-input-number": "^1.2.1",
42
- "@synerise/ds-select": "^1.1.6",
43
- "@synerise/ds-tooltip": "^1.1.10",
44
- "@synerise/ds-utils": "^1.3.0"
37
+ "@synerise/ds-button": "^1.4.2",
38
+ "@synerise/ds-dropdown": "^1.0.15",
39
+ "@synerise/ds-icon": "^1.5.4",
40
+ "@synerise/ds-input": "^1.3.2",
41
+ "@synerise/ds-input-number": "^1.2.3",
42
+ "@synerise/ds-select": "^1.1.8",
43
+ "@synerise/ds-tooltip": "^1.1.12",
44
+ "@synerise/ds-utils": "^1.3.1"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@synerise/ds-core": "*",
@@ -50,5 +50,5 @@
50
50
  "react-intl": ">=3.12.0 <= 6.8",
51
51
  "styled-components": "^5.3.3"
52
52
  },
53
- "gitHead": "f2713cd35cfe22f63a159f05144585834897a132"
53
+ "gitHead": "4512641033ba3581a3df208143c547fcfed45895"
54
54
  }