From c47ba5036988ada112aaca3b9b60dec2d30b5597 Mon Sep 17 00:00:00 2001 From: Alexandre Rousseau Date: Thu, 4 Jul 2024 22:37:46 +0200 Subject: [PATCH] feat(ui): introduce `CoreColorInput`. WF-9 --- .../public/components/colorinput.png | Bin 0 -> 4227 bytes src/ui/src/core/templateMap.ts | 2 + .../core_components/base/BaseInputColor.vue | 53 ++++++++++ .../core_components/input/CoreColorInput.vue | 100 ++++++++++++++++++ src/ui/src/renderer/useFormValueBroker.ts | 8 +- 5 files changed, 159 insertions(+), 4 deletions(-) create mode 100644 docs/framework/public/components/colorinput.png create mode 100644 src/ui/src/core_components/base/BaseInputColor.vue create mode 100644 src/ui/src/core_components/input/CoreColorInput.vue diff --git a/docs/framework/public/components/colorinput.png b/docs/framework/public/components/colorinput.png new file mode 100644 index 0000000000000000000000000000000000000000..a0d96a8c5dea0cb5bbe7fa52c0f98d9c61731646 GIT binary patch literal 4227 zcmcgwXH=6*w+s@>H?ETEMpP6}+%DdNZ`gsH)T>>71kVvGgH{3VS z%?0sT)-S*_cUwac1mfT@)V*UBnnzxUFdskY!v9>Wc|Ol$aVI(N&I6u?Tmw?!z0xzu zhM-Yhl@J9fxo>7?!K2wL*Bb{UYTp-JgDz-zW#Pd^s%kx<*}stH7CvH1m&bTUNLgHx z?q2l;dw6ABbzQ;g#jS?T+9Nj)&&h?MqrIrT1xLz>qb7w=n$g|gMpvOtJG^sb@MR}e zzOWN}kpqi%iV-9#nlt2qjAC|B(V+7+LgritPm23r+@T!Lk9t|+Kq<8CC{ykFGW8>O zl`E+APl4J_X2Ftidg7=9ZMNQfV?O!J2G@2K(-?w$g7xk;4O$Z&oRtvuO2W-z;1HsO z^X1`>N_xyBhIcVjC|F_5b>XI4;0xNayK*viw$Gtfv>J3^-|g5#Ui6j#5yW-L-&*S&v}t6Pr8+1}&$V@1NlZccg_ zlYSFU7DDZY6BP<49g0g+RA*gY@pE1JIplt=PJkIPRbGKWGxUa4UV%{m^&)C5C?T+q z4#2zV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0606339 100644 --- a/src/ui/src/core/templateMap.ts +++ b/src/ui/src/core/templateMap.ts @@ -16,6 +16,7 @@ import CoreTags from "../core_components/content/CoreTags.vue"; import CoreAvatar from "../core_components/content/CoreAvatar.vue"; // input import CoreCheckboxInput from "../core_components/input/CoreCheckboxInput.vue"; +import CoreColorInput from "../core_components/input/CoreColorInput.vue"; import CoreDateInput from "../core_components/input/CoreDateInput.vue"; import CoreDropdownInput from "../core_components/input/CoreDropdownInput.vue"; import CoreFileInput from "../core_components/input/CoreFileInput.vue"; @@ -93,6 +94,7 @@ const templateMap = { textareainput: CoreTextareaInput, numberinput: CoreNumberInput, sliderinput: CoreSliderInput, + colorinput: CoreColorInput, dateinput: CoreDateInput, timeinput: CoreTimeInput, radioinput: CoreRadioInput, diff --git a/src/ui/src/core_components/base/BaseInputColor.vue b/src/ui/src/core_components/base/BaseInputColor.vue new file mode 100644 index 000000000..7a6ba7257 --- /dev/null +++ b/src/ui/src/core_components/base/BaseInputColor.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/src/ui/src/core_components/input/CoreColorInput.vue b/src/ui/src/core_components/input/CoreColorInput.vue new file mode 100644 index 000000000..0c37e598a --- /dev/null +++ b/src/ui/src/core_components/input/CoreColorInput.vue @@ -0,0 +1,100 @@ + + + + + + diff --git a/src/ui/src/renderer/useFormValueBroker.ts b/src/ui/src/renderer/useFormValueBroker.ts index 8d19dabd7..3d2623973 100644 --- a/src/ui/src/renderer/useFormValueBroker.ts +++ b/src/ui/src/renderer/useFormValueBroker.ts @@ -1,6 +1,6 @@ import { ComponentPublicInstance, computed, Ref, ref, watch } from "vue"; -import { Core, InstancePath } from "../writerTypes"; import { useEvaluator } from "../renderer/useEvaluator"; +import { Core, InstancePath } from "../writerTypes"; /** * @@ -10,14 +10,14 @@ import { useEvaluator } from "../renderer/useEvaluator"; * @param componentId * @returns */ -export function useFormValueBroker( +export function useFormValueBroker( wf: Core, instancePath: InstancePath, emitterEl: Ref, ) { - const formValue: Ref = ref(); + const formValue: Ref = ref(); const isBusy = ref(false); - const queuedEvent: Ref<{ eventValue: any; emitEventType: string }> = + const queuedEvent: Ref<{ eventValue: T; emitEventType: string }> = ref(null); const componentId = instancePath.at(-1).componentId;