grainjs 1.0.1 → 1.1.0

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.
Files changed (146) hide show
  1. package/README.md +23 -26
  2. package/dist/cjs/index.js +28 -17
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/lib/PriorityQueue.d.ts +2 -2
  5. package/dist/cjs/lib/PriorityQueue.js +1 -0
  6. package/dist/cjs/lib/PriorityQueue.js.map +1 -1
  7. package/dist/cjs/lib/_computed_queue.js +4 -3
  8. package/dist/cjs/lib/_computed_queue.js.map +1 -1
  9. package/dist/cjs/lib/binding.d.ts +11 -4
  10. package/dist/cjs/lib/binding.js +6 -5
  11. package/dist/cjs/lib/binding.js.map +1 -1
  12. package/dist/cjs/lib/browserGlobals.d.ts +4 -1
  13. package/dist/cjs/lib/browserGlobals.js +2 -0
  14. package/dist/cjs/lib/browserGlobals.js.map +1 -1
  15. package/dist/cjs/lib/computed.d.ts +49 -28
  16. package/dist/cjs/lib/computed.js +38 -51
  17. package/dist/cjs/lib/computed.js.map +1 -1
  18. package/dist/cjs/lib/dispose.d.ts +109 -96
  19. package/dist/cjs/lib/dispose.js +106 -79
  20. package/dist/cjs/lib/dispose.js.map +1 -1
  21. package/dist/cjs/lib/dom.d.ts +40 -18
  22. package/dist/cjs/lib/dom.js +63 -29
  23. package/dist/cjs/lib/dom.js.map +1 -1
  24. package/dist/cjs/lib/domComponent.d.ts +56 -51
  25. package/dist/cjs/lib/domComponent.js +46 -44
  26. package/dist/cjs/lib/domComponent.js.map +1 -1
  27. package/dist/cjs/lib/domComputed.d.ts +50 -20
  28. package/dist/cjs/lib/domComputed.js +37 -7
  29. package/dist/cjs/lib/domComputed.js.map +1 -1
  30. package/dist/cjs/lib/domDispose.d.ts +27 -12
  31. package/dist/cjs/lib/domDispose.js +27 -11
  32. package/dist/cjs/lib/domDispose.js.map +1 -1
  33. package/dist/cjs/lib/domForEach.d.ts +5 -4
  34. package/dist/cjs/lib/domForEach.js +41 -41
  35. package/dist/cjs/lib/domForEach.js.map +1 -1
  36. package/dist/cjs/lib/domImpl.d.ts +33 -10
  37. package/dist/cjs/lib/domImpl.js +29 -9
  38. package/dist/cjs/lib/domImpl.js.map +1 -1
  39. package/dist/cjs/lib/domMethods.d.ts +93 -47
  40. package/dist/cjs/lib/domMethods.js +91 -47
  41. package/dist/cjs/lib/domMethods.js.map +1 -1
  42. package/dist/cjs/lib/domevent.d.ts +87 -62
  43. package/dist/cjs/lib/domevent.js +85 -59
  44. package/dist/cjs/lib/domevent.js.map +1 -1
  45. package/dist/cjs/lib/emit.d.ts +62 -32
  46. package/dist/cjs/lib/emit.js +68 -53
  47. package/dist/cjs/lib/emit.js.map +1 -1
  48. package/dist/cjs/lib/kowrap.d.ts +6 -3
  49. package/dist/cjs/lib/kowrap.js +7 -3
  50. package/dist/cjs/lib/kowrap.js.map +1 -1
  51. package/dist/cjs/lib/obsArray.d.ts +91 -53
  52. package/dist/cjs/lib/obsArray.js +87 -54
  53. package/dist/cjs/lib/obsArray.js.map +1 -1
  54. package/dist/cjs/lib/observable.d.ts +25 -15
  55. package/dist/cjs/lib/observable.js +31 -19
  56. package/dist/cjs/lib/observable.js.map +1 -1
  57. package/dist/cjs/lib/pureComputed.d.ts +12 -15
  58. package/dist/cjs/lib/pureComputed.js +16 -18
  59. package/dist/cjs/lib/pureComputed.js.map +1 -1
  60. package/dist/cjs/lib/styled.d.ts +78 -61
  61. package/dist/cjs/lib/styled.js +27 -79
  62. package/dist/cjs/lib/styled.js.map +1 -1
  63. package/dist/cjs/lib/subscribe.d.ts +41 -37
  64. package/dist/cjs/lib/subscribe.js +31 -39
  65. package/dist/cjs/lib/subscribe.js.map +1 -1
  66. package/dist/cjs/lib/util.js +2 -0
  67. package/dist/cjs/lib/util.js.map +1 -1
  68. package/dist/cjs/lib/widgets/input.d.ts +3 -1
  69. package/dist/cjs/lib/widgets/input.js +7 -4
  70. package/dist/cjs/lib/widgets/input.js.map +1 -1
  71. package/dist/cjs/lib/widgets/select.d.ts +4 -2
  72. package/dist/cjs/lib/widgets/select.js +8 -5
  73. package/dist/cjs/lib/widgets/select.js.map +1 -1
  74. package/dist/esm/lib/_computed_queue.js +3 -3
  75. package/dist/esm/lib/_computed_queue.js.map +1 -1
  76. package/dist/esm/lib/binding.js +2 -2
  77. package/dist/esm/lib/binding.js.map +1 -1
  78. package/dist/esm/lib/browserGlobals.js +1 -0
  79. package/dist/esm/lib/browserGlobals.js.map +1 -1
  80. package/dist/esm/lib/computed.js +36 -50
  81. package/dist/esm/lib/computed.js.map +1 -1
  82. package/dist/esm/lib/dispose.js +104 -78
  83. package/dist/esm/lib/dispose.js.map +1 -1
  84. package/dist/esm/lib/dom.js +40 -18
  85. package/dist/esm/lib/dom.js.map +1 -1
  86. package/dist/esm/lib/domComponent.js +45 -44
  87. package/dist/esm/lib/domComponent.js.map +1 -1
  88. package/dist/esm/lib/domComputed.js +32 -5
  89. package/dist/esm/lib/domComputed.js.map +1 -1
  90. package/dist/esm/lib/domDispose.js +26 -11
  91. package/dist/esm/lib/domDispose.js.map +1 -1
  92. package/dist/esm/lib/domForEach.js +40 -41
  93. package/dist/esm/lib/domForEach.js.map +1 -1
  94. package/dist/esm/lib/domImpl.js +26 -7
  95. package/dist/esm/lib/domImpl.js.map +1 -1
  96. package/dist/esm/lib/domMethods.js +77 -35
  97. package/dist/esm/lib/domMethods.js.map +1 -1
  98. package/dist/esm/lib/domevent.js +84 -59
  99. package/dist/esm/lib/domevent.js.map +1 -1
  100. package/dist/esm/lib/emit.js +67 -53
  101. package/dist/esm/lib/emit.js.map +1 -1
  102. package/dist/esm/lib/kowrap.js +5 -2
  103. package/dist/esm/lib/kowrap.js.map +1 -1
  104. package/dist/esm/lib/obsArray.js +82 -50
  105. package/dist/esm/lib/obsArray.js.map +1 -1
  106. package/dist/esm/lib/observable.js +26 -15
  107. package/dist/esm/lib/observable.js.map +1 -1
  108. package/dist/esm/lib/pureComputed.js +15 -18
  109. package/dist/esm/lib/pureComputed.js.map +1 -1
  110. package/dist/esm/lib/styled.js +24 -77
  111. package/dist/esm/lib/styled.js.map +1 -1
  112. package/dist/esm/lib/subscribe.js +27 -36
  113. package/dist/esm/lib/subscribe.js.map +1 -1
  114. package/dist/esm/lib/util.js +1 -0
  115. package/dist/esm/lib/util.js.map +1 -1
  116. package/dist/esm/lib/widgets/input.js +3 -1
  117. package/dist/esm/lib/widgets/input.js.map +1 -1
  118. package/dist/esm/lib/widgets/select.js +3 -1
  119. package/dist/esm/lib/widgets/select.js.map +1 -1
  120. package/dist/grain-full.debug.js +2138 -3052
  121. package/dist/grain-full.debug.js.map +7 -0
  122. package/dist/grain-full.min.js +6 -2
  123. package/dist/grain-full.min.js.map +7 -1
  124. package/lib/binding.ts +9 -2
  125. package/lib/browserGlobals.ts +3 -1
  126. package/lib/computed.ts +56 -56
  127. package/lib/dispose.ts +110 -85
  128. package/lib/dom.ts +41 -20
  129. package/lib/domComponent.ts +68 -70
  130. package/lib/domComputed.ts +66 -21
  131. package/lib/domDispose.ts +28 -11
  132. package/lib/domForEach.ts +13 -12
  133. package/lib/domImpl.ts +30 -7
  134. package/lib/domMethods.ts +101 -46
  135. package/lib/domevent.ts +86 -61
  136. package/lib/emit.ts +64 -50
  137. package/lib/kowrap.ts +5 -2
  138. package/lib/obsArray.ts +89 -54
  139. package/lib/observable.ts +26 -15
  140. package/lib/pureComputed.ts +16 -22
  141. package/lib/styled.ts +85 -71
  142. package/lib/subscribe.ts +41 -45
  143. package/lib/util.ts +1 -0
  144. package/lib/widgets/input.ts +3 -1
  145. package/lib/widgets/select.ts +3 -1
  146. package/package.json +48 -38
@@ -1,74 +1,109 @@
1
1
  import { BindableValue } from './binding';
2
2
  import { DomElementMethod, DomMethod, IAttrObj } from './domImpl';
3
3
  /**
4
- * Sets multiple attributes of a DOM element. The `attrs()` variant takes no `elem` argument.
4
+ * Sets multiple attributes of a DOM element.
5
5
  * Null and undefined values are omitted, and booleans are either omitted or set to empty string.
6
- * @param {Object} attrsObj: Object mapping attribute names to attribute values.
6
+ * @param attrsObj - Object mapping attribute names to attribute values.
7
7
  */
8
8
  export declare function attrsElem(elem: Element, attrsObj: IAttrObj): void;
9
+ /**
10
+ * Sets multiple attributes of a DOM element. Null and undefined values are omitted, and booleans
11
+ * are either omitted or set to empty string.
12
+ */
9
13
  export declare function attrs(attrsObj: IAttrObj): DomElementMethod;
10
14
  /**
11
15
  * Sets an attribute of a DOM element to the given value. Removes the attribute when the value is
12
- * null or undefined. The `attr()` variant takes no `elem` argument, and `attrValue` may be an
13
- * observable or function.
14
- * @param {Element} elem: The element to update.
15
- * @param {String} attrName: The name of the attribute to bind, e.g. 'href'.
16
- * @param {String|null} attrValue: The string value or null to remove the attribute.
16
+ * null or undefined.
17
+ * @param elem - The element to update.
18
+ * @param attrName - The name of the attribute to bind, e.g. 'href'.
19
+ * @param attrValue - The string value, or null or undefined to remove the attribute.
17
20
  */
18
- export declare function attrElem(elem: Element, attrName: string, attrValue: string | null): void;
19
- export declare function attr(attrName: string, attrValueObs: BindableValue<string>): DomElementMethod;
21
+ export declare function attrElem(elem: Element, attrName: string, attrValue: string | null | undefined): void;
22
+ /**
23
+ * Sets an attribute of a DOM element to the given value. Removes the attribute when the value is
24
+ * null or undefined.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * dom('a', dom.attr('href', urlObs))
29
+ * ```
30
+ */
31
+ export declare function attr(attrName: string, attrValueObs: BindableValue<string | null | undefined>): DomElementMethod;
20
32
  /**
21
33
  * Sets or removes a boolean attribute of a DOM element. According to the spec, empty string is a
22
34
  * valid true value for the attribute, and the false value is indicated by the attribute's absence.
23
- * The `boolAttr()` variant takes no `elem`, and `boolValue` may be an observable or function.
24
- * @param {Element} elem: The element to update.
25
- * @param {String} attrName: The name of the attribute to bind, e.g. 'checked'.
26
- * @param {Boolean} boolValue: Boolean value whether to set or unset the attribute.
35
+ * @param elem - The element to update.
36
+ * @param attrName - The name of the attribute to bind, e.g. 'checked'.
37
+ * @param boolValue - Boolean value whether to set or unset the attribute.
27
38
  */
28
39
  export declare function boolAttrElem(elem: Element, attrName: string, boolValue: boolean): void;
40
+ /**
41
+ * Dom-method that sets or removes a boolean attribute of a DOM element.
42
+ * @param attrName - The name of the attribute to bind, e.g. 'checked'.
43
+ * @param boolValueObs - Value, observable, or function for a whether to set or unset the attribute.
44
+ */
29
45
  export declare function boolAttr(attrName: string, boolValueObs: BindableValue<boolean>): DomElementMethod;
30
46
  /**
31
- * Adds a text node to the element. The `text()` variant takes no `elem`, and `value` may be an
32
- * observable or function.
33
- * @param {Element} elem: The element to update.
34
- * @param {String} value: The text value to add.
47
+ * Adds a text node to the element.
48
+ * @param elem - The element to update.
49
+ * @param value - The text value to add.
35
50
  */
36
51
  export declare function textElem(elem: Node, value: string): void;
52
+ /**
53
+ * Sets text content of a DOM element to a value that may be an observable or a function.
54
+ */
37
55
  export declare function text(valueObs: BindableValue<string>): DomMethod;
38
56
  /**
39
- * Sets a style property of a DOM element to the given value. The `style()` variant takes no
40
- * `elem`, and `value` may be an observable or function.
41
- * @param {Element} elem: The element to update.
42
- * @param {String} property: The name of the style property to update, e.g. 'fontWeight'.
43
- * @param {String} value: The value for the property.
57
+ * Sets a style property of a DOM element to the given value.
58
+ * @param elem - The element to update.
59
+ * @param property - The name of the style property to update, e.g. 'fontWeight'.
60
+ * @param value - The value for the property.
44
61
  */
45
62
  export declare function styleElem(elem: Element, property: string, value: string): void;
63
+ /**
64
+ * Sets a style property of a DOM element to the given value, which may be an observable or a
65
+ * function.
66
+ * @param property - The name of the style property to update, e.g. 'fontWeight'.
67
+ * @param value - The value for the property.
68
+ */
46
69
  export declare function style(property: string, valueObs: BindableValue<string>): DomElementMethod;
47
70
  /**
48
71
  * Sets the property of a DOM element to the given value.
49
- * The `prop()` variant takes no `elem`, and `value` may be an observable or function.
50
- * @param {Element} elem: The element to update.
51
- * @param {String} property: The name of the property to update, e.g. 'disabled'.
52
- * @param {Object} value: The value for the property.
72
+ * @param elem - The element to update.
73
+ * @param property - The name of the property to update, e.g. 'disabled'.
74
+ * @param value - The value for the property.
53
75
  */
54
76
  export declare function propElem<T>(elem: Node, property: string, value: T): void;
77
+ /**
78
+ * Sets the property of a DOM element to the given value, which may be an observable or a
79
+ * function.
80
+ * @param property - The name of the property to update, e.g. 'disabled'.
81
+ * @param value - The value for the property.
82
+ */
55
83
  export declare function prop<T>(property: string, valueObs: BindableValue<T>): DomMethod;
56
84
  /**
57
85
  * Shows or hides the element depending on a boolean value. Note that the element must be visible
58
86
  * initially (i.e. unsetting style.display should show it).
59
- * The `show()` variant takes no `elem`, and `boolValue` may be an observable or function.
60
- * @param {Element} elem: The element to update.
61
- * @param {Boolean} boolValue: True to show the element, false to hide it.
87
+ * @param elem - The element to update.
88
+ * @param boolValue - True to show the element, false to hide it.
62
89
  */
63
90
  export declare function showElem(elem: HTMLElement, boolValue: boolean): void;
91
+ /**
92
+ * Shows or hides the element depending on a boolean value, which may be an observable or a function.
93
+ * Note that the element must be visible by default (i.e. unsetting `style.display` should show it).
94
+ */
64
95
  export declare function show(boolValueObs: BindableValue<boolean>): DomElementMethod;
65
96
  /**
66
97
  * The opposite of show, hiding the element when boolValue is true.
67
- * The `hide()` variant takes no `elem`, and `boolValue` may be an observable or function.
68
- * @param {Element} elem: The element to update.
69
- * @param {Boolean} boolValue: True to hide the element, false to show it.
98
+ * @param elem - The element to update.
99
+ * @param boolValue - True to hide the element, false to show it.
70
100
  */
71
101
  export declare function hideElem(elem: HTMLElement, boolValue: boolean): void;
102
+ /**
103
+ * The opposite of show, hiding the element when boolValue is true. `boolValueObs` may be an
104
+ * observable or a function.
105
+ * Note that the element must be visible by default (i.e. unsetting `style.display` should show it).
106
+ */
72
107
  export declare function hide(boolValueObs: BindableValue<boolean>): DomElementMethod;
73
108
  /**
74
109
  * Sets or toggles the given css class className.
@@ -78,12 +113,13 @@ export declare function clsElem(elem: Element, className: string, boolValue?: bo
78
113
  * Sets or toggles a css class className. If className is an observable, it will be replaced when
79
114
  * the observable changes. If a plain string, then an optional second boolean observable may be
80
115
  * given, which will toggle it.
81
- *
82
- * dom.cls('foo') // Sets className 'foo'
83
- * dom.cls('foo', isFoo); // Toggles 'foo' className according to observable.
84
- * dom.cls('foo', (use) => use(isFoo)); // Toggles 'foo' className according to observable.
85
- * dom.cls(fooClass); // Sets className to the value of fooClass observable
86
- * dom.cls((use) => `prefix-${use(fooClass)}`); // Sets className to prefix- plus fooClass observable.
116
+ * ```ts
117
+ * dom.cls('foo') // Sets className 'foo'
118
+ * dom.cls('foo', isFoo); // Toggles 'foo' className according to observable.
119
+ * dom.cls('foo', (use) => use(isFoo)); // Toggles 'foo' className according to observable.
120
+ * dom.cls(fooClass); // Sets className to the value of fooClass observable
121
+ * dom.cls((use) => `prefix-${use(fooClass)}`); // Sets className to prefix- plus fooClass observable.
122
+ * ```
87
123
  */
88
124
  export declare function cls(className: string, boolValue?: BindableValue<boolean>): DomElementMethod;
89
125
  export declare function cls(className: BindableValue<string>): DomElementMethod;
@@ -93,19 +129,26 @@ export declare function cls(className: BindableValue<string>): DomElementMethod;
93
129
  export declare function clsPrefix(prefix: string, className: string, boolValue?: BindableValue<boolean>): DomElementMethod;
94
130
  export declare function clsPrefix(prefix: string, className: BindableValue<string>): DomElementMethod;
95
131
  /**
96
- * Associate arbitrary data with a DOM element. The `data()` variant takes no `elem`, and `value`
97
- * may be an observable or function.
98
- * @param {Element} elem: The element with which to associate data.
99
- * @param {String} key: Key to identify this piece of data among others attached to elem.
100
- * @param {Object} value: Arbitrary value to associate with elem.
132
+ * Associate arbitrary data with a DOM element.
133
+ * @param elem - The element with which to associate data.
134
+ * @param key - Key to identify this piece of data among others attached to elem.
135
+ * @param value - Arbitrary value to associate with elem.
101
136
  */
102
137
  export declare function dataElem(elem: Node, key: string, value: any): void;
138
+ /**
139
+ * Associate arbitrary data with a DOM element: `value` may be an observable or a function.
140
+ * @param key - Key to identify this piece of data among others attached to elem.
141
+ * @param value - Arbitrary value to associate with elem.
142
+ */
103
143
  export declare function data(key: string, valueObs: BindableValue<any>): DomMethod;
144
+ /**
145
+ * Retrieve data associated with a DOM element using `data()` or `dataElem()`.
146
+ */
104
147
  export declare function getData(elem: Node, key: string): any;
105
148
  /**
106
149
  * A very simple setup to identify DOM elements for testing purposes. Here's the recommended
107
150
  * usage.
108
- *
151
+ * ```ts
109
152
  * // In the component to be tested.
110
153
  * import {noTestId, TestId} from 'grainjs';
111
154
  *
@@ -114,22 +157,25 @@ export declare function getData(elem: Node, key: string): any;
114
157
  * dom(..., testId("another-name"), ...),
115
158
  * );
116
159
  * }
160
+ * ```
117
161
  *
118
162
  * In the fixture code using this component:
119
- *
163
+ * ```ts
120
164
  * import {makeTestId} from 'grainjs';
121
165
  *
122
166
  * dom(..., myComponent(myArgs, makeTestId('test-mycomp-'), ...)
167
+ * ```
123
168
  *
124
169
  * In the webdriver test code:
125
- *
170
+ * ```ts
126
171
  * driver.find('.test-my-comp-some-name')
127
172
  * driver.find('.test-my-comp-another-name')
173
+ * ```
128
174
  *
129
175
  * When myComponent() is created with testId argument omitted, the testId() calls are no-ops. When
130
176
  * makeTestId('test-foo-') is passed in, testId() calls simply add a css class with that prefix.
131
177
  */
132
- export declare type TestId = (name: string) => DomElementMethod | null;
178
+ export type TestId = (name: string) => DomElementMethod | null;
133
179
  /**
134
180
  * See documentation for TestId above.
135
181
  */
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.noTestId = exports.makeTestId = exports.getData = exports.data = exports.dataElem = exports.clsPrefix = exports.cls = exports.clsElem = exports.hide = exports.hideElem = exports.show = exports.showElem = exports.prop = exports.propElem = exports.style = exports.styleElem = exports.text = exports.textElem = exports.boolAttr = exports.boolAttrElem = exports.attr = exports.attrElem = exports.attrs = exports.attrsElem = void 0;
3
4
  const binding_1 = require("./binding");
4
5
  const domDispose_1 = require("./domDispose");
5
6
  // Use the browser globals in a way that allows replacing them with mocks in tests.
@@ -10,9 +11,9 @@ const browserGlobals_1 = require("./browserGlobals");
10
11
  */
11
12
  const _dataMap = new WeakMap();
12
13
  /**
13
- * Sets multiple attributes of a DOM element. The `attrs()` variant takes no `elem` argument.
14
+ * Sets multiple attributes of a DOM element.
14
15
  * Null and undefined values are omitted, and booleans are either omitted or set to empty string.
15
- * @param {Object} attrsObj: Object mapping attribute names to attribute values.
16
+ * @param attrsObj - Object mapping attribute names to attribute values.
16
17
  */
17
18
  function attrsElem(elem, attrsObj) {
18
19
  for (const key of Object.keys(attrsObj)) {
@@ -23,17 +24,20 @@ function attrsElem(elem, attrsObj) {
23
24
  }
24
25
  }
25
26
  exports.attrsElem = attrsElem;
27
+ /**
28
+ * Sets multiple attributes of a DOM element. Null and undefined values are omitted, and booleans
29
+ * are either omitted or set to empty string.
30
+ */
26
31
  function attrs(attrsObj) {
27
32
  return (elem) => attrsElem(elem, attrsObj);
28
33
  }
29
34
  exports.attrs = attrs;
30
35
  /**
31
36
  * Sets an attribute of a DOM element to the given value. Removes the attribute when the value is
32
- * null or undefined. The `attr()` variant takes no `elem` argument, and `attrValue` may be an
33
- * observable or function.
34
- * @param {Element} elem: The element to update.
35
- * @param {String} attrName: The name of the attribute to bind, e.g. 'href'.
36
- * @param {String|null} attrValue: The string value or null to remove the attribute.
37
+ * null or undefined.
38
+ * @param elem - The element to update.
39
+ * @param attrName - The name of the attribute to bind, e.g. 'href'.
40
+ * @param attrValue - The string value, or null or undefined to remove the attribute.
37
41
  */
38
42
  function attrElem(elem, attrName, attrValue) {
39
43
  if (attrValue === null || attrValue === undefined) {
@@ -44,101 +48,133 @@ function attrElem(elem, attrName, attrValue) {
44
48
  }
45
49
  }
46
50
  exports.attrElem = attrElem;
51
+ /**
52
+ * Sets an attribute of a DOM element to the given value. Removes the attribute when the value is
53
+ * null or undefined.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * dom('a', dom.attr('href', urlObs))
58
+ * ```
59
+ */
47
60
  function attr(attrName, attrValueObs) {
48
- return (elem) => binding_1.subscribeElem(elem, attrValueObs, (val) => attrElem(elem, attrName, val));
61
+ return (elem) => (0, binding_1.subscribeElem)(elem, attrValueObs, (val) => attrElem(elem, attrName, val));
49
62
  }
50
63
  exports.attr = attr;
51
64
  /**
52
65
  * Sets or removes a boolean attribute of a DOM element. According to the spec, empty string is a
53
66
  * valid true value for the attribute, and the false value is indicated by the attribute's absence.
54
- * The `boolAttr()` variant takes no `elem`, and `boolValue` may be an observable or function.
55
- * @param {Element} elem: The element to update.
56
- * @param {String} attrName: The name of the attribute to bind, e.g. 'checked'.
57
- * @param {Boolean} boolValue: Boolean value whether to set or unset the attribute.
67
+ * @param elem - The element to update.
68
+ * @param attrName - The name of the attribute to bind, e.g. 'checked'.
69
+ * @param boolValue - Boolean value whether to set or unset the attribute.
58
70
  */
59
71
  function boolAttrElem(elem, attrName, boolValue) {
60
72
  attrElem(elem, attrName, boolValue ? '' : null);
61
73
  }
62
74
  exports.boolAttrElem = boolAttrElem;
75
+ /**
76
+ * Dom-method that sets or removes a boolean attribute of a DOM element.
77
+ * @param attrName - The name of the attribute to bind, e.g. 'checked'.
78
+ * @param boolValueObs - Value, observable, or function for a whether to set or unset the attribute.
79
+ */
63
80
  function boolAttr(attrName, boolValueObs) {
64
- return (elem) => binding_1.subscribeElem(elem, boolValueObs, (val) => boolAttrElem(elem, attrName, val));
81
+ return (elem) => (0, binding_1.subscribeElem)(elem, boolValueObs, (val) => boolAttrElem(elem, attrName, val));
65
82
  }
66
83
  exports.boolAttr = boolAttr;
67
84
  /**
68
- * Adds a text node to the element. The `text()` variant takes no `elem`, and `value` may be an
69
- * observable or function.
70
- * @param {Element} elem: The element to update.
71
- * @param {String} value: The text value to add.
85
+ * Adds a text node to the element.
86
+ * @param elem - The element to update.
87
+ * @param value - The text value to add.
72
88
  */
73
89
  function textElem(elem, value) {
74
90
  elem.appendChild(browserGlobals_1.G.document.createTextNode(value));
75
91
  }
76
92
  exports.textElem = textElem;
93
+ /**
94
+ * Sets text content of a DOM element to a value that may be an observable or a function.
95
+ */
77
96
  function text(valueObs) {
78
97
  return (elem) => {
79
98
  const textNode = browserGlobals_1.G.document.createTextNode('');
80
- binding_1.subscribeElem(elem, valueObs, (val) => { textNode.nodeValue = val; });
99
+ (0, binding_1.subscribeElem)(elem, valueObs, (val) => { textNode.nodeValue = val; });
81
100
  elem.appendChild(textNode);
82
101
  };
83
102
  }
84
103
  exports.text = text;
85
104
  /**
86
- * Sets a style property of a DOM element to the given value. The `style()` variant takes no
87
- * `elem`, and `value` may be an observable or function.
88
- * @param {Element} elem: The element to update.
89
- * @param {String} property: The name of the style property to update, e.g. 'fontWeight'.
90
- * @param {String} value: The value for the property.
105
+ * Sets a style property of a DOM element to the given value.
106
+ * @param elem - The element to update.
107
+ * @param property - The name of the style property to update, e.g. 'fontWeight'.
108
+ * @param value - The value for the property.
91
109
  */
92
110
  function styleElem(elem, property, value) {
93
111
  elem.style[property] = value;
94
112
  }
95
113
  exports.styleElem = styleElem;
114
+ /**
115
+ * Sets a style property of a DOM element to the given value, which may be an observable or a
116
+ * function.
117
+ * @param property - The name of the style property to update, e.g. 'fontWeight'.
118
+ * @param value - The value for the property.
119
+ */
96
120
  function style(property, valueObs) {
97
- return (elem) => binding_1.subscribeElem(elem, valueObs, (val) => styleElem(elem, property, val));
121
+ return (elem) => (0, binding_1.subscribeElem)(elem, valueObs, (val) => styleElem(elem, property, val));
98
122
  }
99
123
  exports.style = style;
100
124
  /**
101
125
  * Sets the property of a DOM element to the given value.
102
- * The `prop()` variant takes no `elem`, and `value` may be an observable or function.
103
- * @param {Element} elem: The element to update.
104
- * @param {String} property: The name of the property to update, e.g. 'disabled'.
105
- * @param {Object} value: The value for the property.
126
+ * @param elem - The element to update.
127
+ * @param property - The name of the property to update, e.g. 'disabled'.
128
+ * @param value - The value for the property.
106
129
  */
107
130
  function propElem(elem, property, value) {
108
131
  elem[property] = value;
109
132
  }
110
133
  exports.propElem = propElem;
134
+ /**
135
+ * Sets the property of a DOM element to the given value, which may be an observable or a
136
+ * function.
137
+ * @param property - The name of the property to update, e.g. 'disabled'.
138
+ * @param value - The value for the property.
139
+ */
111
140
  function prop(property, valueObs) {
112
- return (elem) => binding_1.subscribeElem(elem, valueObs, (val) => propElem(elem, property, val));
141
+ return (elem) => (0, binding_1.subscribeElem)(elem, valueObs, (val) => propElem(elem, property, val));
113
142
  }
114
143
  exports.prop = prop;
115
144
  /**
116
145
  * Shows or hides the element depending on a boolean value. Note that the element must be visible
117
146
  * initially (i.e. unsetting style.display should show it).
118
- * The `show()` variant takes no `elem`, and `boolValue` may be an observable or function.
119
- * @param {Element} elem: The element to update.
120
- * @param {Boolean} boolValue: True to show the element, false to hide it.
147
+ * @param elem - The element to update.
148
+ * @param boolValue - True to show the element, false to hide it.
121
149
  */
122
150
  function showElem(elem, boolValue) {
123
151
  elem.style.display = boolValue ? '' : 'none';
124
152
  }
125
153
  exports.showElem = showElem;
154
+ /**
155
+ * Shows or hides the element depending on a boolean value, which may be an observable or a function.
156
+ * Note that the element must be visible by default (i.e. unsetting `style.display` should show it).
157
+ */
126
158
  function show(boolValueObs) {
127
- return (elem) => binding_1.subscribeElem(elem, boolValueObs, (val) => showElem(elem, val));
159
+ return (elem) => (0, binding_1.subscribeElem)(elem, boolValueObs, (val) => showElem(elem, val));
128
160
  }
129
161
  exports.show = show;
130
162
  /**
131
163
  * The opposite of show, hiding the element when boolValue is true.
132
- * The `hide()` variant takes no `elem`, and `boolValue` may be an observable or function.
133
- * @param {Element} elem: The element to update.
134
- * @param {Boolean} boolValue: True to hide the element, false to show it.
164
+ * @param elem - The element to update.
165
+ * @param boolValue - True to hide the element, false to show it.
135
166
  */
136
167
  function hideElem(elem, boolValue) {
137
168
  elem.style.display = boolValue ? 'none' : '';
138
169
  }
139
170
  exports.hideElem = hideElem;
171
+ /**
172
+ * The opposite of show, hiding the element when boolValue is true. `boolValueObs` may be an
173
+ * observable or a function.
174
+ * Note that the element must be visible by default (i.e. unsetting `style.display` should show it).
175
+ */
140
176
  function hide(boolValueObs) {
141
- return (elem) => binding_1.subscribeElem(elem, boolValueObs, (val) => hideElem(elem, val));
177
+ return (elem) => (0, binding_1.subscribeElem)(elem, boolValueObs, (val) => hideElem(elem, val));
142
178
  }
143
179
  exports.hide = hide;
144
180
  /**
@@ -156,7 +192,7 @@ function cls(className, boolValue) {
156
192
  return (elem) => clsElem(elem, className, boolValue);
157
193
  }
158
194
  else {
159
- return (elem) => binding_1.subscribeElem(elem, boolValue, (val) => clsElem(elem, className, val));
195
+ return (elem) => (0, binding_1.subscribeElem)(elem, boolValue, (val) => clsElem(elem, className, val));
160
196
  }
161
197
  }
162
198
  exports.cls = cls;
@@ -172,7 +208,7 @@ exports.clsPrefix = clsPrefix;
172
208
  function _clsDynamicPrefix(prefix, className) {
173
209
  return (elem) => {
174
210
  let prevClass = null;
175
- binding_1.subscribeElem(elem, className, (name) => {
211
+ (0, binding_1.subscribeElem)(elem, className, (name) => {
176
212
  if (prevClass) {
177
213
  elem.classList.remove(prevClass);
178
214
  }
@@ -184,11 +220,10 @@ function _clsDynamicPrefix(prefix, className) {
184
220
  };
185
221
  }
186
222
  /**
187
- * Associate arbitrary data with a DOM element. The `data()` variant takes no `elem`, and `value`
188
- * may be an observable or function.
189
- * @param {Element} elem: The element with which to associate data.
190
- * @param {String} key: Key to identify this piece of data among others attached to elem.
191
- * @param {Object} value: Arbitrary value to associate with elem.
223
+ * Associate arbitrary data with a DOM element.
224
+ * @param elem - The element with which to associate data.
225
+ * @param key - Key to identify this piece of data among others attached to elem.
226
+ * @param value - Arbitrary value to associate with elem.
192
227
  */
193
228
  function dataElem(elem, key, value) {
194
229
  const obj = _dataMap.get(elem);
@@ -196,15 +231,23 @@ function dataElem(elem, key, value) {
196
231
  obj[key] = value;
197
232
  }
198
233
  else {
199
- domDispose_1.onDisposeElem(elem, () => _dataMap.delete(elem));
234
+ (0, domDispose_1.onDisposeElem)(elem, () => _dataMap.delete(elem));
200
235
  _dataMap.set(elem, { [key]: value });
201
236
  }
202
237
  }
203
238
  exports.dataElem = dataElem;
239
+ /**
240
+ * Associate arbitrary data with a DOM element: `value` may be an observable or a function.
241
+ * @param key - Key to identify this piece of data among others attached to elem.
242
+ * @param value - Arbitrary value to associate with elem.
243
+ */
204
244
  function data(key, valueObs) {
205
- return (elem) => binding_1.subscribeElem(elem, valueObs, (val) => dataElem(elem, key, val));
245
+ return (elem) => (0, binding_1.subscribeElem)(elem, valueObs, (val) => dataElem(elem, key, val));
206
246
  }
207
247
  exports.data = data;
248
+ /**
249
+ * Retrieve data associated with a DOM element using `data()` or `dataElem()`.
250
+ */
208
251
  function getData(elem, key) {
209
252
  const obj = _dataMap.get(elem);
210
253
  return obj && obj[key];
@@ -220,5 +263,6 @@ exports.makeTestId = makeTestId;
220
263
  /**
221
264
  * See documentation for TestId above.
222
265
  */
223
- exports.noTestId = (name) => null;
266
+ const noTestId = (name) => null;
267
+ exports.noTestId = noTestId;
224
268
  //# sourceMappingURL=domMethods.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"domMethods.js","sourceRoot":"","sources":["../../../lib/domMethods.ts"],"names":[],"mappings":";;AAAA,uCAAqE;AACrE,6CAA2C;AAG3C,mFAAmF;AACnF,qDAAmC;AAEnC;;;GAGG;AACH,MAAM,QAAQ,GAAwC,IAAI,OAAO,EAAE,CAAC;AAEpE;;;;GAIG;AACH,SAAgB,SAAS,CAAC,IAAa,EAAE,QAAkB;IACzD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;QACvC,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,KAAK,KAAK,EAAE;YAChC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;SACjD;KACF;AACH,CAAC;AAPD,8BAOC;AACD,SAA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