@synerise/ds-factors 0.27.1 → 0.27.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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.27.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.27.1...@synerise/ds-factors@0.27.2) (2024-11-21)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **core:** onError fn types ([c34bdfe](https://github.com/Synerise/synerise-design/commit/c34bdfe9da898d7999c605f9fbcbba4716dfb6d4))
12
+ * **factors:** deep merge of default and prop texts ([787b436](https://github.com/Synerise/synerise-design/commit/787b4367213922eca21292a0a933c7ff5c241dd9))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [0.27.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.27.0...@synerise/ds-factors@0.27.1) (2024-11-12)
7
19
 
8
20
  **Note:** Version bump only for package @synerise/ds-factors
package/dist/Factors.js CHANGED
@@ -1,15 +1,4 @@
1
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
-
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
-
5
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
-
7
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
8
-
9
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
-
11
1
  import React, { useMemo } from 'react';
12
- import { useIntl } from 'react-intl';
13
2
  import { BookM, Calendar2M, DynamicKeyM, FormulaM, HashM, ListM, ShowM, TextM } from '@synerise/ds-icon';
14
3
  import * as S from './style/Factors.style';
15
4
  import FactorTypeSelector from './FactorTypeSelector/FactorTypeSelector';
@@ -21,6 +10,7 @@ import TextInput from './FactorValue/Text/Text';
21
10
  import ParameterInput from './FactorValue/Parameter/Parameter';
22
11
  import NumberInput from './FactorValue/Number/NumberInput';
23
12
  import DateRangeInput from './FactorValue/DateRange/DateRange';
13
+ import { useTexts } from './hooks/useTexts';
24
14
  export var factorTypes = {
25
15
  text: {
26
16
  icon: /*#__PURE__*/React.createElement(TextM, null),
@@ -103,350 +93,7 @@ var Factors = function Factors(_ref) {
103
93
  inputProps = _ref.inputProps,
104
94
  readOnly = _ref.readOnly,
105
95
  getMenuEntryProps = _ref.getMenuEntryProps;
106
-
107
- var _useIntl = useIntl(),
108
- formatMessage = _useIntl.formatMessage;
109
-
110
- var text = useMemo(function () {
111
- return _objectSpread({
112
- dateRangePicker: {
113
- after: formatMessage({
114
- id: "DS.DATE-RANGE-PICKER.AFTER",
115
- defaultMessage: 'after'
116
- }),
117
- allTime: formatMessage({
118
- id: "DS.DATE-RANGE-PICKER.ALL-TIME",
119
- defaultMessage: 'Lifetime'
120
- }),
121
- apply: formatMessage({
122
- id: "DS.DATE-RANGE-PICKER.APPLY",
123
- defaultMessage: 'Apply'
124
- }),
125
- before: formatMessage({
126
- id: "DS.DATE-RANGE-PICKER.BEFORE",
127
- defaultMessage: 'before'
128
- }),
129
- clear: formatMessage({
130
- id: "DS.DATE-RANGE-PICKER.CLEAR",
131
- defaultMessage: 'Clear'
132
- }),
133
- clearRange: formatMessage({
134
- id: "DS.DATE-RANGE-PICKER.CLEAR-RANGE",
135
- defaultMessage: ' Clear range'
136
- }),
137
- copyRange: formatMessage({
138
- id: "DS.DATE-RANGE-PICKER.COPY-RANGE",
139
- defaultMessage: 'Copy range'
140
- }),
141
- custom: formatMessage({
142
- id: "DS.DATE-RANGE-PICKER.CUSTOM",
143
- defaultMessage: 'Custom'
144
- }),
145
- days: formatMessage({
146
- id: "DS.DATE-RANGE-PICKER.DAYS",
147
- defaultMessage: 'Days'
148
- }),
149
- emptyDateError: formatMessage({
150
- id: "DS.DATE-RANGE-PICKER.EMPTY-DATE-ERROR",
151
- defaultMessage: 'Date cannot be empty'
152
- }),
153
- endDate: formatMessage({
154
- id: "DS.DATE-RANGE-PICKER.END-DATE",
155
- defaultMessage: 'End date'
156
- }),
157
- endDatePlaceholder: formatMessage({
158
- id: "DS.DATE-RANGE-PICKER.END-DATE-PLACEHOLDER",
159
- defaultMessage: 'End date'
160
- }),
161
- filter: formatMessage({
162
- id: "DS.DATE-RANGE-PICKER.FILTER",
163
- defaultMessage: 'Date filter'
164
- }),
165
- hours: formatMessage({
166
- id: "DS.DATE-RANGE-PICKER.HOURS",
167
- defaultMessage: 'Hours'
168
- }),
169
- last3Months: formatMessage({
170
- id: "DS.DATE-RANGE-PICKER.LAST-3-MONTHS",
171
- defaultMessage: 'Last 3 months'
172
- }),
173
- last6Months: formatMessage({
174
- id: "DS.DATE-RANGE-PICKER.LAST-6-MONTHS",
175
- defaultMessage: 'Last 6 months'
176
- }),
177
- last7Days: formatMessage({
178
- id: "DS.DATE-RANGE-PICKER.LAST-7-DAYS",
179
- defaultMessage: 'Last 7 days'
180
- }),
181
- last: formatMessage({
182
- id: "DS.DATE-RANGE-PICKER.LAST",
183
- defaultMessage: 'Last'
184
- }),
185
- lastMonth: formatMessage({
186
- id: "DS.DATE-RANGE-PICKER.LAST-MONTH",
187
- defaultMessage: 'Last month'
188
- }),
189
- lastWeek: formatMessage({
190
- id: "DS.DATE-RANGE-PICKER.LAST-WEEK",
191
- defaultMessage: 'Last week'
192
- }),
193
- lastYear: formatMessage({
194
- id: "DS.DATE-RANGE-PICKER.LAST-YEAR",
195
- defaultMessage: 'Last year'
196
- }),
197
- minutes: formatMessage({
198
- id: "DS.DATE-RANGE-PICKER.MINUTES",
199
- defaultMessage: 'Minutes'
200
- }),
201
- months: formatMessage({
202
- id: "DS.DATE-RANGE-PICKER.MONTHS",
203
- defaultMessage: 'Months'
204
- }),
205
- more: formatMessage({
206
- id: "DS.DATE-RANGE-PICKER.MORE",
207
- defaultMessage: 'More'
208
- }),
209
- next3Months: formatMessage({
210
- id: "DS.DATE-RANGE-PICKER.NEXT-3-MONTHS",
211
- defaultMessage: 'Next 3 months'
212
- }),
213
- next6Months: formatMessage({
214
- id: "DS.DATE-RANGE-PICKER.NEXT-6-MONTHS",
215
- defaultMessage: 'Next 6 months'
216
- }),
217
- next7Days: formatMessage({
218
- id: "DS.DATE-RANGE-PICKER.NEXT-7-DAYS",
219
- defaultMessage: 'Next 7 days'
220
- }),
221
- next: formatMessage({
222
- id: "DS.DATE-RANGE-PICKER.NEXT",
223
- defaultMessage: 'Next'
224
- }),
225
- nextMonth: formatMessage({
226
- id: "DS.DATE-RANGE-PICKER.NEXT-MONTH",
227
- defaultMessage: 'Next month'
228
- }),
229
- nextWeek: formatMessage({
230
- id: "DS.DATE-RANGE-PICKER.NEXT-WEEK",
231
- defaultMessage: 'Next week'
232
- }),
233
- nextYear: formatMessage({
234
- id: "DS.DATE-RANGE-PICKER.NEXT-YEAR",
235
- defaultMessage: 'Next year'
236
- }),
237
- now: formatMessage({
238
- id: "DS.DATE-RANGE-PICKER.NOW",
239
- defaultMessage: 'Now'
240
- }),
241
- pasteRange: formatMessage({
242
- id: "DS.DATE-RANGE-PICKER.PASTE-RANGE",
243
- defaultMessage: 'Paste range'
244
- }),
245
- relativeDateRange: formatMessage({
246
- id: "DS.DATE-RANGE-PICKER.RELATIVE-DATE-RANGE",
247
- defaultMessage: 'Relative date range'
248
- }),
249
- remove: formatMessage({
250
- id: "DS.DATE-RANGE-PICKER.REMOVE",
251
- defaultMessage: 'Remove'
252
- }),
253
- savedFiltersTrigger: formatMessage({
254
- id: "DS.DATE-RANGE-PICKER.SAVED-FILTERS",
255
- defaultMessage: 'Saved filters'
256
- }),
257
- seconds: formatMessage({
258
- id: "DS.DATE-RANGE-PICKER.SECONDS",
259
- defaultMessage: 'Seconds'
260
- }),
261
- selectDate: formatMessage({
262
- id: "DS.DATE-RANGE-PICKER.SELECT-DATE",
263
- defaultMessage: 'Select date'
264
- }),
265
- selectTime: formatMessage({
266
- id: "DS.DATE-RANGE-PICKER.SELECT-TIME",
267
- defaultMessage: 'Select time'
268
- }),
269
- since: formatMessage({
270
- id: "DS.DATE-RANGE-PICKER.SINCE",
271
- defaultMessage: 'Since'
272
- }),
273
- startDate: formatMessage({
274
- id: "DS.DATE-RANGE-PICKER.START-DATE",
275
- defaultMessage: 'Start date'
276
- }),
277
- startDatePlaceholder: formatMessage({
278
- id: "DS.DATE-RANGE-PICKER.START-DATE-PLACEHOLDER",
279
- defaultMessage: 'Start date'
280
- }),
281
- thisMonth: formatMessage({
282
- id: "DS.DATE-RANGE-PICKER.THIS-MONTH",
283
- defaultMessage: 'This month'
284
- }),
285
- thisWeek: formatMessage({
286
- id: "DS.DATE-RANGE-PICKER.THIS-WEEK",
287
- defaultMessage: 'This week'
288
- }),
289
- timestampLast: formatMessage({
290
- id: "DS.DATE-RANGE-PICKER.TIMESTAMP-LAST",
291
- defaultMessage: 'Last'
292
- }),
293
- timestampNext: formatMessage({
294
- id: "DS.DATE-RANGE-PICKER.TIMESTAMP-NEXT",
295
- defaultMessage: 'Next'
296
- }),
297
- timestampTill: formatMessage({
298
- id: "DS.DATE-RANGE-PICKER.TIMESTAMP-TILL",
299
- defaultMessage: 'till'
300
- }),
301
- today: formatMessage({
302
- id: "DS.DATE-RANGE-PICKER.TODAY",
303
- defaultMessage: 'Today'
304
- }),
305
- tomorrow: formatMessage({
306
- id: "DS.DATE-RANGE-PICKER.TOMORROW",
307
- defaultMessage: 'Tomorrow'
308
- }),
309
- weeks: formatMessage({
310
- id: "DS.DATE-RANGE-PICKER.WEEKS",
311
- defaultMessage: 'Weeks'
312
- }),
313
- years: formatMessage({
314
- id: "DS.DATE-RANGE-PICKER.YEARS",
315
- defaultMessage: 'Years'
316
- }),
317
- yesterday: formatMessage({
318
- id: "DS.DATE-RANGE-PICKER.YESTERDAY",
319
- defaultMessage: 'Yesterday'
320
- }),
321
- range: formatMessage({
322
- id: "DS.DATE-RANGE-PICKER.RANGE",
323
- defaultMessage: 'Range'
324
- }),
325
- hour: formatMessage({
326
- id: "DS.DATE-RANGE-PICKER.HOUR",
327
- defaultMessage: 'Hour'
328
- })
329
- },
330
- datePicker: {
331
- apply: formatMessage({
332
- id: 'DS.FACTORS.DATE_PICKER.APPLY',
333
- defaultMessage: 'Apply'
334
- }),
335
- clearTooltip: formatMessage({
336
- id: 'DS.FACTORS.DATE_PICKER.CLEAR_TOOLTIP',
337
- defaultMessage: 'Clear'
338
- }),
339
- inputPlaceholder: formatMessage({
340
- id: 'DS.FACTORS.DATE_PICKER.INPUT_PLACEHOLDER',
341
- defaultMessage: 'Select date'
342
- }),
343
- now: formatMessage({
344
- id: 'DS.FACTORS.DATE_PICKER.NOW',
345
- defaultMessage: 'Now'
346
- })
347
- },
348
- dynamicKey: {
349
- keyPlaceholder: formatMessage({
350
- id: 'DS.FACTORS.DYNAMIC_KEY.KEY_PLACEHOLDER',
351
- defaultMessage: 'Key'
352
- }),
353
- valuePlaceholder: formatMessage({
354
- id: 'DS.FACTORS.DYNAMIC_KEY.VALUE_PLACEHOLDER',
355
- defaultMessage: 'Value'
356
- })
357
- },
358
- formula: {
359
- buttonPlaceholder: formatMessage({
360
- id: 'DS.FACTORS.FORMULA.BUTTON_PLACEHOLDER',
361
- defaultMessage: 'Formula'
362
- }),
363
- defaultName: formatMessage({
364
- id: 'DS.FACTORS.FORMULA.DEFAULT_NAME',
365
- defaultMessage: 'Formula'
366
- })
367
- },
368
- parameter: {
369
- searchPlaceholder: formatMessage({
370
- id: 'DS.FACTORS.PARAMETER.SEARCH_PLACEHOLDER',
371
- defaultMessage: 'Search'
372
- }),
373
- noResults: formatMessage({
374
- id: 'DS.FACTORS.PARAMETER.NO_RESULTS',
375
- defaultMessage: 'No results'
376
- }),
377
- loadingParameter: formatMessage({
378
- id: 'DS.FACTORS.PARAMETER.LOADING_PARAMETERS',
379
- defaultMessage: 'Loading parameters'
380
- }),
381
- showMore: formatMessage({
382
- id: 'DS.FACTORS.PARAMETER.SHOW_MORE',
383
- defaultMessage: 'Show more'
384
- }),
385
- recentItemsGroupName: formatMessage({
386
- id: 'DS.FACTORS.PARAMETER.RECENT',
387
- defaultMessage: 'Recent'
388
- }),
389
- allItemsGroupName: formatMessage({
390
- id: 'DS.FACTORS.PARAMETER.ALL',
391
- defaultMessage: 'All'
392
- })
393
- },
394
- valuePlaceholder: formatMessage({
395
- id: 'DS.FACTORS.VALUE_PLACEHOLDER',
396
- defaultMessage: 'Value'
397
- }),
398
- modalApply: formatMessage({
399
- id: 'DS.FACTORS.MODAL_APPLY',
400
- defaultMessage: 'Apply'
401
- }),
402
- modalCancel: formatMessage({
403
- id: 'DS.FACTORS.MODAL_CANCEL',
404
- defaultMessage: 'Cancel'
405
- }),
406
- modalTitle: formatMessage({
407
- id: 'DS.FACTORS.MODAL_TITLE',
408
- defaultMessage: 'Value'
409
- }),
410
- factorTypes: {
411
- text: formatMessage({
412
- id: 'DS.FACTORS.FACTOR_TYPES.TEXT',
413
- defaultMessage: 'Text'
414
- }),
415
- number: formatMessage({
416
- id: 'DS.FACTORS.FACTOR_TYPES.NUMBER',
417
- defaultMessage: 'Number'
418
- }),
419
- parameter: formatMessage({
420
- id: 'DS.FACTORS.FACTOR_TYPES.PARAMETER',
421
- defaultMessage: 'Parameter'
422
- }),
423
- contextParameter: formatMessage({
424
- id: 'DS.FACTORS.FACTOR_TYPES.CONTEXT_PARAMETER',
425
- defaultMessage: 'Context parameter'
426
- }),
427
- dynamicKey: formatMessage({
428
- id: 'DS.FACTORS.FACTOR_TYPES.DYNAMIC_KEY',
429
- defaultMessage: 'Dynamic key'
430
- }),
431
- formula: formatMessage({
432
- id: 'DS.FACTORS.FACTOR_TYPES.FORMULA',
433
- defaultMessage: 'Formula'
434
- }),
435
- array: formatMessage({
436
- id: 'DS.FACTORS.FACTOR_TYPES.ARRAY',
437
- defaultMessage: 'Array'
438
- }),
439
- date: formatMessage({
440
- id: 'DS.FACTORS.FACTOR_TYPES.DATE',
441
- defaultMessage: 'Date'
442
- }),
443
- dateRange: formatMessage({
444
- id: 'DS.FACTORS.FACTOR_TYPES.DATE_RANGE',
445
- defaultMessage: 'Date range'
446
- })
447
- }
448
- }, texts);
449
- }, [texts, formatMessage]);
96
+ var allTexts = useTexts(texts);
450
97
  var factorType = useMemo(function () {
451
98
  return selectedFactorType || defaultFactorType;
452
99
  }, [selectedFactorType, defaultFactorType]);
@@ -459,7 +106,7 @@ var Factors = function Factors(_ref) {
459
106
  withoutTypeSelector: withoutTypeSelector,
460
107
  className: "ds-factors ds-factors-" + factorType
461
108
  }, !withoutTypeSelector && setSelectedFactorType && /*#__PURE__*/React.createElement(FactorTypeSelector, {
462
- texts: text.factorTypes,
109
+ texts: allTexts.factorTypes,
463
110
  selectedFactorType: factorType,
464
111
  setSelectedFactorType: setSelectedFactorType,
465
112
  selectedFactor: selectedFactor,
@@ -477,7 +124,7 @@ var Factors = function Factors(_ref) {
477
124
  autocompleteText: autocompleteText,
478
125
  withoutTypeSelector: withoutTypeSelector,
479
126
  formulaEditor: formulaEditor,
480
- texts: text,
127
+ texts: allTexts,
481
128
  opened: opened,
482
129
  inputProps: inputProps,
483
130
  loading: loading,
@@ -5,8 +5,9 @@ import type { MenuItemProps } from '@synerise/ds-menu';
5
5
  import type { AutoResizeProp } from '@synerise/ds-input';
6
6
  import type { InformationCardProps } from '@synerise/ds-information-card';
7
7
  import type { ListItemProps } from '@synerise/ds-list-item';
8
+ import type { LiteralStringUnion, DeepPartial } from '@synerise/ds-utils';
8
9
  export declare const ALL_FACTOR_TYPES: readonly ["text", "number", "parameter", "contextParameter", "dynamicKey", "formula", "array", "date", "dateRange"];
9
- export type FactorType = typeof ALL_FACTOR_TYPES[number] | string;
10
+ export type FactorType = LiteralStringUnion<typeof ALL_FACTOR_TYPES[number]>;
10
11
  export type DefinedFactorTypes = typeof ALL_FACTOR_TYPES[number];
11
12
  export type DynamicKeyValueType = {
12
13
  key: ReactText;
@@ -51,7 +52,7 @@ export type SelectedFactorType = {
51
52
  input: ElementType;
52
53
  };
53
54
  export type FactorsTexts = {
54
- dateRangePicker: Partial<DateRangeTexts>;
55
+ dateRangePicker: DateRangeTexts;
55
56
  datePicker: {
56
57
  apply: string;
57
58
  clearTooltip: string;
@@ -78,7 +79,7 @@ export type FactorsTexts = {
78
79
  modalApply: string;
79
80
  modalCancel: string;
80
81
  modalTitle: string;
81
- factorTypes?: {
82
+ factorTypes: {
82
83
  [k in DefinedFactorTypes]: string;
83
84
  };
84
85
  };
@@ -97,7 +98,7 @@ export type FactorsProps = {
97
98
  onDeactivate?: () => void;
98
99
  onChangeValue: (value: FactorValueType) => void;
99
100
  value: FactorValueType;
100
- textType?: 'autocomplete' | 'expansible' | 'default' | string;
101
+ textType?: LiteralStringUnion<'autocomplete' | 'expansible' | 'default'>;
101
102
  autoResize?: AutoResizeProp;
102
103
  autocompleteText?: {
103
104
  options: string[];
@@ -119,7 +120,7 @@ export type FactorsProps = {
119
120
  };
120
121
  onParamsClick?: () => void;
121
122
  formulaEditor?: ReactNode;
122
- texts?: Partial<FactorsTexts>;
123
+ texts?: DeepPartial<FactorsTexts>;
123
124
  opened?: boolean;
124
125
  allowClear?: boolean;
125
126
  loading?: boolean;
@@ -0,0 +1,3 @@
1
+ import { DeepPartial } from '@synerise/ds-utils';
2
+ import type { FactorsTexts } from '../Factors.types';
3
+ export declare const useTexts: (defaultTexts?: DeepPartial<FactorsTexts>) => FactorsTexts;
@@ -0,0 +1,131 @@
1
+ import { useMemo } from 'react';
2
+ import { useIntl } from 'react-intl';
3
+ import { merge } from 'lodash';
4
+ import { utils as dateRangePickerUtils } from '@synerise/ds-date-range-picker';
5
+ export var useTexts = function useTexts(defaultTexts) {
6
+ var intl = useIntl();
7
+ var texts = useMemo(function () {
8
+ return merge({
9
+ dateRangePicker: dateRangePickerUtils.getDefaultTexts(intl),
10
+ datePicker: {
11
+ apply: intl.formatMessage({
12
+ id: 'DS.FACTORS.DATE_PICKER.APPLY',
13
+ defaultMessage: 'Apply'
14
+ }),
15
+ clearTooltip: intl.formatMessage({
16
+ id: 'DS.FACTORS.DATE_PICKER.CLEAR_TOOLTIP',
17
+ defaultMessage: 'Clear'
18
+ }),
19
+ inputPlaceholder: intl.formatMessage({
20
+ id: 'DS.FACTORS.DATE_PICKER.INPUT_PLACEHOLDER',
21
+ defaultMessage: 'Select date'
22
+ }),
23
+ now: intl.formatMessage({
24
+ id: 'DS.FACTORS.DATE_PICKER.NOW',
25
+ defaultMessage: 'Now'
26
+ })
27
+ },
28
+ dynamicKey: {
29
+ keyPlaceholder: intl.formatMessage({
30
+ id: 'DS.FACTORS.DYNAMIC_KEY.KEY_PLACEHOLDER',
31
+ defaultMessage: 'Key'
32
+ }),
33
+ valuePlaceholder: intl.formatMessage({
34
+ id: 'DS.FACTORS.DYNAMIC_KEY.VALUE_PLACEHOLDER',
35
+ defaultMessage: 'Value'
36
+ })
37
+ },
38
+ formula: {
39
+ buttonPlaceholder: intl.formatMessage({
40
+ id: 'DS.FACTORS.FORMULA.BUTTON_PLACEHOLDER',
41
+ defaultMessage: 'Formula'
42
+ }),
43
+ defaultName: intl.formatMessage({
44
+ id: 'DS.FACTORS.FORMULA.DEFAULT_NAME',
45
+ defaultMessage: 'Formula'
46
+ })
47
+ },
48
+ parameter: {
49
+ searchPlaceholder: intl.formatMessage({
50
+ id: 'DS.FACTORS.PARAMETER.SEARCH_PLACEHOLDER',
51
+ defaultMessage: 'Search'
52
+ }),
53
+ noResults: intl.formatMessage({
54
+ id: 'DS.FACTORS.PARAMETER.NO_RESULTS',
55
+ defaultMessage: 'No results'
56
+ }),
57
+ loadingParameter: intl.formatMessage({
58
+ id: 'DS.FACTORS.PARAMETER.LOADING_PARAMETERS',
59
+ defaultMessage: 'Loading parameters'
60
+ }),
61
+ showMore: intl.formatMessage({
62
+ id: 'DS.FACTORS.PARAMETER.SHOW_MORE',
63
+ defaultMessage: 'Show more'
64
+ }),
65
+ recentItemsGroupName: intl.formatMessage({
66
+ id: 'DS.FACTORS.PARAMETER.RECENT',
67
+ defaultMessage: 'Recent'
68
+ }),
69
+ allItemsGroupName: intl.formatMessage({
70
+ id: 'DS.FACTORS.PARAMETER.ALL',
71
+ defaultMessage: 'All'
72
+ })
73
+ },
74
+ valuePlaceholder: intl.formatMessage({
75
+ id: 'DS.FACTORS.VALUE_PLACEHOLDER',
76
+ defaultMessage: 'Value'
77
+ }),
78
+ modalApply: intl.formatMessage({
79
+ id: 'DS.FACTORS.MODAL_APPLY',
80
+ defaultMessage: 'Apply'
81
+ }),
82
+ modalCancel: intl.formatMessage({
83
+ id: 'DS.FACTORS.MODAL_CANCEL',
84
+ defaultMessage: 'Cancel'
85
+ }),
86
+ modalTitle: intl.formatMessage({
87
+ id: 'DS.FACTORS.MODAL_TITLE',
88
+ defaultMessage: 'Value'
89
+ }),
90
+ factorTypes: {
91
+ text: intl.formatMessage({
92
+ id: 'DS.FACTORS.FACTOR_TYPES.TEXT',
93
+ defaultMessage: 'Text'
94
+ }),
95
+ number: intl.formatMessage({
96
+ id: 'DS.FACTORS.FACTOR_TYPES.NUMBER',
97
+ defaultMessage: 'Number'
98
+ }),
99
+ parameter: intl.formatMessage({
100
+ id: 'DS.FACTORS.FACTOR_TYPES.PARAMETER',
101
+ defaultMessage: 'Parameter'
102
+ }),
103
+ contextParameter: intl.formatMessage({
104
+ id: 'DS.FACTORS.FACTOR_TYPES.CONTEXT_PARAMETER',
105
+ defaultMessage: 'Context parameter'
106
+ }),
107
+ dynamicKey: intl.formatMessage({
108
+ id: 'DS.FACTORS.FACTOR_TYPES.DYNAMIC_KEY',
109
+ defaultMessage: 'Dynamic key'
110
+ }),
111
+ formula: intl.formatMessage({
112
+ id: 'DS.FACTORS.FACTOR_TYPES.FORMULA',
113
+ defaultMessage: 'Formula'
114
+ }),
115
+ array: intl.formatMessage({
116
+ id: 'DS.FACTORS.FACTOR_TYPES.ARRAY',
117
+ defaultMessage: 'Array'
118
+ }),
119
+ date: intl.formatMessage({
120
+ id: 'DS.FACTORS.FACTOR_TYPES.DATE',
121
+ defaultMessage: 'Date'
122
+ }),
123
+ dateRange: intl.formatMessage({
124
+ id: 'DS.FACTORS.FACTOR_TYPES.DATE_RANGE',
125
+ defaultMessage: 'Date range'
126
+ })
127
+ }
128
+ }, defaultTexts);
129
+ }, [defaultTexts, intl]);
130
+ return texts;
131
+ };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { default, factorTypes } from './Factors';
2
2
  export { ALL_FACTOR_TYPES } from './Factors.types';
3
- export type { FactorsProps, ParameterValueType, InputProps, FactorValueType } from './Factors.types';
3
+ export type { FactorsProps, ParameterValueType, ParameterItem, ParameterGroup, InputProps, FactorType, FactorValueType, DynamicKeyValueType, } from './Factors.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-factors",
3
- "version": "0.27.1",
3
+ "version": "0.27.2",
4
4
  "description": "Factors UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,28 +34,27 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-autocomplete": "^0.8.27",
38
- "@synerise/ds-badge": "^0.8.18",
39
- "@synerise/ds-button": "^0.21.18",
40
- "@synerise/ds-date-picker": "^0.13.1",
41
- "@synerise/ds-date-range-picker": "^0.31.1",
42
- "@synerise/ds-dropdown": "^0.18.23",
43
- "@synerise/ds-icon": "^0.66.4",
44
- "@synerise/ds-information-card": "^0.6.1",
45
- "@synerise/ds-inline-edit": "^0.9.0",
46
- "@synerise/ds-input": "^0.24.13",
47
- "@synerise/ds-input-number": "^0.10.14",
48
- "@synerise/ds-list-item": "^0.4.18",
49
- "@synerise/ds-menu": "^0.20.5",
50
- "@synerise/ds-modal": "^0.17.50",
51
- "@synerise/ds-result": "^0.7.13",
52
- "@synerise/ds-scrollbar": "^0.11.18",
53
- "@synerise/ds-skeleton": "^0.6.17",
54
- "@synerise/ds-tabs": "^0.17.6",
55
- "@synerise/ds-tooltip": "^0.14.48",
56
- "@synerise/ds-utils": "^0.31.1",
37
+ "@synerise/ds-autocomplete": "^0.8.28",
38
+ "@synerise/ds-badge": "^0.8.19",
39
+ "@synerise/ds-button": "^0.21.19",
40
+ "@synerise/ds-date-picker": "^0.13.2",
41
+ "@synerise/ds-date-range-picker": "^0.31.2",
42
+ "@synerise/ds-dropdown": "^0.18.24",
43
+ "@synerise/ds-icon": "^0.67.0",
44
+ "@synerise/ds-information-card": "^0.6.2",
45
+ "@synerise/ds-inline-edit": "^0.9.1",
46
+ "@synerise/ds-input": "^0.24.14",
47
+ "@synerise/ds-input-number": "^0.10.15",
48
+ "@synerise/ds-list-item": "^0.4.19",
49
+ "@synerise/ds-menu": "^0.20.6",
50
+ "@synerise/ds-modal": "^0.17.51",
51
+ "@synerise/ds-result": "^0.7.14",
52
+ "@synerise/ds-scrollbar": "^0.11.19",
53
+ "@synerise/ds-skeleton": "^0.6.18",
54
+ "@synerise/ds-tabs": "^0.17.7",
55
+ "@synerise/ds-tooltip": "^0.14.49",
56
+ "@synerise/ds-utils": "^0.31.2",
57
57
  "lodash": "^4.17.21",
58
- "react-intl": "6.8.4",
59
58
  "react-window": "1.8.5",
60
59
  "uuid": "^8.3.2"
61
60
  },
@@ -63,7 +62,8 @@
63
62
  "@synerise/ds-core": "*",
64
63
  "antd": "4.7.0",
65
64
  "react": ">=16.9.0 <= 17.0.2",
65
+ "react-intl": ">=3.12.0 <= 6.8",
66
66
  "styled-components": "5.0.1"
67
67
  },
68
- "gitHead": "8d26191fc0475407e0691b9b183761ad3cd7c87d"
68
+ "gitHead": "05f083c767e2cec3c2f91c9475aee89852a77d6c"
69
69
  }