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

Commit51de3a3

Browse files
committed
Initialize tags component
1 parent18d3e40 commit51de3a3

File tree

6 files changed

+141
-0
lines changed

6 files changed

+141
-0
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import{AnimationStyle,BoolCodeControl,ButtonEventHandlerControl,CommonNameConfig,DropdownOptionControl,IconControl,LinkStyle,NameConfig,NameConfigDisabled,RefControl,Section,SelectOptionControl,StringControl,TabsOptionControl,TagsOptionControl,UICompBuilder,blurMethod,clickMethod,focusWithOptions,migrateOldData,refMethods,sectionNames,stringExposingStateControl,styleControl,withDefault,withExposingConfigs}from"@lowcoder-ee/index.sdk";
2+
importReactfrom"react";
3+
import{trans}from"i18n";
4+
import{buttonRefMethods}from"../buttonComp/buttonCompConstants";
5+
import{Tag}from"antd";
6+
import{autoCompleteRefMethods}from"../autoCompleteComp/autoCompleteConstants";
7+
8+
9+
// const TagsCompView = (function () {
10+
// // const childrenMap = {
11+
// // text: withDefault(StringControl, trans("link.link")),
12+
// // onEvent: ButtonEventHandlerControl,
13+
// // disabled: BoolCodeControl,
14+
// // loading: BoolCodeControl,
15+
16+
// // // style: migrateOldData(styleControl(LinkStyle, 'style')),
17+
// // animationStyle: styleControl(AnimationStyle, 'animationStyle'),
18+
// // prefixIcon: IconControl,
19+
// // suffixIcon: IconControl,
20+
// // viewRef: RefControl<HTMLElement>,
21+
// //};
22+
23+
// const childrenMap = {
24+
// text: stringExposingStateControl("text", "world"),
25+
// // options: TabsOptionControl,
26+
// };
27+
// return new UICompBuilder(childrenMap, (props) => {
28+
// return (
29+
// <Tag>Tag 1</Tag>
30+
// )
31+
// })
32+
// .setPropertyViewFn((children) => {
33+
// return(
34+
// <Section name={sectionNames.basic}>
35+
// {/* {children.options.propertyView({})} */}
36+
// {children.text.propertyView({ label: trans("text") })}
37+
// </Section>
38+
// )
39+
// })
40+
// .build();
41+
// })();
42+
43+
constmultiTags=(function(){
44+
constchildrenMap={
45+
text:stringExposingStateControl("text","world"),
46+
options:TagsOptionControl,
47+
};
48+
49+
returnnewUICompBuilder(childrenMap,(props)=>{
50+
consttext=props.text.value;
51+
console.log(props.options)
52+
return(
53+
<>
54+
{props.options.map(tag=>(
55+
<Tag>{tag.label}</Tag>
56+
))}
57+
</>
58+
);
59+
})
60+
.setPropertyViewFn((children:any)=>{
61+
return(
62+
<Sectionname="Basic">
63+
{children.options.propertyView({})}
64+
{children.text.propertyView({label:"Text"})}
65+
</Section>
66+
)
67+
})
68+
.build();
69+
})()
70+
71+
72+
// const childrenMap = {
73+
// text: stringExposingStateControl("text", "world"),
74+
// options: TagsOptionControl,
75+
// };
76+
77+
// const TagsCompView = new UICompBuilder(childrenMap, (props: any) => {
78+
// const text = props.text.value;
79+
// return <div>Hello {text}</div>;
80+
// })
81+
// .setPropertyViewFn((children: any) => {
82+
// return (
83+
// <Section name="Basic">
84+
// {children.options.propertyView({})}
85+
// {children.text.propertyView({ label: "Text" })}
86+
// </Section>
87+
// )
88+
// })
89+
// .build();
90+
91+
exportconstMultiTagsComp=withExposingConfigs(multiTags,[newNameConfig("text","")]);
92+

‎client/packages/lowcoder/src/comps/controls/optionsControl.tsx‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ const TabsOption = new MultiCompBuilder(
557557
</>
558558
))
559559
.build();
560+
560561

561562
exportconstTabsOptionControl=manualOptionsControl(TabsOption,{
562563
initOptions:[
@@ -567,6 +568,37 @@ export const TabsOptionControl = manualOptionsControl(TabsOption, {
567568
autoIncField:"id",
568569
});
569570

571+
constTagsOption=newMultiCompBuilder(
572+
{
573+
id:valueComp<number>(-1),
574+
label:StringControl,
575+
icon:IconControl,
576+
iconPosition:withDefault(LeftRightControl,"left"),
577+
hidden:BoolCodeControl,
578+
},
579+
(props)=>props
580+
)
581+
.setPropertyViewFn((children)=>(
582+
<>
583+
{children.label.propertyView({label:trans("label")})}
584+
{children.icon.propertyView({label:trans("icon")})}
585+
{children.iconPosition.propertyView({
586+
label:trans("tabbedContainer.iconPosition"),
587+
radioButton:true,
588+
})}
589+
{hiddenPropertyView(children)}
590+
</>
591+
))
592+
.build();
593+
594+
exportconstTagsOptionControl=optionsControl(TagsOption,{
595+
initOptions:[
596+
{id:0,label:"Option 1"},
597+
{id:1,label:"Option 2"},
598+
],
599+
autoIncField:"id",
600+
});
601+
570602
constStyledIcon=styled.span`
571603
margin: 0 4px 0 14px;
572604
`;

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ import { DrawerComp } from "./hooks/drawerComp";
193193
import{ModalComp}from"./hooks/modalComp";
194194
import{defaultCollapsibleContainerData}from"./comps/containerComp/collapsibleContainerComp";
195195
import{ContainerCompasFloatTextContainerComp}from"./comps/containerComp/textContainerComp";
196+
import{MultiTagsComp}from"./comps/tagsComp/tagsCompView";
196197

197198
typeRegistry={
198199
[keyinUICompType]?:UICompManifest;
@@ -709,6 +710,19 @@ export var uiCompMap: Registry = {
709710
},
710711
defaultDataFn:defaultGridData,
711712
},
713+
multiTags:{
714+
name:trans("tags"),
715+
enName:"tags",
716+
description:"Desc of Tags",
717+
categories:["layout"],
718+
icon:FloatingButtonCompIcon,
719+
keywords:trans("uiComp.floatButtonCompKeywords"),
720+
comp:MultiTagsComp,
721+
layoutInfo:{
722+
w:9,
723+
h:5,
724+
},
725+
},
712726
modal:{
713727
name:trans("uiComp.modalCompName"),
714728
enName:"Modal",

‎client/packages/lowcoder/src/comps/uiCompRegistry.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export type UICompType =
106106
|"container"
107107
|"pageLayout"// added by Falk Wolsky
108108
|"floatTextContainer"
109+
|"multiTags"// Added by Kamal Qureshi
109110
|"tabbedContainer"
110111
|"modal"
111112
|"listView"

‎client/packages/lowcoder/src/i18n/locales/en.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export const en = {
4545
"accessControl":"Access Control",
4646
"copySuccess":"Copied Successfully",
4747
"copyError":"Copy Error",
48+
"tags":"Tags",
4849

4950
"api":{
5051
"publishSuccess":"Published Successfully",

‎client/packages/lowcoder/src/pages/editor/editorConstants.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ export const CompStateIcon: {
237237
step:<MemoizedIconIcon={StepCompIconSmall}/>,
238238
table:<MemoizedIconIcon={TableCompIconSmall}/>,
239239
text:<MemoizedIconIcon={TextCompIconSmall}/>,
240+
multiTags:<MemoizedIconIcon={TextCompIconSmall}/>,
240241
timeline:<MemoizedIconIcon={TimeLineCompIconSmall}/>,
241242
toggleButton:<MemoizedIconIcon={ToggleButtonCompIconSmall}/>,
242243
tour:<MemoizedIconIcon={TourCompIconSmall}/>,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp