Skip to content

Commit a8a08cf

Browse files
authored
"icon" class is implied by icon component (#1842)
1 parent a036f67 commit a8a08cf

File tree

22 files changed

+50
-50
lines changed

22 files changed

+50
-50
lines changed

demos/form-control/dropdown-plus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
Form\Control\Dropdown::class,
9090
'caption' => 'Using icon',
9191
'empty' => 'Choose an icon',
92-
'values' => ['tag' => ['Tag', 'icon' => 'tag icon'], 'globe' => ['Globe', 'icon' => 'globe icon'], 'registered' => ['Registered', 'icon' => 'registered icon'], 'file' => ['File', 'icon' => 'file icon']],
92+
'values' => ['tag' => ['Tag', 'icon' => 'tag'], 'globe' => ['Globe', 'icon' => 'globe'], 'registered' => ['Registered', 'icon' => 'registered'], 'file' => ['File', 'icon' => 'file']],
9393
]);
9494

9595
$form->addControl('multi', [

demos/form-control/input2.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636

3737
$group = $form->addGroup('Dropdown');
3838
$values = [
39-
'tag' => ['Tag', 'icon' => 'tag icon'],
40-
'globe' => ['Globe', 'icon' => 'globe icon'],
41-
'registered' => ['Registered', 'icon' => 'registered icon'],
42-
'file' => ['File', 'icon' => 'file icon'],
39+
'tag' => ['Tag', 'icon' => 'tag'],
40+
'globe' => ['Globe', 'icon' => 'globe'],
41+
'registered' => ['Registered', 'icon' => 'registered'],
42+
'file' => ['File', 'icon' => 'file'],
4343
];
4444
$group->addControl('d_norm', [Form\Control\Dropdown::class, 'values' => $values, 'width' => 'three'])->set('globe');
4545
$group->addControl('d_read', [Form\Control\Dropdown::class, 'values' => $values, 'readOnly' => true, 'width' => 'three'])->set('globe'); // allows to change value
@@ -185,10 +185,10 @@
185185
$group = $form->addGroup(['Dropdown', 'width' => 'three']);
186186
$d1 = $group->addControl('d1', new Form\Control\Dropdown([
187187
'values' => [
188-
'tag' => ['Tag', 'icon' => 'tag icon'],
189-
'globe' => ['Globe', 'icon' => 'globe icon'],
190-
'registered' => ['Registered', 'icon' => 'registered icon'],
191-
'file' => ['File', 'icon' => 'file icon'],
188+
'tag' => ['Tag', 'icon' => 'tag'],
189+
'globe' => ['Globe', 'icon' => 'globe'],
190+
'registered' => ['Registered', 'icon' => 'registered'],
191+
'file' => ['File', 'icon' => 'file'],
192192
],
193193
]));
194194
$d1->onChange('console.log("Dropdown changed")');

docs/form-control.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,10 @@ If not used with a model, you can define the Dropdown values in $values array. T
406406
You can also define an Icon right away::
407407

408408
$dropdown->values = [
409-
'tag' => ['Tag', 'icon' => 'tag icon'],
410-
'globe' => ['Globe', 'icon' => 'globe icon'],
411-
'registered' => ['Registered', 'icon' => 'registered icon'],
412-
'file' => ['File', 'icon' => 'file icon'],
409+
'tag' => ['Tag', 'icon' => 'tag'],
410+
'globe' => ['Globe', 'icon' => 'globe'],
411+
'registered' => ['Registered', 'icon' => 'registered'],
412+
'file' => ['File', 'icon' => 'file'],
413413
];
414414

415415
If using $values property, you can also use the :php:meth:`Form::renderRowFunction()`, though there usually is no need for it.

docs/icon.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Composing offers you another way to deal with Group icons::
9797

9898
$no_users = new \Atk4\Ui\View(['class.huge icons' => true, 'element' => 'i']);
9999
Icon::addTo($no_users, ['big red dont']);
100-
Icon::addTo($no_users, ['black user icon']);
100+
Icon::addTo($no_users, ['black user']);
101101

102102
$app->add($no_users);
103103

js/src/components/query-builder/fomantic-ui-group.component.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</div>
4747
</div>
4848
<div class="two wide right aligned column">
49-
<i v-if="depth > 1" class="atk-qb-remove" :class="labels.removeGroup" @click="remove"></i>
49+
<i v-if="depth > 1" class="atk-qb-remove" :class="labels.removeGroupClass" @click="remove"></i>
5050
</div>
5151
</div>
5252
</div>

js/src/components/query-builder/fomantic-ui-rule.component.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
</div>
7878
<div class="right aligned three wide column">
7979
<!-- Remove rule button -->
80-
<i :class="labels.removeRule" @click="remove" class="atk-qb-remove"></i>
80+
<i :class="labels.removeRuleClass" @click="remove" class="atk-qb-remove"></i>
8181
</div>
8282
</div>
8383
</div>

js/src/components/query-builder/query-builder.component.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ export default {
5858
{ id: 'OR', label: 'Or' },
5959
],
6060
addRule: 'Add Rule',
61-
removeRule: 'small icon times',
61+
removeRuleClass: 'small icon times',
6262
addGroup: 'Add Group',
63-
removeGroup: 'small icon times',
63+
removeGroupClass: 'small icon times',
6464
textInputPlaceholder: 'value',
6565
spaceRule: 'fitted', // can be fitted, compact or padded.
6666
hiddenOperator: ['is empty', 'is not empty'], // a list of operators that when select, will hide user input.

js/src/components/tree-item-selector/tree-item-selector.component.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ export default {
2424
nodes: this.item.nodes,
2525
icons: {
2626
single: {
27-
on: 'circle icon',
28-
off: 'circle outline icon',
29-
indeterminate: 'dot circle outline icon',
27+
on: 'circle',
28+
off: 'circle outline',
29+
indeterminate: 'dot circle outline',
3030
},
3131
multiple: {
32-
on: 'check square outline icon',
33-
off: 'square outline icon',
34-
indeterminate: 'minus square outline icon',
32+
on: 'check square outline',
33+
off: 'square outline',
34+
indeterminate: 'minus square outline',
3535
},
3636
},
3737
};
@@ -55,7 +55,7 @@ export default {
5555
return (this.nodes && this.nodes.length > 0);
5656
},
5757
toggleIcon: function () {
58-
return this.isParent ? this.open ? 'caret down icon' : 'caret right icon' : null;
58+
return this.isParent ? (this.open ? 'caret down' : 'caret right') + ' icon' : null;
5959
},
6060
state: function () {
6161
let state = 'off';
@@ -68,7 +68,7 @@ export default {
6868
return state;
6969
},
7070
getIcon: function () {
71-
return this.icons[this.getRootData().options.mode][this.state];
71+
return this.icons[this.getRootData().options.mode][this.state] + ' icon';
7272
},
7373
},
7474
methods: {

js/src/plugins/sidenav.plugin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default class sidenav extends atkPlugin {
9090
* @param selector
9191
*/
9292
setTogglerIcon(selector) {
93-
this.toggler.find(selector).attr('class', this.isMenuOn() ? this.settings.icon.off : this.settings.icon.on);
93+
this.toggler.find(selector).attr('class', (this.isMenuOn() ? this.settings.icon.off : this.settings.icon.on) + ' icon');
9494
}
9595

9696
/**
@@ -123,7 +123,7 @@ sidenav.DEFAULTS = {
123123
firstItemSelector: 'a', // the selector for the first menu item in a group, where click will be trigger.
124124
icon: {
125125
selector: 'i',
126-
on: 'icon caret right',
127-
off: 'icon caret down',
126+
on: 'caret right',
127+
off: 'caret down',
128128
},
129129
};

0 commit comments

Comments
 (0)