native-document 1.0.288 → 1.0.290
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "native-document",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.290",
|
|
4
4
|
"description": "A reactive JavaScript framework that preserves native DOM simplicity without sacrificing modern features",
|
|
5
5
|
"author": "AfroCodeur <https://github.com/afrocodeur>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,6 +59,7 @@ export default function Dropdown(props = {}) {
|
|
|
59
59
|
render: null,
|
|
60
60
|
filter: null,
|
|
61
61
|
mapper: null,
|
|
62
|
+
arrow: null,
|
|
62
63
|
filterDependencies: null,
|
|
63
64
|
matchTriggerWidth: null,
|
|
64
65
|
matchTargetWidth: null,
|
|
@@ -95,6 +96,7 @@ Dropdown.defaultTemplate = null;
|
|
|
95
96
|
* mapper: ((item: *) => DropdownItem)|null,
|
|
96
97
|
* matchTriggerWidth: boolean|null,
|
|
97
98
|
* updatePositionOn: Observable<*>|null,
|
|
99
|
+
* arrow: boolean,
|
|
98
100
|
* includeTriggerIntoGhost: boolean,
|
|
99
101
|
* props: GlobalAttributes,
|
|
100
102
|
* }, instance: Dropdown) => NdChild} template
|
|
@@ -165,6 +167,12 @@ Dropdown.prototype.bind = function(source, mapper) {
|
|
|
165
167
|
return this;
|
|
166
168
|
};
|
|
167
169
|
|
|
170
|
+
Dropdown.prototype.arrow = function(arrow = true) {
|
|
171
|
+
this.$description.arrow = arrow;
|
|
172
|
+
return this;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
|
|
168
176
|
/**
|
|
169
177
|
* Alias for {@link Dropdown.prototype.bind}
|
|
170
178
|
*/
|
|
@@ -23,12 +23,13 @@ export type DropdownDescription = {
|
|
|
23
23
|
filter: ((item: DropdownItemInterface, query: string) => boolean) | null;
|
|
24
24
|
mapper: ((item: unknown) => DropdownItemInterface) | null;
|
|
25
25
|
matchTriggerWidth: boolean | null;
|
|
26
|
+
arrow: true,
|
|
26
27
|
updatePositionOn: ObservableItem<unknown> | null;
|
|
27
28
|
includeTriggerIntoGhost: boolean;
|
|
28
29
|
props: GlobalAttributes;
|
|
29
30
|
};
|
|
30
31
|
|
|
31
|
-
export interface DropdownInterface extends BaseComponent {
|
|
32
|
+
export interface DropdownInterface extends Omit<BaseComponent, 'onChange'> {
|
|
32
33
|
open(): this;
|
|
33
34
|
close(): this;
|
|
34
35
|
toggle(): this;
|
|
@@ -54,6 +55,7 @@ export interface DropdownInterface extends BaseComponent {
|
|
|
54
55
|
divider(): this;
|
|
55
56
|
select(value: unknown): this;
|
|
56
57
|
next(): this;
|
|
58
|
+
arrow(v: boolean): this;
|
|
57
59
|
preview(): this;
|
|
58
60
|
loopOnKeyboard(v: boolean): this;
|
|
59
61
|
onChange(handler: (value: unknown, item: DropdownItemInterface) => void): this;
|
|
@@ -10,9 +10,15 @@ export default function Slot(content) {
|
|
|
10
10
|
|
|
11
11
|
if(content) {
|
|
12
12
|
if(content.__$Observable) {
|
|
13
|
-
|
|
13
|
+
const currentValue = content.val();
|
|
14
|
+
currentValue && this.$anchor.setContent(currentValue);
|
|
15
|
+
|
|
14
16
|
content.subscribe((value) => {
|
|
15
|
-
|
|
17
|
+
if(!value) {
|
|
18
|
+
this.$anchor.removeChildren();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.$anchor.setContent(value);
|
|
16
22
|
});
|
|
17
23
|
return;
|
|
18
24
|
}
|