@simplysm/angular 14.0.39 → 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/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/modal/injectFocusTrap.js +4 -4
- package/dist/core/modal/sd-modal.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/validation/setupInvalid.js +6 -5
- package/dist/data/sheet/useSheetCellAgent.js +6 -6
- 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/modal/injectFocusTrap.ts +4 -4
- package/src/core/modal/sd-modal.provider.ts +4 -4
- 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/sheet/useSheetCellAgent.ts +6 -6
- 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
|
}
|
|
@@ -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();
|
|
@@ -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();
|
|
@@ -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);
|
|
@@ -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
|
}
|
|
@@ -45,7 +45,7 @@ function SdSidebarMenu_ng_template_4_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
45
45
|
const menu_r2 = ctx.$implicit;
|
|
46
46
|
const depth_r4 = i0.ɵɵnextContext().depth;
|
|
47
47
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
48
|
-
i0.ɵɵstyleProp("
|
|
48
|
+
i0.ɵɵstyleProp("text-indent", depth_r4 > 0 ? (depth_r4 + 1) * 0.5 : undefined, "em");
|
|
49
49
|
i0.ɵɵproperty("sdRouterLink", ctx_r2.getMenuRouterLinkOption(menu_r2))("selected", ctx_r2.getIsMenuSelected(menu_r2))("layout", depth_r4 === 0 ? ctx_r2.rootLayout() : "accordion");
|
|
50
50
|
i0.ɵɵadvance();
|
|
51
51
|
i0.ɵɵconditional(menu_r2.icon ? 1 : -1);
|
|
@@ -81,7 +81,7 @@ export class SdSidebarMenu {
|
|
|
81
81
|
static ɵfac = function SdSidebarMenu_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SdSidebarMenu)(); };
|
|
82
82
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SdSidebarMenu, selectors: [["sd-sidebar-menu"]], hostAttrs: [1, "flex-column", "fill"], hostVars: 1, hostBindings: function SdSidebarMenu_HostBindings(rf, ctx) { if (rf & 2) {
|
|
83
83
|
i0.ɵɵattribute("data-sd-root-layout", ctx.rootLayout());
|
|
84
|
-
} }, inputs: { menus: [1, "menus"], layout: [1, "layout"], getMenuIsSelectedFn: [1, "getMenuIsSelectedFn"] }, decls: 6, vars: 6, consts: [["itemTpl", ""], [1, "control-header", "p-default"], [1, "flex-fill", 3, "inset"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], [3, "typed"], [3, "
|
|
84
|
+
} }, inputs: { menus: [1, "menus"], layout: [1, "layout"], getMenuIsSelectedFn: [1, "getMenuIsSelectedFn"] }, decls: 6, vars: 6, consts: [["itemTpl", ""], [1, "control-header", "p-default"], [1, "flex-fill", 3, "inset"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], [3, "typed"], [3, "text-indent", "sdRouterLink", "selected", "layout"], [3, "click", "sdRouterLink", "selected", "layout"], [3, "inset"], [3, "svg"]], template: function SdSidebarMenu_Template(rf, ctx) { if (rf & 1) {
|
|
85
85
|
i0.ɵɵelementStart(0, "div", 1);
|
|
86
86
|
i0.ɵɵtext(1, "MENU");
|
|
87
87
|
i0.ɵɵelementEnd();
|
|
@@ -129,7 +129,7 @@ export class SdSidebarMenu {
|
|
|
129
129
|
<ng-template #itemTpl [typed]="itemTemplateType" let-currMenus="menus" let-depth="depth">
|
|
130
130
|
@for (menu of currMenus; track menu.codeChain.join(".")) {
|
|
131
131
|
<sd-list-item
|
|
132
|
-
[style.
|
|
132
|
+
[style.text-indent.em]="depth > 0 ? (depth + 1) * 0.5 : undefined"
|
|
133
133
|
[sdRouterLink]="getMenuRouterLinkOption(menu)"
|
|
134
134
|
(click)="onMenuClick(menu)"
|
|
135
135
|
[selected]="getIsMenuSelected(menu)"
|
package/dist/styles.css
CHANGED
|
@@ -283,7 +283,7 @@
|
|
|
283
283
|
border: 2px solid transparent;
|
|
284
284
|
}
|
|
285
285
|
*::-webkit-scrollbar-track:hover {
|
|
286
|
-
background-color: var(--theme-gray-
|
|
286
|
+
background-color: var(--theme-gray-lightest);
|
|
287
287
|
border-radius: 0.6667rem;
|
|
288
288
|
background-clip: padding-box;
|
|
289
289
|
border: 2px solid transparent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/angular",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.40",
|
|
4
4
|
"description": "심플리즘 패키지 - Angular",
|
|
5
5
|
"author": "심플리즘",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"jspdf": "^4.2.1",
|
|
51
51
|
"rxjs": "^7.8.2",
|
|
52
52
|
"tabbable": "^6.4.0",
|
|
53
|
-
"@simplysm/core-browser": "14.0.
|
|
54
|
-
"@simplysm/
|
|
55
|
-
"@simplysm/
|
|
56
|
-
"@simplysm/service-common": "14.0.
|
|
53
|
+
"@simplysm/core-browser": "14.0.40",
|
|
54
|
+
"@simplysm/service-client": "14.0.40",
|
|
55
|
+
"@simplysm/core-common": "14.0.40",
|
|
56
|
+
"@simplysm/service-common": "14.0.40"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@angular/compiler": "^21.2.8",
|
|
@@ -47,17 +47,23 @@ export class SdCollapse {
|
|
|
47
47
|
|
|
48
48
|
contentHeight = signal(0);
|
|
49
49
|
|
|
50
|
+
private readonly _initialized = signal(false);
|
|
51
|
+
|
|
50
52
|
contentMarginTop = computed(() => {
|
|
51
53
|
return this.open() ? "" : `-${this.contentHeight()}px`;
|
|
52
54
|
});
|
|
53
55
|
|
|
54
56
|
contentTransition = computed(() => {
|
|
57
|
+
if (!this._initialized()) return "";
|
|
55
58
|
return this.open() ? "margin-top 0.1s ease-out" : "margin-top 0.1s ease-in";
|
|
56
59
|
});
|
|
57
60
|
|
|
58
61
|
constructor() {
|
|
59
62
|
afterNextRender(() => {
|
|
60
63
|
this.contentHeight.set(this._contentElRef().nativeElement.offsetHeight);
|
|
64
|
+
requestAnimationFrame(() => {
|
|
65
|
+
this._initialized.set(true);
|
|
66
|
+
});
|
|
61
67
|
});
|
|
62
68
|
|
|
63
69
|
effect(() => {
|
|
@@ -129,11 +129,11 @@ export class SdDropdown {
|
|
|
129
129
|
this._openPopup();
|
|
130
130
|
} else {
|
|
131
131
|
const popupEl = this.popupElRef().nativeElement;
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
132
|
+
const tabbable = popupEl.findFirstTabbableChild();
|
|
133
|
+
if (tabbable) {
|
|
134
134
|
event.preventDefault();
|
|
135
135
|
event.stopPropagation();
|
|
136
|
-
|
|
136
|
+
tabbable.focus();
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
@@ -261,9 +261,9 @@ export class SdDropdown {
|
|
|
261
261
|
mouseoverEl instanceof HTMLElement &&
|
|
262
262
|
(contentEl.contains(mouseoverEl) === true || popupEl.contains(mouseoverEl) === true)
|
|
263
263
|
) {
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
266
|
-
|
|
264
|
+
const tabbable = popupEl.findFirstTabbableChild();
|
|
265
|
+
if (tabbable != null) {
|
|
266
|
+
tabbable.focus();
|
|
267
267
|
} else {
|
|
268
268
|
contentEl.focus();
|
|
269
269
|
}
|
|
@@ -97,12 +97,6 @@ import { setupRipple } from "../../core/ripple/setupRipple";
|
|
|
97
97
|
background: transparent;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
&[data-sd-has-children="false"] {
|
|
102
|
-
> ._content {
|
|
103
|
-
padding-left: calc(var(--gap-default) + var(--gap-sm) + 0.75em);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
100
|
}
|
|
107
101
|
`,
|
|
108
102
|
],
|
|
@@ -279,15 +279,15 @@ export class SdSelect<M extends "single" | "multi", T> {
|
|
|
279
279
|
event.preventDefault();
|
|
280
280
|
event.stopPropagation();
|
|
281
281
|
|
|
282
|
-
const
|
|
283
|
-
if (
|
|
282
|
+
const tabbableEls = tabbable(popupEl);
|
|
283
|
+
if (tabbableEls.length === 0) return;
|
|
284
284
|
|
|
285
|
-
const currIndex =
|
|
285
|
+
const currIndex = tabbableEls.indexOf(document.activeElement as HTMLElement);
|
|
286
286
|
|
|
287
287
|
if (event.key === "ArrowDown") {
|
|
288
288
|
const nextIndex = currIndex + 1;
|
|
289
|
-
if (nextIndex <
|
|
290
|
-
|
|
289
|
+
if (nextIndex < tabbableEls.length) {
|
|
290
|
+
tabbableEls[nextIndex].focus();
|
|
291
291
|
}
|
|
292
292
|
} else {
|
|
293
293
|
// ArrowUp
|
|
@@ -295,7 +295,7 @@ export class SdSelect<M extends "single" | "multi", T> {
|
|
|
295
295
|
// Return focus to dropdown trigger
|
|
296
296
|
this._dropdownElRef().nativeElement.focus();
|
|
297
297
|
} else {
|
|
298
|
-
|
|
298
|
+
tabbableEls[currIndex - 1].focus();
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
}
|
|
@@ -321,14 +321,9 @@ export class SdSelect<M extends "single" | "multi", T> {
|
|
|
321
321
|
const items = this._itemControls();
|
|
322
322
|
const currentValue = this.value();
|
|
323
323
|
|
|
324
|
-
if (currentValue == null) {
|
|
325
|
-
this._selectedItemContentHTML.set(undefined);
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
324
|
if (this.selectMode() === "multi") {
|
|
330
|
-
const arr = currentValue as T[];
|
|
331
|
-
if (arr.length === 0) {
|
|
325
|
+
const arr = currentValue as T[] | undefined;
|
|
326
|
+
if (arr == null || arr.length === 0) {
|
|
332
327
|
this._selectedItemContentHTML.set(undefined);
|
|
333
328
|
return;
|
|
334
329
|
}
|
|
@@ -21,11 +21,11 @@ export function injectFocusTrap(): {
|
|
|
21
21
|
|
|
22
22
|
function handleTabTrap(event: KeyboardEvent): void {
|
|
23
23
|
const hostEl = elRef.nativeElement;
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
24
|
+
const tabbableElements = getTabbableElements(hostEl);
|
|
25
|
+
if (tabbableElements.length === 0) return;
|
|
26
26
|
|
|
27
|
-
const first =
|
|
28
|
-
const last =
|
|
27
|
+
const first = tabbableElements[0];
|
|
28
|
+
const last = tabbableElements[tabbableElements.length - 1];
|
|
29
29
|
|
|
30
30
|
if (event.shiftKey) {
|
|
31
31
|
if (document.activeElement === first) {
|
|
@@ -170,11 +170,11 @@ export class SdModalProvider {
|
|
|
170
170
|
if (options?.noFirstControlFocusing === true) {
|
|
171
171
|
dialogEl.focus();
|
|
172
172
|
} else {
|
|
173
|
-
// 컨텐츠 영역에서 첫
|
|
173
|
+
// 컨텐츠 영역에서 첫 탭 이동 가능 요소 검색
|
|
174
174
|
const contentEl = modalEl.querySelector("._content");
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
177
|
-
|
|
175
|
+
const firstTabbable = contentEl?.findFirstTabbableChild();
|
|
176
|
+
if (firstTabbable !== undefined) {
|
|
177
|
+
firstTabbable.focus();
|
|
178
178
|
} else {
|
|
179
179
|
dialogEl.focus();
|
|
180
180
|
}
|
|
@@ -18,18 +18,21 @@ import {
|
|
|
18
18
|
styles: [
|
|
19
19
|
/* language=SCSS */ `
|
|
20
20
|
@use "../../../scss/commons/variables";
|
|
21
|
+
@use "../../../scss/commons/mixins";
|
|
21
22
|
@use "sass:map";
|
|
22
23
|
|
|
23
24
|
sd-toast-container {
|
|
25
|
+
display: flex;
|
|
24
26
|
position: fixed;
|
|
25
27
|
top: 0;
|
|
26
28
|
left: 0;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
flex-direction: column;
|
|
30
|
-
align-items: center;
|
|
31
|
-
z-index: map.get(variables.$vars, z-index, toast);
|
|
29
|
+
height: 100%;
|
|
30
|
+
width: 100%;
|
|
32
31
|
pointer-events: none;
|
|
32
|
+
padding: var(--gap-xxl);
|
|
33
|
+
z-index: map.get(variables.$vars, z-index, toast);
|
|
34
|
+
|
|
35
|
+
@include mixins.flex-direction(column);
|
|
33
36
|
|
|
34
37
|
@media all and (max-width: variables.$breakpoint-mobile) {
|
|
35
38
|
flex-direction: column-reverse;
|
|
@@ -37,8 +40,6 @@ import {
|
|
|
37
40
|
|
|
38
41
|
&[data-sd-overlap] {
|
|
39
42
|
display: block;
|
|
40
|
-
bottom: 0;
|
|
41
|
-
height: 100%;
|
|
42
43
|
|
|
43
44
|
> sd-toast {
|
|
44
45
|
position: absolute;
|
|
@@ -46,7 +47,6 @@ import {
|
|
|
46
47
|
left: var(--gap-xxl);
|
|
47
48
|
right: var(--gap-xxl);
|
|
48
49
|
width: auto;
|
|
49
|
-
max-width: none;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -18,21 +18,23 @@ const ASSERTIVE_THEMES: ReadonlySet<string> = new Set(["warning", "danger"]);
|
|
|
18
18
|
encapsulation: ViewEncapsulation.None,
|
|
19
19
|
standalone: true,
|
|
20
20
|
host: {
|
|
21
|
-
"[attr.data-sd-open]": "open()
|
|
21
|
+
"[attr.data-sd-open]": "open()",
|
|
22
22
|
"[attr.data-sd-theme]": "theme()",
|
|
23
23
|
"[attr.role]": "ariaRole()",
|
|
24
24
|
"[attr.aria-live]": "ariaLive()",
|
|
25
25
|
},
|
|
26
26
|
template: `
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<div class="_progress
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
<div class="_block">
|
|
28
|
+
@if (message() !== undefined) {
|
|
29
|
+
<div class="_message">{{ message() }}</div>
|
|
30
|
+
}
|
|
31
|
+
<ng-content />
|
|
32
|
+
@if (useProgress()) {
|
|
33
|
+
<div class="_progress">
|
|
34
|
+
<div class="_progress-bar" [style.width.%]="progress()"></div>
|
|
35
|
+
</div>
|
|
36
|
+
}
|
|
37
|
+
</div>
|
|
36
38
|
`,
|
|
37
39
|
styles: [
|
|
38
40
|
/* language=SCSS */ `
|
|
@@ -42,59 +44,90 @@ const ASSERTIVE_THEMES: ReadonlySet<string> = new Set(["warning", "danger"]);
|
|
|
42
44
|
|
|
43
45
|
sd-toast {
|
|
44
46
|
display: block;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
margin-bottom: var(--gap-sm);
|
|
48
|
+
text-align: center;
|
|
47
49
|
width: 100%;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
|
|
52
|
+
> ._block {
|
|
53
|
+
display: inline-block;
|
|
54
|
+
text-align: left;
|
|
55
|
+
color: var(--text-trans-rev-default);
|
|
56
|
+
transform: translateY(-100%);
|
|
57
|
+
border-radius: var(--border-radius-lg);
|
|
58
|
+
opacity: 0;
|
|
59
|
+
@include mixins.elevation(12);
|
|
60
|
+
pointer-events: auto;
|
|
61
|
+
|
|
62
|
+
> ._message {
|
|
63
|
+
padding: var(--gap-default) var(--gap-lg);
|
|
64
|
+
word-break: break-all;
|
|
65
|
+
white-space: pre-wrap;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
> ._progress {
|
|
69
|
+
background: var(--theme-gray-default);
|
|
70
|
+
height: 4px;
|
|
71
|
+
border-radius: var(--border-radius-xl);
|
|
72
|
+
margin: 0 4px 4px 4px;
|
|
73
|
+
|
|
74
|
+
> ._progress-bar {
|
|
75
|
+
border-radius: var(--border-radius-xl);
|
|
76
|
+
height: 4px;
|
|
77
|
+
transition: width 1s ease-out;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
64
80
|
}
|
|
65
81
|
|
|
66
82
|
@each $theme-name, $theme-map in map.get(variables.$vars, theme) {
|
|
67
83
|
&[data-sd-theme="#{$theme-name}"] {
|
|
68
|
-
|
|
84
|
+
> ._block {
|
|
85
|
+
background: map.get($theme-map, default);
|
|
86
|
+
|
|
87
|
+
> ._progress {
|
|
88
|
+
background: map.get($theme-map, darker);
|
|
89
|
+
|
|
90
|
+
> ._progress-bar {
|
|
91
|
+
background: map.get($theme-map, lighter);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
69
95
|
}
|
|
70
96
|
}
|
|
71
97
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
98
|
+
&[data-sd-open="true"] {
|
|
99
|
+
> ._block {
|
|
100
|
+
transform: none;
|
|
101
|
+
transition: var(--animation-duration) ease-out;
|
|
102
|
+
transition-property: transform, opacity;
|
|
103
|
+
opacity: 1;
|
|
104
|
+
}
|
|
75
105
|
}
|
|
76
106
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
background: var(--trans-lighter);
|
|
84
|
-
border-radius: 0 0 var(--border-radius-default) var(--border-radius-default);
|
|
85
|
-
overflow: hidden;
|
|
86
|
-
|
|
87
|
-
> ._progress-bar {
|
|
88
|
-
height: 100%;
|
|
89
|
-
background: var(--trans-default);
|
|
90
|
-
transition: width 0.3s ease;
|
|
107
|
+
&[data-sd-open="false"] {
|
|
108
|
+
> ._block {
|
|
109
|
+
transform: translateY(-100%);
|
|
110
|
+
transition: var(--animation-duration) ease-in;
|
|
111
|
+
transition-property: transform, opacity;
|
|
112
|
+
opacity: 0;
|
|
91
113
|
}
|
|
92
114
|
}
|
|
93
115
|
|
|
94
116
|
@media all and (max-width: variables.$breakpoint-mobile) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
117
|
+
> ._block {
|
|
118
|
+
border-radius: calc(var(--line-height) / 2);
|
|
119
|
+
transform: translateY(100%);
|
|
120
|
+
|
|
121
|
+
> ._message {
|
|
122
|
+
padding: var(--gap-xs) var(--gap-default);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&[data-sd-open="false"] {
|
|
127
|
+
> ._block {
|
|
128
|
+
transform: translateY(100%);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
98
131
|
}
|
|
99
132
|
}
|
|
100
133
|
`,
|
|
@@ -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
|
|
|
6
6
|
export function setupInvalid(getInvalidMessage: () => string): void {
|
|
7
7
|
const elRef = inject<ElementRef<HTMLElement>>(ElementRef);
|
|
@@ -65,6 +65,7 @@ function createInputHiddenEl(renderer: Renderer2, hostEl: HTMLElement): HTMLInpu
|
|
|
65
65
|
newEl.type = "text";
|
|
66
66
|
newEl.name = Uuid.generate().toString();
|
|
67
67
|
newEl.className = "sd-invalid-input";
|
|
68
|
+
newEl.tabIndex = -1;
|
|
68
69
|
setSafeStyle(renderer, newEl, {
|
|
69
70
|
position: "absolute",
|
|
70
71
|
left: "2px",
|
|
@@ -79,11 +80,11 @@ function createInputHiddenEl(renderer: Renderer2, hostEl: HTMLElement): HTMLInpu
|
|
|
79
80
|
});
|
|
80
81
|
|
|
81
82
|
renderer.listen(newEl, "focus", () => {
|
|
82
|
-
const
|
|
83
|
-
(
|
|
84
|
-
hostEl.
|
|
85
|
-
if (
|
|
86
|
-
|
|
83
|
+
const tabbableElement =
|
|
84
|
+
(isTabbable(hostEl) ? hostEl : hostEl.findFirstTabbableChild()) ??
|
|
85
|
+
hostEl.findTabbableParent();
|
|
86
|
+
if (tabbableElement !== undefined) {
|
|
87
|
+
tabbableElement.focus();
|
|
87
88
|
}
|
|
88
89
|
});
|
|
89
90
|
|
|
@@ -25,9 +25,9 @@ export function useSheetCellAgent(options: {
|
|
|
25
25
|
queueMicrotask(() => {
|
|
26
26
|
const cell = options.domAccessor.getCell(r, c);
|
|
27
27
|
if (cell == null) return;
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
|
|
28
|
+
const tabbable =cell.findFirstTabbableChild();
|
|
29
|
+
if (tabbable !== undefined) {
|
|
30
|
+
tabbable.focus();
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -51,9 +51,9 @@ export function useSheetCellAgent(options: {
|
|
|
51
51
|
_isTransitioning = false;
|
|
52
52
|
const targetCell = options.domAccessor.getCell(r, c);
|
|
53
53
|
if (targetCell == null) return;
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
|
|
54
|
+
const tabbable =targetCell.findFirstTabbableChild();
|
|
55
|
+
if (tabbable !== undefined) {
|
|
56
|
+
tabbable.focus();
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
} else {
|
|
@@ -42,7 +42,7 @@ import { NgIcon } from "@ng-icons/core";
|
|
|
42
42
|
<ng-template #itemTpl [typed]="itemTemplateType" let-currMenus="menus" let-depth="depth">
|
|
43
43
|
@for (menu of currMenus; track menu.codeChain.join(".")) {
|
|
44
44
|
<sd-list-item
|
|
45
|
-
[style.
|
|
45
|
+
[style.text-indent.em]="depth > 0 ? (depth + 1) * 0.5 : undefined"
|
|
46
46
|
[sdRouterLink]="getMenuRouterLinkOption(menu)"
|
|
47
47
|
(click)="onMenuClick(menu)"
|
|
48
48
|
[selected]="getIsMenuSelected(menu)"
|