Skip to content

Commit

Permalink
mui-x-tree-view.version=7.23.2
Browse files Browse the repository at this point in the history
  • Loading branch information
aerialist7 committed Dec 25, 2024
1 parent bf47334 commit 4c55154
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 34 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/karakum/mui/Generator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ private fun generateTreeViewDeclarations(
generate(typesFile, targetDir, Package.treeView)
}

"TreeView", "SimpleTreeView", "RichTreeView", "TreeItem2DragAndDropOverlay" -> {
"TreeView", "SimpleTreeView", "RichTreeView", "TreeItem2LabelInput", "TreeItem2DragAndDropOverlay" -> {
val typesFile = it.resolve("${it.name}.types.d.ts")
generate(typesFile, targetDir, Package.treeView)
}
Expand Down
10 changes: 6 additions & 4 deletions buildSrc/src/main/kotlin/karakum/mui/KotlinType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ private val STANDARD_TYPE_MAP = mapOf(
"React.HTMLAttributes<HTMLDivElement>" to "react.dom.html.HTMLAttributes<web.html.HTMLDivElement>",
"Partial<React.HTMLAttributes<HTMLDivElement>>" to "react.dom.html.HTMLAttributes<web.html.HTMLDivElement>",
"React.HTMLAttributes<HTMLElement>" to "react.dom.html.HTMLAttributes<web.html.HTMLElement>",
"MuiCancellableEventHandler<React.KeyboardEvent<HTMLLIElement>>" to "react.dom.events.KeyboardEventHandler<web.html.HTMLLIElement>",
"TreeViewCancellableEventHandler<React.KeyboardEvent<HTMLLIElement>>" to "react.dom.events.KeyboardEventHandler<web.html.HTMLLIElement>",
"TreeViewCancellableEventHandler<React.KeyboardEvent<HTMLInputElement>>" to "react.dom.events.KeyboardEventHandler<web.html.HTMLInputElement>",
"TreeViewCancellableEventHandler<React.FocusEvent<HTMLInputElement>>" to "react.dom.events.FocusEventHandler<web.html.HTMLInputElement>",

"NonNullable<React.HTMLAttributes<any>['tabIndex']>" to "Int",
"React.InputHTMLAttributes<unknown>['type']" to "InputType",
Expand Down Expand Up @@ -414,13 +416,13 @@ internal fun kotlinType(
return when (partialResult) {
"TouchRippleProps",
"NativeSelectInputProps",
-> DYNAMIC
-> DYNAMIC

"StandardInputProps",
-> "InputProps"
-> "InputProps"

"SelectProps",
-> "SelectProps<*>"
-> "SelectProps<*>"

else -> STANDARD_TYPE_MAP[partialResult] ?: partialResult
}
Expand Down
11 changes: 10 additions & 1 deletion buildSrc/src/main/kotlin/karakum/mui/adapters/Classes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ private fun String.cleanupTreeItemContentClasses(): String {
focused: string;
/** State class applied to the element when disabled. */
disabled: string;
/** Styles applied to the tree item icon and collapse/expand icon. */
/** Styles applied to the Tree Item icon and collapse/expand icon. */
iconContainer: string;
/** Styles applied to the label element. */
label: string;
/** Styles applied to the checkbox element. */
checkbox: string;
/** Styles applied to the input element that is visible when editing is enabled. */
labelInput: string;
/** Styles applied to the content element when editing is enabled. */
editing: string;
/** Styles applied to the content of the items that are editable. */
editable: string;
};
""",
"""
Expand All @@ -37,6 +43,9 @@ private fun String.cleanupTreeItemContentClasses(): String {
iconContainer: string;
label: string;
checkbox: string;
labelInput: string;
editing: string;
editable: string;
};
""",
)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mui-base.version=5.0.0-beta.40-0
mui-system.version=5.16.13
mui-lab.version=5.0.0-alpha.175
mui-x-date-pickers.version=5.0.20
mui-x-tree-view.version=7.12.0
mui-x-tree-view.version=7.23.2
# Flags
org.gradle.jvmargs=-Xms2g -Xmx4g
org.gradle.parallel=true
Expand Down
11 changes: 10 additions & 1 deletion mui-kotlin/src/jsMain/kotlin/muix/tree/view/TreeItem.classes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sealed external interface TreeItemClasses {
/** State class applied to the element when disabled. */
val disabled: ClassName

/** Styles applied to the tree item icon. */
/** Styles applied to the Tree Item icon. */
val iconContainer: ClassName

/** Styles applied to the label element. */
Expand All @@ -37,6 +37,15 @@ sealed external interface TreeItemClasses {
/** Styles applied to the checkbox element. */
val checkbox: ClassName

/** Styles applied to the input element that is visible when editing is enabled. */
val labelInput: ClassName

/** Styles applied to the content element when editing is enabled. */
val editing: ClassName

/** Styles applied to the content of the items that are editable. */
val editable: ClassName

/** Styles applied to the drag and drop overlay. */
val dragAndDropOverlay: ClassName
}
Expand Down
6 changes: 4 additions & 2 deletions mui-kotlin/src/jsMain/kotlin/muix/tree/view/TreeItem.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ external interface TreeItemProps :

/**
* The component used to render the content of the item.
* @deprecated Consider using the `<TreeItem2 />` component or the `useTreeItem2` hook instead. For more details, see https://mui.com/x/react-tree-view/tree-item-customization/.
* @default TreeItemContent
*/
var ContentComponent: react.ComponentType<TreeItemContentProps>?

/**
* Props applied to ContentComponent.
* @deprecated Consider using the `<TreeItem2 />` component or the `useTreeItem2` hook instead. For more details, see https://mui.com/x/react-tree-view/tree-item-customization/.
*/
var ContentProps: react.Props? /* React.HTMLAttributes<HTMLElement> & { ref?: React.Ref<HTMLElement>; } */

Expand All @@ -60,7 +62,7 @@ external interface TreeItemProps :
override var onFocus: react.dom.events.FocusEventHandler<web.html.HTMLLIElement>?

/**
* The tree item label.
* The Tree Item label.
*/
var label: react.ReactNode?

Expand Down Expand Up @@ -97,7 +99,7 @@ external interface TreeItemSlots {
var endIcon: react.ElementType<*>?

/**
* The icon to display next to the tree item's label.
* The icon to display next to the Tree Item's label.
*/
var icon: react.ElementType<*>?

Expand Down
10 changes: 10 additions & 0 deletions mui-kotlin/src/jsMain/kotlin/muix/tree/view/TreeItem2LabelInput.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Automatically generated - do not modify!

@file:JsModule("@mui/x-tree-view/TreeItem2LabelInput")

package muix.tree.view

/**
* @ignore - internal component.
*/
external val TreeItem2LabelInput: react.FC<TreeItem2LabelInputProps>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Automatically generated - do not modify!

package muix.tree.view

external interface TreeItem2LabelInputProps : react.Props {
var value: String?

/**
* Used to determine if the target of keydown or blur events is the input and prevent the event from propagating to the root.
*/
// var `data-element`: mui.system.Union? /* 'labelInput' */

var onChange: react.dom.events.ChangeEventHandler<web.html.HTMLInputElement>?

var onKeyDown: react.dom.events.KeyboardEventHandler<web.html.HTMLInputElement>?

var onBlur: react.dom.events.FocusEventHandler<web.html.HTMLInputElement>?

var autoFocus: Boolean? /* true */

var type: mui.system.Union? /* 'text' */
}
13 changes: 9 additions & 4 deletions mui-kotlin/src/jsMain/kotlin/muix/tree/view/TreeItemContent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ external interface TreeItemContentProps :
val iconContainer: ClassName
val label: ClassName
val checkbox: ClassName
val labelInput: ClassName
val editing: ClassName
val editable: ClassName
}

/**
* The tree item label.
* The Tree Item label.
*/
var label: react.ReactNode?

Expand All @@ -38,21 +41,23 @@ external interface TreeItemContentProps :
var itemId: String

/**
* The icon to display next to the tree item's label.
* The icon to display next to the Tree Item's label.
*/
var icon: react.ReactNode?

/**
* The icon to display next to the tree item's label. Either an expansion or collapse icon.
* The icon to display next to the Tree Item's label. Either an expansion or collapse icon.
*/
var expansionIcon: react.ReactNode?

/**
* The icon to display next to the tree item's label. Either a parent or end icon.
* The icon to display next to the Tree Item's label. Either a parent or end icon.
*/
var displayIcon: react.ReactNode?

var dragAndDropOverlayProps: TreeItem2DragAndDropOverlayProps?

var labelInputProps: TreeItem2LabelInputProps?
}

/**
Expand Down
2 changes: 1 addition & 1 deletion mui-kotlin/src/jsMain/kotlin/muix/tree/view/TreeView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package muix.tree.view

/**
* This component has been deprecated in favor of the new `SimpleTreeView` component.
* This component has been deprecated in favor of the new Simple Tree View component.
* You can have a look at how to migrate to the new component in the v7 [migration guide](https://mui.com/x/migration/migration-tree-view-v6/#use-simpletreeview-instead-of-treeview)
*
* Demos:
Expand Down
46 changes: 27 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4c55154

Please sign in to comment.