@simplysm/angular 14.0.39 → 14.0.41
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/controls/collapse/sd-collapse.d.ts +2 -1
- package/dist/controls/collapse/sd-collapse.d.ts.map +1 -1
- package/dist/controls/collapse/sd-collapse.js +6 -0
- package/dist/controls/dropdown/sd-dropdown.js +6 -6
- package/dist/controls/list/sd-list-item.d.ts.map +1 -1
- package/dist/controls/list/sd-list-item.js +3 -3
- package/dist/controls/select/sd-select.d.ts.map +1 -1
- package/dist/controls/select/sd-select.js +7 -11
- package/dist/core/app-structure/sd-app-structure.provider.d.ts +2 -2
- package/dist/core/app-structure/sd-app-structure.provider.d.ts.map +1 -1
- package/dist/core/app-structure/sd-app-structure.provider.js +4 -4
- package/dist/core/config/sd-local-storage.provider.d.ts +1 -1
- package/dist/core/config/sd-local-storage.provider.d.ts.map +1 -1
- package/dist/core/config/sd-local-storage.provider.js +4 -4
- package/dist/core/error-handler/sd-global-error-handler.plugin.d.ts +1 -1
- package/dist/core/error-handler/sd-global-error-handler.plugin.d.ts.map +1 -1
- package/dist/core/error-handler/sd-global-error-handler.plugin.js +3 -3
- package/dist/core/modal/injectFocusTrap.js +4 -4
- package/dist/core/modal/sd-modal.d.ts +2 -2
- package/dist/core/modal/sd-modal.d.ts.map +1 -1
- package/dist/core/modal/sd-modal.js +8 -8
- package/dist/core/modal/sd-modal.provider.js +4 -4
- package/dist/core/routing/injectViewTitleSignal.js +3 -3
- package/dist/core/routing/injectViewTypeSignal.js +2 -2
- package/dist/core/routing/sd-router-link.d.ts +1 -1
- package/dist/core/routing/sd-router-link.d.ts.map +1 -1
- package/dist/core/routing/sd-router-link.js +4 -4
- package/dist/core/routing/setupCanDeactivate.js +3 -3
- package/dist/core/service-client/sd-service-client-factory.provider.d.ts +2 -2
- package/dist/core/service-client/sd-service-client-factory.provider.d.ts.map +1 -1
- package/dist/core/service-client/sd-service-client-factory.provider.js +4 -4
- package/dist/core/shared-data/sd-shared-data.provider.d.ts +4 -3
- package/dist/core/shared-data/sd-shared-data.provider.d.ts.map +1 -1
- package/dist/core/shared-data/sd-shared-data.provider.js +4 -4
- package/dist/core/toast/sd-toast-container.js +2 -2
- package/dist/core/toast/sd-toast.d.ts.map +1 -1
- package/dist/core/toast/sd-toast.js +30 -25
- package/dist/core/toast/sd-toast.provider.d.ts +3 -3
- package/dist/core/toast/sd-toast.provider.d.ts.map +1 -1
- package/dist/core/toast/sd-toast.provider.js +2 -2
- package/dist/core/validation/setupInvalid.js +6 -5
- package/dist/data/data-detail/sd-data-detail.base.d.ts +6 -4
- package/dist/data/data-detail/sd-data-detail.base.d.ts.map +1 -1
- package/dist/data/data-select-button/sd-data-select-button.base.d.ts +2 -2
- package/dist/data/data-select-button/sd-data-select-button.base.d.ts.map +1 -1
- package/dist/data/sheet/sd-sheet.d.ts +1 -1
- package/dist/data/sheet/sd-sheet.d.ts.map +1 -1
- package/dist/data/sheet/sd-sheet.js +2 -2
- package/dist/data/sheet/useSheetCellAgent.js +6 -6
- package/dist/layout/base-container/sd-base-container.d.ts +1 -1
- package/dist/layout/base-container/sd-base-container.d.ts.map +1 -1
- package/dist/layout/base-container/sd-base-container.js +2 -2
- package/dist/layout/sidebar/sd-sidebar-menu.js +3 -3
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/scss/commons/_styles.scss +1 -1
- package/src/controls/collapse/sd-collapse.ts +6 -0
- package/src/controls/dropdown/sd-dropdown.ts +6 -6
- package/src/controls/list/sd-list-item.ts +0 -6
- package/src/controls/select/sd-select.ts +8 -13
- package/src/core/app-structure/sd-app-structure.provider.ts +4 -4
- package/src/core/config/sd-local-storage.provider.ts +4 -4
- package/src/core/error-handler/sd-global-error-handler.plugin.ts +3 -3
- package/src/core/modal/injectFocusTrap.ts +4 -4
- package/src/core/modal/sd-modal.provider.ts +4 -4
- package/src/core/modal/sd-modal.ts +8 -8
- package/src/core/routing/injectViewTitleSignal.ts +3 -3
- package/src/core/routing/injectViewTypeSignal.ts +2 -2
- package/src/core/routing/sd-router-link.ts +4 -4
- package/src/core/routing/setupCanDeactivate.ts +3 -3
- package/src/core/service-client/sd-service-client-factory.provider.ts +4 -4
- package/src/core/shared-data/sd-shared-data.provider.ts +5 -5
- package/src/core/toast/sd-toast-container.ts +8 -8
- package/src/core/toast/sd-toast.provider.ts +6 -6
- package/src/core/toast/sd-toast.ts +82 -49
- package/src/core/validation/setupInvalid.ts +7 -6
- package/src/data/data-detail/sd-data-detail.base.ts +3 -3
- package/src/data/data-select-button/sd-data-select-button.base.ts +1 -1
- package/src/data/sheet/sd-sheet.ts +2 -2
- package/src/data/sheet/useSheetCellAgent.ts +6 -6
- package/src/layout/base-container/sd-base-container.ts +2 -2
- package/src/layout/sidebar/sd-sidebar-menu.ts +1 -1
|
@@ -4,8 +4,9 @@ export declare class SdCollapse {
|
|
|
4
4
|
open: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
5
5
|
private readonly _contentElRef;
|
|
6
6
|
contentHeight: import("@angular/core").WritableSignal<number>;
|
|
7
|
+
private readonly _initialized;
|
|
7
8
|
contentMarginTop: import("@angular/core").Signal<string>;
|
|
8
|
-
contentTransition: import("@angular/core").Signal<"margin-top 0.1s ease-out" | "margin-top 0.1s ease-in">;
|
|
9
|
+
contentTransition: import("@angular/core").Signal<"" | "margin-top 0.1s ease-out" | "margin-top 0.1s ease-in">;
|
|
9
10
|
constructor();
|
|
10
11
|
onContentResize(event: SdResizeEvent): void;
|
|
11
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdCollapse, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-collapse.d.ts","sourceRoot":"","sources":["../../../src/controls/collapse/sd-collapse.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;;AAE9E,qBA0Ba,UAAU;IACrB,IAAI,qEAAiD;IAErD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAC6B;IAE3D,aAAa,iDAAa;IAE1B,gBAAgB,yCAEb;IAEH,iBAAiB,
|
|
1
|
+
{"version":3,"file":"sd-collapse.d.ts","sourceRoot":"","sources":["../../../src/controls/collapse/sd-collapse.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;;AAE9E,qBA0Ba,UAAU;IACrB,IAAI,qEAAiD;IAErD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAC6B;IAE3D,aAAa,iDAAa;IAE1B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAiB;IAE9C,gBAAgB,yCAEb;IAEH,iBAAiB,8FAGd;;IAiBH,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;yCAlChC,UAAU;2CAAV,UAAU;CAuCtB"}
|
|
@@ -6,15 +6,21 @@ export class SdCollapse {
|
|
|
6
6
|
open = input(false, { ...(ngDevMode ? { debugName: "open" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
7
7
|
_contentElRef = viewChild.required("contentEl");
|
|
8
8
|
contentHeight = signal(0, ...(ngDevMode ? [{ debugName: "contentHeight" }] : /* istanbul ignore next */ []));
|
|
9
|
+
_initialized = signal(false, ...(ngDevMode ? [{ debugName: "_initialized" }] : /* istanbul ignore next */ []));
|
|
9
10
|
contentMarginTop = computed(() => {
|
|
10
11
|
return this.open() ? "" : `-${this.contentHeight()}px`;
|
|
11
12
|
}, ...(ngDevMode ? [{ debugName: "contentMarginTop" }] : /* istanbul ignore next */ []));
|
|
12
13
|
contentTransition = computed(() => {
|
|
14
|
+
if (!this._initialized())
|
|
15
|
+
return "";
|
|
13
16
|
return this.open() ? "margin-top 0.1s ease-out" : "margin-top 0.1s ease-in";
|
|
14
17
|
}, ...(ngDevMode ? [{ debugName: "contentTransition" }] : /* istanbul ignore next */ []));
|
|
15
18
|
constructor() {
|
|
16
19
|
afterNextRender(() => {
|
|
17
20
|
this.contentHeight.set(this._contentElRef().nativeElement.offsetHeight);
|
|
21
|
+
requestAnimationFrame(() => {
|
|
22
|
+
this._initialized.set(true);
|
|
23
|
+
});
|
|
18
24
|
});
|
|
19
25
|
effect(() => {
|
|
20
26
|
// Re-measure height on open transition to handle stale values from closed state
|
|
@@ -89,11 +89,11 @@ export class SdDropdown {
|
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
91
|
const popupEl = this.popupElRef().nativeElement;
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
92
|
+
const tabbable = popupEl.findFirstTabbableChild();
|
|
93
|
+
if (tabbable) {
|
|
94
94
|
event.preventDefault();
|
|
95
95
|
event.stopPropagation();
|
|
96
|
-
|
|
96
|
+
tabbable.focus();
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -204,9 +204,9 @@ export class SdDropdown {
|
|
|
204
204
|
if (relatedTarget == null &&
|
|
205
205
|
mouseoverEl instanceof HTMLElement &&
|
|
206
206
|
(contentEl.contains(mouseoverEl) === true || popupEl.contains(mouseoverEl) === true)) {
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
|
|
207
|
+
const tabbable = popupEl.findFirstTabbableChild();
|
|
208
|
+
if (tabbable != null) {
|
|
209
|
+
tabbable.focus();
|
|
210
210
|
}
|
|
211
211
|
else {
|
|
212
212
|
contentEl.focus();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-list-item.d.ts","sourceRoot":"","sources":["../../../src/controls/list/sd-list-item.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,WAAW,EAEZ,MAAM,eAAe,CAAC;;AAQvB,
|
|
1
|
+
{"version":3,"file":"sd-list-item.d.ts","sourceRoot":"","sources":["../../../src/controls/list/sd-list-item.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,WAAW,EAEZ,MAAM,eAAe,CAAC;;AAQvB,qBA0Fa,UAAU;IACrB,MAAM,4DAA4C;IAClD,IAAI,+CAAgB;IACpB,QAAQ,qEAAiD;IACzD,YAAY,0DAAmB;IAC/B,QAAQ,qEAAiD;IACzD,YAAY,0DAAmB;IAC/B,YAAY,0DAAmB;IAE/B,OAAO,gEAA8C;IAErD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA2B;IAEvD,WAAW,0CAAiD;IAE5D,YAAY,0CAET;;IAMH,cAAc,IAAI,IAAI;yCAvBX,UAAU;2CAAV,UAAU;CA6BtB"}
|
|
@@ -94,7 +94,7 @@ export class SdListItem {
|
|
|
94
94
|
i0.ɵɵconditional(ctx.toolTpl() ? 5 : -1);
|
|
95
95
|
i0.ɵɵadvance();
|
|
96
96
|
i0.ɵɵconditional(ctx.hasChildren() ? 6 : -1);
|
|
97
|
-
} }, dependencies: [SdCollapse, SdCollapseIcon, NgTemplateOutlet, NgIcon], styles: ["sd-list-item {\n display: block;\n}\nsd-list-item > ._content {\n display: flex;\n align-items: center;\n padding: var(--gap-sm) var(--gap-default);\n cursor: pointer;\n gap: var(--gap-sm);\n}\nsd-list-item > ._content > ._label {\n flex: 1;\n}\nsd-list-item:hover > ._content {\n background: var(--trans-lighter);\n}\nsd-list-item[data-sd-selected=true] > ._content {\n background: var(--trans-lighter);\n font-weight: bold;\n}\nsd-list-item[data-sd-readonly=true] > ._content {\n cursor: default;\n}\nsd-list-item[data-sd-readonly=true]:hover > ._content {\n background: transparent;\n}\nsd-list-item[data-sd-layout=flat] > ._content {\n font-size: 0.85em;\n opacity: 0.7;\n cursor: default;\n}\nsd-list-item[data-sd-layout=flat]:hover > ._content {\n background: transparent;\n}
|
|
97
|
+
} }, dependencies: [SdCollapse, SdCollapseIcon, NgTemplateOutlet, NgIcon], styles: ["sd-list-item {\n display: block;\n}\nsd-list-item > ._content {\n display: flex;\n align-items: center;\n padding: var(--gap-sm) var(--gap-default);\n cursor: pointer;\n gap: var(--gap-sm);\n}\nsd-list-item > ._content > ._label {\n flex: 1;\n}\nsd-list-item:hover > ._content {\n background: var(--trans-lighter);\n}\nsd-list-item[data-sd-selected=true] > ._content {\n background: var(--trans-lighter);\n font-weight: bold;\n}\nsd-list-item[data-sd-readonly=true] > ._content {\n cursor: default;\n}\nsd-list-item[data-sd-readonly=true]:hover > ._content {\n background: transparent;\n}\nsd-list-item[data-sd-layout=flat] > ._content {\n font-size: 0.85em;\n opacity: 0.7;\n cursor: default;\n}\nsd-list-item[data-sd-layout=flat]:hover > ._content {\n background: transparent;\n}"], encapsulation: 2, changeDetection: 0 });
|
|
98
98
|
}
|
|
99
99
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SdListItem, [{
|
|
100
100
|
type: Component,
|
|
@@ -129,6 +129,6 @@ export class SdListItem {
|
|
|
129
129
|
"[attr.data-sd-selected]": "selected()",
|
|
130
130
|
"[attr.data-sd-readonly]": "readonly()",
|
|
131
131
|
"[attr.data-sd-has-children]": "hasChildren()",
|
|
132
|
-
}, styles: ["sd-list-item {\n display: block;\n}\nsd-list-item > ._content {\n display: flex;\n align-items: center;\n padding: var(--gap-sm) var(--gap-default);\n cursor: pointer;\n gap: var(--gap-sm);\n}\nsd-list-item > ._content > ._label {\n flex: 1;\n}\nsd-list-item:hover > ._content {\n background: var(--trans-lighter);\n}\nsd-list-item[data-sd-selected=true] > ._content {\n background: var(--trans-lighter);\n font-weight: bold;\n}\nsd-list-item[data-sd-readonly=true] > ._content {\n cursor: default;\n}\nsd-list-item[data-sd-readonly=true]:hover > ._content {\n background: transparent;\n}\nsd-list-item[data-sd-layout=flat] > ._content {\n font-size: 0.85em;\n opacity: 0.7;\n cursor: default;\n}\nsd-list-item[data-sd-layout=flat]:hover > ._content {\n background: transparent;\n}
|
|
132
|
+
}, styles: ["sd-list-item {\n display: block;\n}\nsd-list-item > ._content {\n display: flex;\n align-items: center;\n padding: var(--gap-sm) var(--gap-default);\n cursor: pointer;\n gap: var(--gap-sm);\n}\nsd-list-item > ._content > ._label {\n flex: 1;\n}\nsd-list-item:hover > ._content {\n background: var(--trans-lighter);\n}\nsd-list-item[data-sd-selected=true] > ._content {\n background: var(--trans-lighter);\n font-weight: bold;\n}\nsd-list-item[data-sd-readonly=true] > ._content {\n cursor: default;\n}\nsd-list-item[data-sd-readonly=true]:hover > ._content {\n background: transparent;\n}\nsd-list-item[data-sd-layout=flat] > ._content {\n font-size: 0.85em;\n opacity: 0.7;\n cursor: default;\n}\nsd-list-item[data-sd-layout=flat]:hover > ._content {\n background: transparent;\n}"] }]
|
|
133
133
|
}], () => [], { layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], selectedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIcon", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], contentStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentStyle", required: false }] }], contentClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentClass", required: false }] }], toolTpl: [{ type: i0.ContentChild, args: ["toolTpl", { isSignal: true }] }], _childLists: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdList), { isSignal: true }] }] }); })();
|
|
134
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdListItem, { className: "SdListItem", filePath: "packages/angular/src/controls/list/sd-list-item.ts", lineNumber:
|
|
134
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdListItem, { className: "SdListItem", filePath: "packages/angular/src/controls/list/sd-list-item.ts", lineNumber: 110, forbidOrphanRendering: true }); })();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-select.d.ts","sourceRoot":"","sources":["../../../src/controls/select/sd-select.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,WAAW,EAIZ,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;;AAUhD,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAC/B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,MAAM,EAAE,CAAC,CAAC;CACX,CAAC;AAEF,qBAmJa,QAAQ,CAAC,CAAC,SAAS,QAAQ,GAAG,OAAO,EAAE,CAAC;IACnD,UAAU,yCAAwB;IAClC,KAAK,2EAAoC;IACzC,WAAW,0DAAmB;IAC9B,QAAQ,qEAAiD;IACzD,MAAM,qEAAiD;IACvD,KAAK,qEAAiD;IACtD,IAAI,+DAAwB;IAC5B,QAAQ,qEAAiD;IAEzD,aAAa,qEAAiD;IAC9D,8BAA8B,8DAAuB;IAErD,KAAK,uDAAgB;IACrB,aAAa,8CAAgB,CAAC,KAAK,CAAC,EAAE,GAAG,SAAS,eAAI;IAEtD,YAAY,0DAAmB;IAC/B,YAAY,0DAAmB;IAE/B,YAAY,kDAAiB;IAE7B,SAAS,CAAC,QAAQ,CAAC,eAAe,iUAAmB;IAErD,aAAa,+DAAiC;IAC9C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkC;IACnE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAG7B;IAEF,UAAU,gEAAgD;IAC1D,UAAU,gEAAgD;IAC1D,UAAU,+DAAyD;IAEnE,wBAAwB,6DAAyC;IAEjE,UAAU;cAIY,CAAC;eAAS,MAAM;eAAS,MAAM;SAelD;;
|
|
1
|
+
{"version":3,"file":"sd-select.d.ts","sourceRoot":"","sources":["../../../src/controls/select/sd-select.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,WAAW,EAIZ,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;;AAUhD,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAC/B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,MAAM,EAAE,CAAC,CAAC;CACX,CAAC;AAEF,qBAmJa,QAAQ,CAAC,CAAC,SAAS,QAAQ,GAAG,OAAO,EAAE,CAAC;IACnD,UAAU,yCAAwB;IAClC,KAAK,2EAAoC;IACzC,WAAW,0DAAmB;IAC9B,QAAQ,qEAAiD;IACzD,MAAM,qEAAiD;IACvD,KAAK,qEAAiD;IACtD,IAAI,+DAAwB;IAC5B,QAAQ,qEAAiD;IAEzD,aAAa,qEAAiD;IAC9D,8BAA8B,8DAAuB;IAErD,KAAK,uDAAgB;IACrB,aAAa,8CAAgB,CAAC,KAAK,CAAC,EAAE,GAAG,SAAS,eAAI;IAEtD,YAAY,0DAAmB;IAC/B,YAAY,0DAAmB;IAE/B,YAAY,kDAAiB;IAE7B,SAAS,CAAC,QAAQ,CAAC,eAAe,iUAAmB;IAErD,aAAa,+DAAiC;IAC9C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkC;IACnE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAG7B;IAEF,UAAU,gEAAgD;IAC1D,UAAU,gEAAgD;IAC1D,UAAU,+DAAyD;IAEnE,wBAAwB,6DAAyC;IAEjE,UAAU;cAIY,CAAC;eAAS,MAAM;eAAS,MAAM;SAelD;;IA6HH,UAAU,CAAC,SAAS,EAAE,CAAC,GAAG,IAAI;IAO9B,UAAU,CAAC,SAAS,EAAE,CAAC,GAAG,IAAI;IAI9B,OAAO,CAAC,YAAY;IAepB,WAAW,IAAI,IAAI;IAQnB,aAAa,IAAI,IAAI;IAIrB,aAAa,IAAI,IAAI;IAIrB,YAAY,IAAI,IAAI;yCA9NT,QAAQ;2CAAR,QAAQ;CAkOpB"}
|
|
@@ -182,14 +182,14 @@ export class SdSelect {
|
|
|
182
182
|
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
183
183
|
event.preventDefault();
|
|
184
184
|
event.stopPropagation();
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
185
|
+
const tabbableEls = tabbable(popupEl);
|
|
186
|
+
if (tabbableEls.length === 0)
|
|
187
187
|
return;
|
|
188
|
-
const currIndex =
|
|
188
|
+
const currIndex = tabbableEls.indexOf(document.activeElement);
|
|
189
189
|
if (event.key === "ArrowDown") {
|
|
190
190
|
const nextIndex = currIndex + 1;
|
|
191
|
-
if (nextIndex <
|
|
192
|
-
|
|
191
|
+
if (nextIndex < tabbableEls.length) {
|
|
192
|
+
tabbableEls[nextIndex].focus();
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
else {
|
|
@@ -199,7 +199,7 @@ export class SdSelect {
|
|
|
199
199
|
this._dropdownElRef().nativeElement.focus();
|
|
200
200
|
}
|
|
201
201
|
else {
|
|
202
|
-
|
|
202
|
+
tabbableEls[currIndex - 1].focus();
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
}
|
|
@@ -222,13 +222,9 @@ export class SdSelect {
|
|
|
222
222
|
effect(() => {
|
|
223
223
|
const items = this._itemControls();
|
|
224
224
|
const currentValue = this.value();
|
|
225
|
-
if (currentValue == null) {
|
|
226
|
-
this._selectedItemContentHTML.set(undefined);
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
225
|
if (this.selectMode() === "multi") {
|
|
230
226
|
const arr = currentValue;
|
|
231
|
-
if (arr.length === 0) {
|
|
227
|
+
if (arr == null || arr.length === 0) {
|
|
232
228
|
this._selectedItemContentHTML.set(undefined);
|
|
233
229
|
return;
|
|
234
230
|
}
|
|
@@ -4,8 +4,8 @@ import type { SdFlatMenu } from "./sd-app-structure.types";
|
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare function injectPermsSignal<K extends string>(viewCodes: string[], keys: K[]): Signal<K[]>;
|
|
6
6
|
export declare class SdAppStructureProvider<TModule = unknown> {
|
|
7
|
-
private readonly
|
|
8
|
-
private readonly
|
|
7
|
+
private readonly _sdServiceClientFactory;
|
|
8
|
+
private readonly _sdAngularConfig;
|
|
9
9
|
readonly usableModules: import("@angular/core").WritableSignal<TModule[] | undefined>;
|
|
10
10
|
readonly permRecord: import("@angular/core").WritableSignal<Record<string, boolean> | undefined>;
|
|
11
11
|
readonly items: import("@angular/core").WritableSignal<AppStructureItem<TModule>[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-app-structure.provider.d.ts","sourceRoot":"","sources":["../../../src/core/app-structure/sd-app-structure.provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;;AAK3D,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAG/F;AAID,qBACa,sBAAsB,CAAC,OAAO,GAAG,OAAO;IACnD,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"sd-app-structure.provider.d.ts","sourceRoot":"","sources":["../../../src/core/app-structure/sd-app-structure.provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;;AAK3D,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAG/F;AAID,qBACa,sBAAsB,CAAC,OAAO,GAAG,OAAO;IACnD,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAA0C;IAClF,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmC;IAEpE,QAAQ,CAAC,aAAa,gEAA4C;IAClE,QAAQ,CAAC,UAAU,8EAA0D;IAC7E,QAAQ,CAAC,KAAK,sEAA2C;IAEnD,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASnD,WAAW,sDAET;IACF,eAAe,gCAEb;IAEF,yBAAyB,CAAC,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,GAAE,MAAM,EAAO;IAItF,kBAAkB,CAAC,QAAQ,EAAE,MAAM;IAInC,sBAAsB,CAAC,QAAQ,EAAE,MAAM;IAIvC,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE;yCApClE,sBAAsB;6CAAtB,sBAAsB;CA4ClC"}
|
|
@@ -10,16 +10,16 @@ export function injectPermsSignal(viewCodes, keys) {
|
|
|
10
10
|
// 권한은 모듈만 체크하고
|
|
11
11
|
// 메뉴는 모듈/권한 모두 체크함
|
|
12
12
|
export class SdAppStructureProvider {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
_sdServiceClientFactory = inject(SdServiceClientFactoryProvider);
|
|
14
|
+
_sdAngularConfig = inject(SdAngularConfigProvider);
|
|
15
15
|
usableModules = signal(undefined, ...(ngDevMode ? [{ debugName: "usableModules" }] : /* istanbul ignore next */ []));
|
|
16
16
|
permRecord = signal(undefined, ...(ngDevMode ? [{ debugName: "permRecord" }] : /* istanbul ignore next */ []));
|
|
17
17
|
items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
18
18
|
async initialize(serviceKey) {
|
|
19
|
-
const client = this.
|
|
19
|
+
const client = this._sdServiceClientFactory.get(serviceKey);
|
|
20
20
|
const svc = client.getService("AppStructure");
|
|
21
21
|
const itemsMap = await svc.getItems();
|
|
22
|
-
this.items.set((itemsMap[this.
|
|
22
|
+
this.items.set((itemsMap[this._sdAngularConfig.clientName] ?? []));
|
|
23
23
|
}
|
|
24
24
|
usableMenus = computed(() => SdAppStructureUtils.getMenus(this.items(), [], this.usableModules(), this.permRecord()), ...(ngDevMode ? [{ debugName: "usableMenus" }] : /* istanbul ignore next */ []));
|
|
25
25
|
usableFlatMenus = computed(() => SdAppStructureUtils.getFlatMenus(this.items(), this.usableModules(), this.permRecord()), ...(ngDevMode ? [{ debugName: "usableFlatMenus" }] : /* istanbul ignore next */ []));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class SdLocalStorageProvider<T> {
|
|
3
|
-
private readonly
|
|
3
|
+
private readonly _sdAngularConfig;
|
|
4
4
|
set<K extends keyof T & string>(key: K, value: T[K]): void;
|
|
5
5
|
get<K extends keyof T & string>(key: K): T[K] | undefined;
|
|
6
6
|
remove(key: keyof T & string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-local-storage.provider.d.ts","sourceRoot":"","sources":["../../../src/core/config/sd-local-storage.provider.ts"],"names":[],"mappings":";AAGA,qBACa,sBAAsB,CAAC,CAAC;IACnC,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"sd-local-storage.provider.d.ts","sourceRoot":"","sources":["../../../src/core/config/sd-local-storage.provider.ts"],"names":[],"mappings":";AAGA,qBACa,sBAAsB,CAAC,CAAC;IACnC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmC;IAEpE,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IAInD,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;IAUzD,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,MAAM;yCAjBjB,sBAAsB;6CAAtB,sBAAsB;CAoBlC"}
|
|
@@ -2,12 +2,12 @@ import { inject, Injectable } from "@angular/core";
|
|
|
2
2
|
import { SdAngularConfigProvider } from "./sd-angular-config.provider";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export class SdLocalStorageProvider {
|
|
5
|
-
|
|
5
|
+
_sdAngularConfig = inject(SdAngularConfigProvider);
|
|
6
6
|
set(key, value) {
|
|
7
|
-
localStorage.setItem(`${this.
|
|
7
|
+
localStorage.setItem(`${this._sdAngularConfig.clientName}.${key}`, JSON.stringify(value));
|
|
8
8
|
}
|
|
9
9
|
get(key) {
|
|
10
|
-
const json = localStorage.getItem(`${this.
|
|
10
|
+
const json = localStorage.getItem(`${this._sdAngularConfig.clientName}.${key}`);
|
|
11
11
|
if (json == null)
|
|
12
12
|
return undefined;
|
|
13
13
|
try {
|
|
@@ -18,7 +18,7 @@ export class SdLocalStorageProvider {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
remove(key) {
|
|
21
|
-
localStorage.removeItem(`${this.
|
|
21
|
+
localStorage.removeItem(`${this._sdAngularConfig.clientName}.${key}`);
|
|
22
22
|
}
|
|
23
23
|
static ɵfac = function SdLocalStorageProvider_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SdLocalStorageProvider)(); };
|
|
24
24
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: SdLocalStorageProvider, factory: SdLocalStorageProvider.ɵfac, providedIn: "root" });
|
|
@@ -2,7 +2,7 @@ import { ErrorHandler } from "@angular/core";
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class SdGlobalErrorHandlerPlugin implements ErrorHandler {
|
|
4
4
|
private readonly _envInjector;
|
|
5
|
-
private readonly
|
|
5
|
+
private readonly _sdSystemLog;
|
|
6
6
|
private _hasDisplayedError;
|
|
7
7
|
handleError(event: any): false | undefined;
|
|
8
8
|
private _displayErrorMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-global-error-handler.plugin.d.ts","sourceRoot":"","sources":["../../../src/core/error-handler/sd-global-error-handler.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAIb,MAAM,eAAe,CAAC;;AAGvB,qBACa,0BAA2B,YAAW,YAAY;IAC7D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA+B;IAC5D,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"sd-global-error-handler.plugin.d.ts","sourceRoot":"","sources":["../../../src/core/error-handler/sd-global-error-handler.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAIb,MAAM,eAAe,CAAC;;AAGvB,qBACa,0BAA2B,YAAW,YAAY;IAC7D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA+B;IAC5D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA+B;IAC5D,OAAO,CAAC,kBAAkB,CAAS;IAEnC,WAAW,CAAC,KAAK,EAAE,GAAG;IA2EtB,OAAO,CAAC,oBAAoB;yCAhFjB,0BAA0B;6CAA1B,0BAA0B;CAwHtC"}
|
|
@@ -3,7 +3,7 @@ import { SdSystemLogProvider } from "../config/sd-system-log.provider";
|
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export class SdGlobalErrorHandlerPlugin {
|
|
5
5
|
_envInjector = inject(EnvironmentInjector);
|
|
6
|
-
|
|
6
|
+
_sdSystemLog = inject(SdSystemLogProvider);
|
|
7
7
|
_hasDisplayedError = false;
|
|
8
8
|
handleError(event) {
|
|
9
9
|
try {
|
|
@@ -34,7 +34,7 @@ export class SdGlobalErrorHandlerPlugin {
|
|
|
34
34
|
else if (event instanceof ErrorEvent) {
|
|
35
35
|
const { message, filename, lineno, colno, error } = event;
|
|
36
36
|
if (error == null) {
|
|
37
|
-
void this.
|
|
37
|
+
void this._sdSystemLog.writeAsync("warn", message);
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
let stack = "";
|
|
@@ -82,7 +82,7 @@ export class SdGlobalErrorHandlerPlugin {
|
|
|
82
82
|
return;
|
|
83
83
|
this._hasDisplayedError = true;
|
|
84
84
|
const paramLines = Object.keys(param).map((key) => key + ": " + param[key]);
|
|
85
|
-
void this.
|
|
85
|
+
void this._sdSystemLog.writeAsync("error", `[${title}]\n${paramLines.join("\n")}`);
|
|
86
86
|
const appRef = this._envInjector.get(ApplicationRef);
|
|
87
87
|
appRef.destroy();
|
|
88
88
|
const plainText = `[${title}]\n${paramLines.join("\n")}`;
|
|
@@ -16,11 +16,11 @@ export function injectFocusTrap() {
|
|
|
16
16
|
}
|
|
17
17
|
function handleTabTrap(event) {
|
|
18
18
|
const hostEl = elRef.nativeElement;
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
19
|
+
const tabbableElements = getTabbableElements(hostEl);
|
|
20
|
+
if (tabbableElements.length === 0)
|
|
21
21
|
return;
|
|
22
|
-
const first =
|
|
23
|
-
const last =
|
|
22
|
+
const first = tabbableElements[0];
|
|
23
|
+
const last = tabbableElements[tabbableElements.length - 1];
|
|
24
24
|
if (event.shiftKey) {
|
|
25
25
|
if (document.activeElement === first) {
|
|
26
26
|
event.preventDefault();
|
|
@@ -3,8 +3,8 @@ import "@simplysm/core-browser";
|
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class SdModal {
|
|
5
5
|
private readonly _elRef;
|
|
6
|
-
private readonly
|
|
7
|
-
private readonly
|
|
6
|
+
private readonly _sdActivatedModal;
|
|
7
|
+
private readonly _sdSystemConfig;
|
|
8
8
|
private readonly _errorHandler;
|
|
9
9
|
private readonly _focusTrap;
|
|
10
10
|
protected readonly tablerX = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"stroke-width:var(--ng-icon__stroke-width, 2)\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"></path><path d=\"M18 6l-12 12\"></path><path d=\"M6 6l12 12\"></path></svg>";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-modal.d.ts","sourceRoot":"","sources":["../../../src/core/modal/sd-modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAC;AAQvB,OAAO,wBAAwB,CAAC;;AAEhC,qBAuQa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmC;IAC1D,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"sd-modal.d.ts","sourceRoot":"","sources":["../../../src/core/modal/sd-modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAC;AAQvB,OAAO,wBAAwB,CAAC;;AAEhC,qBAuQa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmC;IAC1D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwD;IAC1F,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAsD;IACtF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAwB;IACtD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;IAEhD,SAAS,CAAC,QAAQ,CAAC,OAAO,yVAAW;IAErC,IAAI,+CAAgB;IACpB,GAAG,0DAAwC;IAC3C,KAAK,8CAAa;IAClB,UAAU,+CAAgB;IAC1B,eAAe,+CAAgB;IAC/B,kBAAkB,+CAAe;IACjC,mBAAmB,+CAAe;IAClC,KAAK,+CAAgB;IACrB,IAAI,+CAAgB;IACpB,SAAS,+CAAgB;IACzB,OAAO,+CAAgB;IACvB,QAAQ,gFAA8D;IACtE,WAAW,0DAAwC;IACnD,UAAU,0DAAwC;IAClD,QAAQ,0DAAwC;IAChD,OAAO,0DAAwC;IAC/C,YAAY,oEAAkD;IAE9D,YAAY,iDAAkB;IAE9B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAKzB;;IAqCH,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAKvD,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAO1C,eAAe,IAAI,IAAI;IAKvB,kBAAkB,IAAI,IAAI;IAI1B,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAS3C,aAAa,IAAI,IAAI;IAIrB,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,YAAY;YAIN,WAAW;YAgBX,cAAc;yCArJjB,OAAO;2CAAP,OAAO;CAqKnB"}
|
|
@@ -77,8 +77,8 @@ function SdModal_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
77
77
|
} }
|
|
78
78
|
export class SdModal {
|
|
79
79
|
_elRef = inject((ElementRef));
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
_sdActivatedModal = inject(SdActivatedModalProvider, { optional: true });
|
|
81
|
+
_sdSystemConfig = inject(SdSystemConfigProvider, { optional: true });
|
|
82
82
|
_errorHandler = inject(ErrorHandler);
|
|
83
83
|
_focusTrap = injectFocusTrap();
|
|
84
84
|
tablerX = tablerX;
|
|
@@ -134,7 +134,7 @@ export class SdModal {
|
|
|
134
134
|
// key 기반 설정 복원
|
|
135
135
|
effect(() => {
|
|
136
136
|
const k = this.key();
|
|
137
|
-
if (k === undefined || this.
|
|
137
|
+
if (k === undefined || this._sdSystemConfig == null)
|
|
138
138
|
return;
|
|
139
139
|
void this._restoreConfig(k).catch((err) => this._errorHandler.handleError(err));
|
|
140
140
|
});
|
|
@@ -173,7 +173,7 @@ export class SdModal {
|
|
|
173
173
|
this._bringToFront();
|
|
174
174
|
}
|
|
175
175
|
_requestClose() {
|
|
176
|
-
if (this.
|
|
176
|
+
if (this._sdActivatedModal !== null && !this._sdActivatedModal.canDeactivateFn()) {
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
179
|
void this._saveConfig().catch((err) => this._errorHandler.handleError(err));
|
|
@@ -201,7 +201,7 @@ export class SdModal {
|
|
|
201
201
|
}
|
|
202
202
|
async _saveConfig() {
|
|
203
203
|
const k = this.key();
|
|
204
|
-
if (k === undefined || this.
|
|
204
|
+
if (k === undefined || this._sdSystemConfig == null)
|
|
205
205
|
return;
|
|
206
206
|
const dialogEl = this._getDialogEl();
|
|
207
207
|
if (dialogEl === null)
|
|
@@ -215,12 +215,12 @@ export class SdModal {
|
|
|
215
215
|
config["left"] = dialogEl.style.left;
|
|
216
216
|
if (dialogEl.style.top !== "")
|
|
217
217
|
config["top"] = dialogEl.style.top;
|
|
218
|
-
await this.
|
|
218
|
+
await this._sdSystemConfig.setAsync(`sd-modal.${k}`, config);
|
|
219
219
|
}
|
|
220
220
|
async _restoreConfig(k) {
|
|
221
|
-
if (this.
|
|
221
|
+
if (this._sdSystemConfig == null)
|
|
222
222
|
return;
|
|
223
|
-
const config = (await this.
|
|
223
|
+
const config = (await this._sdSystemConfig.getAsync(`sd-modal.${k}`));
|
|
224
224
|
if (config == null)
|
|
225
225
|
return;
|
|
226
226
|
const dialogEl = this._getDialogEl();
|
|
@@ -89,11 +89,11 @@ export class SdModalProvider {
|
|
|
89
89
|
dialogEl.focus();
|
|
90
90
|
}
|
|
91
91
|
else {
|
|
92
|
-
// 컨텐츠 영역에서 첫
|
|
92
|
+
// 컨텐츠 영역에서 첫 탭 이동 가능 요소 검색
|
|
93
93
|
const contentEl = modalEl.querySelector("._content");
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
|
|
94
|
+
const firstTabbable = contentEl?.findFirstTabbableChild();
|
|
95
|
+
if (firstTabbable !== undefined) {
|
|
96
|
+
firstTabbable.focus();
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
99
99
|
dialogEl.focus();
|
|
@@ -4,13 +4,13 @@ import { SdAppStructureProvider } from "../app-structure/sd-app-structure.provid
|
|
|
4
4
|
import { injectFullPageCodeSignal } from "./injectFullPageCodeSignal";
|
|
5
5
|
import { injectCurrentPageCodeSignal } from "./injectCurrentPageCodeSignal";
|
|
6
6
|
export function injectViewTitleSignal() {
|
|
7
|
-
const
|
|
7
|
+
const sdActivatedModal = inject(SdActivatedModalProvider, { optional: true });
|
|
8
8
|
const sdAppStructure = inject(SdAppStructureProvider);
|
|
9
9
|
const fullPageCode = injectFullPageCodeSignal();
|
|
10
10
|
const currPageCode = injectCurrentPageCodeSignal();
|
|
11
11
|
return computed(() => {
|
|
12
|
-
if (
|
|
13
|
-
return
|
|
12
|
+
if (sdActivatedModal != null) {
|
|
13
|
+
return sdActivatedModal.modalComponent()?.title() ?? "";
|
|
14
14
|
}
|
|
15
15
|
try {
|
|
16
16
|
return sdAppStructure.getTitleByFullCode(currPageCode?.() ?? fullPageCode());
|
|
@@ -4,12 +4,12 @@ import { SdActivatedModalProvider } from "../modal/sd-activated-modal.provider";
|
|
|
4
4
|
import { injectCurrentPageCodeSignal } from "./injectCurrentPageCodeSignal";
|
|
5
5
|
import { injectFullPageCodeSignal } from "./injectFullPageCodeSignal";
|
|
6
6
|
export function injectViewTypeSignal(getComp) {
|
|
7
|
-
const
|
|
7
|
+
const sdActivatedModal = inject(SdActivatedModalProvider, { optional: true });
|
|
8
8
|
const activatedRoute = inject(ActivatedRoute, { optional: true });
|
|
9
9
|
const fullPageCode = injectFullPageCodeSignal();
|
|
10
10
|
const currPageCode = injectCurrentPageCodeSignal();
|
|
11
11
|
return computed(() => {
|
|
12
|
-
if (
|
|
12
|
+
if (sdActivatedModal != null) {
|
|
13
13
|
return "modal";
|
|
14
14
|
}
|
|
15
15
|
const comp = getComp();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class SdRouterLink {
|
|
3
3
|
private readonly _router;
|
|
4
|
-
private readonly
|
|
4
|
+
private readonly _sdNavigateWindow;
|
|
5
5
|
option: import("@angular/core").InputSignal<{
|
|
6
6
|
link: string;
|
|
7
7
|
params?: Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-router-link.d.ts","sourceRoot":"","sources":["../../../src/core/routing/sd-router-link.ts"],"names":[],"mappings":";AAIA,qBAQa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"sd-router-link.d.ts","sourceRoot":"","sources":["../../../src/core/routing/sd-router-link.ts"],"names":[],"mappings":";AAIA,qBAQa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoC;IAEtE,MAAM;cAEM,MAAM;iBACH,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;iBACtB;YACP,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB;qBACY,MAAM;sBACL,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;mBAGF;IAElC,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;yCAlBpC,YAAY;2CAAZ,YAAY;CA4DxB"}
|
|
@@ -4,7 +4,7 @@ import { SdNavigateWindowProvider } from "./sd-navigate-window.provider";
|
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export class SdRouterLink {
|
|
6
6
|
_router = inject(Router);
|
|
7
|
-
|
|
7
|
+
_sdNavigateWindow = inject(SdNavigateWindowProvider);
|
|
8
8
|
option = input(undefined, { ...(ngDevMode ? { debugName: "option" } : /* istanbul ignore next */ {}), alias: "sdRouterLink" });
|
|
9
9
|
async onClick(event) {
|
|
10
10
|
const option = this.option();
|
|
@@ -15,19 +15,19 @@ export class SdRouterLink {
|
|
|
15
15
|
return;
|
|
16
16
|
event.preventDefault();
|
|
17
17
|
event.stopPropagation();
|
|
18
|
-
if (this.
|
|
18
|
+
if (this._sdNavigateWindow.isWindow) {
|
|
19
19
|
const width = option.window?.width ?? 800;
|
|
20
20
|
const height = option.window?.height ?? 800;
|
|
21
21
|
const qp = option.queryParams
|
|
22
22
|
? "?" + new URLSearchParams(option.queryParams).toString()
|
|
23
23
|
: "";
|
|
24
|
-
this.
|
|
24
|
+
this._sdNavigateWindow.open(option.link + qp, option.params, `width=${width},height=${height}`);
|
|
25
25
|
}
|
|
26
26
|
else if (event.ctrlKey || event.shiftKey) {
|
|
27
27
|
const qp = option.queryParams
|
|
28
28
|
? "?" + new URLSearchParams(option.queryParams).toString()
|
|
29
29
|
: "";
|
|
30
|
-
this.
|
|
30
|
+
this._sdNavigateWindow.open(option.link + qp, option.params);
|
|
31
31
|
}
|
|
32
32
|
else if (option.outletName === undefined) {
|
|
33
33
|
await this._router.navigate([option.link, ...(option.params ? [option.params] : [])], option.queryParams ? { queryParams: option.queryParams } : undefined);
|
|
@@ -2,11 +2,11 @@ import { DestroyRef, ElementRef, inject, reflectComponentType } from "@angular/c
|
|
|
2
2
|
import { ActivatedRoute } from "@angular/router";
|
|
3
3
|
import { SdActivatedModalProvider } from "../modal/sd-activated-modal.provider";
|
|
4
4
|
export function setupCanDeactivate(fn) {
|
|
5
|
-
const
|
|
5
|
+
const sdActivatedModal = inject(SdActivatedModalProvider, { optional: true });
|
|
6
6
|
const activatedRoute = inject(ActivatedRoute, { optional: true });
|
|
7
7
|
const elRef = inject(ElementRef);
|
|
8
|
-
if (
|
|
9
|
-
|
|
8
|
+
if (sdActivatedModal != null) {
|
|
9
|
+
sdActivatedModal.canDeactivateFn = fn;
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
if (activatedRoute) {
|
|
@@ -2,8 +2,8 @@ import type { ServiceConnectionOptions } from "@simplysm/service-client";
|
|
|
2
2
|
import { ServiceClient } from "@simplysm/service-client";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class SdServiceClientFactoryProvider {
|
|
5
|
-
private readonly
|
|
6
|
-
private readonly
|
|
5
|
+
private readonly _sdToast;
|
|
6
|
+
private readonly _sdAngularConfig;
|
|
7
7
|
private readonly _destroyRef;
|
|
8
8
|
private readonly _clientMap;
|
|
9
9
|
private readonly _closedKeys;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-service-client-factory.provider.d.ts","sourceRoot":"","sources":["../../../src/core/service-client/sd-service-client-factory.provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAwB,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAuB,aAAa,EAAE,MAAM,0BAA0B,CAAC;;AAI9E,qBACa,8BAA8B;IACzC,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"sd-service-client-factory.provider.d.ts","sourceRoot":"","sources":["../../../src/core/service-client/sd-service-client-factory.provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAwB,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAuB,aAAa,EAAE,MAAM,0BAA0B,CAAC;;AAI9E,qBACa,8BAA8B;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2B;IACpD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmC;IACpE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsB;IAElD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoC;IAC/D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IACjD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6C;;IAWpE,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAkCrF,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW5C,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa;IAW/B,OAAO,CAAC,eAAe;yCA1EZ,8BAA8B;6CAA9B,8BAA8B;CA0F1C"}
|
|
@@ -4,8 +4,8 @@ import { SdAngularConfigProvider } from "../config/sd-angular-config.provider";
|
|
|
4
4
|
import { SdToastProvider } from "../toast/sd-toast.provider";
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export class SdServiceClientFactoryProvider {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
_sdToast = inject(SdToastProvider);
|
|
8
|
+
_sdAngularConfig = inject(SdAngularConfigProvider);
|
|
9
9
|
_destroyRef = inject(DestroyRef);
|
|
10
10
|
_clientMap = new Map();
|
|
11
11
|
_closedKeys = new Set();
|
|
@@ -35,7 +35,7 @@ export class SdServiceClientFactoryProvider {
|
|
|
35
35
|
...defaultOptions,
|
|
36
36
|
...options,
|
|
37
37
|
};
|
|
38
|
-
const client = createServiceClient(this.
|
|
38
|
+
const client = createServiceClient(this._sdAngularConfig.clientName, mergedOptions);
|
|
39
39
|
client.on("request-progress", (state) => {
|
|
40
40
|
this._handleProgress("요청을 전송하는 중입니다.", state);
|
|
41
41
|
});
|
|
@@ -69,7 +69,7 @@ export class SdServiceClientFactoryProvider {
|
|
|
69
69
|
const progress = totalSize === 0 ? 0 : Math.round((completedSize / totalSize) * 100);
|
|
70
70
|
let progressSignal = this._progressMap.get(uuid);
|
|
71
71
|
if (progressSignal == null) {
|
|
72
|
-
progressSignal = this.
|
|
72
|
+
progressSignal = this._sdToast.info(message, true);
|
|
73
73
|
this._progressMap.set(uuid, progressSignal);
|
|
74
74
|
}
|
|
75
75
|
progressSignal.set(progress);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type Signal, type WritableSignal } from "@angular/core";
|
|
1
|
+
import { ErrorHandler, type Signal, type WritableSignal } from "@angular/core";
|
|
2
|
+
import { SdServiceClientFactoryProvider } from "../service-client/sd-service-client-factory.provider";
|
|
2
3
|
import "@simplysm/core-common";
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export interface SharedDataBase<TKey extends string | number> {
|
|
@@ -22,8 +23,8 @@ export declare const SdSharedDataChangeEvent: import("@simplysm/service-common")
|
|
|
22
23
|
filter: unknown;
|
|
23
24
|
}, (string | number)[] | undefined>;
|
|
24
25
|
export declare abstract class SdSharedDataProvider<T extends Record<string, SharedDataBase<string | number>>> {
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
protected readonly _sdServiceClientFactory: SdServiceClientFactoryProvider;
|
|
27
|
+
protected readonly _errorHandler: ErrorHandler;
|
|
27
28
|
readonly loadingCount: WritableSignal<number>;
|
|
28
29
|
private readonly _entries;
|
|
29
30
|
abstract initialize(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-shared-data.provider.d.ts","sourceRoot":"","sources":["../../../src/core/shared-data/sd-shared-data.provider.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"sd-shared-data.provider.d.ts","sourceRoot":"","sources":["../../../src/core/shared-data/sd-shared-data.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,YAAY,EAA8B,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAGrH,OAAO,EAAE,8BAA8B,EAAE,MAAM,sDAAsD,CAAC;AACtG,OAAO,uBAAuB,CAAC;;AAE/B,MAAM,WAAW,cAAc,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IAC1D,UAAU,EAAE,IAAI,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC;IACzE,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;IACnB,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,SAAS,GAAG,CAAC,GAAG,SAAS,CAAC;CACtD;AAED,eAAO,MAAM,uBAAuB;UAC1B,MAAM;YAAU,OAAO;mCAEV,CAAC;AAYxB,8BACsB,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAClG,SAAS,CAAC,QAAQ,CAAC,uBAAuB,iCAA0C;IACpF,SAAS,CAAC,QAAQ,CAAC,aAAa,eAAwB;IAExD,QAAQ,CAAC,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,CAAa;IAE1D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2C;IAEpE,QAAQ,CAAC,UAAU,IAAI,IAAI;IAE3B,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAqC/E,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAchE,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,EACxC,IAAI,EAAE,CAAC,EACP,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAC/B,OAAO,CAAC,IAAI,CAAC;IAcV,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,OAAO,CAAC,cAAc;YAuCR,QAAQ;yCAzHF,oBAAoB;6CAApB,oBAAoB;CAkKzC"}
|
|
@@ -6,7 +6,7 @@ import "@simplysm/core-common";
|
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export const SdSharedDataChangeEvent = defineEvent("SdSharedDataChange");
|
|
8
8
|
export class SdSharedDataProvider {
|
|
9
|
-
|
|
9
|
+
_sdServiceClientFactory = inject(SdServiceClientFactoryProvider);
|
|
10
10
|
_errorHandler = inject(ErrorHandler);
|
|
11
11
|
loadingCount = signal(0, ...(ngDevMode ? [{ debugName: "loadingCount" }] : /* istanbul ignore next */ []));
|
|
12
12
|
_entries = new Map();
|
|
@@ -15,7 +15,7 @@ export class SdSharedDataProvider {
|
|
|
15
15
|
if (existing != null) {
|
|
16
16
|
// 기존 리스너 키 초기화 + generation 증가로 이전 이벤트 무시
|
|
17
17
|
if (existing.listenerKey != null) {
|
|
18
|
-
const client = this.
|
|
18
|
+
const client = this._sdServiceClientFactory.get(existing.info.serviceKey);
|
|
19
19
|
void client.removeListener(existing.listenerKey);
|
|
20
20
|
existing.listenerKey = undefined;
|
|
21
21
|
}
|
|
@@ -60,7 +60,7 @@ export class SdSharedDataProvider {
|
|
|
60
60
|
if (entry == null) {
|
|
61
61
|
throw new Error(`등록되지 않은 공유 데이터: ${name}`);
|
|
62
62
|
}
|
|
63
|
-
const client = this.
|
|
63
|
+
const client = this._sdServiceClientFactory.get(entry.info.serviceKey);
|
|
64
64
|
const event = client.getEvent("SdSharedDataChange");
|
|
65
65
|
await event.emit((item) => item.name === name && obj.equal(item.filter, entry.info.filter), changeKeys);
|
|
66
66
|
}
|
|
@@ -81,7 +81,7 @@ export class SdSharedDataProvider {
|
|
|
81
81
|
entry.itemsSignal.set(data);
|
|
82
82
|
// 이벤트 리스너 등록
|
|
83
83
|
if (entry.listenerKey == null) {
|
|
84
|
-
const client = this.
|
|
84
|
+
const client = this._sdServiceClientFactory.get(entry.info.serviceKey);
|
|
85
85
|
const event = client.getEvent("SdSharedDataChange");
|
|
86
86
|
entry.listenerKey = await event.addListener({ name, filter: entry.info.filter }, async (changeKeys) => {
|
|
87
87
|
await this._onEvent(name, entry, changeKeys, capturedGeneration);
|