Image capture parameter

This commit is contained in:
Yurii
2026-05-18 18:08:13 +03:00
parent 5000dcef30
commit 47c98d1faf
5 changed files with 24 additions and 0 deletions

View File

@@ -215,6 +215,7 @@
"preview": "Preview",
"attachmentField": "Attachment Field",
"maxFileSize": "Max File Size (Mb)",
"capture": "Capture",
"isPersonalData": "Is Personal Data",
"useIframe": "Use Iframe",
"useNumericFormat": "Use Numeric Format",
@@ -359,6 +360,10 @@
"labelType": {
"state": "State",
"regular": "Regular"
},
"capture": {
"user": "User",
"environment": "Environment"
}
},
"logicalOperators": {

View File

@@ -82,6 +82,7 @@
}
},
"tooltips": {
"imageCapture": "Specifies which camera to use for capture of image data.",
"optionsReference": "Re-use options from another field.",
"currencyDecimal": "Use the Decimal DB type. In the app, values will be represented as strings. Check this parameter if precision is required.",
"cutHeight": "A text higher then a specified value will be cut with a 'show more' button displayed.",

View File

@@ -32,6 +32,16 @@
"tooltip": true,
"min": 0
},
{
"name": "capture",
"type": "enum",
"options": [
"",
"user",
"environment"
],
"tooltip": "imageCapture"
},
{
"name": "readOnly",
"type": "bool"

View File

@@ -7,6 +7,7 @@
type="file"
class="file pull-right"
{{#if acceptAttribute}}accept="{{acceptAttribute}}"{{/if}}
{{#if capture}} capture="{{capture}}" {{/if}}
tabindex="-1"
>
</label>

View File

@@ -62,6 +62,12 @@ export interface FileParams extends LinkParams {
* A max file size (in Mb).
*/
maxFileSize?: number;
/**
* Specifies which camera to use for capture of image data.
*
* @since 10.0.0
*/
capture?: null | 'user' | 'environment';
}
export interface FileOptions extends LinkOptions {
@@ -128,6 +134,7 @@ class FileFieldView<
...super.data(),
id: this.model.get(this.idName),
acceptAttribute: this.acceptAttribute,
capture: this.params.capture,
} as any;
if (this.mode === this.MODE_EDIT) {