mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 18:37:44 +02:00
26 lines
618 B
Lua
26 lines
618 B
Lua
local component = require("druid.component")
|
|
local input = require("druid.extended.input")
|
|
|
|
---@class input_password: druid.component
|
|
---@field druid druid_instance
|
|
---@field root node
|
|
local M = component.create("input_password")
|
|
|
|
|
|
---@param template string
|
|
---@param nodes table<hash, node>
|
|
function M:init(template, nodes)
|
|
self.druid = self:get_druid(template, nodes)
|
|
|
|
self.root = self:get_node("root")
|
|
self.input = self.druid:new(input, "input/root", "input/text", gui.KEYBOARD_TYPE_PASSWORD)
|
|
self.input:set_text("")
|
|
|
|
self.input.on_input_unselect:subscribe(function(_, text)
|
|
print(text)
|
|
end)
|
|
end
|
|
|
|
|
|
return M
|