lsd_rails 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Packages/Sheet.js/Source/SheetParser.Value.js +1 -1
- data/Packages/lsd/Source/Action/Clone.js +2 -12
- data/Packages/lsd/Source/Action/Delete.js +1 -7
- data/Packages/lsd/Source/Action/Display.js +7 -7
- data/Packages/lsd/Source/Action/Edit.js +2 -2
- data/Packages/lsd/Source/Action/Invoke.js +2 -2
- data/Packages/lsd/Source/Action/Submit.js +2 -0
- data/Packages/lsd/Source/Action/Toggle.js +4 -0
- data/Packages/lsd/Source/Action/Update.js +2 -1
- data/Packages/lsd/Source/Action.js +4 -5
- data/Packages/lsd/Source/Document.js +10 -7
- data/Packages/lsd/Source/LSD.js +22 -127
- data/Packages/lsd/Source/Layer.js +4 -4
- data/Packages/lsd/Source/Layout.js +1077 -259
- data/Packages/lsd/Source/Mixin/Animation.js +1 -1
- data/Packages/lsd/Source/Mixin/Choice.js +2 -2
- data/Packages/lsd/Source/Mixin/Command.js +26 -8
- data/Packages/lsd/Source/Mixin/ContentEditable.js +2 -1
- data/Packages/lsd/Source/{Trait → Mixin}/Date.js +21 -11
- data/Packages/lsd/Source/{Trait/Menu.js → Mixin/Details.js} +6 -1
- data/Packages/lsd/Source/Mixin/Draggable.js +1 -1
- data/Packages/lsd/Source/Mixin/Fieldset.js +51 -49
- data/Packages/lsd/Source/Mixin/Focusable.js +38 -39
- data/Packages/lsd/Source/Mixin/Invokable.js +13 -14
- data/Packages/lsd/Source/Mixin/List.js +9 -17
- data/Packages/lsd/Source/Mixin/Placeholder.js +2 -7
- data/Packages/lsd/Source/Mixin/Request.js +5 -3
- data/Packages/lsd/Source/Mixin/Resizable.js +3 -3
- data/Packages/lsd/Source/Mixin/Resource.js +1 -1
- data/Packages/lsd/Source/Mixin/Root.js +17 -1
- data/Packages/lsd/Source/Mixin/Scrollable.js +1 -1
- data/Packages/lsd/Source/{Trait → Mixin}/Slider.js +0 -0
- data/Packages/lsd/Source/Mixin/Sortable.js +2 -2
- data/Packages/lsd/Source/Mixin/Submittable.js +2 -1
- data/Packages/lsd/Source/Mixin/Target.js +11 -6
- data/Packages/lsd/Source/Mixin/Touchable.js +2 -2
- data/Packages/lsd/Source/Mixin/Unselectable.js +1 -1
- data/Packages/lsd/Source/Mixin/Uploader.js +11 -13
- data/Packages/lsd/Source/Mixin/Validity.js +35 -9
- data/Packages/lsd/Source/Mixin/Value.js +5 -3
- data/Packages/lsd/Source/Module/Accessories/Attributes.js +90 -89
- data/Packages/lsd/Source/Module/Accessories/Chain.js +40 -25
- data/Packages/lsd/Source/Module/Accessories/Element.js +59 -58
- data/Packages/lsd/Source/Module/Accessories/Events.js +25 -10
- data/Packages/lsd/Source/Module/Accessories/Options.js +11 -13
- data/Packages/lsd/Source/Module/Accessories/States.js +42 -5
- data/Packages/lsd/Source/Module/Accessories/Styles.js +1 -1
- data/Packages/lsd/Source/Module/Accessories/Tag.js +21 -7
- data/Packages/lsd/Source/Module/Ambient/Allocations.js +178 -64
- data/Packages/lsd/Source/Module/Ambient/DOM.js +98 -55
- data/Packages/lsd/Source/Module/Ambient/Expectations.js +57 -8
- data/Packages/lsd/Source/Module/Ambient/Interpolations.js +147 -0
- data/Packages/lsd/Source/Module/Ambient/Layout.js +52 -15
- data/Packages/lsd/Source/Module/Ambient/Proxies.js +44 -36
- data/Packages/lsd/Source/Module/Ambient/Relations.js +3 -1
- data/Packages/lsd/Source/Module/Ambient/Selectors.js +3 -3
- data/Packages/lsd/Source/Module/Ambient.js +2 -2
- data/Packages/lsd/Source/Module/Graphics/Layers.js +1 -1
- data/Packages/lsd/Source/Module/Graphics/Render.js +1 -1
- data/Packages/lsd/Source/Relation.js +19 -20
- data/Packages/lsd/Source/Sheet.js +4 -5
- data/Packages/lsd/Source/{Behavior.js → Tools/Behavior.js} +0 -0
- data/Packages/lsd/Source/Tools/Command.js +190 -0
- data/Packages/lsd/Source/Tools/Helpers.js +109 -0
- data/Packages/lsd/Source/Tools/Interpolation.js +351 -0
- data/Packages/lsd/Source/Tools/Microdata.js +75 -0
- data/Packages/lsd/Source/Tools/Object.js +192 -0
- data/Packages/lsd/Source/Tools/Position.js +208 -0
- data/Packages/lsd/Source/Tools/Require.js +76 -0
- data/Packages/lsd/Source/Type.js +2 -2
- data/Packages/lsd/package.yml +11 -7
- data/Packages/lsd-mobile/Source/Body/Dialog.js +2 -2
- data/Packages/lsd-mobile/Source/Input/Date.js +9 -84
- data/Packages/lsd-native/Source/Input/Checkbox.js +4 -4
- data/Packages/lsd-native/Source/Input/Date.js +46 -6
- data/Packages/lsd-native/Source/Input/Radio.js +1 -4
- data/Packages/lsd-native/Source/Input.js +5 -6
- data/Packages/lsd-widgets/Source/Body/Dialog.js +9 -6
- data/Packages/lsd-widgets/Source/Body/Page.js +1 -1
- data/Packages/lsd-widgets/Source/Body.js +1 -1
- data/Packages/lsd-widgets/Source/Button.js +1 -1
- data/Packages/lsd-widgets/Source/Form.js +1 -1
- data/Packages/lsd-widgets/Source/Input/Checkbox.js +2 -2
- data/Packages/lsd-widgets/Source/Input/Date.js +45 -16
- data/Packages/lsd-widgets/Source/Input/File.js +2 -2
- data/Packages/lsd-widgets/Source/Input/HTML.js +2 -2
- data/Packages/lsd-widgets/Source/Input/Radio.js +1 -1
- data/Packages/lsd-widgets/Source/Input/Range.js +2 -2
- data/Packages/lsd-widgets/Source/Input/Submit.js +1 -1
- data/Packages/lsd-widgets/Source/Input.js +2 -11
- data/Packages/lsd-widgets/Source/Label.js +4 -8
- data/Packages/lsd-widgets/Source/Menu/List.js +3 -3
- data/Packages/lsd-widgets/Source/Menu.js +2 -2
- data/Packages/lsd-widgets/Source/Progress.js +1 -1
- data/Packages/lsd-widgets/Source/Select.js +7 -6
- data/Packages/lsd-widgets/Source/Table/Calendar.js +41 -15
- data/Packages/lsd-widgets/Source/Table.js +7 -2
- data/Packages/mootools-ext/Source/Core/Class.Mixin.js +43 -38
- data/Packages/mootools-ext/Source/Core/Class.States.js +26 -22
- data/Packages/mootools-ext/Source/Element/Element.from.js +1 -1
- data/Packages/mootools-ext/Source/Element/Properties/Item.js +1 -2
- data/Packages/mootools-ext/Source/Request/Request.Statuses.js +9 -7
- data/Packages/mootools-ext/Source/Types/{FastArray.js → Object.Array.js} +8 -14
- data/Packages/mootools-ext/package.yml +1 -2
- data/lib/lsd.rake +28 -0
- metadata +15 -11
- data/Packages/lsd/Source/Command.js +0 -135
- data/Packages/lsd/Source/Interpolation.js +0 -103
- data/Packages/lsd/Source/Module/Ambient/Container.js +0 -56
- data/Packages/mootools-ext/Source/Element/Element.onDispose.js +0 -36
@@ -12,7 +12,7 @@ authors: Yaroslaff Fedin
|
|
12
12
|
requires:
|
13
13
|
- LSD.Mobile.Input
|
14
14
|
- LSD.Mobile.Body.Dialog
|
15
|
-
- LSD/LSD.
|
15
|
+
- LSD/LSD.Mixin.Date
|
16
16
|
|
17
17
|
provides:
|
18
18
|
- LSD.Mobile.Input.Date
|
@@ -21,8 +21,6 @@ provides:
|
|
21
21
|
*/
|
22
22
|
|
23
23
|
LSD.Mobile.Input.Date = new Class({
|
24
|
-
Implements: LSD.Trait.Date,
|
25
|
-
|
26
24
|
options: {
|
27
25
|
attributes: {
|
28
26
|
type: 'date'
|
@@ -32,88 +30,15 @@ LSD.Mobile.Input.Date = new Class({
|
|
32
30
|
focus: 'expand'
|
33
31
|
}
|
34
32
|
},
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
this.setDate(date);
|
43
|
-
this.collapse();
|
44
|
-
}
|
45
|
-
}
|
46
|
-
}
|
47
|
-
},
|
48
|
-
states: Array.fast('expanded')
|
49
|
-
},
|
50
|
-
|
51
|
-
initialize: function() {
|
52
|
-
this.parent.apply(this, arguments);
|
53
|
-
this.setDate(this.getDate());
|
54
|
-
},
|
55
|
-
|
56
|
-
setDate: function(date) {
|
57
|
-
this.parent.apply(this, arguments);
|
58
|
-
if (date) this.element.set('value', this.formatDate(date));
|
59
|
-
if (this.dialog) this.dialog.setDate(date);
|
60
|
-
}
|
61
|
-
});
|
62
|
-
|
63
|
-
LSD.Mobile.Body.Dialog.Datepicker = new Class({
|
64
|
-
Extends: LSD.Mobile.Body.Dialog,
|
65
|
-
|
66
|
-
Implements: LSD.Trait.Date,
|
67
|
-
|
68
|
-
options: {
|
69
|
-
classes: Array.fast('datepicker'),
|
70
|
-
layout: {
|
71
|
-
'::decrementor': 'Previous month',
|
72
|
-
'::incrementor': 'Next month',
|
73
|
-
'::table': true,
|
74
|
-
'::closer': 'Close dialog'
|
75
|
-
},
|
76
|
-
has: {
|
77
|
-
one: {
|
78
|
-
table: {
|
79
|
-
selector: 'table[type=calendar]',
|
80
|
-
events: {
|
81
|
-
set: 'selectDate'
|
82
|
-
}
|
83
|
-
},
|
84
|
-
decrementor: {
|
85
|
-
selector: 'button#decrement',
|
86
|
-
events: {
|
87
|
-
click: 'decrement'
|
88
|
-
}
|
89
|
-
},
|
90
|
-
incrementor: {
|
91
|
-
selector: 'button#increment',
|
92
|
-
events: {
|
93
|
-
click: 'increment'
|
94
|
-
}
|
95
|
-
},
|
96
|
-
closer: {
|
97
|
-
selector: 'button#closer',
|
98
|
-
events: {
|
99
|
-
click: 'cancel'
|
100
|
-
}
|
33
|
+
pseudos: Array.object('date'),
|
34
|
+
states: Array.object('expanded'),
|
35
|
+
events: {
|
36
|
+
self: {
|
37
|
+
setDate: function(date) {
|
38
|
+
if (date) this.element.set('value', this.formatDate(date));
|
39
|
+
if (this.dialog) this.dialog.setDate(date);
|
101
40
|
}
|
102
41
|
}
|
103
42
|
}
|
104
|
-
},
|
105
|
-
|
106
|
-
getData: function() {
|
107
|
-
return this.date;
|
108
|
-
},
|
109
|
-
|
110
|
-
setDate: function(date) {
|
111
|
-
this.parent.apply(this, arguments);
|
112
|
-
this.table.setDate(date);
|
113
|
-
},
|
114
|
-
|
115
|
-
selectDate: function(date) {
|
116
|
-
this.setDate(date);
|
117
|
-
this.submit();
|
118
43
|
}
|
119
|
-
})
|
44
|
+
});
|
@@ -22,13 +22,13 @@ LSD.Native.Input.Checkbox = new Class({
|
|
22
22
|
Extends: LSD.Native.Input,
|
23
23
|
|
24
24
|
options: {
|
25
|
-
pseudos: Array.
|
25
|
+
pseudos: Array.object('checkbox', 'clickable'),
|
26
|
+
attributes: {
|
27
|
+
type: 'checkbox'
|
28
|
+
},
|
26
29
|
events: {
|
27
30
|
_checkbox: {
|
28
31
|
self: {
|
29
|
-
setDocument: function() {
|
30
|
-
if (this.attributes.checked) this.click();
|
31
|
-
},
|
32
32
|
check: function() {
|
33
33
|
this.element.checked = true;
|
34
34
|
},
|
@@ -11,7 +11,7 @@ authors: Yaroslaff Fedin
|
|
11
11
|
|
12
12
|
requires:
|
13
13
|
- LSD.Native.Input
|
14
|
-
- LSD/LSD.
|
14
|
+
- LSD/LSD.Mixin.Date
|
15
15
|
|
16
16
|
provides:
|
17
17
|
- LSD.Native.Input.Date
|
@@ -20,14 +20,54 @@ provides:
|
|
20
20
|
*/
|
21
21
|
|
22
22
|
LSD.Native.Input.Date = new Class({
|
23
|
-
|
24
|
-
LSD.Native.Input,
|
25
|
-
LSD.Trait.Date
|
26
|
-
],
|
23
|
+
Extends: LSD.Native.Input,
|
27
24
|
|
28
25
|
options: {
|
29
26
|
attributes: {
|
30
27
|
type: 'date'
|
28
|
+
},
|
29
|
+
pseudos: Array.object('date'),
|
30
|
+
layout: {
|
31
|
+
'if &:focused': {
|
32
|
+
'::dialog:of-kind(input-date)': {
|
33
|
+
'button.previous': 'Previous month',
|
34
|
+
'button.next': 'Next month',
|
35
|
+
'table[type=calendar]': true
|
36
|
+
}
|
37
|
+
}
|
38
|
+
},
|
39
|
+
relations: {
|
40
|
+
decrementor: {
|
41
|
+
selector: '.previous',
|
42
|
+
events: {
|
43
|
+
click: 'decrement'
|
44
|
+
}
|
45
|
+
},
|
46
|
+
incrementor: {
|
47
|
+
selector: '.next',
|
48
|
+
events: {
|
49
|
+
click: 'increment'
|
50
|
+
}
|
51
|
+
},
|
52
|
+
calendar: {
|
53
|
+
selector: 'table',
|
54
|
+
events: {
|
55
|
+
click: 'increment',
|
56
|
+
set: 'setDate'
|
57
|
+
}
|
58
|
+
}
|
59
|
+
},
|
60
|
+
events: {
|
61
|
+
_date: {
|
62
|
+
build: function() {
|
63
|
+
this.setDate(this.getDate());
|
64
|
+
},
|
65
|
+
setDate: function(date, source) {
|
66
|
+
if (date && !source) this.element.set('value', this.formatDate(date));
|
67
|
+
if (this.calendar) this.calendar.setDate(date);
|
68
|
+
},
|
69
|
+
change: 'setDate'
|
70
|
+
}
|
31
71
|
}
|
32
72
|
}
|
33
|
-
});
|
73
|
+
});
|
@@ -22,13 +22,10 @@ LSD.Native.Input.Radio = new Class({
|
|
22
22
|
Extends: LSD.Native.Input,
|
23
23
|
|
24
24
|
options: {
|
25
|
-
pseudos: Array.
|
25
|
+
pseudos: Array.object('radio', 'clickable'),
|
26
26
|
events: {
|
27
27
|
_checkbox: {
|
28
28
|
self: {
|
29
|
-
setDocument: function() {
|
30
|
-
if (this.attributes.checked) this.click();
|
31
|
-
},
|
32
29
|
check: function() {
|
33
30
|
this.element.checked = true;
|
34
31
|
},
|
@@ -25,12 +25,15 @@ LSD.Native.Input = new Class({
|
|
25
25
|
events: {
|
26
26
|
_input: {
|
27
27
|
element: {
|
28
|
-
input: 'setValue'
|
28
|
+
input: 'setValue',
|
29
|
+
change: 'setValue',
|
30
|
+
focus: 'onFocus',
|
31
|
+
blur: 'onBlur'
|
29
32
|
}
|
30
33
|
}
|
31
34
|
},
|
32
35
|
inline: null,
|
33
|
-
pseudos: Array.
|
36
|
+
pseudos: Array.object('form-associated', 'focusable', 'value')
|
34
37
|
},
|
35
38
|
|
36
39
|
applyValue: function(value) {
|
@@ -39,10 +42,6 @@ LSD.Native.Input = new Class({
|
|
39
42
|
|
40
43
|
getRawValue: function() {
|
41
44
|
return this.element.get('value');
|
42
|
-
},
|
43
|
-
|
44
|
-
focus: function() {
|
45
|
-
this.element.focus();
|
46
45
|
}
|
47
46
|
|
48
47
|
});
|
@@ -29,12 +29,9 @@ LSD.Widget.Body.Dialog = new Class({
|
|
29
29
|
element: {
|
30
30
|
tag: 'section'
|
31
31
|
},
|
32
|
-
classes: Array.
|
33
|
-
pseudos: Array.
|
32
|
+
classes: Array.object('dialog'),
|
33
|
+
pseudos: Array.object('fieldset', 'submittable', 'invokable', 'command', 'focusable'),
|
34
34
|
clone: true,
|
35
|
-
interpolate: function(string) {
|
36
|
-
this.options.interpolate = LSD.Interpolation.from(this.attributes, this, this.dataset)
|
37
|
-
},
|
38
35
|
events: {
|
39
36
|
_dialog: {
|
40
37
|
element: {
|
@@ -48,6 +45,7 @@ LSD.Widget.Body.Dialog = new Class({
|
|
48
45
|
},
|
49
46
|
setRole: function() {
|
50
47
|
var kind = this.attributes.kind;
|
48
|
+
console.error('set role', kind, this.element, this.attributes);
|
51
49
|
if (!kind) return;
|
52
50
|
var element = Slick.find(document.body, 'dialog#' + kind);
|
53
51
|
if (element) return {origin: element};
|
@@ -58,11 +56,16 @@ LSD.Widget.Body.Dialog = new Class({
|
|
58
56
|
one: {
|
59
57
|
form: {
|
60
58
|
selector: 'form',
|
61
|
-
as: 'invoker'
|
59
|
+
as: 'invoker',
|
60
|
+
pseudos: Array.object('invokable')
|
62
61
|
}
|
63
62
|
}
|
64
63
|
}
|
65
64
|
},
|
66
65
|
|
66
|
+
getParentElement: function() {
|
67
|
+
return document.body;
|
68
|
+
},
|
69
|
+
|
67
70
|
hidden: true
|
68
71
|
});
|
@@ -24,7 +24,7 @@ provides:
|
|
24
24
|
LSD.Widget.Form = new Class({
|
25
25
|
options: {
|
26
26
|
tag: 'form',
|
27
|
-
pseudos: Array.
|
27
|
+
pseudos: Array.object('form', 'fieldset', 'command', 'submittable'),
|
28
28
|
events: {
|
29
29
|
self: {
|
30
30
|
build: function() {
|
@@ -23,9 +23,9 @@ provides:
|
|
23
23
|
LSD.Widget.Input.Checkbox = new Class({
|
24
24
|
options: {
|
25
25
|
tag: 'input',
|
26
|
+
pseudos: Array.object('clickable', 'focusable', 'checkbox', 'value', 'form-associated'),
|
26
27
|
shortcuts: {
|
27
28
|
space: 'toggle'
|
28
|
-
}
|
29
|
-
pseudos: Array.fast('clickable', 'focusable', 'checkbox', 'value', 'form-associated')
|
29
|
+
}
|
30
30
|
}
|
31
31
|
});
|
@@ -10,7 +10,8 @@ license: Public domain (http://unlicense.org).
|
|
10
10
|
authors: Yaroslaff Fedin
|
11
11
|
|
12
12
|
requires:
|
13
|
-
- LSD.Widget.Input
|
13
|
+
- LSD.Widget.Input
|
14
|
+
- LSD.Widget.Table.Calendar
|
14
15
|
|
15
16
|
provides: [LSD.Widget.Input.Date]
|
16
17
|
|
@@ -18,26 +19,54 @@ provides: [LSD.Widget.Input.Date]
|
|
18
19
|
*/
|
19
20
|
|
20
21
|
LSD.Widget.Input.Date = new Class({
|
21
|
-
Extends: LSD.
|
22
|
+
Extends: LSD.Widget.Input,
|
22
23
|
|
23
24
|
options: {
|
24
25
|
attributes: {
|
25
26
|
type: 'date'
|
26
27
|
},
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
28
|
+
pseudos: Array.object('date'),
|
29
|
+
layout: {
|
30
|
+
'if &:focused': {
|
31
|
+
'::dialog:of-kind(input-date)': {
|
32
|
+
'button.previous': 'Previous month',
|
33
|
+
'button.next': 'Next month',
|
34
|
+
'table[type=calendar]': true
|
35
|
+
}
|
36
|
+
}
|
37
|
+
},
|
38
|
+
relations: {
|
39
|
+
decrementor: {
|
40
|
+
selector: '.previous',
|
41
|
+
events: {
|
42
|
+
click: 'decrement'
|
43
|
+
}
|
44
|
+
},
|
45
|
+
incrementor: {
|
46
|
+
selector: '.next',
|
47
|
+
events: {
|
48
|
+
click: 'increment'
|
49
|
+
}
|
50
|
+
},
|
51
|
+
calendar: {
|
52
|
+
selector: 'table',
|
53
|
+
events: {
|
54
|
+
click: 'increment',
|
55
|
+
set: 'setDate'
|
56
|
+
}
|
57
|
+
}
|
58
|
+
},
|
59
|
+
events: {
|
60
|
+
_date: {
|
61
|
+
build: function() {
|
62
|
+
this.setDate(this.getDate());
|
63
|
+
},
|
64
|
+
setDate: function(date, source) {
|
65
|
+
if (date && !source) this.element.set('value', this.formatDate(date));
|
66
|
+
if (this.calendar) this.calendar.setDate(date);
|
67
|
+
},
|
68
|
+
change: 'setDate'
|
69
|
+
}
|
35
70
|
}
|
36
|
-
},
|
37
|
-
|
38
|
-
setDate: function(date) {
|
39
|
-
this.parent.apply(this, arguments);
|
40
|
-
if (date) this.element.set('value', this.formatDate(date));
|
41
|
-
if (this.dialog) this.dialog.setDate(date);
|
42
71
|
}
|
43
72
|
});
|
@@ -31,8 +31,8 @@ LSD.Widget.Input.File = new Class({
|
|
31
31
|
url: '/blobs.json',
|
32
32
|
fieldName: 'blob'
|
33
33
|
},
|
34
|
-
pseudos: Array.
|
35
|
-
layout: Array.
|
34
|
+
pseudos: Array.object('uploader', 'focusable', 'form-associated', 'value'),
|
35
|
+
layout: Array.object('::list'),
|
36
36
|
proxies: {
|
37
37
|
files: {
|
38
38
|
condition: function(widget) {
|
@@ -24,12 +24,12 @@ provides:
|
|
24
24
|
LSD.Widget.Input.Html = LSD.Widget.Input.HTML = new Class({
|
25
25
|
options: {
|
26
26
|
tag: 'input',
|
27
|
-
pseudos: Array.
|
27
|
+
pseudos: Array.object('form-associated', 'value'),
|
28
28
|
attributes: {
|
29
29
|
contenteditable: 'editor',
|
30
30
|
tabindex: 0
|
31
31
|
},
|
32
|
-
states: Array.
|
32
|
+
states: Array.object('editing'),
|
33
33
|
events: {
|
34
34
|
self: {
|
35
35
|
focus: 'edit',
|
@@ -23,7 +23,7 @@ provides: [LSD.Widget.Input.Radio]
|
|
23
23
|
LSD.Widget.Input.Radio = new Class({
|
24
24
|
options: {
|
25
25
|
tag: 'input',
|
26
|
-
pseudos: Array.
|
26
|
+
pseudos: Array.object('focusable', 'clickable', 'radio', 'form-associated', 'value'),
|
27
27
|
shortcuts: {
|
28
28
|
space: 'click'
|
29
29
|
}
|
@@ -30,7 +30,7 @@ LSD.Widget.Input.Range = new Class({
|
|
30
30
|
next: 'increment',
|
31
31
|
previous: 'decrement'
|
32
32
|
},
|
33
|
-
layout: Array.
|
33
|
+
layout: Array.object('::thumb'),
|
34
34
|
has: {
|
35
35
|
one: {
|
36
36
|
thumb: {
|
@@ -39,7 +39,7 @@ LSD.Widget.Input.Range = new Class({
|
|
39
39
|
}
|
40
40
|
}
|
41
41
|
},
|
42
|
-
pseudos: Array.
|
42
|
+
pseudos: Array.object('focusable', 'value', 'form-associated')
|
43
43
|
},
|
44
44
|
|
45
45
|
initialize: function() {
|
@@ -28,7 +28,7 @@ LSD.Widget.Input = new Class({
|
|
28
28
|
attributes: {
|
29
29
|
type: 'text'
|
30
30
|
},
|
31
|
-
pseudos: Array.
|
31
|
+
pseudos: Array.object('form-associated', 'value'),
|
32
32
|
events: {
|
33
33
|
_input: {
|
34
34
|
focus: function() {
|
@@ -39,12 +39,7 @@ LSD.Widget.Input = new Class({
|
|
39
39
|
}
|
40
40
|
}
|
41
41
|
},
|
42
|
-
states: Array.
|
43
|
-
},
|
44
|
-
|
45
|
-
retain: function() {
|
46
|
-
this.focus(false);
|
47
|
-
return false;
|
42
|
+
states: Array.object('focused')
|
48
43
|
},
|
49
44
|
|
50
45
|
applyValue: function(item) {
|
@@ -53,10 +48,6 @@ LSD.Widget.Input = new Class({
|
|
53
48
|
|
54
49
|
getRawValue: function() {
|
55
50
|
return ('value' in this.attributes) && this.element.get('value');
|
56
|
-
},
|
57
|
-
|
58
|
-
focus: function() {
|
59
|
-
this.element.focus();
|
60
51
|
}
|
61
52
|
|
62
53
|
});
|
@@ -24,9 +24,6 @@ LSD.Widget.Label = new Class({
|
|
24
24
|
has: {
|
25
25
|
one: {
|
26
26
|
control: {
|
27
|
-
expectation: function() {
|
28
|
-
return {combinator: ' ', tag: '*', pseudos: [{key: 'form-associated'}]}
|
29
|
-
},
|
30
27
|
collection: 'labels',
|
31
28
|
states: {
|
32
29
|
get: {
|
@@ -41,14 +38,13 @@ LSD.Widget.Label = new Class({
|
|
41
38
|
widget[state ? 'addRelation' : 'removeRelation']('control', {
|
42
39
|
expectation: function() {
|
43
40
|
var id = this.attributes['for'];
|
44
|
-
if (id) return {id: id, combinator: '
|
45
|
-
}
|
46
|
-
target: 'root'
|
41
|
+
if (id) return {id: id, combinator: '&&', tag: '*'};
|
42
|
+
}
|
47
43
|
});
|
48
44
|
}
|
49
45
|
},
|
50
|
-
pseudos: Array.
|
51
|
-
states: Array.
|
46
|
+
pseudos: Array.object('form-associated', 'clickable', 'command'),
|
47
|
+
states: Array.object('invalid'),
|
52
48
|
chain: {
|
53
49
|
focusControl: function() {
|
54
50
|
if (this.control) return {
|
@@ -25,7 +25,7 @@ LSD.Widget.Menu.List = new Class({
|
|
25
25
|
Extends: LSD.Widget.Menu,
|
26
26
|
|
27
27
|
options: {
|
28
|
-
pseudos: Array.
|
28
|
+
pseudos: Array.object('list', 'value'),
|
29
29
|
attributes: {
|
30
30
|
type: 'list'
|
31
31
|
},
|
@@ -34,7 +34,7 @@ LSD.Widget.Menu.List = new Class({
|
|
34
34
|
items: {
|
35
35
|
source: 'menu-list-option',
|
36
36
|
mutation: '> button, > li, > command, > option',
|
37
|
-
pseudos: Array.
|
37
|
+
pseudos: Array.object('clickable')
|
38
38
|
}
|
39
39
|
}
|
40
40
|
}
|
@@ -44,6 +44,6 @@ LSD.Widget.Menu.List = new Class({
|
|
44
44
|
LSD.Widget.Menu.List.Option = new Class({
|
45
45
|
options: {
|
46
46
|
tag: 'option',
|
47
|
-
pseudos: Array.
|
47
|
+
pseudos: Array.object('item')
|
48
48
|
}
|
49
49
|
});
|
@@ -25,7 +25,7 @@ LSD.Widget.Menu = new Class({
|
|
25
25
|
options: {
|
26
26
|
tag: 'menu',
|
27
27
|
inline: null,
|
28
|
-
pseudos: Array.
|
28
|
+
pseudos: Array.object('list')
|
29
29
|
}
|
30
30
|
});
|
31
31
|
|
@@ -33,6 +33,6 @@ LSD.Widget.Menu.Command = new Class({
|
|
33
33
|
options: {
|
34
34
|
tag: 'command',
|
35
35
|
inline: null,
|
36
|
-
pseudos: Array.
|
36
|
+
pseudos: Array.object('item')
|
37
37
|
}
|
38
38
|
});
|
@@ -11,10 +11,11 @@ authors: Yaroslaff Fedin
|
|
11
11
|
|
12
12
|
requires:
|
13
13
|
- LSD/LSD.Widget
|
14
|
-
- LSD.Widget.Menu
|
15
14
|
- LSD.Widget.Button
|
15
|
+
- LSD.Widget.Menu.Context
|
16
16
|
- LSD/LSD.Mixin.List
|
17
17
|
- LSD/LSD.Mixin.Choice
|
18
|
+
- LSD/LSD.Mixin.Touchable
|
18
19
|
- LSD/LSD.Mixin.Focusable
|
19
20
|
|
20
21
|
provides: [LSD.Widget.Select, LSD.Widget.Select.Button, LSD.Widget.Select.Option]
|
@@ -25,7 +26,7 @@ provides: [LSD.Widget.Select, LSD.Widget.Select.Button, LSD.Widget.Select.Option
|
|
25
26
|
LSD.Widget.Select = new Class({
|
26
27
|
options: {
|
27
28
|
tag: 'select',
|
28
|
-
pseudos: Array.
|
29
|
+
pseudos: Array.object('list', 'choice', 'focusable', 'value', 'form-associated'),
|
29
30
|
events: {
|
30
31
|
self: {
|
31
32
|
set: function(item) {
|
@@ -34,7 +35,7 @@ LSD.Widget.Select = new Class({
|
|
34
35
|
}
|
35
36
|
}
|
36
37
|
},
|
37
|
-
layout: Array.
|
38
|
+
layout: Array.object('::button'),
|
38
39
|
has: {
|
39
40
|
many: {
|
40
41
|
items: {
|
@@ -43,14 +44,14 @@ LSD.Widget.Select = new Class({
|
|
43
44
|
states: {
|
44
45
|
hover: 'chosen'
|
45
46
|
},
|
46
|
-
pseudos: Array.
|
47
|
+
pseudos: Array.object('clickable', 'hoverable', 'command')
|
47
48
|
}
|
48
49
|
},
|
49
50
|
one: {
|
50
51
|
menu: {
|
51
52
|
proxy: function(widget) {
|
52
53
|
if (!widget.pseudos.item) return;
|
53
|
-
if (!this.
|
54
|
+
// if (!this.selectedItems[0] || widget.pseudos.selected) widget.select()
|
54
55
|
return true;
|
55
56
|
}
|
56
57
|
},
|
@@ -68,7 +69,7 @@ LSD.Widget.Select.Button = LSD.Widget.Button;
|
|
68
69
|
LSD.Widget.Select.Option = new Class({
|
69
70
|
options: {
|
70
71
|
tag: 'option',
|
71
|
-
pseudos: Array.
|
72
|
+
pseudos: Array.object('item')
|
72
73
|
},
|
73
74
|
|
74
75
|
getTitle: function() {
|