@limetech/lime-web-components 4.53.1 → 4.54.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/CHANGELOG.md CHANGED
@@ -3,6 +3,27 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.54.1](https://github.com/Lundalogik/lime-web-components/compare/v4.54.0...v4.54.1) (2022-09-23)
7
+
8
+ **Note:** Version bump only for package @limetech/lime-web-components
9
+
10
+
11
+
12
+
13
+
14
+ # [4.54.0](https://github.com/Lundalogik/lime-web-components/compare/v4.53.1...v4.54.0) (2022-09-19)
15
+
16
+
17
+ ### Features
18
+
19
+ * **commandbus:** add factory method ([3bb2085](https://github.com/Lundalogik/lime-web-components/commit/3bb208557db1b138b9d1f56813bad5140a7ca1fc)), closes [Lundalogik/crm-feature#2892](https://github.com/Lundalogik/crm-feature/issues/2892)
20
+ * **http:** add missing `HttpResponseError` interface ([f86ae62](https://github.com/Lundalogik/lime-web-components/commit/f86ae62d6393b5a6a8f0996ac9da36b5869407b8))
21
+ * **navigator:** add new command for navigating ([73bc129](https://github.com/Lundalogik/lime-web-components/commit/73bc12987c16105ea6159f92d53aeae67dfe9bd9)), closes [Lundalogik/crm-feature#2892](https://github.com/Lundalogik/crm-feature/issues/2892)
22
+
23
+
24
+
25
+
26
+
6
27
  ## [4.53.1](https://github.com/Lundalogik/lime-web-components/compare/v4.53.0...v4.53.1) (2022-09-12)
7
28
 
8
29
  **Note:** Version bump only for package @limetech/lime-web-components
@@ -35,6 +35,13 @@ export interface CommandBus extends CommandHandler {
35
35
  * @returns {CommandHandler} the handler for the command class
36
36
  */
37
37
  getHandler(commandClass: CommandClass): CommandHandler;
38
+ /**
39
+ * Create a command instance from a {@link CommandConfig}
40
+ *
41
+ * @param {CommandConfig} config The command configuration
42
+ * @throws {Error} Thrown if the command has not been registered yet
43
+ */
44
+ createCommand?<T = any>(config: CommandConfig<T>): T;
38
45
  }
39
46
  /**
40
47
  * Service for executing commands
@@ -94,6 +101,22 @@ export interface CommandOptions {
94
101
  */
95
102
  id: string;
96
103
  }
104
+ /**
105
+ * Config for describing a command
106
+ */
107
+ export interface CommandConfig<T = any> {
108
+ /**
109
+ * Id of the command
110
+ *
111
+ * Specified by the {@link Command} decorator when declaring the command
112
+ */
113
+ id: string;
114
+ /**
115
+ * Optional parameters to set when creating the command from the config.
116
+ * All values need to be serializable
117
+ */
118
+ params?: Partial<Record<keyof T, unknown>>;
119
+ }
97
120
  /**
98
121
  * Register a class as a command
99
122
  *
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NavigateCommand = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var commandbus_1 = require("../commandbus");
6
+ var NavigateCommand = (function () {
7
+ function NavigateCommand() {
8
+ }
9
+ NavigateCommand = tslib_1.__decorate([
10
+ (0, commandbus_1.Command)({
11
+ id: 'navigator.navigate',
12
+ })
13
+ ], NavigateCommand);
14
+ return NavigateCommand;
15
+ }());
16
+ exports.NavigateCommand = NavigateCommand;
@@ -4,3 +4,4 @@ var tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./navigator"), exports);
5
5
  tslib_1.__exportStar(require("./types"), exports);
6
6
  tslib_1.__exportStar(require("./decorator"), exports);
7
+ tslib_1.__exportStar(require("./command"), exports);
@@ -70,3 +70,18 @@ export interface HttpHeaders {
70
70
  [header: string]: string | string[];
71
71
  }
72
72
  export declare type HttpResponseType = 'text' | 'json' | 'arraybuffer' | 'blob';
73
+ /**
74
+ * Exceptiopn thrown by {@link HttpClient} when an error occurs while sending a
75
+ * request
76
+ */
77
+ export interface HttpResponseError extends Error {
78
+ name: 'HttpResponseError';
79
+ /**
80
+ * Http status code
81
+ */
82
+ status: number;
83
+ /**
84
+ * The response from the request
85
+ */
86
+ response: Response;
87
+ }
@@ -0,0 +1,24 @@
1
+ import { Location } from './navigator';
2
+ /**
3
+ * Navigates to a new location
4
+ *
5
+ * @id `navigator.navigate`
6
+ */
7
+ export declare class NavigateCommand implements Partial<Location> {
8
+ /**
9
+ * @inheritdoc
10
+ */
11
+ path?: string;
12
+ /**
13
+ * @inheritdoc
14
+ */
15
+ query?: Record<string, unknown>;
16
+ /**
17
+ * @inheritdoc
18
+ */
19
+ hash?: string;
20
+ /**
21
+ * @inheritdoc
22
+ */
23
+ state?: unknown;
24
+ }
@@ -0,0 +1,15 @@
1
+ import { __decorate } from "tslib";
2
+ import { Command } from '../commandbus';
3
+ /**
4
+ * Navigates to a new location
5
+ *
6
+ * @id `navigator.navigate`
7
+ */
8
+ let NavigateCommand = class NavigateCommand {
9
+ };
10
+ NavigateCommand = __decorate([
11
+ Command({
12
+ id: 'navigator.navigate',
13
+ })
14
+ ], NavigateCommand);
15
+ export { NavigateCommand };
@@ -1,3 +1,4 @@
1
1
  export * from './navigator';
2
2
  export * from './types';
3
3
  export * from './decorator';
4
+ export * from './command';
@@ -1,3 +1,4 @@
1
1
  export * from './navigator';
2
2
  export * from './types';
3
3
  export * from './decorator';
4
+ export * from './command';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-web-components",
3
- "version": "4.53.1",
3
+ "version": "4.54.1",
4
4
  "author": "Lime Technologies",
5
5
  "homepage": "https://github.com/Lundalogik/lime-web-components",
6
6
  "license": "Apache-2.0",
@@ -51,5 +51,5 @@
51
51
  "peerDependencies": {
52
52
  "@stencil/core": "^2.17.1"
53
53
  },
54
- "gitHead": "423e86cdd7bd1139b9928817e32e524cee4b1b10"
54
+ "gitHead": "4b82a12b6d6fc9a8c8c1494e7bb3701b6fe8a7c2"
55
55
  }