From d0c0d3606ea5885cf98e99644f9b44ce2e54f42d Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 9 Jan 2023 12:00:27 +0400 Subject: [PATCH] Move StyleManager config to TS --- .../config/{config.js => config.ts} | 93 +++++++++++++------ 1 file changed, 64 insertions(+), 29 deletions(-) rename src/style_manager/config/{config.js => config.ts} (50%) diff --git a/src/style_manager/config/config.js b/src/style_manager/config/config.ts similarity index 50% rename from src/style_manager/config/config.js rename to src/style_manager/config/config.ts index 933d3903f..e43fe17ea 100644 --- a/src/style_manager/config/config.js +++ b/src/style_manager/config/config.ts @@ -1,5 +1,67 @@ +export interface StyleManagerConfig { + /** + * Default sectors and properties + */ + sectors?: {}[]; // TODO + + /** + * Specify the element to use as a container, string (query) or HTMLElement. + * With the empty value, nothing will be rendered. + */ + appendTo?: string | HTMLElement; + + /** + * Style prefix. + * @default 'sm-' + */ + stylePrefix?: string; + + /** + * Avoid rendering the default style manager. + * @default false + */ + custom?: boolean; + + /** + * Hide the property in case it's not stylable for the + * selected component (each component has 'stylable' property). + * @deprecated + */ + hideNotStylable?: boolean; + + /** + * Highlight changed properties of the selected component. + * @deprecated + */ + highlightChanged?: boolean; + + /** + * Highlight computed properties of the selected component. + * @deprecated + */ + highlightComputed?: boolean; + + /** + * Show computed properties of the selected component, if this value + * is set to false, highlightComputed will not take effect. + * @deprecated + */ + showComputed?: boolean; + + /** + * Adds the possibility to clear property value from the target style. + * @deprecated + */ + clearProperties?: boolean; + + /** + * Properties not to take in account for computed styles. + * @deprecated + */ + avoidComputed?: string[]; +} + export default { - // Default sectors and properties sectors: [ { name: 'General', @@ -52,40 +114,13 @@ export default { properties: ['opacity', 'transition', 'transform'], }, ], - - // Specify the element to use as a container, string (query) or HTMLElement - // With the empty value, nothing will be rendered appendTo: '', - - // Style prefix stylePrefix: 'sm-', - - // Avoid rendering the default style manager. custom: false, - - // Hide the property in case it's not stylable for the - // selected component (each component has 'stylable' property) - // @deprecated hideNotStylable: true, - - // Highlight changed properties of the selected component - // @deprecated highlightChanged: true, - - // Highlight computed properties of the selected component - // @deprecated highlightComputed: true, - - // Show computed properties of the selected component, if this value - // is set to false, highlightComputed will not take effect - // @deprecated showComputed: true, - - // Adds the possibility to clear property value from the target style - // @deprecated clearProperties: true, - - // Properties not to take in account for computed styles - // @deprecated avoidComputed: ['width', 'height'], -}; +} as StyleManagerConfig;