@ids-group-ltd/ids-design-system 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +261 -3
- package/agent/INDEX.md +12 -2
- package/agent/feedback/ds-attachment.md +12 -0
- package/agent/feedback/ds-chat-attachment.md +10 -0
- package/agent/feedback/ds-chat-message.md +11 -0
- package/agent/feedback/ds-chat-step.md +10 -0
- package/agent/feedback/ds-chat-steps.md +10 -0
- package/agent/feedback/ds-chat-thread.md +11 -0
- package/agent/feedback/ds-timeline-item.md +3 -1
- package/agent/feedback/ds-timeline.md +9 -0
- package/agent/feedback/ds-toast.md +1 -1
- package/agent/feedback/ds-tree.md +3 -1
- package/agent/forms/ds-chat-input.md +16 -0
- package/agent/forms/ds-inline-edit.md +14 -0
- package/agent/foundations/tokens.md +3 -3
- package/agent/navigation/ds-splitter.md +14 -0
- package/agent/platform/toast-service.md +3 -2
- package/agent/tables/ds-table.md +1 -1
- package/components.md +107 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +7 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chat.mjs +858 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chat.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-inline-edit.mjs +107 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-inline-edit.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-splitter.mjs +359 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-splitter.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +74 -17
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +163 -20
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +146 -24
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +54 -0
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +4 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/1.0.2.json +28 -0
- package/migrations/1.0.3.json +15 -0
- package/migrations/1.1.0.json +183 -0
- package/package.json +25 -1
- package/schematics/check-overrides/surface.json +181 -5
- package/styles/_dropdown-overlay.scss +6 -4
- package/styles/_step-marker.scss +51 -0
- package/styles/_tokens.scss +5 -3
- package/themes/README.md +2 -1
- package/themes/_semantic.scss +10 -0
- package/themes/dark/_palette.scss +1 -2
- package/themes/dark/_theme.scss +24 -3
- package/types/ids-group-ltd-ids-design-system-components-avatar.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +2 -2
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-chat.d.ts +340 -0
- package/types/ids-group-ltd-ids-design-system-components-inline-edit.d.ts +43 -0
- package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-splitter.d.ts +83 -0
- package/types/ids-group-ltd-ids-design-system-components-timeline.d.ts +34 -5
- package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +53 -4
- package/types/ids-group-ltd-ids-design-system-components-tree.d.ts +51 -7
- package/types/ids-group-ltd-ids-design-system-core.d.ts +104 -0
- package/types/ids-group-ltd-ids-design-system.d.ts +6 -3
|
@@ -95,14 +95,14 @@ class DrawerComponent {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
98
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DrawerComponent, isStandalone: true, selector: "ds-drawer", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "openChange", closed: "closed" }, host: { listeners: { "document:keydown.escape": "onEscape()" }, properties: { "attr.title": "null" } }, hostDirectives: [{ directive: i1.DsStaticPreview, inputs: ["staticPreview", "staticPreview"] }], ngImport: i0, template: "@if (rendered() || preview.staticPreview()) {\n <div\n [class]=\"preview.staticPreview() ? 'drawer-static' : 'drawer-root'\"\n [class.closing]=\"closing()\">\n @if (!preview.staticPreview()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- scrim; click dismisses, keyboard dismisses via Escape (host document:keydown.escape) -->\n <div\n class=\"drawer-scrim\"\n [class.closing]=\"closing()\"\n (click)=\"onClose()\">\n </div>\n }\n\n <div\n role=\"dialog\"\n [attr.aria-modal]=\"preview.staticPreview() ? null : 'true'\"\n [cdkTrapFocus]=\"!preview.staticPreview()\"\n [cdkTrapFocusAutoCapture]=\"!preview.staticPreview()\"\n [class]=\"classes()\"\n [class.closing]=\"closing()\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n (keydown.escape)=\"onClose()\"\n (animationend)=\"onLeaveEnd($event)\">\n <header class=\"header\">\n <h4\n class=\"title\"\n [id]=\"titleId\">\n {{ title() }}\n </h4>\n\n <button\n type=\"button\"\n class=\"close\"\n [attr.aria-label]=\"intl().dialog.close\"\n (click)=\"onClose()\">\n <ds-icon\n name=\"x\"\n [size]=\"16\" />\n </button>\n </header>\n\n <div class=\"body\">\n <ng-content select=\"[drawer-body], [body]\"></ng-content>\n\n <ng-content></ng-content>\n </div>\n\n <div class=\"footer\">\n <ng-content select=\"[drawer-footer], [actions]\"></ng-content>\n </div>\n </div>\n </div>\n}\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_drawer-bg-color: var(--ds-drawer-bg-color, var(--surface-overlay));--_drawer-scrim-color: var(--ds-drawer-scrim-color, var(--scrim, hsl(220deg 20% 12% / 45%)));--_drawer-shadow: var(--ds-drawer-shadow, var(--ds-elevation-modal));--_drawer-divider: var(--ds-drawer-divider, var(--border-divider));--_drawer-close-icon-color: var(--ds-drawer-close-icon-color, var(--icon-default));--_drawer-close-icon-color-hover: var(--ds-drawer-close-icon-color-hover, var(--icon-strong));--_drawer-radius: var(--ds-drawer-radius, 0);--_drawer-title-color: var(--ds-drawer-title-color, inherit);--_drawer-width-sm: var(--ds-drawer-width, var(--drawer-w-sm));--_drawer-width-md: var(--ds-drawer-width, var(--drawer-w-md));--_drawer-width-lg: var(--ds-drawer-width, var(--drawer-w-lg));--_drawer-enter-keyframes: var(--ds-drawer-enter-keyframes, ds-slide-edge-in);--_drawer-leave-keyframes: var(--ds-drawer-leave-keyframes, ds-slide-edge-out);--_drawer-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-large-duration));--_drawer-enter-easing: var(--ds-drawer-enter-easing, var(--ds-motion-enter-large-easing));--_drawer-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-large-duration));--_drawer-leave-easing: var(--ds-drawer-leave-easing, var(--ds-motion-exit-large-easing));--_drawer-scrim-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-panel-duration));--_drawer-scrim-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-drawer-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_drawer-enter-duration: 0ms;--_drawer-leave-duration: 0ms;--_drawer-scrim-enter-duration: 0ms;--_drawer-scrim-leave-duration: 0ms}}.drawer-root{position:fixed;inset:0;z-index:var(--layer-modal);overflow:clip}.drawer-root.closing{pointer-events:none}.drawer-static{display:contents}.drawer-static .drawer{position:relative;max-width:100%;animation:none}.drawer-scrim{position:absolute;inset:0;background:var(--_drawer-scrim-color);animation-name:ds-fade-in;animation-duration:var(--_drawer-scrim-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer-scrim.closing{animation-name:ds-fade-out;animation-duration:var(--_drawer-scrim-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer{position:absolute;background:var(--_drawer-bg-color);box-shadow:var(--_drawer-shadow);border-radius:var(--_drawer-radius);display:flex;flex-direction:column;isolation:isolate;animation-name:var(--_drawer-enter-keyframes);animation-duration:var(--_drawer-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer.closing{animation-duration:var(--_drawer-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer.sm{width:var(--_drawer-width-sm)}.drawer.md{width:var(--_drawer-width-md)}.drawer.lg{width:var(--_drawer-width-lg)}.drawer.right{--_ds-enter-x: 100%;top:0;right:0;bottom:0;max-width:100vw}.drawer.right.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.left{--_ds-enter-x: -100%;top:0;left:0;bottom:0;max-width:100vw}.drawer.left.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.top{--_ds-enter-y: -100%;top:0;left:0;right:0;width:auto;max-height:80vh}.drawer.top.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.bottom{--_ds-enter-y: 100%;bottom:0;left:0;right:0;width:auto;max-height:80vh}.drawer.bottom.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer .header{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-5) var(--space-6);border-bottom:var(--border-width-default) solid var(--_drawer-divider)}.drawer .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);color:var(--_drawer-title-color);margin:0;flex:1}.drawer .close{display:inline-flex;align-items:center;justify-content:center;padding:var(--space-0-5);border:0;background:none;cursor:pointer}.drawer .close:active:not(:disabled,[disabled],.is-disabled,.disabled,[aria-disabled=true]){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.drawer .close{width:var(--modal-close-size);height:var(--modal-close-size);color:var(--_drawer-close-icon-color)}.drawer .close:hover{color:var(--_drawer-close-icon-color-hover)}.drawer .body{flex:1;padding:var(--space-6);overflow-y:auto}.drawer .footer{padding:var(--space-4) var(--space-6);border-top:var(--border-width-default) solid var(--_drawer-divider);display:flex;gap:var(--space-2);justify-content:flex-end}:where(.footer)>::ng-deep :where(div[actions],div[drawer-footer]){display:contents}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
98
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DrawerComponent, isStandalone: true, selector: "ds-drawer", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "openChange", closed: "closed" }, host: { listeners: { "document:keydown.escape": "onEscape()" }, properties: { "attr.title": "null" } }, hostDirectives: [{ directive: i1.DsStaticPreview, inputs: ["staticPreview", "staticPreview"] }], ngImport: i0, template: "@if (rendered() || preview.staticPreview()) {\n <div\n [class]=\"preview.staticPreview() ? 'drawer-static' : 'drawer-root'\"\n [class.closing]=\"closing()\">\n @if (!preview.staticPreview()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- scrim; click dismisses, keyboard dismisses via Escape (host document:keydown.escape) -->\n <div\n class=\"drawer-scrim\"\n [class.closing]=\"closing()\"\n (click)=\"onClose()\">\n </div>\n }\n\n <div\n role=\"dialog\"\n [attr.aria-modal]=\"preview.staticPreview() ? null : 'true'\"\n [cdkTrapFocus]=\"!preview.staticPreview()\"\n [cdkTrapFocusAutoCapture]=\"!preview.staticPreview()\"\n [class]=\"classes()\"\n [class.closing]=\"closing()\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n (keydown.escape)=\"onClose()\"\n (animationend)=\"onLeaveEnd($event)\">\n <header class=\"header\">\n <h4\n class=\"title\"\n [id]=\"titleId\">\n {{ title() }}\n </h4>\n\n <button\n type=\"button\"\n class=\"close\"\n [attr.aria-label]=\"intl().dialog.close\"\n (click)=\"onClose()\">\n <ds-icon\n name=\"x\"\n [size]=\"16\" />\n </button>\n </header>\n\n <div class=\"body\">\n <ng-content select=\"[drawer-body], [body]\"></ng-content>\n\n <ng-content></ng-content>\n </div>\n\n <div class=\"footer\">\n <ng-content select=\"[drawer-footer], [actions]\"></ng-content>\n </div>\n </div>\n </div>\n}\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_drawer-bg-color: var(--ds-drawer-bg-color, var(--surface-overlay));--surface-secondary: var(--surface-overlay-secondary);--surface-muted: var(--surface-overlay-muted);--_drawer-scrim-color: var(--ds-drawer-scrim-color, var(--scrim, hsl(220deg 20% 12% / 45%)));--_drawer-shadow: var(--ds-drawer-shadow, var(--ds-elevation-modal));--_drawer-divider: var(--ds-drawer-divider, var(--border-divider));--_drawer-close-icon-color: var(--ds-drawer-close-icon-color, var(--icon-default));--_drawer-close-icon-color-hover: var(--ds-drawer-close-icon-color-hover, var(--icon-strong));--_drawer-radius: var(--ds-drawer-radius, 0);--_drawer-title-color: var(--ds-drawer-title-color, inherit);--_drawer-width-sm: var(--ds-drawer-width, var(--drawer-w-sm));--_drawer-width-md: var(--ds-drawer-width, var(--drawer-w-md));--_drawer-width-lg: var(--ds-drawer-width, var(--drawer-w-lg));--_drawer-enter-keyframes: var(--ds-drawer-enter-keyframes, ds-slide-edge-in);--_drawer-leave-keyframes: var(--ds-drawer-leave-keyframes, ds-slide-edge-out);--_drawer-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-large-duration));--_drawer-enter-easing: var(--ds-drawer-enter-easing, var(--ds-motion-enter-large-easing));--_drawer-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-large-duration));--_drawer-leave-easing: var(--ds-drawer-leave-easing, var(--ds-motion-exit-large-easing));--_drawer-scrim-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-panel-duration));--_drawer-scrim-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-drawer-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_drawer-enter-duration: 0ms;--_drawer-leave-duration: 0ms;--_drawer-scrim-enter-duration: 0ms;--_drawer-scrim-leave-duration: 0ms}}.drawer-root{position:fixed;inset:0;z-index:var(--layer-modal);overflow:clip}.drawer-root.closing{pointer-events:none}.drawer-static{display:contents}.drawer-static .drawer{position:relative;max-width:100%;animation:none}.drawer-scrim{position:absolute;inset:0;background:var(--_drawer-scrim-color);animation-name:ds-fade-in;animation-duration:var(--_drawer-scrim-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer-scrim.closing{animation-name:ds-fade-out;animation-duration:var(--_drawer-scrim-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer{position:absolute;background:var(--_drawer-bg-color);box-shadow:var(--_drawer-shadow);border-radius:var(--_drawer-radius);display:flex;flex-direction:column;isolation:isolate;animation-name:var(--_drawer-enter-keyframes);animation-duration:var(--_drawer-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer.closing{animation-duration:var(--_drawer-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer.sm{width:var(--_drawer-width-sm)}.drawer.md{width:var(--_drawer-width-md)}.drawer.lg{width:var(--_drawer-width-lg)}.drawer.right{--_ds-enter-x: 100%;top:0;right:0;bottom:0;max-width:100vw}.drawer.right.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.left{--_ds-enter-x: -100%;top:0;left:0;bottom:0;max-width:100vw}.drawer.left.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.top{--_ds-enter-y: -100%;top:0;left:0;right:0;width:auto;max-height:80vh}.drawer.top.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.bottom{--_ds-enter-y: 100%;bottom:0;left:0;right:0;width:auto;max-height:80vh}.drawer.bottom.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer .header{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-5) var(--space-6);border-bottom:var(--border-width-default) solid var(--_drawer-divider)}.drawer .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);color:var(--_drawer-title-color);margin:0;flex:1}.drawer .close{display:inline-flex;align-items:center;justify-content:center;padding:var(--space-0-5);border:0;background:none;cursor:pointer}.drawer .close:active:not(:disabled,[disabled],.is-disabled,.disabled,[aria-disabled=true]){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.drawer .close{width:var(--modal-close-size);height:var(--modal-close-size);color:var(--_drawer-close-icon-color)}.drawer .close:hover{color:var(--_drawer-close-icon-color-hover)}.drawer .body{flex:1;padding:var(--space-6);overflow-y:auto}.drawer .footer{padding:var(--space-4) var(--space-6);border-top:var(--border-width-default) solid var(--_drawer-divider);display:flex;gap:var(--space-2);justify-content:flex-end}:where(.footer)>::ng-deep :where(div[actions],div[drawer-footer]){display:contents}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
99
99
|
}
|
|
100
100
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
101
101
|
type: Component,
|
|
102
102
|
args: [{ selector: 'ds-drawer', standalone: true, imports: [IconComponent, A11yModule], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
103
103
|
'[attr.title]': 'null',
|
|
104
104
|
'(document:keydown.escape)': 'onEscape()',
|
|
105
|
-
}, hostDirectives: [{ directive: DsStaticPreview, inputs: ['staticPreview'] }], template: "@if (rendered() || preview.staticPreview()) {\n <div\n [class]=\"preview.staticPreview() ? 'drawer-static' : 'drawer-root'\"\n [class.closing]=\"closing()\">\n @if (!preview.staticPreview()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- scrim; click dismisses, keyboard dismisses via Escape (host document:keydown.escape) -->\n <div\n class=\"drawer-scrim\"\n [class.closing]=\"closing()\"\n (click)=\"onClose()\">\n </div>\n }\n\n <div\n role=\"dialog\"\n [attr.aria-modal]=\"preview.staticPreview() ? null : 'true'\"\n [cdkTrapFocus]=\"!preview.staticPreview()\"\n [cdkTrapFocusAutoCapture]=\"!preview.staticPreview()\"\n [class]=\"classes()\"\n [class.closing]=\"closing()\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n (keydown.escape)=\"onClose()\"\n (animationend)=\"onLeaveEnd($event)\">\n <header class=\"header\">\n <h4\n class=\"title\"\n [id]=\"titleId\">\n {{ title() }}\n </h4>\n\n <button\n type=\"button\"\n class=\"close\"\n [attr.aria-label]=\"intl().dialog.close\"\n (click)=\"onClose()\">\n <ds-icon\n name=\"x\"\n [size]=\"16\" />\n </button>\n </header>\n\n <div class=\"body\">\n <ng-content select=\"[drawer-body], [body]\"></ng-content>\n\n <ng-content></ng-content>\n </div>\n\n <div class=\"footer\">\n <ng-content select=\"[drawer-footer], [actions]\"></ng-content>\n </div>\n </div>\n </div>\n}\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_drawer-bg-color: var(--ds-drawer-bg-color, var(--surface-overlay));--_drawer-scrim-color: var(--ds-drawer-scrim-color, var(--scrim, hsl(220deg 20% 12% / 45%)));--_drawer-shadow: var(--ds-drawer-shadow, var(--ds-elevation-modal));--_drawer-divider: var(--ds-drawer-divider, var(--border-divider));--_drawer-close-icon-color: var(--ds-drawer-close-icon-color, var(--icon-default));--_drawer-close-icon-color-hover: var(--ds-drawer-close-icon-color-hover, var(--icon-strong));--_drawer-radius: var(--ds-drawer-radius, 0);--_drawer-title-color: var(--ds-drawer-title-color, inherit);--_drawer-width-sm: var(--ds-drawer-width, var(--drawer-w-sm));--_drawer-width-md: var(--ds-drawer-width, var(--drawer-w-md));--_drawer-width-lg: var(--ds-drawer-width, var(--drawer-w-lg));--_drawer-enter-keyframes: var(--ds-drawer-enter-keyframes, ds-slide-edge-in);--_drawer-leave-keyframes: var(--ds-drawer-leave-keyframes, ds-slide-edge-out);--_drawer-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-large-duration));--_drawer-enter-easing: var(--ds-drawer-enter-easing, var(--ds-motion-enter-large-easing));--_drawer-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-large-duration));--_drawer-leave-easing: var(--ds-drawer-leave-easing, var(--ds-motion-exit-large-easing));--_drawer-scrim-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-panel-duration));--_drawer-scrim-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-drawer-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_drawer-enter-duration: 0ms;--_drawer-leave-duration: 0ms;--_drawer-scrim-enter-duration: 0ms;--_drawer-scrim-leave-duration: 0ms}}.drawer-root{position:fixed;inset:0;z-index:var(--layer-modal);overflow:clip}.drawer-root.closing{pointer-events:none}.drawer-static{display:contents}.drawer-static .drawer{position:relative;max-width:100%;animation:none}.drawer-scrim{position:absolute;inset:0;background:var(--_drawer-scrim-color);animation-name:ds-fade-in;animation-duration:var(--_drawer-scrim-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer-scrim.closing{animation-name:ds-fade-out;animation-duration:var(--_drawer-scrim-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer{position:absolute;background:var(--_drawer-bg-color);box-shadow:var(--_drawer-shadow);border-radius:var(--_drawer-radius);display:flex;flex-direction:column;isolation:isolate;animation-name:var(--_drawer-enter-keyframes);animation-duration:var(--_drawer-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer.closing{animation-duration:var(--_drawer-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer.sm{width:var(--_drawer-width-sm)}.drawer.md{width:var(--_drawer-width-md)}.drawer.lg{width:var(--_drawer-width-lg)}.drawer.right{--_ds-enter-x: 100%;top:0;right:0;bottom:0;max-width:100vw}.drawer.right.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.left{--_ds-enter-x: -100%;top:0;left:0;bottom:0;max-width:100vw}.drawer.left.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.top{--_ds-enter-y: -100%;top:0;left:0;right:0;width:auto;max-height:80vh}.drawer.top.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.bottom{--_ds-enter-y: 100%;bottom:0;left:0;right:0;width:auto;max-height:80vh}.drawer.bottom.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer .header{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-5) var(--space-6);border-bottom:var(--border-width-default) solid var(--_drawer-divider)}.drawer .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);color:var(--_drawer-title-color);margin:0;flex:1}.drawer .close{display:inline-flex;align-items:center;justify-content:center;padding:var(--space-0-5);border:0;background:none;cursor:pointer}.drawer .close:active:not(:disabled,[disabled],.is-disabled,.disabled,[aria-disabled=true]){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.drawer .close{width:var(--modal-close-size);height:var(--modal-close-size);color:var(--_drawer-close-icon-color)}.drawer .close:hover{color:var(--_drawer-close-icon-color-hover)}.drawer .body{flex:1;padding:var(--space-6);overflow-y:auto}.drawer .footer{padding:var(--space-4) var(--space-6);border-top:var(--border-width-default) solid var(--_drawer-divider);display:flex;gap:var(--space-2);justify-content:flex-end}:where(.footer)>::ng-deep :where(div[actions],div[drawer-footer]){display:contents}\n"] }]
|
|
105
|
+
}, hostDirectives: [{ directive: DsStaticPreview, inputs: ['staticPreview'] }], template: "@if (rendered() || preview.staticPreview()) {\n <div\n [class]=\"preview.staticPreview() ? 'drawer-static' : 'drawer-root'\"\n [class.closing]=\"closing()\">\n @if (!preview.staticPreview()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- scrim; click dismisses, keyboard dismisses via Escape (host document:keydown.escape) -->\n <div\n class=\"drawer-scrim\"\n [class.closing]=\"closing()\"\n (click)=\"onClose()\">\n </div>\n }\n\n <div\n role=\"dialog\"\n [attr.aria-modal]=\"preview.staticPreview() ? null : 'true'\"\n [cdkTrapFocus]=\"!preview.staticPreview()\"\n [cdkTrapFocusAutoCapture]=\"!preview.staticPreview()\"\n [class]=\"classes()\"\n [class.closing]=\"closing()\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n (keydown.escape)=\"onClose()\"\n (animationend)=\"onLeaveEnd($event)\">\n <header class=\"header\">\n <h4\n class=\"title\"\n [id]=\"titleId\">\n {{ title() }}\n </h4>\n\n <button\n type=\"button\"\n class=\"close\"\n [attr.aria-label]=\"intl().dialog.close\"\n (click)=\"onClose()\">\n <ds-icon\n name=\"x\"\n [size]=\"16\" />\n </button>\n </header>\n\n <div class=\"body\">\n <ng-content select=\"[drawer-body], [body]\"></ng-content>\n\n <ng-content></ng-content>\n </div>\n\n <div class=\"footer\">\n <ng-content select=\"[drawer-footer], [actions]\"></ng-content>\n </div>\n </div>\n </div>\n}\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_drawer-bg-color: var(--ds-drawer-bg-color, var(--surface-overlay));--surface-secondary: var(--surface-overlay-secondary);--surface-muted: var(--surface-overlay-muted);--_drawer-scrim-color: var(--ds-drawer-scrim-color, var(--scrim, hsl(220deg 20% 12% / 45%)));--_drawer-shadow: var(--ds-drawer-shadow, var(--ds-elevation-modal));--_drawer-divider: var(--ds-drawer-divider, var(--border-divider));--_drawer-close-icon-color: var(--ds-drawer-close-icon-color, var(--icon-default));--_drawer-close-icon-color-hover: var(--ds-drawer-close-icon-color-hover, var(--icon-strong));--_drawer-radius: var(--ds-drawer-radius, 0);--_drawer-title-color: var(--ds-drawer-title-color, inherit);--_drawer-width-sm: var(--ds-drawer-width, var(--drawer-w-sm));--_drawer-width-md: var(--ds-drawer-width, var(--drawer-w-md));--_drawer-width-lg: var(--ds-drawer-width, var(--drawer-w-lg));--_drawer-enter-keyframes: var(--ds-drawer-enter-keyframes, ds-slide-edge-in);--_drawer-leave-keyframes: var(--ds-drawer-leave-keyframes, ds-slide-edge-out);--_drawer-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-large-duration));--_drawer-enter-easing: var(--ds-drawer-enter-easing, var(--ds-motion-enter-large-easing));--_drawer-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-large-duration));--_drawer-leave-easing: var(--ds-drawer-leave-easing, var(--ds-motion-exit-large-easing));--_drawer-scrim-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-panel-duration));--_drawer-scrim-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-drawer-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_drawer-enter-duration: 0ms;--_drawer-leave-duration: 0ms;--_drawer-scrim-enter-duration: 0ms;--_drawer-scrim-leave-duration: 0ms}}.drawer-root{position:fixed;inset:0;z-index:var(--layer-modal);overflow:clip}.drawer-root.closing{pointer-events:none}.drawer-static{display:contents}.drawer-static .drawer{position:relative;max-width:100%;animation:none}.drawer-scrim{position:absolute;inset:0;background:var(--_drawer-scrim-color);animation-name:ds-fade-in;animation-duration:var(--_drawer-scrim-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer-scrim.closing{animation-name:ds-fade-out;animation-duration:var(--_drawer-scrim-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer{position:absolute;background:var(--_drawer-bg-color);box-shadow:var(--_drawer-shadow);border-radius:var(--_drawer-radius);display:flex;flex-direction:column;isolation:isolate;animation-name:var(--_drawer-enter-keyframes);animation-duration:var(--_drawer-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer.closing{animation-duration:var(--_drawer-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer.sm{width:var(--_drawer-width-sm)}.drawer.md{width:var(--_drawer-width-md)}.drawer.lg{width:var(--_drawer-width-lg)}.drawer.right{--_ds-enter-x: 100%;top:0;right:0;bottom:0;max-width:100vw}.drawer.right.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.left{--_ds-enter-x: -100%;top:0;left:0;bottom:0;max-width:100vw}.drawer.left.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.top{--_ds-enter-y: -100%;top:0;left:0;right:0;width:auto;max-height:80vh}.drawer.top.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.bottom{--_ds-enter-y: 100%;bottom:0;left:0;right:0;width:auto;max-height:80vh}.drawer.bottom.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer .header{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-5) var(--space-6);border-bottom:var(--border-width-default) solid var(--_drawer-divider)}.drawer .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);color:var(--_drawer-title-color);margin:0;flex:1}.drawer .close{display:inline-flex;align-items:center;justify-content:center;padding:var(--space-0-5);border:0;background:none;cursor:pointer}.drawer .close:active:not(:disabled,[disabled],.is-disabled,.disabled,[aria-disabled=true]){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.drawer .close{width:var(--modal-close-size);height:var(--modal-close-size);color:var(--_drawer-close-icon-color)}.drawer .close:hover{color:var(--_drawer-close-icon-color-hover)}.drawer .body{flex:1;padding:var(--space-6);overflow-y:auto}.drawer .footer{padding:var(--space-4) var(--space-6);border-top:var(--border-width-default) solid var(--_drawer-divider);display:flex;gap:var(--space-2);justify-content:flex-end}:where(.footer)>::ng-deep :where(div[actions],div[drawer-footer]){display:contents}\n"] }]
|
|
106
106
|
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
107
107
|
|
|
108
108
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-drawer.mjs","sources":["../../../src/lib/components/drawer/drawer.component.ts","../../../src/lib/components/drawer/drawer.component.html","../../../src/lib/components/drawer/ids-group-ltd-ids-design-system-components-drawer.ts"],"sourcesContent":["import {\n Component,\n type OnDestroy,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { BodyScrollLockService } from '@ids-group-ltd/ids-design-system/overlay';\nimport { DS_INTL } from '@ids-group-ltd/ids-design-system/core';\nimport { DsStaticPreview } from '@ids-group-ltd/ids-design-system/components';\nimport type { DrawerPlacement } from './drawer.types';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\n\nlet nextId = 0;\n\n@Component({\n selector: 'ds-drawer',\n standalone: true,\n imports: [IconComponent, A11yModule],\n templateUrl: './drawer.component.html',\n styleUrl: './drawer.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n // Keeps a static `title` attribute from becoming a native tooltip on the host.\n host: {\n '[attr.title]': 'null',\n '(document:keydown.escape)': 'onEscape()',\n },\n hostDirectives: [{ directive: DsStaticPreview, inputs: ['staticPreview'] }],\n})\nexport class DrawerComponent implements OnDestroy {\n private readonly scrollLock = inject(BodyScrollLockService);\n protected readonly intl = inject(DS_INTL);\n protected readonly preview = inject(DsStaticPreview);\n\n /** Open state, two-way bound. */\n readonly open = model<boolean>(false);\n /** Panel size. */\n readonly size = input<DsSize>('md');\n /** Edge the panel slides in from. */\n readonly placement = input<DrawerPlacement>('right');\n /** Drawer title, shown in the header and used for `aria-labelledby`. */\n readonly title = input.required<string>();\n /** Fires once the close (slide-out) animation finishes. */\n readonly closed = output<void>();\n\n protected readonly titleId = `ds-drawer-title-${++nextId}`;\n protected readonly rendered = signal(false);\n protected readonly closing = signal(false);\n private wasOpen = false;\n private closeFallbackTimer: ReturnType<typeof setTimeout> | null = null;\n\n protected readonly classes = computed(() => {\n const parts = ['drawer', this.placement(), this.size()];\n\n return parts.join(' ');\n });\n\n constructor() {\n effect(() => {\n if (this.preview.staticPreview()) {\n return;\n }\n const isOpen = this.open();\n if (isOpen) {\n this.closing.set(false);\n this.rendered.set(true);\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = null;\n } else if (this.wasOpen) {\n this.closing.set(true);\n // animationend is never delivered on a backgrounded tab (Chrome freezes CSS\n // animations) or for a 0s reduced-motion leave; this timer is the teardown.\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = setTimeout(() => this.finishClose(), 300);\n }\n this.wasOpen = isOpen;\n });\n\n // Ref-counted, so stacked overlays don't unlock each other.\n effect((onCleanup) => {\n if (this.preview.staticPreview() || !this.rendered()) {\n return;\n }\n this.scrollLock.lock();\n onCleanup(() => this.scrollLock.unlock());\n });\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = null;\n }\n\n protected onClose(): void {\n if (this.preview.staticPreview()) {\n return;\n }\n this.open.set(false);\n }\n\n protected onLeaveEnd(event: AnimationEvent): void {\n // Panel's OWN animationend only; matching the keyframes name would make the exit un-overridable.\n if (event.target !== event.currentTarget) {\n return;\n }\n this.finishClose();\n }\n\n private finishClose(): void {\n if (!this.closing()) {\n return;\n }\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = null;\n this.closing.set(false);\n this.rendered.set(false);\n this.closed.emit();\n }\n\n protected onEscape(): void {\n if (this.open()) {\n this.onClose();\n }\n }\n}\n","@if (rendered() || preview.staticPreview()) {\n <div\n [class]=\"preview.staticPreview() ? 'drawer-static' : 'drawer-root'\"\n [class.closing]=\"closing()\">\n @if (!preview.staticPreview()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- scrim; click dismisses, keyboard dismisses via Escape (host document:keydown.escape) -->\n <div\n class=\"drawer-scrim\"\n [class.closing]=\"closing()\"\n (click)=\"onClose()\">\n </div>\n }\n\n <div\n role=\"dialog\"\n [attr.aria-modal]=\"preview.staticPreview() ? null : 'true'\"\n [cdkTrapFocus]=\"!preview.staticPreview()\"\n [cdkTrapFocusAutoCapture]=\"!preview.staticPreview()\"\n [class]=\"classes()\"\n [class.closing]=\"closing()\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n (keydown.escape)=\"onClose()\"\n (animationend)=\"onLeaveEnd($event)\">\n <header class=\"header\">\n <h4\n class=\"title\"\n [id]=\"titleId\">\n {{ title() }}\n </h4>\n\n <button\n type=\"button\"\n class=\"close\"\n [attr.aria-label]=\"intl().dialog.close\"\n (click)=\"onClose()\">\n <ds-icon\n name=\"x\"\n [size]=\"16\" />\n </button>\n </header>\n\n <div class=\"body\">\n <ng-content select=\"[drawer-body], [body]\"></ng-content>\n\n <ng-content></ng-content>\n </div>\n\n <div class=\"footer\">\n <ng-content select=\"[drawer-footer], [actions]\"></ng-content>\n </div>\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAoBA,IAAI,MAAM,GAAG,CAAC;MAgBD,eAAe,CAAA;AACT,IAAA,UAAU,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACxC,IAAA,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;AACtB,IAAA,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC;;AAG3C,IAAA,IAAI,GAAG,KAAK,CAAU,KAAK,2EAAC;;AAE5B,IAAA,IAAI,GAAG,KAAK,CAAS,IAAI,2EAAC;;AAE1B,IAAA,SAAS,GAAG,KAAK,CAAkB,OAAO,gFAAC;;AAE3C,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAU;;IAEhC,MAAM,GAAG,MAAM,EAAQ;AAEb,IAAA,OAAO,GAAG,CAAA,gBAAA,EAAmB,EAAE,MAAM,EAAE;AACvC,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,+EAAC;AACxB,IAAA,OAAO,GAAG,MAAM,CAAC,KAAK,8EAAC;IAClC,OAAO,GAAG,KAAK;IACf,kBAAkB,GAAyC,IAAI;AAEpD,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,QAAA,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;AAEvD,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AACxB,IAAA,CAAC,8EAAC;AAEF,IAAA,WAAA,GAAA;QACE,MAAM,C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AAC,EAAA,aAAA,EAGrB,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EAEnC;AACJ,wBAAA,cAAc,EAAE,MAAM;AACtB,wBAAA,2BAA2B,EAAE,YAAY;AAC1C,qBAAA,EAAA,cAAA,EACe,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,EAAA,QAAA,EAAA,6qDAAA,EAAA,MAAA,EAAA,CAAA,stKAAA,CAAA,EAAA;;;AElC7E;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-drawer.mjs","sources":["../../../src/lib/components/drawer/drawer.component.ts","../../../src/lib/components/drawer/drawer.component.html","../../../src/lib/components/drawer/ids-group-ltd-ids-design-system-components-drawer.ts"],"sourcesContent":["import {\n Component,\n type OnDestroy,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { BodyScrollLockService } from '@ids-group-ltd/ids-design-system/overlay';\nimport { DS_INTL } from '@ids-group-ltd/ids-design-system/core';\nimport { DsStaticPreview } from '@ids-group-ltd/ids-design-system/components';\nimport type { DrawerPlacement } from './drawer.types';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\n\nlet nextId = 0;\n\n@Component({\n selector: 'ds-drawer',\n standalone: true,\n imports: [IconComponent, A11yModule],\n templateUrl: './drawer.component.html',\n styleUrl: './drawer.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n // Keeps a static `title` attribute from becoming a native tooltip on the host.\n host: {\n '[attr.title]': 'null',\n '(document:keydown.escape)': 'onEscape()',\n },\n hostDirectives: [{ directive: DsStaticPreview, inputs: ['staticPreview'] }],\n})\nexport class DrawerComponent implements OnDestroy {\n private readonly scrollLock = inject(BodyScrollLockService);\n protected readonly intl = inject(DS_INTL);\n protected readonly preview = inject(DsStaticPreview);\n\n /** Open state, two-way bound. */\n readonly open = model<boolean>(false);\n /** Panel size. */\n readonly size = input<DsSize>('md');\n /** Edge the panel slides in from. */\n readonly placement = input<DrawerPlacement>('right');\n /** Drawer title, shown in the header and used for `aria-labelledby`. */\n readonly title = input.required<string>();\n /** Fires once the close (slide-out) animation finishes. */\n readonly closed = output<void>();\n\n protected readonly titleId = `ds-drawer-title-${++nextId}`;\n protected readonly rendered = signal(false);\n protected readonly closing = signal(false);\n private wasOpen = false;\n private closeFallbackTimer: ReturnType<typeof setTimeout> | null = null;\n\n protected readonly classes = computed(() => {\n const parts = ['drawer', this.placement(), this.size()];\n\n return parts.join(' ');\n });\n\n constructor() {\n effect(() => {\n if (this.preview.staticPreview()) {\n return;\n }\n const isOpen = this.open();\n if (isOpen) {\n this.closing.set(false);\n this.rendered.set(true);\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = null;\n } else if (this.wasOpen) {\n this.closing.set(true);\n // animationend is never delivered on a backgrounded tab (Chrome freezes CSS\n // animations) or for a 0s reduced-motion leave; this timer is the teardown.\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = setTimeout(() => this.finishClose(), 300);\n }\n this.wasOpen = isOpen;\n });\n\n // Ref-counted, so stacked overlays don't unlock each other.\n effect((onCleanup) => {\n if (this.preview.staticPreview() || !this.rendered()) {\n return;\n }\n this.scrollLock.lock();\n onCleanup(() => this.scrollLock.unlock());\n });\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = null;\n }\n\n protected onClose(): void {\n if (this.preview.staticPreview()) {\n return;\n }\n this.open.set(false);\n }\n\n protected onLeaveEnd(event: AnimationEvent): void {\n // Panel's OWN animationend only; matching the keyframes name would make the exit un-overridable.\n if (event.target !== event.currentTarget) {\n return;\n }\n this.finishClose();\n }\n\n private finishClose(): void {\n if (!this.closing()) {\n return;\n }\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = null;\n this.closing.set(false);\n this.rendered.set(false);\n this.closed.emit();\n }\n\n protected onEscape(): void {\n if (this.open()) {\n this.onClose();\n }\n }\n}\n","@if (rendered() || preview.staticPreview()) {\n <div\n [class]=\"preview.staticPreview() ? 'drawer-static' : 'drawer-root'\"\n [class.closing]=\"closing()\">\n @if (!preview.staticPreview()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- scrim; click dismisses, keyboard dismisses via Escape (host document:keydown.escape) -->\n <div\n class=\"drawer-scrim\"\n [class.closing]=\"closing()\"\n (click)=\"onClose()\">\n </div>\n }\n\n <div\n role=\"dialog\"\n [attr.aria-modal]=\"preview.staticPreview() ? null : 'true'\"\n [cdkTrapFocus]=\"!preview.staticPreview()\"\n [cdkTrapFocusAutoCapture]=\"!preview.staticPreview()\"\n [class]=\"classes()\"\n [class.closing]=\"closing()\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n (keydown.escape)=\"onClose()\"\n (animationend)=\"onLeaveEnd($event)\">\n <header class=\"header\">\n <h4\n class=\"title\"\n [id]=\"titleId\">\n {{ title() }}\n </h4>\n\n <button\n type=\"button\"\n class=\"close\"\n [attr.aria-label]=\"intl().dialog.close\"\n (click)=\"onClose()\">\n <ds-icon\n name=\"x\"\n [size]=\"16\" />\n </button>\n </header>\n\n <div class=\"body\">\n <ng-content select=\"[drawer-body], [body]\"></ng-content>\n\n <ng-content></ng-content>\n </div>\n\n <div class=\"footer\">\n <ng-content select=\"[drawer-footer], [actions]\"></ng-content>\n </div>\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAoBA,IAAI,MAAM,GAAG,CAAC;MAgBD,eAAe,CAAA;AACT,IAAA,UAAU,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACxC,IAAA,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;AACtB,I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AAA,EAAA,yBAAA,EAAA,YAAA,EAAA,EAAA,UAAA,EAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,eAAA,EAAA,MAAA,EAAA,CAAA,eAAA,EAAA,eAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECpC5B,6qDAqDA,EAAA,MAAA,EAAA,CAAA,0zKAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,ED5BY,aAAa,oGAAE,UAAU,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,yBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAWxB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAd3B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,EAAA,UAAA,EACT,IAAI,EAAA,OAAA,EACP,CAAC,aAAa,EAAE,UAAU,CAAC,EAAA,aAAA,EAGrB,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EAEnC;AACJ,wBAAA,cAAc,EAAE,MAAM;AACtB,wBAAA,2BAA2B,EAAE,YAAY;AAC1C,qBAAA,EAAA,cAAA,EACe,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,EAAA,QAAA,EAAA,6qDAAA,EAAA,MAAA,EAAA,CAAA,0zKAAA,CAAA,EAAA;;;AElC7E;;AAEG;;;;"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injector, viewChild, model, input, booleanAttribute, output, signal, computed, afterNextRender, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { DS_INTL, DS_INTL_DEFAULTS } from '@ids-group-ltd/ids-design-system/core';
|
|
4
|
+
import { TooltipDirective } from '@ids-group-ltd/ids-design-system/components/tooltip';
|
|
5
|
+
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Text that turns into a field of the same font and size when clicked, to rename it in place. Put it
|
|
9
|
+
* inside the element that gives the text its role and type, such as a heading: it inherits the font.
|
|
10
|
+
* Click, Enter, Space or F2 edits; Enter or leaving the field saves, Escape cancels. A blank or
|
|
11
|
+
* unchanged value saves nothing.
|
|
12
|
+
*/
|
|
13
|
+
class InlineEditComponent {
|
|
14
|
+
intl = inject(DS_INTL);
|
|
15
|
+
injector = inject(Injector);
|
|
16
|
+
field = viewChild('field', ...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
17
|
+
display = viewChild('display', ...(ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []));
|
|
18
|
+
/** The text, two-way bound. Changes only on a save of a non-blank, different value. */
|
|
19
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
20
|
+
/** Shown, muted, while the value is empty, and in the empty field. */
|
|
21
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
22
|
+
/** Longest value the field accepts, in characters; `null` for no limit. */
|
|
23
|
+
maxLength = input(null, ...(ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []));
|
|
24
|
+
/** Shows the text without the edit affordance and refuses to edit. */
|
|
25
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
26
|
+
/** What the text is, such as "Chat title"; names the text and the field. Unset falls back to
|
|
27
|
+
* `DS_INTL.inlineEdit.rename`. */
|
|
28
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
29
|
+
/** The trimmed new value, after a save that changed it. */
|
|
30
|
+
saved = output();
|
|
31
|
+
editing = signal(false, ...(ngDevMode ? [{ debugName: "editing" }] : /* istanbul ignore next */ []));
|
|
32
|
+
announcement = signal('', ...(ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []));
|
|
33
|
+
labels = computed(() => ({
|
|
34
|
+
...DS_INTL_DEFAULTS.inlineEdit,
|
|
35
|
+
...this.intl().inlineEdit,
|
|
36
|
+
}), ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
37
|
+
label = computed(() => this.ariaLabel() || this.labels().rename, ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
38
|
+
hint = computed(() => this.labels().rename, ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
39
|
+
shown = computed(() => this.value() || this.placeholder(), ...(ngDevMode ? [{ debugName: "shown" }] : /* istanbul ignore next */ []));
|
|
40
|
+
/** Turns the text into the field, with the text selected. Does nothing while `disabled`. */
|
|
41
|
+
edit() {
|
|
42
|
+
if (this.disabled() || this.editing()) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.announcement.set('');
|
|
46
|
+
this.editing.set(true);
|
|
47
|
+
afterNextRender(() => {
|
|
48
|
+
const field = this.field()?.nativeElement;
|
|
49
|
+
field?.focus();
|
|
50
|
+
field?.select();
|
|
51
|
+
}, { injector: this.injector });
|
|
52
|
+
}
|
|
53
|
+
onDisplayKeydown(event) {
|
|
54
|
+
if (event.key === 'F2') {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
this.edit();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
onFieldKeydown(event) {
|
|
60
|
+
if (event.key === 'Enter' && !event.isComposing) {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
this.finish(true, true);
|
|
63
|
+
}
|
|
64
|
+
else if (event.key === 'Escape') {
|
|
65
|
+
// Escape belongs to the field here, not to a dialog or panel around it.
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
event.stopPropagation();
|
|
68
|
+
this.finish(false, true);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
onFieldBlur() {
|
|
72
|
+
this.finish(true, false);
|
|
73
|
+
}
|
|
74
|
+
// Leaves the field once: Enter removes it, and a removed focused field may still report a blur.
|
|
75
|
+
finish(save, returnFocus) {
|
|
76
|
+
if (!this.editing()) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const next = (this.field()?.nativeElement.value ?? '').trim();
|
|
80
|
+
this.editing.set(false);
|
|
81
|
+
if (save && next !== '' && next !== this.value()) {
|
|
82
|
+
this.value.set(next);
|
|
83
|
+
this.saved.emit(next);
|
|
84
|
+
this.announcement.set(this.labels().saved);
|
|
85
|
+
}
|
|
86
|
+
if (returnFocus) {
|
|
87
|
+
afterNextRender(() => this.display()?.nativeElement.focus(), {
|
|
88
|
+
injector: this.injector,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: InlineEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
93
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: InlineEditComponent, isStandalone: true, selector: "ds-inline-edit", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", saved: "saved" }, host: { properties: { "class.editing": "editing()" } }, viewQueries: [{ propertyName: "field", first: true, predicate: ["field"], descendants: true, isSignal: true }, { propertyName: "display", first: true, predicate: ["display"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (editing()) {\n <input\n #field\n class=\"box field\"\n type=\"text\"\n [value]=\"value()\"\n [attr.maxlength]=\"maxLength()\"\n [attr.placeholder]=\"placeholder() || null\"\n [attr.aria-label]=\"label()\"\n (keydown)=\"onFieldKeydown($event)\"\n (blur)=\"onFieldBlur()\" />\n} @else if (disabled()) {\n <span\n class=\"box display\"\n [class.empty]=\"!value()\">\n <span class=\"text\">\n {{ shown() }}\n </span>\n </span>\n} @else {\n <button\n #display\n type=\"button\"\n class=\"box display\"\n [class.empty]=\"!value()\"\n [attr.aria-label]=\"label() + ': ' + shown()\"\n [dsTooltip]=\"hint()\"\n (click)=\"edit()\"\n (keydown)=\"onDisplayKeydown($event)\">\n <span class=\"text\">\n {{ shown() }}\n </span>\n\n <ds-icon\n class=\"pencil\"\n name=\"edit\"\n aria-hidden=\"true\"\n [size]=\"14\" />\n </button>\n}\n\n<span\n class=\"live\"\n aria-live=\"polite\">\n {{ announcement() }}\n</span>\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_inline-edit-pad: var(--ds-inline-edit-padding, var(--space-1));--_inline-edit-hover-bg-color: var(--ds-inline-edit-hover-bg-color, var(--surface-muted));--_inline-edit-border-color: var(--ds-inline-edit-border-color, var(--primary));--_inline-edit-radius: var(--ds-inline-edit-radius, var(--radius-sm));position:relative;display:flex;min-inline-size:0;max-inline-size:100%}.box{margin:calc(-1 * var(--border-width-default)) calc(-1 * (var(--_inline-edit-pad) + var(--border-width-default)));padding:0 var(--_inline-edit-pad);font:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;text-align:start;background:transparent;border:var(--border-width-default) solid transparent;border-radius:var(--_inline-edit-radius)}.display{display:inline-flex;gap:var(--space-1);align-items:center;min-inline-size:0;max-inline-size:calc(100% + 2 * (var(--_inline-edit-pad) + var(--border-width-default)));transition:background-color var(--duration-fast) var(--ease-standard)}button.display{cursor:text}button.display:hover{background-color:var(--_inline-edit-hover-bg-color)}.text{overflow:clip visible;text-overflow:ellipsis;white-space:nowrap;min-inline-size:0}.empty .text{color:var(--text-tertiary)}.pencil{flex:none;color:var(--text-tertiary);opacity:0;transition:opacity var(--duration-fast) var(--ease-standard)}button.display:hover .pencil,button.display:focus-visible .pencil{opacity:1}.field{flex:1 1 auto;min-inline-size:0;border-color:var(--_inline-edit-border-color)}@media not (forced-colors:active){.field:focus-visible{outline:none}}.field::placeholder{color:var(--text-tertiary)}.live{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "directive", type: TooltipDirective, selector: "[dsTooltip], [dsTooltipWhenClipped]", inputs: ["dsTooltip", "dsTooltipConfig", "dsTooltipPlacement", "dsTooltipDelay", "dsTooltipArrow", "dsTooltipWhenClipped", "dsTooltipPinOnClick"] }] });
|
|
94
|
+
}
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: InlineEditComponent, decorators: [{
|
|
96
|
+
type: Component,
|
|
97
|
+
args: [{ selector: 'ds-inline-edit', standalone: true, imports: [IconComponent, TooltipDirective], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
98
|
+
'[class.editing]': 'editing()',
|
|
99
|
+
}, template: "@if (editing()) {\n <input\n #field\n class=\"box field\"\n type=\"text\"\n [value]=\"value()\"\n [attr.maxlength]=\"maxLength()\"\n [attr.placeholder]=\"placeholder() || null\"\n [attr.aria-label]=\"label()\"\n (keydown)=\"onFieldKeydown($event)\"\n (blur)=\"onFieldBlur()\" />\n} @else if (disabled()) {\n <span\n class=\"box display\"\n [class.empty]=\"!value()\">\n <span class=\"text\">\n {{ shown() }}\n </span>\n </span>\n} @else {\n <button\n #display\n type=\"button\"\n class=\"box display\"\n [class.empty]=\"!value()\"\n [attr.aria-label]=\"label() + ': ' + shown()\"\n [dsTooltip]=\"hint()\"\n (click)=\"edit()\"\n (keydown)=\"onDisplayKeydown($event)\">\n <span class=\"text\">\n {{ shown() }}\n </span>\n\n <ds-icon\n class=\"pencil\"\n name=\"edit\"\n aria-hidden=\"true\"\n [size]=\"14\" />\n </button>\n}\n\n<span\n class=\"live\"\n aria-live=\"polite\">\n {{ announcement() }}\n</span>\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_inline-edit-pad: var(--ds-inline-edit-padding, var(--space-1));--_inline-edit-hover-bg-color: var(--ds-inline-edit-hover-bg-color, var(--surface-muted));--_inline-edit-border-color: var(--ds-inline-edit-border-color, var(--primary));--_inline-edit-radius: var(--ds-inline-edit-radius, var(--radius-sm));position:relative;display:flex;min-inline-size:0;max-inline-size:100%}.box{margin:calc(-1 * var(--border-width-default)) calc(-1 * (var(--_inline-edit-pad) + var(--border-width-default)));padding:0 var(--_inline-edit-pad);font:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;text-align:start;background:transparent;border:var(--border-width-default) solid transparent;border-radius:var(--_inline-edit-radius)}.display{display:inline-flex;gap:var(--space-1);align-items:center;min-inline-size:0;max-inline-size:calc(100% + 2 * (var(--_inline-edit-pad) + var(--border-width-default)));transition:background-color var(--duration-fast) var(--ease-standard)}button.display{cursor:text}button.display:hover{background-color:var(--_inline-edit-hover-bg-color)}.text{overflow:clip visible;text-overflow:ellipsis;white-space:nowrap;min-inline-size:0}.empty .text{color:var(--text-tertiary)}.pencil{flex:none;color:var(--text-tertiary);opacity:0;transition:opacity var(--duration-fast) var(--ease-standard)}button.display:hover .pencil,button.display:focus-visible .pencil{opacity:1}.field{flex:1 1 auto;min-inline-size:0;border-color:var(--_inline-edit-border-color)}@media not (forced-colors:active){.field:focus-visible{outline:none}}.field::placeholder{color:var(--text-tertiary)}.live{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n"] }]
|
|
100
|
+
}], propDecorators: { field: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }], display: [{ type: i0.ViewChild, args: ['display', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], saved: [{ type: i0.Output, args: ["saved"] }] } });
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Generated bundle index. Do not edit.
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
export { InlineEditComponent };
|
|
107
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-inline-edit.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-inline-edit.mjs","sources":["../../../src/lib/components/inline-edit/inline-edit.component.ts","../../../src/lib/components/inline-edit/inline-edit.component.html","../../../src/lib/components/inline-edit/ids-group-ltd-ids-design-system-components-inline-edit.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n Injector,\n ViewEncapsulation,\n afterNextRender,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport {\n DS_INTL,\n DS_INTL_DEFAULTS,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { TooltipDirective } from '@ids-group-ltd/ids-design-system/components/tooltip';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\n\n/**\n * Text that turns into a field of the same font and size when clicked, to rename it in place. Put it\n * inside the element that gives the text its role and type, such as a heading: it inherits the font.\n * Click, Enter, Space or F2 edits; Enter or leaving the field saves, Escape cancels. A blank or\n * unchanged value saves nothing.\n */\n@Component({\n selector: 'ds-inline-edit',\n standalone: true,\n imports: [IconComponent, TooltipDirective],\n templateUrl: './inline-edit.component.html',\n styleUrl: './inline-edit.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[class.editing]': 'editing()',\n },\n})\nexport class InlineEditComponent {\n private readonly intl = inject(DS_INTL);\n private readonly injector = inject(Injector);\n private readonly field = viewChild<ElementRef<HTMLInputElement>>('field');\n private readonly display =\n viewChild<ElementRef<HTMLButtonElement>>('display');\n\n /** The text, two-way bound. Changes only on a save of a non-blank, different value. */\n readonly value = model<string>('');\n /** Shown, muted, while the value is empty, and in the empty field. */\n readonly placeholder = input<string>('');\n /** Longest value the field accepts, in characters; `null` for no limit. */\n readonly maxLength = input<number | null>(null);\n /** Shows the text without the edit affordance and refuses to edit. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** What the text is, such as \"Chat title\"; names the text and the field. Unset falls back to\n * `DS_INTL.inlineEdit.rename`. */\n readonly ariaLabel = input<string | null>(null);\n\n /** The trimmed new value, after a save that changed it. */\n readonly saved = output<string>();\n\n protected readonly editing = signal(false);\n protected readonly announcement = signal('');\n private readonly labels = computed(() => ({\n ...DS_INTL_DEFAULTS.inlineEdit,\n ...this.intl().inlineEdit,\n }));\n protected readonly label = computed(\n () => this.ariaLabel() || this.labels().rename,\n );\n protected readonly hint = computed(() => this.labels().rename);\n protected readonly shown = computed(() => this.value() || this.placeholder());\n\n /** Turns the text into the field, with the text selected. Does nothing while `disabled`. */\n edit(): void {\n if (this.disabled() || this.editing()) {\n return;\n }\n this.announcement.set('');\n this.editing.set(true);\n afterNextRender(\n () => {\n const field = this.field()?.nativeElement;\n field?.focus();\n field?.select();\n },\n { injector: this.injector },\n );\n }\n\n protected onDisplayKeydown(event: KeyboardEvent): void {\n if (event.key === 'F2') {\n event.preventDefault();\n this.edit();\n }\n }\n\n protected onFieldKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter' && !event.isComposing) {\n event.preventDefault();\n this.finish(true, true);\n } else if (event.key === 'Escape') {\n // Escape belongs to the field here, not to a dialog or panel around it.\n event.preventDefault();\n event.stopPropagation();\n this.finish(false, true);\n }\n }\n\n protected onFieldBlur(): void {\n this.finish(true, false);\n }\n\n // Leaves the field once: Enter removes it, and a removed focused field may still report a blur.\n private finish(save: boolean, returnFocus: boolean): void {\n if (!this.editing()) {\n return;\n }\n const next = (this.field()?.nativeElement.value ?? '').trim();\n this.editing.set(false);\n if (save && next !== '' && next !== this.value()) {\n this.value.set(next);\n this.saved.emit(next);\n this.announcement.set(this.labels().saved);\n }\n if (returnFocus) {\n afterNextRender(() => this.display()?.nativeElement.focus(), {\n injector: this.injector,\n });\n }\n }\n}\n","@if (editing()) {\n <input\n #field\n class=\"box field\"\n type=\"text\"\n [value]=\"value()\"\n [attr.maxlength]=\"maxLength()\"\n [attr.placeholder]=\"placeholder() || null\"\n [attr.aria-label]=\"label()\"\n (keydown)=\"onFieldKeydown($event)\"\n (blur)=\"onFieldBlur()\" />\n} @else if (disabled()) {\n <span\n class=\"box display\"\n [class.empty]=\"!value()\">\n <span class=\"text\">\n {{ shown() }}\n </span>\n </span>\n} @else {\n <button\n #display\n type=\"button\"\n class=\"box display\"\n [class.empty]=\"!value()\"\n [attr.aria-label]=\"label() + ': ' + shown()\"\n [dsTooltip]=\"hint()\"\n (click)=\"edit()\"\n (keydown)=\"onDisplayKeydown($event)\">\n <span class=\"text\">\n {{ shown() }}\n </span>\n\n <ds-icon\n class=\"pencil\"\n name=\"edit\"\n aria-hidden=\"true\"\n [size]=\"14\" />\n </button>\n}\n\n<span\n class=\"live\"\n aria-live=\"polite\">\n {{ announcement() }}\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAsBA;;;;;AAKG;MAYU,mBAAmB,CAAA;AACb,IAAA,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;AACtB,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,KAAK,GAAG,SAAS,CAA+B,OAAO,4EAAC;AACxD,IAAA,OAAO,GACtB,SAAS,CAAgC,SAAS,8EAAC;;AAG5C,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;;AAEzB,IAAA,WAAW,GAAG,KAAK,CAAS,EAAE,kFAAC;;AAE/B,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;;IAEtC,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AACjE;AACmC;AAC1B,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;;IAGtC,KAAK,GAAG,MAAM,EAAU;AAEd,IAAA,OAAO,GAAG,MAAM,CAAC,KAAK,8EAAC;AACvB,IAAA,YAAY,GAAG,MAAM,CAAC,EAAE,mFAAC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,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE5CtD;;AAEG;;;;"}
|
|
@@ -32,7 +32,7 @@ class ListItemComponent {
|
|
|
32
32
|
/** Fires when the clickable row's button is activated. */
|
|
33
33
|
activated = output();
|
|
34
34
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
35
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ListItemComponent, isStandalone: true, selector: "ds-list-item", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activated: "activated" }, host: { attributes: { "role": "listitem" }, properties: { "attr.title": "null", "attr.aria-current": "selected() ? 'true' : null", "class.clickable": "clickable()", "class.selected": "selected()", "class.disabled": "disabled()" } }, ngImport: i0, template: "<span class=\"leading\">\n <ng-content select=\"[leading]\"></ng-content>\n</span>\n\n<!-- `[leading]` and `[trailing]` stay outside the activator: a control nested in a <button> is\n invalid and its click would bubble into `activated`. Legal because `role=\"listitem\"` allows\n interactive descendants, unlike `role=\"option\"`. -->\n@if (clickable()) {\n <button\n type=\"button\"\n class=\"activator\"\n [disabled]=\"disabled()\"\n (click)=\"activated.emit()\">\n <ng-container [ngTemplateOutlet]=\"body\"></ng-container>\n </button>\n} @else {\n <ng-container [ngTemplateOutlet]=\"body\"></ng-container>\n}\n\n<span class=\"trailing\">\n <ng-content select=\"[trailing]\"></ng-content>\n</span>\n\n<ng-template #body>\n <span class=\"body\">\n @if (title()) {\n <span class=\"title\">\n {{ title() }}\n </span>\n }\n\n @if (subtitle()) {\n <span class=\"subtitle\">\n {{ subtitle() }}\n </span>\n }\n\n <ng-content></ng-content>\n </span>\n</ng-template>\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_list-item-padding-y: var(--ds-list-item-padding-y, var(--list-item-pad-y));--_list-item-padding-x: var(--ds-list-item-padding-x, var(--list-item-pad-x));--_list-item-gap: var(--ds-list-item-gap, var(--list-item-gap));--_list-item-hover-bg-color: var(--ds-list-item-hover-bg-color, var(--surface-secondary));--_list-item-selected-bg-color: var(--ds-list-item-selected-bg-color, var(--accent-surface-tint));--_list-item-selected-label-color: var(--ds-list-item-selected-label-color, var(--accent-strong));--_list-item-selected-icon-color: var(--ds-list-item-selected-icon-color, var(--_list-item-selected-label-color));--_list-item-label-color: var(--ds-list-item-label-color, var(--text-primary));--_list-item-subtitle-color: var(--ds-list-item-subtitle-color, var(--text-tertiary));display:flex;align-items:center;gap:var(--_list-item-gap);padding:var(--_list-item-padding-y) var(--_list-item-padding-x);transition:background-color var(--duration-fast) var(--ease-standard)}.activator{display:flex;align-items:center;flex:1;min-width:0;padding:0;border:0;background:transparent;border-radius:var(--focus-ring-radius);color:var(--text-primary);font:inherit;text-align:left}button.activator{cursor:pointer}button.activator:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-width);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}button.activator:disabled{cursor:not-allowed}:host(:has(button.activator:hover)){background-color:var(--_list-item-hover-bg-color)}:host(:has(button.activator:active:not(:disabled))){background-color:var(--surface-muted)}.leading,.trailing{display:inline-flex;align-items:center;flex:none}.leading:empty,.trailing:empty{display:none}.trailing{color:var(--
|
|
35
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ListItemComponent, isStandalone: true, selector: "ds-list-item", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activated: "activated" }, host: { attributes: { "role": "listitem" }, properties: { "attr.title": "null", "attr.aria-current": "selected() ? 'true' : null", "class.clickable": "clickable()", "class.selected": "selected()", "class.disabled": "disabled()" } }, ngImport: i0, template: "<span class=\"leading\">\n <ng-content select=\"[leading]\"></ng-content>\n</span>\n\n<!-- `[leading]` and `[trailing]` stay outside the activator: a control nested in a <button> is\n invalid and its click would bubble into `activated`. Legal because `role=\"listitem\"` allows\n interactive descendants, unlike `role=\"option\"`. -->\n@if (clickable()) {\n <button\n type=\"button\"\n class=\"activator\"\n [disabled]=\"disabled()\"\n (click)=\"activated.emit()\">\n <ng-container [ngTemplateOutlet]=\"body\"></ng-container>\n </button>\n} @else {\n <ng-container [ngTemplateOutlet]=\"body\"></ng-container>\n}\n\n<span class=\"trailing\">\n <ng-content select=\"[trailing]\"></ng-content>\n</span>\n\n<ng-template #body>\n <span class=\"body\">\n @if (title()) {\n <span class=\"title\">\n {{ title() }}\n </span>\n }\n\n @if (subtitle()) {\n <span class=\"subtitle\">\n {{ subtitle() }}\n </span>\n }\n\n <ng-content></ng-content>\n </span>\n</ng-template>\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_list-item-padding-y: var(--ds-list-item-padding-y, var(--list-item-pad-y));--_list-item-padding-x: var(--ds-list-item-padding-x, var(--list-item-pad-x));--_list-item-gap: var(--ds-list-item-gap, var(--list-item-gap));--_list-item-hover-bg-color: var(--ds-list-item-hover-bg-color, var(--surface-secondary));--_list-item-selected-bg-color: var(--ds-list-item-selected-bg-color, var(--accent-surface-tint));--_list-item-selected-label-color: var(--ds-list-item-selected-label-color, var(--accent-strong));--_list-item-selected-icon-color: var(--ds-list-item-selected-icon-color, var(--_list-item-selected-label-color));--_list-item-label-color: var(--ds-list-item-label-color, var(--text-primary));--_list-item-subtitle-color: var(--ds-list-item-subtitle-color, var(--text-tertiary));--_list-item-trailing-color: var(--text-tertiary);display:flex;align-items:center;gap:var(--_list-item-gap);padding:var(--_list-item-padding-y) var(--_list-item-padding-x);transition:background-color var(--duration-fast) var(--ease-standard)}.activator{display:flex;align-items:center;flex:1;min-width:0;padding:0;border:0;background:transparent;border-radius:var(--focus-ring-radius);color:var(--text-primary);font:inherit;text-align:left}button.activator{cursor:pointer}button.activator:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-width);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}button.activator:disabled{cursor:not-allowed}:host-context(.popover),:host-context(.ds-overlay-pane){--_list-item-subtitle-color: var(--ds-list-item-subtitle-color, var(--text-tertiary-overlay));--_list-item-trailing-color: var(--text-tertiary-overlay)}:host(:has(button.activator:hover)){background-color:var(--_list-item-hover-bg-color)}:host(:has(button.activator:active:not(:disabled))){background-color:var(--surface-muted)}.leading,.trailing{display:inline-flex;align-items:center;flex:none}.leading:empty,.trailing:empty{display:none}.trailing{color:var(--_list-item-trailing-color)}.body{display:flex;flex-direction:column;gap:var(--space-px);flex:1;min-width:0}.title{color:var(--_list-item-label-color);font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-base) var(--font-sans)}.subtitle{color:var(--_list-item-subtitle-color);font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans)}:host(.selected){background-color:var(--_list-item-selected-bg-color)}:host(.selected) .title{color:var(--_list-item-selected-label-color)}:host(.selected) .leading{color:var(--_list-item-selected-icon-color)}:host(.disabled) .title,:host(.disabled) .subtitle,:host(.disabled) .trailing{color:var(--text-disabled)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
36
36
|
}
|
|
37
37
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ListItemComponent, decorators: [{
|
|
38
38
|
type: Component,
|
|
@@ -43,7 +43,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
43
43
|
'[class.clickable]': 'clickable()',
|
|
44
44
|
'[class.selected]': 'selected()',
|
|
45
45
|
'[class.disabled]': 'disabled()',
|
|
46
|
-
}, template: "<span class=\"leading\">\n <ng-content select=\"[leading]\"></ng-content>\n</span>\n\n<!-- `[leading]` and `[trailing]` stay outside the activator: a control nested in a <button> is\n invalid and its click would bubble into `activated`. Legal because `role=\"listitem\"` allows\n interactive descendants, unlike `role=\"option\"`. -->\n@if (clickable()) {\n <button\n type=\"button\"\n class=\"activator\"\n [disabled]=\"disabled()\"\n (click)=\"activated.emit()\">\n <ng-container [ngTemplateOutlet]=\"body\"></ng-container>\n </button>\n} @else {\n <ng-container [ngTemplateOutlet]=\"body\"></ng-container>\n}\n\n<span class=\"trailing\">\n <ng-content select=\"[trailing]\"></ng-content>\n</span>\n\n<ng-template #body>\n <span class=\"body\">\n @if (title()) {\n <span class=\"title\">\n {{ title() }}\n </span>\n }\n\n @if (subtitle()) {\n <span class=\"subtitle\">\n {{ subtitle() }}\n </span>\n }\n\n <ng-content></ng-content>\n </span>\n</ng-template>\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_list-item-padding-y: var(--ds-list-item-padding-y, var(--list-item-pad-y));--_list-item-padding-x: var(--ds-list-item-padding-x, var(--list-item-pad-x));--_list-item-gap: var(--ds-list-item-gap, var(--list-item-gap));--_list-item-hover-bg-color: var(--ds-list-item-hover-bg-color, var(--surface-secondary));--_list-item-selected-bg-color: var(--ds-list-item-selected-bg-color, var(--accent-surface-tint));--_list-item-selected-label-color: var(--ds-list-item-selected-label-color, var(--accent-strong));--_list-item-selected-icon-color: var(--ds-list-item-selected-icon-color, var(--_list-item-selected-label-color));--_list-item-label-color: var(--ds-list-item-label-color, var(--text-primary));--_list-item-subtitle-color: var(--ds-list-item-subtitle-color, var(--text-tertiary));display:flex;align-items:center;gap:var(--_list-item-gap);padding:var(--_list-item-padding-y) var(--_list-item-padding-x);transition:background-color var(--duration-fast) var(--ease-standard)}.activator{display:flex;align-items:center;flex:1;min-width:0;padding:0;border:0;background:transparent;border-radius:var(--focus-ring-radius);color:var(--text-primary);font:inherit;text-align:left}button.activator{cursor:pointer}button.activator:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-width);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}button.activator:disabled{cursor:not-allowed}:host(:has(button.activator:hover)){background-color:var(--_list-item-hover-bg-color)}:host(:has(button.activator:active:not(:disabled))){background-color:var(--surface-muted)}.leading,.trailing{display:inline-flex;align-items:center;flex:none}.leading:empty,.trailing:empty{display:none}.trailing{color:var(--
|
|
46
|
+
}, template: "<span class=\"leading\">\n <ng-content select=\"[leading]\"></ng-content>\n</span>\n\n<!-- `[leading]` and `[trailing]` stay outside the activator: a control nested in a <button> is\n invalid and its click would bubble into `activated`. Legal because `role=\"listitem\"` allows\n interactive descendants, unlike `role=\"option\"`. -->\n@if (clickable()) {\n <button\n type=\"button\"\n class=\"activator\"\n [disabled]=\"disabled()\"\n (click)=\"activated.emit()\">\n <ng-container [ngTemplateOutlet]=\"body\"></ng-container>\n </button>\n} @else {\n <ng-container [ngTemplateOutlet]=\"body\"></ng-container>\n}\n\n<span class=\"trailing\">\n <ng-content select=\"[trailing]\"></ng-content>\n</span>\n\n<ng-template #body>\n <span class=\"body\">\n @if (title()) {\n <span class=\"title\">\n {{ title() }}\n </span>\n }\n\n @if (subtitle()) {\n <span class=\"subtitle\">\n {{ subtitle() }}\n </span>\n }\n\n <ng-content></ng-content>\n </span>\n</ng-template>\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_list-item-padding-y: var(--ds-list-item-padding-y, var(--list-item-pad-y));--_list-item-padding-x: var(--ds-list-item-padding-x, var(--list-item-pad-x));--_list-item-gap: var(--ds-list-item-gap, var(--list-item-gap));--_list-item-hover-bg-color: var(--ds-list-item-hover-bg-color, var(--surface-secondary));--_list-item-selected-bg-color: var(--ds-list-item-selected-bg-color, var(--accent-surface-tint));--_list-item-selected-label-color: var(--ds-list-item-selected-label-color, var(--accent-strong));--_list-item-selected-icon-color: var(--ds-list-item-selected-icon-color, var(--_list-item-selected-label-color));--_list-item-label-color: var(--ds-list-item-label-color, var(--text-primary));--_list-item-subtitle-color: var(--ds-list-item-subtitle-color, var(--text-tertiary));--_list-item-trailing-color: var(--text-tertiary);display:flex;align-items:center;gap:var(--_list-item-gap);padding:var(--_list-item-padding-y) var(--_list-item-padding-x);transition:background-color var(--duration-fast) var(--ease-standard)}.activator{display:flex;align-items:center;flex:1;min-width:0;padding:0;border:0;background:transparent;border-radius:var(--focus-ring-radius);color:var(--text-primary);font:inherit;text-align:left}button.activator{cursor:pointer}button.activator:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-width);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}button.activator:disabled{cursor:not-allowed}:host-context(.popover),:host-context(.ds-overlay-pane){--_list-item-subtitle-color: var(--ds-list-item-subtitle-color, var(--text-tertiary-overlay));--_list-item-trailing-color: var(--text-tertiary-overlay)}:host(:has(button.activator:hover)){background-color:var(--_list-item-hover-bg-color)}:host(:has(button.activator:active:not(:disabled))){background-color:var(--surface-muted)}.leading,.trailing{display:inline-flex;align-items:center;flex:none}.leading:empty,.trailing:empty{display:none}.trailing{color:var(--_list-item-trailing-color)}.body{display:flex;flex-direction:column;gap:var(--space-px);flex:1;min-width:0}.title{color:var(--_list-item-label-color);font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-base) var(--font-sans)}.subtitle{color:var(--_list-item-subtitle-color);font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans)}:host(.selected){background-color:var(--_list-item-selected-bg-color)}:host(.selected) .title{color:var(--_list-item-selected-label-color)}:host(.selected) .leading{color:var(--_list-item-selected-icon-color)}:host(.disabled) .title,:host(.disabled) .subtitle,:host(.disabled) .trailing{color:var(--text-disabled)}\n"] }]
|
|
47
47
|
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], activated: [{ type: i0.Output, args: ["activated"] }] } });
|
|
48
48
|
|
|
49
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-list.mjs","sources":["../../../src/lib/components/list/list.component.ts","../../../src/lib/components/list/list-item.component.ts","../../../src/lib/components/list/list-item.component.html","../../../src/lib/components/list/ids-group-ltd-ids-design-system-components-list.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n input,\n} from '@angular/core';\n\n@Component({\n selector: 'ds-list',\n standalone: true,\n template: '<ng-content></ng-content>',\n styleUrl: './list.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n role: 'list',\n '[class.dividers]': 'dividers()',\n },\n})\nexport class ListComponent {\n /** Hairline separator between adjacent items. */\n readonly dividers = input(true, { transform: booleanAttribute });\n}\n","import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n input,\n output,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\n@Component({\n selector: 'ds-list-item',\n standalone: true,\n imports: [NgTemplateOutlet],\n templateUrl: './list-item.component.html',\n styleUrl: './list-item.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[attr.title]': 'null',\n role: 'listitem',\n '[attr.aria-current]': \"selected() ? 'true' : null\",\n '[class.clickable]': 'clickable()',\n '[class.selected]': 'selected()',\n '[class.disabled]': 'disabled()',\n },\n})\nexport class ListItemComponent {\n /** Row text; richer content can be projected instead. */\n readonly title = input<string>('');\n /** Secondary line below `title`. */\n readonly subtitle = input<string>('');\n /** Makes the row's text a button that emits `activated`. `[leading]` and\n * `[trailing]` stay outside it, so a row can hold its own controls as well. */\n readonly clickable = input(false, { transform: booleanAttribute });\n /** Marks the row current: `aria-current` and the selected tint. */\n readonly selected = input(false, { transform: booleanAttribute });\n /** Disables the row's own button. Controls projected into `[leading]` or\n * `[trailing]` keep their own disabled state. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Fires when the clickable row's button is activated. */\n readonly activated = output<void>();\n}\n","<span class=\"leading\">\n <ng-content select=\"[leading]\"></ng-content>\n</span>\n\n<!-- `[leading]` and `[trailing]` stay outside the activator: a control nested in a <button> is\n invalid and its click would bubble into `activated`. Legal because `role=\"listitem\"` allows\n interactive descendants, unlike `role=\"option\"`. -->\n@if (clickable()) {\n <button\n type=\"button\"\n class=\"activator\"\n [disabled]=\"disabled()\"\n (click)=\"activated.emit()\">\n <ng-container [ngTemplateOutlet]=\"body\"></ng-container>\n </button>\n} @else {\n <ng-container [ngTemplateOutlet]=\"body\"></ng-container>\n}\n\n<span class=\"trailing\">\n <ng-content select=\"[trailing]\"></ng-content>\n</span>\n\n<ng-template #body>\n <span class=\"body\">\n @if (title()) {\n <span class=\"title\">\n {{ title() }}\n </span>\n }\n\n @if (subtitle()) {\n <span class=\"subtitle\">\n {{ subtitle() }}\n </span>\n }\n\n <ng-content></ng-content>\n </span>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAkBa,aAAa,CAAA;;IAEf,QAAQ,GAAG,KAAK,CAAC,IAAI,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;wGAFrD,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAb,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,aAAa,0SARd,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,q1BAAA,CAAA,E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A,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,UAAA,EAAA,EAAA,UAAA,EAAA,EAAA,YAAA,EAAA,MAAA,EAAA,mBAAA,EAAA,4BAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,YAAA,EAAA,gBAAA,EAAA,YAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECzB9B,khCAwCA,EAAA,MAAA,EAAA,CAAA
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-list.mjs","sources":["../../../src/lib/components/list/list.component.ts","../../../src/lib/components/list/list-item.component.ts","../../../src/lib/components/list/list-item.component.html","../../../src/lib/components/list/ids-group-ltd-ids-design-system-components-list.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n input,\n} from '@angular/core';\n\n@Component({\n selector: 'ds-list',\n standalone: true,\n template: '<ng-content></ng-content>',\n styleUrl: './list.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n role: 'list',\n '[class.dividers]': 'dividers()',\n },\n})\nexport class ListComponent {\n /** Hairline separator between adjacent items. */\n readonly dividers = input(true, { transform: booleanAttribute });\n}\n","import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n input,\n output,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\n@Component({\n selector: 'ds-list-item',\n standalone: true,\n imports: [NgTemplateOutlet],\n templateUrl: './list-item.component.html',\n styleUrl: './list-item.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[attr.title]': 'null',\n role: 'listitem',\n '[attr.aria-current]': \"selected() ? 'true' : null\",\n '[class.clickable]': 'clickable()',\n '[class.selected]': 'selected()',\n '[class.disabled]': 'disabled()',\n },\n})\nexport class ListItemComponent {\n /** Row text; richer content can be projected instead. */\n readonly title = input<string>('');\n /** Secondary line below `title`. */\n readonly subtitle = input<string>('');\n /** Makes the row's text a button that emits `activated`. `[leading]` and\n * `[trailing]` stay outside it, so a row can hold its own controls as well. */\n readonly clickable = input(false, { transform: booleanAttribute });\n /** Marks the row current: `aria-current` and the selected tint. */\n readonly selected = input(false, { transform: booleanAttribute });\n /** Disables the row's own button. Controls projected into `[leading]` or\n * `[trailing]` keep their own disabled state. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Fires when the clickable row's button is activated. */\n readonly activated = output<void>();\n}\n","<span class=\"leading\">\n <ng-content select=\"[leading]\"></ng-content>\n</span>\n\n<!-- `[leading]` and `[trailing]` stay outside the activator: a control nested in a <button> is\n invalid and its click would bubble into `activated`. Legal because `role=\"listitem\"` allows\n interactive descendants, unlike `role=\"option\"`. -->\n@if (clickable()) {\n <button\n type=\"button\"\n class=\"activator\"\n [disabled]=\"disabled()\"\n (click)=\"activated.emit()\">\n <ng-container [ngTemplateOutlet]=\"body\"></ng-container>\n </button>\n} @else {\n <ng-container [ngTemplateOutlet]=\"body\"></ng-container>\n}\n\n<span class=\"trailing\">\n <ng-content select=\"[trailing]\"></ng-content>\n</span>\n\n<ng-template #body>\n <span class=\"body\">\n @if (title()) {\n <span class=\"title\">\n {{ title() }}\n </span>\n }\n\n @if (subtitle()) {\n <span class=\"subtitle\">\n {{ subtitle() }}\n </span>\n }\n\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MAAA,EAAA,CAAA,6wGAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,ED5BY,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAaf,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAhB7B,SAAS;+BACE,cAAc,EAAA,UAAA,EACZ,IAAI,EAAA,OAAA,EACP,CAAC,gBAAgB,CAAC,EAAA,aAAA,EAGZ,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EACnC;AACJ,wBAAA,cAAc,EAAE,MAAM;AACtB,wBAAA,IAAI,EAAE,UAAU;AAChB,wBAAA,qBAAqB,EAAE,4BAA4B;AACnD,wBAAA,mBAAmB,EAAE,aAAa;AAClC,wBAAA,kBAAkB,EAAE,YAAY;AAChC,wBAAA,kBAAkB,EAAE,YAAY;AACjC,qBAAA,EAAA,QAAA,EAAA,khCAAA,EAAA,MAAA,EAAA,CAAA,6wGAAA,CAAA,EAAA;;;AEvBH;;AAEG;;;;"}
|
|
@@ -293,11 +293,11 @@ class MenuItemComponent {
|
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: MenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
296
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: MenuItemComponent, isStandalone: true, selector: "ds-menu-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, quiet: { classPropertyName: "quiet", publicName: "quiet", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, submenu: { classPropertyName: "submenu", publicName: "submenu", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressed" }, host: { attributes: { "role": "none" } }, viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true, isSignal: true }], ngImport: i0, template: "<button\n #button\n class=\"menu-item\"\n type=\"button\"\n role=\"menuitem\"\n [attr.tabindex]=\"tabbable() ? 0 : -1\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n [class.disabled]=\"disabled()\"\n [class.error]=\"error()\"\n [class.quiet]=\"quiet()\"\n [class.has-submenu]=\"hasSubmenu()\"\n [attr.aria-haspopup]=\"hasSubmenu() ? 'menu' : null\"\n [attr.aria-expanded]=\"hasSubmenu() ? submenuOpen() : null\"\n [attr.aria-describedby]=\"description() ? descriptionId : null\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave($event)\">\n @if (icon()) {\n <ds-icon\n [name]=\"icon()!\"\n [size]=\"16\">\n </ds-icon>\n } @else {\n <span class=\"menu-item-icon\">\n <ng-content select=\"[icon]\"></ng-content>\n </span>\n }\n\n <span class=\"menu-item-body\">\n <ng-content></ng-content>\n\n @if (description()) {\n <span\n class=\"menu-item-description\"\n aria-hidden=\"true\"\n [id]=\"descriptionId\">\n {{ description() }}\n </span>\n }\n </span>\n\n @if (hasSubmenu()) {\n <ds-icon\n class=\"submenu-chevron\"\n name=\"chevronRight\"\n [size]=\"14\" />\n }\n</button>\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_menu-item-label-color: var(--ds-menu-item-label-color, var(--text-primary));--_menu-item-hover-bg-color: var(--ds-menu-item-hover-bg-color, var(--surface-secondary));--_menu-item-error-label-color: var(--ds-menu-item-error-label-color, var(--error-text));--_menu-item-quiet-label-color: var(--ds-menu-item-quiet-label-color, var(--text-secondary));--_menu-item-padding-x: var(--ds-menu-item-padding-x, var(--space-3));--_menu-item-padding-y: var(--ds-menu-item-padding-y, var(--space-2));--_menu-item-label-font-weight: var(--ds-menu-item-label-font-weight, var(--font-weight-medium));--_menu-item-label-font-size: var(--ds-menu-item-label-font-size, var(--font-size-s));--_menu-item-description-color: var(--ds-menu-item-description-color, var(--text-tertiary));--_menu-item-description-font-size: var(--ds-menu-item-description-font-size, var(--font-size-2xs));--_menu-item-description-max-width: var(--ds-menu-item-description-max-width, 14rem);--_menu-item-icon-size: var(--ds-menu-item-icon-size, 16px);display:block}.menu-item-body{display:flex;flex-direction:column;align-items:flex-start;min-width:0}.menu-item-icon{display:contents}:host-context(ds-menu.has-icons) .menu-item-icon{display:block;flex:none;width:var(--_menu-item-icon-size)}.menu-item-description{display:block;max-width:var(--_menu-item-description-max-width);color:var(--_menu-item-description-color);font-size:var(--_menu-item-description-font-size);line-height:var(--line-height-snug);font-weight:var(--font-weight-regular);text-wrap:pretty}.menu-item{display:flex;align-items:center;gap:var(--space-2-5);width:100%;padding:var(--_menu-item-padding-y) var(--_menu-item-padding-x);background:transparent;border:0;border-radius:var(--ds-menu-item-radius, 0);font:var(--_menu-item-label-font-weight) var(--_menu-item-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_menu-item-label-color);cursor:pointer;text-align:left;transition:background-color var(--duration-fast) var(--ease-standard)}:host(:first-child) .menu-item{border-start-start-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0));border-start-end-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0))}:host(:last-child) .menu-item{border-end-start-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0));border-end-end-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0))}.menu-item:hover{background:var(--_menu-item-hover-bg-color)}.menu-item:active:not(.disabled){background:var(--surface-muted)}.menu-item:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.menu-item.disabled{color:var(--text-disabled);cursor:not-allowed}.menu-item.disabled:hover{background:transparent}.menu-item.quiet{color:var(--_menu-item-quiet-label-color)}.menu-item.error{color:var(--_menu-item-error-label-color)}.menu-item.error:hover{background:var(--error-subtitle)}.menu-item.error:active:not(.disabled){background:var(--error-muted)}.menu-item .submenu-chevron{margin-left:auto;color:var(--icon-muted);flex-shrink:0}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
296
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: MenuItemComponent, isStandalone: true, selector: "ds-menu-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, quiet: { classPropertyName: "quiet", publicName: "quiet", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, submenu: { classPropertyName: "submenu", publicName: "submenu", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressed" }, host: { attributes: { "role": "none" } }, viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true, isSignal: true }], ngImport: i0, template: "<button\n #button\n class=\"menu-item\"\n type=\"button\"\n role=\"menuitem\"\n [attr.tabindex]=\"tabbable() ? 0 : -1\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n [class.disabled]=\"disabled()\"\n [class.error]=\"error()\"\n [class.quiet]=\"quiet()\"\n [class.has-submenu]=\"hasSubmenu()\"\n [attr.aria-haspopup]=\"hasSubmenu() ? 'menu' : null\"\n [attr.aria-expanded]=\"hasSubmenu() ? submenuOpen() : null\"\n [attr.aria-describedby]=\"description() ? descriptionId : null\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave($event)\">\n @if (icon()) {\n <ds-icon\n [name]=\"icon()!\"\n [size]=\"16\">\n </ds-icon>\n } @else {\n <span class=\"menu-item-icon\">\n <ng-content select=\"[icon]\"></ng-content>\n </span>\n }\n\n <span class=\"menu-item-body\">\n <ng-content></ng-content>\n\n @if (description()) {\n <span\n class=\"menu-item-description\"\n aria-hidden=\"true\"\n [id]=\"descriptionId\">\n {{ description() }}\n </span>\n }\n </span>\n\n @if (hasSubmenu()) {\n <ds-icon\n class=\"submenu-chevron\"\n name=\"chevronRight\"\n [size]=\"14\" />\n }\n</button>\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_menu-item-label-color: var(--ds-menu-item-label-color, var(--text-primary));--_menu-item-hover-bg-color: var(--ds-menu-item-hover-bg-color, var(--surface-secondary));--_menu-item-error-label-color: var(--ds-menu-item-error-label-color, var(--error-text));--_menu-item-quiet-label-color: var(--ds-menu-item-quiet-label-color, var(--text-secondary));--_menu-item-padding-x: var(--ds-menu-item-padding-x, var(--space-3));--_menu-item-padding-y: var(--ds-menu-item-padding-y, var(--space-2));--_menu-item-label-font-weight: var(--ds-menu-item-label-font-weight, var(--font-weight-medium));--_menu-item-label-font-size: var(--ds-menu-item-label-font-size, var(--font-size-s));--_menu-item-description-color: var(--ds-menu-item-description-color, var(--text-tertiary));--_menu-item-description-font-size: var(--ds-menu-item-description-font-size, var(--font-size-2xs));--_menu-item-description-max-width: var(--ds-menu-item-description-max-width, 14rem);--_menu-item-icon-size: var(--ds-menu-item-icon-size, 16px);display:block}:host-context(.popover),:host-context(.ds-overlay-pane){--_menu-item-description-color: var(--ds-menu-item-description-color, var(--text-tertiary-overlay))}.menu-item-body{display:flex;flex-direction:column;align-items:flex-start;min-width:0}.menu-item-icon{display:contents}:host-context(ds-menu.has-icons) .menu-item-icon{display:block;flex:none;width:var(--_menu-item-icon-size)}.menu-item-description{display:block;max-width:var(--_menu-item-description-max-width);color:var(--_menu-item-description-color);font-size:var(--_menu-item-description-font-size);line-height:var(--line-height-snug);font-weight:var(--font-weight-regular);text-wrap:pretty}.menu-item{display:flex;align-items:center;gap:var(--space-2-5);width:100%;padding:var(--_menu-item-padding-y) var(--_menu-item-padding-x);background:transparent;border:0;border-radius:var(--ds-menu-item-radius, 0);font:var(--_menu-item-label-font-weight) var(--_menu-item-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_menu-item-label-color);cursor:pointer;text-align:left;transition:background-color var(--duration-fast) var(--ease-standard)}:host(:first-child) .menu-item{border-start-start-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0));border-start-end-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0))}:host(:last-child) .menu-item{border-end-start-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0));border-end-end-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0))}.menu-item:hover{background:var(--_menu-item-hover-bg-color)}.menu-item:active:not(.disabled){background:var(--surface-muted)}.menu-item:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.menu-item.disabled{color:var(--text-disabled);cursor:not-allowed}.menu-item.disabled:hover{background:transparent}.menu-item.quiet{color:var(--_menu-item-quiet-label-color)}.menu-item.error{color:var(--_menu-item-error-label-color)}.menu-item.error:hover{background:var(--error-subtitle)}.menu-item.error:active:not(.disabled){background:var(--error-muted)}.menu-item .submenu-chevron{margin-left:auto;color:var(--icon-muted);flex-shrink:0}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
297
297
|
}
|
|
298
298
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: MenuItemComponent, decorators: [{
|
|
299
299
|
type: Component,
|
|
300
|
-
args: [{ selector: 'ds-menu-item', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, host: { role: 'none' }, template: "<button\n #button\n class=\"menu-item\"\n type=\"button\"\n role=\"menuitem\"\n [attr.tabindex]=\"tabbable() ? 0 : -1\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n [class.disabled]=\"disabled()\"\n [class.error]=\"error()\"\n [class.quiet]=\"quiet()\"\n [class.has-submenu]=\"hasSubmenu()\"\n [attr.aria-haspopup]=\"hasSubmenu() ? 'menu' : null\"\n [attr.aria-expanded]=\"hasSubmenu() ? submenuOpen() : null\"\n [attr.aria-describedby]=\"description() ? descriptionId : null\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave($event)\">\n @if (icon()) {\n <ds-icon\n [name]=\"icon()!\"\n [size]=\"16\">\n </ds-icon>\n } @else {\n <span class=\"menu-item-icon\">\n <ng-content select=\"[icon]\"></ng-content>\n </span>\n }\n\n <span class=\"menu-item-body\">\n <ng-content></ng-content>\n\n @if (description()) {\n <span\n class=\"menu-item-description\"\n aria-hidden=\"true\"\n [id]=\"descriptionId\">\n {{ description() }}\n </span>\n }\n </span>\n\n @if (hasSubmenu()) {\n <ds-icon\n class=\"submenu-chevron\"\n name=\"chevronRight\"\n [size]=\"14\" />\n }\n</button>\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_menu-item-label-color: var(--ds-menu-item-label-color, var(--text-primary));--_menu-item-hover-bg-color: var(--ds-menu-item-hover-bg-color, var(--surface-secondary));--_menu-item-error-label-color: var(--ds-menu-item-error-label-color, var(--error-text));--_menu-item-quiet-label-color: var(--ds-menu-item-quiet-label-color, var(--text-secondary));--_menu-item-padding-x: var(--ds-menu-item-padding-x, var(--space-3));--_menu-item-padding-y: var(--ds-menu-item-padding-y, var(--space-2));--_menu-item-label-font-weight: var(--ds-menu-item-label-font-weight, var(--font-weight-medium));--_menu-item-label-font-size: var(--ds-menu-item-label-font-size, var(--font-size-s));--_menu-item-description-color: var(--ds-menu-item-description-color, var(--text-tertiary));--_menu-item-description-font-size: var(--ds-menu-item-description-font-size, var(--font-size-2xs));--_menu-item-description-max-width: var(--ds-menu-item-description-max-width, 14rem);--_menu-item-icon-size: var(--ds-menu-item-icon-size, 16px);display:block}.menu-item-body{display:flex;flex-direction:column;align-items:flex-start;min-width:0}.menu-item-icon{display:contents}:host-context(ds-menu.has-icons) .menu-item-icon{display:block;flex:none;width:var(--_menu-item-icon-size)}.menu-item-description{display:block;max-width:var(--_menu-item-description-max-width);color:var(--_menu-item-description-color);font-size:var(--_menu-item-description-font-size);line-height:var(--line-height-snug);font-weight:var(--font-weight-regular);text-wrap:pretty}.menu-item{display:flex;align-items:center;gap:var(--space-2-5);width:100%;padding:var(--_menu-item-padding-y) var(--_menu-item-padding-x);background:transparent;border:0;border-radius:var(--ds-menu-item-radius, 0);font:var(--_menu-item-label-font-weight) var(--_menu-item-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_menu-item-label-color);cursor:pointer;text-align:left;transition:background-color var(--duration-fast) var(--ease-standard)}:host(:first-child) .menu-item{border-start-start-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0));border-start-end-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0))}:host(:last-child) .menu-item{border-end-start-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0));border-end-end-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0))}.menu-item:hover{background:var(--_menu-item-hover-bg-color)}.menu-item:active:not(.disabled){background:var(--surface-muted)}.menu-item:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.menu-item.disabled{color:var(--text-disabled);cursor:not-allowed}.menu-item.disabled:hover{background:transparent}.menu-item.quiet{color:var(--_menu-item-quiet-label-color)}.menu-item.error{color:var(--_menu-item-error-label-color)}.menu-item.error:hover{background:var(--error-subtitle)}.menu-item.error:active:not(.disabled){background:var(--error-muted)}.menu-item .submenu-chevron{margin-left:auto;color:var(--icon-muted);flex-shrink:0}\n"] }]
|
|
300
|
+
args: [{ selector: 'ds-menu-item', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, host: { role: 'none' }, template: "<button\n #button\n class=\"menu-item\"\n type=\"button\"\n role=\"menuitem\"\n [attr.tabindex]=\"tabbable() ? 0 : -1\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n [class.disabled]=\"disabled()\"\n [class.error]=\"error()\"\n [class.quiet]=\"quiet()\"\n [class.has-submenu]=\"hasSubmenu()\"\n [attr.aria-haspopup]=\"hasSubmenu() ? 'menu' : null\"\n [attr.aria-expanded]=\"hasSubmenu() ? submenuOpen() : null\"\n [attr.aria-describedby]=\"description() ? descriptionId : null\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave($event)\">\n @if (icon()) {\n <ds-icon\n [name]=\"icon()!\"\n [size]=\"16\">\n </ds-icon>\n } @else {\n <span class=\"menu-item-icon\">\n <ng-content select=\"[icon]\"></ng-content>\n </span>\n }\n\n <span class=\"menu-item-body\">\n <ng-content></ng-content>\n\n @if (description()) {\n <span\n class=\"menu-item-description\"\n aria-hidden=\"true\"\n [id]=\"descriptionId\">\n {{ description() }}\n </span>\n }\n </span>\n\n @if (hasSubmenu()) {\n <ds-icon\n class=\"submenu-chevron\"\n name=\"chevronRight\"\n [size]=\"14\" />\n }\n</button>\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_menu-item-label-color: var(--ds-menu-item-label-color, var(--text-primary));--_menu-item-hover-bg-color: var(--ds-menu-item-hover-bg-color, var(--surface-secondary));--_menu-item-error-label-color: var(--ds-menu-item-error-label-color, var(--error-text));--_menu-item-quiet-label-color: var(--ds-menu-item-quiet-label-color, var(--text-secondary));--_menu-item-padding-x: var(--ds-menu-item-padding-x, var(--space-3));--_menu-item-padding-y: var(--ds-menu-item-padding-y, var(--space-2));--_menu-item-label-font-weight: var(--ds-menu-item-label-font-weight, var(--font-weight-medium));--_menu-item-label-font-size: var(--ds-menu-item-label-font-size, var(--font-size-s));--_menu-item-description-color: var(--ds-menu-item-description-color, var(--text-tertiary));--_menu-item-description-font-size: var(--ds-menu-item-description-font-size, var(--font-size-2xs));--_menu-item-description-max-width: var(--ds-menu-item-description-max-width, 14rem);--_menu-item-icon-size: var(--ds-menu-item-icon-size, 16px);display:block}:host-context(.popover),:host-context(.ds-overlay-pane){--_menu-item-description-color: var(--ds-menu-item-description-color, var(--text-tertiary-overlay))}.menu-item-body{display:flex;flex-direction:column;align-items:flex-start;min-width:0}.menu-item-icon{display:contents}:host-context(ds-menu.has-icons) .menu-item-icon{display:block;flex:none;width:var(--_menu-item-icon-size)}.menu-item-description{display:block;max-width:var(--_menu-item-description-max-width);color:var(--_menu-item-description-color);font-size:var(--_menu-item-description-font-size);line-height:var(--line-height-snug);font-weight:var(--font-weight-regular);text-wrap:pretty}.menu-item{display:flex;align-items:center;gap:var(--space-2-5);width:100%;padding:var(--_menu-item-padding-y) var(--_menu-item-padding-x);background:transparent;border:0;border-radius:var(--ds-menu-item-radius, 0);font:var(--_menu-item-label-font-weight) var(--_menu-item-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_menu-item-label-color);cursor:pointer;text-align:left;transition:background-color var(--duration-fast) var(--ease-standard)}:host(:first-child) .menu-item{border-start-start-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0));border-start-end-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0))}:host(:last-child) .menu-item{border-end-start-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0));border-end-end-radius:var(--ds-menu-item-radius, var(--_menu-edge-radius, 0))}.menu-item:hover{background:var(--_menu-item-hover-bg-color)}.menu-item:active:not(.disabled){background:var(--surface-muted)}.menu-item:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.menu-item.disabled{color:var(--text-disabled);cursor:not-allowed}.menu-item.disabled:hover{background:transparent}.menu-item.quiet{color:var(--_menu-item-quiet-label-color)}.menu-item.error{color:var(--_menu-item-error-label-color)}.menu-item.error:hover{background:var(--error-subtitle)}.menu-item.error:active:not(.disabled){background:var(--error-muted)}.menu-item .submenu-chevron{margin-left:auto;color:var(--icon-muted);flex-shrink:0}\n"] }]
|
|
301
301
|
}], propDecorators: { button: [{ type: i0.ViewChild, args: ['button', { isSignal: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], quiet: [{ type: i0.Input, args: [{ isSignal: true, alias: "quiet", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], submenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "submenu", required: false }] }], pressed: [{ type: i0.Output, args: ["pressed"] }] } });
|
|
302
302
|
|
|
303
303
|
class MenuComponent {
|