@infomaximum/widget-sdk 4.0.0 → 4.1.0

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/dist/index.d.ts CHANGED
@@ -39,7 +39,8 @@ declare enum EControlType {
39
39
  filter = "filter",
40
40
  actionOnClick = "actionOnClick",
41
41
  eventsPicker = "eventsPicker",
42
- size = "size"
42
+ size = "size",
43
+ formatting = "formatting"
43
44
  }
44
45
  /** Конфигурация элемента управления настройкой */
45
46
  interface IControlRecord<Settings extends object, Value, ControlType = EControlType> {
@@ -250,6 +251,35 @@ declare enum EFormattingPresets {
250
251
  interface IWidgetFormatting {
251
252
  getFormattedValue: (value: string, formatType: EFormatTypes, formatting: EFormattingPresets, formatTemplate: TNullable<string>) => string;
252
253
  }
254
+ declare const formattingConfig: {
255
+ readonly availableFormatsByDataType: {
256
+ OTHER: EFormatTypes[];
257
+ STRING: EFormatTypes[];
258
+ FLOAT: EFormatTypes[];
259
+ INTEGER: EFormatTypes[];
260
+ DATE: EFormatTypes[];
261
+ DATETIME: EFormatTypes[];
262
+ DATETIME64: EFormatTypes[];
263
+ BOOLEAN: EFormatTypes[];
264
+ };
265
+ readonly availableFormattingByFormat: {
266
+ DATE: EFormattingPresets[];
267
+ DATETIME: EFormattingPresets[];
268
+ DAY_OF_WEEK: EFormattingPresets[];
269
+ MONTH: EFormattingPresets[];
270
+ NUMBER: EFormattingPresets[];
271
+ DURATION: EFormattingPresets[];
272
+ HOUR: EFormattingPresets[];
273
+ MONTH_YEAR: EFormattingPresets[];
274
+ QUARTER: EFormattingPresets[];
275
+ QUARTER_YEAR: EFormattingPresets[];
276
+ STRING: never[];
277
+ DAY_OF_MONTH: never[];
278
+ WEEK: never[];
279
+ YEAR: never[];
280
+ BOOLEAN: never[];
281
+ };
282
+ };
253
283
 
254
284
  declare enum ELastTimeUnit {
255
285
  DAYS = "DAYS",
@@ -1401,6 +1431,9 @@ interface IDivePanelDescription<Settings extends object, GroupSettings extends I
1401
1431
  interface IPanelDescriptionCreator<Settings extends IBaseWidgetSettings, GroupSettings extends IGroupSettings> {
1402
1432
  (context: IGlobalContext, panelSettings: Settings, calculatorFactory: ICalculatorFactory): IPanelDescription<Settings, GroupSettings>;
1403
1433
  }
1434
+ declare enum ESystemRecordKey {
1435
+ formatting = "formatting"
1436
+ }
1404
1437
 
1405
1438
  interface IWidgetPlaceholderController {
1406
1439
  setError(value: Error | null): void;
@@ -1731,4 +1764,4 @@ declare global {
1731
1764
  }
1732
1765
  }
1733
1766
 
1734
- export { EActionTypes, ECalculatorFilterMethods, EColorMode, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionGoToUrl, type IActionRunScript, type IActionScript, type IActionUpdateVariable, type IAddButtonSelectOption, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, type IAppearanceSettings, type IAutoIdentifiedArrayItem, type IBaseDimensionsAndMeasuresCalculator, type IBaseDimensionsAndMeasuresCalculatorInput, type IBaseDimensionsAndMeasuresCalculatorOutput, type IBaseWidgetSettings, type ICalculator, type ICalculatorDimensionInput, type ICalculatorDimensionOutput, type ICalculatorFactory, type ICalculatorFilter, type ICalculatorIndicatorInput, type ICalculatorIndicatorOutput, type ICalculatorMeasureInput, type ICalculatorMeasureOutput, type IColoredValue, type ICommonDimensions, type ICommonMeasures, type ICommonState, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayPredicate, type IDisplayRule, type IDivePanelDescription, type IDividerRecord, type IEdge, type IExportColumnOrder, type IFillSettings, type IFormulaFilterValue, type IGeneralCalculator, type IGeneralCalculatorExportInput, type IGeneralCalculatorInput, type IGeneralCalculatorOutput, type IGlobalContext, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type IIndicatorLink, type IInitialSettings, type ILens, type IMarkdownMeasure, type IMeasureAddButtonProps, type IPanelDescription, type IPanelDescriptionCreator, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRange, type ISelectBranchOption, type ISelectDividerOption, type ISelectGroupOption, type ISelectLeafOption, type ISelectOption, type ISelectSystemOption, type ISortOrder, type ISortingAddButtonProps, type IStagesFilterValue, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type ITypeCalculatorOutputItem, type IVertex, type IViewContext, type IViewInputValue, type IWidget, type IWidgetAction, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetIndicator, type IWidgetIndicatorAddButtonProps, type IWidgetMeasure, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionsOnClick, type TAddButton, type TBoundedContentWithIndicator, type TColor, type TColorRule, type TColumnIndicatorValue, type TContextMenu, type TContextMenuButton, type TContextMenuButtonActions, type TContextMenuButtonApply, type TContextMenuButtonClose, type TContextMenuButtonCustom, type TContextMenuButtonGroup, type TContextMenuButtonOptions, type TContextMenuList, type TContextMenuPositionUnit, type TContextMenuRow, type TCustomAddButtonSelectOption, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TExtendedFormulaFilterValue, type TFiltrationMode, type TGroupLevelRecord, type TLaunchActionParams, type TMeasureAddButtonSelectOption, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchOptions, type TSelectivePartial, type TSortDirection, type TSystemVariable, type TUpdateSelection, type TValuePath, type TWidgetActionParameter, type TWidgetContainer, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dashboardLinkRegExp, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isExecuteScriptActionValid, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseIndicatorLink, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
1767
+ export { EActionTypes, ECalculatorFilterMethods, EColorMode, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionGoToUrl, type IActionRunScript, type IActionScript, type IActionUpdateVariable, type IAddButtonSelectOption, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, type IAppearanceSettings, type IAutoIdentifiedArrayItem, type IBaseDimensionsAndMeasuresCalculator, type IBaseDimensionsAndMeasuresCalculatorInput, type IBaseDimensionsAndMeasuresCalculatorOutput, type IBaseWidgetSettings, type ICalculator, type ICalculatorDimensionInput, type ICalculatorDimensionOutput, type ICalculatorFactory, type ICalculatorFilter, type ICalculatorIndicatorInput, type ICalculatorIndicatorOutput, type ICalculatorMeasureInput, type ICalculatorMeasureOutput, type IColoredValue, type ICommonDimensions, type ICommonMeasures, type ICommonState, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayPredicate, type IDisplayRule, type IDivePanelDescription, type IDividerRecord, type IEdge, type IExportColumnOrder, type IFillSettings, type IFormulaFilterValue, type IGeneralCalculator, type IGeneralCalculatorExportInput, type IGeneralCalculatorInput, type IGeneralCalculatorOutput, type IGlobalContext, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type IIndicatorLink, type IInitialSettings, type ILens, type IMarkdownMeasure, type IMeasureAddButtonProps, type IPanelDescription, type IPanelDescriptionCreator, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRange, type ISelectBranchOption, type ISelectDividerOption, type ISelectGroupOption, type ISelectLeafOption, type ISelectOption, type ISelectSystemOption, type ISortOrder, type ISortingAddButtonProps, type IStagesFilterValue, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type ITypeCalculatorOutputItem, type IVertex, type IViewContext, type IViewInputValue, type IWidget, type IWidgetAction, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetIndicator, type IWidgetIndicatorAddButtonProps, type IWidgetMeasure, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionsOnClick, type TAddButton, type TBoundedContentWithIndicator, type TColor, type TColorRule, type TColumnIndicatorValue, type TContextMenu, type TContextMenuButton, type TContextMenuButtonActions, type TContextMenuButtonApply, type TContextMenuButtonClose, type TContextMenuButtonCustom, type TContextMenuButtonGroup, type TContextMenuButtonOptions, type TContextMenuList, type TContextMenuPositionUnit, type TContextMenuRow, type TCustomAddButtonSelectOption, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TExtendedFormulaFilterValue, type TFiltrationMode, type TGroupLevelRecord, type TLaunchActionParams, type TMeasureAddButtonSelectOption, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchOptions, type TSelectivePartial, type TSortDirection, type TSystemVariable, type TUpdateSelection, type TValuePath, type TWidgetActionParameter, type TWidgetContainer, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dashboardLinkRegExp, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isExecuteScriptActionValid, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseIndicatorLink, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
package/dist/index.esm.js CHANGED
@@ -328,6 +328,157 @@ var EFormattingPresets;
328
328
  EFormattingPresets["R[-]YYYY"] = "R[-]YYYY";
329
329
  EFormattingPresets["R[-]YY"] = "R[-]YY";
330
330
  })(EFormattingPresets || (EFormattingPresets = {}));
331
+ var formattingConfig = {
332
+ get availableFormatsByDataType() {
333
+ var _a;
334
+ return _a = {},
335
+ _a[ESimpleDataType.OTHER] = [EFormatTypes.STRING],
336
+ _a[ESimpleDataType.STRING] = [EFormatTypes.STRING],
337
+ _a[ESimpleDataType.FLOAT] = [EFormatTypes.NUMBER, EFormatTypes.DURATION],
338
+ _a[ESimpleDataType.INTEGER] = [
339
+ EFormatTypes.NUMBER,
340
+ EFormatTypes.DURATION,
341
+ EFormatTypes.QUARTER_YEAR,
342
+ EFormatTypes.MONTH_YEAR,
343
+ EFormatTypes.MONTH,
344
+ EFormatTypes.DAY_OF_WEEK,
345
+ ],
346
+ _a[ESimpleDataType.DATE] = [EFormatTypes.DATE],
347
+ _a[ESimpleDataType.DATETIME] = [EFormatTypes.DATETIME],
348
+ _a[ESimpleDataType.DATETIME64] = [EFormatTypes.DATETIME],
349
+ _a[ESimpleDataType.BOOLEAN] = [EFormatTypes.BOOLEAN],
350
+ _a;
351
+ },
352
+ get availableFormattingByFormat() {
353
+ var _a;
354
+ return _a = {},
355
+ _a[EFormatTypes.DATE] = [
356
+ EFormattingPresets.AUTO,
357
+ EFormattingPresets["DD.MM.YY"],
358
+ EFormattingPresets["DD.MM.YYYY"],
359
+ EFormattingPresets["YY-MM-DD"],
360
+ EFormattingPresets["YYYY-MM-DD"],
361
+ EFormattingPresets["MM-DD-YY"],
362
+ EFormattingPresets["MM-DD-YYYY"],
363
+ EFormattingPresets["MM.DD.YY"],
364
+ EFormattingPresets["MM.DD.YYYY"],
365
+ EFormattingPresets["DD MMM YY"],
366
+ EFormattingPresets["DD MMM YYYY"],
367
+ EFormattingPresets["DD MMMM YY"],
368
+ EFormattingPresets["DD MMMM YYYY"],
369
+ EFormattingPresets["DD/MM/YY"],
370
+ EFormattingPresets["DD/MM/YYYY"],
371
+ EFormattingPresets["MM/DD/YY"],
372
+ EFormattingPresets["MM/DD/YYYY"],
373
+ EFormattingPresets["MMMM DD, YY"],
374
+ EFormattingPresets["MMMM DD, YYYY"],
375
+ EFormattingPresets.CUSTOM,
376
+ ],
377
+ _a[EFormatTypes.DATETIME] = [
378
+ EFormattingPresets.AUTO,
379
+ EFormattingPresets["DD.MM.YY"],
380
+ EFormattingPresets["DD.MM.YY, HH:mm"],
381
+ EFormattingPresets["DD.MM.YYYY"],
382
+ EFormattingPresets["DD.MM.YYYY, HH:mm"],
383
+ EFormattingPresets["YY-MM-DD"],
384
+ EFormattingPresets["YYYY-MM-DD, HH:mm"],
385
+ EFormattingPresets["YYYY-MM-DD"],
386
+ EFormattingPresets["YYYY-MM-DD HH:mm"],
387
+ EFormattingPresets["MM-DD-YY"],
388
+ EFormattingPresets["MM-DD-YY, hh:mm a"],
389
+ EFormattingPresets["MM-DD-YYYY"],
390
+ EFormattingPresets["MM-DD-YYYY, hh:mm a"],
391
+ EFormattingPresets["MM.DD.YY"],
392
+ EFormattingPresets["MM.DD.YY, hh:mm a"],
393
+ EFormattingPresets["MM.DD.YYYY"],
394
+ EFormattingPresets["MM.DD.YYYY, hh:mm a"],
395
+ EFormattingPresets["DD MMM YY"],
396
+ EFormattingPresets["DD MMM YY, HH:mm"],
397
+ EFormattingPresets["DD MMM YYYY"],
398
+ EFormattingPresets["DD MMM YYYY, HH:mm"],
399
+ EFormattingPresets["DD MMMM YY"],
400
+ EFormattingPresets["DD MMMM YY, HH:mm"],
401
+ EFormattingPresets["DD MMMM YYYY"],
402
+ EFormattingPresets["DD MMMM YYYY, HH:mm"],
403
+ EFormattingPresets["DD/MM/YY"],
404
+ EFormattingPresets["DD/MM/YY, HH:mm"],
405
+ EFormattingPresets["DD/MM/YYYY"],
406
+ EFormattingPresets["DD/MM/YYYY, HH:mm"],
407
+ EFormattingPresets["MM/DD/YY"],
408
+ EFormattingPresets["MM/DD/YY, hh:mm a"],
409
+ EFormattingPresets["MM/DD/YYYY"],
410
+ EFormattingPresets["MM/DD/YYYY, hh:mm a"],
411
+ EFormattingPresets["MMMM DD, YY"],
412
+ EFormattingPresets["MMMM DD, YY, HH:mm"],
413
+ EFormattingPresets["MMMM DD, YYYY"],
414
+ EFormattingPresets["MMMM DD, YYYY, HH:mm"],
415
+ EFormattingPresets.CUSTOM,
416
+ ],
417
+ _a[EFormatTypes.DAY_OF_WEEK] = [
418
+ EFormattingPresets.AUTO,
419
+ EFormattingPresets.DD,
420
+ EFormattingPresets.D,
421
+ EFormattingPresets.DDDD,
422
+ ],
423
+ _a[EFormatTypes.MONTH] = [
424
+ EFormattingPresets.AUTO,
425
+ EFormattingPresets.MMM,
426
+ EFormattingPresets.MM,
427
+ EFormattingPresets.MMMM,
428
+ ],
429
+ _a[EFormatTypes.NUMBER] = [
430
+ EFormattingPresets.AUTO,
431
+ EFormattingPresets["#,##x"],
432
+ EFormattingPresets["#,##x.x"],
433
+ EFormattingPresets["#,##x.xx"],
434
+ EFormattingPresets["x[%]"],
435
+ EFormattingPresets["x.x[%]"],
436
+ EFormattingPresets["zx.xx[%]"],
437
+ EFormattingPresets["[$]x"],
438
+ EFormattingPresets.CUSTOM,
439
+ ],
440
+ _a[EFormatTypes.DURATION] = [
441
+ EFormattingPresets.AUTO,
442
+ EFormattingPresets.d,
443
+ EFormattingPresets.h,
444
+ EFormattingPresets.CUSTOM,
445
+ ],
446
+ _a[EFormatTypes.HOUR] = [
447
+ EFormattingPresets.AUTO,
448
+ EFormattingPresets.HH,
449
+ EFormattingPresets["hh a"],
450
+ ],
451
+ _a[EFormatTypes.MONTH_YEAR] = [
452
+ EFormattingPresets.AUTO,
453
+ EFormattingPresets["MMM, YYYY"],
454
+ EFormattingPresets["MMM, YY"],
455
+ EFormattingPresets["MM.YYYY"],
456
+ EFormattingPresets["MM.YY"],
457
+ EFormattingPresets["MMMM YYYY"],
458
+ EFormattingPresets["MMMM YY"],
459
+ EFormattingPresets.CUSTOM,
460
+ ],
461
+ _a[EFormatTypes.QUARTER] = [
462
+ EFormattingPresets.AUTO,
463
+ EFormattingPresets["[Q]q"],
464
+ EFormattingPresets.R,
465
+ ],
466
+ _a[EFormatTypes.QUARTER_YEAR] = [
467
+ EFormattingPresets.AUTO,
468
+ EFormattingPresets["[Q]q[-]YYYY"],
469
+ EFormattingPresets["[Q]q[-]YY"],
470
+ EFormattingPresets["R[-]YYYY"],
471
+ EFormattingPresets["R[-]YY"],
472
+ EFormattingPresets.CUSTOM,
473
+ ],
474
+ _a[EFormatTypes.STRING] = [],
475
+ _a[EFormatTypes.DAY_OF_MONTH] = [],
476
+ _a[EFormatTypes.WEEK] = [],
477
+ _a[EFormatTypes.YEAR] = [],
478
+ _a[EFormatTypes.BOOLEAN] = [],
479
+ _a;
480
+ },
481
+ };
331
482
 
332
483
  var ELastTimeUnit;
333
484
  (function (ELastTimeUnit) {
@@ -1039,6 +1190,7 @@ var EControlType;
1039
1190
  EControlType["actionOnClick"] = "actionOnClick";
1040
1191
  EControlType["eventsPicker"] = "eventsPicker";
1041
1192
  EControlType["size"] = "size";
1193
+ EControlType["formatting"] = "formatting";
1042
1194
  })(EControlType || (EControlType = {}));
1043
1195
 
1044
1196
  var ESelectOptionTypes;
@@ -1054,6 +1206,11 @@ var ECustomSelectTemplates;
1054
1206
  ECustomSelectTemplates["FORMULA"] = "FORMULA";
1055
1207
  ECustomSelectTemplates["DIMENSION_GROUPS"] = "DIMENSION_GROUPS";
1056
1208
  })(ECustomSelectTemplates || (ECustomSelectTemplates = {}));
1209
+ //todo: заполнить в рамках BI-13985
1210
+ var ESystemRecordKey;
1211
+ (function (ESystemRecordKey) {
1212
+ ESystemRecordKey["formatting"] = "formatting";
1213
+ })(ESystemRecordKey || (ESystemRecordKey = {}));
1057
1214
 
1058
1215
  var findFilterByFormula = function (filters, formula) {
1059
1216
  var _a;
@@ -1190,4 +1347,4 @@ var isValidColor = function (color, globalContext) {
1190
1347
  return true;
1191
1348
  };
1192
1349
 
1193
- export { EActionTypes, ECalculatorFilterMethods, EColorMode, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dashboardLinkRegExp, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isExecuteScriptActionValid, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseIndicatorLink, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
1350
+ export { EActionTypes, ECalculatorFilterMethods, EColorMode, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dashboardLinkRegExp, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isExecuteScriptActionValid, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseIndicatorLink, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
package/dist/index.js CHANGED
@@ -329,6 +329,157 @@ exports.EFormattingPresets = void 0;
329
329
  EFormattingPresets["R[-]YYYY"] = "R[-]YYYY";
330
330
  EFormattingPresets["R[-]YY"] = "R[-]YY";
331
331
  })(exports.EFormattingPresets || (exports.EFormattingPresets = {}));
332
+ var formattingConfig = {
333
+ get availableFormatsByDataType() {
334
+ var _a;
335
+ return _a = {},
336
+ _a[exports.ESimpleDataType.OTHER] = [exports.EFormatTypes.STRING],
337
+ _a[exports.ESimpleDataType.STRING] = [exports.EFormatTypes.STRING],
338
+ _a[exports.ESimpleDataType.FLOAT] = [exports.EFormatTypes.NUMBER, exports.EFormatTypes.DURATION],
339
+ _a[exports.ESimpleDataType.INTEGER] = [
340
+ exports.EFormatTypes.NUMBER,
341
+ exports.EFormatTypes.DURATION,
342
+ exports.EFormatTypes.QUARTER_YEAR,
343
+ exports.EFormatTypes.MONTH_YEAR,
344
+ exports.EFormatTypes.MONTH,
345
+ exports.EFormatTypes.DAY_OF_WEEK,
346
+ ],
347
+ _a[exports.ESimpleDataType.DATE] = [exports.EFormatTypes.DATE],
348
+ _a[exports.ESimpleDataType.DATETIME] = [exports.EFormatTypes.DATETIME],
349
+ _a[exports.ESimpleDataType.DATETIME64] = [exports.EFormatTypes.DATETIME],
350
+ _a[exports.ESimpleDataType.BOOLEAN] = [exports.EFormatTypes.BOOLEAN],
351
+ _a;
352
+ },
353
+ get availableFormattingByFormat() {
354
+ var _a;
355
+ return _a = {},
356
+ _a[exports.EFormatTypes.DATE] = [
357
+ exports.EFormattingPresets.AUTO,
358
+ exports.EFormattingPresets["DD.MM.YY"],
359
+ exports.EFormattingPresets["DD.MM.YYYY"],
360
+ exports.EFormattingPresets["YY-MM-DD"],
361
+ exports.EFormattingPresets["YYYY-MM-DD"],
362
+ exports.EFormattingPresets["MM-DD-YY"],
363
+ exports.EFormattingPresets["MM-DD-YYYY"],
364
+ exports.EFormattingPresets["MM.DD.YY"],
365
+ exports.EFormattingPresets["MM.DD.YYYY"],
366
+ exports.EFormattingPresets["DD MMM YY"],
367
+ exports.EFormattingPresets["DD MMM YYYY"],
368
+ exports.EFormattingPresets["DD MMMM YY"],
369
+ exports.EFormattingPresets["DD MMMM YYYY"],
370
+ exports.EFormattingPresets["DD/MM/YY"],
371
+ exports.EFormattingPresets["DD/MM/YYYY"],
372
+ exports.EFormattingPresets["MM/DD/YY"],
373
+ exports.EFormattingPresets["MM/DD/YYYY"],
374
+ exports.EFormattingPresets["MMMM DD, YY"],
375
+ exports.EFormattingPresets["MMMM DD, YYYY"],
376
+ exports.EFormattingPresets.CUSTOM,
377
+ ],
378
+ _a[exports.EFormatTypes.DATETIME] = [
379
+ exports.EFormattingPresets.AUTO,
380
+ exports.EFormattingPresets["DD.MM.YY"],
381
+ exports.EFormattingPresets["DD.MM.YY, HH:mm"],
382
+ exports.EFormattingPresets["DD.MM.YYYY"],
383
+ exports.EFormattingPresets["DD.MM.YYYY, HH:mm"],
384
+ exports.EFormattingPresets["YY-MM-DD"],
385
+ exports.EFormattingPresets["YYYY-MM-DD, HH:mm"],
386
+ exports.EFormattingPresets["YYYY-MM-DD"],
387
+ exports.EFormattingPresets["YYYY-MM-DD HH:mm"],
388
+ exports.EFormattingPresets["MM-DD-YY"],
389
+ exports.EFormattingPresets["MM-DD-YY, hh:mm a"],
390
+ exports.EFormattingPresets["MM-DD-YYYY"],
391
+ exports.EFormattingPresets["MM-DD-YYYY, hh:mm a"],
392
+ exports.EFormattingPresets["MM.DD.YY"],
393
+ exports.EFormattingPresets["MM.DD.YY, hh:mm a"],
394
+ exports.EFormattingPresets["MM.DD.YYYY"],
395
+ exports.EFormattingPresets["MM.DD.YYYY, hh:mm a"],
396
+ exports.EFormattingPresets["DD MMM YY"],
397
+ exports.EFormattingPresets["DD MMM YY, HH:mm"],
398
+ exports.EFormattingPresets["DD MMM YYYY"],
399
+ exports.EFormattingPresets["DD MMM YYYY, HH:mm"],
400
+ exports.EFormattingPresets["DD MMMM YY"],
401
+ exports.EFormattingPresets["DD MMMM YY, HH:mm"],
402
+ exports.EFormattingPresets["DD MMMM YYYY"],
403
+ exports.EFormattingPresets["DD MMMM YYYY, HH:mm"],
404
+ exports.EFormattingPresets["DD/MM/YY"],
405
+ exports.EFormattingPresets["DD/MM/YY, HH:mm"],
406
+ exports.EFormattingPresets["DD/MM/YYYY"],
407
+ exports.EFormattingPresets["DD/MM/YYYY, HH:mm"],
408
+ exports.EFormattingPresets["MM/DD/YY"],
409
+ exports.EFormattingPresets["MM/DD/YY, hh:mm a"],
410
+ exports.EFormattingPresets["MM/DD/YYYY"],
411
+ exports.EFormattingPresets["MM/DD/YYYY, hh:mm a"],
412
+ exports.EFormattingPresets["MMMM DD, YY"],
413
+ exports.EFormattingPresets["MMMM DD, YY, HH:mm"],
414
+ exports.EFormattingPresets["MMMM DD, YYYY"],
415
+ exports.EFormattingPresets["MMMM DD, YYYY, HH:mm"],
416
+ exports.EFormattingPresets.CUSTOM,
417
+ ],
418
+ _a[exports.EFormatTypes.DAY_OF_WEEK] = [
419
+ exports.EFormattingPresets.AUTO,
420
+ exports.EFormattingPresets.DD,
421
+ exports.EFormattingPresets.D,
422
+ exports.EFormattingPresets.DDDD,
423
+ ],
424
+ _a[exports.EFormatTypes.MONTH] = [
425
+ exports.EFormattingPresets.AUTO,
426
+ exports.EFormattingPresets.MMM,
427
+ exports.EFormattingPresets.MM,
428
+ exports.EFormattingPresets.MMMM,
429
+ ],
430
+ _a[exports.EFormatTypes.NUMBER] = [
431
+ exports.EFormattingPresets.AUTO,
432
+ exports.EFormattingPresets["#,##x"],
433
+ exports.EFormattingPresets["#,##x.x"],
434
+ exports.EFormattingPresets["#,##x.xx"],
435
+ exports.EFormattingPresets["x[%]"],
436
+ exports.EFormattingPresets["x.x[%]"],
437
+ exports.EFormattingPresets["zx.xx[%]"],
438
+ exports.EFormattingPresets["[$]x"],
439
+ exports.EFormattingPresets.CUSTOM,
440
+ ],
441
+ _a[exports.EFormatTypes.DURATION] = [
442
+ exports.EFormattingPresets.AUTO,
443
+ exports.EFormattingPresets.d,
444
+ exports.EFormattingPresets.h,
445
+ exports.EFormattingPresets.CUSTOM,
446
+ ],
447
+ _a[exports.EFormatTypes.HOUR] = [
448
+ exports.EFormattingPresets.AUTO,
449
+ exports.EFormattingPresets.HH,
450
+ exports.EFormattingPresets["hh a"],
451
+ ],
452
+ _a[exports.EFormatTypes.MONTH_YEAR] = [
453
+ exports.EFormattingPresets.AUTO,
454
+ exports.EFormattingPresets["MMM, YYYY"],
455
+ exports.EFormattingPresets["MMM, YY"],
456
+ exports.EFormattingPresets["MM.YYYY"],
457
+ exports.EFormattingPresets["MM.YY"],
458
+ exports.EFormattingPresets["MMMM YYYY"],
459
+ exports.EFormattingPresets["MMMM YY"],
460
+ exports.EFormattingPresets.CUSTOM,
461
+ ],
462
+ _a[exports.EFormatTypes.QUARTER] = [
463
+ exports.EFormattingPresets.AUTO,
464
+ exports.EFormattingPresets["[Q]q"],
465
+ exports.EFormattingPresets.R,
466
+ ],
467
+ _a[exports.EFormatTypes.QUARTER_YEAR] = [
468
+ exports.EFormattingPresets.AUTO,
469
+ exports.EFormattingPresets["[Q]q[-]YYYY"],
470
+ exports.EFormattingPresets["[Q]q[-]YY"],
471
+ exports.EFormattingPresets["R[-]YYYY"],
472
+ exports.EFormattingPresets["R[-]YY"],
473
+ exports.EFormattingPresets.CUSTOM,
474
+ ],
475
+ _a[exports.EFormatTypes.STRING] = [],
476
+ _a[exports.EFormatTypes.DAY_OF_MONTH] = [],
477
+ _a[exports.EFormatTypes.WEEK] = [],
478
+ _a[exports.EFormatTypes.YEAR] = [],
479
+ _a[exports.EFormatTypes.BOOLEAN] = [],
480
+ _a;
481
+ },
482
+ };
332
483
 
333
484
  exports.ELastTimeUnit = void 0;
334
485
  (function (ELastTimeUnit) {
@@ -1040,6 +1191,7 @@ exports.EControlType = void 0;
1040
1191
  EControlType["actionOnClick"] = "actionOnClick";
1041
1192
  EControlType["eventsPicker"] = "eventsPicker";
1042
1193
  EControlType["size"] = "size";
1194
+ EControlType["formatting"] = "formatting";
1043
1195
  })(exports.EControlType || (exports.EControlType = {}));
1044
1196
 
1045
1197
  exports.ESelectOptionTypes = void 0;
@@ -1055,6 +1207,11 @@ exports.ECustomSelectTemplates = void 0;
1055
1207
  ECustomSelectTemplates["FORMULA"] = "FORMULA";
1056
1208
  ECustomSelectTemplates["DIMENSION_GROUPS"] = "DIMENSION_GROUPS";
1057
1209
  })(exports.ECustomSelectTemplates || (exports.ECustomSelectTemplates = {}));
1210
+ //todo: заполнить в рамках BI-13985
1211
+ exports.ESystemRecordKey = void 0;
1212
+ (function (ESystemRecordKey) {
1213
+ ESystemRecordKey["formatting"] = "formatting";
1214
+ })(exports.ESystemRecordKey || (exports.ESystemRecordKey = {}));
1058
1215
 
1059
1216
  var findFilterByFormula = function (filters, formula) {
1060
1217
  var _a;
@@ -1207,6 +1364,7 @@ exports.dimensionTemplateFormulas = dimensionTemplateFormulas;
1207
1364
  exports.escapeSpecialCharacters = escapeSpecialCharacters;
1208
1365
  exports.eventMeasureTemplateFormulas = eventMeasureTemplateFormulas;
1209
1366
  exports.fillTemplateString = fillTemplateString;
1367
+ exports.formattingConfig = formattingConfig;
1210
1368
  exports.formulaFilterMethods = formulaFilterMethods;
1211
1369
  exports.generateColumnFormula = generateColumnFormula;
1212
1370
  exports.getDimensionFormula = getDimensionFormula;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infomaximum/widget-sdk",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",