已合并
多态样式支持hover #31478
多态样式支持hover #31478
已合并
Yun-xier创建于 3月23日
共 4 个文件变更+65-1
@@ -17020,6 +17020,18 @@ declare interface StateStyles {
17020 * @since 11 dynamic17020 * @since 11 dynamic
17021 */17021 */
17022 selected?: object;17022 selected?: object;
17023+ 
17024+ /**
17025+ * Defines hovered state styles.
17026+ *
17027+ * @type { ?object }
17028+ * @syscap SystemCapability.ArkUI.ArkUI.Full
17029+ * @stagemodelonly
17030+ * @crossplatform
17031+ * @atomicservice
17032+ * @since 26.0.0 dynamic
17033+ */
17034+ hovered?: object;
17023}17035}
17024 17036 
17025/**17037/**
@@ -21031,6 +21043,18 @@ declare interface AttributeModifier<T> {
21031 * @since 12 dynamic21043 * @since 12 dynamic
21032 */21044 */
21033 applySelectedAttribute?(instance: T) : void;21045 applySelectedAttribute?(instance: T) : void;
21046+ 
21047+ /**
21048+ * Defines the function that updates the hovered attribute.
21049+ *
21050+ * @param { T } instance
21051+ * @syscap SystemCapability.ArkUI.ArkUI.Full
21052+ * @stagemodelonly
21053+ * @crossplatform
21054+ * @atomicservice
21055+ * @since 26.0.0 dynamic
21056+ */
21057+ applyHoveredAttribute?(instance: T) : void;
21034}21058}
21035 21059 
21036/**21060/**
@@ -260,6 +260,17 @@ export enum UIState {
260 * @since 20 dynamic260 * @since 20 dynamic
261 */261 */
262 SELECTED = 1 << 3,262 SELECTED = 1 << 3,
263+ 
264+ /**
265+ * The hovered state.
266+ *
267+ * @syscap SystemCapability.ArkUI.ArkUI.Full
268+ * @stagemodelonly
269+ * @crossplatform
270+ * @atomicservice
271+ * @since 26.0.0 dynamic
272+ */
273+ HOVERED = 1 << 4,
263}274}
264 275 
265 /**276 /**
@@ -264,7 +264,16 @@ export enum UIState {
264 * @stagemodelonly264 * @stagemodelonly
265 * @since 24 static265 * @since 24 static
266 */266 */
267- SELECTED = 1 << 3267+ SELECTED = 1 << 3,
268+ 
269+ /**
270+ * The hovered state.
271+ *
272+ * @syscap SystemCapability.ArkUI.ArkUI.Full
273+ * @stagemodelonly
274+ * @since 26.0.0 static
275+ */
276+ HOVERED = 1 << 4,
268}277}
269 278 
270/**279/**
@@ -6833,6 +6833,16 @@ export declare interface StateStyles {
6833 * @since 23 static6833 * @since 23 static
6834 */6834 */
6835 selected?: CustomStyles;6835 selected?: CustomStyles;
6836+ 
6837+ /**
6838+ * Defines hovered state styles.
6839+ *
6840+ * @type { ?CustomStyles }
6841+ * @syscap SystemCapability.ArkUI.ArkUI.Full
6842+ * @stagemodelonly
6843+ * @since 26.0.0 static
6844+ */
6845+ hovered?: CustomStyles;
6836}6846}
6837/**6847/**
6838 * Defines the options of popup message.6848 * Defines the options of popup message.
@@ -9072,6 +9082,16 @@ export declare interface AttributeModifier<T> {
9072 */9082 */
9073 default applySelectedAttribute(instance: T) : void;9083 default applySelectedAttribute(instance: T) : void;
9074 9084 
9085+ /**
9086+ * Defines the function that updates the hovered attribute.
9087+ *
9088+ * @param { T } instance
9089+ * @syscap SystemCapability.ArkUI.ArkUI.Full
9090+ * @stagemodelonly
9091+ * @since 26.0.0 static
9092+ */
9093+ default applyHoveredAttribute(instance: T) : void;
9094+ 
9075 /**9095 /**
9076 * Specifies the states to be monitored.9096 * Specifies the states to be monitored.
9077 * Override this method to specify which states (Normal, Pressed, Focused, Disabled, Selected) should be9097 * Override this method to specify which states (Normal, Pressed, Focused, Disabled, Selected) should be