mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-17 05:47:34 +08:00
Filterable attributes, Int64 entity
This commit is contained in:
23
js/template/pin/Int64PinTemplate.js
Normal file
23
js/template/pin/Int64PinTemplate.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import { html } from "lit"
|
||||
import IntInputPinTemplate from "./IntPinTemplate"
|
||||
import INumericInputPinTemplate from "./INumericInputPinTemplate"
|
||||
|
||||
/** @typedef {import("../../entity/IntegerEntity").default} IntegerEntity */
|
||||
|
||||
export default class Int64InputPinTemplate extends IntInputPinTemplate {
|
||||
|
||||
/** @param {String[]} values */
|
||||
setInputs(values = [], updateDefaultValue = false) {
|
||||
if (!values || values.length == 0) {
|
||||
values = [this.getInput()]
|
||||
}
|
||||
super.setInputs(values, false)
|
||||
if (updateDefaultValue) {
|
||||
if (!values[0].match(/[\-\+]?[0-9]+/)) {
|
||||
return
|
||||
}
|
||||
const parsedValues = [BigInt(values[0])]
|
||||
this.setDefaultValue(parsedValues, values)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user