refactor(background): deprecate bgcolor prop
This commit is contained in:
@@ -17,6 +17,7 @@ const {
|
|||||||
y = 0,
|
y = 0,
|
||||||
bgColor,
|
bgColor,
|
||||||
patternColor: initialPatternColor,
|
patternColor: initialPatternColor,
|
||||||
|
color: _patternColor,
|
||||||
offset = 2,
|
offset = 2,
|
||||||
} = defineProps<BackgroundProps>()
|
} = defineProps<BackgroundProps>()
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ const background = computed(() => {
|
|||||||
// when there are multiple flows on a page we need to make sure that every background gets its own pattern.
|
// when there are multiple flows on a page we need to make sure that every background gets its own pattern.
|
||||||
const patternId = toRef(() => `pattern-${vueFlowId}${id ? `-${id}` : ''}`)
|
const patternId = toRef(() => `pattern-${vueFlowId}${id ? `-${id}` : ''}`)
|
||||||
|
|
||||||
const patternColor = toRef(() => initialPatternColor || DefaultBgColors[variant || BackgroundVariant.Dots])
|
const patternColor = toRef(() => _patternColor || initialPatternColor || DefaultBgColors[variant || BackgroundVariant.Dots])
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
// todo: replace with a simple string type
|
/**
|
||||||
|
* @deprecated - will be removed in the next major version. You can use simple string values for `variant` prop instead, i.e. `lines` or `dots`
|
||||||
|
*/
|
||||||
export enum BackgroundVariant {
|
export enum BackgroundVariant {
|
||||||
Lines = 'lines',
|
Lines = 'lines',
|
||||||
Dots = 'dots',
|
Dots = 'dots',
|
||||||
@@ -15,9 +17,17 @@ export interface BackgroundProps {
|
|||||||
/** Background pattern size */
|
/** Background pattern size */
|
||||||
size?: number
|
size?: number
|
||||||
lineWidth?: number
|
lineWidth?: number
|
||||||
/** Background pattern color */
|
/**
|
||||||
|
* @deprecated - will be removed in the next major version. Use `color` instead
|
||||||
|
* Background pattern color
|
||||||
|
*/
|
||||||
patternColor?: string
|
patternColor?: string
|
||||||
/** Background color */
|
/** Background pattern color */
|
||||||
|
color?: string
|
||||||
|
/**
|
||||||
|
* @deprecated - will be removed in the next major version. You can assign a bg color to `<VueFlow />` directly instead.
|
||||||
|
* Background color
|
||||||
|
*/
|
||||||
bgColor?: string
|
bgColor?: string
|
||||||
/** @deprecated Background height */
|
/** @deprecated Background height */
|
||||||
height?: number
|
height?: number
|
||||||
|
|||||||
Reference in New Issue
Block a user