@itwin/components-react 4.13.3 → 4.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.js +1 -0
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
- package/lib/cjs/components-react/inputs/ParsedInput.d.ts +1 -1
- package/lib/cjs/components-react/inputs/ParsedInput.d.ts.map +1 -1
- package/lib/cjs/components-react/inputs/ParsedInput.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.d.ts +1 -1
- package/lib/cjs/components-react/properties/renderers/value/MergedPropertyValueRenderer.d.ts +1 -1
- package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts +1 -1
- package/lib/cjs/components-react/properties/renderers/value/WithContextStyle.d.ts +1 -1
- package/lib/cjs/components-react/properties/renderers/value/WithContextStyle.d.ts.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.js +1 -0
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
- package/lib/esm/components-react/inputs/ParsedInput.d.ts +1 -1
- package/lib/esm/components-react/inputs/ParsedInput.d.ts.map +1 -1
- package/lib/esm/components-react/inputs/ParsedInput.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.d.ts +1 -1
- package/lib/esm/components-react/properties/renderers/value/MergedPropertyValueRenderer.d.ts +1 -1
- package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts +1 -1
- package/lib/esm/components-react/properties/renderers/value/WithContextStyle.d.ts +1 -1
- package/lib/esm/components-react/properties/renderers/value/WithContextStyle.d.ts.map +1 -1
- package/package.json +11 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Change Log - @itwin/components-react
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 21 May 2024 08:21:34 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.13.4
|
|
6
|
+
Tue, 21 May 2024 08:21:34 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
4
9
|
|
|
5
10
|
## 4.13.3
|
|
6
11
|
Fri, 17 May 2024 09:43:31 GMT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoritePropertiesRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components-react/favorite/FavoritePropertiesRenderer.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAGzE;;GAEG;AACH,KAAK,UAAU,GAAG,CAAC,SAAS,EAAE,OAAO,GAAG,gBAAgB,KAAK;IAC3D,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,qBAAa,0BAA0B;IACrC;;;;OAIG;IACI,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO;IAIxD;;;;;;;;;;OAUG;IACI,eAAe,CACpB,YAAY,EAAE,YAAY,EAC1B,WAAW,CAAC,EAAE,WAAW,EACzB,UAAU,CAAC,EAAE,UAAU,GACtB,WAAW,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"FavoritePropertiesRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components-react/favorite/FavoritePropertiesRenderer.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAGzE;;GAEG;AACH,KAAK,UAAU,GAAG,CAAC,SAAS,EAAE,OAAO,GAAG,gBAAgB,KAAK;IAC3D,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,qBAAa,0BAA0B;IACrC;;;;OAIG;IACI,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO;IAIxD;;;;;;;;;;OAUG;IACI,eAAe,CACpB,YAAY,EAAE,YAAY,EAC1B,WAAW,CAAC,EAAE,WAAW,EACzB,UAAU,CAAC,EAAE,UAAU,GACtB,WAAW,GAAG,MAAM;CAexB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoritePropertiesRenderer.js","sourceRoot":"","sources":["../../../../src/components-react/favorite/FavoritePropertiesRenderer.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,oDAAsC;AAGtC,iEAA8D;AAS9D;;GAEG;AACH,MAAa,0BAA0B;IACrC;;;;OAIG;IACI,YAAY,CAAC,YAA0B;QAC5C,OAAO,YAAY,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC;IACrD,CAAC;IAED;;;;;;;;;;OAUG;IACI,eAAe,CACpB,YAA0B,EAC1B,WAAyB,EACzB,UAAuB;QAEvB,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CACjC,2CAAoB,EACpB,EAAE,YAAY,EAAE,WAAW,EAAE,EAC7B,IAAI,CACL,CAAC;QACF,IAAI,UAAU,EAAE,CAAC;YACf,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"FavoritePropertiesRenderer.js","sourceRoot":"","sources":["../../../../src/components-react/favorite/FavoritePropertiesRenderer.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,oDAAsC;AAGtC,iEAA8D;AAS9D;;GAEG;AACH,MAAa,0BAA0B;IACrC;;;;OAIG;IACI,YAAY,CAAC,YAA0B;QAC5C,OAAO,YAAY,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC;IACrD,CAAC;IAED;;;;;;;;;;OAUG;IACI,eAAe,CACpB,YAA0B,EAC1B,WAAyB,EACzB,UAAuB;QAEvB,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CACjC,2CAAoB,EACpB,EAAE,YAAY,EAAE,WAAW,EAAE,EAC7B,IAAI,CACL,CAAC;QACF,IAAI,UAAU,EAAE,CAAC;YACf,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,wEAAwE;YACxE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAxCD,gEAwCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Favorite\n */\n\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport type { Orientation } from \"@itwin/core-react\";\nimport type { PropertyData } from \"../propertygrid/PropertyDataProvider\";\nimport { FavoritePropertyList } from \"./FavoritePropertyList\";\n\n/**\n * Basic recreation of the `createRoot` function type, intentionally not exported.\n */\ntype CreateRoot = (container: Element | DocumentFragment) => {\n render(children: React.ReactNode): void;\n};\n\n/** Renderer for Favorite Property List\n * @public\n */\nexport class FavoritePropertiesRenderer {\n /**\n * Evaluates if a PropertyData contain Favorite records.\n * @param propertyData PropertyData containing records\n * @returns true if it contains Favorite records\n */\n public hasFavorites(propertyData: PropertyData): boolean {\n return propertyData.records.Favorite !== undefined;\n }\n\n /**\n * Allow creating an HTMLElement containing the `<FavoritePropertyList />` component so it can be added outside of a React component (`showCard` is the main expected use)\n *\n * Note: When using React18, in order to remove the `ReactDOM.render` warning you will need to provide the `createRoot` function to this function,\n * the parameter type is intentionally simplified to not depend on React18 type.\n *\n * @param propertyData PropertyData containing Favorite records to display.\n * @param orientation Orientation of the items\n * @param createRoot `createRoot` function imported from `import { createRoot } from \"react-dom/client\";`\n * @returns a `div` HTMLElement with the `<FavoritePropertyList />` rendered within it.\n */\n public renderFavorites(\n propertyData: PropertyData,\n orientation?: Orientation,\n createRoot?: CreateRoot\n ): HTMLElement | string {\n const div = document.createElement(\"div\");\n const element = React.createElement(\n FavoritePropertyList,\n { propertyData, orientation },\n null\n );\n if (createRoot) {\n createRoot(div).render(element);\n } else {\n // eslint-disable-next-line react/no-deprecated, deprecation/deprecation\n ReactDOM.render(element, div);\n }\n return div;\n }\n}\n"]}
|
|
@@ -25,5 +25,5 @@ export interface ParsedInputProps extends CommonProps {
|
|
|
25
25
|
/** Generic Input component that requires formatting and parsing functions to be passed in as props.
|
|
26
26
|
* @public
|
|
27
27
|
*/
|
|
28
|
-
export declare const ParsedInput: (props: ParsedInputProps) => React.
|
|
28
|
+
export declare const ParsedInput: (props: ParsedInputProps) => React.ReactNode;
|
|
29
29
|
//# sourceMappingURL=ParsedInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParsedInput.d.ts","sourceRoot":"","sources":["../../../../src/components-react/inputs/ParsedInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,qDAAqD;IACrD,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,YAAY,CAAC;IACnD,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACnC;AA+HD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"ParsedInput.d.ts","sourceRoot":"","sources":["../../../../src/components-react/inputs/ParsedInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CA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;YACvC,iBAAiB,CAAC,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;YACxD,cAAc,CAAC,KAAK,CAAC,CAAC;YACtB,KAAK,CAAC,cAAc,EAAE,CAAC;QACzB,CAAC;IACH,CAAC,EACD,CAAC,WAAW,EAAE,qBAAqB,CAAC,CACrC,CAAC;IAEF,MAAM,UAAU,GAAG,IAAA,oBAAU,EAC3B,SAAS,EACT,yBAAyB,EACzB,WAAW,IAAI,mCAAmC,CACnD,CAAC;IAEF,OAAO,CACL,oBAAC,qBAAK,mBACQ,yBAAyB,EACrC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,GACZ,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,WAAW,
|
|
1
|
+
{"version":3,"file":"ParsedInput.js","sourceRoot":"","sources":["../../../../src/components-react/inputs/ParsedInput.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,4DAAoC;AACpC,6CAAkC;AAClC,wDAA6C;AAG7C,8BAA4B;AAoB5B,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAG5C,SAAS,qBAAqB,CAC9B,EACE,YAAY,EACZ,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EACD,GAAG;IAEH,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnD,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,qBAAqB,GAAG,KAAK,CAAC,MA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,KAAK,CAAC,CAAC;YACjD,KAAK,CAAC,cAAc,EAAE,CAAC;QACzB,CAAC;QACD,IAAI,KAAK,CAAC,GAAG,KAAK,iBAAG,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YACvC,iBAAiB,CAAC,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;YACxD,cAAc,CAAC,KAAK,CAAC,CAAC;YACtB,KAAK,CAAC,cAAc,EAAE,CAAC;QACzB,CAAC;IACH,CAAC,EACD,CAAC,WAAW,EAAE,qBAAqB,CAAC,CACrC,CAAC;IAEF,MAAM,UAAU,GAAG,IAAA,oBAAU,EAC3B,SAAS,EACT,yBAAyB,EACzB,WAAW,IAAI,mCAAmC,CACnD,CAAC;IAEF,OAAO,CACL,oBAAC,qBAAK,mBACQ,yBAAyB,EACrC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,GACZ,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,WAAW,GACtB,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { Key } from \"ts-key-enum\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport type { ParseResults } from \"@itwin/appui-abstract\";\nimport \"./ParsedInput.scss\";\n\n/** Props for [[ParsedInput]] control\n * @public\n */\nexport interface ParsedInputProps extends CommonProps {\n /** InitialValue which is used to restore input field if ESC is pressed */\n initialValue: number;\n /** Function used to format the value */\n formatValue: (value: number) => string;\n /** Function used to parse user input into a value */\n parseString: (stringValue: string) => ParseResults;\n /** Function to call when value is changed */\n onChange?: (newValue: number) => void;\n /** if readonly then only the formatValue function is used. */\n readonly?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n}\n\nconst ForwardRefParsedInput = React.forwardRef<\n HTMLInputElement,\n ParsedInputProps\n>(function ForwardRefParsedInput(\n {\n initialValue,\n formatValue,\n parseString,\n readonly,\n className,\n style,\n onChange,\n },\n ref\n) {\n const currentValueRef = React.useRef(initialValue);\n const isMountedRef = React.useRef(false);\n const lastFormattedValueRef = React.useRef(formatValue(initialValue));\n const [formattedValue, setFormattedValue] = React.useState(\n () => lastFormattedValueRef.current\n );\n const [hasBadInput, setHasBadInput] = React.useState(false);\n\n React.useEffect(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n\n // See if new initialValue props have changed since component mounted\n React.useEffect(() => {\n currentValueRef.current = initialValue;\n const currentFormattedValue = formatValue(currentValueRef.current);\n if (currentFormattedValue !== lastFormattedValueRef.current) {\n lastFormattedValueRef.current = currentFormattedValue;\n setFormattedValue(lastFormattedValueRef.current);\n setHasBadInput(false);\n }\n }, [formatValue, initialValue]);\n\n const handleChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setFormattedValue(event.currentTarget.value);\n },\n []\n );\n\n const updateValueFromString = React.useCallback(\n (strVal: string) => {\n if (lastFormattedValueRef.current === strVal) return;\n\n const parseResults = parseString(strVal);\n // istanbul ignore else\n if (!parseResults.parseError) {\n // istanbul ignore else\n if (\n undefined !== parseResults.value &&\n typeof parseResults.value === \"number\"\n ) {\n const currentValue = parseResults.value;\n // istanbul ignore else\n if (currentValue !== currentValueRef.current) {\n currentValueRef.current = currentValue;\n onChange && onChange(currentValueRef.current);\n }\n // istanbul ignore else\n if (isMountedRef.current) {\n lastFormattedValueRef.current = formatValue(currentValue);\n setFormattedValue(lastFormattedValueRef.current);\n setHasBadInput(false);\n }\n }\n } else {\n setHasBadInput(true);\n }\n },\n [formatValue, onChange, parseString]\n );\n\n const handleBlur = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n updateValueFromString(event.target.value);\n },\n [updateValueFromString]\n );\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n // istanbul ignore else\n if (event.key === Key.Enter.valueOf()) {\n updateValueFromString(event.currentTarget.value);\n event.preventDefault();\n }\n if (event.key === Key.Escape.valueOf()) {\n setFormattedValue(formatValue(currentValueRef.current));\n setHasBadInput(false);\n event.preventDefault();\n }\n },\n [formatValue, updateValueFromString]\n );\n\n const classNames = classnames(\n className,\n \"components-parsed-input\",\n hasBadInput && \"components-parsed-input-has-error\"\n );\n\n return (\n <Input\n data-testid=\"components-parsed-input\"\n ref={ref}\n style={style}\n className={classNames}\n onKeyDown={handleKeyDown}\n onBlur={handleBlur}\n onChange={handleChange}\n value={formattedValue}\n disabled={readonly}\n size=\"small\"\n />\n );\n});\n\n/** Generic Input component that requires formatting and parsing functions to be passed in as props.\n * @public\n */\nexport const ParsedInput: (props: ParsedInputProps) => React.ReactNode =\n ForwardRefParsedInput;\n"]}
|
|
@@ -11,6 +11,6 @@ export declare class ArrayPropertyValueRenderer implements IPropertyValueRendere
|
|
|
11
11
|
/** Checks if the renderer can handle given property */
|
|
12
12
|
canRender(record: PropertyRecord): boolean;
|
|
13
13
|
/** Method that returns a JSX representation of PropertyRecord */
|
|
14
|
-
render(record: PropertyRecord, context?: PropertyValueRendererContext): React.ReactNode;
|
|
14
|
+
render(record: PropertyRecord, context?: PropertyValueRendererContext): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=ArrayPropertyValueRenderer.d.ts.map
|
package/lib/cjs/components-react/properties/renderers/value/MergedPropertyValueRenderer.d.ts
CHANGED
|
@@ -10,6 +10,6 @@ export declare class MergedPropertyValueRenderer implements IPropertyValueRender
|
|
|
10
10
|
/** Checks if the renderer can handle given property */
|
|
11
11
|
canRender(record: PropertyRecord): boolean;
|
|
12
12
|
/** Method that returns a JSX representation of PropertyRecord */
|
|
13
|
-
render(_record: PropertyRecord, context?: PropertyValueRendererContext): import("react").ReactNode;
|
|
13
|
+
render(_record: PropertyRecord, context?: PropertyValueRendererContext): string | number | boolean | Iterable<import("react").ReactNode> | import("react").JSX.Element | null | undefined;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=MergedPropertyValueRenderer.d.ts.map
|
package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ export declare class StructPropertyValueRenderer implements IPropertyValueRender
|
|
|
11
11
|
/** Checks if the renderer can handle given property */
|
|
12
12
|
canRender(record: PropertyRecord): boolean;
|
|
13
13
|
/** Method that returns a JSX representation of PropertyRecord */
|
|
14
|
-
render(record: PropertyRecord, context?: PropertyValueRendererContext): React.ReactNode;
|
|
14
|
+
render(record: PropertyRecord, context?: PropertyValueRendererContext): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=StructPropertyValueRenderer.d.ts.map
|
|
@@ -6,5 +6,5 @@ import type { PropertyValueRendererContext } from "../../ValueRendererManager";
|
|
|
6
6
|
/** Wraps a React component with a span element with a given style attribute
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
|
-
export declare const withContextStyle: (node: React.ReactNode, context?: PropertyValueRendererContext) => React.ReactNode;
|
|
9
|
+
export declare const withContextStyle: (node: React.ReactNode, context?: PropertyValueRendererContext) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
10
10
|
//# sourceMappingURL=WithContextStyle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithContextStyle.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/WithContextStyle.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,gBAAgB,SACrB,MAAM,SAAS,YACX,4BAA4B,
|
|
1
|
+
{"version":3,"file":"WithContextStyle.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/WithContextStyle.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,gBAAgB,SACrB,MAAM,SAAS,YACX,4BAA4B,iGAIvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoritePropertiesRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components-react/favorite/FavoritePropertiesRenderer.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAGzE;;GAEG;AACH,KAAK,UAAU,GAAG,CAAC,SAAS,EAAE,OAAO,GAAG,gBAAgB,KAAK;IAC3D,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,qBAAa,0BAA0B;IACrC;;;;OAIG;IACI,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO;IAIxD;;;;;;;;;;OAUG;IACI,eAAe,CACpB,YAAY,EAAE,YAAY,EAC1B,WAAW,CAAC,EAAE,WAAW,EACzB,UAAU,CAAC,EAAE,UAAU,GACtB,WAAW,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"FavoritePropertiesRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components-react/favorite/FavoritePropertiesRenderer.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAGzE;;GAEG;AACH,KAAK,UAAU,GAAG,CAAC,SAAS,EAAE,OAAO,GAAG,gBAAgB,KAAK;IAC3D,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,qBAAa,0BAA0B;IACrC;;;;OAIG;IACI,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO;IAIxD;;;;;;;;;;OAUG;IACI,eAAe,CACpB,YAAY,EAAE,YAAY,EAC1B,WAAW,CAAC,EAAE,WAAW,EACzB,UAAU,CAAC,EAAE,UAAU,GACtB,WAAW,GAAG,MAAM;CAexB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoritePropertiesRenderer.js","sourceRoot":"","sources":["../../../../src/components-react/favorite/FavoritePropertiesRenderer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAS9D;;GAEG;AACH,MAAM,OAAO,0BAA0B;IACrC;;;;OAIG;IACI,YAAY,CAAC,YAA0B;QAC5C,OAAO,YAAY,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC;IACrD,CAAC;IAED;;;;;;;;;;OAUG;IACI,eAAe,CACpB,YAA0B,EAC1B,WAAyB,EACzB,UAAuB;QAEvB,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CACjC,oBAAoB,EACpB,EAAE,YAAY,EAAE,WAAW,EAAE,EAC7B,IAAI,CACL,CAAC;QACF,IAAI,UAAU,EAAE,CAAC;YACf,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Favorite\n */\n\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport type { Orientation } from \"@itwin/core-react\";\nimport type { PropertyData } from \"../propertygrid/PropertyDataProvider\";\nimport { FavoritePropertyList } from \"./FavoritePropertyList\";\n\n/**\n * Basic recreation of the `createRoot` function type, intentionally not exported.\n */\ntype CreateRoot = (container: Element | DocumentFragment) => {\n render(children: React.ReactNode): void;\n};\n\n/** Renderer for Favorite Property List\n * @public\n */\nexport class FavoritePropertiesRenderer {\n /**\n * Evaluates if a PropertyData contain Favorite records.\n * @param propertyData PropertyData containing records\n * @returns true if it contains Favorite records\n */\n public hasFavorites(propertyData: PropertyData): boolean {\n return propertyData.records.Favorite !== undefined;\n }\n\n /**\n * Allow creating an HTMLElement containing the `<FavoritePropertyList />` component so it can be added outside of a React component (`showCard` is the main expected use)\n *\n * Note: When using React18, in order to remove the `ReactDOM.render` warning you will need to provide the `createRoot` function to this function,\n * the parameter type is intentionally simplified to not depend on React18 type.\n *\n * @param propertyData PropertyData containing Favorite records to display.\n * @param orientation Orientation of the items\n * @param createRoot `createRoot` function imported from `import { createRoot } from \"react-dom/client\";`\n * @returns a `div` HTMLElement with the `<FavoritePropertyList />` rendered within it.\n */\n public renderFavorites(\n propertyData: PropertyData,\n orientation?: Orientation,\n createRoot?: CreateRoot\n ): HTMLElement | string {\n const div = document.createElement(\"div\");\n const element = React.createElement(\n FavoritePropertyList,\n { propertyData, orientation },\n null\n );\n if (createRoot) {\n createRoot(div).render(element);\n } else {\n ReactDOM.render(element, div);\n }\n return div;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FavoritePropertiesRenderer.js","sourceRoot":"","sources":["../../../../src/components-react/favorite/FavoritePropertiesRenderer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAS9D;;GAEG;AACH,MAAM,OAAO,0BAA0B;IACrC;;;;OAIG;IACI,YAAY,CAAC,YAA0B;QAC5C,OAAO,YAAY,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC;IACrD,CAAC;IAED;;;;;;;;;;OAUG;IACI,eAAe,CACpB,YAA0B,EAC1B,WAAyB,EACzB,UAAuB;QAEvB,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CACjC,oBAAoB,EACpB,EAAE,YAAY,EAAE,WAAW,EAAE,EAC7B,IAAI,CACL,CAAC;QACF,IAAI,UAAU,EAAE,CAAC;YACf,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,wEAAwE;YACxE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Favorite\n */\n\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport type { Orientation } from \"@itwin/core-react\";\nimport type { PropertyData } from \"../propertygrid/PropertyDataProvider\";\nimport { FavoritePropertyList } from \"./FavoritePropertyList\";\n\n/**\n * Basic recreation of the `createRoot` function type, intentionally not exported.\n */\ntype CreateRoot = (container: Element | DocumentFragment) => {\n render(children: React.ReactNode): void;\n};\n\n/** Renderer for Favorite Property List\n * @public\n */\nexport class FavoritePropertiesRenderer {\n /**\n * Evaluates if a PropertyData contain Favorite records.\n * @param propertyData PropertyData containing records\n * @returns true if it contains Favorite records\n */\n public hasFavorites(propertyData: PropertyData): boolean {\n return propertyData.records.Favorite !== undefined;\n }\n\n /**\n * Allow creating an HTMLElement containing the `<FavoritePropertyList />` component so it can be added outside of a React component (`showCard` is the main expected use)\n *\n * Note: When using React18, in order to remove the `ReactDOM.render` warning you will need to provide the `createRoot` function to this function,\n * the parameter type is intentionally simplified to not depend on React18 type.\n *\n * @param propertyData PropertyData containing Favorite records to display.\n * @param orientation Orientation of the items\n * @param createRoot `createRoot` function imported from `import { createRoot } from \"react-dom/client\";`\n * @returns a `div` HTMLElement with the `<FavoritePropertyList />` rendered within it.\n */\n public renderFavorites(\n propertyData: PropertyData,\n orientation?: Orientation,\n createRoot?: CreateRoot\n ): HTMLElement | string {\n const div = document.createElement(\"div\");\n const element = React.createElement(\n FavoritePropertyList,\n { propertyData, orientation },\n null\n );\n if (createRoot) {\n createRoot(div).render(element);\n } else {\n // eslint-disable-next-line react/no-deprecated, deprecation/deprecation\n ReactDOM.render(element, div);\n }\n return div;\n }\n}\n"]}
|
|
@@ -25,5 +25,5 @@ export interface ParsedInputProps extends CommonProps {
|
|
|
25
25
|
/** Generic Input component that requires formatting and parsing functions to be passed in as props.
|
|
26
26
|
* @public
|
|
27
27
|
*/
|
|
28
|
-
export declare const ParsedInput: (props: ParsedInputProps) => React.
|
|
28
|
+
export declare const ParsedInput: (props: ParsedInputProps) => React.ReactNode;
|
|
29
29
|
//# sourceMappingURL=ParsedInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParsedInput.d.ts","sourceRoot":"","sources":["../../../../src/components-react/inputs/ParsedInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,qDAAqD;IACrD,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,YAAY,CAAC;IACnD,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACnC;AA+HD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"ParsedInput.d.ts","sourceRoot":"","sources":["../../../../src/components-react/inputs/ParsedInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM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AG,KAAK,CAAC,WAAW,CACrC,CAAC,KAA4C,EAAE,EAAE;QAC/C,uBAAuB;QACvB,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YACtC,qBAAqB,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YACjD,KAAK,CAAC,cAAc,EAAE,CAAC;QACzB,CAAC;QACD,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YACvC,iBAAiB,CAAC,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;YACxD,cAAc,CAAC,KAAK,CAAC,CAAC;YACtB,KAAK,CAAC,cAAc,EAAE,CAAC;QACzB,CAAC;IACH,CAAC,EACD,CAAC,WAAW,EAAE,qBAAqB,CAAC,CACrC,CAAC;IAEF,MAAM,UAAU,GAAG,UAAU,CAC3B,SAAS,EACT,yBAAyB,EACzB,WAAW,IAAI,mCAAmC,CACnD,CAAC;IAEF,OAAO,CACL,oBAAC,KAAK,mBACQ,yBAAyB,EACrC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,GACZ,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"ParsedInput.js","sourceRoot":"","sources":["../../../../src/components-react/inputs/ParsedInput.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,GAAG,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,CAAC,MAAM,WAAW,GACtB,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { Key } from \"ts-key-enum\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport type { ParseResults } from \"@itwin/appui-abstract\";\nimport \"./ParsedInput.scss\";\n\n/** Props for [[ParsedInput]] control\n * @public\n */\nexport interface ParsedInputProps extends CommonProps {\n /** InitialValue which is used to restore input field if ESC is pressed */\n initialValue: number;\n /** Function used to format the value */\n formatValue: (value: number) => string;\n /** Function used to parse user input into a value */\n parseString: (stringValue: string) => ParseResults;\n /** Function to call when value is changed */\n onChange?: (newValue: number) => void;\n /** if readonly then only the formatValue function is used. */\n readonly?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n}\n\nconst ForwardRefParsedInput = React.forwardRef<\n HTMLInputElement,\n ParsedInputProps\n>(function ForwardRefParsedInput(\n {\n initialValue,\n formatValue,\n parseString,\n readonly,\n className,\n style,\n onChange,\n },\n ref\n) {\n const currentValueRef = React.useRef(initialValue);\n const isMountedRef = React.useRef(false);\n const lastFormattedValueRef = React.useRef(formatValue(initialValue));\n const [formattedValue, setFormattedValue] = React.useState(\n () => lastFormattedValueRef.current\n );\n const [hasBadInput, setHasBadInput] = React.useState(false);\n\n React.useEffect(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n\n // See if new initialValue props have changed since component mounted\n React.useEffect(() => {\n currentValueRef.current = initialValue;\n const currentFormattedValue = formatValue(currentValueRef.current);\n if (currentFormattedValue !== lastFormattedValueRef.current) {\n lastFormattedValueRef.current = currentFormattedValue;\n setFormattedValue(lastFormattedValueRef.current);\n setHasBadInput(false);\n }\n }, [formatValue, initialValue]);\n\n const handleChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setFormattedValue(event.currentTarget.value);\n },\n []\n );\n\n const updateValueFromString = React.useCallback(\n (strVal: string) => {\n if (lastFormattedValueRef.current === strVal) return;\n\n const parseResults = parseString(strVal);\n // istanbul ignore else\n if (!parseResults.parseError) {\n // istanbul ignore else\n if (\n undefined !== parseResults.value &&\n typeof parseResults.value === \"number\"\n ) {\n const currentValue = parseResults.value;\n // istanbul ignore else\n if (currentValue !== currentValueRef.current) {\n currentValueRef.current = currentValue;\n onChange && onChange(currentValueRef.current);\n }\n // istanbul ignore else\n if (isMountedRef.current) {\n lastFormattedValueRef.current = formatValue(currentValue);\n setFormattedValue(lastFormattedValueRef.current);\n setHasBadInput(false);\n }\n }\n } else {\n setHasBadInput(true);\n }\n },\n [formatValue, onChange, parseString]\n );\n\n const handleBlur = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n updateValueFromString(event.target.value);\n },\n [updateValueFromString]\n );\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n // istanbul ignore else\n if (event.key === Key.Enter.valueOf()) {\n updateValueFromString(event.currentTarget.value);\n event.preventDefault();\n }\n if (event.key === Key.Escape.valueOf()) {\n setFormattedValue(formatValue(currentValueRef.current));\n setHasBadInput(false);\n event.preventDefault();\n }\n },\n [formatValue, updateValueFromString]\n );\n\n const classNames = classnames(\n className,\n \"components-parsed-input\",\n hasBadInput && \"components-parsed-input-has-error\"\n );\n\n return (\n <Input\n data-testid=\"components-parsed-input\"\n ref={ref}\n style={style}\n className={classNames}\n onKeyDown={handleKeyDown}\n onBlur={handleBlur}\n onChange={handleChange}\n value={formattedValue}\n disabled={readonly}\n size=\"small\"\n />\n );\n});\n\n/** Generic Input component that requires formatting and parsing functions to be passed in as props.\n * @public\n */\nexport const ParsedInput: (props: ParsedInputProps) => React.ReactNode =\n ForwardRefParsedInput;\n"]}
|
|
@@ -11,6 +11,6 @@ export declare class ArrayPropertyValueRenderer implements IPropertyValueRendere
|
|
|
11
11
|
/** Checks if the renderer can handle given property */
|
|
12
12
|
canRender(record: PropertyRecord): boolean;
|
|
13
13
|
/** Method that returns a JSX representation of PropertyRecord */
|
|
14
|
-
render(record: PropertyRecord, context?: PropertyValueRendererContext): React.ReactNode;
|
|
14
|
+
render(record: PropertyRecord, context?: PropertyValueRendererContext): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=ArrayPropertyValueRenderer.d.ts.map
|
package/lib/esm/components-react/properties/renderers/value/MergedPropertyValueRenderer.d.ts
CHANGED
|
@@ -10,6 +10,6 @@ export declare class MergedPropertyValueRenderer implements IPropertyValueRender
|
|
|
10
10
|
/** Checks if the renderer can handle given property */
|
|
11
11
|
canRender(record: PropertyRecord): boolean;
|
|
12
12
|
/** Method that returns a JSX representation of PropertyRecord */
|
|
13
|
-
render(_record: PropertyRecord, context?: PropertyValueRendererContext): import("react").ReactNode;
|
|
13
|
+
render(_record: PropertyRecord, context?: PropertyValueRendererContext): string | number | boolean | Iterable<import("react").ReactNode> | import("react").JSX.Element | null | undefined;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=MergedPropertyValueRenderer.d.ts.map
|
package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ export declare class StructPropertyValueRenderer implements IPropertyValueRender
|
|
|
11
11
|
/** Checks if the renderer can handle given property */
|
|
12
12
|
canRender(record: PropertyRecord): boolean;
|
|
13
13
|
/** Method that returns a JSX representation of PropertyRecord */
|
|
14
|
-
render(record: PropertyRecord, context?: PropertyValueRendererContext): React.ReactNode;
|
|
14
|
+
render(record: PropertyRecord, context?: PropertyValueRendererContext): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=StructPropertyValueRenderer.d.ts.map
|
|
@@ -6,5 +6,5 @@ import type { PropertyValueRendererContext } from "../../ValueRendererManager";
|
|
|
6
6
|
/** Wraps a React component with a span element with a given style attribute
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
|
-
export declare const withContextStyle: (node: React.ReactNode, context?: PropertyValueRendererContext) => React.ReactNode;
|
|
9
|
+
export declare const withContextStyle: (node: React.ReactNode, context?: PropertyValueRendererContext) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
10
10
|
//# sourceMappingURL=WithContextStyle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithContextStyle.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/WithContextStyle.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,gBAAgB,SACrB,MAAM,SAAS,YACX,4BAA4B,
|
|
1
|
+
{"version":3,"file":"WithContextStyle.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/WithContextStyle.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,gBAAgB,SACrB,MAAM,SAAS,YACX,4BAA4B,iGAIvC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/components-react",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.4",
|
|
4
4
|
"description": "iTwin.js UI complex components",
|
|
5
5
|
"main": "lib/cjs/components-react.js",
|
|
6
6
|
"module": "lib/esm/components-react.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@itwin/appui-abstract": "^3.7.0 || ^4.0.0",
|
|
26
26
|
"@itwin/core-bentley": "^3.7.0 || ^4.0.0",
|
|
27
|
-
"@itwin/core-react": "^4.13.
|
|
27
|
+
"@itwin/core-react": "^4.13.4",
|
|
28
28
|
"react": "^17.0.0 || ^18.0.0",
|
|
29
29
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
30
30
|
},
|
|
@@ -40,16 +40,15 @@
|
|
|
40
40
|
"@itwin/core-geometry": "^3.7.0 || ^4.0.0",
|
|
41
41
|
"@itwin/core-i18n": "^3.7.0 || ^4.0.0",
|
|
42
42
|
"@itwin/eslint-plugin": "^4.0.0-dev.52",
|
|
43
|
-
"@testing-library/dom": "^
|
|
44
|
-
"@testing-library/react": "^
|
|
45
|
-
"@testing-library/
|
|
46
|
-
"@testing-library/user-event": "^14.4.2",
|
|
43
|
+
"@testing-library/dom": "^10.1.0",
|
|
44
|
+
"@testing-library/react": "^15.0.7",
|
|
45
|
+
"@testing-library/user-event": "^14.5.2",
|
|
47
46
|
"@types/faker": "^4.1.0",
|
|
48
47
|
"@types/linkify-it": "~2.1.0",
|
|
49
48
|
"@types/lodash": "^4.14.0",
|
|
50
49
|
"@types/node": "18.11.5",
|
|
51
|
-
"@types/react": "^
|
|
52
|
-
"@types/react-dom": "^
|
|
50
|
+
"@types/react": "^18.3.2",
|
|
51
|
+
"@types/react-dom": "^18.3.0",
|
|
53
52
|
"@types/react-highlight-words": "^0.16.1",
|
|
54
53
|
"@types/react-window": "^1.8.2",
|
|
55
54
|
"@vitest/coverage-v8": "^1.4.0",
|
|
@@ -59,18 +58,17 @@
|
|
|
59
58
|
"faker": "^4.1.0",
|
|
60
59
|
"ignore-styles": "^5.0.1",
|
|
61
60
|
"jsdom": "^24.0.0",
|
|
62
|
-
"jsdom-global": "3.0.2",
|
|
63
61
|
"npm-run-all": "^4.1.5",
|
|
64
62
|
"raf": "^3.4.0",
|
|
65
|
-
"react": "^
|
|
66
|
-
"react-dom": "^
|
|
63
|
+
"react": "^18.3.1",
|
|
64
|
+
"react-dom": "^18.3.1",
|
|
67
65
|
"rimraf": "^3.0.2",
|
|
68
66
|
"ts-node": "^10.8.2",
|
|
69
67
|
"typemoq": "^2.1.0",
|
|
70
68
|
"typescript": "~5.3.3",
|
|
71
69
|
"upath": "^2.0.1",
|
|
72
|
-
"vitest": "^1.
|
|
73
|
-
"@itwin/core-react": "4.13.
|
|
70
|
+
"vitest": "^1.6.0",
|
|
71
|
+
"@itwin/core-react": "4.13.4"
|
|
74
72
|
},
|
|
75
73
|
"//dependencies": [
|
|
76
74
|
"NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API",
|