This commit is contained in:
NoryiE
2025-11-04 21:41:17 +00:00
parent 23ddaddee6
commit 003d8c41fe
2 changed files with 31 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ Extends: `PropertySystem`
|[BaseElement:getCurrentState](#baseelement-getcurrentstate)|string|nil|Gets current primary state|
|[BaseElement:getActiveStates](#baseelement-getactivestates)|table|Gets all active states|
|[BaseElement:updateConditionalStates](#baseelement-updateconditionalstates)|BaseElement|Updates conditional states|
|[BaseElement:registerResponsiveState](#baseelement-registerresponsivestate-statename-condition-options)|BaseElement|Registers a state that responds to parent dimensions|
|[BaseElement:unregisterState](#baseelement-unregisterstate-statename)|BaseElement|Removes state definition|
|[BaseElement:fireEvent](#baseelement-fireevent-event-any)|table|Triggers event callbacks with provided arguments|
|[BaseElement:onChange](#baseelement-onchange-property-callback)|table|Watches property changes with callback notification|
@@ -151,6 +152,18 @@ Updates all states that have auto-conditions
### Returns
* `BaseElement` self
## BaseElement:registerResponsiveState(stateName, condition, options?)
Registers a responsive state that reacts to parent size changes
### Parameters
* `stateName` `string` The name of the state
* `condition` `string|function` Condition as string expression or function: function(element) return boolean end
* `options` *(optional)* `table|number` Options table with 'priority' and 'observe', or just priority number
### Returns
* `BaseElement` self
## BaseElement:unregisterState(stateName)
Removes a state from the registry

View File

@@ -0,0 +1,18 @@
# BaseElement
_This is the responsive plugin. It provides a fluent builder API for creating responsive states with an intuitive when/apply/otherwise syntax._
## Functions
|Method|Returns|Description|
|---|---|---|
|[BaseElement:responsive](#baseelement-responsive-self)|ResponsiveBuilder|Creates a responsive state builder|
## BaseElement:responsive(self)
Creates a responsive builder for defining responsive states
### Parameters
* `self` `BaseElement` The element to create the builder for
### Returns
* `ResponsiveBuilder` `builder` The responsive builder instance