@itrocks/list 0.3.1 → 0.3.3

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/build.js CHANGED
@@ -20,10 +20,10 @@ build('article[data-action="list"] > form > table.objects', table => {
20
20
  });
21
21
  table.addEventListener('click', event => {
22
22
  const element = event.target;
23
- if (!(element instanceof HTMLElement))
23
+ if ((element instanceof HTMLInputElement) || !(element instanceof HTMLElement))
24
24
  return;
25
25
  const cell = element.closest('table, th');
26
- if (!(cell instanceof HTMLTableCellElement) || !cell.classList.contains('select'))
26
+ if (!((cell instanceof HTMLTableCellElement) && cell.classList.contains('select')))
27
27
  return;
28
28
  const input = cell.querySelector('input[type=checkbox]');
29
29
  if (!input)
package/cjs/columns.d.ts CHANGED
@@ -1,18 +1,17 @@
1
- import { KeyOf } from '@itrocks/class-type';
2
1
  import { Type } from '@itrocks/class-type';
3
2
  import { ReflectProperty } from '@itrocks/reflect';
4
3
  import { Request } from '@itrocks/request-response';
5
4
  import { Option } from '@itrocks/storage';
6
5
  import { Parameter } from './parameter';
7
6
  export declare class Columns<T extends object> extends Parameter implements Iterable<ReflectProperty<T>> {
8
- properties: ReflectProperty<T>[];
9
- [Symbol.iterator](): ArrayIterator<ReflectProperty<T>>;
7
+ properties: ReflectProperty<T, keyof T>[];
8
+ [Symbol.iterator](): ArrayIterator<ReflectProperty<T, keyof T>>;
10
9
  getParams(_request: Request, type: Type<T>): void;
11
10
  get length(): number;
12
11
  map(callback: (value: ReflectProperty<T>) => any): any[];
13
12
  readOptions(options?: Option[]): Option[];
14
13
  remove(propertyName: string): void;
15
- serialize(): Extract<keyof T, string>[];
16
- unserialize(data: KeyOf<T>[], type: Type<T>): void;
14
+ serialize(): (keyof T)[];
15
+ unserialize(data: (keyof T)[], type: Type<T>): void;
17
16
  unshift(property: ReflectProperty<T>): number;
18
17
  }
package/cjs/sort.js CHANGED
@@ -50,7 +50,7 @@ class Sort extends parameter_1.Parameter {
50
50
  }
51
51
  }
52
52
  for (const column of this.columns) {
53
- const sortIndex = sortProperties.indexOf(column.name);
53
+ const sortIndex = sortProperties.indexOf(column.name.toString());
54
54
  column.reverse = !!sortReverse[sortIndex];
55
55
  column.sort = (sortIndex + 1) || undefined;
56
56
  }
package/package.json CHANGED
@@ -72,5 +72,5 @@
72
72
  "build:front": "tsc -p esm/tsconfig.json && ../prepare-module/prepare-module.js esm"
73
73
  },
74
74
  "types": "./cjs/list.d.ts",
75
- "version": "0.3.1"
75
+ "version": "0.3.3"
76
76
  }