Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd62967b

Browse files
committed
[Feat]: Add tabindex for the switch, autocomp and rich editor
1 parent3ed4c97 commitd62967b

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

‎client/packages/lowcoder/src/comps/comps/autoCompleteComp/autoCompleteComp.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
importstyled,{css}from"styled-components";
2121
import{UICompBuilder}from"../../generators";
2222
import{FormDataPropertyView}from"../formComp/formDataConstants";
23-
import{jsonControl}from"comps/controls/codeControl";
23+
import{jsonControl,NumberControl}from"comps/controls/codeControl";
2424
import{dropdownControl}from"comps/controls/dropdownControl";
2525
import{
2626
getStyle,
@@ -92,6 +92,7 @@ const childrenMap = {
9292
inputFieldStyle:styleControl(InputLikeStyle,'inputFieldStyle'),
9393
childrenInputFieldStyle:styleControl(ChildrenMultiSelectStyle,'childrenInputFieldStyle'),
9494
animationStyle:styleControl(AnimationStyle,'animationStyle'),
95+
tabIndex:NumberControl,
9596
};
9697

9798
constgetValidate=(value:any):""|"warning"|"error"|undefined=>{
@@ -271,6 +272,7 @@ let AutoCompleteCompBase = (function () {
271272
suffix={hasIcon(props.suffixIcon)&&props.suffixIcon}
272273
status={getValidate(validateState)}
273274
onPressEnter={undefined}
275+
tabIndex={typeofprops.tabIndex==='number' ?props.tabIndex :undefined}
274276
/>
275277
</AutoComplete>
276278
</>
@@ -354,6 +356,9 @@ let AutoCompleteCompBase = (function () {
354356
>
355357
{children.animationStyle.getPropertyView()}
356358
</Section>
359+
<Sectionname={sectionNames.advanced}>
360+
{children.tabIndex.propertyView({label:trans("prop.tabIndex")})}
361+
</Section>
357362
</>
358363
);
359364
})

‎client/packages/lowcoder/src/comps/comps/richTextEditorComp.tsx‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import{StringControl}from"comps/controls/codeControl";
1+
import{StringControl,NumberControl}from"comps/controls/codeControl";
22
import{BoolControl}from"comps/controls/boolControl";
33
import{BoolCodeControl}from"../controls/codeControl";
44
import{stringExposingStateControl}from"comps/controls/codeStateControl";
@@ -180,6 +180,7 @@ const childrenMap = {
180180
toolbar:withDefault(StringControl,JSON.stringify(toolbarOptions)),
181181
onEvent:ChangeEventHandlerControl,
182182
style:styleControl(RichTextEditorStyle,'style'),
183+
tabIndex:NumberControl,
183184

184185
...formDataChildren,
185186
};
@@ -196,6 +197,7 @@ interface IProps {
196197
onChange:(value:string)=>void;
197198
$style:RichTextEditorStyleType;
198199
contentScrollBar:boolean;
200+
tabIndex?:number;
199201
}
200202

201203
constReactQuillEditor=React.lazy(()=>import("react-quill"));
@@ -226,6 +228,15 @@ function RichTextEditor(props: IProps) {
226228
[props.placeholder]
227229
);
228230

231+
useEffect(()=>{
232+
if(editorRef.current&&props.tabIndex!==undefined){
233+
consteditor=editorRef.current.getEditor();
234+
if(editor&&editor.scroll&&editor.scroll.domNode){
235+
(editor.scroll.domNodeasHTMLElement).tabIndex=props.tabIndex;
236+
}
237+
}
238+
},[props.tabIndex,key]);// Also re-run when key changes due to placeholder update
239+
229240
constcontains=(parent:HTMLElement,descendant:HTMLElement)=>{
230241
try{
231242
// Firefox inserts inaccessible nodes around video elements
@@ -316,6 +327,7 @@ const RichTextEditorCompBase = new UICompBuilder(childrenMap, (props) => {
316327
onChange={handleChange}
317328
$style={props.style}
318329
contentScrollBar={props.contentScrollBar}
330+
tabIndex={props.tabIndex}
319331
/>
320332
);
321333
})
@@ -334,6 +346,7 @@ const RichTextEditorCompBase = new UICompBuilder(childrenMap, (props) => {
334346
{children.onEvent.getPropertyView()}
335347
{hiddenPropertyView(children)}
336348
{readOnlyPropertyView(children)}
349+
{children.tabIndex.propertyView({label:trans("prop.tabIndex")})}
337350
{showDataLoadingIndicatorsPropertyView(children)}
338351
</Section>
339352
)}

‎client/packages/lowcoder/src/comps/comps/switchComp.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import{defaultasSwitch}from"antd/es/switch";
2-
import{BoolCodeControl}from"comps/controls/codeControl";
2+
import{BoolCodeControl,NumberControl}from"comps/controls/codeControl";
33
import{booleanExposingStateControl}from"comps/controls/codeStateControl";
44
import{changeEvent,eventHandlerControl}from"comps/controls/eventHandlerControl";
55
import{LabelControl}from"comps/controls/labelControl";
@@ -104,6 +104,7 @@ let SwitchTmpComp = (function () {
104104
),
105105
viewRef:RefControl<HTMLElement>,
106106
inputFieldStyle:migrateOldData(styleControl(SwitchStyle,'inputFieldStyle'),fixOldData),
107+
tabIndex:NumberControl,
107108
...formDataChildren,
108109
};
109110
returnnewUICompBuilder(childrenMap,(props)=>{
@@ -125,6 +126,7 @@ let SwitchTmpComp = (function () {
125126
checked={value}
126127
disabled={props.disabled}
127128
ref={props.viewRef}
129+
tabIndex={typeofprops.tabIndex==='number' ?props.tabIndex :undefined}
128130
onChange={(checked)=>{
129131
props.value.onChange(checked);
130132
props.onEvent("change");
@@ -149,6 +151,7 @@ let SwitchTmpComp = (function () {
149151
{children.onEvent.getPropertyView()}
150152
{disabledPropertyView(children)}
151153
{hiddenPropertyView(children)}
154+
{children.tabIndex.propertyView({label:trans("prop.tabIndex")})}
152155
{showDataLoadingIndicatorsPropertyView(children)}
153156
</Section>
154157
)}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp