From c3158e40bb505eca7758b7752210da8d6aadd116 Mon Sep 17 00:00:00 2001 From: Luc Claustres Date: Wed, 4 Dec 2024 08:21:42 +0100 Subject: [PATCH] refactor: custom shapes with new KDK method to add new shapes --- src/components/miscellaneous/Shapes.vue | 48 ++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/components/miscellaneous/Shapes.vue b/src/components/miscellaneous/Shapes.vue index 0d217da..9561f86 100644 --- a/src/components/miscellaneous/Shapes.vue +++ b/src/components/miscellaneous/Shapes.vue @@ -28,38 +28,38 @@ import { Shapes } from '@kalisio/kdk/core/client/utils/utils.shapes.js' const radius = 12 -Shapes['Full-pin'] = { +Shapes.add('full-pin', { viewBox: [0, 0, 14, 24], content: '' -} -Shapes['Empty-pin'] = { +}) +Shapes.add('empty-pin', { viewBox: [0, 0, 14, 24], content: '' -} -Shapes['Pin-with-empty-star'] = { +}) +Shapes.add('pin-with-empty-star', { viewBox: [0, 0, 14, 24], content: '' -} -Shapes['Full-circle'] = { +}) +Shapes.add('full-circle', { viewBox: [0, 0, 24, 24], content: '' -} -Shapes['Empty-circle'] = { +}) +Shapes.add('empty-circle', { viewBox: [0, 0, 24, 24], content: '' -} -Shapes['Full-circle-with-empty-star'] = { +}) +Shapes.add('full-circle-with-empty-star', { viewBox: [0, 0, 24, 24], content: '' -} -Shapes['Full-rounded-square-with-empty-star'] = { +}) +Shapes.add('full-rounded-square-with-empty-star', { viewBox: [0, 0, 24, 24], content: '' -} -Shapes['Full-rounded-square'] = { +}) +Shapes.add('full-rounded-square', { viewBox: [0, 0, 24, 24], content: '' -} +}) const shapes = ref({ size: [ @@ -92,14 +92,14 @@ const shapes = ref({ { name: 'Html only', options: { html: "" } } ], custom: [ - { name: 'Full pin', options: { shape: 'Full-pin', size: [24, 41.14], color: 'lightblue' } }, - { name: 'Empty pin', options: { shape: 'Empty-pin', size: [24, 41.14], color: 'lightblue' } }, - { name: 'Pin with empty star', options: { shape: 'Pin-with-empty-star', size: [24, 41.14], color: 'lightblue' } }, - { name: 'Full rounded square with empty star', options: { shape: 'Full-rounded-square-with-empty-star', color: 'limegreen' } }, - { name: 'Full rounded square', options: { shape: 'Full-rounded-square', color: 'limegreen' } }, - { name: 'Full circle', options: { shape: 'Full-circle', color: 'pink' } }, - { name: 'Empty circle', options: { shape: 'Empty-circle', color: 'pink' } }, - { name: 'Full circle with empty star', options: { shape: 'Full-circle-with-empty-star', color: 'pink' } } + { name: 'Full pin', options: { shape: 'full-pin', size: [24, 41.14], color: 'lightblue' } }, + { name: 'Empty pin', options: { shape: 'empty-pin', size: [24, 41.14], color: 'lightblue' } }, + { name: 'Pin with empty star', options: { shape: 'pin-with-empty-star', size: [24, 41.14], color: 'lightblue' } }, + { name: 'Full rounded square with empty star', options: { shape: 'full-rounded-square-with-empty-star', color: 'limegreen' } }, + { name: 'Full rounded square', options: { shape: 'full-rounded-square', color: 'limegreen' } }, + { name: 'Full circle', options: { shape: 'full-circle', color: 'pink' } }, + { name: 'Empty circle', options: { shape: 'empty-circle', color: 'pink' } }, + { name: 'Full circle with empty star', options: { shape: 'full-circle-with-empty-star', color: 'pink' } } ] })