feat: add feature to customize onClick behaviour for phone, email and links data type (#16265)

Fixes Issue: #15797

This PR adds a configurable click behavior setting for Phone, Email, and
Links field types, allowing users to customize what happens when
clicking on these fields.

A new option (**Click Behaviour**) to configure the default behaviour
for onClick of data is added in the settings page (Settings → Data Model
→ Object → Field Edit) for Phone, Email and Links data types.

Users can now choose between two actions:
- **Copy to clipboard**: Copies the value to clipboard with a success
toast message
- **Open as link**: Opens the value as a link (tel:, mailto:, or
http/https)

The default behaviour is persisted for all these three types(phone- Copy
to clipboard, email & links: open link) to maintain backward
compatibility.

**Screenshots :** 
<img width="2084" height="1736" alt="image"
src="https://github.com/user-attachments/assets/eb5d129c-e3e0-4334-b426-eb38d8a4840c"
/>

<img width="1474" height="1428" alt="image"
src="https://github.com/user-attachments/assets/487f4e44-6151-4254-bc5c-5398be5fc087"
/>
<img width="1594" height="1398" alt="image"
src="https://github.com/user-attachments/assets/abdbc213-7223-4d57-809e-4d55c90cda80"
/>

---------

Co-authored-by: Etienne <45695613+etiennejouan@users.noreply.github.com>
This commit is contained in:
Abhishek Kumar
2025-12-12 19:04:47 +05:30
committed by GitHub
parent 4f91b48470
commit 8dbcd506ed
26 changed files with 323 additions and 60 deletions
@@ -1,3 +1,9 @@
export enum FieldMetadataSettingsOnClickAction {
COPY = 'COPY',
OPEN_LINK = 'OPEN_LINK',
}
export type FieldMetadataMultiItemSettings = {
maxNumberOfValues?: number;
clickAction?: FieldMetadataSettingsOnClickAction;
};
@@ -84,6 +84,7 @@ export {
FieldMetadataDefaultArray,
} from './FieldMetadataDefaultValue';
export type { FieldMetadataMultiItemSettings } from './FieldMetadataMultiItemSettings';
export { FieldMetadataSettingsOnClickAction } from './FieldMetadataMultiItemSettings';
export type { TagColor, FieldMetadataOptions } from './FieldMetadataOptions';
export {
FieldMetadataDefaultOption,