@umbraco-cms/backoffice 14.0.0--preview004-d3a523b7 → 14.0.0--preview004-6d426013
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-cms/packages/core/modal/common/icon-picker/icon-picker-modal.element.js +6 -4
- package/dist-cms/packages/core/modal/token/icon-picker-modal.token.js +1 -1
- package/dist-cms/shared/resources/apiTypeValidators.function.d.ts +4 -0
- package/dist-cms/shared/resources/apiTypeValidators.function.js +9 -0
- package/dist-cms/shared/resources/resource.controller.js +4 -4
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -80,7 +80,6 @@ export let UmbIconPickerModalElement = class UmbIconPickerModalElement extends U
|
|
|
80
80
|
<uui-color-swatch label="${color}" title="${color}" value="${color}"></uui-color-swatch>
|
|
81
81
|
`)}
|
|
82
82
|
</uui-color-swatches>
|
|
83
|
-
|
|
84
83
|
<hr />
|
|
85
84
|
<uui-scroll-container id="icon-selection">${this.renderIconSelection()}</uui-scroll-container>
|
|
86
85
|
</div>
|
|
@@ -112,7 +111,8 @@ export let UmbIconPickerModalElement = class UmbIconPickerModalElement extends U
|
|
|
112
111
|
label="${icon}"
|
|
113
112
|
id="${icon}"
|
|
114
113
|
@click="${this._changeIcon}"
|
|
115
|
-
@keyup="${this._changeIcon}"
|
|
114
|
+
@keyup="${this._changeIcon}">
|
|
115
|
+
</uui-icon>
|
|
116
116
|
`;
|
|
117
117
|
})}`;
|
|
118
118
|
}
|
|
@@ -150,7 +150,8 @@ export let UmbIconPickerModalElement = class UmbIconPickerModalElement extends U
|
|
|
150
150
|
#icon-selection {
|
|
151
151
|
line-height: 0;
|
|
152
152
|
display: grid;
|
|
153
|
-
grid-template-columns: repeat(auto-fit, minmax(40px, calc(100% /
|
|
153
|
+
grid-template-columns: repeat(auto-fit, minmax(40px, calc((100% / 12) - 10px)));
|
|
154
|
+
gap: 10px;
|
|
154
155
|
overflow-y: scroll;
|
|
155
156
|
max-height: 100%;
|
|
156
157
|
min-height: 0;
|
|
@@ -164,6 +165,7 @@ export let UmbIconPickerModalElement = class UmbIconPickerModalElement extends U
|
|
|
164
165
|
height: 100%;
|
|
165
166
|
padding: var(--uui-size-space-3);
|
|
166
167
|
box-sizing: border-box;
|
|
168
|
+
cursor: pointer;
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
#icon-selection .icon-container {
|
|
@@ -181,7 +183,7 @@ export let UmbIconPickerModalElement = class UmbIconPickerModalElement extends U
|
|
|
181
183
|
}
|
|
182
184
|
|
|
183
185
|
uui-color-swatches {
|
|
184
|
-
margin:
|
|
186
|
+
margin: 0;
|
|
185
187
|
}
|
|
186
188
|
`,
|
|
187
189
|
]; }
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ApiError, CancelError, CancelablePromise } from '../../external/backend-api/index.js';
|
|
2
|
+
export declare function isApiError(error: unknown): error is ApiError;
|
|
3
|
+
export declare function isCancelError(error: unknown): error is CancelError;
|
|
4
|
+
export declare function isCancelablePromise<T>(promise: unknown): promise is CancelablePromise<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { isApiError, isCancelError, isCancelablePromise } from './apiTypeValidators.function.js';
|
|
2
3
|
import { UMB_NOTIFICATION_CONTEXT_TOKEN, } from '../../packages/core/notification/index.js';
|
|
3
|
-
import { ApiError, CancelError, CancelablePromise } from '../../external/backend-api/index.js';
|
|
4
4
|
import { UmbBaseController } from '../../libs/controller-api/index.js';
|
|
5
5
|
import { UmbContextConsumerController } from '../../libs/context-api/index.js';
|
|
6
6
|
export class UmbResourceController extends UmbBaseController {
|
|
@@ -27,7 +27,7 @@ export class UmbResourceController extends UmbBaseController {
|
|
|
27
27
|
return { data: await promise };
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
30
|
-
if (error
|
|
30
|
+
if (isApiError(error) || isCancelError(error)) {
|
|
31
31
|
return { error };
|
|
32
32
|
}
|
|
33
33
|
console.error('Unknown error', error);
|
|
@@ -46,7 +46,7 @@ export class UmbResourceController extends UmbBaseController {
|
|
|
46
46
|
* If the error is not a recognizable system error (i.e. a HttpError), then we will show a notification
|
|
47
47
|
* with the error details using the default notification options.
|
|
48
48
|
*/
|
|
49
|
-
if (error
|
|
49
|
+
if (isCancelError(error)) {
|
|
50
50
|
// Cancelled - do nothing
|
|
51
51
|
return {};
|
|
52
52
|
}
|
|
@@ -108,7 +108,7 @@ export class UmbResourceController extends UmbBaseController {
|
|
|
108
108
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortController
|
|
109
109
|
*/
|
|
110
110
|
cancel() {
|
|
111
|
-
if (this.#promise
|
|
111
|
+
if (isCancelablePromise(this.#promise)) {
|
|
112
112
|
this.#promise.cancel();
|
|
113
113
|
}
|
|
114
114
|
}
|