ados-rcm 1.0.88 → 1.0.89
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/dist/AModule/AComponents/ATable/ATable.d.ts +6 -20
- package/dist/AModule/AComponents/ATable/ATableBody.d.ts +1 -0
- package/dist/AModule/AComponents/ATree/ATree.d.ts +6 -0
- package/dist/AModule/AComponents/ATree/ATreeItem.d.ts +3 -2
- package/dist/AModule/AComponents/ATree/ATreeSearch.d.ts +1 -0
- package/dist/AModule/AUtils/objF.d.ts +8 -11
- package/dist/AModule/AUtils/treeF.d.ts +2 -5
- package/dist/index.cjs.js +40 -14
- package/dist/index.es.js +8314 -4618
- package/package.json +1 -1
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ATable
|
|
3
|
-
*
|
|
4
|
-
* Notice 1 : Defs Explanation
|
|
5
|
-
* - Keys of defs are used as each columns.
|
|
6
|
-
* - defaultDef is used as default for each columns, and will not be rendered.
|
|
7
|
-
* - def is calculated as {...defaultDef, ...def}.
|
|
8
|
-
*
|
|
9
|
-
* Notice 2 : Select and Check
|
|
10
|
-
* - Select and Check are different. not like ATree. careful.
|
|
11
|
-
*
|
|
12
|
-
* Notice 3 : entireItems and pagedItems
|
|
13
|
-
* - pagedItems is the items to be rendered.
|
|
14
|
-
* - pagedItems can be provided directly, or it can be calculated from entireItems.
|
|
15
|
-
* - entireItems is the entire items, and will be filtered, sorted, and paged to become the pagedItems.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* Todo 1 : Defs is declared as type. it would be better to declare as interface, but I couldn't find the way.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
1
|
import React from 'react';
|
|
22
2
|
import { TUseValues } from '../../AHooks/useValues';
|
|
23
3
|
import { TCanCallback } from '../../AUtils/cbF';
|
|
@@ -379,6 +359,12 @@ export interface IATableProps<T extends IItem> {
|
|
|
379
359
|
* Description : defs of ATable
|
|
380
360
|
*/
|
|
381
361
|
defs: TATableDefs<T>;
|
|
362
|
+
/**
|
|
363
|
+
* pk? : keyof T | (keyof T)[]
|
|
364
|
+
*
|
|
365
|
+
* Description : pk of ATable
|
|
366
|
+
*/
|
|
367
|
+
pk?: keyof T | (keyof T)[];
|
|
382
368
|
/**
|
|
383
369
|
* defaultDef? : IATableDef<T>
|
|
384
370
|
*
|
|
@@ -5,6 +5,7 @@ import { IItem } from '../../AUtils/objF';
|
|
|
5
5
|
import { IATablePagination, IATableSortation, IATableTRProps, TATableDefs, TATableFilteration } from './ATable';
|
|
6
6
|
interface IATableBodyProps<T extends IItem> {
|
|
7
7
|
defs: TATableDefs<T>;
|
|
8
|
+
isEqual: (a: T, b: T) => boolean;
|
|
8
9
|
rProps?: TCanCallback<IATableTRProps<T>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
9
10
|
useSelect?: TUseValues<T[]>;
|
|
10
11
|
isTableDisabled?: boolean;
|
|
@@ -59,6 +59,12 @@ export interface IATreeAction {
|
|
|
59
59
|
collapseAll: () => void;
|
|
60
60
|
}
|
|
61
61
|
export interface IATreeProps<T extends IATreeItem<T>> extends IABaseProps {
|
|
62
|
+
/**
|
|
63
|
+
* pk? : keyof T | (keyof T)[]
|
|
64
|
+
*
|
|
65
|
+
* Description : pk of ATree. if pk is set, it will be used as key of item. if not, index will be used.
|
|
66
|
+
*/
|
|
67
|
+
pk?: keyof T | (keyof T)[];
|
|
62
68
|
/**
|
|
63
69
|
* ItemRenderer? : (props: IATreeItemProps<T>) => React.ReactNode
|
|
64
70
|
*
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TIcons } from '../AIcon/AIcon';
|
|
3
2
|
import { TUseValues } from '../../AHooks/useValues';
|
|
4
|
-
import {
|
|
3
|
+
import { TIcons } from '../AIcon/AIcon';
|
|
5
4
|
import { Resources } from '../AResource/AResource';
|
|
5
|
+
import { IATreeItem, IATreeSearchResult } from './ATree';
|
|
6
6
|
export interface IATreeItemProps<T> {
|
|
7
|
+
isEqual: (a: T, b: T) => boolean;
|
|
7
8
|
item: T;
|
|
8
9
|
selectDisabled?: (item: T) => boolean | string | undefined;
|
|
9
10
|
isParentDisabled?: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IATreeItem, IATreeSearchResult } from './ATree';
|
|
2
2
|
import { Resources } from '../AResource/AResource';
|
|
3
3
|
interface IATreeSearchProps<T extends IATreeItem<T>> {
|
|
4
|
+
isEqual: (a: T, b: T) => boolean;
|
|
4
5
|
searchResult: IATreeSearchResult<T> | undefined;
|
|
5
6
|
initSearch: (inputValue: string) => void;
|
|
6
7
|
searchUp: () => void;
|
|
@@ -4,19 +4,16 @@ export interface IObject {
|
|
|
4
4
|
[key: TIdx]: any;
|
|
5
5
|
}
|
|
6
6
|
export interface IItem extends IObject {
|
|
7
|
-
idx?: TIdx;
|
|
8
7
|
}
|
|
9
|
-
declare function equal<T extends IItem>(a: T, b: T): boolean;
|
|
10
8
|
export declare const objF: {
|
|
11
|
-
equal:
|
|
12
|
-
parse: <
|
|
9
|
+
equal: <T extends IObject>(a: T, b: T) => boolean;
|
|
10
|
+
parse: <T_1>(value: string) => T_1 | undefined;
|
|
13
11
|
stringify: (value: any, indent?: number | string) => string;
|
|
14
|
-
keys: <
|
|
15
|
-
values: <
|
|
16
|
-
hasKey: <
|
|
17
|
-
map: <
|
|
18
|
-
some: <
|
|
19
|
-
find: <
|
|
12
|
+
keys: <T_2 extends IObject>(obj: T_2) => (keyof T_2)[];
|
|
13
|
+
values: <T_3 extends IObject>(obj: T_3) => T_3[keyof T_3][];
|
|
14
|
+
hasKey: <T_4 extends IObject>(obj: T_4, key: string | number | symbol) => key is keyof T_4;
|
|
15
|
+
map: <T_5 extends IObject, U>(obj: T_5, fn: (keyValue: [keyof T_5, T_5[keyof T_5]], idx: number) => U) => U[];
|
|
16
|
+
some: <T_6 extends IObject>(obj: T_6, fn: (key: keyof T_6, value: T_6[keyof T_6]) => any) => boolean;
|
|
17
|
+
find: <T_7 extends IObject>(obj: T_7, fn: (key: keyof T_7, value: T_7[keyof T_7]) => any) => [string, any] | undefined;
|
|
20
18
|
isReactNode: (value: any) => value is React.ReactNode;
|
|
21
19
|
};
|
|
22
|
-
export {};
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import { TIdx } from '../AComponents/ATypes/ATypes';
|
|
2
1
|
import { IATreeItem } from '../AComponents/ATree/ATree';
|
|
3
|
-
import {
|
|
4
|
-
declare function equal<T extends IItem>(a: T, b: T): boolean;
|
|
2
|
+
import { TIdx } from '../AComponents/ATypes/ATypes';
|
|
5
3
|
declare function find<T extends IATreeItem<T>>(items: T[] | T, predicate: (item: T, idx?: TIdx) => any): T | undefined;
|
|
6
4
|
declare function forEach<T extends IATreeItem<T>>(items: T[] | T, callback: (item: T, idx?: TIdx) => void): void;
|
|
7
5
|
declare function map<T extends IATreeItem<T>, R>(items: T[] | T, callback: (item: T, idx?: TIdx) => R): R[];
|
|
8
6
|
declare function every<T extends IATreeItem<T>>(items: T[] | T, predicate: (item: T, idx?: TIdx) => boolean): boolean;
|
|
9
7
|
declare function filter<T extends IATreeItem<T>>(items: T[] | T, predicate: (item: T, idx?: TIdx) => boolean): T[];
|
|
10
8
|
declare function length<T extends IATreeItem<T>>(items: T[] | T): number;
|
|
11
|
-
declare function replace<T extends IATreeItem<T>>(items: T[] | T, srcItem: T, dstItem: T): T[] | null;
|
|
9
|
+
declare function replace<T extends IATreeItem<T>>(items: T[] | T, srcItem: T, dstItem: T, isEqual: (a: T, b: T) => boolean): T[] | null;
|
|
12
10
|
export declare const treeF: {
|
|
13
11
|
find: typeof find;
|
|
14
12
|
forEach: typeof forEach;
|
|
15
13
|
map: typeof map;
|
|
16
14
|
every: typeof every;
|
|
17
15
|
filter: typeof filter;
|
|
18
|
-
equal: typeof equal;
|
|
19
16
|
length: typeof length;
|
|
20
17
|
replace: typeof replace;
|
|
21
18
|
};
|