ados-rcm 1.1.821 → 1.1.823

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,6 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { TCanCallback } from '../../AUtils/cbF';
3
3
  import { IObject } from '../../AUtils/objF';
4
+ import { sF } from '../../AUtils/sF';
4
5
  import { IABaseProps } from '../ABase/ABase';
5
6
  import { TIdx } from '../ATypes/ATypes';
6
7
  export interface IAListViewLabelProps<T extends IObject> {
@@ -43,13 +44,14 @@ export interface IAListViewContentProps<T extends IObject> {
43
44
  */
44
45
  item: T;
45
46
  }
47
+ export type TAListViewBold = 'label' | 'content' | 'both' | keyof typeof sF.fontWeights;
46
48
  export interface IAListViewDef<T extends IObject> {
47
49
  /**
48
- * bold? : 'label' | 'content' | 'both'
50
+ * bold? : TCanCallback<IAListViewLabelProps<T>, TAListViewBold>
49
51
  *
50
- * Description : bold of AListView, Default is label
52
+ * Description : bold of AListView, Default is label. Can be 'label', 'content', 'both' or specific weight like 'SemiBold'.
51
53
  */
52
- bold?: 'label' | 'content' | 'both';
54
+ bold?: TCanCallback<IAListViewLabelProps<T>, TAListViewBold>;
53
55
  /**
54
56
  * content? : TCanCallback<IAListViewContentProps<T>, React.ReactNode>
55
57
  *
@@ -75,6 +77,12 @@ export type TAListViewDefs<T extends IObject> = {
75
77
  [key in TIdx]?: IAListViewDef<T>;
76
78
  };
77
79
  export interface IAListViewProps<T extends IObject> extends IABaseProps {
80
+ /**
81
+ * bold? : TAListViewBold
82
+ *
83
+ * Description : global bold setting for AListView
84
+ */
85
+ bold?: TAListViewBold;
78
86
  /**
79
87
  * contentClassName? : string
80
88
  *
@@ -166,4 +174,29 @@ export interface IAListViewProps<T extends IObject> extends IABaseProps {
166
174
  */
167
175
  rowHeight?: number | string;
168
176
  }
177
+ /**
178
+ * AComponent : AListView
179
+ *
180
+ * Description : AListView is a list view component that can show the key:values of items
181
+ *
182
+ * Basic Usage :
183
+ *
184
+ * const defs = {
185
+ * name : {label: 'Name~'}
186
+ * age : {content: ({item}) => item.age},
187
+ * height : {}
188
+ * description : {}
189
+ * }
190
+ * const defaultDef = {
191
+ * label: ({defKey}) => 'label is ' + defKey,
192
+ * content: ({defKey, item}) => 'content is ' + item[defKey]
193
+ * }
194
+ * const user = {name: 'John', age: 20, height: 180, description: 'good'}
195
+ *
196
+ * if (case 1)
197
+ * <AListView defs={defs} item={user}/>
198
+ *
199
+ * if (case 2)
200
+ * <AListView defs={defs} item={user} defaultDef={defaultDef}/>
201
+ */
169
202
  export declare const AListView: <T extends IObject>(props: IAListViewProps<T>) => import("react/jsx-runtime").JSX.Element;