@je-es/client 0.2.1 → 0.2.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/README.md +2 -2
- package/dist/main.cjs +10 -14
- package/dist/main.cjs.map +1 -1
- package/dist/main.d.cts +19 -15
- package/dist/main.d.ts +19 -15
- package/dist/main.js +10 -14
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.d.cts
CHANGED
|
@@ -731,7 +731,7 @@ declare class StyleManager {
|
|
|
731
731
|
* CSS template literal tag
|
|
732
732
|
* Usage: css`.class { color: red; }`
|
|
733
733
|
*/
|
|
734
|
-
declare function css(strings: TemplateStringsArray, ...values:
|
|
734
|
+
declare function css(strings: TemplateStringsArray, ...values: (string | number | boolean | null | undefined)[]): string;
|
|
735
735
|
|
|
736
736
|
declare class I18nManager {
|
|
737
737
|
private translations;
|
|
@@ -810,9 +810,10 @@ declare class I18nManager {
|
|
|
810
810
|
*
|
|
811
811
|
* @param key Translation key
|
|
812
812
|
* @param params Optional parameters for replacement
|
|
813
|
+
* @param defaultValue Optional default translation key
|
|
813
814
|
* @returns Array of VNode and string elements that can be used as children
|
|
814
815
|
*/
|
|
815
|
-
tHtml(key: string, params?: Record<string, string
|
|
816
|
+
tHtml(key: string, params?: Record<string, string>, defaultValue?: string): (VNode | string)[];
|
|
816
817
|
/**
|
|
817
818
|
* Parse HTML string into VNode and text elements
|
|
818
819
|
* Converts \n and /n sequences to <br> tags
|
|
@@ -898,9 +899,10 @@ declare function tLang(key: string, lang: string, params?: Record<string, string
|
|
|
898
899
|
* Useful for multiline translations with formatting like <br>
|
|
899
900
|
* @param key Translation key
|
|
900
901
|
* @param params Optional parameters
|
|
902
|
+
* @param defaultValue Optional default translation key
|
|
901
903
|
* @returns Array of VNode and string elements that can be used as children
|
|
902
904
|
*/
|
|
903
|
-
declare function tHtml(key: string, params?: Record<string, string
|
|
905
|
+
declare function tHtml(key: string, params?: Record<string, string>, defaultValue?: string): (VNode | string)[];
|
|
904
906
|
/**
|
|
905
907
|
* Set the current language globally (synchronous)
|
|
906
908
|
* @param lang Language code
|
|
@@ -1201,7 +1203,7 @@ interface PopupOptions {
|
|
|
1201
1203
|
}
|
|
1202
1204
|
interface ActivePopup extends PopupOptions {
|
|
1203
1205
|
id: number;
|
|
1204
|
-
resolve?: (value: boolean | string | null | unknown) => void;
|
|
1206
|
+
resolve?: (value: boolean | string | null | Record<string, unknown>) => void;
|
|
1205
1207
|
inputValue?: string;
|
|
1206
1208
|
isSubmitting?: boolean;
|
|
1207
1209
|
}
|
|
@@ -1216,11 +1218,11 @@ declare class Popup extends Component {
|
|
|
1216
1218
|
/**
|
|
1217
1219
|
* Show a custom popup
|
|
1218
1220
|
*/
|
|
1219
|
-
show(options: PopupOptions): Promise<boolean | string | null | unknown
|
|
1221
|
+
show(options: PopupOptions): Promise<boolean | string | null | Record<string, unknown>>;
|
|
1220
1222
|
/**
|
|
1221
1223
|
* Show a form popup
|
|
1222
1224
|
*/
|
|
1223
|
-
showForm(options: PopupFormOptions): Promise<unknown
|
|
1225
|
+
showForm(options: PopupFormOptions): Promise<boolean | string | null | Record<string, unknown>>;
|
|
1224
1226
|
/**
|
|
1225
1227
|
* Show a confirmation dialog
|
|
1226
1228
|
*/
|
|
@@ -1274,7 +1276,7 @@ declare class Popup extends Component {
|
|
|
1274
1276
|
/**
|
|
1275
1277
|
* Close a specific popup
|
|
1276
1278
|
*/
|
|
1277
|
-
closePopup(id: number, result: boolean | string | null | unknown): void;
|
|
1279
|
+
closePopup(id: number, result: boolean | string | null | Record<string, unknown>): void;
|
|
1278
1280
|
/**
|
|
1279
1281
|
* Close all popups
|
|
1280
1282
|
*/
|
|
@@ -1286,7 +1288,7 @@ declare class Popup extends Component {
|
|
|
1286
1288
|
declare function initPopup(container?: HTMLElement): Popup;
|
|
1287
1289
|
declare function getPopup(): Popup;
|
|
1288
1290
|
declare const popup: {
|
|
1289
|
-
show: (options: PopupOptions) => Promise<unknown>;
|
|
1291
|
+
show: (options: PopupOptions) => Promise<string | boolean | Record<string, unknown> | null>;
|
|
1290
1292
|
confirm: (options: Parameters<Popup["confirm"]>[0]) => Promise<boolean>;
|
|
1291
1293
|
alert: (options: Parameters<Popup["alert"]>[0]) => Promise<boolean>;
|
|
1292
1294
|
prompt: (options: {
|
|
@@ -1297,8 +1299,8 @@ declare const popup: {
|
|
|
1297
1299
|
messageTranslateKey?: string;
|
|
1298
1300
|
onConfirm?: () => void | Promise<void>;
|
|
1299
1301
|
}) => Promise<string | null>;
|
|
1300
|
-
showForm: (options: PopupFormOptions) => Promise<unknown>;
|
|
1301
|
-
closePopup: (id: number, result: boolean | string | null | unknown) => void;
|
|
1302
|
+
showForm: (options: PopupFormOptions) => Promise<string | boolean | Record<string, unknown> | null>;
|
|
1303
|
+
closePopup: (id: number, result: boolean | string | null | Record<string, unknown>) => void;
|
|
1302
1304
|
closeLastPopup: () => void;
|
|
1303
1305
|
closeFirstPopup: () => void;
|
|
1304
1306
|
closeAll: () => void;
|
|
@@ -1408,8 +1410,8 @@ interface ItemsLoaderConfig<T> {
|
|
|
1408
1410
|
onLoadMore?: (page: number, items: T[]) => void;
|
|
1409
1411
|
onError?: (error: Error) => void;
|
|
1410
1412
|
initialItems?: T[];
|
|
1411
|
-
extractItems?: (response:
|
|
1412
|
-
extractTotal?: (response:
|
|
1413
|
+
extractItems?: (response: Record<string, unknown>) => T[];
|
|
1414
|
+
extractTotal?: (response: Record<string, unknown>) => number;
|
|
1413
1415
|
getAuthToken?: () => string | null;
|
|
1414
1416
|
enableInfiniteScroll?: boolean;
|
|
1415
1417
|
scrollThreshold?: number;
|
|
@@ -1498,7 +1500,7 @@ interface DropdownConfig {
|
|
|
1498
1500
|
trigger: {
|
|
1499
1501
|
text?: string;
|
|
1500
1502
|
icon?: string;
|
|
1501
|
-
element?: () =>
|
|
1503
|
+
element?: () => VNode | HTMLElement;
|
|
1502
1504
|
className?: string;
|
|
1503
1505
|
};
|
|
1504
1506
|
items: (DropdownItemConfig | 'divider')[];
|
|
@@ -1509,8 +1511,10 @@ interface DropdownConfig {
|
|
|
1509
1511
|
hideArrow?: boolean;
|
|
1510
1512
|
asIcon?: boolean;
|
|
1511
1513
|
className?: string;
|
|
1514
|
+
defaultSelected?: string;
|
|
1512
1515
|
onOpen?: () => void;
|
|
1513
1516
|
onClose?: () => void;
|
|
1517
|
+
onSelect?: (item: DropdownItemConfig) => void;
|
|
1514
1518
|
}
|
|
1515
1519
|
declare class Dropdown extends Component {
|
|
1516
1520
|
config: DropdownConfig;
|
|
@@ -1552,12 +1556,12 @@ declare function createDropdown(config: DropdownConfig): Dropdown;
|
|
|
1552
1556
|
* Debounce function
|
|
1553
1557
|
* Delays function execution until after wait time
|
|
1554
1558
|
*/
|
|
1555
|
-
declare function debounce<T extends (...args: never[]) =>
|
|
1559
|
+
declare function debounce<T extends (...args: never[]) => any>(fn: T, delay: number): (...args: Parameters<T>) => void;
|
|
1556
1560
|
/**
|
|
1557
1561
|
* Throttle function
|
|
1558
1562
|
* Limits function execution to once per time period
|
|
1559
1563
|
*/
|
|
1560
|
-
declare function throttle<T extends (...args: never[]) =>
|
|
1564
|
+
declare function throttle<T extends (...args: never[]) => any>(fn: T, delay: number): (...args: Parameters<T>) => void;
|
|
1561
1565
|
/**
|
|
1562
1566
|
* Class names utility
|
|
1563
1567
|
* Combines class names conditionally
|
package/dist/main.d.ts
CHANGED
|
@@ -731,7 +731,7 @@ declare class StyleManager {
|
|
|
731
731
|
* CSS template literal tag
|
|
732
732
|
* Usage: css`.class { color: red; }`
|
|
733
733
|
*/
|
|
734
|
-
declare function css(strings: TemplateStringsArray, ...values:
|
|
734
|
+
declare function css(strings: TemplateStringsArray, ...values: (string | number | boolean | null | undefined)[]): string;
|
|
735
735
|
|
|
736
736
|
declare class I18nManager {
|
|
737
737
|
private translations;
|
|
@@ -810,9 +810,10 @@ declare class I18nManager {
|
|
|
810
810
|
*
|
|
811
811
|
* @param key Translation key
|
|
812
812
|
* @param params Optional parameters for replacement
|
|
813
|
+
* @param defaultValue Optional default translation key
|
|
813
814
|
* @returns Array of VNode and string elements that can be used as children
|
|
814
815
|
*/
|
|
815
|
-
tHtml(key: string, params?: Record<string, string
|
|
816
|
+
tHtml(key: string, params?: Record<string, string>, defaultValue?: string): (VNode | string)[];
|
|
816
817
|
/**
|
|
817
818
|
* Parse HTML string into VNode and text elements
|
|
818
819
|
* Converts \n and /n sequences to <br> tags
|
|
@@ -898,9 +899,10 @@ declare function tLang(key: string, lang: string, params?: Record<string, string
|
|
|
898
899
|
* Useful for multiline translations with formatting like <br>
|
|
899
900
|
* @param key Translation key
|
|
900
901
|
* @param params Optional parameters
|
|
902
|
+
* @param defaultValue Optional default translation key
|
|
901
903
|
* @returns Array of VNode and string elements that can be used as children
|
|
902
904
|
*/
|
|
903
|
-
declare function tHtml(key: string, params?: Record<string, string
|
|
905
|
+
declare function tHtml(key: string, params?: Record<string, string>, defaultValue?: string): (VNode | string)[];
|
|
904
906
|
/**
|
|
905
907
|
* Set the current language globally (synchronous)
|
|
906
908
|
* @param lang Language code
|
|
@@ -1201,7 +1203,7 @@ interface PopupOptions {
|
|
|
1201
1203
|
}
|
|
1202
1204
|
interface ActivePopup extends PopupOptions {
|
|
1203
1205
|
id: number;
|
|
1204
|
-
resolve?: (value: boolean | string | null | unknown) => void;
|
|
1206
|
+
resolve?: (value: boolean | string | null | Record<string, unknown>) => void;
|
|
1205
1207
|
inputValue?: string;
|
|
1206
1208
|
isSubmitting?: boolean;
|
|
1207
1209
|
}
|
|
@@ -1216,11 +1218,11 @@ declare class Popup extends Component {
|
|
|
1216
1218
|
/**
|
|
1217
1219
|
* Show a custom popup
|
|
1218
1220
|
*/
|
|
1219
|
-
show(options: PopupOptions): Promise<boolean | string | null | unknown
|
|
1221
|
+
show(options: PopupOptions): Promise<boolean | string | null | Record<string, unknown>>;
|
|
1220
1222
|
/**
|
|
1221
1223
|
* Show a form popup
|
|
1222
1224
|
*/
|
|
1223
|
-
showForm(options: PopupFormOptions): Promise<unknown
|
|
1225
|
+
showForm(options: PopupFormOptions): Promise<boolean | string | null | Record<string, unknown>>;
|
|
1224
1226
|
/**
|
|
1225
1227
|
* Show a confirmation dialog
|
|
1226
1228
|
*/
|
|
@@ -1274,7 +1276,7 @@ declare class Popup extends Component {
|
|
|
1274
1276
|
/**
|
|
1275
1277
|
* Close a specific popup
|
|
1276
1278
|
*/
|
|
1277
|
-
closePopup(id: number, result: boolean | string | null | unknown): void;
|
|
1279
|
+
closePopup(id: number, result: boolean | string | null | Record<string, unknown>): void;
|
|
1278
1280
|
/**
|
|
1279
1281
|
* Close all popups
|
|
1280
1282
|
*/
|
|
@@ -1286,7 +1288,7 @@ declare class Popup extends Component {
|
|
|
1286
1288
|
declare function initPopup(container?: HTMLElement): Popup;
|
|
1287
1289
|
declare function getPopup(): Popup;
|
|
1288
1290
|
declare const popup: {
|
|
1289
|
-
show: (options: PopupOptions) => Promise<unknown>;
|
|
1291
|
+
show: (options: PopupOptions) => Promise<string | boolean | Record<string, unknown> | null>;
|
|
1290
1292
|
confirm: (options: Parameters<Popup["confirm"]>[0]) => Promise<boolean>;
|
|
1291
1293
|
alert: (options: Parameters<Popup["alert"]>[0]) => Promise<boolean>;
|
|
1292
1294
|
prompt: (options: {
|
|
@@ -1297,8 +1299,8 @@ declare const popup: {
|
|
|
1297
1299
|
messageTranslateKey?: string;
|
|
1298
1300
|
onConfirm?: () => void | Promise<void>;
|
|
1299
1301
|
}) => Promise<string | null>;
|
|
1300
|
-
showForm: (options: PopupFormOptions) => Promise<unknown>;
|
|
1301
|
-
closePopup: (id: number, result: boolean | string | null | unknown) => void;
|
|
1302
|
+
showForm: (options: PopupFormOptions) => Promise<string | boolean | Record<string, unknown> | null>;
|
|
1303
|
+
closePopup: (id: number, result: boolean | string | null | Record<string, unknown>) => void;
|
|
1302
1304
|
closeLastPopup: () => void;
|
|
1303
1305
|
closeFirstPopup: () => void;
|
|
1304
1306
|
closeAll: () => void;
|
|
@@ -1408,8 +1410,8 @@ interface ItemsLoaderConfig<T> {
|
|
|
1408
1410
|
onLoadMore?: (page: number, items: T[]) => void;
|
|
1409
1411
|
onError?: (error: Error) => void;
|
|
1410
1412
|
initialItems?: T[];
|
|
1411
|
-
extractItems?: (response:
|
|
1412
|
-
extractTotal?: (response:
|
|
1413
|
+
extractItems?: (response: Record<string, unknown>) => T[];
|
|
1414
|
+
extractTotal?: (response: Record<string, unknown>) => number;
|
|
1413
1415
|
getAuthToken?: () => string | null;
|
|
1414
1416
|
enableInfiniteScroll?: boolean;
|
|
1415
1417
|
scrollThreshold?: number;
|
|
@@ -1498,7 +1500,7 @@ interface DropdownConfig {
|
|
|
1498
1500
|
trigger: {
|
|
1499
1501
|
text?: string;
|
|
1500
1502
|
icon?: string;
|
|
1501
|
-
element?: () =>
|
|
1503
|
+
element?: () => VNode | HTMLElement;
|
|
1502
1504
|
className?: string;
|
|
1503
1505
|
};
|
|
1504
1506
|
items: (DropdownItemConfig | 'divider')[];
|
|
@@ -1509,8 +1511,10 @@ interface DropdownConfig {
|
|
|
1509
1511
|
hideArrow?: boolean;
|
|
1510
1512
|
asIcon?: boolean;
|
|
1511
1513
|
className?: string;
|
|
1514
|
+
defaultSelected?: string;
|
|
1512
1515
|
onOpen?: () => void;
|
|
1513
1516
|
onClose?: () => void;
|
|
1517
|
+
onSelect?: (item: DropdownItemConfig) => void;
|
|
1514
1518
|
}
|
|
1515
1519
|
declare class Dropdown extends Component {
|
|
1516
1520
|
config: DropdownConfig;
|
|
@@ -1552,12 +1556,12 @@ declare function createDropdown(config: DropdownConfig): Dropdown;
|
|
|
1552
1556
|
* Debounce function
|
|
1553
1557
|
* Delays function execution until after wait time
|
|
1554
1558
|
*/
|
|
1555
|
-
declare function debounce<T extends (...args: never[]) =>
|
|
1559
|
+
declare function debounce<T extends (...args: never[]) => any>(fn: T, delay: number): (...args: Parameters<T>) => void;
|
|
1556
1560
|
/**
|
|
1557
1561
|
* Throttle function
|
|
1558
1562
|
* Limits function execution to once per time period
|
|
1559
1563
|
*/
|
|
1560
|
-
declare function throttle<T extends (...args: never[]) =>
|
|
1564
|
+
declare function throttle<T extends (...args: never[]) => any>(fn: T, delay: number): (...args: Parameters<T>) => void;
|
|
1561
1565
|
/**
|
|
1562
1566
|
* Class names utility
|
|
1563
1567
|
* Combines class names conditionally
|