Browse Source

test: fix pw test

pull/7807/head
Raju Udava 9 months ago
parent
commit
c322b29642
  1. 220
      packages/nc-gui/components/general/BaseIconColorPicker.vue

220
packages/nc-gui/components/general/BaseIconColorPicker.vue

@ -64,120 +64,122 @@ watch(
</script> </script>
<template> <template>
<a-dropdown v-model:visible="isOpen" :trigger="['click']" :disabled="readonly"> <div>
<div <a-dropdown v-model:visible="isOpen" :trigger="['click']" :disabled="readonly">
class="flex flex-row justify-center items-center select-none rounded-md nc-emoji" <div
:class="{ class="flex flex-row justify-center items-center select-none rounded-md nc-emoji"
'hover:bg-gray-500 hover:bg-opacity-15 cursor-pointer': !readonly, :class="{
'bg-gray-500 bg-opacity-15': isOpen, 'hover:bg-gray-500 hover:bg-opacity-15 cursor-pointer': !readonly,
'h-6 w-6 text-lg': size === 'small', 'bg-gray-500 bg-opacity-15': isOpen,
'h-8 w-8 text-xl': size === 'medium', 'h-6 w-6 text-lg': size === 'small',
'h-10 w-10 text-2xl': size === 'large', 'h-8 w-8 text-xl': size === 'medium',
'h-14 w-16 text-5xl': size === 'xlarge', 'h-10 w-10 text-2xl': size === 'large',
}" 'h-14 w-16 text-5xl': size === 'xlarge',
@click.stop="onClick" }"
> @click.stop="onClick"
<template v-if="hue !== 0 && !hue && colorRef.h === defaultHueValue"> >
<slot name="default" /> <template v-if="hue !== 0 && !hue && colorRef.h === defaultHueValue">
</template> <slot name="default" />
<template v-else> </template>
<svg width="16" height="16" viewBox="0 0 1073 1073" fill="none" xmlns="http://www.w3.org/2000/svg" :class="iconClass"> <template v-else>
<mask <svg width="16" height="16" viewBox="0 0 1073 1073" fill="none" xmlns="http://www.w3.org/2000/svg" :class="iconClass">
id="mask0_1749_80944" <mask
style="mask-type: luminance" id="mask0_1749_80944"
maskUnits="userSpaceOnUse" style="mask-type: luminance"
x="94" maskUnits="userSpaceOnUse"
y="40" x="94"
width="885" y="40"
height="993" width="885"
> height="993"
<path d="M978.723 40H94V1033H978.723V40Z" fill="white" /> >
</mask> <path d="M978.723 40H94V1033H978.723V40Z" fill="white" />
<g mask="url(#mask0_1749_80944)"> </mask>
<path <g mask="url(#mask0_1749_80944)">
fill-rule="evenodd" <path
clip-rule="evenodd" fill-rule="evenodd"
d="M638.951 291.265L936.342 462.949C966.129 480.145 980.256 502.958 978.723 525.482V774.266C980.256 796.789 966.129 819.602 936.342 836.798L638.951 1008.48C582.292 1041.19 490.431 1041.19 433.773 1008.48L136.381 836.798C106.595 819.602 92.4675 796.789 93.9999 774.266L93.9999 525.482C92.4675 502.957 106.595 480.145 136.381 462.949L433.773 291.265C490.431 258.556 582.292 258.556 638.951 291.265Z" clip-rule="evenodd"
:fill=" d="M638.951 291.265L936.342 462.949C966.129 480.145 980.256 502.958 978.723 525.482V774.266C980.256 796.789 966.129 819.602 936.342 836.798L638.951 1008.48C582.292 1041.19 490.431 1041.19 433.773 1008.48L136.381 836.798C106.595 819.602 92.4675 796.789 93.9999 774.266L93.9999 525.482C92.4675 502.957 106.595 480.145 136.381 462.949L433.773 291.265C490.431 258.556 582.292 258.556 638.951 291.265Z"
tinycolor( :fill="
preDefinedHueData && preDefinedHueData[`_${colorRef.h}`] tinycolor(
? `hsv(${preDefinedHueData[`_${colorRef.h}`].shade.h},${preDefinedHueData[`_${colorRef.h}`].shade.s}%, ${ preDefinedHueData && preDefinedHueData[`_${colorRef.h}`]
preDefinedHueData[`_${colorRef.h}`].shade.v ? `hsv(${preDefinedHueData[`_${colorRef.h}`].shade.h},${preDefinedHueData[`_${colorRef.h}`].shade.s}%, ${
}%)` preDefinedHueData[`_${colorRef.h}`].shade.v
: `hsv(${colorRef.h ?? defaultHueValue}, 100%, 30%)`, }%)`
).toHexString() : `hsv(${colorRef.h ?? defaultHueValue}, 100%, 30%)`,
" ).toHexString()
/> "
<path />
fill-rule="evenodd" <path
clip-rule="evenodd" fill-rule="evenodd"
d="M638.951 65.0055L936.342 236.69C966.129 253.886 980.256 276.699 978.723 299.222V548.006C980.256 570.529 966.129 593.343 936.342 610.538L638.951 782.223C582.292 814.931 490.431 814.931 433.773 782.223L136.381 610.538C106.595 593.343 92.4675 570.529 93.9999 548.006L93.9999 299.222C92.4675 276.699 106.595 253.886 136.381 236.69L433.773 65.0055C490.431 32.2968 582.292 32.2968 638.951 65.0055Z" clip-rule="evenodd"
:fill=" d="M638.951 65.0055L936.342 236.69C966.129 253.886 980.256 276.699 978.723 299.222V548.006C980.256 570.529 966.129 593.343 936.342 610.538L638.951 782.223C582.292 814.931 490.431 814.931 433.773 782.223L136.381 610.538C106.595 593.343 92.4675 570.529 93.9999 548.006L93.9999 299.222C92.4675 276.699 106.595 253.886 136.381 236.69L433.773 65.0055C490.431 32.2968 582.292 32.2968 638.951 65.0055Z"
tinycolor( :fill="
preDefinedHueData && preDefinedHueData[`_${colorRef.h}`] tinycolor(
? `hsv(${preDefinedHueData[`_${colorRef.h}`].tint.h},${preDefinedHueData[`_${colorRef.h}`].tint.s}%, ${ preDefinedHueData && preDefinedHueData[`_${colorRef.h}`]
preDefinedHueData[`_${colorRef.h}`].tint.v ? `hsv(${preDefinedHueData[`_${colorRef.h}`].tint.h},${preDefinedHueData[`_${colorRef.h}`].tint.s}%, ${
}%)` preDefinedHueData[`_${colorRef.h}`].tint.v
: `hsv(${colorRef.h ?? defaultHueValue}, 50%, 100%)`, }%)`
).toHexString() : `hsv(${colorRef.h ?? defaultHueValue}, 50%, 100%)`,
" ).toHexString()
/> "
</g> />
</svg> </g>
</template> </svg>
</div> </template>
<template #overlay> </div>
<div class="nc-base-icon-color-picker-dropdown relative bg-white rounded-lg border-1 border-gray-200"> <template #overlay>
<div class="flex items-center p-2 space-x-2"> <div class="nc-base-icon-color-picker-dropdown relative bg-white rounded-lg border-1 border-gray-200">
<div <div class="flex items-center p-2 space-x-2">
v-for="(h, i) of Object.keys(preDefinedHueData)"
:key="i"
class="nc-pre-defined-hue-item p-1 rounded cursor-pointer hover:bg-gray-200"
>
<div <div
class="rounded h-6 w-6" v-for="(h, i) of Object.keys(preDefinedHueData)"
:class="{ :key="i"
selected: preDefinedHueData[h].tint.h === hue || (h === '_199' && hue !== 0 && !hue), class="nc-pre-defined-hue-item p-1 rounded cursor-pointer hover:bg-gray-200"
}" >
:style="{ <div
backgroundColor: preDefinedHueData[h].pickerColor, class="rounded h-6 w-6"
}" :class="{
@click="selectColor(preDefinedHueData[h].tint.h)" selected: preDefinedHueData[h].tint.h === hue || (h === '_199' && hue !== 0 && !hue),
></div> }"
:style="{
backgroundColor: preDefinedHueData[h].pickerColor,
}"
@click="selectColor(preDefinedHueData[h].tint.h)"
></div>
</div>
</div> </div>
</div>
<div class="p-2 border-t-1 border-gray-200 flex flex-col space-y-2.5"> <div class="p-2 border-t-1 border-gray-200 flex flex-col space-y-2.5">
<div class="uppercase text-xs font-medium">{{ $t('labels.customColour') }}</div> <div class="uppercase text-xs font-medium">{{ $t('labels.customColour') }}</div>
<div class="flex flex-row items-center gap-x-3"> <div class="flex flex-row items-center gap-x-3">
<input <input
:value="parseInt(`${colorRef.h ?? 0}`)" :value="parseInt(`${colorRef.h ?? 0}`)"
class="nc-color-hue-input" class="nc-color-hue-input"
type="number" type="number"
:min="0" :min="0"
:max="360" :max="360"
@input=" @input="
(value) => { (value) => {
updateColorHue(value.target?.value) updateColorHue(value.target?.value)
} }
" "
/> />
<LazyGeneralColorSliderWrapper <LazyGeneralColorSliderWrapper
:model-value="colorRef" :model-value="colorRef"
class="!min-w-none ml-3" class="!min-w-none ml-3"
@update:model-value=" @update:model-value="
(value) => { (value) => {
updateColorHue(value?.h) updateColorHue(value?.h)
} }
" "
/> />
</div>
</div> </div>
</div> </div>
</div> </template>
</template> </a-dropdown>
</a-dropdown> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

Loading…
Cancel
Save