@jupyterlab/ui-components
Advanced tools
Comparing version 4.2.0-beta.1 to 4.2.0-beta.2
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
import { InputGroup } from './inputgroup'; | ||
import { ReactWidget } from './vdom'; | ||
import { StringExt } from '@lumino/algorithm'; | ||
import React, { useEffect, useState } from 'react'; | ||
import { Search } from '@jupyter/react-components'; | ||
import { searchIcon } from '../icon'; | ||
/** | ||
@@ -92,3 +93,4 @@ * Perform a fuzzy search on a single item. | ||
}; | ||
return (React.createElement(InputGroup, { className: "jp-FilterBox", inputRef: props.inputRef, type: "text", disabled: props.disabled, rightIcon: "ui-components:search", placeholder: props.placeholder, onChange: handleChange, value: filter })); | ||
return (React.createElement(Search, { className: "jp-FilterBox", ref: props.inputRef, value: filter, onChange: handleChange, placeholder: props.placeholder, disabled: props.disabled }, | ||
React.createElement(searchIcon.react, { slot: "end", tag: null }))); | ||
}; | ||
@@ -95,0 +97,0 @@ /** |
@@ -23,3 +23,3 @@ import { IRenderMime } from '@jupyterlab/rendermime-interfaces'; | ||
* | ||
* @param icon - either a string with the name of an existing icon | ||
* @param options - icon: either a string with the name of an existing icon | ||
* or an object with \{name: string, svgstr: string\} fields. | ||
@@ -266,2 +266,6 @@ * | ||
title?: string; | ||
/** | ||
* Optional slot property to specify the position of the icon in the template | ||
*/ | ||
slot?: string | null; | ||
} | ||
@@ -268,0 +272,0 @@ interface IResolverProps { |
@@ -37,3 +37,3 @@ // Copyright (c) Jupyter Development Team. | ||
* | ||
* @param icon - either a string with the name of an existing icon | ||
* @param options - icon: either a string with the name of an existing icon | ||
* or an object with \{name: string, svgstr: string\} fields. | ||
@@ -382,3 +382,3 @@ * | ||
const component = React.forwardRef((props = {}, ref) => { | ||
const { className, container, label, title, tag = 'div', ...styleProps } = { ...this._props, ...props }; | ||
const { className, container, label, title, slot, tag = 'div', ...styleProps } = { ...this._props, ...props }; | ||
// set up component state via useState hook | ||
@@ -404,3 +404,13 @@ const [, setId] = React.useState(this._uuid); | ||
} | ||
const svgComponent = (React.createElement("svg", { ...this.svgReactAttrs, dangerouslySetInnerHTML: { __html: this.svgInnerHTML }, ref: ref })); | ||
const svgProps = { ...this.svgReactAttrs }; | ||
if (!tag) { | ||
Object.assign(svgProps, { | ||
className: className || styleProps | ||
? classes(className, LabIconStyle.styleClass(styleProps)) | ||
: undefined, | ||
title: title, | ||
slot: slot | ||
}); | ||
} | ||
const svgComponent = (React.createElement("svg", { ...svgProps, ...this.svgReactAttrs, dangerouslySetInnerHTML: { __html: this.svgInnerHTML }, ref: ref })); | ||
if (container) { | ||
@@ -419,3 +429,4 @@ Private.initContainer({ container, className, styleProps, title }); | ||
: undefined, | ||
title: title | ||
title: title, | ||
slot: slot | ||
}; | ||
@@ -465,3 +476,3 @@ } | ||
(function (Private) { | ||
function blankElement({ className = '', container, label, title, tag = 'div', ...styleProps }) { | ||
function blankElement({ className = '', container, label, title, tag = 'div', slot, ...styleProps }) { | ||
if ((container === null || container === void 0 ? void 0 : container.className) === className) { | ||
@@ -468,0 +479,0 @@ // nothing needs doing, return the icon node |
{ | ||
"name": "@jupyterlab/ui-components", | ||
"version": "4.2.0-beta.1", | ||
"version": "4.2.0-beta.2", | ||
"description": "JupyterLab - UI components written in React", | ||
@@ -35,3 +35,2 @@ "homepage": "https://github.com/jupyterlab/jupyterlab", | ||
"cleansvg": "svgo --config svgo.yaml", | ||
"docs": "typedoc src", | ||
"docs:init": "bash docs/build.sh", | ||
@@ -45,8 +44,8 @@ "test": "jest", | ||
"dependencies": { | ||
"@jupyter/react-components": "^0.15.2", | ||
"@jupyter/web-components": "^0.15.2", | ||
"@jupyterlab/coreutils": "^6.2.0-beta.1", | ||
"@jupyterlab/observables": "^5.2.0-beta.1", | ||
"@jupyterlab/rendermime-interfaces": "^3.10.0-beta.1", | ||
"@jupyterlab/translation": "^4.2.0-beta.1", | ||
"@jupyter/react-components": "^0.15.3", | ||
"@jupyter/web-components": "^0.15.3", | ||
"@jupyterlab/coreutils": "^6.2.0-beta.2", | ||
"@jupyterlab/observables": "^5.2.0-beta.2", | ||
"@jupyterlab/rendermime-interfaces": "^3.10.0-beta.2", | ||
"@jupyterlab/translation": "^4.2.0-beta.2", | ||
"@lumino/algorithm": "^2.0.1", | ||
@@ -69,3 +68,3 @@ "@lumino/commands": "^2.3.0", | ||
"devDependencies": { | ||
"@jupyterlab/testing": "^4.2.0-beta.1", | ||
"@jupyterlab/testing": "^4.2.0-beta.2", | ||
"@types/jest": "^29.2.0", | ||
@@ -76,3 +75,2 @@ "@types/react": "^18.0.26", | ||
"svgo": "^3.0.1", | ||
"typedoc": "~0.24.7", | ||
"typescript": "~5.1.6" | ||
@@ -79,0 +77,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
929539
7
19932