@cellaware/utils 8.0.4 → 8.1.1
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/azure/cosmos.d.ts
CHANGED
|
@@ -69,19 +69,19 @@ export declare function getCosmosTimestampSecond(timeZone?: string): string;
|
|
|
69
69
|
*
|
|
70
70
|
* NOTE: default time zone is UTC
|
|
71
71
|
*/
|
|
72
|
-
export declare function
|
|
72
|
+
export declare function getCosmosCurrentDayClause(timeZone?: string): string;
|
|
73
73
|
/**
|
|
74
74
|
* Returns a `WHERE` clause condition to retrieve records with a `_ts` of this month
|
|
75
75
|
*
|
|
76
76
|
* NOTE: default time zone is UTC
|
|
77
77
|
*/
|
|
78
|
-
export declare function
|
|
78
|
+
export declare function getCosmosCurrentMonthClause(timeZone?: string): string;
|
|
79
79
|
/**
|
|
80
80
|
* Returns a `WHERE` clause condition to retrieve records with a `_ts` of this year
|
|
81
81
|
*
|
|
82
82
|
* NOTE: default time zone is UTC
|
|
83
83
|
*/
|
|
84
|
-
export declare function
|
|
84
|
+
export declare function getCosmosCurrentYearClause(timeZone?: string): string;
|
|
85
85
|
export declare function cosmosSelect(databaseId: string, collectionId: string, partitionKey: string, query: string): Promise<any[]>;
|
|
86
86
|
export declare function cosmosInsert(databaseId: string, collectionId: string, partitionKey: string, data: any): Promise<boolean>;
|
|
87
87
|
/**
|
package/dist/azure/cosmos.js
CHANGED
|
@@ -141,7 +141,7 @@ export function getCosmosTimestampSecond(timeZone) {
|
|
|
141
141
|
*
|
|
142
142
|
* NOTE: default time zone is UTC
|
|
143
143
|
*/
|
|
144
|
-
export function
|
|
144
|
+
export function getCosmosCurrentDayClause(timeZone) {
|
|
145
145
|
return `DateTimeDiff('dd', ${getCosmosTimestampDateTime(timeZone)}, ${getCosmosCurrentDateTime(timeZone)}) = 0`;
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
@@ -149,7 +149,7 @@ export function getCosmosCurrentDayWhereClause(timeZone) {
|
|
|
149
149
|
*
|
|
150
150
|
* NOTE: default time zone is UTC
|
|
151
151
|
*/
|
|
152
|
-
export function
|
|
152
|
+
export function getCosmosCurrentMonthClause(timeZone) {
|
|
153
153
|
return `DateTimeDiff('mm', ${getCosmosTimestampDateTime(timeZone)}, ${getCosmosCurrentDateTime(timeZone)}) = 0`;
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
@@ -157,7 +157,7 @@ export function getCosmosCurrentMonthWhereClause(timeZone) {
|
|
|
157
157
|
*
|
|
158
158
|
* NOTE: default time zone is UTC
|
|
159
159
|
*/
|
|
160
|
-
export function
|
|
160
|
+
export function getCosmosCurrentYearClause(timeZone) {
|
|
161
161
|
return `DateTimeDiff('yyyy', ${getCosmosTimestampDateTime(timeZone)}, ${getCosmosCurrentDateTime(timeZone)}) = 0`;
|
|
162
162
|
}
|
|
163
163
|
export async function cosmosSelect(databaseId, collectionId, partitionKey, query) {
|
|
@@ -105,6 +105,7 @@ export interface ConditionalFormat {
|
|
|
105
105
|
style: string;
|
|
106
106
|
row: boolean;
|
|
107
107
|
}
|
|
108
|
+
export declare function evaluateConditionalFormat(condFmt: ConditionalFormat, dataType: string, value: any): boolean;
|
|
108
109
|
export interface DatagridCondition {
|
|
109
110
|
columnName: string;
|
|
110
111
|
/** `text` | `number` | `date` | `boolean` */
|
package/dist/chatwms/datagrid.js
CHANGED
|
@@ -230,6 +230,33 @@ export const CONDITIONAL_FORMAT_RULES_BOOLEAN = [
|
|
|
230
230
|
ConditionalFormatRule.BLANK,
|
|
231
231
|
ConditionalFormatRule.NOT_BLANK
|
|
232
232
|
];
|
|
233
|
+
export function evaluateConditionalFormat(condFmt, dataType, value) {
|
|
234
|
+
const isBlank = (v) => v === null || v === undefined || (dataType !== 'number' && dataType !== 'boolean' && v === '');
|
|
235
|
+
const v1 = condFmt.value;
|
|
236
|
+
const v2 = condFmt.value2;
|
|
237
|
+
const ruleHandlers = {
|
|
238
|
+
[ConditionalFormatRule.EQUALS]: () => value == v1,
|
|
239
|
+
[ConditionalFormatRule.DOES_NOT_EQUAL]: () => value != v1,
|
|
240
|
+
[ConditionalFormatRule.GREATER_THAN]: () => value > v1,
|
|
241
|
+
[ConditionalFormatRule.GREATER_THAN_OR_EQUAL_TO]: () => value >= v1,
|
|
242
|
+
[ConditionalFormatRule.LESS_THAN]: () => value < v1,
|
|
243
|
+
[ConditionalFormatRule.LESS_THAN_OR_EQUAL_TO]: () => value <= v1,
|
|
244
|
+
[ConditionalFormatRule.BETWEEN]: () => value >= v1 && value <= (v2 ?? 0),
|
|
245
|
+
[ConditionalFormatRule.CONTAINS]: () => String(value).includes(v1),
|
|
246
|
+
[ConditionalFormatRule.DOES_NOT_CONTAIN]: () => !String(value).includes(v1),
|
|
247
|
+
[ConditionalFormatRule.BEGINS_WITH]: () => String(value).startsWith(v1),
|
|
248
|
+
[ConditionalFormatRule.ENDS_WITH]: () => String(value).endsWith(v1),
|
|
249
|
+
[ConditionalFormatRule.BLANK]: () => isBlank(value),
|
|
250
|
+
[ConditionalFormatRule.NOT_BLANK]: () => !isBlank(value)
|
|
251
|
+
};
|
|
252
|
+
try {
|
|
253
|
+
const fn = ruleHandlers[condFmt.rule];
|
|
254
|
+
return fn ? fn() : false;
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
233
260
|
export function initDatagridCondition() {
|
|
234
261
|
return {
|
|
235
262
|
columnName: '',
|
package/dist/chatwms/report.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export declare const REPORT_VISIBILITY_GLOBAL = "global";
|
|
|
6
6
|
export interface ReportParameter {
|
|
7
7
|
sequence: number;
|
|
8
8
|
name: string;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
required: boolean;
|
|
10
|
+
exampleValue: string;
|
|
11
11
|
}
|
|
12
12
|
export interface Report {
|
|
13
13
|
reportId: string;
|
|
@@ -20,6 +20,7 @@ export interface Report {
|
|
|
20
20
|
brief: string;
|
|
21
21
|
clientId: string;
|
|
22
22
|
userId: string;
|
|
23
|
+
customerLevel?: boolean;
|
|
23
24
|
}
|
|
24
25
|
export declare function initReport(): Report;
|
|
25
26
|
export interface LineReportParameter {
|
|
@@ -40,6 +41,7 @@ export interface ReportLineContentInfo extends DatagridStateBase {
|
|
|
40
41
|
tableGroups?: string[];
|
|
41
42
|
developer?: boolean;
|
|
42
43
|
archive?: boolean;
|
|
44
|
+
referenceLineId?: string;
|
|
43
45
|
}
|
|
44
46
|
export interface ReportLine {
|
|
45
47
|
lineId: string;
|
|
@@ -63,4 +65,5 @@ export interface ReportUsage {
|
|
|
63
65
|
clientId: string;
|
|
64
66
|
userId: string;
|
|
65
67
|
datetime: Date;
|
|
68
|
+
customerLevel?: boolean;
|
|
66
69
|
}
|