]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * Creates a visual theme for spinner field triggers. Note this mixin only provides\r | |
3 | * styling for the spinner trigger buttons. The text field portion of the styling must be\r | |
4 | * created using {@link Ext.form.field.Text#css_mixin-extjs-text-field-ui}\r | |
5 | *\r | |
6 | * @param {string} $ui\r | |
7 | * The name of the UI being created. Can not included spaces or special punctuation\r | |
8 | * (used in CSS class names).\r | |
9 | *\r | |
10 | * @param {boolean} [$ui-trigger-vertical=$spinner-trigger-vertical]\r | |
11 | * `true` to align the up/down triggers vertically.\r | |
12 | *\r | |
13 | * @param {number} [$ui-trigger-width=$form-trigger-width]\r | |
14 | * The width of the triggers.\r | |
15 | *\r | |
16 | * @param {number} [$ui-field-height=$form-text-field-height]\r | |
17 | * The height of the text field that the trigger must fit within. This does not set the\r | |
18 | * height of the field, only the height of the triggers. When {@link #css_mixin-extjs-spinner-trigger-ui $ui-trigger-vertical}\r | |
19 | * is true, the available height within the field borders is divided evenly between the\r | |
20 | * two triggers.\r | |
21 | *\r | |
22 | * @param {number/list} [$ui-field-border-width=$form-text-field-border-width]\r | |
23 | * The border width of the text field that the trigger must fit within. This does not set\r | |
24 | * the border of the field, it is only needed so that the border-width of the field can\r | |
25 | * be subtracted from the trigger height.\r | |
26 | *\r | |
27 | * @param {string} [$ui-trigger-vertical-background-image=$spinner-trigger-vertical-background-image]\r | |
28 | * The background image sprite for vertically aligned spinner triggers\r | |
29 | *\r | |
30 | * @param {string} [$ui-trigger-up-background-image='form/spinner-up']\r | |
31 | * The background image for the "up" trigger when triggers are horizontally aligned\r | |
32 | *\r | |
33 | * @param {string} [$ui-trigger-down-background-image='form/spinner-down']\r | |
34 | * The background image for the "down" trigger when triggers are horizontally aligned\r | |
35 | *\r | |
36 | * @param {string/list} [$ui-trigger-up-glyph=$spinner-trigger-up-glyph]\r | |
37 | * The glyph for the "up" spinner trigger trigger when {@link Global_CSS#$enable-font-icons} is `true`.\r | |
38 | *\r | |
39 | * @param {string/list} [$ui-trigger-down-glyph=$spinner-trigger-down-glyph]\r | |
40 | * The glyph for the "down" spinner trigger trigger when {@link Global_CSS#$enable-font-icons} is `true`.\r | |
41 | *\r | |
42 | * @param {color} [$ui-trigger-glyph-color=$spinner-trigger-glyph-color]\r | |
43 | * The color of spinner triggers when {@link Global_CSS#$enable-font-icons} is `true`.\r | |
44 | *\r | |
45 | * @param {color} [$ui-trigger-background-color=$form-text-field-background-color]\r | |
46 | * The background color of the spinner triggers\r | |
47 | *\r | |
48 | * @param {boolean} [$ui-classic-border=$form-text-field-classic-border]\r | |
49 | * `true` to use classic-theme styled border.\r | |
50 | *\r | |
51 | * @member Ext.form.trigger.Spinner\r | |
52 | */\r | |
53 | @mixin extjs-spinner-trigger-ui(\r | |
54 | $ui: null,\r | |
55 | $ui-trigger-vertical: $spinner-trigger-vertical,\r | |
56 | $ui-trigger-width: $form-trigger-width,\r | |
57 | $ui-field-height: $form-text-field-height,\r | |
58 | $ui-field-border-width: $form-text-field-border-width,\r | |
59 | $ui-trigger-vertical-background-image: $spinner-trigger-vertical-background-image,\r | |
60 | $ui-trigger-up-background-image: $spinner-trigger-up-background-image,\r | |
61 | $ui-trigger-down-background-image: $spinner-trigger-down-background-image,\r | |
62 | $ui-trigger-up-glyph: $spinner-trigger-up-glyph,\r | |
63 | $ui-trigger-down-glyph: $spinner-trigger-down-glyph,\r | |
64 | $ui-trigger-glyph-color: $spinner-trigger-glyph-color,\r | |
65 | $ui-trigger-background-color: $form-text-field-background-color,\r | |
66 | $ui-classic-border: $form-text-field-classic-border\r | |
67 | ){\r | |
68 | $ui-inner-height: if($ui-classic-border, $ui-field-height, $ui-field-height - vertical($ui-field-border-width));\r | |
69 | $ui-trigger-height: if($ui-trigger-vertical, $ui-inner-height / 2, $ui-inner-height);\r | |
70 | \r | |
71 | .#{$prefix}form-trigger-spinner-#{$ui} {\r | |
72 | width: if($ui-trigger-vertical, $ui-trigger-width, $ui-trigger-width * 2);\r | |
73 | @if $ui-classic-border {\r | |
74 | border: 0;\r | |
75 | }\r | |
76 | \r | |
77 | @if $enable-font-icons and ($ui-trigger-up-glyph != null or $ui-trigger-down-glyph != null) {\r | |
78 | // remove pseduo element from default trigger\r | |
79 | &:before {\r | |
80 | content: '';\r | |
81 | }\r | |
82 | }\r | |
83 | }\r | |
84 | \r | |
85 | .#{$prefix}form-spinner-#{$ui} {\r | |
86 | @if $ui-trigger-vertical {\r | |
87 | @if (not $enable-font-icons) or ($ui-trigger-up-glyph == null and $ui-trigger-down-glyph == null) {\r | |
88 | background-image: theme-background-image($ui-trigger-vertical-background-image);\r | |
89 | @if $include-rtl {\r | |
90 | &.#{$prefix}rtl {\r | |
91 | background-image: theme-background-image($ui-trigger-vertical-background-image + '-rtl');\r | |
92 | }\r | |
93 | }\r | |
94 | }\r | |
95 | } @else {\r | |
96 | display: inline-block;\r | |
97 | }\r | |
98 | background-color: $ui-trigger-background-color;\r | |
99 | width: $ui-trigger-width;\r | |
100 | height: $ui-trigger-height;\r | |
101 | @if $enable-font-icons {\r | |
102 | color: $ui-trigger-glyph-color;\r | |
103 | }\r | |
104 | }\r | |
105 | \r | |
106 | @if not $spinner-trigger-vertical {\r | |
107 | @if (not $enable-font-icons) or ($ui-trigger-up-glyph == null) {\r | |
108 | .#{$prefix}form-spinner-up-#{$ui} {\r | |
109 | background-image: theme-background-image($ui-trigger-up-background-image);\r | |
110 | @if $include-rtl {\r | |
111 | &.#{$prefix}rtl {\r | |
112 | background-image: theme-background-image($ui-trigger-up-background-image + '-rtl');\r | |
113 | }\r | |
114 | }\r | |
115 | }\r | |
116 | }\r | |
117 | \r | |
118 | @if (not $enable-font-icons) or ($ui-trigger-down-glyph == null) {\r | |
119 | .#{$prefix}form-spinner-down-#{$ui} {\r | |
120 | background-image: theme-background-image($ui-trigger-down-background-image);\r | |
121 | @if $include-rtl {\r | |
122 | &.#{$prefix}rtl {\r | |
123 | background-image: theme-background-image($ui-trigger-down-background-image + '-rtl');\r | |
124 | }\r | |
125 | }\r | |
126 | }\r | |
127 | }\r | |
128 | }\r | |
129 | \r | |
130 | @if $enable-font-icons and ($ui-trigger-up-glyph != null) {\r | |
131 | .#{$prefix}form-spinner-up-#{$ui} {\r | |
132 | @include font-icon($ui-trigger-up-glyph);\r | |
133 | }\r | |
134 | }\r | |
135 | \r | |
136 | @if $enable-font-icons and ($ui-trigger-down-glyph != null) {\r | |
137 | .#{$prefix}form-spinner-down-#{$ui} {\r | |
138 | @include font-icon($ui-trigger-down-glyph);\r | |
139 | }\r | |
140 | }\r | |
141 | \r | |
142 | @if $ui-trigger-vertical {\r | |
143 | .#{$prefix}form-spinner-up-#{$ui} {\r | |
144 | background-position: 0 0;\r | |
145 | \r | |
146 | &.#{$prefix}form-spinner-over {\r | |
147 | background-position: (-$ui-trigger-width) 0;\r | |
148 | &.#{$prefix}form-spinner-focus {\r | |
149 | background-position: -($ui-trigger-width * 4) 0;\r | |
150 | }\r | |
151 | }\r | |
152 | \r | |
153 | &.#{$prefix}form-spinner-focus {\r | |
154 | background-position: -($ui-trigger-width * 3) 0;\r | |
155 | }\r | |
156 | \r | |
157 | // add x-form-spinner class to increase specificity of "click" above focus/over\r | |
158 | &.#{$prefix}form-spinner.#{$prefix}form-spinner-click {\r | |
159 | background-position: -($ui-trigger-width * 2) 0;\r | |
160 | }\r | |
161 | }\r | |
162 | \r | |
163 | .#{$prefix}form-spinner-down-#{$ui} {\r | |
164 | background-position: 0 (-$ui-trigger-height);\r | |
165 | \r | |
166 | &.#{$prefix}form-spinner-over {\r | |
167 | background-position: (-$ui-trigger-width) (-$ui-trigger-height);\r | |
168 | &.#{$prefix}form-spinner-focus {\r | |
169 | background-position: -($ui-trigger-width * 4) (-$ui-trigger-height);\r | |
170 | }\r | |
171 | }\r | |
172 | \r | |
173 | &.#{$prefix}form-spinner-focus {\r | |
174 | background-position: -($ui-trigger-width * 3) (-$ui-trigger-height);\r | |
175 | }\r | |
176 | \r | |
177 | // add x-form-spinner class to increase specificity of "click" above focus/over\r | |
178 | &.#{$prefix}form-spinner.#{$prefix}form-spinner-click {\r | |
179 | background-position: -($ui-trigger-width * 2) (-$ui-trigger-height);\r | |
180 | }\r | |
181 | }\r | |
182 | } @else {\r | |
183 | .#{$prefix}form-spinner-#{$ui} {\r | |
184 | background-position: 0 0;\r | |
185 | \r | |
186 | &.#{$prefix}form-spinner-over {\r | |
187 | background-position: (-$ui-trigger-width) 0;\r | |
188 | &.#{$prefix}form-spinner-focus {\r | |
189 | background-position: -($ui-trigger-width * 4) 0;\r | |
190 | }\r | |
191 | }\r | |
192 | \r | |
193 | &.#{$prefix}form-spinner-focus {\r | |
194 | background-position: -($ui-trigger-width * 3) 0;\r | |
195 | }\r | |
196 | \r | |
197 | // add x-form-spinner class to increase specificity of "click" above focus/over\r | |
198 | &.#{$prefix}form-spinner.#{$prefix}form-spinner-click {\r | |
199 | background-position: -($ui-trigger-width * 2) 0;\r | |
200 | }\r | |
201 | }\r | |
202 | }\r | |
203 | }\r | |
204 | \r |