diff --git a/frontend/components.d.ts b/frontend/components.d.ts index 7fb5745f1..d4207a468 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -34,6 +34,7 @@ declare module 'vue' { BlockProperties: typeof import('./src/components/BlockProperties.vue')['default'] BlockSnapGuides: typeof import('./src/components/BlockSnapGuides.vue')['default'] BooleanOptions: typeof import('./src/components/PropsOptions/BooleanOptions.vue')['default'] + BorderControl: typeof import('./src/components/BorderControl.vue')['default'] BorderRadiusControl: typeof import('./src/components/BorderRadiusControl.vue')['default'] BorderRadiusHandler: typeof import('./src/components/BorderRadiusHandler.vue')['default'] BoxResizer: typeof import('./src/components/BoxResizer.vue')['default'] diff --git a/frontend/src/components/BlockPropertySections/StyleSection.ts b/frontend/src/components/BlockPropertySections/StyleSection.ts index 6c2086378..8954f5d39 100644 --- a/frontend/src/components/BlockPropertySections/StyleSection.ts +++ b/frontend/src/components/BlockPropertySections/StyleSection.ts @@ -6,6 +6,7 @@ import { BORDER_UNIT_OPTIONS, ROTATION_UNIT_OPTIONS } from "@/utils/unitOptions" import RangeInput from "../Controls/RangeInput.vue"; import ShadowHandler from "@/components/ShadowHandler.vue"; import BorderRadiusControl from "@/components/BorderRadiusControl.vue"; +import BorderControl from "@/components/BorderControl.vue"; const overflowOptions = [ { @@ -69,60 +70,11 @@ const styleSectionProperties = [ searchKeyWords: "Text, Color, TextColor, Text Color", }, { - component: StylePropertyControl, + component: BorderControl, getProps: () => { - return { - component: ColorInput, - propertyKey: "borderColor", - popoverOffset: 120, - label: "Border Color", - }; - }, - searchKeyWords: "Border, Color, BorderColor, Border Color", - events: { - "update:modelValue": (val: StyleValue) => { - if (val) { - if (!blockController.getStyle("borderWidth")) { - blockController.setStyle("borderWidth", "1px"); - blockController.setStyle("borderStyle", "solid"); - } - } else { - blockController.setStyle("borderWidth", null); - blockController.setStyle("borderStyle", null); - } - }, - }, - }, - { - component: StylePropertyControl, - getProps: () => { - return { - label: "Border Width", - propertyKey: "borderWidth", - enableSlider: true, - unitOptions: BORDER_UNIT_OPTIONS, - minValue: 0, - }; - }, - searchKeyWords: "Border, Width, BorderWidth, Border Width", - condition: () => blockController.getStyle("borderColor") || blockController.getStyle("borderWidth"), - }, - { - component: StylePropertyControl, - getProps: () => { - return { - label: "Border Style", - propertyKey: "borderStyle", - type: "select", - options: [ - { value: "solid", label: "Solid" }, - { value: "dashed", label: "Dashed" }, - { value: "dotted", label: "Dotted" }, - ], - }; + return {}; }, - searchKeyWords: "Border, Style, BorderStyle, Border Style, Solid, Dashed, Dotted", - condition: () => blockController.getStyle("borderColor"), + searchKeyWords: "Border, Color, Width, Style, BorderColor, BorderWidth, BorderStyle", }, { component: ShadowHandler, diff --git a/frontend/src/components/BorderControl.vue b/frontend/src/components/BorderControl.vue new file mode 100644 index 000000000..a4550a177 --- /dev/null +++ b/frontend/src/components/BorderControl.vue @@ -0,0 +1,105 @@ + + +