@acoustte-digital-services/digitalstore-controls-dev 0.8.1 → 0.8.2-dev.20260324084945

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/index.d.mts CHANGED
@@ -1,12 +1,16 @@
1
- import React from 'react';
1
+ import React, { ComponentType } from 'react';
2
+
3
+ type WidgetRegistryType = Record<string, ComponentType<any> | ((props: any) => any)>;
4
+ declare const registerWidgets: (widgets: WidgetRegistryType) => void;
5
+ declare const getWidget: (code: string) => ComponentType<any> | undefined;
2
6
 
3
7
  interface ViewControlProps {
4
- value?: any;
5
- controlType: string;
8
+ value?: unknown;
9
+ controlType?: string;
6
10
  format?: string;
7
11
  width?: string;
8
12
  apiBaseUrl?: string;
9
- customProps?: Record<string, any>;
13
+ customProps?: Record<string, unknown>;
10
14
  }
11
15
 
12
16
  declare const ViewControl: React.ForwardRefExoticComponent<ViewControlProps & React.RefAttributes<HTMLDivElement>>;
@@ -138,4 +142,74 @@ declare const InputControlType: {
138
142
  booleanSelect: string;
139
143
  };
140
144
 
141
- export { type ActionResponse, InputControl, type InputControlProps, InputControlType, ViewControl, type ViewControlProps, ViewControlTypes };
145
+ interface DataListConfiguration<T> {
146
+ title?: string;
147
+ columns: DataListColumn[];
148
+ filters?: FilterColumn[];
149
+ path: string;
150
+ serviceClient?: ServiceClientInterface;
151
+ query?: {
152
+ [key: string]: string;
153
+ };
154
+ subTitle?: string;
155
+ dataset?: QueryResponse<any>;
156
+ addLinkHref?: string;
157
+ addLinkText?: string;
158
+ recordValidityColumnName?: string;
159
+ altLinkUrl?: string;
160
+ }
161
+ interface DataListColumn {
162
+ label: string;
163
+ name: string;
164
+ controlType: string;
165
+ enableSorting: boolean;
166
+ width: string;
167
+ format?: string;
168
+ showAsLink?: boolean;
169
+ linkUrlSegment?: string;
170
+ emptyValueLabel?: string;
171
+ addhref?: boolean;
172
+ customProps?: any;
173
+ }
174
+ interface FilterColumn {
175
+ placeholder: string;
176
+ name: string;
177
+ servicePath: string;
178
+ dataTextFieldName: string;
179
+ dataKeyFieldName: string;
180
+ dataTypeCode: string;
181
+ }
182
+ declare const DataList: React.FC<DataListConfiguration<any>>;
183
+
184
+ interface Session {
185
+ cid: string;
186
+ contactId?: number;
187
+ fullName?: string;
188
+ truncatedPhone?: string;
189
+ userCurrencyCode?: string;
190
+ marketCode?: string;
191
+ oAuthToken?: string;
192
+ refreshToken?: string;
193
+ }
194
+
195
+ interface PageBodyRendererProps {
196
+ rawBody?: string;
197
+ routeParameters?: {
198
+ [key: string]: unknown;
199
+ };
200
+ query?: {
201
+ [key: string]: string;
202
+ };
203
+ session: Session;
204
+ host: string;
205
+ path: string;
206
+ apiBaseUrl: string;
207
+ breadcrumb?: string;
208
+ donotApplyContainerClass?: boolean;
209
+ donotApplyContainerLargeClass?: boolean;
210
+ serviceClient?: ServiceClientInterface;
211
+ assetBaseUrl?: string;
212
+ }
213
+ declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
214
+
215
+ export { type ActionResponse, DataList, InputControl, type InputControlProps, InputControlType, PageBodyRenderer, ViewControl, type ViewControlProps, ViewControlTypes, getWidget, registerWidgets };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,16 @@
1
- import React from 'react';
1
+ import React, { ComponentType } from 'react';
2
+
3
+ type WidgetRegistryType = Record<string, ComponentType<any> | ((props: any) => any)>;
4
+ declare const registerWidgets: (widgets: WidgetRegistryType) => void;
5
+ declare const getWidget: (code: string) => ComponentType<any> | undefined;
2
6
 
3
7
  interface ViewControlProps {
4
- value?: any;
5
- controlType: string;
8
+ value?: unknown;
9
+ controlType?: string;
6
10
  format?: string;
7
11
  width?: string;
8
12
  apiBaseUrl?: string;
9
- customProps?: Record<string, any>;
13
+ customProps?: Record<string, unknown>;
10
14
  }
11
15
 
12
16
  declare const ViewControl: React.ForwardRefExoticComponent<ViewControlProps & React.RefAttributes<HTMLDivElement>>;
@@ -138,4 +142,74 @@ declare const InputControlType: {
138
142
  booleanSelect: string;
139
143
  };
140
144
 
141
- export { type ActionResponse, InputControl, type InputControlProps, InputControlType, ViewControl, type ViewControlProps, ViewControlTypes };
145
+ interface DataListConfiguration<T> {
146
+ title?: string;
147
+ columns: DataListColumn[];
148
+ filters?: FilterColumn[];
149
+ path: string;
150
+ serviceClient?: ServiceClientInterface;
151
+ query?: {
152
+ [key: string]: string;
153
+ };
154
+ subTitle?: string;
155
+ dataset?: QueryResponse<any>;
156
+ addLinkHref?: string;
157
+ addLinkText?: string;
158
+ recordValidityColumnName?: string;
159
+ altLinkUrl?: string;
160
+ }
161
+ interface DataListColumn {
162
+ label: string;
163
+ name: string;
164
+ controlType: string;
165
+ enableSorting: boolean;
166
+ width: string;
167
+ format?: string;
168
+ showAsLink?: boolean;
169
+ linkUrlSegment?: string;
170
+ emptyValueLabel?: string;
171
+ addhref?: boolean;
172
+ customProps?: any;
173
+ }
174
+ interface FilterColumn {
175
+ placeholder: string;
176
+ name: string;
177
+ servicePath: string;
178
+ dataTextFieldName: string;
179
+ dataKeyFieldName: string;
180
+ dataTypeCode: string;
181
+ }
182
+ declare const DataList: React.FC<DataListConfiguration<any>>;
183
+
184
+ interface Session {
185
+ cid: string;
186
+ contactId?: number;
187
+ fullName?: string;
188
+ truncatedPhone?: string;
189
+ userCurrencyCode?: string;
190
+ marketCode?: string;
191
+ oAuthToken?: string;
192
+ refreshToken?: string;
193
+ }
194
+
195
+ interface PageBodyRendererProps {
196
+ rawBody?: string;
197
+ routeParameters?: {
198
+ [key: string]: unknown;
199
+ };
200
+ query?: {
201
+ [key: string]: string;
202
+ };
203
+ session: Session;
204
+ host: string;
205
+ path: string;
206
+ apiBaseUrl: string;
207
+ breadcrumb?: string;
208
+ donotApplyContainerClass?: boolean;
209
+ donotApplyContainerLargeClass?: boolean;
210
+ serviceClient?: ServiceClientInterface;
211
+ assetBaseUrl?: string;
212
+ }
213
+ declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
214
+
215
+ export { type ActionResponse, DataList, InputControl, type InputControlProps, InputControlType, PageBodyRenderer, ViewControl, type ViewControlProps, ViewControlTypes, getWidget, registerWidgets };