@itwin/components-react 5.29.0 → 5.30.1
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 +134 -0
- package/lib/components-react/editors/BooleanEditor.d.ts +2 -0
- package/lib/components-react/editors/BooleanEditor.d.ts.map +1 -1
- package/lib/components-react/editors/BooleanEditor.js +2 -0
- package/lib/components-react/editors/BooleanEditor.js.map +1 -1
- package/lib/components-react/editors/CustomNumberEditor.d.ts +2 -0
- package/lib/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
- package/lib/components-react/editors/CustomNumberEditor.js +4 -6
- package/lib/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/components-react/editors/DateTimeEditor.d.ts.map +1 -1
- package/lib/components-react/editors/DateTimeEditor.js +1 -2
- package/lib/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/components-react/editors/EditorContainer.d.ts +5 -1
- package/lib/components-react/editors/EditorContainer.d.ts.map +1 -1
- package/lib/components-react/editors/EditorContainer.js +1 -1
- package/lib/components-react/editors/EditorContainer.js.map +1 -1
- package/lib/components-react/editors/EnumButtonGroupEditor.d.ts +2 -0
- package/lib/components-react/editors/EnumButtonGroupEditor.d.ts.map +1 -1
- package/lib/components-react/editors/EnumButtonGroupEditor.js +2 -0
- package/lib/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
- package/lib/components-react/editors/EnumEditor.d.ts +2 -0
- package/lib/components-react/editors/EnumEditor.d.ts.map +1 -1
- package/lib/components-react/editors/EnumEditor.js +2 -0
- package/lib/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/components-react/editors/IconEditor.d.ts +2 -0
- package/lib/components-react/editors/IconEditor.d.ts.map +1 -1
- package/lib/components-react/editors/IconEditor.js +2 -0
- package/lib/components-react/editors/IconEditor.js.map +1 -1
- package/lib/components-react/editors/ImageCheckBoxEditor.d.ts +2 -0
- package/lib/components-react/editors/ImageCheckBoxEditor.d.ts.map +1 -1
- package/lib/components-react/editors/ImageCheckBoxEditor.js +3 -3
- package/lib/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
- package/lib/components-react/editors/NumericInputEditor.d.ts +2 -0
- package/lib/components-react/editors/NumericInputEditor.d.ts.map +1 -1
- package/lib/components-react/editors/NumericInputEditor.js +3 -3
- package/lib/components-react/editors/NumericInputEditor.js.map +1 -1
- package/lib/components-react/editors/PropertyEditorManager.d.ts +11 -2
- package/lib/components-react/editors/PropertyEditorManager.d.ts.map +1 -1
- package/lib/components-react/editors/PropertyEditorManager.js +6 -1
- package/lib/components-react/editors/PropertyEditorManager.js.map +1 -1
- package/lib/components-react/editors/SliderEditor.d.ts +4 -1
- package/lib/components-react/editors/SliderEditor.d.ts.map +1 -1
- package/lib/components-react/editors/SliderEditor.js +6 -7
- package/lib/components-react/editors/SliderEditor.js.map +1 -1
- package/lib/components-react/editors/TextEditor.d.ts +1 -0
- package/lib/components-react/editors/TextEditor.d.ts.map +1 -1
- package/lib/components-react/editors/TextEditor.js +3 -6
- package/lib/components-react/editors/TextEditor.js.map +1 -1
- package/lib/components-react/editors/TextareaEditor.d.ts +2 -0
- package/lib/components-react/editors/TextareaEditor.d.ts.map +1 -1
- package/lib/components-react/editors/TextareaEditor.js +2 -0
- package/lib/components-react/editors/TextareaEditor.js.map +1 -1
- package/lib/components-react/editors/ToggleEditor.d.ts +2 -0
- package/lib/components-react/editors/ToggleEditor.d.ts.map +1 -1
- package/lib/components-react/editors/ToggleEditor.js +2 -0
- package/lib/components-react/editors/ToggleEditor.js.map +1 -1
- package/lib/components-react/editors/registerEditors.d.ts.map +1 -1
- package/lib/components-react/editors/registerEditors.js +1 -0
- package/lib/components-react/editors/registerEditors.js.map +1 -1
- package/lib/components-react/favorite/FavoritePropertyList.d.ts.map +1 -1
- package/lib/components-react/favorite/FavoritePropertyList.js +4 -1
- package/lib/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/components-react/filter-builder/FilterBuilderRule.d.ts +1 -0
- package/lib/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
- package/lib/components-react/filter-builder/FilterBuilderRule.js +5 -3
- package/lib/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
- package/lib/components-react/filter-builder/FilterBuilderRuleGroup.d.ts +1 -0
- package/lib/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -1
- package/lib/components-react/filter-builder/FilterBuilderRuleGroup.js +5 -5
- package/lib/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
- package/lib/components-react/filter-builder/FilterBuilderRuleValue.d.ts +45 -8
- package/lib/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -1
- package/lib/components-react/filter-builder/FilterBuilderRuleValue.js +17 -8
- package/lib/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/components-react/new-editors/interop/EditorInterop.d.ts +2 -2
- package/lib/components-react/new-editors/interop/EditorInterop.d.ts.map +1 -1
- package/lib/components-react/new-editors/interop/EditorInterop.js.map +1 -1
- package/lib/components-react/new-editors/interop/Metadata.d.ts +9 -6
- package/lib/components-react/new-editors/interop/Metadata.d.ts.map +1 -1
- package/lib/components-react/new-editors/interop/Metadata.js +6 -3
- package/lib/components-react/new-editors/interop/Metadata.js.map +1 -1
- package/lib/components-react/new-editors/interop/PropertyRecordEditor.d.ts +28 -3
- package/lib/components-react/new-editors/interop/PropertyRecordEditor.d.ts.map +1 -1
- package/lib/components-react/new-editors/interop/PropertyRecordEditor.js +7 -3
- package/lib/components-react/new-editors/interop/PropertyRecordEditor.js.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/Color.js +2 -2
- package/lib/components-react/new-editors/interop/old-editors/Color.js.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/CustomNumber.d.ts +2 -2
- package/lib/components-react/new-editors/interop/old-editors/CustomNumber.d.ts.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/CustomNumber.js +2 -2
- package/lib/components-react/new-editors/interop/old-editors/CustomNumber.js.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/Enum.js +2 -2
- package/lib/components-react/new-editors/interop/old-editors/Enum.js.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/EnumButtonGroup.js +2 -2
- package/lib/components-react/new-editors/interop/old-editors/EnumButtonGroup.js.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/NumericInput.d.ts +2 -2
- package/lib/components-react/new-editors/interop/old-editors/NumericInput.d.ts.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/NumericInput.js +2 -2
- package/lib/components-react/new-editors/interop/old-editors/NumericInput.js.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/Slider.js +2 -2
- package/lib/components-react/new-editors/interop/old-editors/Slider.js.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/TextArea.d.ts.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/TextArea.js +2 -2
- package/lib/components-react/new-editors/interop/old-editors/TextArea.js.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/UseEditorParams.d.ts +8 -8
- package/lib/components-react/new-editors/interop/old-editors/UseEditorParams.d.ts.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/UseEditorParams.js.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/UseEnumMetadata.d.ts +2 -2
- package/lib/components-react/new-editors/interop/old-editors/UseEnumMetadata.d.ts.map +1 -1
- package/lib/components-react/new-editors/interop/old-editors/UseEnumMetadata.js.map +1 -1
- package/lib/components-react/properties/renderers/NonPrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +4 -1
- package/lib/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/components-react/properties/renderers/PropertyRenderer.d.ts +45 -7
- package/lib/components-react/properties/renderers/PropertyRenderer.d.ts.map +1 -1
- package/lib/components-react/properties/renderers/PropertyRenderer.js +13 -5
- package/lib/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
- package/lib/components-react/propertygrid/component/PropertyList.d.ts +40 -10
- package/lib/components-react/propertygrid/component/PropertyList.d.ts.map +1 -1
- package/lib/components-react/propertygrid/component/PropertyList.js +7 -2
- package/lib/components-react/propertygrid/component/PropertyList.js.map +1 -1
- package/lib/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +37 -33
- package/lib/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts.map +1 -1
- package/lib/components-react/propertygrid/component/VirtualizedPropertyGrid.js +10 -4
- package/lib/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts +41 -5
- package/lib/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts.map +1 -1
- package/lib/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js +6 -4
- package/lib/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
- package/lib/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +3 -1
- package/lib/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/components-react.d.ts +1 -0
- package/lib/components-react.d.ts.map +1 -1
- package/lib/components-react.js +1 -0
- package/lib/components-react.js.map +1 -1
- package/lib/internal.d.ts +0 -1
- package/lib/internal.d.ts.map +1 -1
- package/lib/internal.js +0 -1
- package/lib/internal.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumericInputEditor.js","sourceRoot":"","sources":["../../../src/components-react/editors/NumericInputEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EA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,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IACnC,CAAC,CAAC;IACF,OAAO,CACL,oBAAC,oBAAoB,IAAC,IAAI,EAAC,OAAO;QAChC,oBAAC,oBAAoB,CAAC,KAAK,OACrB,IAAI,EACR,GAAG,EAAE,YAAY,EACjB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAC,OAAO,GACZ;QACD,UAAU,CACU,CACxB,CAAC;AACJ,CAAC,CAAC,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 PropertyEditors\n */\n\nimport \"./NumericInputEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n InputEditorSizeParams,\n PropertyEditorParams,\n PropertyValue,\n RangeEditorParams,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n PropertyValueFormat,\n} from \"@itwin/appui-abstract\";\nimport { NumberInput } from \"@itwin/core-react\";\nimport type {\n InternalInputEditorProps,\n PropertyEditorProps,\n TypeEditor,\n} from \"./EditorContainer.js\";\nimport { PropertyEditorBase } from \"./PropertyEditorManager.js\";\nimport { InputWithDecorations } from \"@itwin/itwinui-react\";\n\n/** @internal */\ninterface NumericInputEditorState {\n value: number;\n size?: number;\n maxSize?: number;\n maxLength?: number;\n\n min?: number;\n max?: number;\n step?: number;\n precision?: number;\n}\n\n/** NumericInputEditor React component that is a property editor with numeric input & up/down buttons\n * @public\n */\nexport class NumericInputEditor\n extends React.PureComponent<PropertyEditorProps, NumericInputEditorState>\n implements TypeEditor\n{\n private _isMounted = false;\n private _inputElement: React.RefObject<HTMLInputElement | null> =\n React.createRef();\n public hasFocus = false; // hot used since containerHandlesEnter is false\n\n public override readonly state: Readonly<NumericInputEditorState> = {\n value: 0,\n };\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: this.state.value,\n displayValue: \"\",\n };\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._inputElement.current;\n }\n\n private _handleCommit = async (): Promise<void> => {\n if (this.props.propertyRecord && this.props.onCommit) {\n const propertyValue = await this.getPropertyValue();\n if (propertyValue !== undefined) {\n this.props.onCommit({\n propertyRecord: this.props.propertyRecord,\n newValue: propertyValue,\n });\n }\n }\n };\n\n private _updateValue = (\n value: number | undefined,\n _stringValue: string\n ): void => {\n const newValue = value !== undefined ? value : 0;\n\n if (this._isMounted)\n this.setState(\n {\n value: newValue,\n },\n async () => {\n await this._handleCommit();\n }\n );\n };\n\n public override componentDidMount() {\n this._isMounted = true;\n void this.setStateFromProps();\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n void this.setStateFromProps();\n }\n }\n\n private async setStateFromProps() {\n const record = this.props.propertyRecord;\n let initialValue = 0;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n initialValue = record.value.value as number;\n }\n\n let size: number | undefined;\n let maxSize: number | undefined;\n let maxLength: number | undefined;\n let min: number | undefined;\n let max: number | undefined;\n let step: number | undefined;\n let precision: number | undefined;\n\n if (\n record &&\n record.property &&\n record.property.editor &&\n record.property.editor.params\n ) {\n const editorSizeParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.InputEditorSize.valueOf()\n ) as InputEditorSizeParams;\n if (editorSizeParams) {\n if (editorSizeParams.size) size = editorSizeParams.size;\n if (editorSizeParams.maxSize) maxSize = editorSizeParams.maxSize;\n if (editorSizeParams.maxLength) maxLength = editorSizeParams.maxLength;\n }\n\n const rangeParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.Range.valueOf()\n ) as RangeEditorParams;\n if (rangeParams) {\n min = rangeParams.minimum;\n max = rangeParams.maximum;\n step = rangeParams.step;\n precision = rangeParams.precision;\n }\n }\n\n if (this._isMounted)\n this.setState({\n value: initialValue,\n size,\n maxSize,\n maxLength,\n min,\n max,\n step,\n precision,\n });\n }\n\n public override render(): React.ReactNode {\n const { decoration } = this.props as InternalInputEditorProps;\n const className = classnames(\n \"components-cell-editor\",\n \"components-numeric-input-editor\",\n this.props.className\n );\n const minSize = this.state.size ? this.state.size : 8;\n const style: React.CSSProperties = {\n ...this.props.style,\n minWidth: `${minSize * 0.75}em`,\n maxWidth: this.state.maxSize\n ? `${this.state.maxSize * 0.75}em`\n : undefined,\n };\n\n return (\n <NumericEditor\n ref={this._inputElement}\n id={this.props.propertyRecord?.property.name}\n className={className}\n style={style}\n value={this.state.value}\n min={this.state.min}\n max={this.state.max}\n step={this.state.step}\n precision={this.state.precision}\n readOnly={this.props.propertyRecord?.isReadonly}\n disabled={this.props.propertyRecord?.isDisabled}\n maxLength={this.state.maxLength}\n onBlur={this.props.onBlur}\n onChange={this._updateValue}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={\n this.props.setFocus && !this.props.propertyRecord?.isDisabled\n }\n isControlled={this.props.shouldCommitOnChange}\n decoration={decoration}\n />\n );\n }\n}\n\n/** Numeric Input Property Editor registered for the \"number\" type name and \"numeric-input\" editor name.\n * It uses the [[NumericInputEditor]] React component.\n * @public\n */\nexport class NumericInputPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <NumericInputEditor />;\n }\n public override get containerHandlesEnter(): boolean {\n // let input editor process enter key\n return false;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-deprecated\ntype NumberInputProps = React.ComponentProps<typeof NumberInput>;\n\ninterface NumericEditorProps extends Omit<NumberInputProps, \"step\"> {\n decoration?: React.ReactNode;\n step?: number;\n}\n\nconst NumericEditor = React.forwardRef<HTMLInputElement, NumericEditorProps>(\n function NumericEditor(props, forwardedRef) {\n const { decoration, ...rest } = props;\n if (decoration) {\n return (\n <LockNumericEditor\n {...rest}\n ref={forwardedRef}\n decoration={decoration}\n />\n );\n }\n\n return (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <NumberInput ref={forwardedRef} {...rest} />\n );\n }\n);\n\ninterface LockNumericEditorProps extends NumericEditorProps {\n decoration: React.ReactNode;\n}\n\nconst LockNumericEditor = React.forwardRef<\n HTMLInputElement,\n LockNumericEditorProps\n>(function LockNumericEditor(props, forwardedRef) {\n const { decoration, precision, onChange, isControlled, ...rest } = props;\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = event.target.value;\n onChange?.(Number(value), value);\n };\n return (\n <InputWithDecorations size=\"small\">\n <InputWithDecorations.Input\n {...rest}\n ref={forwardedRef}\n type=\"number\"\n onChange={handleChange}\n size=\"small\"\n />\n {decoration}\n </InputWithDecorations>\n );\n});\n"]}
|
|
1
|
+
{"version":3,"file":"NumericInputEditor.js","sourceRoot":"","sources":["../../../src/components-react/editors/NumericInputEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAkB5D;;;GAGG;AACH,MAAM,OAAO,kBACX,SAAQ,KAAK,CAAC,aAA2D;IAGjE,UAAU,GAAG,KAAK,CAAC;IACnB,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ACD,UAAU,CACU,CACxB,CAAC;AACJ,CAAC,CAAC,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 PropertyEditors\n */\n\nimport \"./NumericInputEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n InputEditorSizeParams,\n PropertyEditorParams,\n PropertyValue,\n RangeEditorParams,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n PropertyValueFormat,\n} from \"@itwin/appui-abstract\";\nimport { NumberInput } from \"@itwin/core-react\";\nimport type {\n InternalInputEditorProps,\n PropertyEditorProps,\n TypeEditor,\n} from \"./EditorContainer.js\";\nimport { PropertyEditorBase } from \"./PropertyEditorManager.js\";\nimport { InputWithDecorations } from \"@itwin/itwinui-react\";\nimport { EditorRenderer } from \"../new-editors/EditorRenderer.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** @internal */\ninterface NumericInputEditorState {\n value: number;\n size?: number;\n maxSize?: number;\n maxLength?: number;\n\n min?: number;\n max?: number;\n step?: number;\n precision?: number;\n}\n\n/** NumericInputEditor React component that is a property editor with numeric input & up/down buttons\n * @public\n * @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.\n */\nexport class NumericInputEditor\n extends React.PureComponent<PropertyEditorProps, NumericInputEditorState>\n implements TypeEditor\n{\n private _isMounted = false;\n private _inputElement: React.RefObject<HTMLInputElement | null> =\n React.createRef();\n public hasFocus = false; // hot used since containerHandlesEnter is false\n\n public override readonly state: Readonly<NumericInputEditorState> = {\n value: 0,\n };\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: this.state.value,\n displayValue: \"\",\n };\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._inputElement.current;\n }\n\n private _handleCommit = async (): Promise<void> => {\n if (this.props.propertyRecord && this.props.onCommit) {\n const propertyValue = await this.getPropertyValue();\n if (propertyValue !== undefined) {\n this.props.onCommit({\n propertyRecord: this.props.propertyRecord,\n newValue: propertyValue,\n });\n }\n }\n };\n\n private _updateValue = (\n value: number | undefined,\n _stringValue: string\n ): void => {\n const newValue = value !== undefined ? value : 0;\n\n if (this._isMounted)\n this.setState(\n {\n value: newValue,\n },\n async () => {\n await this._handleCommit();\n }\n );\n };\n\n public override componentDidMount() {\n this._isMounted = true;\n void this.setStateFromProps();\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n void this.setStateFromProps();\n }\n }\n\n private async setStateFromProps() {\n const record = this.props.propertyRecord;\n let initialValue = 0;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n initialValue = record.value.value as number;\n }\n\n let size: number | undefined;\n let maxSize: number | undefined;\n let maxLength: number | undefined;\n let min: number | undefined;\n let max: number | undefined;\n let step: number | undefined;\n let precision: number | undefined;\n\n if (\n record &&\n record.property &&\n record.property.editor &&\n record.property.editor.params\n ) {\n const editorSizeParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.InputEditorSize.valueOf()\n ) as InputEditorSizeParams;\n if (editorSizeParams) {\n if (editorSizeParams.size) size = editorSizeParams.size;\n if (editorSizeParams.maxSize) maxSize = editorSizeParams.maxSize;\n if (editorSizeParams.maxLength) maxLength = editorSizeParams.maxLength;\n }\n\n const rangeParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.Range.valueOf()\n ) as RangeEditorParams;\n if (rangeParams) {\n min = rangeParams.minimum;\n max = rangeParams.maximum;\n step = rangeParams.step;\n precision = rangeParams.precision;\n }\n }\n\n if (this._isMounted)\n this.setState({\n value: initialValue,\n size,\n maxSize,\n maxLength,\n min,\n max,\n step,\n precision,\n });\n }\n\n public override render(): React.ReactNode {\n const { decoration } = this.props as InternalInputEditorProps;\n const className = classnames(\n \"components-cell-editor\",\n \"components-numeric-input-editor\",\n this.props.className\n );\n const minSize = this.state.size ? this.state.size : 8;\n const style: React.CSSProperties = {\n ...this.props.style,\n minWidth: `${minSize * 0.75}em`,\n maxWidth: this.state.maxSize\n ? `${this.state.maxSize * 0.75}em`\n : undefined,\n };\n\n return (\n <NumericEditor\n ref={this._inputElement}\n id={this.props.propertyRecord?.property.name}\n className={className}\n style={style}\n value={this.state.value}\n min={this.state.min}\n max={this.state.max}\n step={this.state.step}\n precision={this.state.precision}\n readOnly={this.props.propertyRecord?.isReadonly}\n disabled={this.props.propertyRecord?.isDisabled}\n maxLength={this.state.maxLength}\n onBlur={this.props.onBlur}\n onChange={this._updateValue}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={\n this.props.setFocus && !this.props.propertyRecord?.isDisabled\n }\n isControlled={this.props.shouldCommitOnChange}\n decoration={decoration}\n />\n );\n }\n}\n\n/** Numeric Input Property Editor registered for the \"number\" type name and \"numeric-input\" editor name.\n * It uses the [[NumericInputEditor]] React component.\n * @public\n * @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.\n */\nexport class NumericInputPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <NumericInputEditor />;\n }\n public override get containerHandlesEnter(): boolean {\n // let input editor process enter key\n return false;\n }\n}\n\ntype NumberInputProps = React.ComponentProps<typeof NumberInput>;\n\ninterface NumericEditorProps extends Omit<NumberInputProps, \"step\"> {\n decoration?: React.ReactNode;\n step?: number;\n}\n\nconst NumericEditor = React.forwardRef<HTMLInputElement, NumericEditorProps>(\n function NumericEditor(props, forwardedRef) {\n const { decoration, ...rest } = props;\n if (decoration) {\n return (\n <LockNumericEditor\n {...rest}\n ref={forwardedRef}\n decoration={decoration}\n />\n );\n }\n\n return <NumberInput ref={forwardedRef} {...rest} />;\n }\n);\n\ninterface LockNumericEditorProps extends NumericEditorProps {\n decoration: React.ReactNode;\n}\n\nconst LockNumericEditor = React.forwardRef<\n HTMLInputElement,\n LockNumericEditorProps\n>(function LockNumericEditor(props, forwardedRef) {\n const { decoration, precision, onChange, isControlled, ...rest } = props;\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = event.target.value;\n onChange?.(Number(value), value);\n };\n return (\n <InputWithDecorations size=\"small\">\n <InputWithDecorations.Input\n {...rest}\n ref={forwardedRef}\n type=\"number\"\n onChange={handleChange}\n size=\"small\"\n />\n {decoration}\n </InputWithDecorations>\n );\n});\n"]}
|
|
@@ -5,6 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import type { DisplayMessageType, MessageSeverity, PropertyDescription, PropertyRecord, PropertyValue } from "@itwin/appui-abstract";
|
|
6
6
|
/** Asynchronous Error Message returned as part of [[AsyncValueProcessingResult]]
|
|
7
7
|
* @public
|
|
8
|
+
* @deprecated in 5.30. This is part of the old editor system and is not used anymore.
|
|
8
9
|
*/
|
|
9
10
|
export interface AsyncErrorMessage {
|
|
10
11
|
severity: MessageSeverity;
|
|
@@ -14,14 +15,17 @@ export interface AsyncErrorMessage {
|
|
|
14
15
|
}
|
|
15
16
|
/** Asynchronous Value Process Result
|
|
16
17
|
* @public
|
|
18
|
+
* @deprecated in 5.30. This is part of the old editor system and is not used anymore.
|
|
17
19
|
*/
|
|
18
20
|
export interface AsyncValueProcessingResult {
|
|
19
21
|
encounteredError: boolean;
|
|
20
22
|
returnValue?: PropertyValue;
|
|
21
23
|
errorMessage?: AsyncErrorMessage;
|
|
22
24
|
}
|
|
23
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* DataControllers can be implemented per typename to validate and commit values.
|
|
24
27
|
* @public
|
|
28
|
+
* @deprecated in 5.30. This is part of the old editor system and is not used anymore.
|
|
25
29
|
*/
|
|
26
30
|
export interface DataController {
|
|
27
31
|
validateValue(newValue: PropertyValue, record: PropertyRecord): Promise<AsyncValueProcessingResult>;
|
|
@@ -29,6 +33,7 @@ export interface DataController {
|
|
|
29
33
|
}
|
|
30
34
|
/** PropertyEditor is the base class for all property editors.
|
|
31
35
|
* @public
|
|
36
|
+
* @deprecated in 5.30. This is part of the old editor system and was used to defined custom editor. Use {@link EditorSpec} and {@link createEditorSpec} instead.
|
|
32
37
|
*/
|
|
33
38
|
export declare abstract class PropertyEditorBase implements DataController {
|
|
34
39
|
get containerHandlesBlur(): boolean;
|
|
@@ -42,8 +47,10 @@ export declare abstract class PropertyEditorBase implements DataController {
|
|
|
42
47
|
commitValue(newValue: PropertyValue, record: PropertyRecord): Promise<AsyncValueProcessingResult>;
|
|
43
48
|
validateValue(newValue: PropertyValue, record: PropertyRecord): Promise<AsyncValueProcessingResult>;
|
|
44
49
|
}
|
|
45
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* DataControllerBase is the base class for all Data Controllers.
|
|
46
52
|
* @public
|
|
53
|
+
* @deprecated in 5.30. This is part of the old editor system and was used to defined custom editor. Use {@link EditorSpec} and {@link createEditorSpec} instead.
|
|
47
54
|
*/
|
|
48
55
|
export declare abstract class DataControllerBase implements DataController {
|
|
49
56
|
commitValue(_newValue: PropertyValue, _record: PropertyRecord): Promise<AsyncValueProcessingResult>;
|
|
@@ -51,6 +58,7 @@ export declare abstract class DataControllerBase implements DataController {
|
|
|
51
58
|
}
|
|
52
59
|
/** Manages Property Editors. Property Editors are registered with and created by the manager.
|
|
53
60
|
* @public
|
|
61
|
+
* @deprecated in 5.30. This is part of the old editor system and was used to register custom editors. Use {@link EditorsRegistryProvider} instead.
|
|
54
62
|
*/
|
|
55
63
|
export declare class PropertyEditorManager {
|
|
56
64
|
private static _dataControllers;
|
|
@@ -64,6 +72,7 @@ export declare class PropertyEditorManager {
|
|
|
64
72
|
/** Basic Property Editor registered for the "text" and "string" type names.
|
|
65
73
|
* It uses the [[TextEditor]] React component.
|
|
66
74
|
* @public
|
|
75
|
+
* @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.
|
|
67
76
|
*/
|
|
68
77
|
export declare class BasicPropertyEditor extends PropertyEditorBase {
|
|
69
78
|
get reactNode(): React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyEditorManager.d.ts","sourceRoot":"","sources":["../../../src/components-react/editors/PropertyEditorManager.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,aAAa,EACd,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"PropertyEditorManager.d.ts","sourceRoot":"","sources":["../../../src/components-react/editors/PropertyEditorManager.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,aAAa,EACd,MAAM,uBAAuB,CAAC;AAO/B;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,eAAe,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAClC;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,aAAa,CACX,QAAQ,EAAE,aAAa,EACvB,MAAM,EAA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EACtB,UAAU,EAAE,UAAU,kBAAkB,GACvC,IAAI;IAUP,gBAAgB;WACF,wBAAwB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI;WAMtD,YAAY,CACxB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,kBAAkB;WA0BP,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;CAI7E;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;CACF;AAQD;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,UAAU,kBAAkB,EACpC,UAAU,CAAC,EAAE,MAAM,EACnB,QAAQ,UAAQ,QAQjB"}
|
|
@@ -9,6 +9,7 @@ import * as React from "react";
|
|
|
9
9
|
import { TextEditor } from "./TextEditor.js";
|
|
10
10
|
/** PropertyEditor is the base class for all property editors.
|
|
11
11
|
* @public
|
|
12
|
+
* @deprecated in 5.30. This is part of the old editor system and was used to defined custom editor. Use {@link EditorSpec} and {@link createEditorSpec} instead.
|
|
12
13
|
*/
|
|
13
14
|
export class PropertyEditorBase {
|
|
14
15
|
get containerHandlesBlur() {
|
|
@@ -39,8 +40,10 @@ export class PropertyEditorBase {
|
|
|
39
40
|
return { encounteredError: false };
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* DataControllerBase is the base class for all Data Controllers.
|
|
43
45
|
* @public
|
|
46
|
+
* @deprecated in 5.30. This is part of the old editor system and was used to defined custom editor. Use {@link EditorSpec} and {@link createEditorSpec} instead.
|
|
44
47
|
*/
|
|
45
48
|
export class DataControllerBase {
|
|
46
49
|
async commitValue(_newValue, _record) {
|
|
@@ -53,6 +56,7 @@ export class DataControllerBase {
|
|
|
53
56
|
const editors = {};
|
|
54
57
|
/** Manages Property Editors. Property Editors are registered with and created by the manager.
|
|
55
58
|
* @public
|
|
59
|
+
* @deprecated in 5.30. This is part of the old editor system and was used to register custom editors. Use {@link EditorsRegistryProvider} instead.
|
|
56
60
|
*/
|
|
57
61
|
export class PropertyEditorManager {
|
|
58
62
|
static _dataControllers = {};
|
|
@@ -103,6 +107,7 @@ export class PropertyEditorManager {
|
|
|
103
107
|
/** Basic Property Editor registered for the "text" and "string" type names.
|
|
104
108
|
* It uses the [[TextEditor]] React component.
|
|
105
109
|
* @public
|
|
110
|
+
* @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.
|
|
106
111
|
*/
|
|
107
112
|
export class BasicPropertyEditor extends PropertyEditorBase {
|
|
108
113
|
get reactNode() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyEditorManager.js","sourceRoot":"","sources":["../../../src/components-react/editors/PropertyEditorManager.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA0C7C;;GAEG;AACH,MAAM,OAAgB,kBAAkB;IACtC,IAAW,oBAAoB;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAW,sBAAsB;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAW,qBAAqB;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAW,mBAAmB;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAW,gCAAgC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,oBAAoB,GAA+B,SAAS,CAAC;IAI7D,iBAAiB,CACtB,SAA8B,EAC9B,OAAuB,IAChB,CAAC;IAEH,KAAK,CAAC,WAAW,CACtB,QAAuB,EACvB,MAAsB;QAEtB,IAAI,IAAI,CAAC,o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AED,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,QAAgB,EAAE,UAAkB;QAChE,MAAM,cAAc,GAAG,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAC/D,OAAO,OAAO,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAChD,CAAC;;AAGH;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB;IACzD,IAAW,SAAS;QAClB,OAAO,oBAAC,UAAU,OAAG,CAAC;IACxB,CAAC;CACF;AAED,SAAS,iBAAiB,CAAC,QAAgB,EAAE,UAAmB;IAC9D,IAAI,cAAc,GAAG,QAAQ,CAAC;IAC9B,IAAI,UAAU;QAAE,cAAc,IAAI,IAAI,UAAU,EAAE,CAAC;IACnD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAAgB,EAChB,MAAoC,EACpC,UAAmB,EACnB,QAAQ,GAAG,KAAK;IAEhB,MAAM,cAAc,GAAG,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAE/D,yDAAyD;IACzD,IAAI,OAAO,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ;QAAE,OAAO;IAEhE,OAAO,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;AACnC,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 PropertyEditors\n */\n\nimport * as React from \"react\";\nimport { TextEditor } from \"./TextEditor.js\";\nimport type {\n DisplayMessageType,\n MessageSeverity,\n PropertyDescription,\n PropertyRecord,\n PropertyValue,\n} from \"@itwin/appui-abstract\";\n\n/** Asynchronous Error Message returned as part of [[AsyncValueProcessingResult]]\n * @public\n */\nexport interface AsyncErrorMessage {\n severity: MessageSeverity;\n briefMessage: string;\n detailedMessage?: string;\n messageType?: DisplayMessageType;\n}\n\n/** Asynchronous Value Process Result\n * @public\n */\nexport interface AsyncValueProcessingResult {\n encounteredError: boolean;\n returnValue?: PropertyValue;\n errorMessage?: AsyncErrorMessage;\n}\n\n/** DataControllers can be implemented per typename to validate and commit values.\n * @public\n */\nexport interface DataController {\n validateValue(\n newValue: PropertyValue,\n record: PropertyRecord\n ): Promise<AsyncValueProcessingResult>;\n commitValue(\n newValue: PropertyValue,\n record: PropertyRecord\n ): Promise<AsyncValueProcessingResult>;\n}\n\n/** PropertyEditor is the base class for all property editors.\n * @public\n */\nexport abstract class PropertyEditorBase implements DataController {\n public get containerHandlesBlur(): boolean {\n return true;\n }\n public get containerHandlesEscape(): boolean {\n return true;\n }\n public get containerHandlesEnter(): boolean {\n return true;\n }\n public get containerHandlesTab(): boolean {\n return true;\n }\n public get containerStopsKeydownPropagation(): boolean {\n return true;\n }\n\n public customDataController: DataController | undefined = undefined;\n\n public abstract get reactNode(): React.ReactNode;\n\n public applyEditorParams(\n _property: PropertyDescription,\n _record: PropertyRecord\n ): void {}\n\n public async commitValue(\n newValue: PropertyValue,\n record: PropertyRecord\n ): Promise<AsyncValueProcessingResult> {\n if (this.customDataController)\n return this.customDataController.commitValue(newValue, record);\n\n return { encounteredError: false };\n }\n\n public async validateValue(\n newValue: PropertyValue,\n record: PropertyRecord\n ): Promise<AsyncValueProcessingResult> {\n if (this.customDataController)\n return this.customDataController.validateValue(newValue, record);\n\n return { encounteredError: false };\n }\n}\n\n/** DataControllerBase is the base class for all Data Controllers.\n * @public\n */\nexport abstract class DataControllerBase implements DataController {\n public async commitValue(\n _newValue: PropertyValue,\n _record: PropertyRecord\n ): Promise<AsyncValueProcessingResult> {\n return { encounteredError: false };\n }\n\n public async validateValue(\n _newValue: PropertyValue,\n _record: PropertyRecord\n ): Promise<AsyncValueProcessingResult> {\n return { encounteredError: false };\n }\n}\n\nconst editors: { [index: string]: new () => PropertyEditorBase } = {};\n\n/** Manages Property Editors. Property Editors are registered with and created by the manager.\n * @public\n */\nexport class PropertyEditorManager {\n private static _dataControllers: {\n [index: string]: new () => DataControllerBase;\n } = {};\n\n public static registerEditor(\n editType: string,\n editor: new () => PropertyEditorBase,\n editorName?: string\n ): void {\n const fullEditorName = getFullEditorName(editType, editorName);\n\n if (editors.hasOwnProperty(fullEditorName)) {\n const nameOfEditor = editors[fullEditorName].name;\n throw Error(\n `PropertyEditorManager.registerEditor error: type '${fullEditorName}' already registered to '${nameOfEditor}'`\n );\n }\n editors[fullEditorName] = editor;\n }\n\n public static registerDataController(\n controllerName: string,\n controller: new () => DataControllerBase\n ): void {\n if (PropertyEditorManager._dataControllers.hasOwnProperty(controllerName)) {\n throw Error(\n `PropertyEditorManager.registerDataController error: type '${controllerName}' already registered to '${(typeof PropertyEditorManager\n ._dataControllers[controllerName]).toString()}'`\n );\n }\n PropertyEditorManager._dataControllers[controllerName] = controller;\n }\n\n /** @internal */\n public static deregisterDataController(controllerName: string): void {\n if (PropertyEditorManager._dataControllers.hasOwnProperty(controllerName)) {\n delete PropertyEditorManager._dataControllers[controllerName];\n }\n }\n\n public static createEditor(\n editType: string,\n editorName?: string,\n dataControllerName?: string\n ): PropertyEditorBase {\n const fullEditorName = getFullEditorName(editType, editorName);\n\n let editor: PropertyEditorBase;\n if (editors.hasOwnProperty(fullEditorName))\n editor = new editors[fullEditorName]();\n else if (editors.hasOwnProperty(editType)) editor = new editors[editType]();\n else editor = new BasicPropertyEditor();\n\n if (dataControllerName) {\n if (\n PropertyEditorManager._dataControllers.hasOwnProperty(\n dataControllerName\n )\n )\n editor.customDataController =\n new PropertyEditorManager._dataControllers[dataControllerName]();\n else\n throw Error(\n `PropertyEditorManager.createEditor error: data controller '${dataControllerName}' is not registered`\n );\n }\n\n return editor;\n }\n\n public static hasCustomEditor(editType: string, editorName: string): boolean {\n const fullEditorName = getFullEditorName(editType, editorName);\n return editors.hasOwnProperty(fullEditorName);\n }\n}\n\n/** Basic Property Editor registered for the \"text\" and \"string\" type names.\n * It uses the [[TextEditor]] React component.\n * @public\n */\nexport class BasicPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <TextEditor />;\n }\n}\n\nfunction getFullEditorName(editType: string, editorName?: string) {\n let fullEditorName = editType;\n if (editorName) fullEditorName += `:${editorName}`;\n return fullEditorName;\n}\n\n/** Used to override the default property editors from the `appui-react` package.\n * @internal\n */\nexport function registerDefaultPropertyEditor(\n editType: string,\n editor: new () => PropertyEditorBase,\n editorName?: string,\n override = false\n) {\n const fullEditorName = getFullEditorName(editType, editorName);\n\n // Ignore if already registered and override is disabled.\n if (editors.hasOwnProperty(fullEditorName) && !override) return;\n\n editors[fullEditorName] = editor;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PropertyEditorManager.js","sourceRoot":"","sources":["../../../src/components-react/editors/PropertyEditorManager.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAmD7C;;;GAGG;AACH,MAAM,OAAgB,kBAAkB;IACtC,IAAW,oBAAoB;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAW,sBAAsB;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAW,qBAAqB;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAW,mBAAmB;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAW,gCAAgC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,oBAAoB,GAA+B,SAAS,CAAC;IAI7D,iBAAiB,CACtB,SAA8B,EAC9B,OAAuB,IAChB,CAAC;IAEH,KAAK,CAAC,WAAW,CACtB,QAAuB,EACvB,MAAsB;QAEtB,IAAI,IAAI,CAAC,oBAAoB;YAC3B,OAAO,IAAI,CAAC,oBAAoB,CA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MAAM,CAAC,eAAe,CAAC,QAAgB,EAAE,UAAkB;QAChE,MAAM,cAAc,GAAG,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAC/D,OAAO,OAAO,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAChD,CAAC;;AAGH;;;;GAIG;AACH,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB;IACzD,IAAW,SAAS;QAClB,OAAO,oBAAC,UAAU,OAAG,CAAC;IACxB,CAAC;CACF;AAED,SAAS,iBAAiB,CAAC,QAAgB,EAAE,UAAmB;IAC9D,IAAI,cAAc,GAAG,QAAQ,CAAC;IAC9B,IAAI,UAAU;QAAE,cAAc,IAAI,IAAI,UAAU,EAAE,CAAC;IACnD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAAgB,EAChB,MAAoC,EACpC,UAAmB,EACnB,QAAQ,GAAG,KAAK;IAEhB,MAAM,cAAc,GAAG,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAE/D,yDAAyD;IACzD,IAAI,OAAO,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ;QAAE,OAAO;IAEhE,OAAO,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;AACnC,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 PropertyEditors\n */\n\nimport * as React from \"react\";\nimport { TextEditor } from \"./TextEditor.js\";\nimport type {\n DisplayMessageType,\n MessageSeverity,\n PropertyDescription,\n PropertyRecord,\n PropertyValue,\n} from \"@itwin/appui-abstract\";\nimport { createEditorSpec, EditorSpec } from \"../new-editors/Types.js\";\nimport { EditorRenderer } from \"../new-editors/EditorRenderer.js\";\nimport { EditorsRegistryProvider } from \"../new-editors/editors-registry/EditorsRegistryProvider.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Asynchronous Error Message returned as part of [[AsyncValueProcessingResult]]\n * @public\n * @deprecated in 5.30. This is part of the old editor system and is not used anymore.\n */\nexport interface AsyncErrorMessage {\n severity: MessageSeverity;\n briefMessage: string;\n detailedMessage?: string;\n messageType?: DisplayMessageType;\n}\n\n/** Asynchronous Value Process Result\n * @public\n * @deprecated in 5.30. This is part of the old editor system and is not used anymore.\n */\nexport interface AsyncValueProcessingResult {\n encounteredError: boolean;\n returnValue?: PropertyValue;\n errorMessage?: AsyncErrorMessage;\n}\n\n/**\n * DataControllers can be implemented per typename to validate and commit values.\n * @public\n * @deprecated in 5.30. This is part of the old editor system and is not used anymore.\n */\nexport interface DataController {\n validateValue(\n newValue: PropertyValue,\n record: PropertyRecord\n ): Promise<AsyncValueProcessingResult>;\n commitValue(\n newValue: PropertyValue,\n record: PropertyRecord\n ): Promise<AsyncValueProcessingResult>;\n}\n\n/** PropertyEditor is the base class for all property editors.\n * @public\n * @deprecated in 5.30. This is part of the old editor system and was used to defined custom editor. Use {@link EditorSpec} and {@link createEditorSpec} instead.\n */\nexport abstract class PropertyEditorBase implements DataController {\n public get containerHandlesBlur(): boolean {\n return true;\n }\n public get containerHandlesEscape(): boolean {\n return true;\n }\n public get containerHandlesEnter(): boolean {\n return true;\n }\n public get containerHandlesTab(): boolean {\n return true;\n }\n public get containerStopsKeydownPropagation(): boolean {\n return true;\n }\n\n public customDataController: DataController | undefined = undefined;\n\n public abstract get reactNode(): React.ReactNode;\n\n public applyEditorParams(\n _property: PropertyDescription,\n _record: PropertyRecord\n ): void {}\n\n public async commitValue(\n newValue: PropertyValue,\n record: PropertyRecord\n ): Promise<AsyncValueProcessingResult> {\n if (this.customDataController)\n return this.customDataController.commitValue(newValue, record);\n\n return { encounteredError: false };\n }\n\n public async validateValue(\n newValue: PropertyValue,\n record: PropertyRecord\n ): Promise<AsyncValueProcessingResult> {\n if (this.customDataController)\n return this.customDataController.validateValue(newValue, record);\n\n return { encounteredError: false };\n }\n}\n\n/**\n * DataControllerBase is the base class for all Data Controllers.\n * @public\n * @deprecated in 5.30. This is part of the old editor system and was used to defined custom editor. Use {@link EditorSpec} and {@link createEditorSpec} instead.\n */\nexport abstract class DataControllerBase implements DataController {\n public async commitValue(\n _newValue: PropertyValue,\n _record: PropertyRecord\n ): Promise<AsyncValueProcessingResult> {\n return { encounteredError: false };\n }\n\n public async validateValue(\n _newValue: PropertyValue,\n _record: PropertyRecord\n ): Promise<AsyncValueProcessingResult> {\n return { encounteredError: false };\n }\n}\n\nconst editors: { [index: string]: new () => PropertyEditorBase } = {};\n\n/** Manages Property Editors. Property Editors are registered with and created by the manager.\n * @public\n * @deprecated in 5.30. This is part of the old editor system and was used to register custom editors. Use {@link EditorsRegistryProvider} instead.\n */\nexport class PropertyEditorManager {\n private static _dataControllers: {\n [index: string]: new () => DataControllerBase;\n } = {};\n\n public static registerEditor(\n editType: string,\n editor: new () => PropertyEditorBase,\n editorName?: string\n ): void {\n const fullEditorName = getFullEditorName(editType, editorName);\n\n if (editors.hasOwnProperty(fullEditorName)) {\n const nameOfEditor = editors[fullEditorName].name;\n throw Error(\n `PropertyEditorManager.registerEditor error: type '${fullEditorName}' already registered to '${nameOfEditor}'`\n );\n }\n editors[fullEditorName] = editor;\n }\n\n public static registerDataController(\n controllerName: string,\n controller: new () => DataControllerBase\n ): void {\n if (PropertyEditorManager._dataControllers.hasOwnProperty(controllerName)) {\n throw Error(\n `PropertyEditorManager.registerDataController error: type '${controllerName}' already registered to '${(typeof PropertyEditorManager\n ._dataControllers[controllerName]).toString()}'`\n );\n }\n PropertyEditorManager._dataControllers[controllerName] = controller;\n }\n\n /** @internal */\n public static deregisterDataController(controllerName: string): void {\n if (PropertyEditorManager._dataControllers.hasOwnProperty(controllerName)) {\n delete PropertyEditorManager._dataControllers[controllerName];\n }\n }\n\n public static createEditor(\n editType: string,\n editorName?: string,\n dataControllerName?: string\n ): PropertyEditorBase {\n const fullEditorName = getFullEditorName(editType, editorName);\n\n let editor: PropertyEditorBase;\n if (editors.hasOwnProperty(fullEditorName))\n editor = new editors[fullEditorName]();\n else if (editors.hasOwnProperty(editType)) editor = new editors[editType]();\n else editor = new BasicPropertyEditor();\n\n if (dataControllerName) {\n if (\n PropertyEditorManager._dataControllers.hasOwnProperty(\n dataControllerName\n )\n )\n editor.customDataController =\n new PropertyEditorManager._dataControllers[dataControllerName]();\n else\n throw Error(\n `PropertyEditorManager.createEditor error: data controller '${dataControllerName}' is not registered`\n );\n }\n\n return editor;\n }\n\n public static hasCustomEditor(editType: string, editorName: string): boolean {\n const fullEditorName = getFullEditorName(editType, editorName);\n return editors.hasOwnProperty(fullEditorName);\n }\n}\n\n/** Basic Property Editor registered for the \"text\" and \"string\" type names.\n * It uses the [[TextEditor]] React component.\n * @public\n * @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.\n */\nexport class BasicPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <TextEditor />;\n }\n}\n\nfunction getFullEditorName(editType: string, editorName?: string) {\n let fullEditorName = editType;\n if (editorName) fullEditorName += `:${editorName}`;\n return fullEditorName;\n}\n\n/** Used to override the default property editors from the `appui-react` package.\n * @internal\n */\nexport function registerDefaultPropertyEditor(\n editType: string,\n editor: new () => PropertyEditorBase,\n editorName?: string,\n override = false\n) {\n const fullEditorName = getFullEditorName(editType, editorName);\n\n // Ignore if already registered and override is disabled.\n if (editors.hasOwnProperty(fullEditorName) && !override) return;\n\n editors[fullEditorName] = editor;\n}\n"]}
|
|
@@ -22,8 +22,10 @@ interface SliderEditorState {
|
|
|
22
22
|
maxLabel?: React.ReactNode;
|
|
23
23
|
tickLabels?: React.ReactNode;
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* SliderEditor React component that is a property editor with numeric input & up/down buttons
|
|
26
27
|
* @public
|
|
28
|
+
* @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.
|
|
27
29
|
*/
|
|
28
30
|
export declare class SliderEditor extends React.PureComponent<PropertyEditorProps, SliderEditorState> implements TypeEditor {
|
|
29
31
|
private _isMounted;
|
|
@@ -51,6 +53,7 @@ export declare class SliderEditor extends React.PureComponent<PropertyEditorProp
|
|
|
51
53
|
/** Slider Property Editor registered for the "number" type name and "slider" editor name.
|
|
52
54
|
* It uses the [[SliderEditor]] React component.
|
|
53
55
|
* @public
|
|
56
|
+
* @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.
|
|
54
57
|
*/
|
|
55
58
|
export declare class SliderPropertyEditor extends PropertyEditorBase {
|
|
56
59
|
get reactNode(): React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderEditor.d.ts","sourceRoot":"","sources":["../../../src/components-react/editors/SliderEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"SliderEditor.d.ts","sourceRoot":"","sources":["../../../src/components-react/editors/SliderEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAYhE,g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,CAMlB;IAEF,OAAO,CAAC,SAAS,CAEf;IAEF,OAAO,CAAC,aAAa,CAInB;IAEF,OAAO,CAAC,aAAa,CAUnB;IAEF,OAAO,CAAC,YAAY,CASlB;IAEc,MAAM,IAAI,KAAK,CAAC,SAAS;CAyD1C;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC1D,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;CACF"}
|
|
@@ -13,8 +13,10 @@ import { Icon } from "@itwin/core-react";
|
|
|
13
13
|
import { Slider } from "@itwin/itwinui-react";
|
|
14
14
|
import { PropertyEditorBase } from "./PropertyEditorManager.js";
|
|
15
15
|
import { PopupButton, PopupContent, PopupOkCancelButtons, } from "./PopupButton.js";
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* SliderEditor React component that is a property editor with numeric input & up/down buttons
|
|
17
18
|
* @public
|
|
19
|
+
* @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.
|
|
18
20
|
*/
|
|
19
21
|
export class SliderEditor extends React.PureComponent {
|
|
20
22
|
_isMounted = false;
|
|
@@ -108,12 +110,8 @@ export class SliderEditor extends React.PureComponent {
|
|
|
108
110
|
showTooltip = sliderParams.showTooltip;
|
|
109
111
|
tooltipBelow = sliderParams.tooltipBelow;
|
|
110
112
|
formatTooltip = sliderParams.formatTooltip;
|
|
111
|
-
minLabel = !sliderParams.showMinMax ? ("") : sliderParams.minIconSpec ? (
|
|
112
|
-
|
|
113
|
-
React.createElement(Icon, { iconSpec: sliderParams.minIconSpec })) : undefined;
|
|
114
|
-
maxLabel = !sliderParams.showMinMax ? ("") : sliderParams.maxIconSpec ? (
|
|
115
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
116
|
-
React.createElement(Icon, { iconSpec: sliderParams.maxIconSpec })) : undefined;
|
|
113
|
+
minLabel = !sliderParams.showMinMax ? ("") : sliderParams.minIconSpec ? (React.createElement(Icon, { iconSpec: sliderParams.minIconSpec })) : undefined;
|
|
114
|
+
maxLabel = !sliderParams.showMinMax ? ("") : sliderParams.maxIconSpec ? (React.createElement(Icon, { iconSpec: sliderParams.maxIconSpec })) : undefined;
|
|
117
115
|
if (sliderParams.showTicks) {
|
|
118
116
|
const count = sliderParams.getTickCount
|
|
119
117
|
? sliderParams.getTickCount()
|
|
@@ -224,6 +222,7 @@ export class SliderEditor extends React.PureComponent {
|
|
|
224
222
|
/** Slider Property Editor registered for the "number" type name and "slider" editor name.
|
|
225
223
|
* It uses the [[SliderEditor]] React component.
|
|
226
224
|
* @public
|
|
225
|
+
* @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.
|
|
227
226
|
*/
|
|
228
227
|
export class SliderPropertyEditor extends PropertyEditorBase {
|
|
229
228
|
get reactNode() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderEditor.js","sourceRoot":"","sources":["../../../src/components-react/editors/SliderEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EACL,WAAW,EACX,YAAY,EACZ,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAqB1B;;GAEG;AACH,MAAM,OAAO,YACX,SAAQ,KAAK,CAAC,aAAqD;IAG3D,UAAU,GAAG,KAAK,CAAC;IACnB,SAAS,GAAG,KAAK,CAAC;IAClB,WAAW,GAAG,KAAK,CAAC,SAAS,E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E,IAAI,CAAC,aAAa,GAC5B,CACW,CACH,CACV,CACP,CAAC;IACJ,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IAC1D,IAAW,SAAS;QAClB,OAAO,oBAAC,YAAY,OAAG,CAAC;IAC1B,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 PropertyEditors\n */\n\nimport \"./SliderEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n PropertyEditorParams,\n PropertyValue,\n SliderEditorParams,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n PropertyValueFormat,\n} from \"@itwin/appui-abstract\";\nimport { Icon } from \"@itwin/core-react\";\nimport type { Tooltip } from \"@itwin/itwinui-react\";\nimport { Slider } from \"@itwin/itwinui-react\";\nimport type { PropertyEditorProps, TypeEditor } from \"./EditorContainer.js\";\nimport { PropertyEditorBase } from \"./PropertyEditorManager.js\";\nimport {\n PopupButton,\n PopupContent,\n PopupOkCancelButtons,\n} from \"./PopupButton.js\";\n\ntype TooltipProps = React.ComponentPropsWithoutRef<typeof Tooltip>;\n\n/** @internal */\ninterface SliderEditorState {\n value: number;\n min: number;\n max: number;\n size?: number;\n step?: number;\n showTooltip?: boolean;\n tooltipBelow?: boolean;\n formatTooltip?: (value: number) => string;\n thumbMode?: \"allow-crossing\" | \"inhibit-crossing\";\n trackDisplayMode?: \"auto\" | \"none\" | \"odd-segments\" | \"even-segments\";\n minLabel?: React.ReactNode;\n maxLabel?: React.ReactNode;\n tickLabels?: React.ReactNode;\n}\n\n/** SliderEditor React component that is a property editor with numeric input & up/down buttons\n * @public\n */\nexport class SliderEditor\n extends React.PureComponent<PropertyEditorProps, SliderEditorState>\n implements TypeEditor\n{\n private _isMounted = false;\n private _enterKey = false;\n private _divElement = React.createRef<HTMLDivElement>();\n\n public override readonly state: Readonly<SliderEditorState> = {\n value: 0,\n min: 0,\n max: 100,\n };\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: this.state.value,\n displayValue: \"\",\n };\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._divElement.current;\n }\n\n public get hasFocus(): boolean {\n let containsFocus = false;\n if (this.htmlElement)\n containsFocus = this.htmlElement.contains(document.activeElement);\n return containsFocus;\n }\n\n private _handleChange = (values: readonly number[]): void => {\n const newValue = values[0];\n\n if (this._isMounted)\n this.setState({\n value: newValue,\n });\n };\n\n public override componentDidMount() {\n this._isMounted = true;\n void this.setStateFromProps();\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n void this.setStateFromProps();\n }\n }\n\n private internalFormatTooltip = (value: number, step = 1) => {\n if (Number.isInteger(step)) return value.toFixed(0);\n\n const stepString = step.toString();\n const decimalIndex = stepString.indexOf(\".\");\n const numDecimals = step.toString().length - (decimalIndex + 1);\n return value.toFixed(numDecimals);\n };\n\n private async setStateFromProps() {\n const record = this.props.propertyRecord;\n let initialValue = 0;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n initialValue = record.value.value as number;\n }\n\n let size: number | undefined;\n let min = 0;\n let max = 100;\n let step: number | undefined;\n let showTooltip: boolean | undefined;\n let tooltipBelow: boolean | undefined;\n let formatTooltip: ((value: number) => string) | undefined;\n let tickLabels: string[] | undefined;\n let minLabel: React.ReactNode | undefined;\n let maxLabel: React.ReactNode | undefined;\n let trackDisplayMode:\n | \"auto\"\n | \"none\"\n | \"odd-segments\"\n | \"even-segments\"\n | undefined;\n let thumbMode: \"allow-crossing\" | \"inhibit-crossing\" | undefined;\n\n if (\n record &&\n record.property &&\n record.property.editor &&\n record.property.editor.params\n ) {\n const sliderParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.Slider.valueOf()\n ) as SliderEditorParams;\n if (sliderParams) {\n min = sliderParams.minimum;\n max = sliderParams.maximum;\n size = sliderParams.size;\n step = sliderParams.step;\n thumbMode =\n 1 === sliderParams.mode ? \"allow-crossing\" : \"inhibit-crossing\";\n trackDisplayMode = !sliderParams.reversed ? \"auto\" : \"odd-segments\";\n showTooltip = sliderParams.showTooltip;\n tooltipBelow = sliderParams.tooltipBelow;\n formatTooltip = sliderParams.formatTooltip;\n\n minLabel = !sliderParams.showMinMax ? (\n \"\"\n ) : sliderParams.minIconSpec ? (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <Icon iconSpec={sliderParams.minIconSpec} />\n ) : undefined;\n maxLabel = !sliderParams.showMinMax ? (\n \"\"\n ) : sliderParams.maxIconSpec ? (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <Icon iconSpec={sliderParams.maxIconSpec} />\n ) : undefined;\n\n if (sliderParams.showTicks) {\n const count = sliderParams.getTickCount\n ? sliderParams.getTickCount()\n : 0;\n if (count) {\n tickLabels = [];\n const increment = (max - min) / count;\n for (let i = 0; i <= count; i++) {\n const value = i * increment + min;\n if (sliderParams.showTickLabels) {\n const label = sliderParams.formatTick\n ? sliderParams.formatTick(value)\n : this.internalFormatTooltip(value, step);\n tickLabels.push(label);\n } else {\n tickLabels.push(\"\");\n }\n }\n } else if (sliderParams.getTickValues) {\n tickLabels = sliderParams\n .getTickValues()\n .map((val: number) =>\n sliderParams.formatTick\n ? sliderParams.formatTick(val)\n : this.internalFormatTooltip(val, step)\n );\n }\n }\n }\n }\n\n if (this._isMounted)\n this.setState({\n value: initialValue,\n size,\n min,\n max,\n step,\n trackDisplayMode,\n showTooltip,\n tooltipBelow,\n formatTooltip,\n minLabel,\n maxLabel,\n tickLabels,\n thumbMode,\n });\n }\n\n private _handleEnter = async (): Promise<void> => {\n this._enterKey = true;\n await this._handleCommit();\n };\n\n private _handleClose = async (): Promise<void> => {\n if (this._enterKey) {\n this._enterKey = false;\n } else {\n if (this.props.onCancel) this.props.onCancel();\n }\n };\n\n private _handleOk = async (_event: React.MouseEvent): Promise<void> => {\n await this._handleCommit();\n };\n\n private _handleCancel = (_event: React.MouseEvent): void => {\n if (this.props.onCancel) {\n this.props.onCancel();\n }\n };\n\n private _handleCommit = async (): Promise<void> => {\n if (this.props.propertyRecord && this.props.onCommit) {\n const propertyValue = await this.getPropertyValue();\n if (propertyValue !== undefined) {\n this.props.onCommit({\n propertyRecord: this.props.propertyRecord,\n newValue: propertyValue,\n });\n }\n }\n };\n\n private tooltipProps = (_index: number, val: number) => {\n const content = this.state.formatTooltip\n ? this.state.formatTooltip(val)\n : this.internalFormatTooltip(val, this.state.step);\n return {\n placement: this.state.tooltipBelow ? \"bottom\" : \"top\",\n content,\n visible: this.state.showTooltip,\n } as Partial<Omit<TooltipProps, \"children\">>;\n };\n\n public override render(): React.ReactNode {\n const className = classnames(\n \"components-cell-editor\",\n \"components-slider-editor\",\n this.props.className\n );\n const minSize = this.state.size ? this.state.size : 100;\n const style: React.CSSProperties = {\n ...this.props.style,\n minWidth: `${minSize}px`,\n };\n\n const tickProps = {\n \"data-testid\": \"components-tick\",\n } as React.ComponentProps<\"span\">;\n const popupContent = (\n <Slider\n className=\"components-slider-editor-slider\"\n style={style}\n values={[this.state.value]}\n min={this.state.min}\n max={this.state.max}\n step={this.state.step}\n thumbMode={this.state.thumbMode}\n trackDisplayMode={this.state.trackDisplayMode}\n disabled={this.props.propertyRecord?.isDisabled}\n minLabel={this.state.minLabel}\n maxLabel={this.state.maxLabel}\n tooltipProps={this.tooltipProps}\n tickLabels={this.state.tickLabels}\n tickProps={tickProps}\n onChange={this._handleChange}\n />\n );\n\n return (\n <div className={className} ref={this._divElement}>\n <PopupButton\n id={this.props.propertyRecord?.property.name}\n label={this.state.value}\n onClose={this._handleClose}\n onEnter={this._handleEnter}\n setFocus={this.props.setFocus}\n disabled={this.props.propertyRecord?.isDisabled}\n readonly={this.props.propertyRecord?.isReadonly}\n >\n <PopupContent>\n {popupContent}\n <PopupOkCancelButtons\n onOk={this._handleOk}\n onCancel={this._handleCancel}\n />\n </PopupContent>\n </PopupButton>\n </div>\n );\n }\n}\n\n/** Slider Property Editor registered for the \"number\" type name and \"slider\" editor name.\n * It uses the [[SliderEditor]] React component.\n * @public\n */\nexport class SliderPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <SliderEditor />;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SliderEditor.js","sourceRoot":"","sources":["../../../src/components-react/editors/SliderEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EACL,WAAW,EACX,YAAY,EACZ,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAwB1B;;;;GAIG;AACH,MAAM,OAAO,YACX,SAAQ,KAAK,CAAC,aAAqD;IAG3D,UAAU,GAAG,KAAK,CAAC;IACnB,SAAS,GAAG,KAAK,CAAC;IAClB,WAAW,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;IAE/B,KAAK,GAAgC;QAC5D,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,CAAC;QACN,GAAG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AC1D,IAAW,SAAS;QAClB,OAAO,oBAAC,YAAY,OAAG,CAAC;IAC1B,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 PropertyEditors\n */\n\nimport \"./SliderEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n PropertyEditorParams,\n PropertyValue,\n SliderEditorParams,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n PropertyValueFormat,\n} from \"@itwin/appui-abstract\";\nimport { Icon } from \"@itwin/core-react\";\nimport type { Tooltip } from \"@itwin/itwinui-react\";\nimport { Slider } from \"@itwin/itwinui-react\";\nimport type { PropertyEditorProps, TypeEditor } from \"./EditorContainer.js\";\nimport { PropertyEditorBase } from \"./PropertyEditorManager.js\";\nimport {\n PopupButton,\n PopupContent,\n PopupOkCancelButtons,\n} from \"./PopupButton.js\";\nimport { EditorRenderer } from \"../new-editors/EditorRenderer.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\ntype TooltipProps = React.ComponentPropsWithoutRef<typeof Tooltip>;\n\n/** @internal */\ninterface SliderEditorState {\n value: number;\n min: number;\n max: number;\n size?: number;\n step?: number;\n showTooltip?: boolean;\n tooltipBelow?: boolean;\n formatTooltip?: (value: number) => string;\n thumbMode?: \"allow-crossing\" | \"inhibit-crossing\";\n trackDisplayMode?: \"auto\" | \"none\" | \"odd-segments\" | \"even-segments\";\n minLabel?: React.ReactNode;\n maxLabel?: React.ReactNode;\n tickLabels?: React.ReactNode;\n}\n\n/**\n * SliderEditor React component that is a property editor with numeric input & up/down buttons\n * @public\n * @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.\n */\nexport class SliderEditor\n extends React.PureComponent<PropertyEditorProps, SliderEditorState>\n implements TypeEditor\n{\n private _isMounted = false;\n private _enterKey = false;\n private _divElement = React.createRef<HTMLDivElement>();\n\n public override readonly state: Readonly<SliderEditorState> = {\n value: 0,\n min: 0,\n max: 100,\n };\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: this.state.value,\n displayValue: \"\",\n };\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._divElement.current;\n }\n\n public get hasFocus(): boolean {\n let containsFocus = false;\n if (this.htmlElement)\n containsFocus = this.htmlElement.contains(document.activeElement);\n return containsFocus;\n }\n\n private _handleChange = (values: readonly number[]): void => {\n const newValue = values[0];\n\n if (this._isMounted)\n this.setState({\n value: newValue,\n });\n };\n\n public override componentDidMount() {\n this._isMounted = true;\n void this.setStateFromProps();\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n void this.setStateFromProps();\n }\n }\n\n private internalFormatTooltip = (value: number, step = 1) => {\n if (Number.isInteger(step)) return value.toFixed(0);\n\n const stepString = step.toString();\n const decimalIndex = stepString.indexOf(\".\");\n const numDecimals = step.toString().length - (decimalIndex + 1);\n return value.toFixed(numDecimals);\n };\n\n private async setStateFromProps() {\n const record = this.props.propertyRecord;\n let initialValue = 0;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n initialValue = record.value.value as number;\n }\n\n let size: number | undefined;\n let min = 0;\n let max = 100;\n let step: number | undefined;\n let showTooltip: boolean | undefined;\n let tooltipBelow: boolean | undefined;\n let formatTooltip: ((value: number) => string) | undefined;\n let tickLabels: string[] | undefined;\n let minLabel: React.ReactNode | undefined;\n let maxLabel: React.ReactNode | undefined;\n let trackDisplayMode:\n | \"auto\"\n | \"none\"\n | \"odd-segments\"\n | \"even-segments\"\n | undefined;\n let thumbMode: \"allow-crossing\" | \"inhibit-crossing\" | undefined;\n\n if (\n record &&\n record.property &&\n record.property.editor &&\n record.property.editor.params\n ) {\n const sliderParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.Slider.valueOf()\n ) as SliderEditorParams;\n if (sliderParams) {\n min = sliderParams.minimum;\n max = sliderParams.maximum;\n size = sliderParams.size;\n step = sliderParams.step;\n thumbMode =\n 1 === sliderParams.mode ? \"allow-crossing\" : \"inhibit-crossing\";\n trackDisplayMode = !sliderParams.reversed ? \"auto\" : \"odd-segments\";\n showTooltip = sliderParams.showTooltip;\n tooltipBelow = sliderParams.tooltipBelow;\n formatTooltip = sliderParams.formatTooltip;\n\n minLabel = !sliderParams.showMinMax ? (\n \"\"\n ) : sliderParams.minIconSpec ? (\n <Icon iconSpec={sliderParams.minIconSpec} />\n ) : undefined;\n maxLabel = !sliderParams.showMinMax ? (\n \"\"\n ) : sliderParams.maxIconSpec ? (\n <Icon iconSpec={sliderParams.maxIconSpec} />\n ) : undefined;\n\n if (sliderParams.showTicks) {\n const count = sliderParams.getTickCount\n ? sliderParams.getTickCount()\n : 0;\n if (count) {\n tickLabels = [];\n const increment = (max - min) / count;\n for (let i = 0; i <= count; i++) {\n const value = i * increment + min;\n if (sliderParams.showTickLabels) {\n const label = sliderParams.formatTick\n ? sliderParams.formatTick(value)\n : this.internalFormatTooltip(value, step);\n tickLabels.push(label);\n } else {\n tickLabels.push(\"\");\n }\n }\n } else if (sliderParams.getTickValues) {\n tickLabels = sliderParams\n .getTickValues()\n .map((val: number) =>\n sliderParams.formatTick\n ? sliderParams.formatTick(val)\n : this.internalFormatTooltip(val, step)\n );\n }\n }\n }\n }\n\n if (this._isMounted)\n this.setState({\n value: initialValue,\n size,\n min,\n max,\n step,\n trackDisplayMode,\n showTooltip,\n tooltipBelow,\n formatTooltip,\n minLabel,\n maxLabel,\n tickLabels,\n thumbMode,\n });\n }\n\n private _handleEnter = async (): Promise<void> => {\n this._enterKey = true;\n await this._handleCommit();\n };\n\n private _handleClose = async (): Promise<void> => {\n if (this._enterKey) {\n this._enterKey = false;\n } else {\n if (this.props.onCancel) this.props.onCancel();\n }\n };\n\n private _handleOk = async (_event: React.MouseEvent): Promise<void> => {\n await this._handleCommit();\n };\n\n private _handleCancel = (_event: React.MouseEvent): void => {\n if (this.props.onCancel) {\n this.props.onCancel();\n }\n };\n\n private _handleCommit = async (): Promise<void> => {\n if (this.props.propertyRecord && this.props.onCommit) {\n const propertyValue = await this.getPropertyValue();\n if (propertyValue !== undefined) {\n this.props.onCommit({\n propertyRecord: this.props.propertyRecord,\n newValue: propertyValue,\n });\n }\n }\n };\n\n private tooltipProps = (_index: number, val: number) => {\n const content = this.state.formatTooltip\n ? this.state.formatTooltip(val)\n : this.internalFormatTooltip(val, this.state.step);\n return {\n placement: this.state.tooltipBelow ? \"bottom\" : \"top\",\n content,\n visible: this.state.showTooltip,\n } as Partial<Omit<TooltipProps, \"children\">>;\n };\n\n public override render(): React.ReactNode {\n const className = classnames(\n \"components-cell-editor\",\n \"components-slider-editor\",\n this.props.className\n );\n const minSize = this.state.size ? this.state.size : 100;\n const style: React.CSSProperties = {\n ...this.props.style,\n minWidth: `${minSize}px`,\n };\n\n const tickProps = {\n \"data-testid\": \"components-tick\",\n } as React.ComponentProps<\"span\">;\n const popupContent = (\n <Slider\n className=\"components-slider-editor-slider\"\n style={style}\n values={[this.state.value]}\n min={this.state.min}\n max={this.state.max}\n step={this.state.step}\n thumbMode={this.state.thumbMode}\n trackDisplayMode={this.state.trackDisplayMode}\n disabled={this.props.propertyRecord?.isDisabled}\n minLabel={this.state.minLabel}\n maxLabel={this.state.maxLabel}\n tooltipProps={this.tooltipProps}\n tickLabels={this.state.tickLabels}\n tickProps={tickProps}\n onChange={this._handleChange}\n />\n );\n\n return (\n <div className={className} ref={this._divElement}>\n <PopupButton\n id={this.props.propertyRecord?.property.name}\n label={this.state.value}\n onClose={this._handleClose}\n onEnter={this._handleEnter}\n setFocus={this.props.setFocus}\n disabled={this.props.propertyRecord?.isDisabled}\n readonly={this.props.propertyRecord?.isReadonly}\n >\n <PopupContent>\n {popupContent}\n <PopupOkCancelButtons\n onOk={this._handleOk}\n onCancel={this._handleCancel}\n />\n </PopupContent>\n </PopupButton>\n </div>\n );\n }\n}\n\n/** Slider Property Editor registered for the \"number\" type name and \"slider\" editor name.\n * It uses the [[SliderEditor]] React component.\n * @public\n * @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.\n */\nexport class SliderPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <SliderEditor />;\n }\n}\n"]}
|
|
@@ -16,6 +16,7 @@ interface TextEditorState {
|
|
|
16
16
|
}
|
|
17
17
|
/** TextEditor React component that is a property editor with text input
|
|
18
18
|
* @public
|
|
19
|
+
* @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.
|
|
19
20
|
*/
|
|
20
21
|
export declare class TextEditor extends React.PureComponent<PropertyEditorProps, TextEditorState> implements TypeEditor {
|
|
21
22
|
private _isMounted;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../../src/components-react/editors/TextEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAE3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAKV,aAAa,EACd,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAEV,mBAAmB,EACnB,UAAU,EACX,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../../src/components-react/editors/TextEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAE3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAKV,aAAa,EACd,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAEV,mBAAmB,EACnB,UAAU,EACX,MAAM,sBAAsB,CAAC;AAQ9B,gBAAgB;AAChB,UAAU,eAAe;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,qBAAa,UACX,SAAQ,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,eAAe,CAChE,YAAW,UAAU;IAErB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAuC;IAE5D,SAAyB,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC,CAGvD;IAEW,gBAAgB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAenE,IAAW,WAAW,IAAI,WAAW,GAAG,IAAI,CAE3C;IAED,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED,OAAO,CAAC,QAAQ,CAOd;IAEF,OAAO,CAAC,iBAAiB,CAqBvB;IAEc,iBAAiB;IAKjB,oBAAoB;IAIpC,gBAAgB;IACA,kBAAkB,CAAC,SAAS,EAAE,mBAAmB;YAMnD,iBAAiB;IAqDf,MAAM,IAAI,KAAK,CAAC,SAAS;CA0C1C"}
|
|
@@ -15,6 +15,7 @@ import { TypeConverterManager } from "../converters/TypeConverterManager.js";
|
|
|
15
15
|
import { UiComponents } from "../UiComponents.js";
|
|
16
16
|
/** TextEditor React component that is a property editor with text input
|
|
17
17
|
* @public
|
|
18
|
+
* @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.
|
|
18
19
|
*/
|
|
19
20
|
export class TextEditor extends React.PureComponent {
|
|
20
21
|
_isMounted = false;
|
|
@@ -139,9 +140,7 @@ export class TextEditor extends React.PureComponent {
|
|
|
139
140
|
autoFocus: this.props.setFocus && !this.props.propertyRecord?.isDisabled,
|
|
140
141
|
"aria-label": UiComponents.translate("editor.text"),
|
|
141
142
|
};
|
|
142
|
-
const icon = this.state.iconSpec ? (
|
|
143
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
144
|
-
React.createElement(Icon, { iconSpec: this.state.iconSpec })) : undefined;
|
|
143
|
+
const icon = this.state.iconSpec ? (React.createElement(Icon, { iconSpec: this.state.iconSpec })) : undefined;
|
|
145
144
|
return (React.createElement(LockTextEditor, { ...inputProps, ref: this._inputElement, id: this.props.propertyRecord?.property.name, icon: icon, decoration: decoration }));
|
|
146
145
|
}
|
|
147
146
|
}
|
|
@@ -154,9 +153,7 @@ const LockTextEditor = React.forwardRef(function LockTextEditor(props, forwarded
|
|
|
154
153
|
decoration));
|
|
155
154
|
}
|
|
156
155
|
if (icon) {
|
|
157
|
-
return (
|
|
158
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
159
|
-
React.createElement(IconInput, { ...rest, ref: forwardedRef, icon: icon, "data-testid": "components-text-editor" }));
|
|
156
|
+
return (React.createElement(IconInput, { ...rest, ref: forwardedRef, icon: icon, "data-testid": "components-text-editor" }));
|
|
160
157
|
}
|
|
161
158
|
return (React.createElement(Input, { ...rest, ref: forwardedRef, "data-testid": "components-text-editor", size: "small" }));
|
|
162
159
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditor.js","sourceRoot":"","sources":["../../../src/components-react/editors/TextEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC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AI,CACP,oBAAC,oBAAoB,CAAC,IAAI,IAAC,IAAI,EAAC,OAAO,IACpC,IAAI,CACqB,CAC7B;YACD,oBAAC,oBAAoB,CAAC,KAAK,OACrB,IAAI,EACR,GAAG,EAAE,YAAY,iBACL,wBAAwB,EACpC,IAAI,EAAC,OAAO,GACZ;YACD,UAAU,CACU,CACxB,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,EAAE,CAAC;QACT,OAAO;QACL,4DAA4D;QAC5D,oBAAC,SAAS,OACJ,IAAI,EACR,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,IAAI,iBACE,wBAAwB,GACpC,CACH,CAAC;IACJ,CAAC;IACD,OAAO,CACL,oBAAC,KAAK,OACA,IAAI,EACR,GAAG,EAAE,YAAY,iBACL,wBAAwB,EACpC,IAAI,EAAC,OAAO,GACZ,CACH,CAAC;AACJ,CAAC,CACF,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 PropertyEditors\n */\n\nimport \"./TextEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n IconEditorParams,\n InputEditorSizeParams,\n PrimitiveValue,\n PropertyEditorParams,\n PropertyValue,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n PropertyValueFormat,\n} from \"@itwin/appui-abstract\";\nimport { Icon, IconInput } from \"@itwin/core-react\";\nimport { Input, InputWithDecorations } from \"@itwin/itwinui-react\";\nimport { TypeConverterManager } from \"../converters/TypeConverterManager.js\";\nimport type {\n InternalInputEditorProps,\n PropertyEditorProps,\n TypeEditor,\n} from \"./EditorContainer.js\";\nimport { UiComponents } from \"../UiComponents.js\";\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Input>;\n\n/** @internal */\ninterface TextEditorState {\n inputValue: string;\n originalValue: string;\n size?: number;\n maxSize?: number;\n maxLength?: number;\n iconSpec?: string;\n}\n\n/** TextEditor React component that is a property editor with text input\n * @public\n */\nexport class TextEditor\n extends React.PureComponent<PropertyEditorProps, TextEditorState>\n implements TypeEditor\n{\n private _isMounted = false;\n private _inputElement = React.createRef<HTMLInputElement>();\n\n public override readonly state: Readonly<TextEditorState> = {\n inputValue: \"\",\n originalValue: \"\",\n };\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = await TypeConverterManager.getConverter(\n record.property.typename,\n record.property.converter?.name\n ).convertFromStringToPropertyValue(this.state.inputValue, record);\n (propertyValue as PrimitiveValue).displayValue = this.state.inputValue;\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._inputElement.current;\n }\n\n public get hasFocus(): boolean {\n return document.activeElement === this._inputElement.current;\n }\n\n private _onFocus = () => {\n if (this._isMounted && this.props.propertyRecord?.isMerged) {\n this.setState((prevState) => ({\n ...prevState,\n inputValue: prevState.originalValue,\n }));\n }\n };\n\n private _updateInputValue = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (this._isMounted)\n this.setState(\n {\n inputValue: e.target.value,\n },\n async () => {\n if (\n this.props.shouldCommitOnChange &&\n this.props.onCommit &&\n this.props.propertyRecord\n ) {\n const newValue = await this.getPropertyValue();\n if (newValue)\n this.props.onCommit({\n propertyRecord: this.props.propertyRecord,\n newValue,\n });\n }\n }\n );\n };\n\n public override componentDidMount() {\n this._isMounted = true;\n void this.setStateFromProps();\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n void this.setStateFromProps();\n }\n }\n\n private async setStateFromProps() {\n const record = this.props.propertyRecord;\n let initialValue = \"\";\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n const value = record.value.value;\n initialValue = await TypeConverterManager.getConverter(\n record.property.typename,\n record.property.converter?.name\n ).convertPropertyToString(record.property, value);\n }\n\n let size: number | undefined;\n let maxSize: number | undefined;\n let maxLength: number | undefined;\n let iconSpec: string | undefined;\n\n if (\n record &&\n record.property &&\n record.property.editor &&\n record.property.editor.params\n ) {\n const editorSizeParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.InputEditorSize.valueOf()\n ) as InputEditorSizeParams;\n if (editorSizeParams) {\n if (editorSizeParams.size) size = editorSizeParams.size;\n if (editorSizeParams.maxSize) maxSize = editorSizeParams.maxSize;\n if (editorSizeParams.maxLength) maxLength = editorSizeParams.maxLength;\n }\n\n const iconParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.Icon.valueOf()\n ) as IconEditorParams;\n if (iconParams) {\n iconSpec = iconParams.definition.iconSpec;\n }\n }\n\n if (this._isMounted)\n this.setState({\n inputValue: record?.isMerged && !this.hasFocus ? \"--\" : initialValue,\n originalValue: initialValue,\n size,\n maxSize,\n maxLength,\n iconSpec,\n });\n }\n\n public override render(): React.ReactNode {\n const { decoration } = this.props as InternalInputEditorProps;\n const className = classnames(\n \"components-cell-editor\",\n \"components-text-editor\",\n this.props.className\n );\n const minSize = this.state.size ? this.state.size : 8;\n const style: React.CSSProperties = {\n minWidth: `${minSize * 0.75}em`,\n maxWidth: this.state.maxSize\n ? `${this.state.maxSize * 0.75}em`\n : undefined,\n };\n const inputProps: InputProps = {\n type: \"text\",\n className,\n style: this.props.style ? this.props.style : style,\n readOnly: this.props.propertyRecord?.isReadonly,\n disabled: this.props.propertyRecord?.isDisabled,\n maxLength: this.state.maxLength,\n value: this.state.inputValue,\n onBlur: this.props.onBlur,\n onFocus: this._onFocus,\n onChange: this._updateInputValue,\n autoFocus: this.props.setFocus && !this.props.propertyRecord?.isDisabled,\n \"aria-label\": UiComponents.translate(\"editor.text\"),\n };\n\n const icon = this.state.iconSpec ? (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <Icon iconSpec={this.state.iconSpec} />\n ) : undefined;\n return (\n <LockTextEditor\n {...inputProps}\n ref={this._inputElement}\n id={this.props.propertyRecord?.property.name}\n icon={icon}\n decoration={decoration}\n />\n );\n }\n}\n\ninterface LockTextEditorProps extends InputProps {\n icon?: React.ReactNode;\n decoration?: React.ReactNode;\n}\n\nconst LockTextEditor = React.forwardRef<HTMLInputElement, LockTextEditorProps>(\n function LockTextEditor(props, forwardedRef) {\n const { icon, decoration, ...rest } = props;\n if (decoration) {\n return (\n <InputWithDecorations size=\"small\">\n {icon && (\n <InputWithDecorations.Icon size=\"small\">\n {icon}\n </InputWithDecorations.Icon>\n )}\n <InputWithDecorations.Input\n {...rest}\n ref={forwardedRef}\n data-testid=\"components-text-editor\"\n size=\"small\"\n />\n {decoration}\n </InputWithDecorations>\n );\n }\n\n if (icon) {\n return (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <IconInput\n {...rest}\n ref={forwardedRef}\n icon={icon}\n data-testid=\"components-text-editor\"\n />\n );\n }\n return (\n <Input\n {...rest}\n ref={forwardedRef}\n data-testid=\"components-text-editor\"\n size=\"small\"\n />\n );\n }\n);\n"]}
|
|
1
|
+
{"version":3,"file":"TextEditor.js","sourceRoot":"","sources":["../../../src/components-react/editors/TextEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,o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L,wBAAwB,EACpC,IAAI,EAAC,OAAO,GACZ;YACD,UAAU,CACU,CACxB,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,CACL,oBAAC,SAAS,OACJ,IAAI,EACR,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,IAAI,iBACE,wBAAwB,GACpC,CACH,CAAC;IACJ,CAAC;IACD,OAAO,CACL,oBAAC,KAAK,OACA,IAAI,EACR,GAAG,EAAE,YAAY,iBACL,wBAAwB,EACpC,IAAI,EAAC,OAAO,GACZ,CACH,CAAC;AACJ,CAAC,CACF,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 PropertyEditors\n */\n\nimport \"./TextEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n IconEditorParams,\n InputEditorSizeParams,\n PrimitiveValue,\n PropertyEditorParams,\n PropertyValue,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n PropertyValueFormat,\n} from \"@itwin/appui-abstract\";\nimport { Icon, IconInput } from \"@itwin/core-react\";\nimport { Input, InputWithDecorations } from \"@itwin/itwinui-react\";\nimport { TypeConverterManager } from \"../converters/TypeConverterManager.js\";\nimport type {\n InternalInputEditorProps,\n PropertyEditorProps,\n TypeEditor,\n} from \"./EditorContainer.js\";\nimport { UiComponents } from \"../UiComponents.js\";\nimport { EditorRenderer } from \"../new-editors/EditorRenderer.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Input>;\n\n/** @internal */\ninterface TextEditorState {\n inputValue: string;\n originalValue: string;\n size?: number;\n maxSize?: number;\n maxLength?: number;\n iconSpec?: string;\n}\n\n/** TextEditor React component that is a property editor with text input\n * @public\n * @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.\n */\nexport class TextEditor\n extends React.PureComponent<PropertyEditorProps, TextEditorState>\n implements TypeEditor\n{\n private _isMounted = false;\n private _inputElement = React.createRef<HTMLInputElement>();\n\n public override readonly state: Readonly<TextEditorState> = {\n inputValue: \"\",\n originalValue: \"\",\n };\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = await TypeConverterManager.getConverter(\n record.property.typename,\n record.property.converter?.name\n ).convertFromStringToPropertyValue(this.state.inputValue, record);\n (propertyValue as PrimitiveValue).displayValue = this.state.inputValue;\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._inputElement.current;\n }\n\n public get hasFocus(): boolean {\n return document.activeElement === this._inputElement.current;\n }\n\n private _onFocus = () => {\n if (this._isMounted && this.props.propertyRecord?.isMerged) {\n this.setState((prevState) => ({\n ...prevState,\n inputValue: prevState.originalValue,\n }));\n }\n };\n\n private _updateInputValue = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (this._isMounted)\n this.setState(\n {\n inputValue: e.target.value,\n },\n async () => {\n if (\n this.props.shouldCommitOnChange &&\n this.props.onCommit &&\n this.props.propertyRecord\n ) {\n const newValue = await this.getPropertyValue();\n if (newValue)\n this.props.onCommit({\n propertyRecord: this.props.propertyRecord,\n newValue,\n });\n }\n }\n );\n };\n\n public override componentDidMount() {\n this._isMounted = true;\n void this.setStateFromProps();\n }\n\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n void this.setStateFromProps();\n }\n }\n\n private async setStateFromProps() {\n const record = this.props.propertyRecord;\n let initialValue = \"\";\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n const value = record.value.value;\n initialValue = await TypeConverterManager.getConverter(\n record.property.typename,\n record.property.converter?.name\n ).convertPropertyToString(record.property, value);\n }\n\n let size: number | undefined;\n let maxSize: number | undefined;\n let maxLength: number | undefined;\n let iconSpec: string | undefined;\n\n if (\n record &&\n record.property &&\n record.property.editor &&\n record.property.editor.params\n ) {\n const editorSizeParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.InputEditorSize.valueOf()\n ) as InputEditorSizeParams;\n if (editorSizeParams) {\n if (editorSizeParams.size) size = editorSizeParams.size;\n if (editorSizeParams.maxSize) maxSize = editorSizeParams.maxSize;\n if (editorSizeParams.maxLength) maxLength = editorSizeParams.maxLength;\n }\n\n const iconParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.Icon.valueOf()\n ) as IconEditorParams;\n if (iconParams) {\n iconSpec = iconParams.definition.iconSpec;\n }\n }\n\n if (this._isMounted)\n this.setState({\n inputValue: record?.isMerged && !this.hasFocus ? \"--\" : initialValue,\n originalValue: initialValue,\n size,\n maxSize,\n maxLength,\n iconSpec,\n });\n }\n\n public override render(): React.ReactNode {\n const { decoration } = this.props as InternalInputEditorProps;\n const className = classnames(\n \"components-cell-editor\",\n \"components-text-editor\",\n this.props.className\n );\n const minSize = this.state.size ? this.state.size : 8;\n const style: React.CSSProperties = {\n minWidth: `${minSize * 0.75}em`,\n maxWidth: this.state.maxSize\n ? `${this.state.maxSize * 0.75}em`\n : undefined,\n };\n const inputProps: InputProps = {\n type: \"text\",\n className,\n style: this.props.style ? this.props.style : style,\n readOnly: this.props.propertyRecord?.isReadonly,\n disabled: this.props.propertyRecord?.isDisabled,\n maxLength: this.state.maxLength,\n value: this.state.inputValue,\n onBlur: this.props.onBlur,\n onFocus: this._onFocus,\n onChange: this._updateInputValue,\n autoFocus: this.props.setFocus && !this.props.propertyRecord?.isDisabled,\n \"aria-label\": UiComponents.translate(\"editor.text\"),\n };\n\n const icon = this.state.iconSpec ? (\n <Icon iconSpec={this.state.iconSpec} />\n ) : undefined;\n return (\n <LockTextEditor\n {...inputProps}\n ref={this._inputElement}\n id={this.props.propertyRecord?.property.name}\n icon={icon}\n decoration={decoration}\n />\n );\n }\n}\n\ninterface LockTextEditorProps extends InputProps {\n icon?: React.ReactNode;\n decoration?: React.ReactNode;\n}\n\nconst LockTextEditor = React.forwardRef<HTMLInputElement, LockTextEditorProps>(\n function LockTextEditor(props, forwardedRef) {\n const { icon, decoration, ...rest } = props;\n if (decoration) {\n return (\n <InputWithDecorations size=\"small\">\n {icon && (\n <InputWithDecorations.Icon size=\"small\">\n {icon}\n </InputWithDecorations.Icon>\n )}\n <InputWithDecorations.Input\n {...rest}\n ref={forwardedRef}\n data-testid=\"components-text-editor\"\n size=\"small\"\n />\n {decoration}\n </InputWithDecorations>\n );\n }\n\n if (icon) {\n return (\n <IconInput\n {...rest}\n ref={forwardedRef}\n icon={icon}\n data-testid=\"components-text-editor\"\n />\n );\n }\n return (\n <Input\n {...rest}\n ref={forwardedRef}\n data-testid=\"components-text-editor\"\n size=\"small\"\n />\n );\n }\n);\n"]}
|
|
@@ -16,6 +16,7 @@ interface TextareaEditorState {
|
|
|
16
16
|
}
|
|
17
17
|
/** TextareaEditor React component that is a property editor with text input
|
|
18
18
|
* @public
|
|
19
|
+
* @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.
|
|
19
20
|
*/
|
|
20
21
|
export declare class TextareaEditor extends React.PureComponent<PropertyEditorProps, TextareaEditorState> implements TypeEditor {
|
|
21
22
|
private _isMounted;
|
|
@@ -38,6 +39,7 @@ export declare class TextareaEditor extends React.PureComponent<PropertyEditorPr
|
|
|
38
39
|
/** Textarea Property Editor registered for the "text" and "string" type names and "multi-line" editor name.
|
|
39
40
|
* It uses the [[TextareaEditor]] React component.
|
|
40
41
|
* @public
|
|
42
|
+
* @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.
|
|
41
43
|
*/
|
|
42
44
|
export declare class TextareaPropertyEditor extends PropertyEditorBase {
|
|
43
45
|
get containerHandlesBlur(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextareaEditor.d.ts","sourceRoot":"","sources":["../../../src/components-react/editors/TextareaEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAKV,aAAa,EACd,MAAM,uBAAuB,CAAC;AAO/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"TextareaEditor.d.ts","sourceRoot":"","sources":["../../../src/components-react/editors/TextareaEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAKV,aAAa,EACd,MAAM,uBAAuB,CAAC;AAO/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAahE,gBAAgB;AAChB,UAAU,mBAAmB;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAID;;;GAGG;AACH,qBAAa,cACX,SAAQ,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,mBAAmB,CACpE,YAAW,UAAU;IAErB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAqC;IACxD,OAAO,CAAC,gBAAgB,CAA0C;IAElE,SAAyB,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAG3D;IAEW,gBAAgB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAcnE,IAAW,WAAW,IAAI,WAAW,GAAG,IAAI,CAE3C;IAED,IAAW,QAAQ,IAAI,OAAO,CAK7B;IAED,OAAO,CAAC,oBAAoB,CAO1B;IAEc,iBAAiB;IAKjB,oBAAoB;IAIpC,gBAAgB;IACA,kBAAkB,CAAC,SAAS,EAAE,mBAAmB;YAMnD,iBAAiB;IAmD/B,OAAO,CAAC,SAAS,CAUf;IAEF,OAAO,CAAC,aAAa,CAInB;IAEc,MAAM,IAAI,KAAK,CAAC,SAAS;CAoD1C;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,kBAAkB;IAC5D,IAAoB,oBAAoB,IAAI,OAAO,CAElD;IACD,IAAoB,qBAAqB,IAAI,OAAO,CAEnD;IACD,IAAoB,mBAAmB,IAAI,OAAO,CAEjD;IAED,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;CACF"}
|
|
@@ -17,6 +17,7 @@ import { UiComponents } from "../UiComponents.js";
|
|
|
17
17
|
const DEFAULT_ROWS = 3;
|
|
18
18
|
/** TextareaEditor React component that is a property editor with text input
|
|
19
19
|
* @public
|
|
20
|
+
* @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.
|
|
20
21
|
*/
|
|
21
22
|
export class TextareaEditor extends React.PureComponent {
|
|
22
23
|
_isMounted = false;
|
|
@@ -149,6 +150,7 @@ export class TextareaEditor extends React.PureComponent {
|
|
|
149
150
|
/** Textarea Property Editor registered for the "text" and "string" type names and "multi-line" editor name.
|
|
150
151
|
* It uses the [[TextareaEditor]] React component.
|
|
151
152
|
* @public
|
|
153
|
+
* @deprecated in 5.30. This is part of the old editor system and should not be used directly. Use {@link EditorRenderer} instead.
|
|
152
154
|
*/
|
|
153
155
|
export class TextareaPropertyEditor extends PropertyEditorBase {
|
|
154
156
|
get containerHandlesBlur() {
|