buli
2023-05-23 07390e2fcb4adf27c928335bf27ae7939c5a80ad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * @Description: 
 * @version: 
 * @Author: chen jing wu
 * @Date: 2023-04-27 11:12:28
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-05-08 11:46:35
 */
import { LightningElement, api } from 'lwc';
 
export default class LexInputTableCell extends LightningElement {
    @api record;
    @api field;
    @api fieldType;
    @api type;
    @api required;
    value;
    label;
    connectedCallback() {
        this.value = this.record[this.field];
        this.label = this.field;
        this.type='text';
    }
    get isRequired(){
        return this.required;
    }
 
    handleInputChange(event) {
        this.value = event.target.value; 
    }
 
    @api
    inputValue() {
        return { value : this.value, field: this.field };
    }
    get isText() {
        if(this.fieldType)
        {
            this.type = 'text';
            return this.fieldType.toLowerCase()=='text';
        }
        return false;
      }
    get isNumber(){
        if(this.fieldType)
        {
            this.type = 'number';
            return this.fieldType.toLowerCase()=='number';
        }
        return false;
    }
}