@limetech/lime-web-components 5.20.0 → 5.22.0

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.
@@ -42,18 +42,18 @@ export interface LimeObjectBulkCommand extends AnyCommand {
42
42
  /**
43
43
  * An expression describing what {@link LimeObject}s to operate on
44
44
  */
45
- filter?: Expression;
45
+ filter: Expression | null;
46
46
  }
47
47
  /**
48
48
  * @public
49
49
  * @group Command bus
50
50
  */
51
- export type CommandClass = new (...args: any[]) => AnyCommand;
51
+ export type CommandClass<T extends AnyCommand = AnyCommand> = new (...args: any[]) => T;
52
52
  /**
53
53
  * @public
54
54
  * @group Command bus
55
55
  */
56
- export type CommandIdentifier = CommandClass | string;
56
+ export type CommandIdentifier<T extends AnyCommand = AnyCommand> = CommandClass<T> | string;
57
57
  /**
58
58
  * Service for registering and executing commands
59
59
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"commandbus.d.ts","sourceRoot":"","sources":["../../src/commandbus/commandbus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAMtC;;;;;GAKG;AACH,MAAM,WAAW,UAAU;CAAG;AAE9B;;;;;GAKG;AACH,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACjD;;OAEG;IACH,OAAO,EAAE,uBAAuB,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACvE;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAsB,SAAQ,UAAU;IACrD;;;;;OAKG;IACH,OAAO,EAAE,uBAAuB,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAExD;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,IAAI,E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7B;;;;OAIG;IACH,OAAO,oBAAoB;IAE3B;;;;OAIG;IACH,MAAM,mBAAmB;CAC5B;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC7B,OAAO,EAAE,UAAU,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,kBAAkB,CAAC,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,GAAG;IAClC;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;CAC9C;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,kBACrB,YAAY,UAIrC;AAeD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,iBAAiB,GAAG,MAAM,CAgB1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,iBAAiB,GAAG,MAAM,EAAE,CAW7E"}
@@ -1,4 +1,11 @@
1
- import { DateTimeType } from './types';
1
+ import { DateTimePropertyType } from '../limetype';
2
+ /**
3
+ * The possible types a date can be formatted as.
4
+ *
5
+ * @beta
6
+ * @group Localization
7
+ */
8
+ export type DateTimeType = 'week' | 'relative' | DateTimePropertyType;
2
9
  /**
3
10
  * The hour cycle to use.
4
11
  * - `h11` is 12 hour clock where midnight and midday are 0:00.
@@ -6,14 +13,14 @@ import { DateTimeType } from './types';
6
13
  * - `h23` is 24 hour clock where midnight is 0:00.
7
14
  * - `h24` is 24 hour clock where midnight is 24:00.
8
15
  *
9
- * @alpha
16
+ * @beta
10
17
  * @group Localization
11
18
  */
12
19
  export type HourCycle = 'h11' | 'h12' | 'h23' | 'h24';
13
20
  /**
14
21
  * Options for `DateTimeFormatter.format()`.
15
22
  *
16
- * @alpha
23
+ * @beta
17
24
  * @group Localization
18
25
  */
19
26
  export interface DateTimeFormatterOptions {
@@ -40,7 +47,7 @@ export interface DateTimeFormatterOptions {
40
47
  /**
41
48
  * Service for formatting date and time values.
42
49
  *
43
- * @alpha
50
+ * @beta
44
51
  * @group Localization
45
52
  */
46
53
  export interface DateTimeFormatter {
@@ -48,15 +55,9 @@ export interface DateTimeFormatter {
48
55
  * Format the given date as the given type.
49
56
  *
50
57
  * **Note**<br>
51
- * If a `string` is supplied to the `date` parameter, it may be converted
52
- * to a `Date` object before formatting. Note that, unless the string
53
- * includes date, time, and timezone in an unambiguous format—like
54
- * `'2022-05-23T00:00:00.000Z'`—this may have unexpected consequences.
55
- *
56
- * For example, calling `DateTimeFormatter.format('2022-05-23', 'time')`
57
- * may very well return a nicely formatted time, but the value will
58
- * obviously be nonsense, as there was no time data in the string provided
59
- * in the first place.
58
+ * If a `string` is supplied to the `date` parameter, it will be converted
59
+ * to a `Date` object before formatting. See {@link DateTimeFormatter#parse}
60
+ * for details.
60
61
  *
61
62
  * @param date - The date to format.
62
63
  * @param options - Either a string specifying the type to format the date
@@ -64,5 +65,41 @@ export interface DateTimeFormatter {
64
65
  * @returns A string representation of the date.
65
66
  */
66
67
  format(date: Date | string, options: DateTimeType | DateTimeFormatterOptions): string;
68
+ /**
69
+ * Parse a date value, converting it to local time.
70
+ *
71
+ * A date value passed as a `string` may be converted as a date-only value
72
+ * if `type` is 'date', 'year', 'quarter', 'month' or 'week'. This
73
+ * basically means returning dates as they are stored in the database, by
74
+ * compensating for any time difference.
75
+ *
76
+ * If the date value includes time but not time zone offset, it is always
77
+ * interpreted as local time.
78
+ *
79
+ * A date value passed as a `Date` is returned unmodified.
80
+ *
81
+ * @example
82
+ * ```
83
+ * // Converting a saved date value to 2023-10-24 in local time
84
+ * // The time component of the returned date object should be ignored.
85
+ * const parsedDate = dateTimeFormatter.parse('2023-10-24T00:00:00.000Z', 'date');
86
+ * ```
87
+ *
88
+ * @example
89
+ * ```
90
+ * // Parsing a date value as local time
91
+ * const parsedDate = dateTimeFormatter.parse('2023-10-24 23:59:59', 'date');
92
+ * ```
93
+ *
94
+ * @example
95
+ * ```
96
+ * // Parsing a date-time value including time zone offset
97
+ * const parsedDate = dateTimeFormatter.parse('2023-10-24T13:00:00+02:00', 'time');
98
+ * ```
99
+ *
100
+ * @param date - The date to parse.
101
+ * @param type - A string specifying the type to parse the date as.
102
+ */
103
+ parse(date: Date | string, type: DateTimeType): Date;
67
104
  }
68
105
  //# sourceMappingURL=datetimeformatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"datetimeformatter.d.ts","sourceRoot":"","sources":["../../src/datetimeformatter/datetimeformatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;IAEnB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CACF,IAAI,EAAE,IAAI,GAAG,MAAM,EACnB,OAAO,EAAE,YAAY,GAAG,wBAAwB,GACjD,MAAM,CAAC;CACb"}
1
+ {"version":3,"file":"datetimeformatter.d.ts","sourceRoot":"","sources":["../../src/datetimeformatter/datetimeformatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,oBAAoB,CAAC;AAEtE;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;IAEnB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;;;;;;;;;;;OAYG;IACH,MAAM,CACF,IAAI,EAAE,IAAI,GAAG,MAAM,EACnB,OAAO,EAAE,YAAY,GAAG,wBAAwB,GACjD,MAAM,CAAC;IAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;CACxD"}
@@ -1,5 +1,4 @@
1
1
  import { DateTimeFormatter } from './datetimeformatter';
2
- import { DateTimePropertyType } from '../limetype';
3
2
  declare const SERVICE_NAME = "datetimeformatter";
4
3
  declare module '../core/platform' {
5
4
  interface PlatformServiceNameType {
@@ -12,12 +11,5 @@ declare module '../core/platform' {
12
11
  get(name: PlatformServiceNameType['DateTimeFormatter']): DateTimeFormatter;
13
12
  }
14
13
  }
15
- /**
16
- * The possible types a date can be formatted as.
17
- *
18
- * @alpha
19
- * @group Localization
20
- */
21
- export type DateTimeType = 'week' | 'relative' | DateTimePropertyType;
22
14
  export {};
23
15
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/datetimeformatter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,QAAA,MAAM,YAAY,sBAAsB,CAAC;AAIzC,OAAO,QAAQ,kBAAkB,CAAC;IAC9B,UAAU,uBAAuB;QAC7B;;WAEG;QACH,iBAAiB,EAAE,OAAO,YAAY,CAAC;KAC1C;IAED,UAAU,wBAAwB;QAC9B,GAAG,CACC,IAAI,EAAE,uBAAuB,CAAC,mBAAmB,CAAC,GACnD,iBAAiB,CAAC;KACxB;CACJ;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,oBAAoB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/datetimeformatter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,QAAA,MAAM,YAAY,sBAAsB,CAAC;AAIzC,OAAO,QAAQ,kBAAkB,CAAC;IAC9B,UAAU,uBAAuB;QAC7B;;WAEG;QACH,iBAAiB,EAAE,OAAO,YAAY,CAAC;KAC1C;IAED,UAAU,wBAAwB;QAC9B,GAAG,CACC,IAAI,EAAE,uBAAuB,CAAC,mBAAmB,CAAC,GACnD,iBAAiB,CAAC;KACxB;CACJ"}
@@ -6,6 +6,7 @@ var getDateTimeFormatter = function () {
6
6
  format: jest.fn(function (date, type) {
7
7
  return "".concat(typeof date === 'object' ? JSON.stringify(date) : date, " - ").concat(typeof type === 'object' ? JSON.stringify(type) : type);
8
8
  }),
9
+ parse: jest.fn(function (date) { return new Date(date); }),
9
10
  };
10
11
  };
11
12
  exports.getDateTimeFormatter = getDateTimeFormatter;
@@ -1 +1 @@
1
- {"version":3,"file":"datetimeformatter.d.ts","sourceRoot":"","sources":["../../../src/testing/services/datetimeformatter.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EAGpB,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,oBAAoB,yBAYhC,CAAC"}
1
+ {"version":3,"file":"datetimeformatter.d.ts","sourceRoot":"","sources":["../../../src/testing/services/datetimeformatter.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EAGpB,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,oBAAoB,yBAahC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export const getDateTimeFormatter = () => {
2
2
  return {
3
3
  format: jest.fn((date, type) => `${typeof date === 'object' ? JSON.stringify(date) : date} - ${typeof type === 'object' ? JSON.stringify(type) : type}`),
4
+ parse: jest.fn((date) => new Date(date)),
4
5
  };
5
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-web-components",
3
- "version": "5.20.0",
3
+ "version": "5.22.0",
4
4
  "description": "Lime Web Components",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",