mirror of
https://github.com/Insality/druid
synced 2025-09-27 10:02:19 +02:00
Remove register and update examples
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
local component = require("druid.component")
|
||||
local input = require("druid.extended.input")
|
||||
|
||||
---@class basic_input: druid.base_component
|
||||
---@field druid druid_instance
|
||||
@@ -12,9 +11,9 @@ local M = component.create("basic_input")
|
||||
function M:init(template, nodes)
|
||||
self.druid = self:get_druid(template, nodes)
|
||||
|
||||
self.input = self.druid:new(input, "input/root", "input/text")
|
||||
self.input = self.druid:new_input("input/root", "input/text")
|
||||
|
||||
self.input_2 = self.druid:new(input, "input_2/root", "input_2/text") --[[@as druid.input]]
|
||||
self.input_2 = self.druid:new_input("input_2/root", "input_2/text") --[[@as druid.input]]
|
||||
|
||||
-- you can set custom style for input and their components
|
||||
-- Check in the example, how long tap on bottom input will erase text
|
||||
|
@@ -1,7 +1,6 @@
|
||||
local component = require("druid.component")
|
||||
local input = require("druid.extended.input")
|
||||
|
||||
---@class input_password: druid.component
|
||||
---@class input_password: druid.base_component
|
||||
---@field druid druid_instance
|
||||
---@field root node
|
||||
local M = component.create("input_password")
|
||||
@@ -13,7 +12,7 @@ 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 = self.druid:new_input("input/root", "input/text", gui.KEYBOARD_TYPE_PASSWORD)
|
||||
self.input:set_text("")
|
||||
|
||||
self.input.on_input_unselect:subscribe(function(_, text)
|
||||
|
@@ -1,5 +1,4 @@
|
||||
local component = require("druid.component")
|
||||
local rich_input = require("druid.custom.rich_input.rich_input")
|
||||
|
||||
---@class rich_input: druid.base_component
|
||||
---@field druid druid_instance
|
||||
@@ -11,10 +10,10 @@ local M = component.create("rich_input")
|
||||
function M:init(template, nodes)
|
||||
self.druid = self:get_druid(template, nodes)
|
||||
|
||||
self.rich_input = self.druid:new(rich_input, "rich_input") --[[@as druid.rich_input]]
|
||||
self.rich_input = self.druid:new_rich_input("rich_input") --[[@as druid.rich_input]]
|
||||
self.rich_input:set_placeholder("Enter text")
|
||||
|
||||
self.rich_input_2 = self.druid:new(rich_input, "rich_input_2") --[[@as druid.rich_input]]
|
||||
self.rich_input_2 = self.druid:new_rich_input("rich_input_2") --[[@as druid.rich_input]]
|
||||
self.rich_input_2:set_placeholder("Enter text")
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user