@cntwg/html-ctrls-lists 0.0.30 → 0.0.31
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/CHANGELOG.md +12 -0
- package/doc/html-ctrls-list.md +179 -127
- package/lib/list.js +35 -7
- package/lib/mod-hfunc.js +1 -30
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
#### *v0.0.31*
|
|
2
|
+
|
|
3
|
+
Pre-release version.
|
|
4
|
+
|
|
5
|
+
> - update `html-ctrls-list.md`;
|
|
6
|
+
> - update dependency on `@ygracs/lists-lib-js` module to v0.2.0;
|
|
7
|
+
> - update dependency on `@cntwg/html-helper` module to v0.1.3;
|
|
8
|
+
> - update dependency on `@cntwg/html-ctrls-buttons` module to v0.1.0;
|
|
9
|
+
> - (THtmlItemsListContainer) add method: `checkIndex`, `tryIndex`;
|
|
10
|
+
> - (THtmlItemsListContainer) deprecate method: `chkIndex`, `chkIndexEx`;
|
|
11
|
+
> - some fixes.
|
|
12
|
+
|
|
1
13
|
#### *v0.0.30*
|
|
2
14
|
|
|
3
15
|
Pre-release version.
|
package/doc/html-ctrls-list.md
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
>|***rev.*:**|0.1.
|
|
1
|
+
>|***rev.*:**|0.1.25|
|
|
2
2
|
>|:---|---:|
|
|
3
|
-
>|date:|
|
|
3
|
+
>|date:|2026-04-18|
|
|
4
4
|
|
|
5
5
|
## Introduction
|
|
6
6
|
|
|
7
7
|
This paper describes a classes provided by `list.js`, `lists-stubs.js` and `lists-btn.js` of `html-ctrls` sub-module.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Content
|
|
10
|
+
|
|
11
|
+
- Classes
|
|
12
|
+
- <a href="#THtmlItemsListContainer">THtmlItemsListContainer</a>
|
|
13
|
+
- <a href="#THtmlItemsListController">THtmlItemsListController</a>
|
|
14
|
+
- <a href="#THtmlListButtonsController">THtmlListButtonsController</a>
|
|
15
|
+
- <a href="#THtmlStubItemsSet">THtmlStubItemsSet</a>
|
|
16
|
+
|
|
17
|
+
### Base type definitions
|
|
18
|
+
|
|
19
|
+
This section contains some definitions for a general types of the objects (e.g. options set) that frequently used in a function or a class method descriptions.
|
|
20
|
+
|
|
21
|
+
### Module classes
|
|
10
22
|
|
|
11
23
|
<a name="THtmlItemsListContainer"></a>
|
|
12
|
-
|
|
24
|
+
#### **THtmlItemsListContainer**
|
|
13
25
|
|
|
14
26
|
This class provide a base container useful when dealing with a list elements placed on an HTML-form.
|
|
15
27
|
|
|
16
|
-
|
|
28
|
+
##### class constructor
|
|
17
29
|
|
|
18
30
|
The class constructor creates a new instance of the class.
|
|
19
31
|
|
|
20
|
-
|
|
32
|
+
###### constructor parameters
|
|
21
33
|
|
|
22
34
|
The class constructor receives a parameters listed below:
|
|
23
35
|
|
|
@@ -26,7 +38,7 @@ The class constructor receives a parameters listed below:
|
|
|
26
38
|
| `host` | `HTMLElement` | `undefined` | points to a host element which holds a list items |
|
|
27
39
|
| `options` | `object` | --- | contains a container settings |
|
|
28
40
|
|
|
29
|
-
|
|
41
|
+
###### ***`options` parameter***
|
|
30
42
|
|
|
31
43
|
The `options` structure has listed below:
|
|
32
44
|
|
|
@@ -36,85 +48,103 @@ The `options` structure has listed below:
|
|
|
36
48
|
| `markCurrentItem` | `boolean` | `false` |alters behavior of the `setCurIndex` class method. If set to `true`, the item which was added to a container members will be automatically marked as current |
|
|
37
49
|
| `itemBaseClassID` | `string`, `string[]` | --- | alters behavior of the `addItem` class method. It accepts value of a string or an array of strings. For more see description of an `addItem` method |
|
|
38
50
|
|
|
39
|
-
|
|
51
|
+
##### class properties
|
|
40
52
|
|
|
41
53
|
<a name="THtmlItemsListContainer+count"></a>
|
|
42
|
-
|
|
54
|
+
###### **count**
|
|
43
55
|
|
|
44
56
|
| property type | read only | description |
|
|
45
57
|
|---|---|:---|
|
|
46
58
|
| `number` | yes | contains a quantity of the elements the container holds |
|
|
47
59
|
|
|
48
60
|
<a name="THtmlItemsListContainer+curIndex"></a>
|
|
49
|
-
|
|
61
|
+
###### **curIndex**
|
|
50
62
|
|
|
51
63
|
| property type | read only | description |
|
|
52
64
|
|---|---|:---|
|
|
53
65
|
| `number` | yes | represents an index of the current element |
|
|
54
66
|
|
|
55
67
|
<a name="THtmlItemsListContainer+minIndex"></a>
|
|
56
|
-
|
|
68
|
+
###### **minIndex**
|
|
57
69
|
|
|
58
70
|
| property type | read only | description |
|
|
59
71
|
|---|---|:---|
|
|
60
72
|
| `number` | yes | represents a minimum possible index for an element inside the container |
|
|
61
73
|
|
|
62
74
|
<a name="THtmlItemsListContainer+maxIndex"></a>
|
|
63
|
-
|
|
75
|
+
###### **maxIndex**
|
|
64
76
|
|
|
65
77
|
| property type | read only | description |
|
|
66
78
|
|---|---|:---|
|
|
67
79
|
| `number` | yes | represents a maximum possible index for an element inside the container |
|
|
68
80
|
|
|
69
81
|
<a name="THtmlItemsListContainer+prevIndex"></a>
|
|
70
|
-
|
|
82
|
+
###### **prevIndex**
|
|
71
83
|
|
|
72
84
|
| property type | read only | description |
|
|
73
85
|
|---|---|:---|
|
|
74
86
|
| `number` | yes | represents an index of the previous element before the current |
|
|
75
87
|
|
|
76
88
|
<a name="THtmlItemsListContainer+nextIndex"></a>
|
|
77
|
-
|
|
89
|
+
###### **nextIndex**
|
|
78
90
|
|
|
79
91
|
| property type | read only | description |
|
|
80
92
|
|---|---|:---|
|
|
81
93
|
| `number` | yes | represents an index of the next element after the current |
|
|
82
94
|
|
|
83
95
|
<a name="THtmlItemsListContainer+curItem"></a>
|
|
84
|
-
|
|
96
|
+
###### **curItem**
|
|
85
97
|
|
|
86
98
|
| property type | read only | description |
|
|
87
99
|
|---|---|:---|
|
|
88
100
|
| `?HTMLElement` | yes | represents an element addressed by the `curIndex` |
|
|
89
101
|
|
|
90
|
-
|
|
102
|
+
##### class methods
|
|
91
103
|
|
|
92
104
|
<a name="THtmlItemsListContainer+clear"></a>
|
|
93
|
-
|
|
105
|
+
###### **clear()** => `void`
|
|
94
106
|
|
|
95
107
|
This method deletes all items that holds by the container.
|
|
96
108
|
|
|
97
109
|
<a name="THtmlItemsListContainer+isEmpty"></a>
|
|
98
|
-
|
|
110
|
+
###### **isEmpty()** => `boolean`
|
|
99
111
|
|
|
100
112
|
This method returns `true` if the container has no items.
|
|
101
113
|
|
|
102
114
|
<a name="THtmlItemsListContainer+isNotEmpty"></a>
|
|
103
|
-
|
|
115
|
+
###### **isNotEmpty()** => `boolean`
|
|
104
116
|
|
|
105
117
|
This method returns `true` if the container has at least one item.
|
|
106
118
|
|
|
107
119
|
<a name="THtmlItemsListContainer+chkIndex"></a>
|
|
108
|
-
|
|
120
|
+
###### **chkIndex(value)** => `boolean`
|
|
121
|
+
|
|
122
|
+
> WARNING: \[since `v0.0.3x`] this method deprecated (*use [`checkIndex`](#THtmlItemsListContainer+checkIndex) method instead*).
|
|
123
|
+
|
|
124
|
+
<a name="THtmlItemsListContainer+checkIndex"></a>
|
|
125
|
+
###### **checkIndex(value)** => `boolean`
|
|
126
|
+
|
|
127
|
+
> since: \[`v0.0.3x`]
|
|
128
|
+
|
|
129
|
+
This method checks if the given `value` represents a valid index value and fits the range of all possible indexes belonging to the list instance. If so `true` is returned.
|
|
130
|
+
|
|
131
|
+
| parameter name | value type | default value | description |
|
|
132
|
+
|:---|---|---:|:---|
|
|
133
|
+
| `value` | `number` or `string` | --- | a value to be verified |
|
|
134
|
+
|
|
135
|
+
<a name="THtmlItemsListContainer+tryIndex"></a>
|
|
136
|
+
###### **tryIndex(value)** => `number`
|
|
109
137
|
|
|
110
|
-
|
|
138
|
+
> since: \[`v0.0.3x`]
|
|
139
|
+
|
|
140
|
+
This method evaluates whether the given `value` represents a valid index value and fits the range of all possible indexes belonging to the list instance. If so an index value returned. If failed a `-1` will be returned.
|
|
111
141
|
|
|
112
142
|
| parameter name | value type | default value | description |
|
|
113
143
|
|:---|---|---:|:---|
|
|
114
144
|
| `value` | `any` | --- | a value to be verified |
|
|
115
145
|
|
|
116
146
|
<a name="THtmlItemsListContainer+chkIndexEx"></a>
|
|
117
|
-
|
|
147
|
+
###### **chkIndexEx(value\[, mode])** => `boolean`\|`number`
|
|
118
148
|
|
|
119
149
|
This method is similar to a `chkIndex` methods but receives a `mode` parameter which allow to choose what a type of the result the method returns.
|
|
120
150
|
|
|
@@ -129,8 +159,10 @@ The `mode` parameter treats as follows:
|
|
|
129
159
|
- if set to `true`, the result returned by the method is an index;
|
|
130
160
|
- if not given or has a type of not a `boolean`, the default value is used.
|
|
131
161
|
|
|
162
|
+
> WARNING: \[since `v0.0.3x`] this method deprecated (*use [`checkIndex`](#THtmlItemsListContainer+checkIndex) or [`tryIndex`](#THtmlItemsListContainer+tryIndex) method instead*).
|
|
163
|
+
|
|
132
164
|
<a name="THtmlItemsListContainer+srchIndex"></a>
|
|
133
|
-
|
|
165
|
+
###### **srchIndex(item)** => `number`
|
|
134
166
|
|
|
135
167
|
This method tries to find a given item in the list and if it is found returns its index.
|
|
136
168
|
|
|
@@ -139,7 +171,7 @@ This method tries to find a given item in the list and if it is found returns it
|
|
|
139
171
|
| `item` | `?HTMLElement` | --- | an element to search |
|
|
140
172
|
|
|
141
173
|
<a name="THtmlItemsListContainer+srchIndexByAttr"></a>
|
|
142
|
-
|
|
174
|
+
###### **srchIndexByAttr(name, value)** => `number`
|
|
143
175
|
|
|
144
176
|
This method tries to find an item that has an attribute with a given `name` and `value` in the list and if it is found its index is returned.
|
|
145
177
|
|
|
@@ -153,7 +185,7 @@ The `value` can be a `boolean`, `number` or a `string`. If it is not given the e
|
|
|
153
185
|
> Note: In case when a `value` is an empty string the method will accept any item with an attribute which name is equal to a given `name` regardless of a value such attribute has.
|
|
154
186
|
|
|
155
187
|
<a name="THtmlItemsListContainer+srchIndexByID"></a>
|
|
156
|
-
|
|
188
|
+
###### **srchIndexByID(value)** => `number`
|
|
157
189
|
|
|
158
190
|
This method tries to find an item by its `ID`-attribute in the list and if it is found returns its index (*see description of `srchIndexByAttr` method for details how a `value` parameter is used*).
|
|
159
191
|
|
|
@@ -162,7 +194,7 @@ This method tries to find an item by its `ID`-attribute in the list and if it is
|
|
|
162
194
|
| `value` | `string` | --- | an ID value |
|
|
163
195
|
|
|
164
196
|
<a name="THtmlItemsListContainer+setCurIndex"></a>
|
|
165
|
-
|
|
197
|
+
###### **setCurIndex(index)** => `boolean`
|
|
166
198
|
|
|
167
199
|
This method sets a current item index in the list. If succeed `true` is returned.
|
|
168
200
|
|
|
@@ -171,12 +203,12 @@ This method sets a current item index in the list. If succeed `true` is returned
|
|
|
171
203
|
| `index` | `number`, `string` | --- | an element index |
|
|
172
204
|
|
|
173
205
|
<a name="THtmlItemsListContainer+rstCurIndex"></a>
|
|
174
|
-
|
|
206
|
+
###### **rstCurIndex()** => `void`
|
|
175
207
|
|
|
176
208
|
This method resets a current element index in the list.
|
|
177
209
|
|
|
178
210
|
<a name="THtmlItemsListContainer+getItem"></a>
|
|
179
|
-
|
|
211
|
+
###### **getItem(index)** => `?HTMLElement`
|
|
180
212
|
|
|
181
213
|
This method returns an element addressed by a given `index`.
|
|
182
214
|
|
|
@@ -185,7 +217,7 @@ This method returns an element addressed by a given `index`.
|
|
|
185
217
|
| `index` | `number`, `string` | --- | an element index |
|
|
186
218
|
|
|
187
219
|
<a name="THtmlItemsListContainer+getItemByAttr"></a>
|
|
188
|
-
|
|
220
|
+
###### **getItemByAttr(name, value)** => `?HTMLElement`
|
|
189
221
|
|
|
190
222
|
This method tries to find an item by its given attribute in the list and if found returns it (*see description of `srchIndexByAttr` method for details how a `value` parameter is used*).
|
|
191
223
|
|
|
@@ -195,7 +227,7 @@ This method tries to find an item by its given attribute in the list and if foun
|
|
|
195
227
|
| `value` | `any` | --- | an attribute value |
|
|
196
228
|
|
|
197
229
|
<a name="THtmlItemsListContainer+getItemByID"></a>
|
|
198
|
-
|
|
230
|
+
###### **getItemByID(value)** => `?HTMLElement`
|
|
199
231
|
|
|
200
232
|
This method tries to find an item by its `ID`-attribute in the list and if found returns it (*see description of `srchIndexByAttr` method for details how a `value` parameter is used*).
|
|
201
233
|
|
|
@@ -204,7 +236,7 @@ This method tries to find an item by its `ID`-attribute in the list and if found
|
|
|
204
236
|
| `value` | `string` | --- | an ID value |
|
|
205
237
|
|
|
206
238
|
<a name="THtmlItemsListContainer+addItem"></a>
|
|
207
|
-
|
|
239
|
+
###### **addItem(item\[, options])** => `number`
|
|
208
240
|
|
|
209
241
|
This method adds a given item to a container members and if succeed returns its index.
|
|
210
242
|
|
|
@@ -218,7 +250,7 @@ If `options` parameter is given and is set to `true`, in case of success, the `c
|
|
|
218
250
|
If `itemBaseClassID` option of the container is set, the method will applied a value given by this option as a `class` attribute of an item which was successfully added.
|
|
219
251
|
|
|
220
252
|
<a name="THtmlItemsListContainer+delItem"></a>
|
|
221
|
-
|
|
253
|
+
###### **delItem(index\[, options\[, optEx]])** => `boolean`
|
|
222
254
|
|
|
223
255
|
This method deletes an item addressed by the given `index` from a container members and if succeed `true` is returned.
|
|
224
256
|
|
|
@@ -231,7 +263,7 @@ This method deletes an item addressed by the given `index` from a container memb
|
|
|
231
263
|
If `options` parameter is set to `true` (a default value), the `curIndex` property is adjusted by the method. If it is set to `false` the `curIndex` property is not adjusted before a value of the property exited out of the list indexes range that caused the property to be reset. In case the `options` is not given or is not a type of a `boolean`, its receives the default value.
|
|
232
264
|
|
|
233
265
|
<a name="THtmlItemsListContainer+selectItem"></a>
|
|
234
|
-
|
|
266
|
+
###### **selectItem(index\[, options])** => `boolean`
|
|
235
267
|
|
|
236
268
|
This method selects an item addressed by an `index` and if succeed `true` is returned.
|
|
237
269
|
|
|
@@ -243,7 +275,7 @@ This method selects an item addressed by an `index` and if succeed `true` is ret
|
|
|
243
275
|
If `options` parameter is given and is set to `true`, in case of success, the `curIndex` property is adjusted by the method.
|
|
244
276
|
|
|
245
277
|
<a name="THtmlItemsListContainer+unselectItem"></a>
|
|
246
|
-
|
|
278
|
+
###### **unselectItem(index)** => `boolean`
|
|
247
279
|
|
|
248
280
|
This method unselects an item addressed by an `index` and if succeed `true` is returned.
|
|
249
281
|
|
|
@@ -252,7 +284,7 @@ This method unselects an item addressed by an `index` and if succeed `true` is r
|
|
|
252
284
|
| `index` | `number`, `string` | --- | an element index |
|
|
253
285
|
|
|
254
286
|
<a name="THtmlItemsListContainer+hideItem"></a>
|
|
255
|
-
|
|
287
|
+
###### **hideItem(index)** => `boolean`
|
|
256
288
|
|
|
257
289
|
This method hides an item addressed by an `index` and if succeed `true` is returned.
|
|
258
290
|
|
|
@@ -261,7 +293,7 @@ This method hides an item addressed by an `index` and if succeed `true` is retur
|
|
|
261
293
|
| `index` | `number`, `string` | --- | an element index |
|
|
262
294
|
|
|
263
295
|
<a name="THtmlItemsListContainer+showItem"></a>
|
|
264
|
-
|
|
296
|
+
###### **showItem(index)** => `boolean`
|
|
265
297
|
|
|
266
298
|
This method shows an item addressed by an `index` and if succeed `true` is returned.
|
|
267
299
|
|
|
@@ -270,7 +302,7 @@ This method shows an item addressed by an `index` and if succeed `true` is retur
|
|
|
270
302
|
| `index` | `number`, `string` | --- | an element index |
|
|
271
303
|
|
|
272
304
|
<a name="THtmlItemsListContainer+isSelectedItem"></a>
|
|
273
|
-
|
|
305
|
+
###### **isSelectedItem(index)** => `boolean`
|
|
274
306
|
|
|
275
307
|
This method checks whether or not an item addressed by an `index` is selected and if so `true` is returned.
|
|
276
308
|
|
|
@@ -279,7 +311,7 @@ This method checks whether or not an item addressed by an `index` is selected an
|
|
|
279
311
|
| `index` | `number`, `string` | --- | an element index |
|
|
280
312
|
|
|
281
313
|
<a name="THtmlItemsListContainer+isHiddenItem"></a>
|
|
282
|
-
|
|
314
|
+
###### **isHiddenItem(index)** => `boolean`
|
|
283
315
|
|
|
284
316
|
This method checks whether or not an item addressed by an `index` is hidden and if so `true` is returned.
|
|
285
317
|
|
|
@@ -288,15 +320,15 @@ This method checks whether or not an item addressed by an `index` is hidden and
|
|
|
288
320
|
| `index` | `number`, `string` | --- | an element index |
|
|
289
321
|
|
|
290
322
|
<a name="THtmlItemsListController"></a>
|
|
291
|
-
|
|
323
|
+
#### **THtmlItemsListController**
|
|
292
324
|
|
|
293
325
|
This class implements a controller that provide mechanism for managing a list container and its elements placed on an HTML-form.
|
|
294
326
|
|
|
295
|
-
|
|
327
|
+
##### class constructor
|
|
296
328
|
|
|
297
329
|
The class constructor creates a new instance of the class.
|
|
298
330
|
|
|
299
|
-
|
|
331
|
+
###### constructor parameters
|
|
300
332
|
|
|
301
333
|
The class constructor receives a parameters listed below:
|
|
302
334
|
|
|
@@ -305,7 +337,7 @@ The class constructor receives a parameters listed below:
|
|
|
305
337
|
| `host` | `HTMLElement` | `undefined` |points to a host element which holds a list items |
|
|
306
338
|
| `options` | `object` | --- | contains a set of a settings for a container |
|
|
307
339
|
|
|
308
|
-
|
|
340
|
+
###### ***`options` parameter***
|
|
309
341
|
|
|
310
342
|
The `options` structure has listed below:
|
|
311
343
|
|
|
@@ -318,116 +350,134 @@ The `options` structure has listed below:
|
|
|
318
350
|
| `allowGroupSelection` | `boolean` | `false` | if set the more than one element can be selected in the list |
|
|
319
351
|
| `allowSelectionLocks` | `boolean` | `false` | \<*reserved, experimental*> |
|
|
320
352
|
|
|
321
|
-
|
|
353
|
+
##### class properties
|
|
322
354
|
|
|
323
355
|
<a name="THtmlItemsListController+count"></a>
|
|
324
|
-
|
|
356
|
+
###### **count**
|
|
325
357
|
|
|
326
358
|
| property type | read only | description |
|
|
327
359
|
|---|---|:---|
|
|
328
360
|
| `number` | yes | contains a quantity of the elements the container holds |
|
|
329
361
|
|
|
330
362
|
<a name="THtmlItemsListController+curIndex"></a>
|
|
331
|
-
|
|
363
|
+
###### **curIndex**
|
|
332
364
|
|
|
333
365
|
| property type | read only | description |
|
|
334
366
|
|---|---|:---|
|
|
335
367
|
| `number` | yes | represents an index of the current element |
|
|
336
368
|
|
|
337
369
|
<a name="THtmlItemsListController+minIndex"></a>
|
|
338
|
-
|
|
370
|
+
###### **minIndex**
|
|
339
371
|
|
|
340
372
|
| property type | read only | description |
|
|
341
373
|
|---|---|:---|
|
|
342
374
|
| `number` | yes | represents a minimum possible index for an element inside the container |
|
|
343
375
|
|
|
344
376
|
<a name="THtmlItemsListController+maxIndex"></a>
|
|
345
|
-
|
|
377
|
+
###### **maxIndex**
|
|
346
378
|
|
|
347
379
|
| property type | read only | description |
|
|
348
380
|
|---|---|:---|
|
|
349
381
|
| `number` | yes | represents a maximum possible index for an element inside the container |
|
|
350
382
|
|
|
351
383
|
<a name="THtmlItemsListController+prevIndex"></a>
|
|
352
|
-
|
|
384
|
+
###### **prevIndex**
|
|
353
385
|
|
|
354
386
|
| property type | read only | description |
|
|
355
387
|
|---|---|:---|
|
|
356
388
|
| `number` | yes | represents an index of the previous element before the current |
|
|
357
389
|
|
|
358
390
|
<a name="THtmlItemsListController+nextIndex"></a>
|
|
359
|
-
|
|
391
|
+
###### **nextIndex**
|
|
360
392
|
|
|
361
393
|
| property type | read only | description |
|
|
362
394
|
|---|---|:---|
|
|
363
395
|
| `number` | yes | represents an index of the next element after the current |
|
|
364
396
|
|
|
365
397
|
<a name="THtmlItemsListController+curItem"></a>
|
|
366
|
-
|
|
398
|
+
###### **curItem**
|
|
367
399
|
|
|
368
400
|
| property type | read only | description |
|
|
369
401
|
|---|---|:---|
|
|
370
402
|
| `?HTMLElement` | yes | represents an element addressed by the `curIndex` |
|
|
371
403
|
|
|
372
404
|
<a name="THtmlItemsListController+isSelectionLocked"></a>
|
|
373
|
-
|
|
405
|
+
###### **isSelectionLocked**
|
|
374
406
|
|
|
375
407
|
| property type | read only | description |
|
|
376
408
|
|---|---|:---|
|
|
377
409
|
| `boolean` | yes | returns `true` if selections of an items is not allowed |
|
|
378
410
|
|
|
379
411
|
<a name="THtmlItemsListController+SelectedItems"></a>
|
|
380
|
-
|
|
412
|
+
###### **SelectedItems**
|
|
381
413
|
|
|
382
414
|
| property type | read only | description |
|
|
383
415
|
|---|---|:---|
|
|
384
416
|
| `HTMLElement[]` | yes | returns an array of the selected elements |
|
|
385
417
|
|
|
386
418
|
<a name="THtmlItemsListController+StubItems"></a>
|
|
387
|
-
|
|
419
|
+
###### **StubItems**
|
|
388
420
|
|
|
389
421
|
| property type | read only | description |
|
|
390
422
|
|---|---|:---|
|
|
391
423
|
| `THtmlStubItemsSet` | yes | returns a `THtmlStubItemsSet` instance |
|
|
392
424
|
|
|
393
|
-
|
|
425
|
+
##### class methods
|
|
394
426
|
|
|
395
427
|
<a name="THtmlItemsListController+clear"></a>
|
|
396
|
-
|
|
428
|
+
###### **clear()** => `void`
|
|
397
429
|
|
|
398
430
|
This method deletes all items that is hold by the list.
|
|
399
431
|
|
|
400
432
|
<a name="THtmlItemsListController+lockItemsSelection"></a>
|
|
401
|
-
|
|
433
|
+
###### **lockItemsSelection()** => `void`
|
|
402
434
|
|
|
403
435
|
This method blocks a selection of the items in the list.
|
|
404
436
|
|
|
405
437
|
<a name="THtmlItemsListController+unlockItemsSelection"></a>
|
|
406
|
-
|
|
438
|
+
###### **unlockItemsSelection()** => `void`
|
|
407
439
|
|
|
408
440
|
This method allows a selection of the items in the list.
|
|
409
441
|
|
|
410
|
-
<a name="
|
|
411
|
-
|
|
442
|
+
<a name="THtmlItemsListController+isEmpty"></a>
|
|
443
|
+
###### **isEmpty()** => `boolean`
|
|
412
444
|
|
|
413
445
|
This method returns `true` if the list has no items.
|
|
414
446
|
|
|
415
|
-
<a name="
|
|
416
|
-
|
|
447
|
+
<a name="THtmlItemsListController+isNotEmpty"></a>
|
|
448
|
+
###### **isNotEmpty()** => `boolean`
|
|
417
449
|
|
|
418
450
|
This method returns `true` if the list has at least one item.
|
|
419
451
|
|
|
420
|
-
<a name="
|
|
421
|
-
|
|
452
|
+
<a name="THtmlItemsListController+chkIndex"></a>
|
|
453
|
+
###### **chkIndex(value)** => `boolean`
|
|
454
|
+
|
|
455
|
+
> WARNING: \[since `v0.0.3x`] this method deprecated (*use [`checkIndex`](#THtmlItemsListController+checkIndex) method instead*).
|
|
422
456
|
|
|
423
|
-
|
|
457
|
+
<a name="THtmlItemsListController+checkIndex"></a>
|
|
458
|
+
###### **checkIndex(value)** => `boolean`
|
|
459
|
+
|
|
460
|
+
> since: \[`v0.0.3x`]
|
|
461
|
+
|
|
462
|
+
This method checks if the given `value` represents a valid index value and fits the range of all possible indexes belonging to the list instance. If so `true` is returned.
|
|
463
|
+
|
|
464
|
+
| parameter name | value type | default value | description |
|
|
465
|
+
|:---|---|---:|:---|
|
|
466
|
+
| `value` | `number` or `string` | --- | a value to be verified |
|
|
467
|
+
|
|
468
|
+
<a name="THtmlItemsListController+tryIndex"></a>
|
|
469
|
+
###### **tryIndex(value)** => `number`
|
|
470
|
+
|
|
471
|
+
> since: \[`v0.0.3x`]
|
|
472
|
+
|
|
473
|
+
This method evaluates whether the given `value` represents a valid index value and fits the range of all possible indexes belonging to the list instance. If so an index value returned. If failed a `-1` will be returned.
|
|
424
474
|
|
|
425
475
|
| parameter name | value type | default value | description |
|
|
426
476
|
|:---|---|---:|:---|
|
|
427
477
|
| `value` | `any` | --- | a value to be verified |
|
|
428
478
|
|
|
429
|
-
<a name="
|
|
430
|
-
|
|
479
|
+
<a name="THtmlItemsListController+chkIndexEx"></a>
|
|
480
|
+
###### **chkIndexEx(value\[, mode])** => `boolean`\|`number`
|
|
431
481
|
|
|
432
482
|
This method is similar to a `chkIndex` methods but receives a `mode` parameter which allow to choose what a type of the result the method returns.
|
|
433
483
|
|
|
@@ -440,8 +490,10 @@ If `mode` parameter set to `false` (*its default value*), the result returned by
|
|
|
440
490
|
|
|
441
491
|
If `mode` parameter set to `true`, the result returned by the method has an index type.
|
|
442
492
|
|
|
443
|
-
|
|
444
|
-
|
|
493
|
+
> WARNING: \[since `v0.0.3x`] this method deprecated (*use [`checkIndex`](#THtmlItemsListController+checkIndex) or [`tryIndex`](#THtmlItemsListController+tryIndex) method instead*).
|
|
494
|
+
|
|
495
|
+
<a name="THtmlItemsListController+srchIndex"></a>
|
|
496
|
+
###### **srchIndex(item)** => `number`
|
|
445
497
|
|
|
446
498
|
This method tries to find a given item in the list and if it is found returns its index.
|
|
447
499
|
|
|
@@ -449,8 +501,8 @@ This method tries to find a given item in the list and if it is found returns it
|
|
|
449
501
|
|:---|---|---:|:---|
|
|
450
502
|
| `item` | `?HTMLElement` | --- | an element to search |
|
|
451
503
|
|
|
452
|
-
<a name="
|
|
453
|
-
|
|
504
|
+
<a name="THtmlItemsListController+srchIndexByAttr"></a>
|
|
505
|
+
###### **srchIndexByAttr(name, value)** => `number`
|
|
454
506
|
|
|
455
507
|
This method tries to find an item by its given attribute in the list and if it is found returns its index.
|
|
456
508
|
|
|
@@ -459,8 +511,8 @@ This method tries to find an item by its given attribute in the list and if it i
|
|
|
459
511
|
| `name` | `string` | --- | an attribute name |
|
|
460
512
|
| `value` | `any` | --- | an attribute value |
|
|
461
513
|
|
|
462
|
-
<a name="
|
|
463
|
-
|
|
514
|
+
<a name="THtmlItemsListController+srchIndexByID"></a>
|
|
515
|
+
###### **srchIndexByID(value)** => `number`
|
|
464
516
|
|
|
465
517
|
This method tries to find an item by its `ID`-attribute in the list and if it is found returns its index.
|
|
466
518
|
|
|
@@ -469,7 +521,7 @@ This method tries to find an item by its `ID`-attribute in the list and if it is
|
|
|
469
521
|
| `value` | `string` | --- | an ID value |
|
|
470
522
|
|
|
471
523
|
<a name="THtmlItemsListController+setCurIndex"></a>
|
|
472
|
-
|
|
524
|
+
###### **setCurIndex(index)** => `boolean`
|
|
473
525
|
|
|
474
526
|
This method sets a current item index in the list. If succeed `true` is returned.
|
|
475
527
|
|
|
@@ -478,12 +530,12 @@ This method sets a current item index in the list. If succeed `true` is returned
|
|
|
478
530
|
| `index` | `number`, `string` | --- | an element index |
|
|
479
531
|
|
|
480
532
|
<a name="THtmlItemsListController+rstCurIndex"></a>
|
|
481
|
-
|
|
533
|
+
###### **rstCurIndex()** => `void`
|
|
482
534
|
|
|
483
535
|
This method resets a current item index in the list.
|
|
484
536
|
|
|
485
|
-
<a name="
|
|
486
|
-
|
|
537
|
+
<a name="THtmlItemsListController+getItem"></a>
|
|
538
|
+
###### **getItem(index)** => `?HTMLElement`
|
|
487
539
|
|
|
488
540
|
This method returns an item addressed by a given index.
|
|
489
541
|
|
|
@@ -491,8 +543,8 @@ This method returns an item addressed by a given index.
|
|
|
491
543
|
|:---|---|---:|:---|
|
|
492
544
|
| `index` | `number`, `string` | --- | an element index |
|
|
493
545
|
|
|
494
|
-
<a name="
|
|
495
|
-
|
|
546
|
+
<a name="THtmlItemsListController+getItemByAttr"></a>
|
|
547
|
+
###### **getItemByAttr(name, value)** => `?HTMLElement`
|
|
496
548
|
|
|
497
549
|
This method tries to find an item by its given attribute in the list and if found returns it.
|
|
498
550
|
|
|
@@ -501,8 +553,8 @@ This method tries to find an item by its given attribute in the list and if foun
|
|
|
501
553
|
| `name` | `string` | --- | an attribute name |
|
|
502
554
|
| `value` | `any` | --- | an attribute value |
|
|
503
555
|
|
|
504
|
-
<a name="
|
|
505
|
-
|
|
556
|
+
<a name="THtmlItemsListController+getItemByID"></a>
|
|
557
|
+
###### **getItemByID(value)** => `?HTMLElement`
|
|
506
558
|
|
|
507
559
|
This method tries to find an item by its `ID`-attribute in the list and if found returns it.
|
|
508
560
|
|
|
@@ -511,7 +563,7 @@ This method tries to find an item by its `ID`-attribute in the list and if found
|
|
|
511
563
|
| `value` | `string` | --- | an ID value |
|
|
512
564
|
|
|
513
565
|
<a name="THtmlItemsListController+addItem"></a>
|
|
514
|
-
|
|
566
|
+
###### **addItem(item\[, options])** => `number`
|
|
515
567
|
|
|
516
568
|
This method adds a given item to a list members and if succeed returns its index.
|
|
517
569
|
|
|
@@ -521,7 +573,7 @@ This method adds a given item to a list members and if succeed returns its index
|
|
|
521
573
|
| `options` | `boolean` | `false` | a flag to switch mode |
|
|
522
574
|
|
|
523
575
|
<a name="THtmlItemsListController+delItem"></a>
|
|
524
|
-
|
|
576
|
+
###### **delItem(index\[, options])** => `boolean`
|
|
525
577
|
|
|
526
578
|
This method deletes an item addressed by `index` from a list members and if succeed `true` is returned.
|
|
527
579
|
|
|
@@ -531,7 +583,7 @@ This method deletes an item addressed by `index` from a list members and if succ
|
|
|
531
583
|
| `options` | `boolean` | `true` | a flag to switch mode |
|
|
532
584
|
|
|
533
585
|
<a name="THtmlItemsListController+selectItem"></a>
|
|
534
|
-
|
|
586
|
+
###### **selectItem(index\[, options])** => `boolean`
|
|
535
587
|
|
|
536
588
|
This method selects an item addressed by an `index` and if succeed `true` is returned.
|
|
537
589
|
|
|
@@ -541,7 +593,7 @@ This method selects an item addressed by an `index` and if succeed `true` is ret
|
|
|
541
593
|
| `options` | `boolean` | `false` | a flag to switch mode |
|
|
542
594
|
|
|
543
595
|
<a name="THtmlItemsListController+unselectItem"></a>
|
|
544
|
-
|
|
596
|
+
###### **unselectItem(index)** => `boolean`
|
|
545
597
|
|
|
546
598
|
This method unselects an item addressed by an `index` and if succeed `true` is returned.
|
|
547
599
|
|
|
@@ -550,12 +602,12 @@ This method unselects an item addressed by an `index` and if succeed `true` is r
|
|
|
550
602
|
| `index` | `number`, `string` | --- | an element index |
|
|
551
603
|
|
|
552
604
|
<a name="THtmlItemsListController+hideItem"></a>
|
|
553
|
-
|
|
605
|
+
###### **hideItem(index)** => `boolean`
|
|
554
606
|
|
|
555
607
|
This method hides an item addressed by an `index` and if succeed `true` is returned.
|
|
556
608
|
|
|
557
609
|
<a name="THtmlItemsListController+showItem"></a>
|
|
558
|
-
|
|
610
|
+
###### **showItem(index)** => `boolean`
|
|
559
611
|
|
|
560
612
|
This method shows an item addressed by an `index` and if succeed `true` is returned.
|
|
561
613
|
|
|
@@ -563,8 +615,8 @@ This method shows an item addressed by an `index` and if succeed `true` is retur
|
|
|
563
615
|
|:---|---|---:|:---|
|
|
564
616
|
| `index` | `number`, `string` | --- | an element index |
|
|
565
617
|
|
|
566
|
-
<a name="
|
|
567
|
-
|
|
618
|
+
<a name="THtmlItemsListController+isSelectedItem"></a>
|
|
619
|
+
###### **isSelectedItem(index)** => `boolean`
|
|
568
620
|
|
|
569
621
|
This method checks whether or not an item addressed by an `index` is selected and if so `true` is returned.
|
|
570
622
|
|
|
@@ -572,8 +624,8 @@ This method checks whether or not an item addressed by an `index` is selected an
|
|
|
572
624
|
|:---|---|---:|:---|
|
|
573
625
|
| `index` | `number`, `string` | --- | an element index |
|
|
574
626
|
|
|
575
|
-
<a name="
|
|
576
|
-
|
|
627
|
+
<a name="THtmlItemsListController+isHiddenItem"></a>
|
|
628
|
+
###### **isHiddenItem(index)** => `boolean`
|
|
577
629
|
|
|
578
630
|
This method checks whether or not an item addressed by an `index` is hidden and if so `true` is returned.
|
|
579
631
|
|
|
@@ -582,7 +634,7 @@ This method checks whether or not an item addressed by an `index` is hidden and
|
|
|
582
634
|
| `index` | `number`, `string` | --- | an element index |
|
|
583
635
|
|
|
584
636
|
<a name="THtmlItemsListController+on"></a>
|
|
585
|
-
|
|
637
|
+
###### **on(name, event)** => `void`
|
|
586
638
|
|
|
587
639
|
This method sets event handler for the list event addressed by a `name` parameter.
|
|
588
640
|
|
|
@@ -593,7 +645,7 @@ This method sets event handler for the list event addressed by a `name` paramete
|
|
|
593
645
|
|
|
594
646
|
> Note: for current implementation you can't reset or set new event handler (especially another one) if a handler with the same name exists already.
|
|
595
647
|
|
|
596
|
-
|
|
648
|
+
##### class events
|
|
597
649
|
|
|
598
650
|
The class generates the events listed in the table bellow:
|
|
599
651
|
|
|
@@ -610,15 +662,15 @@ The class generates the events listed in the table bellow:
|
|
|
610
662
|
| `item-shown` | fired when an item was marked as non-hidden in the list |
|
|
611
663
|
|
|
612
664
|
<a name="THtmlStubItemsSet"></a>
|
|
613
|
-
|
|
665
|
+
#### **THtmlStubItemsSet**
|
|
614
666
|
|
|
615
667
|
This class implements a controller that provide mechanism for managing a so-called "stub"-elements displayed inside an attached list container placed on an HTML-form.
|
|
616
668
|
|
|
617
|
-
|
|
669
|
+
##### class constructor
|
|
618
670
|
|
|
619
671
|
The class constructor creates a new instance of the class.
|
|
620
672
|
|
|
621
|
-
|
|
673
|
+
###### constructor parameters
|
|
622
674
|
|
|
623
675
|
The class constructor receives a parameters listed below:
|
|
624
676
|
|
|
@@ -629,7 +681,7 @@ The class constructor receives a parameters listed below:
|
|
|
629
681
|
|
|
630
682
|
> \[!] NOTE: `[since v0.0.26]` a use of a `array` type as a value of an `options` are deprecated and will be dropped soon.
|
|
631
683
|
|
|
632
|
-
|
|
684
|
+
###### ***`options` parameter***
|
|
633
685
|
|
|
634
686
|
The `options` structure has listed below:
|
|
635
687
|
|
|
@@ -639,31 +691,31 @@ The `options` structure has listed below:
|
|
|
639
691
|
| `defaultItem` | `string` | --- | if set it defines a name of the item used by default |
|
|
640
692
|
| `force` | `boolean` | `false` | if set to `true`, the item which is already present will be replaced with a new one |
|
|
641
693
|
|
|
642
|
-
|
|
694
|
+
##### class properties
|
|
643
695
|
|
|
644
696
|
<a name="THtmlStubItemsSet+count"></a>
|
|
645
|
-
|
|
697
|
+
###### **count**
|
|
646
698
|
|
|
647
699
|
| property type | read only | description |
|
|
648
700
|
|---|---|:---|
|
|
649
701
|
| `number` | yes | contains a quantity of an elements which holds by the set |
|
|
650
702
|
|
|
651
703
|
<a name="THtmlStubItemsSet+defItem"></a>
|
|
652
|
-
|
|
704
|
+
###### **defItem**
|
|
653
705
|
|
|
654
706
|
| property type | read only | description |
|
|
655
707
|
|---|---|:---|
|
|
656
708
|
| `string` | no | defines an element name which is used by default |
|
|
657
709
|
|
|
658
|
-
|
|
710
|
+
##### class methods
|
|
659
711
|
|
|
660
712
|
<a name="THtmlStubItemsSet+clear"></a>
|
|
661
|
-
|
|
713
|
+
###### **clear()** => `void`
|
|
662
714
|
|
|
663
715
|
This class method deletes all items hold by the set.
|
|
664
716
|
|
|
665
717
|
<a name="THtmlStubItemsSet+hasItem"></a>
|
|
666
|
-
|
|
718
|
+
###### **hasItem(name)** => `boolean`
|
|
667
719
|
|
|
668
720
|
This class method returns `true` if an item named by `name` exists in the set and `false` if else.
|
|
669
721
|
|
|
@@ -672,12 +724,12 @@ This class method returns `true` if an item named by `name` exists in the set an
|
|
|
672
724
|
| `name` | `string` | --- | an element name |
|
|
673
725
|
|
|
674
726
|
<a name="THtmlStubItemsSet+hasItems"></a>
|
|
675
|
-
|
|
727
|
+
###### **hasItems()** => `boolean`
|
|
676
728
|
|
|
677
729
|
This class method returns `true` if the set hold any items and `false` if not.
|
|
678
730
|
|
|
679
731
|
<a name="THtmlStubItemsSet+getItem"></a>
|
|
680
|
-
|
|
732
|
+
###### **getItem(name)** => `?HTMLElement`
|
|
681
733
|
|
|
682
734
|
This class method returns an item named by `name` if it exists in the set and `null` if else.
|
|
683
735
|
|
|
@@ -686,7 +738,7 @@ This class method returns an item named by `name` if it exists in the set and `n
|
|
|
686
738
|
| `name` | `string` | --- | an element name |
|
|
687
739
|
|
|
688
740
|
<a name="THtmlStubItemsSet+addItem"></a>
|
|
689
|
-
|
|
741
|
+
###### **addItem(name, item\[, options])** => `boolean`
|
|
690
742
|
|
|
691
743
|
This class method tries to include a given `item` to a set members with a label given by `name` and if succeed returns `true`.
|
|
692
744
|
|
|
@@ -703,7 +755,7 @@ The `actForce` parameter if given alters the method behavior:
|
|
|
703
755
|
- If parameter is not given or not of a `boolean` type its default value meant to be `false`.
|
|
704
756
|
|
|
705
757
|
<a name="THtmlStubItemsSet+delItem"></a>
|
|
706
|
-
|
|
758
|
+
###### **delItem(name)** => `boolean`
|
|
707
759
|
|
|
708
760
|
This class method tries to delete item named by `name` from the set and if succeed `true` is returned.
|
|
709
761
|
|
|
@@ -712,7 +764,7 @@ This class method tries to delete item named by `name` from the set and if succe
|
|
|
712
764
|
| `name` | `string` | --- | an element name |
|
|
713
765
|
|
|
714
766
|
<a name="THtmlStubItemsSet+showItem"></a>
|
|
715
|
-
|
|
767
|
+
###### **showItem(name)** => `boolean`
|
|
716
768
|
|
|
717
769
|
This class method tries to make item named by `name` visible on HTML-form and if succeed `true` is returned.
|
|
718
770
|
|
|
@@ -721,7 +773,7 @@ This class method tries to make item named by `name` visible on HTML-form and if
|
|
|
721
773
|
| `name` | `string` | --- | an element name |
|
|
722
774
|
|
|
723
775
|
<a name="THtmlStubItemsSet+hideItem"></a>
|
|
724
|
-
|
|
776
|
+
###### **hideItem(name)** => `boolean`
|
|
725
777
|
|
|
726
778
|
This class method tries to make item named by `name` invisible on HTML-form and if succeed `true` is returned.
|
|
727
779
|
|
|
@@ -730,7 +782,7 @@ This class method tries to make item named by `name` invisible on HTML-form and
|
|
|
730
782
|
| `name` | `string` | --- | an element name |
|
|
731
783
|
|
|
732
784
|
<a name="THtmlStubItemsSet+setDefItem"></a>
|
|
733
|
-
|
|
785
|
+
###### **setDefItem(name)** => `boolean`
|
|
734
786
|
|
|
735
787
|
This class method tries to set item named by `name` as a default item and if succeed `true` is returned.
|
|
736
788
|
|
|
@@ -739,22 +791,22 @@ This class method tries to set item named by `name` as a default item and if suc
|
|
|
739
791
|
| `name` | `string` | --- | an element name |
|
|
740
792
|
|
|
741
793
|
<a name="THtmlStubItemsSet+rstDefItem"></a>
|
|
742
|
-
|
|
794
|
+
###### **rstDefItem()** => `void`
|
|
743
795
|
|
|
744
796
|
This class method resets a default item.
|
|
745
797
|
|
|
746
798
|
<a name="THtmlStubItemsSet+showDefItem"></a>
|
|
747
|
-
|
|
799
|
+
###### **showDefItem()** => `boolean`
|
|
748
800
|
|
|
749
801
|
This class method is similar to `showItem` method but is performed on a default item.
|
|
750
802
|
|
|
751
803
|
<a name="THtmlStubItemsSet+hideDefItem"></a>
|
|
752
|
-
|
|
804
|
+
###### **hideDefItem()** => `boolean`
|
|
753
805
|
|
|
754
806
|
This class method is similar to `hideItem` method but is performed on a default item.
|
|
755
807
|
|
|
756
808
|
<a name="THtmlStubItemsSet+loadItems"></a>
|
|
757
|
-
|
|
809
|
+
###### **loadItems(data\[, options])** => `number`
|
|
758
810
|
|
|
759
811
|
This class methods loads an items given by `list` in the set and returned quantity of how many items have been processed successfully.
|
|
760
812
|
|
|
@@ -795,15 +847,15 @@ If the `options` parameter is an `object` that contains the following set of par
|
|
|
795
847
|
If the `options` parameter is a `boolean` value it treats as a `options.useClear` option.
|
|
796
848
|
|
|
797
849
|
<a name="THtmlListButtonsController"></a>
|
|
798
|
-
|
|
850
|
+
#### **THtmlListButtonsController**
|
|
799
851
|
|
|
800
852
|
This class provides a buttons controller to use with a list components to performs actions for list elements selection.
|
|
801
853
|
|
|
802
|
-
|
|
854
|
+
##### class constructor
|
|
803
855
|
|
|
804
856
|
The class constructor creates a new instance of the class.
|
|
805
857
|
|
|
806
|
-
|
|
858
|
+
###### constructor parameters
|
|
807
859
|
|
|
808
860
|
The class constructor receives an `options` parameter which structure has listed below:
|
|
809
861
|
|
|
@@ -814,46 +866,46 @@ The class constructor receives an `options` parameter which structure has listed
|
|
|
814
866
|
| `btnNext` | `?HTMLElement` | `undefined` | defines an HTML-button which will select the next element |
|
|
815
867
|
| `btnLast` | `?HTMLElement` | `undefined` | defines an HTML-button which will select the last element |
|
|
816
868
|
|
|
817
|
-
|
|
869
|
+
##### class properties
|
|
818
870
|
|
|
819
871
|
This class has none.
|
|
820
872
|
|
|
821
|
-
|
|
873
|
+
##### class methods
|
|
822
874
|
|
|
823
875
|
<a name="THtmlListButtonsController+disableAll"></a>
|
|
824
|
-
|
|
876
|
+
###### **disableAll()** => `void`
|
|
825
877
|
|
|
826
878
|
This method disables all buttons that holds by the controller.
|
|
827
879
|
|
|
828
880
|
<a name="THtmlListButtonsController+disableBkwd"></a>
|
|
829
|
-
|
|
881
|
+
###### **disableBkwd()** => `void`
|
|
830
882
|
|
|
831
883
|
This method disables all buttons in *'move backward'* group (*i.e. `btnFirst` and `btnPrev`*) that holds by the controller.
|
|
832
884
|
|
|
833
885
|
<a name="THtmlListButtonsController+disableFrwd"></a>
|
|
834
|
-
|
|
886
|
+
###### **disableFrwd()** => `void`
|
|
835
887
|
|
|
836
888
|
This method disables all buttons in *'move forward'* group (*i.e. `btnNext` and `btnLast`*) that holds by the controller.
|
|
837
889
|
|
|
838
890
|
<a name="THtmlListButtonsController+enableAll"></a>
|
|
839
|
-
|
|
891
|
+
###### **enableAll()** => `void`
|
|
840
892
|
|
|
841
893
|
This method enables all buttons that holds by the controller.
|
|
842
894
|
|
|
843
895
|
<a name="THtmlListButtonsController+enableBkwd"></a>
|
|
844
|
-
|
|
896
|
+
###### **enableBkwd()** => `void`
|
|
845
897
|
|
|
846
898
|
This method enables all buttons in *'move backward'* group (*i.e. `btnFirst` and `btnPrev`*) that holds by the controller.
|
|
847
899
|
|
|
848
900
|
<a name="THtmlListButtonsController+enableFrwd"></a>
|
|
849
|
-
|
|
901
|
+
###### **enableFrwd()** => `void`
|
|
850
902
|
|
|
851
903
|
This method enables all buttons in *'move forward'* group (*i.e. `btnNext` and `btnLast`*) that holds by the controller.
|
|
852
904
|
|
|
853
|
-
|
|
905
|
+
##### class methods (*special*)
|
|
854
906
|
|
|
855
907
|
<a name="THtmlListButtonsController+on"></a>
|
|
856
|
-
|
|
908
|
+
###### **on(name, event)** => `void`
|
|
857
909
|
|
|
858
910
|
This method sets event handler addressed by a `name` parameter.
|
|
859
911
|
|
|
@@ -864,7 +916,7 @@ This method sets event handler addressed by a `name` parameter.
|
|
|
864
916
|
|
|
865
917
|
> Note: for current implementation you can't reset or set new event handler (*especially another one*) if a handler with the same name exists already.
|
|
866
918
|
|
|
867
|
-
|
|
919
|
+
##### class events
|
|
868
920
|
|
|
869
921
|
The class generates the events listed in the table bellow:
|
|
870
922
|
|
package/lib/list.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// [v0.1.
|
|
1
|
+
// [v0.1.079-20260416]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
@@ -253,23 +253,51 @@ class THtmlItemsListContainer {
|
|
|
253
253
|
/**
|
|
254
254
|
* Checks if a given value is a valid index and
|
|
255
255
|
* it fits an index range within an instance.
|
|
256
|
-
* @param {
|
|
256
|
+
* @param {number|string} value - index value
|
|
257
257
|
* @returns {boolean}
|
|
258
|
+
* @deprecated
|
|
259
|
+
* @todo \[since v0.0.3x] deprecated. Use
|
|
260
|
+
* {@link THtmlItemsListContainer.checkIndex} instead
|
|
258
261
|
*/
|
|
259
262
|
chkIndex(value) {
|
|
260
|
-
return this.#_items.
|
|
263
|
+
return this.#_items.checkIndex(value);
|
|
261
264
|
}
|
|
262
265
|
|
|
263
266
|
/**
|
|
264
267
|
* Checks if a given value is a valid index and
|
|
265
268
|
* it fits an index range within an instance.
|
|
266
|
-
* @
|
|
269
|
+
* @since 0.0.3x
|
|
270
|
+
* @param {number|string} value - index value
|
|
271
|
+
* @returns {boolean}
|
|
272
|
+
*/
|
|
273
|
+
checkIndex(value) {
|
|
274
|
+
return this.#_items.checkIndex(value);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Checks if a given value is a valid index and
|
|
279
|
+
* it fits an index range within an instance.
|
|
280
|
+
* @param {number|string} value - value to check
|
|
267
281
|
* @param {boolean} [opt=false] - defines a type of result
|
|
268
|
-
* @returns {
|
|
282
|
+
* @returns {boolean|number}
|
|
269
283
|
* @see TItemsListEx.chkIndexEx
|
|
284
|
+
* @todo \[since v0.0.3x] deprecated. Use
|
|
285
|
+
* {@link THtmlItemsListContainer.checkIndex} or
|
|
286
|
+
* {@link THtmlItemsListContainer.tryIndex} instead
|
|
287
|
+
*/
|
|
288
|
+
chkIndexEx(value, opt) {
|
|
289
|
+
return opt ? this.#_items.tryIndex(value) : this.#_items.checkIndex(value);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Returns an index in case a given value is a valid index value and not exceeds
|
|
294
|
+
* an index range within the list. If failed a `-1` returned
|
|
295
|
+
* @since 0.0.3x
|
|
296
|
+
* @param {any} value - value to evaluate
|
|
297
|
+
* @returns {number}
|
|
270
298
|
*/
|
|
271
|
-
|
|
272
|
-
return this.#_items.
|
|
299
|
+
tryIndex(value) {
|
|
300
|
+
return this.#_items.tryIndex(value);
|
|
273
301
|
}
|
|
274
302
|
|
|
275
303
|
/**
|
package/lib/mod-hfunc.js
CHANGED
|
@@ -1,28 +1,11 @@
|
|
|
1
|
-
// [v0.1.
|
|
1
|
+
// [v0.1.067-20260417]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
5
|
-
const {
|
|
6
|
-
eventHelper, // [!] not oficialy exported yet
|
|
7
|
-
} = require('@cntwg/html-helper');
|
|
8
|
-
|
|
9
5
|
// === module inner block ===
|
|
10
6
|
|
|
11
|
-
const {
|
|
12
|
-
pushEventHandler, removeEventHandler,
|
|
13
|
-
triggerEventHandler,
|
|
14
|
-
} = eventHelper;
|
|
15
|
-
|
|
16
7
|
// === module main block ===
|
|
17
8
|
|
|
18
|
-
/***
|
|
19
|
-
* (* constant definitions *)
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/***
|
|
23
|
-
* (* function definitions *)
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
9
|
/**
|
|
27
10
|
* @function readOnClickEventInfo
|
|
28
11
|
* @param {Event} e
|
|
@@ -51,16 +34,4 @@ function readOnClickEventInfo(e) {
|
|
|
51
34
|
};
|
|
52
35
|
return { item, onClickNum };
|
|
53
36
|
};
|
|
54
|
-
|
|
55
|
-
/***
|
|
56
|
-
* (* class definitions *)
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
// === module exports block ===
|
|
60
|
-
|
|
61
37
|
module.exports.readOnClickEventInfo = readOnClickEventInfo;
|
|
62
|
-
|
|
63
|
-
// * re-exported *
|
|
64
|
-
module.exports.pushEventHandler = pushEventHandler;
|
|
65
|
-
module.exports.removeEventHandler = removeEventHandler;
|
|
66
|
-
module.exports.triggerEventHandler = triggerEventHandler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cntwg/html-ctrls-lists",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"description": "An HTML-form component: lists",
|
|
5
5
|
"author": "ygracs <cs70th-om@rambler.ru>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"#test-dir/*": "./__test__/*"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@cntwg/html-ctrls-buttons": "~0.0
|
|
37
|
-
"@cntwg/html-helper": "~0.1.
|
|
36
|
+
"@cntwg/html-ctrls-buttons": "~0.1.0",
|
|
37
|
+
"@cntwg/html-helper": "~0.1.3",
|
|
38
38
|
"@ygracs/bsfoc-lib-js": "~0.3.4",
|
|
39
|
-
"@ygracs/lists-lib-js": "~0.
|
|
39
|
+
"@ygracs/lists-lib-js": "~0.2.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@ygracs/test-helper": "~0.0.2-b",
|
|
43
|
-
"jest": "^30.
|
|
44
|
-
"jest-environment-jsdom": "^30.
|
|
43
|
+
"jest": "^30.3.0",
|
|
44
|
+
"jest-environment-jsdom": "^30.3.0",
|
|
45
45
|
"jsdoc-to-markdown": "^9.1.3",
|
|
46
46
|
"minimist": "^1.2.8"
|
|
47
47
|
}
|