diff --git a/Project.toml b/Project.toml index 4a27bc0..9182ea3 100644 --- a/Project.toml +++ b/Project.toml @@ -26,7 +26,7 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6" [compat] Aqua = "0.6" CodecZlib = "0.6, 0.7" -DashBase = "0.2" +DashBase = "0.2.1" DashCoreComponents = "2.0.0" DashHtmlComponents = "2.0.0" DashTable = "5.0.0" diff --git a/src/app/dashapp.jl b/src/app/dashapp.jl index 92fccce..7c050b3 100644 --- a/src/app/dashapp.jl +++ b/src/app/dashapp.jl @@ -40,27 +40,6 @@ mutable struct DashApp end -const VecChildTypes = Union{NTuple{N, DashBase.Component} where {N}, Vector{<:DashBase.Component}} - -function Base.getindex(component::DashBase.Component, id::AbstractString) - component.id == id && return component - hasproperty(component, :children) || return nothing - cc = component.children - return if cc isa Union{VecChildTypes, DashBase.Component} - cc[id] - elseif cc isa AbstractVector - identity.(filter(x->hasproperty(x, :id), cc))[id] - else - nothing - end -end -function Base.getindex(children::VecChildTypes, id::AbstractString) - for element in children - element.id == id && return element - el = element[id] - el !== nothing && return el - end -end #only name, index_string and layout are available to set function Base.setproperty!(app::DashApp, property::Symbol, value) diff --git a/test/core.jl b/test/core.jl index fd9f030..99370b2 100644 --- a/test/core.jl +++ b/test/core.jl @@ -201,17 +201,3 @@ end @test_throws ErrorException make_handler(app) end -@testset "Index by id" begin - app = dash() - app.layout = html_div() do - dcc_input(id = "my-id", value="initial value", type = "text"), - html_div(id = "my-div", children = [ - html_div(), - "string", - html_div(id = "target") - ]), - html_div(id = "my-div2") - end - @test app.layout["target"].id == "target" - @test app.layout["ups"] === nothing -end