chayns-api 2.4.3 → 2.4.5

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.
@@ -116,7 +116,8 @@ class AppWrapper {
116
116
  },
117
117
  dynamicFontSize: false,
118
118
  locationPersonId: AppInfo.LocationPersonId,
119
- urlHash: (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.location.hash.replace('#', '')
119
+ urlHash: (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.location.hash.replace('#', ''),
120
+ icon: `https://tsimg.cloud/${AppInfo.SiteID}/profile.png`
120
121
  },
121
122
  parameters: Object.fromEntries(urlParams),
122
123
  user: {
@@ -105,7 +105,8 @@ export class AppWrapper {
105
105
  },
106
106
  dynamicFontSize: false,
107
107
  locationPersonId: AppInfo.LocationPersonId,
108
- urlHash: (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.location.hash.replace('#', '')
108
+ urlHash: (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.location.hash.replace('#', ''),
109
+ icon: `https://tsimg.cloud/${AppInfo.SiteID}/profile.png`
109
110
  },
110
111
  parameters: Object.fromEntries(urlParams),
111
112
  user: {
@@ -132,8 +132,8 @@ export declare enum DialogSelectType {
132
132
  IMAGE = 2,
133
133
  SIMPLE = 3
134
134
  }
135
- export type DialogSelectListItemType = {
136
- id: number | string;
135
+ export type DialogSelectListItemType<T extends number | string = number | string> = {
136
+ id: T;
137
137
  name: string;
138
138
  subtitle?: string;
139
139
  disabled?: boolean;
@@ -145,10 +145,10 @@ export type DialogSelectListItemType = {
145
145
  className?: string;
146
146
  icon?: string;
147
147
  };
148
- export interface DialogSelect {
148
+ export interface DialogSelect<T extends number | string = number | string> {
149
149
  type: DialogType.SELECT;
150
- list: DialogSelectListItemType[];
151
- fixedItem?: DialogSelectListItemType & {
150
+ list: DialogSelectListItemType<T>[];
151
+ fixedItem?: DialogSelectListItemType<T> & {
152
152
  position?: 'top' | 'bottom';
153
153
  };
154
154
  multiselect?: boolean;
@@ -191,6 +191,7 @@ export type ChaynsApiSite = {
191
191
  url: string;
192
192
  urlHash: string;
193
193
  originSiteId?: string;
194
+ icon: string;
194
195
  };
195
196
  export declare enum IconStyle {
196
197
  SOLID = 0,
@@ -410,7 +411,7 @@ export interface ChaynsReactFunctions {
410
411
  setOverlay: (value: ShowOverlay, callback: () => void) => Promise<void>;
411
412
  createDialog(config: BaseDialog & (DialogAlert | DialogConfirm | DialogToast)): DialogHandler<void>;
412
413
  createDialog(config: BaseDialog & (DialogInput | DialogSignature)): DialogHandler<string>;
413
- createDialog(config: BaseDialog & DialogSelect): DialogHandler<(number | string)[]>;
414
+ createDialog<T extends number | string = number | string>(config: BaseDialog & DialogSelect<T>): DialogHandler<T[]>;
414
415
  createDialog(config: BaseDialog & DialogDate & ({
415
416
  multiselect: true;
416
417
  } | {
@@ -418,7 +419,8 @@ export interface ChaynsReactFunctions {
418
419
  })): DialogHandler<Date[]>;
419
420
  createDialog(config: BaseDialog & DialogDate): DialogHandler<Date>;
420
421
  createDialog(config: BaseDialog & DialogFileSelect): DialogHandler<DialogResultFile[]>;
421
- createDialog<I = any, R = unknown>(config: BaseDialog & (DialogModule<I> | DialogIFrame<I>)): DialogHandler<R>;
422
+ createDialog<Input = any, Result = unknown>(config: BaseDialog & (DialogModule<Input> | DialogIFrame<Input>)): DialogHandler<Result>;
423
+ createDialog<Input = any, Result = unknown>(config: BaseDialog & (DialogAlert | DialogConfirm | DialogToast | DialogInput | DialogSignature | DialogSelect | DialogDate | DialogFileSelect | DialogIFrame<Input> | DialogModule<Input>)): any;
422
424
  openDialog: (value: any, callback: (data: any) => any) => Promise<any>;
423
425
  closeDialog: (dialogId: number) => Promise<void>;
424
426
  setDialogResult: (buttonType: DialogButtonType, result: any) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.4.3",
3
+ "version": "2.4.5",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",