@infomaximum/widget-sdk 6.0.0-view-theme.4 → 6.0.0-view-theme.5
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 +9 -0
- package/dist/index.d.ts +110 -7
- package/dist/index.esm.js +30 -1
- package/dist/index.js +31 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [6.0.0-view-theme.5](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-view-theme.4...v6.0.0-view-theme.5) (2025-11-01)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* добавлен интерфейс ITheme [BI-15688] ([4c0821c](https://github.com/Infomaximum/widget-sdk/commit/4c0821cdee32900f6cd225da4e07b78082a243de))
|
|
11
|
+
* добавлена функция для привязки мета-информации о теме к Zod-схеме ([731fd97](https://github.com/Infomaximum/widget-sdk/commit/731fd9784a9cce1586bf14cde2f747582a61371c))
|
|
12
|
+
* удален флаг use_theme [BI-15617] ([f0fce3b](https://github.com/Infomaximum/widget-sdk/commit/f0fce3be7bcc1472fcd930f883b83f6702f839da))
|
|
13
|
+
|
|
5
14
|
## [6.0.0-view-theme.4](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-view-theme.3...v6.0.0-view-theme.4) (2025-10-24)
|
|
6
15
|
|
|
7
16
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ELanguages, TLocalizationDescription, ILocalizationProps, TExtractLocalizationParams } from '@infomaximum/localization';
|
|
2
2
|
export { ELanguages, TLocalizationDescription } from '@infomaximum/localization';
|
|
3
|
-
import { z,
|
|
3
|
+
import { z, ZodType } from 'zod';
|
|
4
4
|
export { EFilteringMethodValues } from '@infomaximum/base-filter';
|
|
5
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
5
6
|
|
|
6
7
|
type TNullable<T> = T | null | undefined;
|
|
7
8
|
type valueof<T> = T[keyof T];
|
|
@@ -115,6 +116,15 @@ declare enum EFontWeight {
|
|
|
115
116
|
NORMAL = "NORMAL",
|
|
116
117
|
BOLD = "BOLD"
|
|
117
118
|
}
|
|
119
|
+
interface IGradient {
|
|
120
|
+
startColor: string;
|
|
121
|
+
endColor: string;
|
|
122
|
+
}
|
|
123
|
+
type TTabsHorizontalAlignment = "left" | "center" | "right";
|
|
124
|
+
declare enum EHeightMode {
|
|
125
|
+
FIXED = "FIXED",
|
|
126
|
+
PERCENT = "PERCENT"
|
|
127
|
+
}
|
|
118
128
|
|
|
119
129
|
interface IWidgetTableColumn {
|
|
120
130
|
/** Имя колонки */
|
|
@@ -2430,16 +2440,16 @@ interface IWidgetMigrator<T extends TMigrationStruct = IWidgetStruct> {
|
|
|
2430
2440
|
registerProcessor(version: TVersion, processor: TMigrateProcessor<T>, type?: string, versionPath?: string): void;
|
|
2431
2441
|
}
|
|
2432
2442
|
|
|
2433
|
-
/** Используется для вывода типа настроек виджета по описанной схеме в методе `
|
|
2443
|
+
/** Используется для вывода типа настроек виджета по описанной схеме в методе `createSettingsSchema`
|
|
2434
2444
|
*/
|
|
2435
|
-
type TSettingsOf<D extends IDefinition<B, any, any>, B extends IBaseWidgetSettings = IBaseWidgetSettings> = D["
|
|
2445
|
+
type TSettingsOf<D extends IDefinition<B, any, any>, B extends IBaseWidgetSettings = IBaseWidgetSettings> = D["createSettingsSchema"] extends (z: typeof z) => infer Schema ? Schema extends ZodType ? z.infer<Schema> & B : B : B;
|
|
2436
2446
|
interface IDefinition<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetSettings, GroupSettings extends IGroupSettings = IGroupSettings, MigrationStruct extends TMigrationStruct = IWidgetStruct> {
|
|
2437
2447
|
/** иконка виджета отображаемая в системе (в base64, svg или png) */
|
|
2438
2448
|
icon?: string;
|
|
2439
2449
|
/** метод удаляет настройки, наследуемые от темы и возвращает функцию отката, которая возвращает удаленные настройки */
|
|
2440
2450
|
cleanupThemeProperties?: (settings: WidgetSettings) => (settings: WidgetSettings) => void;
|
|
2441
2451
|
/** возвращает zod-схему настроек виджета */
|
|
2442
|
-
|
|
2452
|
+
createSettingsSchema?: (z: typeof z) => ZodType<WidgetSettings>;
|
|
2443
2453
|
/** возвращает конфигурацию настроек для отображения */
|
|
2444
2454
|
createPanelDescription: IPanelDescriptionCreator<WidgetSettings, GroupSettings>;
|
|
2445
2455
|
/** заполняет настройки значениями по умолчанию */
|
|
@@ -2644,8 +2654,6 @@ interface IWidgetManifest {
|
|
|
2644
2654
|
show_title?: boolean;
|
|
2645
2655
|
/** Отображать ли markdown "описание" виджета (по умолчанию false) */
|
|
2646
2656
|
show_markdown?: boolean;
|
|
2647
|
-
/** Отображать ли переключатель темы виджета (по умолчанию false) */
|
|
2648
|
-
use_theme?: boolean;
|
|
2649
2657
|
};
|
|
2650
2658
|
}
|
|
2651
2659
|
interface ICustomWidgetProps<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetSettings> extends IWidgetProps<WidgetSettings> {
|
|
@@ -2753,6 +2761,101 @@ declare enum EClickHouseBaseTypes {
|
|
|
2753
2761
|
}
|
|
2754
2762
|
declare const parseClickHouseType: (arg: TNullable<string>) => IParsedDbType<EClickHouseBaseTypes | undefined>;
|
|
2755
2763
|
|
|
2764
|
+
type TLimitedColor = Extract<TColor, {
|
|
2765
|
+
mode: EColorMode.AUTO;
|
|
2766
|
+
} | {
|
|
2767
|
+
mode: EColorMode.BASE;
|
|
2768
|
+
}>;
|
|
2769
|
+
type TWidgetsPaletteValue = Extract<TColor, {
|
|
2770
|
+
mode: EColorMode.AUTO;
|
|
2771
|
+
}> | {
|
|
2772
|
+
mode: EColorMode.BASE;
|
|
2773
|
+
values: string[];
|
|
2774
|
+
};
|
|
2775
|
+
type TGradientsSetValue = Extract<TColor, {
|
|
2776
|
+
mode: EColorMode.AUTO;
|
|
2777
|
+
}> | {
|
|
2778
|
+
mode: EColorMode.BASE;
|
|
2779
|
+
values: IGradient[];
|
|
2780
|
+
};
|
|
2781
|
+
interface ITheme {
|
|
2782
|
+
apiVersion: string;
|
|
2783
|
+
maxWidth?: number;
|
|
2784
|
+
dividersHeight: {
|
|
2785
|
+
mode: EHeightMode;
|
|
2786
|
+
value?: number;
|
|
2787
|
+
};
|
|
2788
|
+
backgroundColor: string;
|
|
2789
|
+
backgroundInEdit: boolean;
|
|
2790
|
+
spacing: boolean;
|
|
2791
|
+
widgets: {
|
|
2792
|
+
color: string;
|
|
2793
|
+
paddings: number | string;
|
|
2794
|
+
cornerRadius: number | undefined;
|
|
2795
|
+
titleColor: TLimitedColor;
|
|
2796
|
+
titleSize: number;
|
|
2797
|
+
titleWeight: EFontWeight;
|
|
2798
|
+
textColor: TLimitedColor;
|
|
2799
|
+
textSize: number;
|
|
2800
|
+
axesColor: TLimitedColor;
|
|
2801
|
+
guideLinesColor: TLimitedColor;
|
|
2802
|
+
widgetsPalette: TWidgetsPaletteValue;
|
|
2803
|
+
gradientsSet: TGradientsSetValue;
|
|
2804
|
+
buttons: {
|
|
2805
|
+
primary: {
|
|
2806
|
+
color: TLimitedColor;
|
|
2807
|
+
textColor: TLimitedColor;
|
|
2808
|
+
};
|
|
2809
|
+
primaryOutlined: {
|
|
2810
|
+
borderColor: TLimitedColor;
|
|
2811
|
+
textColor: TLimitedColor;
|
|
2812
|
+
};
|
|
2813
|
+
link: {
|
|
2814
|
+
textColor: TLimitedColor;
|
|
2815
|
+
};
|
|
2816
|
+
};
|
|
2817
|
+
tables: {
|
|
2818
|
+
header: {
|
|
2819
|
+
color: TLimitedColor;
|
|
2820
|
+
textWeight: EFontWeight;
|
|
2821
|
+
textColor: TLimitedColor;
|
|
2822
|
+
};
|
|
2823
|
+
total: {
|
|
2824
|
+
color: TLimitedColor;
|
|
2825
|
+
textWeight: EFontWeight;
|
|
2826
|
+
textColor: TLimitedColor;
|
|
2827
|
+
};
|
|
2828
|
+
};
|
|
2829
|
+
};
|
|
2830
|
+
tabs: {
|
|
2831
|
+
textSize: number;
|
|
2832
|
+
activeTabColor: TLimitedColor;
|
|
2833
|
+
alignment: TTabsHorizontalAlignment;
|
|
2834
|
+
likeViewBackground: boolean;
|
|
2835
|
+
};
|
|
2836
|
+
hoverColor: TLimitedColor;
|
|
2837
|
+
}
|
|
2838
|
+
declare const themeValueMetaKey = "themeValue";
|
|
2839
|
+
/**
|
|
2840
|
+
* Привязывает мета-информацию о теме к Zod-схеме
|
|
2841
|
+
*
|
|
2842
|
+
* @template Value - Тип значения схемы
|
|
2843
|
+
* @template Theme - Тип темы (по умолчанию ITheme)
|
|
2844
|
+
*
|
|
2845
|
+
* @param scheme - Zod схема для привязки
|
|
2846
|
+
* @param selectThemeValue - Функция, возвращающая значение из темы
|
|
2847
|
+
*
|
|
2848
|
+
* @returns Zod схему с мета-информацией о теме
|
|
2849
|
+
*
|
|
2850
|
+
* @example
|
|
2851
|
+
* // Базовое использование
|
|
2852
|
+
* textSize: themed(
|
|
2853
|
+
* z.number().default(12),
|
|
2854
|
+
* (theme) => theme.textSize
|
|
2855
|
+
* )
|
|
2856
|
+
*/
|
|
2857
|
+
declare const themed: <Value, Theme = ITheme>(scheme: ZodType<Value>, selectThemeValue: (theme: Theme) => Value) => ZodType<Value, unknown, zod_v4_core.$ZodTypeInternals<Value, unknown>>;
|
|
2858
|
+
|
|
2756
2859
|
type TDefineWidgetOptions = {
|
|
2757
2860
|
manifest?: IWidgetManifest;
|
|
2758
2861
|
};
|
|
@@ -2765,4 +2868,4 @@ declare global {
|
|
|
2765
2868
|
}
|
|
2766
2869
|
}
|
|
2767
2870
|
|
|
2768
|
-
export { EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionProcessFilterTimeUnit, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatOrFormattingMode, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionButton, type IActionGoToUrl, type IActionOnClickControl, type IActionRunScript, type IActionScript, type IActionUpdateVariable, type IAddButtonSelectOption, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, 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 ICalculatorOptions, type ICollapseRecord, type IColorPickerControl, type IColoredValue, type ICommonDimensions, type ICommonMeasures, type ICommonState, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionProcessFilter, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayConditionControl, type IDisplayPredicate, type IDisplayRule, type IDivePanelDescription, type IDividerRecord, type IEdge, type IEventsColorControl, type IEventsPickerControl, type IExportColumnOrder, type IFillSettings, type IFilterControl, type IFormattingControl, type IFormattingTemplateControl, type IFormulaControl, 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 IInputControl, type IInputMarkdownControl, type IInputNumberControl, type IInputRangeControl, type IInputTemplatedControl, type ILens, type IMarkdownMeasure, type IMeasureAddButtonProps, type IPanelDescription, type IPanelDescriptionCreator, type IParameterColumnList, type IParameterFromAggregation, type IParameterFromColumn, type IParameterFromDynamicList, type IParameterFromEndEvent, type IParameterFromEvent, type IParameterFromFormula, type IParameterFromManualInput, type IParameterFromStartEvent, type IParameterFromStaticList, type IParameterFromVariable, type IParameterTableList, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessFilterPreviewParams, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRadioIconGroupControl, type IRange, type ISelectBranchOption, type ISelectControl, type ISelectDividerOption, type ISelectGroupOption, type ISelectLeafOption, type ISelectNode, type ISelectOption, type ISelectSystemOption, type ISettingsMigratorParams, type ISizeControl, type ISortOrder, type ISortingAddButtonProps, type IStagesFilterValue, type IStaticListLabeledOption, type ISwitchControl, type ITagSetControl, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type ITypeCalculatorOutputItem, type ITypedFormulaControl, type IVertex, type IViewAction, type IViewContext, type IWidget, type IWidgetAction, type IWidgetColumnIndicator, type IWidgetColumnListVariable, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetDynamicListVariable, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetIndicator, type IWidgetIndicatorAddButtonProps, type IWidgetManifest, type IWidgetMeasure, type IWidgetMigrator, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetPresetSettings, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetStaticListVariable, type IWidgetStaticVariable, type IWidgetStruct, type IWidgetTable, type IWidgetTableColumn, OuterAggregation, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionValidator, type TActionsOnClick, type TAddButton, type TBoundedContentWithIndicator, type TColor, type TColorBase, 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 TControlUnion, type TCustomAddButtonSelectOption, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TExtendedFormulaFilterValue, type TFiltrationAccessibility, type TGroupLevelRecord, type THintPlacement, type TLaunchActionParams, type TMeasureAddButtonSelectOption, type TMigrateProcessor, type TMigrationStruct, type TParameterFromDataModel, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchNodes, type TSelectivePartial, type TSettingsFilter, type TSettingsOf, type TSortDirection, type TUpdateSelection, type TValuePath, type TVersion, type TViewActionParameter, type TWidgetActionParameter, type TWidgetContainer, type TWidgetDimensionData, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetIndicatorAggregationValue, type TWidgetIndicatorConversionValue, type TWidgetIndicatorDurationValue, type TWidgetIndicatorTimeValue, type TWidgetLevelRecord, type TWidgetMeasureData, type TWidgetSortingValue, type TWidgetVariable, applyIndexToArrayFormula, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, createEscaper, createAggregationTemplate as createMeasureAggregationTemplate, curlyBracketsContentPattern, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, doubleQuoteContentPattern, durationTemplates, escapeCurlyBracketLinkName, escapeDoubleQuoteLinkName, eventMeasureTemplateFormulas, fillTemplateSql, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getProcessDimensionValueFormula, getRuleColor, getTransitionMeasureFormula, isDimensionProcessFilter, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSettingsFiltersToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|
|
2871
|
+
export { EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionProcessFilterTimeUnit, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatOrFormattingMode, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EHeightMode, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionButton, type IActionGoToUrl, type IActionOnClickControl, type IActionRunScript, type IActionScript, type IActionUpdateVariable, type IAddButtonSelectOption, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, 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 ICalculatorOptions, type ICollapseRecord, type IColorPickerControl, type IColoredValue, type ICommonDimensions, type ICommonMeasures, type ICommonState, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionProcessFilter, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayConditionControl, type IDisplayPredicate, type IDisplayRule, type IDivePanelDescription, type IDividerRecord, type IEdge, type IEventsColorControl, type IEventsPickerControl, type IExportColumnOrder, type IFillSettings, type IFilterControl, type IFormattingControl, type IFormattingTemplateControl, type IFormulaControl, type IFormulaFilterValue, type IGeneralCalculator, type IGeneralCalculatorExportInput, type IGeneralCalculatorInput, type IGeneralCalculatorOutput, type IGlobalContext, type IGradient, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type IIndicatorLink, type IInitialSettings, type IInputControl, type IInputMarkdownControl, type IInputNumberControl, type IInputRangeControl, type IInputTemplatedControl, type ILens, type IMarkdownMeasure, type IMeasureAddButtonProps, type IPanelDescription, type IPanelDescriptionCreator, type IParameterColumnList, type IParameterFromAggregation, type IParameterFromColumn, type IParameterFromDynamicList, type IParameterFromEndEvent, type IParameterFromEvent, type IParameterFromFormula, type IParameterFromManualInput, type IParameterFromStartEvent, type IParameterFromStaticList, type IParameterFromVariable, type IParameterTableList, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessFilterPreviewParams, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRadioIconGroupControl, type IRange, type ISelectBranchOption, type ISelectControl, type ISelectDividerOption, type ISelectGroupOption, type ISelectLeafOption, type ISelectNode, type ISelectOption, type ISelectSystemOption, type ISettingsMigratorParams, type ISizeControl, type ISortOrder, type ISortingAddButtonProps, type IStagesFilterValue, type IStaticListLabeledOption, type ISwitchControl, type ITagSetControl, type ITheme, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type ITypeCalculatorOutputItem, type ITypedFormulaControl, type IVertex, type IViewAction, type IViewContext, type IWidget, type IWidgetAction, type IWidgetColumnIndicator, type IWidgetColumnListVariable, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetDynamicListVariable, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetIndicator, type IWidgetIndicatorAddButtonProps, type IWidgetManifest, type IWidgetMeasure, type IWidgetMigrator, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetPresetSettings, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetStaticListVariable, type IWidgetStaticVariable, type IWidgetStruct, type IWidgetTable, type IWidgetTableColumn, OuterAggregation, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionValidator, type TActionsOnClick, type TAddButton, type TBoundedContentWithIndicator, type TColor, type TColorBase, 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 TControlUnion, type TCustomAddButtonSelectOption, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TExtendedFormulaFilterValue, type TFiltrationAccessibility, type TGradientsSetValue, type TGroupLevelRecord, type THintPlacement, type TLaunchActionParams, type TLimitedColor, type TMeasureAddButtonSelectOption, type TMigrateProcessor, type TMigrationStruct, type TParameterFromDataModel, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchNodes, type TSelectivePartial, type TSettingsFilter, type TSettingsOf, type TSortDirection, type TTabsHorizontalAlignment, type TUpdateSelection, type TValuePath, type TVersion, type TViewActionParameter, type TWidgetActionParameter, type TWidgetContainer, type TWidgetDimensionData, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetIndicatorAggregationValue, type TWidgetIndicatorConversionValue, type TWidgetIndicatorDurationValue, type TWidgetIndicatorTimeValue, type TWidgetLevelRecord, type TWidgetMeasureData, type TWidgetSortingValue, type TWidgetVariable, type TWidgetsPaletteValue, applyIndexToArrayFormula, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, createEscaper, createAggregationTemplate as createMeasureAggregationTemplate, curlyBracketsContentPattern, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, doubleQuoteContentPattern, durationTemplates, escapeCurlyBracketLinkName, escapeDoubleQuoteLinkName, eventMeasureTemplateFormulas, fillTemplateSql, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getProcessDimensionValueFormula, getRuleColor, getTransitionMeasureFormula, isDimensionProcessFilter, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSettingsFiltersToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, themeValueMetaKey, themed, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|
package/dist/index.esm.js
CHANGED
|
@@ -1476,6 +1476,11 @@ var EFontWeight;
|
|
|
1476
1476
|
EFontWeight["NORMAL"] = "NORMAL";
|
|
1477
1477
|
EFontWeight["BOLD"] = "BOLD";
|
|
1478
1478
|
})(EFontWeight || (EFontWeight = {}));
|
|
1479
|
+
var EHeightMode;
|
|
1480
|
+
(function (EHeightMode) {
|
|
1481
|
+
EHeightMode["FIXED"] = "FIXED";
|
|
1482
|
+
EHeightMode["PERCENT"] = "PERCENT";
|
|
1483
|
+
})(EHeightMode || (EHeightMode = {}));
|
|
1479
1484
|
|
|
1480
1485
|
function checkDisplayCondition(displayCondition, variables) {
|
|
1481
1486
|
var _a;
|
|
@@ -2209,4 +2214,28 @@ var getColorByIndex = function (index) {
|
|
|
2209
2214
|
return color;
|
|
2210
2215
|
};
|
|
2211
2216
|
|
|
2212
|
-
|
|
2217
|
+
var themeValueMetaKey = "themeValue";
|
|
2218
|
+
/**
|
|
2219
|
+
* Привязывает мета-информацию о теме к Zod-схеме
|
|
2220
|
+
*
|
|
2221
|
+
* @template Value - Тип значения схемы
|
|
2222
|
+
* @template Theme - Тип темы (по умолчанию ITheme)
|
|
2223
|
+
*
|
|
2224
|
+
* @param scheme - Zod схема для привязки
|
|
2225
|
+
* @param selectThemeValue - Функция, возвращающая значение из темы
|
|
2226
|
+
*
|
|
2227
|
+
* @returns Zod схему с мета-информацией о теме
|
|
2228
|
+
*
|
|
2229
|
+
* @example
|
|
2230
|
+
* // Базовое использование
|
|
2231
|
+
* textSize: themed(
|
|
2232
|
+
* z.number().default(12),
|
|
2233
|
+
* (theme) => theme.textSize
|
|
2234
|
+
* )
|
|
2235
|
+
*/
|
|
2236
|
+
var themed = function (scheme, selectThemeValue) {
|
|
2237
|
+
var _a;
|
|
2238
|
+
return scheme.meta((_a = {}, _a[themeValueMetaKey] = selectThemeValue, _a));
|
|
2239
|
+
};
|
|
2240
|
+
|
|
2241
|
+
export { EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionProcessFilterTimeUnit, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatOrFormattingMode, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EHeightMode, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, OuterAggregation, applyIndexToArrayFormula, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, createEscaper, createAggregationTemplate as createMeasureAggregationTemplate, curlyBracketsContentPattern, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, doubleQuoteContentPattern, durationTemplates, escapeCurlyBracketLinkName, escapeDoubleQuoteLinkName, eventMeasureTemplateFormulas, fillTemplateSql, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getProcessDimensionValueFormula, getRuleColor, getTransitionMeasureFormula, isDimensionProcessFilter, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSettingsFiltersToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, themeValueMetaKey, themed, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|
package/dist/index.js
CHANGED
|
@@ -1477,6 +1477,11 @@ exports.EFontWeight = void 0;
|
|
|
1477
1477
|
EFontWeight["NORMAL"] = "NORMAL";
|
|
1478
1478
|
EFontWeight["BOLD"] = "BOLD";
|
|
1479
1479
|
})(exports.EFontWeight || (exports.EFontWeight = {}));
|
|
1480
|
+
exports.EHeightMode = void 0;
|
|
1481
|
+
(function (EHeightMode) {
|
|
1482
|
+
EHeightMode["FIXED"] = "FIXED";
|
|
1483
|
+
EHeightMode["PERCENT"] = "PERCENT";
|
|
1484
|
+
})(exports.EHeightMode || (exports.EHeightMode = {}));
|
|
1480
1485
|
|
|
1481
1486
|
function checkDisplayCondition(displayCondition, variables) {
|
|
1482
1487
|
var _a;
|
|
@@ -2210,6 +2215,30 @@ var getColorByIndex = function (index) {
|
|
|
2210
2215
|
return color;
|
|
2211
2216
|
};
|
|
2212
2217
|
|
|
2218
|
+
var themeValueMetaKey = "themeValue";
|
|
2219
|
+
/**
|
|
2220
|
+
* Привязывает мета-информацию о теме к Zod-схеме
|
|
2221
|
+
*
|
|
2222
|
+
* @template Value - Тип значения схемы
|
|
2223
|
+
* @template Theme - Тип темы (по умолчанию ITheme)
|
|
2224
|
+
*
|
|
2225
|
+
* @param scheme - Zod схема для привязки
|
|
2226
|
+
* @param selectThemeValue - Функция, возвращающая значение из темы
|
|
2227
|
+
*
|
|
2228
|
+
* @returns Zod схему с мета-информацией о теме
|
|
2229
|
+
*
|
|
2230
|
+
* @example
|
|
2231
|
+
* // Базовое использование
|
|
2232
|
+
* textSize: themed(
|
|
2233
|
+
* z.number().default(12),
|
|
2234
|
+
* (theme) => theme.textSize
|
|
2235
|
+
* )
|
|
2236
|
+
*/
|
|
2237
|
+
var themed = function (scheme, selectThemeValue) {
|
|
2238
|
+
var _a;
|
|
2239
|
+
return scheme.meta((_a = {}, _a[themeValueMetaKey] = selectThemeValue, _a));
|
|
2240
|
+
};
|
|
2241
|
+
|
|
2213
2242
|
Object.defineProperty(exports, "ELanguages", {
|
|
2214
2243
|
enumerable: true,
|
|
2215
2244
|
get: function () { return localization$1.ELanguages; }
|
|
@@ -2283,6 +2312,8 @@ exports.replaceDisplayCondition = replaceDisplayCondition;
|
|
|
2283
2312
|
exports.replaceFiltersBySelection = replaceFiltersBySelection;
|
|
2284
2313
|
exports.replaceHierarchiesWithDimensions = replaceHierarchiesWithDimensions;
|
|
2285
2314
|
exports.selectDimensionFromHierarchy = selectDimensionFromHierarchy;
|
|
2315
|
+
exports.themeValueMetaKey = themeValueMetaKey;
|
|
2316
|
+
exports.themed = themed;
|
|
2286
2317
|
exports.timeTemplates = timeTemplates;
|
|
2287
2318
|
exports.transitionMeasureTemplateFormulas = transitionMeasureTemplateFormulas;
|
|
2288
2319
|
exports.unescapeSpecialCharacters = unescapeSpecialCharacters;
|