@simplysm/angular 14.0.38 → 14.0.40
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/checkbox/sd-checkbox.d.ts +1 -1
- package/dist/controls/checkbox/sd-checkbox.d.ts.map +1 -1
- package/dist/controls/checkbox/sd-checkbox.js +8 -5
- package/dist/controls/checkbox/sd-switch.d.ts +3 -1
- package/dist/controls/checkbox/sd-switch.d.ts.map +1 -1
- package/dist/controls/checkbox/sd-switch.js +11 -5
- 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/input/sd-textfield.d.ts.map +1 -1
- package/dist/controls/input/sd-textfield.js +1 -0
- 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/error-handler/sd-global-error-handler.plugin.d.ts.map +1 -1
- package/dist/core/error-handler/sd-global-error-handler.plugin.js +7 -2
- package/dist/core/modal/injectFocusTrap.js +4 -4
- package/dist/core/modal/sd-modal.d.ts +2 -3
- package/dist/core/modal/sd-modal.d.ts.map +1 -1
- package/dist/core/modal/sd-modal.js +8 -9
- package/dist/core/modal/sd-modal.provider.d.ts +0 -1
- package/dist/core/modal/sd-modal.provider.d.ts.map +1 -1
- package/dist/core/modal/sd-modal.provider.js +5 -5
- package/dist/core/routing/sd-navigate-window.provider.d.ts.map +1 -1
- package/dist/core/routing/sd-navigate-window.provider.js +3 -1
- package/dist/core/setupModelHook.d.ts.map +1 -1
- package/dist/core/setupModelHook.js +18 -1
- package/dist/core/shared-data/sd-shared-data.provider.d.ts.map +1 -1
- package/dist/core/shared-data/sd-shared-data.provider.js +12 -3
- 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/validation/setupInvalid.js +6 -5
- package/dist/data/data-detail/sd-data-detail.base.d.ts +1 -1
- package/dist/data/data-detail/sd-data-detail.base.d.ts.map +1 -1
- package/dist/data/data-detail/sd-data-detail.base.js +19 -20
- package/dist/data/data-sheet/sd-data-sheet.base.d.ts +0 -1
- package/dist/data/data-sheet/sd-data-sheet.base.d.ts.map +1 -1
- package/dist/data/data-sheet/sd-data-sheet.base.js +4 -12
- package/dist/data/getOrmDataEditToastErrorMessage.d.ts +2 -0
- package/dist/data/getOrmDataEditToastErrorMessage.d.ts.map +1 -0
- package/dist/data/getOrmDataEditToastErrorMessage.js +8 -0
- package/dist/data/permission-table/sd-permission-table.d.ts +1 -1
- package/dist/data/permission-table/sd-permission-table.d.ts.map +1 -1
- package/dist/data/permission-table/sd-permission-table.js +6 -5
- package/dist/data/sheet/useSheetCellAgent.js +6 -6
- package/dist/features/editor/sd-tiptap-editor.d.ts.map +1 -1
- package/dist/features/editor/sd-tiptap-editor.js +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/layout/base-container/sd-base-container.d.ts +1 -0
- package/dist/layout/base-container/sd-base-container.d.ts.map +1 -1
- package/dist/layout/base-container/sd-base-container.js +5 -2
- package/dist/layout/sidebar/sd-sidebar-menu.js +3 -3
- package/dist/styles.css +1 -1
- package/package.json +6 -5
- package/scss/commons/_styles.scss +1 -1
- package/src/controls/checkbox/sd-checkbox.ts +7 -3
- package/src/controls/checkbox/sd-switch.ts +8 -2
- package/src/controls/collapse/sd-collapse.ts +6 -0
- package/src/controls/dropdown/sd-dropdown.ts +6 -6
- package/src/controls/input/sd-textfield.ts +1 -0
- package/src/controls/list/sd-list-item.ts +0 -6
- package/src/controls/select/sd-select.ts +8 -13
- package/src/core/error-handler/sd-global-error-handler.plugin.ts +6 -2
- package/src/core/modal/injectFocusTrap.ts +4 -4
- package/src/core/modal/sd-modal.provider.ts +5 -6
- package/src/core/modal/sd-modal.ts +5 -5
- package/src/core/routing/sd-navigate-window.provider.ts +3 -1
- package/src/core/setupModelHook.ts +21 -1
- package/src/core/shared-data/sd-shared-data.provider.ts +13 -2
- package/src/core/toast/sd-toast-container.ts +8 -8
- 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 +21 -24
- package/src/data/data-sheet/sd-data-sheet.base.ts +4 -15
- package/src/data/getOrmDataEditToastErrorMessage.ts +10 -0
- package/src/data/permission-table/sd-permission-table.ts +7 -6
- package/src/data/sheet/useSheetCellAgent.ts +6 -6
- package/src/features/editor/sd-tiptap-editor.ts +2 -0
- package/src/index.ts +3 -0
- package/src/layout/base-container/sd-base-container.ts +4 -1
- package/src/layout/sidebar/sd-sidebar-menu.ts +1 -1
|
@@ -20,6 +20,23 @@ export function setupModelHook(model, canFn) {
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
model.update = (fn) => {
|
|
23
|
-
|
|
23
|
+
const value = fn(model());
|
|
24
|
+
const canSet = canFn()(value);
|
|
25
|
+
if (canSet === false) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (canSet === true) {
|
|
29
|
+
orgSet(value);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
void canSet
|
|
33
|
+
.then((allowed) => {
|
|
34
|
+
if (allowed !== false) {
|
|
35
|
+
orgSet(fn(model()));
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
.catch((err) => {
|
|
39
|
+
errorHandler.handleError(err);
|
|
40
|
+
});
|
|
24
41
|
};
|
|
25
42
|
}
|
|
@@ -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,EAAs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,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"}
|
|
@@ -13,12 +13,13 @@ export class SdSharedDataProvider {
|
|
|
13
13
|
register(name, info) {
|
|
14
14
|
const existing = this._entries.get(name);
|
|
15
15
|
if (existing != null) {
|
|
16
|
-
// 기존 리스너 키 초기화
|
|
16
|
+
// 기존 리스너 키 초기화 + generation 증가로 이전 이벤트 무시
|
|
17
17
|
if (existing.listenerKey != null) {
|
|
18
18
|
const client = this._clientFactory.get(existing.info.serviceKey);
|
|
19
19
|
void client.removeListener(existing.listenerKey);
|
|
20
20
|
existing.listenerKey = undefined;
|
|
21
21
|
}
|
|
22
|
+
existing.generation++;
|
|
22
23
|
existing.info = info;
|
|
23
24
|
existing.needsReload = true;
|
|
24
25
|
}
|
|
@@ -37,6 +38,7 @@ export class SdSharedDataProvider {
|
|
|
37
38
|
info,
|
|
38
39
|
itemsSignal,
|
|
39
40
|
handle,
|
|
41
|
+
generation: 0,
|
|
40
42
|
needsReload: true,
|
|
41
43
|
isLoading: false,
|
|
42
44
|
});
|
|
@@ -67,18 +69,22 @@ export class SdSharedDataProvider {
|
|
|
67
69
|
}
|
|
68
70
|
_loadAndListen(name, entry) {
|
|
69
71
|
entry.isLoading = true;
|
|
72
|
+
const capturedGeneration = entry.generation;
|
|
70
73
|
this.loadingCount.update((v) => v + 1);
|
|
71
74
|
// 비동기 로드
|
|
72
75
|
void entry.info
|
|
73
76
|
.getter()
|
|
74
77
|
.then(async (data) => {
|
|
78
|
+
// register 재호출로 generation이 변경되었으면 결과를 무시
|
|
79
|
+
if (entry.generation !== capturedGeneration)
|
|
80
|
+
return;
|
|
75
81
|
entry.itemsSignal.set(data);
|
|
76
82
|
// 이벤트 리스너 등록
|
|
77
83
|
if (entry.listenerKey == null) {
|
|
78
84
|
const client = this._clientFactory.get(entry.info.serviceKey);
|
|
79
85
|
const event = client.getEvent("SdSharedDataChange");
|
|
80
86
|
entry.listenerKey = await event.addListener({ name, filter: entry.info.filter }, async (changeKeys) => {
|
|
81
|
-
await this._onEvent(name, entry, changeKeys);
|
|
87
|
+
await this._onEvent(name, entry, changeKeys, capturedGeneration);
|
|
82
88
|
});
|
|
83
89
|
}
|
|
84
90
|
})
|
|
@@ -94,7 +100,10 @@ export class SdSharedDataProvider {
|
|
|
94
100
|
}
|
|
95
101
|
});
|
|
96
102
|
}
|
|
97
|
-
async _onEvent(name, entry, changeKeys) {
|
|
103
|
+
async _onEvent(name, entry, changeKeys, generation) {
|
|
104
|
+
// register 재호출로 generation이 변경되었으면 이벤트 무시
|
|
105
|
+
if (entry.generation !== generation)
|
|
106
|
+
return;
|
|
98
107
|
this.loadingCount.update((v) => v + 1);
|
|
99
108
|
try {
|
|
100
109
|
if (changeKeys == null) {
|
|
@@ -9,12 +9,12 @@ export class SdToastContainer {
|
|
|
9
9
|
} }, inputs: { overlap: [1, "overlap"] }, ngContentSelectors: _c0, decls: 1, vars: 0, template: function SdToastContainer_Template(rf, ctx) { if (rf & 1) {
|
|
10
10
|
i0.ɵɵprojectionDef();
|
|
11
11
|
i0.ɵɵprojection(0);
|
|
12
|
-
} }, styles: ["sd-toast-container {\n position: fixed;\n top: 0;\n left: 0;\n
|
|
12
|
+
} }, styles: ["sd-toast-container {\n display: flex;\n position: fixed;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n pointer-events: none;\n padding: var(--gap-xxl);\n z-index: 9999;\n flex-direction: column;\n}\n@supports not (appearance: auto) {\n sd-toast-container.gap-xxs {\n gap: 0;\n }\n sd-toast-container.gap-xxs > * + * {\n margin-top: var(--gap-xxs);\n }\n sd-toast-container.gap-xs {\n gap: 0;\n }\n sd-toast-container.gap-xs > * + * {\n margin-top: var(--gap-xs);\n }\n sd-toast-container.gap-sm {\n gap: 0;\n }\n sd-toast-container.gap-sm > * + * {\n margin-top: var(--gap-sm);\n }\n sd-toast-container.gap-default {\n gap: 0;\n }\n sd-toast-container.gap-default > * + * {\n margin-top: var(--gap-default);\n }\n sd-toast-container.gap-lg {\n gap: 0;\n }\n sd-toast-container.gap-lg > * + * {\n margin-top: var(--gap-lg);\n }\n sd-toast-container.gap-xl {\n gap: 0;\n }\n sd-toast-container.gap-xl > * + * {\n margin-top: var(--gap-xl);\n }\n sd-toast-container.gap-xxl {\n gap: 0;\n }\n sd-toast-container.gap-xxl > * + * {\n margin-top: var(--gap-xxl);\n }\n sd-toast-container.gap-0 {\n gap: 0;\n }\n sd-toast-container.gap-0 > * + * {\n margin-top: var(--gap-0);\n }\n sd-toast-container.gap-auto {\n gap: 0;\n }\n sd-toast-container.gap-auto > * + * {\n margin-top: var(--gap-auto);\n }\n}\n@media all and (max-width: 520px) {\n sd-toast-container {\n flex-direction: column-reverse;\n }\n}\nsd-toast-container[data-sd-overlap] {\n display: block;\n}\nsd-toast-container[data-sd-overlap] > sd-toast {\n position: absolute;\n bottom: var(--gap-xxl);\n left: var(--gap-xxl);\n right: var(--gap-xxl);\n width: auto;\n}"], encapsulation: 2, changeDetection: 0 });
|
|
13
13
|
}
|
|
14
14
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SdToastContainer, [{
|
|
15
15
|
type: Component,
|
|
16
16
|
args: [{ selector: "sd-toast-container", changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, host: {
|
|
17
17
|
"[attr.data-sd-overlap]": "overlap() || undefined",
|
|
18
|
-
}, template: `<ng-content />`, styles: ["sd-toast-container {\n position: fixed;\n top: 0;\n left: 0;\n
|
|
18
|
+
}, template: `<ng-content />`, styles: ["sd-toast-container {\n display: flex;\n position: fixed;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n pointer-events: none;\n padding: var(--gap-xxl);\n z-index: 9999;\n flex-direction: column;\n}\n@supports not (appearance: auto) {\n sd-toast-container.gap-xxs {\n gap: 0;\n }\n sd-toast-container.gap-xxs > * + * {\n margin-top: var(--gap-xxs);\n }\n sd-toast-container.gap-xs {\n gap: 0;\n }\n sd-toast-container.gap-xs > * + * {\n margin-top: var(--gap-xs);\n }\n sd-toast-container.gap-sm {\n gap: 0;\n }\n sd-toast-container.gap-sm > * + * {\n margin-top: var(--gap-sm);\n }\n sd-toast-container.gap-default {\n gap: 0;\n }\n sd-toast-container.gap-default > * + * {\n margin-top: var(--gap-default);\n }\n sd-toast-container.gap-lg {\n gap: 0;\n }\n sd-toast-container.gap-lg > * + * {\n margin-top: var(--gap-lg);\n }\n sd-toast-container.gap-xl {\n gap: 0;\n }\n sd-toast-container.gap-xl > * + * {\n margin-top: var(--gap-xl);\n }\n sd-toast-container.gap-xxl {\n gap: 0;\n }\n sd-toast-container.gap-xxl > * + * {\n margin-top: var(--gap-xxl);\n }\n sd-toast-container.gap-0 {\n gap: 0;\n }\n sd-toast-container.gap-0 > * + * {\n margin-top: var(--gap-0);\n }\n sd-toast-container.gap-auto {\n gap: 0;\n }\n sd-toast-container.gap-auto > * + * {\n margin-top: var(--gap-auto);\n }\n}\n@media all and (max-width: 520px) {\n sd-toast-container {\n flex-direction: column-reverse;\n }\n}\nsd-toast-container[data-sd-overlap] {\n display: block;\n}\nsd-toast-container[data-sd-overlap] > sd-toast {\n position: absolute;\n bottom: var(--gap-xxl);\n left: var(--gap-xxl);\n right: var(--gap-xxl);\n width: auto;\n}"] }]
|
|
19
19
|
}], null, { overlap: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlap", required: false }] }] }); })();
|
|
20
20
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdToastContainer, { className: "SdToastContainer", filePath: "packages/angular/src/core/toast/sd-toast-container.ts", lineNumber: 56, forbidOrphanRendering: true }); })();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-toast.d.ts","sourceRoot":"","sources":["../../../src/core/toast/sd-toast.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;;AAKxD,
|
|
1
|
+
{"version":3,"file":"sd-toast.d.ts","sourceRoot":"","sources":["../../../src/core/toast/sd-toast.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;;AAKxD,qBAyHa,OAAO;IAClB,IAAI,+CAAgB;IACpB,WAAW,qEAAiD;IAC5D,KAAK,oDAA+B;IACpC,QAAQ,8CAAY;IACpB,OAAO,0DAAwC;IAE/C,QAAQ,iEAKL;IAEH,QAAQ,qEAKL;yCAnBQ,OAAO;2CAAP,OAAO;CAoBnB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { booleanAttribute, ChangeDetectionStrategy, Component, computed, input, model, ViewEncapsulation, } from "@angular/core";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
const _c0 = ["*"];
|
|
4
|
-
function
|
|
5
|
-
i0.ɵɵdomElementStart(0, "div",
|
|
4
|
+
function SdToast_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
5
|
+
i0.ɵɵdomElementStart(0, "div", 1);
|
|
6
6
|
i0.ɵɵtext(1);
|
|
7
7
|
i0.ɵɵdomElementEnd();
|
|
8
8
|
} if (rf & 2) {
|
|
@@ -10,9 +10,9 @@ function SdToast_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
10
10
|
i0.ɵɵadvance();
|
|
11
11
|
i0.ɵɵtextInterpolate(ctx_r0.message());
|
|
12
12
|
} }
|
|
13
|
-
function
|
|
14
|
-
i0.ɵɵdomElementStart(0, "div",
|
|
15
|
-
i0.ɵɵdomElement(1, "div",
|
|
13
|
+
function SdToast_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
14
|
+
i0.ɵɵdomElementStart(0, "div", 2);
|
|
15
|
+
i0.ɵɵdomElement(1, "div", 3);
|
|
16
16
|
i0.ɵɵdomElementEnd();
|
|
17
17
|
} if (rf & 2) {
|
|
18
18
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
@@ -45,35 +45,40 @@ export class SdToast {
|
|
|
45
45
|
}, ...(ngDevMode ? [{ debugName: "ariaLive" }] : /* istanbul ignore next */ []));
|
|
46
46
|
static ɵfac = function SdToast_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SdToast)(); };
|
|
47
47
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SdToast, selectors: [["sd-toast"]], hostVars: 4, hostBindings: function SdToast_HostBindings(rf, ctx) { if (rf & 2) {
|
|
48
|
-
i0.ɵɵattribute("data-sd-open", ctx.open()
|
|
49
|
-
} }, inputs: { open: [1, "open"], useProgress: [1, "useProgress"], theme: [1, "theme"], progress: [1, "progress"], message: [1, "message"] }, outputs: { open: "openChange", progress: "progressChange", message: "messageChange" }, ngContentSelectors: _c0, decls:
|
|
48
|
+
i0.ɵɵattribute("data-sd-open", ctx.open())("data-sd-theme", ctx.theme())("role", ctx.ariaRole())("aria-live", ctx.ariaLive());
|
|
49
|
+
} }, inputs: { open: [1, "open"], useProgress: [1, "useProgress"], theme: [1, "theme"], progress: [1, "progress"], message: [1, "message"] }, outputs: { open: "openChange", progress: "progressChange", message: "messageChange" }, ngContentSelectors: _c0, decls: 4, vars: 2, consts: [[1, "_block"], [1, "_message"], [1, "_progress"], [1, "_progress-bar"]], template: function SdToast_Template(rf, ctx) { if (rf & 1) {
|
|
50
50
|
i0.ɵɵprojectionDef();
|
|
51
|
-
i0.ɵɵ
|
|
52
|
-
i0.ɵɵ
|
|
53
|
-
i0.ɵɵ
|
|
51
|
+
i0.ɵɵdomElementStart(0, "div", 0);
|
|
52
|
+
i0.ɵɵconditionalCreate(1, SdToast_Conditional_1_Template, 2, 1, "div", 1);
|
|
53
|
+
i0.ɵɵprojection(2);
|
|
54
|
+
i0.ɵɵconditionalCreate(3, SdToast_Conditional_3_Template, 2, 2, "div", 2);
|
|
55
|
+
i0.ɵɵdomElementEnd();
|
|
54
56
|
} if (rf & 2) {
|
|
55
|
-
i0.ɵɵ
|
|
57
|
+
i0.ɵɵadvance();
|
|
58
|
+
i0.ɵɵconditional(ctx.message() !== undefined ? 1 : -1);
|
|
56
59
|
i0.ɵɵadvance(2);
|
|
57
|
-
i0.ɵɵconditional(ctx.useProgress() ?
|
|
58
|
-
} }, styles: ["sd-toast {\n display: block;\n
|
|
60
|
+
i0.ɵɵconditional(ctx.useProgress() ? 3 : -1);
|
|
61
|
+
} }, styles: ["sd-toast {\n display: block;\n margin-bottom: var(--gap-sm);\n text-align: center;\n width: 100%;\n pointer-events: none;\n}\nsd-toast > ._block {\n display: inline-block;\n text-align: left;\n color: var(--text-trans-rev-default);\n transform: translateY(-100%);\n border-radius: var(--border-radius-lg);\n opacity: 0;\n box-shadow: 0 calc(12 * var(--elevation-size)) calc(12 * 4 * var(--elevation-size)) var(--trans-lighter), 0 var(--elevation-size) var(--elevation-size) var(--trans-lighter);\n pointer-events: auto;\n}\nsd-toast > ._block > ._message {\n padding: var(--gap-default) var(--gap-lg);\n word-break: break-all;\n white-space: pre-wrap;\n}\nsd-toast > ._block > ._progress {\n background: var(--theme-gray-default);\n height: 4px;\n border-radius: var(--border-radius-xl);\n margin: 0 4px 4px 4px;\n}\nsd-toast > ._block > ._progress > ._progress-bar {\n border-radius: var(--border-radius-xl);\n height: 4px;\n transition: width 1s ease-out;\n}\nsd-toast[data-sd-theme=gray] > ._block {\n background: rgb(153.0022463699, 161.0057700366, 174.7317580236);\n}\nsd-toast[data-sd-theme=gray] > ._block > ._progress {\n background: rgb(101.0316959931, 111.1055377773, 128.3821070824);\n}\nsd-toast[data-sd-theme=gray] > ._block > ._progress > ._progress-bar {\n background: rgb(224.400673911, 226.801731011, 230.9195274071);\n}\nsd-toast[data-sd-theme=blue-gray] > ._block {\n background: rgb(144.0364277624, 161.0825504589, 184.9359809919);\n}\nsd-toast[data-sd-theme=blue-gray] > ._block > ._progress {\n background: rgb(95.4928842953, 118.7256854589, 151.2364222704);\n}\nsd-toast[data-sd-theme=blue-gray] > ._block > ._progress > ._progress-bar {\n background: rgb(227.2591069406, 231.5206376147, 237.483995248);\n}\nsd-toast[data-sd-theme=primary] > ._block {\n background: hsl(212.7907636992, 106.3271487689%, 66.8390389975%);\n}\nsd-toast[data-sd-theme=primary] > ._block > ._progress {\n background: hsl(212.7907636992, 106.3271487689%, 50.1292792481%);\n}\nsd-toast[data-sd-theme=primary] > ._block > ._progress > ._progress-bar {\n background: hsl(212.7907636992, 106.3271487689%, 91.7097597494%);\n}\nsd-toast[data-sd-theme=secondary] > ._block {\n background: hsl(212.7907636992, 106.3271487689%, 66.8390389975%);\n}\nsd-toast[data-sd-theme=secondary] > ._block > ._progress {\n background: hsl(212.7907636992, 106.3271487689%, 50.1292792481%);\n}\nsd-toast[data-sd-theme=secondary] > ._block > ._progress > ._progress-bar {\n background: hsl(212.7907636992, 106.3271487689%, 91.7097597494%);\n}\nsd-toast[data-sd-theme=info] > ._block {\n background: hsl(186.1271591177, 175.0224558865%, 34.577706736%);\n}\nsd-toast[data-sd-theme=info] > ._block > ._progress {\n background: hsl(186.1271591177, 175.0224558865%, 25.933280052%);\n}\nsd-toast[data-sd-theme=info] > ._block > ._progress > ._progress-bar {\n background: hsl(186.1271591177, 175.0224558865%, 83.644426684%);\n}\nsd-toast[data-sd-theme=success] > ._block {\n background: hsl(76.4778453101, 152.6473732821%, 35.6889214867%);\n}\nsd-toast[data-sd-theme=success] > ._block > ._progress {\n background: hsl(76.4778453101, 152.6473732821%, 26.766691115%);\n}\nsd-toast[data-sd-theme=success] > ._block > ._progress > ._progress-bar {\n background: hsl(76.4778453101, 152.6473732821%, 83.9222303717%);\n}\nsd-toast[data-sd-theme=warning] > ._block {\n background: hsl(31.4330872217, 102.5675912326%, 51.3170331393%);\n}\nsd-toast[data-sd-theme=warning] > ._block > ._progress {\n background: hsl(31.4330872217, 102.5675912326%, 38.4877748545%);\n}\nsd-toast[data-sd-theme=warning] > ._block > ._progress > ._progress-bar {\n background: hsl(31.4330872217, 102.5675912326%, 87.8292582848%);\n}\nsd-toast[data-sd-theme=danger] > ._block {\n background: hsl(358.7593862564, 101.8439024907%, 69.8357359211%);\n}\nsd-toast[data-sd-theme=danger] > ._block > ._progress {\n background: hsl(358.7593862564, 101.8439024907%, 52.3768019408%);\n}\nsd-toast[data-sd-theme=danger] > ._block > ._progress > ._progress-bar {\n background: hsl(358.7593862564, 101.8439024907%, 92.4589339803%);\n}\nsd-toast[data-sd-open=true] > ._block {\n transform: none;\n transition: var(--animation-duration) ease-out;\n transition-property: transform, opacity;\n opacity: 1;\n}\nsd-toast[data-sd-open=false] > ._block {\n transform: translateY(-100%);\n transition: var(--animation-duration) ease-in;\n transition-property: transform, opacity;\n opacity: 0;\n}\n@media all and (max-width: 520px) {\n sd-toast > ._block {\n border-radius: calc(var(--line-height) / 2);\n transform: translateY(100%);\n }\n sd-toast > ._block > ._message {\n padding: var(--gap-xs) var(--gap-default);\n }\n sd-toast[data-sd-open=false] > ._block {\n transform: translateY(100%);\n }\n}"], encapsulation: 2, changeDetection: 0 });
|
|
59
62
|
}
|
|
60
63
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SdToast, [{
|
|
61
64
|
type: Component,
|
|
62
65
|
args: [{ selector: "sd-toast", changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, host: {
|
|
63
|
-
"[attr.data-sd-open]": "open()
|
|
66
|
+
"[attr.data-sd-open]": "open()",
|
|
64
67
|
"[attr.data-sd-theme]": "theme()",
|
|
65
68
|
"[attr.role]": "ariaRole()",
|
|
66
69
|
"[attr.aria-live]": "ariaLive()",
|
|
67
70
|
}, template: `
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<div class="_progress
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
<div class="_block">
|
|
72
|
+
@if (message() !== undefined) {
|
|
73
|
+
<div class="_message">{{ message() }}</div>
|
|
74
|
+
}
|
|
75
|
+
<ng-content />
|
|
76
|
+
@if (useProgress()) {
|
|
77
|
+
<div class="_progress">
|
|
78
|
+
<div class="_progress-bar" [style.width.%]="progress()"></div>
|
|
79
|
+
</div>
|
|
80
|
+
}
|
|
81
|
+
</div>
|
|
82
|
+
`, styles: ["sd-toast {\n display: block;\n margin-bottom: var(--gap-sm);\n text-align: center;\n width: 100%;\n pointer-events: none;\n}\nsd-toast > ._block {\n display: inline-block;\n text-align: left;\n color: var(--text-trans-rev-default);\n transform: translateY(-100%);\n border-radius: var(--border-radius-lg);\n opacity: 0;\n box-shadow: 0 calc(12 * var(--elevation-size)) calc(12 * 4 * var(--elevation-size)) var(--trans-lighter), 0 var(--elevation-size) var(--elevation-size) var(--trans-lighter);\n pointer-events: auto;\n}\nsd-toast > ._block > ._message {\n padding: var(--gap-default) var(--gap-lg);\n word-break: break-all;\n white-space: pre-wrap;\n}\nsd-toast > ._block > ._progress {\n background: var(--theme-gray-default);\n height: 4px;\n border-radius: var(--border-radius-xl);\n margin: 0 4px 4px 4px;\n}\nsd-toast > ._block > ._progress > ._progress-bar {\n border-radius: var(--border-radius-xl);\n height: 4px;\n transition: width 1s ease-out;\n}\nsd-toast[data-sd-theme=gray] > ._block {\n background: rgb(153.0022463699, 161.0057700366, 174.7317580236);\n}\nsd-toast[data-sd-theme=gray] > ._block > ._progress {\n background: rgb(101.0316959931, 111.1055377773, 128.3821070824);\n}\nsd-toast[data-sd-theme=gray] > ._block > ._progress > ._progress-bar {\n background: rgb(224.400673911, 226.801731011, 230.9195274071);\n}\nsd-toast[data-sd-theme=blue-gray] > ._block {\n background: rgb(144.0364277624, 161.0825504589, 184.9359809919);\n}\nsd-toast[data-sd-theme=blue-gray] > ._block > ._progress {\n background: rgb(95.4928842953, 118.7256854589, 151.2364222704);\n}\nsd-toast[data-sd-theme=blue-gray] > ._block > ._progress > ._progress-bar {\n background: rgb(227.2591069406, 231.5206376147, 237.483995248);\n}\nsd-toast[data-sd-theme=primary] > ._block {\n background: hsl(212.7907636992, 106.3271487689%, 66.8390389975%);\n}\nsd-toast[data-sd-theme=primary] > ._block > ._progress {\n background: hsl(212.7907636992, 106.3271487689%, 50.1292792481%);\n}\nsd-toast[data-sd-theme=primary] > ._block > ._progress > ._progress-bar {\n background: hsl(212.7907636992, 106.3271487689%, 91.7097597494%);\n}\nsd-toast[data-sd-theme=secondary] > ._block {\n background: hsl(212.7907636992, 106.3271487689%, 66.8390389975%);\n}\nsd-toast[data-sd-theme=secondary] > ._block > ._progress {\n background: hsl(212.7907636992, 106.3271487689%, 50.1292792481%);\n}\nsd-toast[data-sd-theme=secondary] > ._block > ._progress > ._progress-bar {\n background: hsl(212.7907636992, 106.3271487689%, 91.7097597494%);\n}\nsd-toast[data-sd-theme=info] > ._block {\n background: hsl(186.1271591177, 175.0224558865%, 34.577706736%);\n}\nsd-toast[data-sd-theme=info] > ._block > ._progress {\n background: hsl(186.1271591177, 175.0224558865%, 25.933280052%);\n}\nsd-toast[data-sd-theme=info] > ._block > ._progress > ._progress-bar {\n background: hsl(186.1271591177, 175.0224558865%, 83.644426684%);\n}\nsd-toast[data-sd-theme=success] > ._block {\n background: hsl(76.4778453101, 152.6473732821%, 35.6889214867%);\n}\nsd-toast[data-sd-theme=success] > ._block > ._progress {\n background: hsl(76.4778453101, 152.6473732821%, 26.766691115%);\n}\nsd-toast[data-sd-theme=success] > ._block > ._progress > ._progress-bar {\n background: hsl(76.4778453101, 152.6473732821%, 83.9222303717%);\n}\nsd-toast[data-sd-theme=warning] > ._block {\n background: hsl(31.4330872217, 102.5675912326%, 51.3170331393%);\n}\nsd-toast[data-sd-theme=warning] > ._block > ._progress {\n background: hsl(31.4330872217, 102.5675912326%, 38.4877748545%);\n}\nsd-toast[data-sd-theme=warning] > ._block > ._progress > ._progress-bar {\n background: hsl(31.4330872217, 102.5675912326%, 87.8292582848%);\n}\nsd-toast[data-sd-theme=danger] > ._block {\n background: hsl(358.7593862564, 101.8439024907%, 69.8357359211%);\n}\nsd-toast[data-sd-theme=danger] > ._block > ._progress {\n background: hsl(358.7593862564, 101.8439024907%, 52.3768019408%);\n}\nsd-toast[data-sd-theme=danger] > ._block > ._progress > ._progress-bar {\n background: hsl(358.7593862564, 101.8439024907%, 92.4589339803%);\n}\nsd-toast[data-sd-open=true] > ._block {\n transform: none;\n transition: var(--animation-duration) ease-out;\n transition-property: transform, opacity;\n opacity: 1;\n}\nsd-toast[data-sd-open=false] > ._block {\n transform: translateY(-100%);\n transition: var(--animation-duration) ease-in;\n transition-property: transform, opacity;\n opacity: 0;\n}\n@media all and (max-width: 520px) {\n sd-toast > ._block {\n border-radius: calc(var(--line-height) / 2);\n transform: translateY(100%);\n }\n sd-toast > ._block > ._message {\n padding: var(--gap-xs) var(--gap-default);\n }\n sd-toast[data-sd-open=false] > ._block {\n transform: translateY(100%);\n }\n}"] }]
|
|
78
83
|
}], null, { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], useProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "useProgress", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], progress: [{ type: i0.Input, args: [{ isSignal: true, alias: "progress", required: false }] }, { type: i0.Output, args: ["progressChange"] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }, { type: i0.Output, args: ["messageChange"] }] }); })();
|
|
79
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdToast, { className: "SdToast", filePath: "packages/angular/src/core/toast/sd-toast.ts", lineNumber:
|
|
84
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdToast, { className: "SdToast", filePath: "packages/angular/src/core/toast/sd-toast.ts", lineNumber: 136, forbidOrphanRendering: true }); })();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DestroyRef, effect, ElementRef, inject, Renderer2 } from "@angular/core";
|
|
2
2
|
import { setSafeStyle } from "../setSafeStyle";
|
|
3
3
|
import { Uuid } from "@simplysm/core-common";
|
|
4
|
-
import {
|
|
4
|
+
import { isTabbable } from "tabbable";
|
|
5
5
|
export function setupInvalid(getInvalidMessage) {
|
|
6
6
|
const elRef = inject(ElementRef);
|
|
7
7
|
const renderer = inject(Renderer2);
|
|
@@ -52,6 +52,7 @@ function createInputHiddenEl(renderer, hostEl) {
|
|
|
52
52
|
newEl.type = "text";
|
|
53
53
|
newEl.name = Uuid.generate().toString();
|
|
54
54
|
newEl.className = "sd-invalid-input";
|
|
55
|
+
newEl.tabIndex = -1;
|
|
55
56
|
setSafeStyle(renderer, newEl, {
|
|
56
57
|
position: "absolute",
|
|
57
58
|
left: "2px",
|
|
@@ -64,10 +65,10 @@ function createInputHiddenEl(renderer, hostEl) {
|
|
|
64
65
|
userSelect: "none",
|
|
65
66
|
});
|
|
66
67
|
renderer.listen(newEl, "focus", () => {
|
|
67
|
-
const
|
|
68
|
-
hostEl.
|
|
69
|
-
if (
|
|
70
|
-
|
|
68
|
+
const tabbableElement = (isTabbable(hostEl) ? hostEl : hostEl.findFirstTabbableChild()) ??
|
|
69
|
+
hostEl.findTabbableParent();
|
|
70
|
+
if (tabbableElement !== undefined) {
|
|
71
|
+
tabbableElement.focus();
|
|
71
72
|
}
|
|
72
73
|
});
|
|
73
74
|
renderer.appendChild(hostEl, newEl);
|
|
@@ -24,6 +24,7 @@ export declare abstract class SdDataDetailBase<T extends object, R = boolean> im
|
|
|
24
24
|
submit?(data: T): Promise<R | undefined> | R | undefined;
|
|
25
25
|
private readonly _sdToast;
|
|
26
26
|
private readonly _sdSharedData;
|
|
27
|
+
private readonly _errorHandler;
|
|
27
28
|
viewType: Signal<import("../..").SdViewType>;
|
|
28
29
|
busyCount: import("@angular/core").WritableSignal<number>;
|
|
29
30
|
busyMessage: import("@angular/core").WritableSignal<string | undefined>;
|
|
@@ -42,7 +43,6 @@ export declare abstract class SdDataDetailBase<T extends object, R = boolean> im
|
|
|
42
43
|
permCheck?: boolean;
|
|
43
44
|
hideNoChangeMessage?: boolean;
|
|
44
45
|
}): Promise<void>;
|
|
45
|
-
private _getOrmDataEditToastErrorMessage;
|
|
46
46
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdDataDetailBase<any, any>, never>;
|
|
47
47
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SdDataDetailBase<any, any>, never, never, {}, { "close": "close"; }, never, never, true, never>;
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-data-detail.base.d.ts","sourceRoot":"","sources":["../../../src/data/data-detail/sd-data-detail.base.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"sd-data-detail.base.d.ts","sourceRoot":"","sources":["../../../src/data/data-detail/sd-data-detail.base.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,MAAM,EACX,WAAW,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAO,MAAM,uBAAuB,CAAC;AAMtD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;;AAI5E,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,QAAQ,GAAG,SAAS,CAAC;IACrC,cAAc,EAAE,M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AAC,GAAG,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,mBAAmB,CAAC,EAAE,OAAO,CAAA;KAAE;yCA3HvD,gBAAgB;2CAAhB,gBAAgB;CA8JrC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Directive, effect, inject, output, signal, TemplateRef, } from "@angular/core";
|
|
1
|
+
import { Directive, effect, ErrorHandler, inject, output, signal, TemplateRef, } from "@angular/core";
|
|
2
2
|
import { DateTime, obj } from "@simplysm/core-common";
|
|
3
3
|
import { TXT_CHANGE_IGNORE_CONFIRM } from "../../core/commons";
|
|
4
4
|
import { SdSharedDataProvider } from "../../core/shared-data/sd-shared-data.provider";
|
|
@@ -7,12 +7,14 @@ import { injectViewTypeSignal } from "../../core/routing/injectViewTypeSignal";
|
|
|
7
7
|
import { withBusy } from "../../core/withBusy";
|
|
8
8
|
import {} from "../../core/modal/sd-modal.provider";
|
|
9
9
|
import { SdToastProvider } from "../../core/toast/sd-toast.provider";
|
|
10
|
+
import { getOrmDataEditToastErrorMessage } from "../getOrmDataEditToastErrorMessage";
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
11
12
|
export class SdDataDetailBase {
|
|
12
13
|
canDelete;
|
|
13
14
|
//-- implement
|
|
14
15
|
_sdToast = inject(SdToastProvider);
|
|
15
16
|
_sdSharedData = inject(SdSharedDataProvider);
|
|
17
|
+
_errorHandler = inject(ErrorHandler);
|
|
16
18
|
viewType = injectViewTypeSignal(() => this);
|
|
17
19
|
busyCount = signal(0, ...(ngDevMode ? [{ debugName: "busyCount" }] : /* istanbul ignore next */ []));
|
|
18
20
|
busyMessage = signal(undefined, ...(ngDevMode ? [{ debugName: "busyMessage" }] : /* istanbul ignore next */ []));
|
|
@@ -30,17 +32,22 @@ export class SdDataDetailBase {
|
|
|
30
32
|
cancelled = true;
|
|
31
33
|
});
|
|
32
34
|
queueMicrotask(async () => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
try {
|
|
36
|
+
if (cancelled)
|
|
37
|
+
return;
|
|
38
|
+
if (!this.canUse()) {
|
|
39
|
+
this.initialized.set(true);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
await withBusy(this.busyCount, () => this._sdToast.try(async () => {
|
|
43
|
+
await this._sdSharedData.wait();
|
|
44
|
+
await this.refresh();
|
|
45
|
+
}));
|
|
36
46
|
this.initialized.set(true);
|
|
37
|
-
return;
|
|
38
47
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}));
|
|
43
|
-
this.initialized.set(true);
|
|
48
|
+
catch (err) {
|
|
49
|
+
this._errorHandler.handleError(err);
|
|
50
|
+
}
|
|
44
51
|
});
|
|
45
52
|
});
|
|
46
53
|
setupCanDeactivate(() => this.viewType() === "modal" || this.checkIgnoreChanges());
|
|
@@ -84,7 +91,7 @@ export class SdDataDetailBase {
|
|
|
84
91
|
return;
|
|
85
92
|
this._sdToast.success(`${del ? "삭제" : "복구"}되었습니다.`);
|
|
86
93
|
this.close.emit(result);
|
|
87
|
-
}, (err) =>
|
|
94
|
+
}, (err) => getOrmDataEditToastErrorMessage(err)));
|
|
88
95
|
}
|
|
89
96
|
async doSubmit(opt) {
|
|
90
97
|
if (this.busyCount() > 0)
|
|
@@ -110,15 +117,7 @@ export class SdDataDetailBase {
|
|
|
110
117
|
this._sdToast.success("저장되었습니다.");
|
|
111
118
|
this.close.emit(result);
|
|
112
119
|
await this.refresh();
|
|
113
|
-
}, (err) =>
|
|
114
|
-
}
|
|
115
|
-
_getOrmDataEditToastErrorMessage(err) {
|
|
116
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
117
|
-
if (message.includes("a parent row: a foreign key constraint") ||
|
|
118
|
-
message.includes("conflicted with the REFERENCE")) {
|
|
119
|
-
return "경고! 연결된 작업에 의한 처리 거부. 후속작업 확인 요망";
|
|
120
|
-
}
|
|
121
|
-
return message;
|
|
120
|
+
}, (err) => getOrmDataEditToastErrorMessage(err)));
|
|
122
121
|
}
|
|
123
122
|
static ɵfac = function SdDataDetailBase_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SdDataDetailBase)(); };
|
|
124
123
|
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: SdDataDetailBase, outputs: { close: "close" } });
|
|
@@ -69,7 +69,6 @@ export declare abstract class SdDataSheetBase<TFilter extends Record<string, any
|
|
|
69
69
|
doModalCancel(): void;
|
|
70
70
|
doDownloadExcel(): Promise<void>;
|
|
71
71
|
doUploadExcel(): Promise<void>;
|
|
72
|
-
private _getOrmDataEditToastErrorMessage;
|
|
73
72
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdDataSheetBase<any, any, any>, never>;
|
|
74
73
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SdDataSheetBase<any, any, any>, never, never, { "selectedItemKeys": { "alias": "selectedItemKeys"; "required": false; "isSignal": true; }; }, { "close": "close"; "submitted": "submitted"; "selectedItemKeys": "selectedItemKeysChange"; }, never, never, true, never>;
|
|
75
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-data-sheet.base.d.ts","sourceRoot":"","sources":["../../../src/data/data-sheet/sd-data-sheet.base.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,MAAM,EACX,WAAW,EACX,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAMpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"sd-data-sheet.base.d.ts","sourceRoot":"","sources":["../../../src/data/data-sheet/sd-data-sheet.base.ts"],"names":[],"mappings":"AAAA,OAAO,EA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0BAAuB;IAEpC,SAAS,GAAI,MAAM,KAAK,KAAG,IAAI,GAAG,KAAK,CAAyC;IAEhF,IAAI,yBAAa;IACjB,UAAU,yBAAa;IACvB,WAAW,+BAA4B;IAGvC,MAAM,EAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACjC,UAAU,EAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAGrC,yBAAyB,kBAMvB;IAEF,4BAA4B,kBAM1B;IAEF,kBAAkB,GAAI,MAAM,KAAK,KAAG,MAAM,GAAG,SAAS,CAGtC;IAEhB,mBAAmB,GAAI,MAAM,KAAK,KAAG,OAAO,CAAuC;;IA0FnF,kBAAkB;IAIlB,cAAc;IAId,SAAS;IAQH,OAAO;IAMP,SAAS;IAIT,QAAQ,CAAC,GAAG,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,mBAAmB,CAAC,EAAE,OAAO,CAAA;KAAE;IAI3E,kBAAkB,CAAC,IAAI,EAAE,KAAK;IAMxB,UAAU,CAAC,IAAI,CAAC,EAAE,KAAK;IAIvB,mBAAmB,CAAC,GAAG,EAAE,OAAO;IAItC,cAAc;IAId,aAAa;IAMP,eAAe;IAIf,aAAa;yCAxPC,eAAe;2CAAf,eAAe;CA4PpC"}
|
|
@@ -10,6 +10,7 @@ import { injectDataSheetRefreshManager } from "./injectDataSheetRefreshManager";
|
|
|
10
10
|
import { injectDataSheetInlineEditManager } from "./injectDataSheetInlineEditManager";
|
|
11
11
|
import { injectDataSheetModalEditManager } from "./injectDataSheetModalEditManager";
|
|
12
12
|
import { injectDataSheetExcelManager } from "./injectDataSheetExcelManager";
|
|
13
|
+
import { getOrmDataEditToastErrorMessage } from "../getOrmDataEditToastErrorMessage";
|
|
13
14
|
import * as i0 from "@angular/core";
|
|
14
15
|
export class SdDataSheetBase {
|
|
15
16
|
hideTool;
|
|
@@ -105,7 +106,7 @@ export class SdDataSheetBase {
|
|
|
105
106
|
refresh: () => this._refreshMgr.refresh(),
|
|
106
107
|
getNewItemFn: () => this.newItem?.bind(this),
|
|
107
108
|
getSubmitFn: () => this.submit?.bind(this),
|
|
108
|
-
errorMessageFn: (err) =>
|
|
109
|
+
errorMessageFn: (err) => getOrmDataEditToastErrorMessage(err),
|
|
109
110
|
});
|
|
110
111
|
//-- modal edit composable
|
|
111
112
|
this._modalEditMgr = injectDataSheetModalEditManager({
|
|
@@ -117,7 +118,7 @@ export class SdDataSheetBase {
|
|
|
117
118
|
refresh: () => this._refreshMgr.refresh(),
|
|
118
119
|
getEditItemFn: () => this.editItem?.bind(this),
|
|
119
120
|
getToggleDeleteItemsFn: () => this.toggleDeleteItems?.bind(this),
|
|
120
|
-
errorMessageFn: (err) =>
|
|
121
|
+
errorMessageFn: (err) => getOrmDataEditToastErrorMessage(err),
|
|
121
122
|
});
|
|
122
123
|
//-- excel composable
|
|
123
124
|
this._excelMgr = injectDataSheetExcelManager({
|
|
@@ -126,7 +127,7 @@ export class SdDataSheetBase {
|
|
|
126
127
|
refresh: () => this._refreshMgr.refresh(),
|
|
127
128
|
getDownloadExcelFn: () => this.downloadExcel?.bind(this),
|
|
128
129
|
getUploadExcelFn: () => this.uploadExcel?.bind(this),
|
|
129
|
-
errorMessageFn: (err) =>
|
|
130
|
+
errorMessageFn: (err) => getOrmDataEditToastErrorMessage(err),
|
|
130
131
|
});
|
|
131
132
|
setupCanDeactivate(() => this.viewType() === "modal" || this.checkIgnoreChanges());
|
|
132
133
|
}
|
|
@@ -179,15 +180,6 @@ export class SdDataSheetBase {
|
|
|
179
180
|
async doUploadExcel() {
|
|
180
181
|
await this._excelMgr.doUploadExcel();
|
|
181
182
|
}
|
|
182
|
-
//-- private
|
|
183
|
-
_getOrmDataEditToastErrorMessage(err) {
|
|
184
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
185
|
-
if (message.includes("a parent row: a foreign key constraint") ||
|
|
186
|
-
message.includes("conflicted with the REFERENCE")) {
|
|
187
|
-
return "경고! 연결된 작업에 의한 처리 거부. 후속작업 확인 요망";
|
|
188
|
-
}
|
|
189
|
-
return message;
|
|
190
|
-
}
|
|
191
183
|
static ɵfac = function SdDataSheetBase_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SdDataSheetBase)(); };
|
|
192
184
|
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: SdDataSheetBase, inputs: { selectedItemKeys: [1, "selectedItemKeys"] }, outputs: { close: "close", submitted: "submitted", selectedItemKeys: "selectedItemKeysChange" } });
|
|
193
185
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOrmDataEditToastErrorMessage.d.ts","sourceRoot":"","sources":["../../src/data/getOrmDataEditToastErrorMessage.ts"],"names":[],"mappings":"AAAA,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CASpE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function getOrmDataEditToastErrorMessage(err) {
|
|
2
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
3
|
+
if (message.includes("a parent row: a foreign key constraint") ||
|
|
4
|
+
message.includes("conflicted with the REFERENCE")) {
|
|
5
|
+
return "경고! 연결된 작업에 의한 처리 거부. 후속작업 확인 요망";
|
|
6
|
+
}
|
|
7
|
+
return message;
|
|
8
|
+
}
|
|
@@ -4,7 +4,7 @@ export declare class SdPermissionTable<TModule> {
|
|
|
4
4
|
value: import("@angular/core").ModelSignal<Record<string, boolean>>;
|
|
5
5
|
items: import("@angular/core").InputSignal<SdPermission<TModule>[]>;
|
|
6
6
|
disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
7
|
-
collapsedItems: import("@angular/core").WritableSignal<Set<
|
|
7
|
+
collapsedItems: import("@angular/core").WritableSignal<Set<string>>;
|
|
8
8
|
depthLength: import("@angular/core").Signal<number>;
|
|
9
9
|
private readonly _permExistsCache;
|
|
10
10
|
private readonly _permCheckedCache;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-permission-table.d.ts","sourceRoot":"","sources":["../../../src/data/permission-table/sd-permission-table.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;;AAMpF,qBAiMa,iBAAiB,CAAC,OAAO;IACpC,KAAK,+DAAsC;IAE3C,KAAK,+DAAsC;IAC3C,QAAQ,qEAAiD;IAEzD,cAAc,
|
|
1
|
+
{"version":3,"file":"sd-permission-table.d.ts","sourceRoot":"","sources":["../../../src/data/permission-table/sd-permission-table.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;;AAMpF,qBAiMa,iBAAiB,CAAC,OAAO;IACpC,KAAK,+DAAsC;IAE3C,KAAK,+DAAsC;IAC3C,QAAQ,qEAAiD;IAEzD,cAAc,sDAA6B;IAE3C,WAAW,yCAER;IAEH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CA6B9B;IAEH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAgC/B;IAEH,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CA6ChC;IAEH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IAEzD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAW1B,kBAAkB,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,OAAO;IAIxD,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,EAAE;IAIpE,eAAe,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,OAAO;IAIrD,eAAe,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO;IAI3E,gBAAgB,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO;IAI5E,oBAAoB,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC;IAiBhD,iBAAiB,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,GAAG,MAAM,EAAE,GAAG,EAAE,OAAO;IAQjF,OAAO,CAAC,gBAAgB;IAkDxB,OAAO,CAAC,eAAe;IAYvB,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAG;QACpC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5B,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;KAC3C,CAAC;yCAzPS,iBAAiB;2CAAjB,iBAAiB;CA0P7B"}
|
|
@@ -251,7 +251,7 @@ export class SdPermissionTable {
|
|
|
251
251
|
return cached;
|
|
252
252
|
}
|
|
253
253
|
getIsPermCollapsed(item) {
|
|
254
|
-
return this.collapsedItems().has(item);
|
|
254
|
+
return this.collapsedItems().has(item.codeChain.join("."));
|
|
255
255
|
}
|
|
256
256
|
getAllChildren(item) {
|
|
257
257
|
return item.children?.mapMany((child) => [child, ...this.getAllChildren(child)]) ?? [];
|
|
@@ -266,16 +266,17 @@ export class SdPermissionTable {
|
|
|
266
266
|
return this._permCheckedCache().get(item.codeChain.join(".") + "." + type) ?? false;
|
|
267
267
|
}
|
|
268
268
|
onPermCollapseToggle(item) {
|
|
269
|
+
const key = item.codeChain.join(".");
|
|
269
270
|
this.collapsedItems.update((v) => {
|
|
270
271
|
const r = new Set(v);
|
|
271
|
-
if (r.has(
|
|
272
|
-
r.delete(
|
|
272
|
+
if (r.has(key)) {
|
|
273
|
+
r.delete(key);
|
|
273
274
|
}
|
|
274
275
|
else {
|
|
275
|
-
r.add(
|
|
276
|
+
r.add(key);
|
|
276
277
|
const allChildren = this.getAllChildren(item);
|
|
277
278
|
for (const allChild of allChildren) {
|
|
278
|
-
r.add(allChild);
|
|
279
|
+
r.add(allChild.codeChain.join("."));
|
|
279
280
|
}
|
|
280
281
|
}
|
|
281
282
|
return r;
|
|
@@ -20,9 +20,9 @@ export function useSheetCellAgent(options) {
|
|
|
20
20
|
const cell = options.domAccessor.getCell(r, c);
|
|
21
21
|
if (cell == null)
|
|
22
22
|
return;
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
|
|
23
|
+
const tabbable = cell.findFirstTabbableChild();
|
|
24
|
+
if (tabbable !== undefined) {
|
|
25
|
+
tabbable.focus();
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -45,9 +45,9 @@ export function useSheetCellAgent(options) {
|
|
|
45
45
|
const targetCell = options.domAccessor.getCell(r, c);
|
|
46
46
|
if (targetCell == null)
|
|
47
47
|
return;
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
|
|
48
|
+
const tabbable = targetCell.findFirstTabbableChild();
|
|
49
|
+
if (tabbable !== undefined) {
|
|
50
|
+
tabbable.focus();
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-tiptap-editor.d.ts","sourceRoot":"","sources":["../../../src/features/editor/sd-tiptap-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAcL,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;;
|
|
1
|
+
{"version":3,"file":"sd-tiptap-editor.d.ts","sourceRoot":"","sources":["../../../src/features/editor/sd-tiptap-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAcL,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;;AAqBzD,qBAsMa,cAAc;IACzB,KAAK,0DAAmB;IACxB,QAAQ,qEAAiD;IACzD,QAAQ,qEAAiD;IACzD,QAAQ,qEAAiD;IACzD,WAAW,0DAAmB;IAC9B,WAAW,+CAAiB,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,eAAI;IACzE,UAAU,kEAA2B;IAErC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+C;IACtE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsB;IAElD,QAAQ,CAAC,YAAY,WAMnB;IAEF,qDAAqD;IACrD,MAAM,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAqB;IAE/D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6C;IACtE,YAAY,kEAA8B;IAC1C,WAAW,yBAA6B;IACxC,aAAa,yBAA+B;IAC5C,eAAe,4CAAiC;IAChD,OAAO,wBAAyB;IAChC,iBAAiB,gCAAmC;IACpD,UAAU,sCAA4B;IAEtC,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,eAAe,CAA6B;IAEpD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CASjC;;IA4DH,OAAO,CAAC,aAAa;IAoBrB,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,kBAAkB;yCArIf,cAAc;2CAAd,cAAc;CA2I1B"}
|
|
@@ -7,6 +7,7 @@ import Color from "@tiptap/extension-color";
|
|
|
7
7
|
import Highlight from "@tiptap/extension-highlight";
|
|
8
8
|
import TextAlign from "@tiptap/extension-text-align";
|
|
9
9
|
import Image from "@tiptap/extension-image";
|
|
10
|
+
import Underline from "@tiptap/extension-underline";
|
|
10
11
|
import Placeholder from "@tiptap/extension-placeholder";
|
|
11
12
|
import { useTiptapToolbar } from "./useTiptapToolbar";
|
|
12
13
|
import * as i0 from "@angular/core";
|
|
@@ -158,6 +159,7 @@ const DEFAULT_EXTENSIONS = [
|
|
|
158
159
|
Highlight.configure({ multicolor: true }),
|
|
159
160
|
TextAlign.configure({ types: ["heading", "paragraph"] }),
|
|
160
161
|
Image.configure({ inline: false, allowBase64: true }),
|
|
162
|
+
Underline,
|
|
161
163
|
];
|
|
162
164
|
export class SdTiptapEditor {
|
|
163
165
|
value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
|
|
@@ -374,4 +376,4 @@ export class SdTiptapEditor {
|
|
|
374
376
|
"[attr.data-sd-readonly]": "readonly()",
|
|
375
377
|
}, styles: ["sd-tiptap-editor {\n display: block;\n position: relative;\n border: 1px solid var(--trans-lighter);\n border-radius: var(--border-radius-default);\n background: var(--theme-secondary-lightest);\n}\nsd-tiptap-editor > ._toolbar {\n display: flex;\n flex-wrap: wrap;\n gap: var(--gap-xs);\n padding: var(--gap-xs);\n border-bottom: 1px solid var(--trans-lighter);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group {\n display: flex;\n gap: 1px;\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button {\n padding: var(--gap-xs) var(--gap-sm);\n border: 1px solid var(--trans-lighter);\n border-radius: var(--border-radius-default);\n background: transparent;\n cursor: pointer;\n font-size: var(--font-size-default);\n line-height: 1;\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button._active {\n background: var(--theme-primary-default);\n color: var(--text-trans-rev-default);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button:hover {\n background: var(--trans-lighter);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button._active:hover {\n background: var(--theme-primary-default);\n}\nsd-tiptap-editor > ._color-picker {\n display: flex;\n flex-wrap: wrap;\n gap: 2px;\n padding: var(--gap-xs);\n border-bottom: 1px solid var(--trans-lighter);\n}\nsd-tiptap-editor > ._color-picker > ._color-swatch {\n width: 1.25rem;\n height: 1.25rem;\n border: 1px solid var(--trans-lighter);\n border-radius: 2px;\n cursor: pointer;\n padding: 0;\n}\nsd-tiptap-editor > ._color-picker > ._color-swatch._no-color {\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--control-color);\n font-size: 0.625rem;\n}\nsd-tiptap-editor > ._editor-container {\n padding: var(--gap-sm);\n min-height: 6.25rem;\n}\nsd-tiptap-editor > ._editor-container > .tiptap {\n outline: none;\n}\nsd-tiptap-editor > ._editor-container > .tiptap:focus {\n outline: none;\n}\nsd-tiptap-editor[data-sd-disabled=true] {\n background: var(--theme-gray-lightest);\n color: var(--text-trans-light);\n}\nsd-tiptap-editor[data-sd-disabled=true] > ._editor-container > .tiptap {\n cursor: not-allowed;\n}\nsd-tiptap-editor[data-sd-readonly=true] > ._editor-container > .tiptap {\n cursor: default;\n}\nsd-tiptap-editor ._color-btn {\n position: relative;\n}\nsd-tiptap-editor ._color-btn > ._color-indicator {\n display: block;\n height: 2px;\n width: 100%;\n position: absolute;\n bottom: 2px;\n left: 0;\n}"] }]
|
|
376
378
|
}], () => [], { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], validatorFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "validatorFn", required: false }] }], extensions: [{ type: i0.Input, args: [{ isSignal: true, alias: "extensions", required: false }] }] }); })();
|
|
377
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdTiptapEditor, { className: "SdTiptapEditor", filePath: "packages/angular/src/features/editor/sd-tiptap-editor.ts", lineNumber:
|
|
379
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdTiptapEditor, { className: "SdTiptapEditor", filePath: "packages/angular/src/features/editor/sd-tiptap-editor.ts", lineNumber: 237, forbidOrphanRendering: true }); })();
|
package/dist/index.d.ts
CHANGED
|
@@ -109,6 +109,7 @@ export { SdDataSheetColumn } from "./data/data-sheet/sd-data-sheet-column";
|
|
|
109
109
|
export { setupCloserWhenSingleSelectionChange } from "./data/data-sheet/setupCloserWhenSingleSelectionChange";
|
|
110
110
|
export { SdDataDetail } from "./data/data-detail/sd-data-detail";
|
|
111
111
|
export { SdDataDetailBase, type SdDataDetailDataInfo, } from "./data/data-detail/sd-data-detail.base";
|
|
112
|
+
export { getOrmDataEditToastErrorMessage } from "./data/getOrmDataEditToastErrorMessage";
|
|
112
113
|
export { SdDataSelectButton } from "./data/data-select-button/sd-data-select-button";
|
|
113
114
|
export { SdDataSelectButtonBase } from "./data/data-select-button/sd-data-select-button.base";
|
|
114
115
|
export { SdSharedDataSelect } from "./data/shared-data/sd-shared-data-select";
|