Browse Source

feat(nc-gui): add tooltip for base icon

pull/7807/head
Ramesh Mane 9 months ago
parent
commit
b36de0bd08
  1. 99
      packages/nc-gui/components/general/BaseIconColorPicker.vue
  2. 3
      packages/nc-gui/lang/en.json

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

@ -70,54 +70,57 @@ watch(
}"
@click="onClick"
>
<template v-if="hue !== 0 && !hue && colorRef.h === defaultHueValue">
<slot name="default" />
</template>
<template v-else>
<svg width="16" height="16" viewBox="0 0 1073 1073" fill="none" xmlns="http://www.w3.org/2000/svg" :class="iconClass">
<mask
id="mask0_1749_80944"
style="mask-type: luminance"
maskUnits="userSpaceOnUse"
x="94"
y="40"
width="885"
height="993"
>
<path d="M978.723 40H94V1033H978.723V40Z" fill="white" />
</mask>
<g mask="url(#mask0_1749_80944)">
<path
fill-rule="evenodd"
clip-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"
:fill="
tinycolor(
preDefinedHueData && preDefinedHueData[`_${colorRef.h}`]
? `hsv(${preDefinedHueData[`_${colorRef.h}`].shade.h},${preDefinedHueData[`_${colorRef.h}`].shade.s}%, ${
preDefinedHueData[`_${colorRef.h}`].shade.v
}%)`
: `hsv(${colorRef.h ?? defaultHueValue}, 100%, 30%)`,
).toHexString()
"
/>
<path
fill-rule="evenodd"
clip-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"
:fill="
tinycolor(
preDefinedHueData && preDefinedHueData[`_${colorRef.h}`]
? `hsv(${preDefinedHueData[`_${colorRef.h}`].tint.h},${preDefinedHueData[`_${colorRef.h}`].tint.s}%, ${
preDefinedHueData[`_${colorRef.h}`].tint.v
}%)`
: `hsv(${colorRef.h ?? defaultHueValue}, 50%, 100%)`,
).toHexString()
"
/>
</g>
</svg>
</template>
<NcTooltip placement="topLeft" :disabled="readonly">
<template #title> {{ $t('tooltip.changeIconColour') }} </template>
<template v-if="hue !== 0 && !hue && colorRef.h === defaultHueValue">
<slot name="default" />
</template>
<template v-else>
<svg width="16" height="16" viewBox="0 0 1073 1073" fill="none" xmlns="http://www.w3.org/2000/svg" :class="iconClass">
<mask
id="mask0_1749_80944"
style="mask-type: luminance"
maskUnits="userSpaceOnUse"
x="94"
y="40"
width="885"
height="993"
>
<path d="M978.723 40H94V1033H978.723V40Z" fill="white" />
</mask>
<g mask="url(#mask0_1749_80944)">
<path
fill-rule="evenodd"
clip-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"
:fill="
tinycolor(
preDefinedHueData && preDefinedHueData[`_${colorRef.h}`]
? `hsv(${preDefinedHueData[`_${colorRef.h}`].shade.h},${preDefinedHueData[`_${colorRef.h}`].shade.s}%, ${
preDefinedHueData[`_${colorRef.h}`].shade.v
}%)`
: `hsv(${colorRef.h ?? defaultHueValue}, 100%, 30%)`,
).toHexString()
"
/>
<path
fill-rule="evenodd"
clip-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"
:fill="
tinycolor(
preDefinedHueData && preDefinedHueData[`_${colorRef.h}`]
? `hsv(${preDefinedHueData[`_${colorRef.h}`].tint.h},${preDefinedHueData[`_${colorRef.h}`].tint.s}%, ${
preDefinedHueData[`_${colorRef.h}`].tint.v
}%)`
: `hsv(${colorRef.h ?? defaultHueValue}, 50%, 100%)`,
).toHexString()
"
/>
</g>
</svg>
</template>
</NcTooltip>
</div>
<template #overlay>
<div class="nc-base-icon-color-picker-dropdown relative bg-white rounded-lg border-1 border-gray-200">

3
packages/nc-gui/lang/en.json

@ -967,7 +967,8 @@
"clientKey": "Select .key file",
"clientCert": "Select .cert file",
"clientCA": "Select CA file",
"preFillFormInfo": "Generate share form URL with pre-filled field data. To get a pre-filled link, make sure you’ve filled the necessary fields in the form view builder.",
"changeIconColour": "Change Icon Colour",
"preFillFormInfo": "To get a prefilled link, make sure you’ve filled the necessary fields in the form view builder.",
"surveyFormInfo": "Form mode with one field per page"
},
"placeholder": {

Loading…
Cancel
Save