@cntwg/html-ctrls-lists 0.0.32 → 0.0.33

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.
@@ -1,63 +1,63 @@
1
- /**
2
- * A description for list buttons set.
3
- */
4
- export type listButtonsSetDesc = {
5
- /**
6
- * - button 'move to first'
7
- */
8
- btnFirst: HTMLElement | null;
9
- /**
10
- * - button 'move to previous'
11
- */
12
- btnPrev: HTMLElement | null;
13
- /**
14
- * - button 'move to next'
15
- */
16
- btnNext: HTMLElement | null;
17
- /**
18
- * - button 'move to last'
19
- */
20
- btnLast: HTMLElement | null;
21
- };
22
- export const BTS_DEF_GROUP_NAME: "all";
23
-
24
- /**
25
- * This class implements an interface of a pre-defined
26
- * buttons set that is used in pair with a list elements.
27
- * A set provide a buttons: <next>, <previous>, <first> and <last>.
28
- */
29
- export class THtmlListButtonsController {
30
- /**
31
- * Creates an instance of a buttons set.
32
- */
33
- constructor(opt?: listButtonsSetDesc);
34
- /**
35
- * Disables all buttons.
36
- */
37
- disableAll(): void;
38
- /**
39
- * Disables all buttons in 'move_bkwd' group.
40
- */
41
- disableBkwd(): void;
42
- /**
43
- * Disables all buttons in 'move_frwd' group.
44
- */
45
- disableFrwd(): void;
46
- /**
47
- * Enables all buttons.
48
- */
49
- enableAll(): void;
50
- /**
51
- * Enables all buttons in 'move_bkwd' group.
52
- */
53
- enableBkwd(): void;
54
- /**
55
- * Enables all buttons in 'move_frwd' group.
56
- */
57
- enableFrwd(): void;
58
- /**
59
- * Sets a callback function to handle event.
60
- */
61
- on(name: string, evnt: Function): void;
62
- #private;
63
- }
1
+ /**
2
+ * A description for list buttons set.
3
+ */
4
+ export type listButtonsSetDesc = {
5
+ /**
6
+ * - button 'move to first'
7
+ */
8
+ btnFirst: HTMLElement | null;
9
+ /**
10
+ * - button 'move to previous'
11
+ */
12
+ btnPrev: HTMLElement | null;
13
+ /**
14
+ * - button 'move to next'
15
+ */
16
+ btnNext: HTMLElement | null;
17
+ /**
18
+ * - button 'move to last'
19
+ */
20
+ btnLast: HTMLElement | null;
21
+ };
22
+ export const BTS_DEF_GROUP_NAME: "all";
23
+
24
+ /**
25
+ * This class implements an interface of a pre-defined
26
+ * buttons set that is used in pair with a list elements.
27
+ * A set provide a buttons: <next>, <previous>, <first> and <last>.
28
+ */
29
+ export class THtmlListButtonsController {
30
+ /**
31
+ * Creates an instance of a buttons set.
32
+ */
33
+ constructor(opt?: listButtonsSetDesc);
34
+ /**
35
+ * Disables all buttons.
36
+ */
37
+ disableAll(): void;
38
+ /**
39
+ * Disables all buttons in 'move_bkwd' group.
40
+ */
41
+ disableBkwd(): void;
42
+ /**
43
+ * Disables all buttons in 'move_frwd' group.
44
+ */
45
+ disableFrwd(): void;
46
+ /**
47
+ * Enables all buttons.
48
+ */
49
+ enableAll(): void;
50
+ /**
51
+ * Enables all buttons in 'move_bkwd' group.
52
+ */
53
+ enableBkwd(): void;
54
+ /**
55
+ * Enables all buttons in 'move_frwd' group.
56
+ */
57
+ enableFrwd(): void;
58
+ /**
59
+ * Sets a callback function to handle event.
60
+ */
61
+ on(name: string, evnt: Function): void;
62
+ #private;
63
+ }
@@ -1,134 +1,134 @@
1
- /**
2
- * A set of options for a `THtmlStubItemsSet`-class constructor
3
- */
4
- export type IStubItemsSetOptions = {
5
- /**
6
- * - array of `name`-`element` pairs
7
- */
8
- items: pairOfNameAndElement[];
9
- /**
10
- * - a default element name
11
- */
12
- defaultItem?: string;
13
- /**
14
- * - run in a force mode
15
- */
16
- force?: boolean | undefined;
17
- };
18
- export const IStubItemsSetOptions: IStubItemsSetOptions;
19
- /**
20
- * A `name`-`element` pair
21
- */
22
- export type pairOfNameAndElement = [ name: string, item: HTMLElement ];
23
- /**
24
- * A settings to load a stub-elements.
25
- */
26
- export type OPT_ldstubs = {
27
- /**
28
- * - a default element name
29
- * @deprecated
30
- */
31
- defaultItem?: string;
32
- /**
33
- * - to clear before load an elements
34
- */
35
- useClear?: boolean;
36
- /**
37
- * - run in a force mode
38
- */
39
- force?: boolean;
40
- };
41
- /**
42
- * A stub-elements list descriptor
43
- */
44
- export type IStubEListDesc = {
45
- /**
46
- * - array of `name`-`element` pairs
47
- */
48
- items: pairOfNameAndElement[];
49
- /**
50
- * - a default element name
51
- */
52
- defaultItem?: string;
53
- };
54
-
55
- /**
56
- * This class implements an interface of a stub-items set
57
- */
58
- export class THtmlStubItemsSet {
59
- /**
60
- * Creates an instance of a stub-items set
61
- * @todo [since v0.0.26] use of an `array`-type as a value of an `opt` is deprecated
62
- */
63
- constructor(host: HTMLElement, opt?: pairOfNameAndElement[] | IStubEListDesc | IStubItemsSetOptions);
64
- /**
65
- * Defines a default element name
66
- * @type {string}
67
- */
68
- set defItem(name: string);
69
- get defItem(): string;
70
- /**
71
- * Contains a Qty of an elements
72
- * @type {number}
73
- */
74
- get count(): number;
75
- /**
76
- * Clears an instance content.
77
- * @todo check if any item is shown
78
- */
79
- clear(): void;
80
- /**
81
- * Sets a default item.
82
- */
83
- setDefItem(name: string): boolean;
84
- /**
85
- * Resets a default item.
86
- * @todo check if item is shown
87
- */
88
- rstDefItem(): void;
89
- /**
90
- * Checks if an item exists.
91
- */
92
- hasItem(name: string): boolean;
93
- /**
94
- * Checks if any items exists.
95
- */
96
- hasItems(): boolean;
97
- /**
98
- * Returns an item by its name.
99
- */
100
- getItem(name: string): HTMLElement | null;
101
- /**
102
- * Adds an item to an instance members.
103
- */
104
- addItem(name: string, item: HTMLElement, opt?: boolean): boolean;
105
- /**
106
- * Deletes an item from an instance members.
107
- * @todo check if item is shown
108
- */
109
- delItem(name: string): boolean;
110
- /**
111
- * Shows an item.
112
- */
113
- showItem(name: string): boolean;
114
- /**
115
- * Shows a default item.
116
- */
117
- showDefItem(): boolean;
118
- /**
119
- * Hides an item.
120
- */
121
- hideItem(name: string): boolean;
122
- /**
123
- * Hides a default item.
124
- */
125
- hideDefItem(): boolean;
126
- /**
127
- * Adds an items to an instance members.
128
- * @todo [since 0.0.25] deprecate use of `opt` as `boolean`
129
- * @todo [since v0.0.26] for `OPT_ldstubs` a `defaultItem`-option deprecated
130
- * @todo [since 0.0.32] deprecate use of `data` as `array`
131
- */
132
- loadItems(data: pairOfNameAndElement[] | IStubEListDesc, opt?: boolean | OPT_ldstubs): number;
133
- #private;
134
- }
1
+ /**
2
+ * A set of options for a `THtmlStubItemsSet`-class constructor
3
+ */
4
+ export type IStubItemsSetOptions = {
5
+ /**
6
+ * - array of `name`-`element` pairs
7
+ */
8
+ items: pairOfNameAndElement[];
9
+ /**
10
+ * - a default element name
11
+ */
12
+ defaultItem?: string;
13
+ /**
14
+ * - run in a force mode
15
+ */
16
+ force?: boolean | undefined;
17
+ };
18
+ export const IStubItemsSetOptions: IStubItemsSetOptions;
19
+ /**
20
+ * A `name`-`element` pair
21
+ */
22
+ export type pairOfNameAndElement = [ name: string, item: HTMLElement ];
23
+ /**
24
+ * A settings to load a stub-elements.
25
+ */
26
+ export type OPT_ldstubs = {
27
+ /**
28
+ * - a default element name
29
+ * @deprecated
30
+ */
31
+ defaultItem?: string;
32
+ /**
33
+ * - to clear before load an elements
34
+ */
35
+ useClear?: boolean;
36
+ /**
37
+ * - run in a force mode
38
+ */
39
+ force?: boolean;
40
+ };
41
+ /**
42
+ * A stub-elements list descriptor
43
+ */
44
+ export type IStubEListDesc = {
45
+ /**
46
+ * - array of `name`-`element` pairs
47
+ */
48
+ items: pairOfNameAndElement[];
49
+ /**
50
+ * - a default element name
51
+ */
52
+ defaultItem?: string;
53
+ };
54
+
55
+ /**
56
+ * This class implements an interface of a stub-items set
57
+ */
58
+ export class THtmlStubItemsSet {
59
+ /**
60
+ * Creates an instance of a stub-items set
61
+ * @todo [since v0.0.26] use of an `array`-type as a value of an `opt` is deprecated
62
+ */
63
+ constructor(host: HTMLElement, opt?: pairOfNameAndElement[] | IStubEListDesc | IStubItemsSetOptions);
64
+ /**
65
+ * Defines a default element name
66
+ * @type {string}
67
+ */
68
+ set defItem(name: string);
69
+ get defItem(): string;
70
+ /**
71
+ * Contains a Qty of an elements
72
+ * @type {number}
73
+ */
74
+ get count(): number;
75
+ /**
76
+ * Clears an instance content.
77
+ * @todo check if any item is shown
78
+ */
79
+ clear(): void;
80
+ /**
81
+ * Sets a default item.
82
+ */
83
+ setDefItem(name: string): boolean;
84
+ /**
85
+ * Resets a default item.
86
+ * @todo check if item is shown
87
+ */
88
+ rstDefItem(): void;
89
+ /**
90
+ * Checks if an item exists.
91
+ */
92
+ hasItem(name: string): boolean;
93
+ /**
94
+ * Checks if any items exists.
95
+ */
96
+ hasItems(): boolean;
97
+ /**
98
+ * Returns an item by its name.
99
+ */
100
+ getItem(name: string): HTMLElement | null;
101
+ /**
102
+ * Adds an item to an instance members.
103
+ */
104
+ addItem(name: string, item: HTMLElement, opt?: boolean): boolean;
105
+ /**
106
+ * Deletes an item from an instance members.
107
+ * @todo check if item is shown
108
+ */
109
+ delItem(name: string): boolean;
110
+ /**
111
+ * Shows an item.
112
+ */
113
+ showItem(name: string): boolean;
114
+ /**
115
+ * Shows a default item.
116
+ */
117
+ showDefItem(): boolean;
118
+ /**
119
+ * Hides an item.
120
+ */
121
+ hideItem(name: string): boolean;
122
+ /**
123
+ * Hides a default item.
124
+ */
125
+ hideDefItem(): boolean;
126
+ /**
127
+ * Adds an items to an instance members.
128
+ * @todo [since 0.0.25] deprecate use of `opt` as `boolean`
129
+ * @todo [since v0.0.26] for `OPT_ldstubs` a `defaultItem`-option deprecated
130
+ * @todo [since 0.0.32] deprecate use of `data` as `array`
131
+ */
132
+ loadItems(data: pairOfNameAndElement[] | IStubEListDesc, opt?: boolean | OPT_ldstubs): number;
133
+ #private;
134
+ }
@@ -1,4 +1,4 @@
1
- // [v0.1.057-20260505]
1
+ // [v0.1.058-20260510]
2
2
 
3
3
  // === module init block ===
4
4
 
@@ -278,7 +278,6 @@ class THtmlStubItemsSet {
278
278
  if (typeof useClear !== 'boolean') useClear = true;
279
279
  if (typeof force !== 'boolean') force = false;
280
280
  if (defaultItem === undefined) defaultItem = _options.defaultItem; /* deprecated */
281
- const setDefs = defaultItem !== undefined;
282
281
  let count = 0;
283
282
  if (isArray(items)) {
284
283
  if (useClear) this.clear();
@@ -292,7 +291,7 @@ class THtmlStubItemsSet {
292
291
  };
293
292
  });
294
293
  };
295
- if (setDefs && count > 0) this.setDefItem(defaultItem);
294
+ if (defaultItem && count > 0) this.setDefItem(defaultItem);
296
295
  return count;
297
296
  }
298
297
 
@@ -1,18 +1,18 @@
1
- export type IClickEventInfo = {
2
- /**
3
- * - some target element
4
- */
5
- item: object | null;
6
- /**
7
- * - reflects a current click count
8
- */
9
- onClickNum: number;
10
- };
11
-
12
- /**
13
- * @function readOnClickEventInfo
14
- * @param {UIEvent} e - event
15
- * @returns {IClickEventInfo}
16
- * @inner
17
- */
18
- export function readOnClickEventInfo(e: UIEvent): IClickEventInfo;
1
+ export type IClickEventInfo = {
2
+ /**
3
+ * - some target element
4
+ */
5
+ item: object | null;
6
+ /**
7
+ * - reflects a current click count
8
+ */
9
+ onClickNum: number;
10
+ };
11
+
12
+ /**
13
+ * @function readOnClickEventInfo
14
+ * @param {UIEvent} e - event
15
+ * @returns {IClickEventInfo}
16
+ * @inner
17
+ */
18
+ export function readOnClickEventInfo(e: UIEvent): IClickEventInfo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntwg/html-ctrls-lists",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "An HTML-form component: lists",
5
5
  "author": "ygracs <cs70th-om@rambler.ru>",
6
6
  "license": "MIT",
@@ -17,9 +17,10 @@
17
17
  "types": "./index.d.ts",
18
18
  "files": [
19
19
  "doc/*.md",
20
+ "lib/list-cont.js",
21
+ "lib/list-ctrl.js",
20
22
  "lib/lists-stubs.js",
21
23
  "lib/lists-btn.js",
22
- "lib/list.js",
23
24
  "lib/mod-hfunc.js",
24
25
  "lib/*.d.ts",
25
26
  "index.js",