Closes [127884](https://github.com/elastic/kibana/issues/127884)
## Summary
…
This PRs adds an option to copy column values to Clipboard via Column actions dropdown. Values will be separated with a new line and can be pasted directly to a spreadsheet.
<img width="1385" alt="Screenshot 2022-05-17 at 15 40 45" src="https://user-images.githubusercontent.com/1415710/168825260-8e42f9ed-52bf-4862-a26d-0e0651a6e207.png">
<details>
<summary>Example output for the included index data</summary>
```
PUT sample
PUT sample/_mapping
{
"properties": {
"keyword_key": {
"type": "keyword"
},
"text_message": {
"type": "text"
},
"number_amount": {
"type": "long"
},
"number_price": {
"type": "float"
},
"bool_enabled": {
"type": "boolean"
},
"binary_blob": {
"type": "binary"
},
"date": {
"type": "date"
},
"date_nanos": {
"type": "date_nanos"
},
"object_user": {
"properties": {
"first": { "type": "text" },
"last": { "type": "text" }
}
},
"nested_user": {
"type": "nested"
},
"flattened_labels": {
"type": "flattened"
},
"range_time_frame": {
"type": "date_range",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
},
"ip_addr": {
"type": "ip"
},
"version": {
"type": "version"
},
"vector": {
"type": "dense_vector",
"dims": 3
},
"geo_point": {
"type": "geo_point"
},
"histogram" : {
"type" : "histogram"
},
"rank_features": {
"type": "rank_features"
},
"geometry": {
"type": "shape"
}
}
}
PUT sample/_doc/1
{
"keyword_key": "abcd1",
"text_message": "Hi there! I am a sample string.",
"number_amount": 50,
"number_price": 10.99,
"bool_enabled": false,
"binary_blob": "U29tZSBiaW5hcnkgYmxvYg==",
"date": "2022-05-22T12:10:30Z",
"date_nanos": "2022-01-01T12:10:30.123456789Z",
"object_user": {
"first": "John",
"last": "Smith"
},
"nested_user" : [
{
"first": "John",
"last": "Smith"
},
{
"first": "Alice",
"last": "White"
}
],
"flattened_labels": {
"priority": "urgent",
"release": ["v1.2.5", "v1.3.0"]
},
"range_time_frame" : {
"gte" : "2015-10-31 12:00:00",
"lte" : "2015-11-01"
},
"ip_addr": "192.168.1.1",
"version": "1.2.3",
"vector": [0.5, 10, 6],
"geo_point" : "POINT (-71.34 41.12)",
"array_tags": [ "elasticsearch", "wow" ],
"array_objects": [
{
"name": "prog_list",
"description": "programming list"
},
{
"name": "cool_list",
"description": "cool stuff list"
}
],
"histogram": {
"values": [0.1, 0.2, 0.3, 0.4, 0.5],
"counts": [3, 7, 23, 12, 6]
},
"rank_features": {
"1star": 10,
"2star": 100
},
"geometry": {
"type" : "polygon",
"coordinates" : [
[ [1000.0, -1001.0], [1001.0, -1001.0], [1001.0, -1000.0], [1000.0, -1000.0], [1000.0, -1001.0] ]
]
}
}
PUT sample/_doc/2
{
"keyword_key": "=1+2\";=1+2",
"text_message": "I'm multiline\n*&%$#@",
"number_amount": 10,
"number_price": 105.99,
"bool_enabled": true,
"binary_blob": "U29tZSBiaW5hcnkgYmxvYg==",
"date": "2022-05-20",
"date_nanos": "2022-01-02T11:10:30.123456789Z",
"object_user": {
"first": "Jane",
"last": "Smith"
},
"nested_user": [
{
"first": "Jane",
"last": "Smith"
}
],
"flattened_labels": {
"priority": "minor",
"release": ["v1.4.5"]
},
"range_time_frame": {
"gte": "2015-10-31 12:00:00",
"lte": "2016-11-01"
},
"ip_addr": "192.168.1.0",
"version": "1.3.3",
"vector": [0.5, 12, 6],
"geo_point": {
"lat": 41.12,
"lon": -71.34
},
"array_tags": [ "=1+2'\" ;,=1+2" ],
"array_objects": [
{
"name": "elastic_list",
"description": "elastic list"
}
],
"histogram": {
"values": [0.1, 0.25, 0.35, 0.4, 0.45, 0.5],
"counts": [8, 17, 8, 7, 6, 2]
},
"rank_features": {
"1star": 20,
"2star": 350
},
"geometry": {
"type": "geometrycollection",
"geometries": [
{
"type": "point",
"coordinates": [1000.0, 100.0]
},
{
"type": "linestring",
"coordinates": [ [1001.0, 100.0], [1002.0, 100.0] ]
}
]
}
}
```
</details>
<img width="1509" alt="Screenshot 2022-05-31 at 14 28 10" src="https://user-images.githubusercontent.com/1415710/171173477-79b0af7b-047d-4828-ad29-8cc5ee501720.png">
In case of formulas, they will be [escaped](https://owasp.org/www-community/attacks/CSV_Injection) and user will be notified about it
<img width="466" alt="Screenshot 2022-05-30 at 17 09 04" src="https://user-images.githubusercontent.com/1415710/171173724-167f1064-3ea1-4103-ac6f-1c8460b3f6e8.png">
Output is the same even if `discover:searchFieldsFromSource` is enabled.
This new feature will be also available for embeddable on Dashboard page and on Surrounding documents page.
### Checklist
- [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios(https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
_* Includes also changes from https://github.com/elastic/kibana/pull/131899 until it's merged_