Skip to content

Commit e4dc649

Browse files
Formatted types/w* packages with dprint (#66544)
* Formatted types/w* packages with dprint * Fix introduced issues
1 parent b84746a commit e4dc649

File tree

843 files changed

+35294
-27667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

843 files changed

+35294
-27667
lines changed

types/w2ui/index.d.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@ interface JQuery {
1616
w2popup(options: Object): W2UI.W2Popup;
1717
}
1818

19-
declare var w2popup: W2UI.W2Popup
20-
declare var w2ui: W2UI.W2UI
19+
declare var w2popup: W2UI.W2Popup;
20+
declare var w2ui: W2UI.W2UI;
2121

2222
declare namespace W2UI {
23-
2423
interface W2Event {
2524
onComplete: () => void;
2625
target: string;
2726
}
2827

29-
type W2EventHandler = ((e: W2Event) => void) | ((id: string, e: W2Event) => void)
28+
type W2EventHandler = ((e: W2Event) => void) | ((id: string, e: W2Event) => void);
3029

3130
/* Primitives (first alphabetically, then by documentation order) */
3231

@@ -42,7 +41,7 @@ declare namespace W2UI {
4241
type?: string | undefined;
4342
}
4443

45-
type W2Object = W2Layout | W2Grid | W2Toolbar | W2Sidebar | W2Tabs | W2Form | W2Popup
44+
type W2Object = W2Layout | W2Grid | W2Toolbar | W2Sidebar | W2Tabs | W2Form | W2Popup;
4645

4746
interface W2Panel {
4847
content?: string | JQuery | undefined;
@@ -108,9 +107,9 @@ declare namespace W2UI {
108107
}
109108

110109
namespace W2Grid {
111-
interface Columns { }
112-
interface Ranges { }
113-
interface Records { }
110+
interface Columns {}
111+
interface Ranges {}
112+
interface Records {}
114113
}
115114

116115
interface W2Grid extends W2Common, W2OnClickable {
@@ -190,7 +189,7 @@ declare namespace W2UI {
190189
hideSearch(...fields: string[]): number;
191190
initAllField(field: string, value?: string): void;
192191
initColumnOnOff(): void;
193-
//initOperator(el, searchInd): void; // this is used internally
192+
// initOperator(el, searchInd): void; // this is used internally
194193
initResize(): void;
195194
initSearches(): void;
196195
initToolbar(): void;
@@ -402,8 +401,7 @@ declare namespace W2UI {
402401
}
403402

404403
interface W2OnClickable {
405-
onClick(event: W2Event): void;
406-
onClick(id: string, data: W2Event): void;
404+
onClick(event: W2Event): void;
405+
onClick(id: string, data: W2Event): void;
407406
}
408-
409407
}

types/w2ui/w2ui-tests.ts

Lines changed: 129 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,172 +1,192 @@
1-
2-
31
$(function() {
4-
5-
$('#myLayout').w2layout({
6-
name: 'myLayout',
2+
$("#myLayout").w2layout({
3+
name: "myLayout",
74
panels: [
8-
{ type: 'top', size: 60 },
9-
{ type: 'left', size: 150, resizable: true },
10-
{ type: 'right', size: 150, resizable: true }
11-
]
5+
{ type: "top", size: 60 },
6+
{ type: "left", size: 150, resizable: true },
7+
{ type: "right", size: 150, resizable: true },
8+
],
129
});
1310

14-
$('#myGrid').w2grid({
15-
name: 'myGrid',
11+
$("#myGrid").w2grid({
12+
name: "myGrid",
1613
columns: [
17-
{ field: 'fname', caption: 'First Name', size: '30%' },
18-
{ field: 'lname', caption: 'Last Name', size: '30%' },
19-
{ field: 'email', caption: 'Email', size: '40%' },
20-
{ field: 'sdate', caption: 'Start Date', size: '120px' },
14+
{ field: "fname", caption: "First Name", size: "30%" },
15+
{ field: "lname", caption: "Last Name", size: "30%" },
16+
{ field: "email", caption: "Email", size: "40%" },
17+
{ field: "sdate", caption: "Start Date", size: "120px" },
2118
],
2219
records: [
23-
{ recid: 1, fname: 'John', lname: 'Doe', email: '[email protected]', sdate: '4/3/2012' },
24-
{ recid: 2, fname: 'Stuart', lname: 'Motzart', email: '[email protected]', sdate: '4/3/2012' },
25-
{ recid: 3, fname: 'Jin', lname: 'Franson', email: '[email protected]', sdate: '4/3/2012' },
26-
{ recid: 4, fname: 'Susan', lname: 'Ottie', email: '[email protected]', sdate: '4/3/2012' },
27-
{ recid: 5, fname: 'Kelly', lname: 'Silver', email: '[email protected]', sdate: '4/3/2012' },
28-
{ recid: 6, fname: 'Francis', lname: 'Gatos', email: '[email protected]', sdate: '4/3/2012' },
29-
{ recid: 7, fname: 'Mark', lname: 'Welldo', email: '[email protected]', sdate: '4/3/2012' },
30-
{ recid: 8, fname: 'Thomas', lname: 'Bahh', email: '[email protected]', sdate: '4/3/2012' },
31-
{ recid: 9, fname: 'Sergei', lname: 'Rachmaninov', email: '[email protected]', sdate: '4/3/2012' }
32-
]
20+
{ recid: 1, fname: "John", lname: "Doe", email: "[email protected]", sdate: "4/3/2012" },
21+
{ recid: 2, fname: "Stuart", lname: "Motzart", email: "[email protected]", sdate: "4/3/2012" },
22+
{ recid: 3, fname: "Jin", lname: "Franson", email: "[email protected]", sdate: "4/3/2012" },
23+
{ recid: 4, fname: "Susan", lname: "Ottie", email: "[email protected]", sdate: "4/3/2012" },
24+
{ recid: 5, fname: "Kelly", lname: "Silver", email: "[email protected]", sdate: "4/3/2012" },
25+
{ recid: 6, fname: "Francis", lname: "Gatos", email: "[email protected]", sdate: "4/3/2012" },
26+
{ recid: 7, fname: "Mark", lname: "Welldo", email: "[email protected]", sdate: "4/3/2012" },
27+
{ recid: 8, fname: "Thomas", lname: "Bahh", email: "[email protected]", sdate: "4/3/2012" },
28+
{ recid: 9, fname: "Sergei", lname: "Rachmaninov", email: "[email protected]", sdate: "4/3/2012" },
29+
],
3330
});
3431

35-
$('#myToolbar').w2toolbar({
36-
name: 'myToolbar',
32+
$("#myToolbar").w2toolbar({
33+
name: "myToolbar",
3734
items: [
38-
{ type: 'check', id: 'item1', caption: 'Check', img: 'icon-add', checked: true },
39-
{ type: 'break' },
35+
{ type: "check", id: "item1", caption: "Check", img: "icon-add", checked: true },
36+
{ type: "break" },
4037
{
41-
type: 'menu', id: 'item2', caption: 'Drop Down', img: 'icon-folder',
38+
type: "menu",
39+
id: "item2",
40+
caption: "Drop Down",
41+
img: "icon-folder",
4242
items: [
43-
{ text: 'Item 1', img: 'icon-page' },
44-
{ text: 'Item 2', img: 'icon-page' },
45-
{ text: 'Item 3', img: 'icon-page' }
46-
]
43+
{ text: "Item 1", img: "icon-page" },
44+
{ text: "Item 2", img: "icon-page" },
45+
{ text: "Item 3", img: "icon-page" },
46+
],
4747
},
48-
{ type: 'break' },
49-
{ type: 'radio', id: 'item3', group: '1', caption: 'Radio 1', img: 'icon-page' },
50-
{ type: 'radio', id: 'item4', group: '1', caption: 'Radio 2', img: 'icon-page' },
51-
{ type: 'spacer' },
52-
{ type: 'button', id: 'item5', caption: 'Item 5', img: 'icon-save' }
53-
]
48+
{ type: "break" },
49+
{ type: "radio", id: "item3", group: "1", caption: "Radio 1", img: "icon-page" },
50+
{ type: "radio", id: "item4", group: "1", caption: "Radio 2", img: "icon-page" },
51+
{ type: "spacer" },
52+
{ type: "button", id: "item5", caption: "Item 5", img: "icon-save" },
53+
],
5454
});
5555

56-
$('#mySidebar').w2sidebar({
57-
name: 'mySidebar',
56+
$("#mySidebar").w2sidebar({
57+
name: "mySidebar",
5858
img: null,
5959
nodes: [
6060
{
61-
id: 'level-1', text: 'Level 1', img: 'icon-folder', expanded: true,
61+
id: "level-1",
62+
text: "Level 1",
63+
img: "icon-folder",
64+
expanded: true,
6265
nodes: [
63-
{ id: 'level-1-1', text: 'Level 1.1', img: 'icon-page' },
64-
{ id: 'level-1-2', text: 'Level 1.2', img: 'icon-page' },
65-
{ id: 'level-1-3', text: 'Level 1.3', img: 'icon-page' }
66-
]
66+
{ id: "level-1-1", text: "Level 1.1", img: "icon-page" },
67+
{ id: "level-1-2", text: "Level 1.2", img: "icon-page" },
68+
{ id: "level-1-3", text: "Level 1.3", img: "icon-page" },
69+
],
6770
},
6871
{
69-
id: 'level-2', text: 'Level 2', img: 'icon-folder',
72+
id: "level-2",
73+
text: "Level 2",
74+
img: "icon-folder",
7075
nodes: [
7176
{
72-
id: 'level-2-1', text: 'Level 2.1', img: 'icon-folder',
77+
id: "level-2-1",
78+
text: "Level 2.1",
79+
img: "icon-folder",
7380
nodes: [
74-
{ id: 'level-2-1-1', text: 'Level 2.1.1', img: 'icon-page' },
75-
{ id: 'level-2-1-2', text: 'Level 2.1.2', img: 'icon-page' },
76-
{ id: 'level-2-1-3', text: 'Level 2.1.3', img: 'icon-page' }
77-
]
81+
{ id: "level-2-1-1", text: "Level 2.1.1", img: "icon-page" },
82+
{ id: "level-2-1-2", text: "Level 2.1.2", img: "icon-page" },
83+
{ id: "level-2-1-3", text: "Level 2.1.3", img: "icon-page" },
84+
],
7885
},
79-
{ id: 'level-2-2', text: 'Level 2.2', img: 'icon-page' },
80-
{ id: 'level-2-3', text: 'Level 2.3', img: 'icon-page' }
81-
]
86+
{ id: "level-2-2", text: "Level 2.2", img: "icon-page" },
87+
{ id: "level-2-3", text: "Level 2.3", img: "icon-page" },
88+
],
8289
},
8390
{
84-
id: 'level-3', text: 'Level 3', img: 'icon-folder',
91+
id: "level-3",
92+
text: "Level 3",
93+
img: "icon-folder",
8594
nodes: [
86-
{ id: 'level-3-1', text: 'Level 3.1', img: 'icon-page' },
87-
{ id: 'level-3-2', text: 'Level 3.2', img: 'icon-page' },
88-
{ id: 'level-3-3', text: 'Level 3.3', img: 'icon-page' }
89-
]
90-
}
95+
{ id: "level-3-1", text: "Level 3.1", img: "icon-page" },
96+
{ id: "level-3-2", text: "Level 3.2", img: "icon-page" },
97+
{ id: "level-3-3", text: "Level 3.3", img: "icon-page" },
98+
],
99+
},
91100
],
92101
onClick: function(event: W2UI.W2Event) {
93102
console.log(event.target);
94-
}
103+
},
95104
});
96105

97-
$('#sidebar').w2sidebar({
98-
name: 'sidebar',
106+
$("#sidebar").w2sidebar({
107+
name: "sidebar",
99108
img: null,
100109
nodes: [
101110
{
102-
id: 'level-1', text: 'Level 1', img: 'icon-folder', expanded: true,
103-
nodes: [{ id: 'level-1-1', text: 'Level 1.1', img: 'icon-page' },
104-
{ id: 'level-1-2', text: 'Level 1.2', img: 'icon-page' },
105-
{ id: 'level-1-3', text: 'Level 1.3', img: 'icon-page' }
106-
]
111+
id: "level-1",
112+
text: "Level 1",
113+
img: "icon-folder",
114+
expanded: true,
115+
nodes: [{ id: "level-1-1", text: "Level 1.1", img: "icon-page" }, {
116+
id: "level-1-2",
117+
text: "Level 1.2",
118+
img: "icon-page",
119+
}, { id: "level-1-3", text: "Level 1.3", img: "icon-page" }],
107120
},
108121
{
109-
id: 'level-2', text: 'Level 2', img: 'icon-folder',
110-
nodes: [{
111-
id: 'level-2-1', text: 'Level 2.1', img: 'icon-folder',
112-
nodes: [
113-
{ id: 'level-2-1-1', text: 'Level 2.1.1', img: 'icon-page' },
114-
{ id: 'level-2-1-2', text: 'Level 2.1.2', img: 'icon-page' },
115-
{ id: 'level-2-1-3', text: 'Level 2.1.3', img: 'icon-page' }
116-
]
117-
},
118-
{ id: 'level-2-2', text: 'Level 2.2', img: 'icon-page' },
119-
{ id: 'level-2-3', text: 'Level 2.3', img: 'icon-page' }
120-
]
122+
id: "level-2",
123+
text: "Level 2",
124+
img: "icon-folder",
125+
nodes: [
126+
{
127+
id: "level-2-1",
128+
text: "Level 2.1",
129+
img: "icon-folder",
130+
nodes: [
131+
{ id: "level-2-1-1", text: "Level 2.1.1", img: "icon-page" },
132+
{ id: "level-2-1-2", text: "Level 2.1.2", img: "icon-page" },
133+
{ id: "level-2-1-3", text: "Level 2.1.3", img: "icon-page" },
134+
],
135+
},
136+
{ id: "level-2-2", text: "Level 2.2", img: "icon-page" },
137+
{ id: "level-2-3", text: "Level 2.3", img: "icon-page" },
138+
],
121139
},
122140
{
123-
id: 'level-3', text: 'Level 3', img: 'icon-folder',
124-
nodes: [{ id: 'level-3-1', text: 'Level 3.1', img: 'icon-page' },
125-
{ id: 'level-3-2', text: 'Level 3.2', img: 'icon-page' },
126-
{ id: 'level-3-3', text: 'Level 3.3', img: 'icon-page' }
127-
]
128-
}
141+
id: "level-3",
142+
text: "Level 3",
143+
img: "icon-folder",
144+
nodes: [{ id: "level-3-1", text: "Level 3.1", img: "icon-page" }, {
145+
id: "level-3-2",
146+
text: "Level 3.2",
147+
img: "icon-page",
148+
}, { id: "level-3-3", text: "Level 3.3", img: "icon-page" }],
149+
},
129150
],
130151
onClick: function(id: string, data: W2UI.W2Event) {
131152
console.log(id);
132-
}
153+
},
133154
});
134155

135-
$('#myTabs').w2tabs({
136-
name: 'myTabs',
137-
active: 'tab1',
156+
$("#myTabs").w2tabs({
157+
name: "myTabs",
158+
active: "tab1",
138159
tabs: [
139-
{ id: 'tab1', caption: 'Tab 1' },
140-
{ id: 'tab2', caption: 'Tab 2' },
141-
{ id: 'tab3', caption: 'Tab 3' },
142-
{ id: 'tab4', caption: 'Tab 4' }
160+
{ id: "tab1", caption: "Tab 1" },
161+
{ id: "tab2", caption: "Tab 2" },
162+
{ id: "tab3", caption: "Tab 3" },
163+
{ id: "tab4", caption: "Tab 4" },
143164
],
144165
onClick: function(event: W2UI.W2Event) {
145-
$('#myTabsContent').html(event.target);
146-
}
166+
$("#myTabsContent").html(event.target);
167+
},
147168
});
148169

149-
$('#myForm').w2form({
150-
name: 'myForm',
170+
$("#myForm").w2form({
171+
name: "myForm",
151172
fields: [
152-
{ name: 'first_name', type: 'text', required: true },
153-
{ name: 'last_name', type: 'text', required: true },
154-
{ name: 'comments', type: 'text' }
173+
{ name: "first_name", type: "text", required: true },
174+
{ name: "last_name", type: "text", required: true },
175+
{ name: "comments", type: "text" },
155176
],
156177
actions: {
157178
reset: function() {
158179
this.clear();
159180
},
160181
save: function() {
161182
this.save();
162-
}
163-
}
183+
},
184+
},
164185
});
165186

166187
w2popup.open({
167-
title: 'Popup Title HTML',
168-
body: 'Body HTML',
169-
buttons: 'Buttons HTML'
188+
title: "Popup Title HTML",
189+
body: "Body HTML",
190+
buttons: "Buttons HTML",
170191
});
171-
172192
});

0 commit comments

Comments
 (0)