Skip to content

Commit c28d6c8

Browse files
author
marker dao ®
committed
feat(button_group): Add new options
1 parent c366ebb commit c28d6c8

11 files changed

Lines changed: 112 additions & 5 deletions

File tree

packages/devextreme-angular/src/ui/button-group/index.ts

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,16 @@ export class DxButtonGroupComponent extends DxComponent implements OnDestroy, On
151151
}
152152

153153

154+
155+
@Input()
156+
get gap(): string {
157+
return this._getOption('gap');
158+
}
159+
set gap(value: string) {
160+
this._setOption('gap', value);
161+
}
162+
163+
154164
/**
155165
* [descr:DOMComponentOptions.height]
156166
@@ -319,6 +329,16 @@ export class DxButtonGroupComponent extends DxComponent implements OnDestroy, On
319329
this._setOption('width', value);
320330
}
321331

332+
333+
334+
@Input()
335+
get wrap(): boolean {
336+
return this._getOption('wrap');
337+
}
338+
set wrap(value: boolean) {
339+
this._setOption('wrap', value);
340+
}
341+
322342
/**
323343
324344
* [descr:dxButtonGroupOptions.onContentReady]
@@ -409,6 +429,13 @@ export class DxButtonGroupComponent extends DxComponent implements OnDestroy, On
409429
*/
410430
@Output() focusStateEnabledChange: EventEmitter<boolean>;
411431

432+
/**
433+
434+
* This member supports the internal infrastructure and is not intended to be used directly from your code.
435+
436+
*/
437+
@Output() gapChange: EventEmitter<string>;
438+
412439
/**
413440
414441
* This member supports the internal infrastructure and is not intended to be used directly from your code.
@@ -500,6 +527,13 @@ export class DxButtonGroupComponent extends DxComponent implements OnDestroy, On
500527
*/
501528
@Output() widthChange: EventEmitter<number | string | undefined>;
502529

530+
/**
531+
532+
* This member supports the internal infrastructure and is not intended to be used directly from your code.
533+
534+
*/
535+
@Output() wrapChange: EventEmitter<boolean>;
536+
503537

504538

505539

@@ -525,6 +559,7 @@ export class DxButtonGroupComponent extends DxComponent implements OnDestroy, On
525559
{ emit: 'disabledChange' },
526560
{ emit: 'elementAttrChange' },
527561
{ emit: 'focusStateEnabledChange' },
562+
{ emit: 'gapChange' },
528563
{ emit: 'heightChange' },
529564
{ emit: 'hintChange' },
530565
{ emit: 'hoverStateEnabledChange' },
@@ -537,7 +572,8 @@ export class DxButtonGroupComponent extends DxComponent implements OnDestroy, On
537572
{ emit: 'stylingModeChange' },
538573
{ emit: 'tabIndexChange' },
539574
{ emit: 'visibleChange' },
540-
{ emit: 'widthChange' }
575+
{ emit: 'widthChange' },
576+
{ emit: 'wrapChange' }
541577
]);
542578

543579
this._idh.setHost(this);

packages/devextreme-angular/src/ui/chat/nested/suggestions.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ export class DxoChatSuggestionsComponent extends NestedOption implements OnDestr
9494
this._setOption('focusStateEnabled', value);
9595
}
9696

97+
@Input()
98+
get gap(): string {
99+
return this._getOption('gap');
100+
}
101+
set gap(value: string) {
102+
this._setOption('gap', value);
103+
}
104+
97105
@Input()
98106
get height(): number | string | undefined {
99107
return this._getOption('height');
@@ -246,6 +254,14 @@ export class DxoChatSuggestionsComponent extends NestedOption implements OnDestr
246254
this._setOption('width', value);
247255
}
248256

257+
@Input()
258+
get wrap(): boolean {
259+
return this._getOption('wrap');
260+
}
261+
set wrap(value: boolean) {
262+
this._setOption('wrap', value);
263+
}
264+
249265

250266
/**
251267

packages/devextreme-angular/src/ui/scheduler/nested/options.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ export class DxoSchedulerOptionsComponent extends NestedOption implements OnDest
9595
this._setOption('focusStateEnabled', value);
9696
}
9797

98+
@Input()
99+
get gap(): string {
100+
return this._getOption('gap');
101+
}
102+
set gap(value: string) {
103+
this._setOption('gap', value);
104+
}
105+
98106
@Input()
99107
get height(): number | string | undefined {
100108
return this._getOption('height');
@@ -247,6 +255,14 @@ export class DxoSchedulerOptionsComponent extends NestedOption implements OnDest
247255
this._setOption('width', value);
248256
}
249257

258+
@Input()
259+
get wrap(): boolean {
260+
return this._getOption('wrap');
261+
}
262+
set wrap(value: boolean) {
263+
this._setOption('wrap', value);
264+
}
265+
250266

251267
/**
252268

packages/devextreme-metadata/make-angular-metadata.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Ng.makeMetadata({
5353
removeMembers(
5454
/\/chat:dxChatOptions\.(fileUploaderOptions|inputFieldText|sendButtonOptions|speechToTextOptions|suggestions|onAttachmentDownloadClick)/,
5555
),
56+
removeMembers(/\/button_group:dxButtonGroupOptions\.(gap|wrap)/),
5657
removeMembers(/\/form:dxFormOptions\.(aiIntegration|onSmartPasting|onSmartPasted|smartPaste)/),
5758
removeMembers(/\/form:dxFormSimpleItem\.aiOptions/),
5859
removeMembers(/\/form:FormPredefinedButtonItem/),

packages/devextreme-react/src/chat.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ type ISuggestionsProps = React.PropsWithChildren<{
524524
disabled?: boolean;
525525
elementAttr?: Record<string, any>;
526526
focusStateEnabled?: boolean;
527+
gap?: string;
527528
height?: number | string | undefined;
528529
hint?: string | undefined;
529530
hoverStateEnabled?: boolean;
@@ -543,6 +544,7 @@ type ISuggestionsProps = React.PropsWithChildren<{
543544
tabIndex?: number;
544545
visible?: boolean;
545546
width?: number | string | undefined;
547+
wrap?: boolean;
546548
defaultSelectedItemKeys?: Array<any>;
547549
onSelectedItemKeysChange?: (value: Array<any>) => void;
548550
defaultSelectedItems?: Array<any>;

packages/devextreme-react/src/scheduler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ type IOptionsProps = React.PropsWithChildren<{
805805
disabled?: boolean;
806806
elementAttr?: Record<string, any>;
807807
focusStateEnabled?: boolean;
808+
gap?: string;
808809
height?: number | string | undefined;
809810
hint?: string | undefined;
810811
hoverStateEnabled?: boolean;
@@ -824,6 +825,7 @@ type IOptionsProps = React.PropsWithChildren<{
824825
tabIndex?: number;
825826
visible?: boolean;
826827
width?: number | string | undefined;
828+
wrap?: boolean;
827829
defaultSelectedItemKeys?: Array<any>;
828830
onSelectedItemKeysChange?: (value: Array<any>) => void;
829831
defaultSelectedItems?: Array<any>;

packages/devextreme-vue/src/button-group.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type AccessibleOptions = Pick<Properties,
2525
"disabled" |
2626
"elementAttr" |
2727
"focusStateEnabled" |
28+
"gap" |
2829
"height" |
2930
"hint" |
3031
"hoverStateEnabled" |
@@ -43,7 +44,8 @@ type AccessibleOptions = Pick<Properties,
4344
"stylingMode" |
4445
"tabIndex" |
4546
"visible" |
46-
"width"
47+
"width" |
48+
"wrap"
4749
>;
4850

4951
interface DxButtonGroup extends AccessibleOptions {
@@ -58,6 +60,7 @@ const componentConfig = {
5860
disabled: Boolean,
5961
elementAttr: Object as PropType<Record<string, any>>,
6062
focusStateEnabled: Boolean,
63+
gap: String,
6164
height: [Number, String],
6265
hint: String,
6366
hoverStateEnabled: Boolean,
@@ -76,7 +79,8 @@ const componentConfig = {
7679
stylingMode: String as PropType<ButtonStyle>,
7780
tabIndex: Number,
7881
visible: Boolean,
79-
width: [Number, String]
82+
width: [Number, String],
83+
wrap: Boolean
8084
},
8185
emits: {
8286
"update:isActive": null,
@@ -87,6 +91,7 @@ const componentConfig = {
8791
"update:disabled": null,
8892
"update:elementAttr": null,
8993
"update:focusStateEnabled": null,
94+
"update:gap": null,
9095
"update:height": null,
9196
"update:hint": null,
9297
"update:hoverStateEnabled": null,
@@ -106,6 +111,7 @@ const componentConfig = {
106111
"update:tabIndex": null,
107112
"update:visible": null,
108113
"update:width": null,
114+
"update:wrap": null,
109115
},
110116
computed: {
111117
instance(): ButtonGroup {

packages/devextreme-vue/src/chat.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ const DxSuggestionsConfig = {
794794
"update:disabled": null,
795795
"update:elementAttr": null,
796796
"update:focusStateEnabled": null,
797+
"update:gap": null,
797798
"update:height": null,
798799
"update:hint": null,
799800
"update:hoverStateEnabled": null,
@@ -813,6 +814,7 @@ const DxSuggestionsConfig = {
813814
"update:tabIndex": null,
814815
"update:visible": null,
815816
"update:width": null,
817+
"update:wrap": null,
816818
},
817819
props: {
818820
accessKey: String,
@@ -821,6 +823,7 @@ const DxSuggestionsConfig = {
821823
disabled: Boolean,
822824
elementAttr: Object as PropType<Record<string, any>>,
823825
focusStateEnabled: Boolean,
826+
gap: String,
824827
height: [Number, String],
825828
hint: String,
826829
hoverStateEnabled: Boolean,
@@ -839,7 +842,8 @@ const DxSuggestionsConfig = {
839842
stylingMode: String as PropType<ButtonStyle>,
840843
tabIndex: Number,
841844
visible: Boolean,
842-
width: [Number, String]
845+
width: [Number, String],
846+
wrap: Boolean
843847
}
844848
};
845849

packages/devextreme-vue/src/scheduler.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,7 @@ const DxOptionsConfig = {
11041104
"update:disabled": null,
11051105
"update:elementAttr": null,
11061106
"update:focusStateEnabled": null,
1107+
"update:gap": null,
11071108
"update:height": null,
11081109
"update:hint": null,
11091110
"update:hoverStateEnabled": null,
@@ -1123,6 +1124,7 @@ const DxOptionsConfig = {
11231124
"update:tabIndex": null,
11241125
"update:visible": null,
11251126
"update:width": null,
1127+
"update:wrap": null,
11261128
},
11271129
props: {
11281130
accessKey: String,
@@ -1131,6 +1133,7 @@ const DxOptionsConfig = {
11311133
disabled: Boolean,
11321134
elementAttr: Object as PropType<Record<string, any>>,
11331135
focusStateEnabled: Boolean,
1136+
gap: String,
11341137
height: [Number, String],
11351138
hint: String,
11361139
hoverStateEnabled: Boolean,
@@ -1149,7 +1152,8 @@ const DxOptionsConfig = {
11491152
stylingMode: String as PropType<ButtonStyle>,
11501153
tabIndex: Number,
11511154
visible: Boolean,
1152-
width: [Number, String]
1155+
width: [Number, String],
1156+
wrap: Boolean
11531157
}
11541158
};
11551159

packages/devextreme/js/ui/button_group.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ export interface dxButtonGroupOptions extends WidgetOptions<dxButtonGroup> {
101101
* @public
102102
*/
103103
focusStateEnabled?: boolean;
104+
/**
105+
* @docid
106+
* @default '12px'
107+
* @public
108+
*/
109+
gap?: string;
104110
/**
105111
* @docid
106112
* @default true
@@ -159,6 +165,12 @@ export interface dxButtonGroupOptions extends WidgetOptions<dxButtonGroup> {
159165
* @public
160166
*/
161167
stylingMode?: ButtonStyle;
168+
/**
169+
* @docid
170+
* @default false
171+
* @public
172+
*/
173+
wrap?: boolean;
162174
}
163175
/**
164176
* @docid

0 commit comments

Comments
 (0)