Skip to content

Commit 25a4dc4

Browse files
committed
feat(ui): better typescript support
1 parent 4d122e0 commit 25a4dc4

File tree

2 files changed

+152
-0
lines changed

2 files changed

+152
-0
lines changed

ui/src/components/QIconPicker.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
},
4040
"icons": {
4141
"type": "Array",
42+
"tsType": "IconNameArray",
4243
"desc": "An array of objects containing icon information. The object must contain the key `name` with the value being the icon name (ie: `{ name: 'bolt' }`). _**Note:** the icons used must already be loaded by Quasar._",
4344
"category": "model",
4445
"examples": [
@@ -62,6 +63,7 @@
6263
},
6364
"tags": {
6465
"type": "Array",
66+
"tsType": "StringArray",
6567
"addedIn": "v1.0.7",
6668
"desc": "An array of tags to be used to do filtering by category",
6769
"category": "behavior",
@@ -132,6 +134,7 @@
132134
},
133135
"pagination": {
134136
"type": "Object",
137+
"tsType": "Pagination",
135138
"sync": true,
136139
"desc": "For pagination purposes uses Quasar's pagination component. Use `pagination.sync` to synchronize the data. You can use `page` and `itemsPerPage` to control the pagination. QIconPicker will set `totalPages` depending on `icon-set` or `icons` properties. If using a `filter` the page will automatically be reset to 1",
137140
"category": "behavior",

ui/types/types.d.ts

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,151 @@
11
export type NumberArray = number[]
22
export type StringArray = string[]
3+
4+
export type IconName = {
5+
name : string
6+
}
7+
8+
export type IconNameArray = IconName[]
9+
10+
export type Pagination = {
11+
/**
12+
* Page number (1-based)
13+
*/
14+
page? : number
15+
/**
16+
* How many rows per page? 0 means Infinite
17+
*/
18+
rowsPerPage? : number
19+
}
20+
21+
export type PaginationProps = {
22+
/**
23+
* Minimum page (must be lower than 'max')
24+
*/
25+
min? : number
26+
/**
27+
* Number of last page (must be higher than 'min')
28+
*/
29+
max? : number
30+
/**
31+
* Maximum number of page links to display at a time; 0 means Infinite
32+
*/
33+
maxPages? : number
34+
/**
35+
* Put component in disabled mode
36+
*/
37+
disable? : boolean
38+
/**
39+
* Use an input instead of buttons
40+
*/
41+
input? : boolean
42+
/**
43+
* Icon name following Quasar convention; Make sure you have the icon library installed unless you are using 'img:' prefix
44+
*/
45+
iconPrev? : string
46+
/**
47+
* Icon name following Quasar convention; Make sure you have the icon library installed unless you are using 'img:' prefix
48+
*/
49+
iconNext? : string
50+
/**
51+
* Icon name following Quasar convention; Make sure you have the icon library installed unless you are using 'img:' prefix
52+
*/
53+
iconFirst? : string
54+
/**
55+
* Icon name following Quasar convention; Make sure you have the icon library installed unless you are using 'img:' prefix
56+
*/
57+
iconLast? : string
58+
/**
59+
* Generate link for page buttons; For best performance, reference it from your scope and do not define it inline
60+
*/
61+
toFn? : function
62+
/**
63+
* Show boundary button links
64+
*/
65+
boundaryLinks? : boolean
66+
/**
67+
* Always show first and last page buttons (if not using 'input')
68+
*/
69+
boundaryNumbers? : boolean
70+
/**
71+
* Show direction buttons
72+
*/
73+
directionLinks? : boolean
74+
/**
75+
* Show ellipses (...) when pages are available
76+
*/
77+
ellipsis? : boolean
78+
/**
79+
* Color name for component from the Quasar Color Palette
80+
*/
81+
color? : string
82+
/**
83+
* Overrides text color (if needed); Color name from the Quasar Color Palette
84+
*/
85+
textColor? : string
86+
/**
87+
* Color name for component from the Quasar Color Palette
88+
*/
89+
activeColor? : string
90+
/**
91+
* Overrides text color (if needed); Color name from the Quasar Color Palette
92+
*/
93+
activeTextColor? : string
94+
/**
95+
* Notify the component that the background is a dark color (useful when you are using it along with the 'input' prop)
96+
*/
97+
dark? : boolean
98+
/**
99+
* Style definitions to be attributed to the input (if using one)
100+
*/
101+
inputStyle? : array | string | object
102+
/**
103+
* Class definitions to be attributed to the input (if using one)
104+
*/
105+
inputClass? : array | string | object
106+
/**
107+
* Button size in CSS units, including unit name
108+
*/
109+
size? : string
110+
/**
111+
* Configure buttons material ripple (disable it by setting it to 'false' or supply a config object); Does not applies to boundary and ellipsis buttons
112+
*/
113+
ripple? : boolean | object
114+
/**
115+
* Makes a circle shaped button for all buttons
116+
*/
117+
round? : boolean
118+
/**
119+
* Applies a more prominent border-radius for a squared shape button for all buttons
120+
*/
121+
rounded? : boolean
122+
/**
123+
* Use 'flat' design for current page button
124+
*/
125+
flat? : boolean
126+
/**
127+
* Use 'outline' design for current page button
128+
*/
129+
outline? : boolean
130+
/**
131+
* Remove shadow for current page button
132+
*/
133+
unelevated? : boolean
134+
/**
135+
* Use 'push' design for current page button
136+
*/
137+
push? : boolean
138+
/**
139+
* Applies a glossy effect for all buttons
140+
*/
141+
glossy? : boolean
142+
/**
143+
* Dense mode; occupies less space
144+
*/
145+
dense? : boolean
146+
/**
147+
* Apply custom padding (vertical [horizontal]); Size in CSS units, including unit name or standard size name (none|xs|sm|md|lg|xl); Also removes the min width and height when set
148+
*/
149+
padding? : string
150+
151+
}

0 commit comments

Comments
 (0)