File tree Expand file tree Collapse file tree
invui-kotlin/src/main/kotlin/xyz/xenondevs/invui/dsl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,6 +115,28 @@ infix fun <T : Any> ProviderDslProperty<in T>.by(valueBuilder: DataComponentBuil
115115infix fun <T : Any > ProviderDslProperty <in T >.by (valueBuilder : Provider <DataComponentBuilder <T >>): Unit =
116116 by(valueBuilder.map(DataComponentBuilder <T >::build))
117117
118+ /* *
119+ * Sets this [List] property to a single value.
120+ * ```
121+ * lore by Component.text("Single line lore")
122+ * ```
123+ */
124+ @JvmName(" listByValue" )
125+ @ExperimentalDslApi
126+ infix fun <T : Any > ProviderDslProperty <in List <T >>.by (value : T ): Unit =
127+ by(listOf (value))
128+
129+ /* *
130+ * Sets this [List] property to a provider of a single value.
131+ * ```
132+ * lore by provider(Component.text("Single line lore"))
133+ * ```
134+ */
135+ @JvmName(" listByValueProvider" )
136+ @ExperimentalDslApi
137+ infix fun <T : Any > ProviderDslProperty <in List <T >>.by (value : Provider <T >): Unit =
138+ by(value.map(::listOf))
139+
118140/* *
119141 * A DSL property backed by a [Provider]. Can be set to a static value or bound to a reactive
120142 * [Provider] using the [by] infix function.
You can’t perform that action at this time.
0 commit comments