@db-ux/ngx-core-components 4.12.0 → 4.13.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @db-ux/ngx-core-components
2
2
 
3
+ ## 4.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - feat: enable Invoker Commands (`command`- and `commandfor`-HTML-attributes) for DBButton - [see commit 00f50c3](https://github.com/db-ux-design-system/core-web/commit/00f50c3fc4508e62f2e30589c00148c54e2fc852)
8
+
9
+ ## 4.12.1
10
+
11
+ ### Patch Changes
12
+
13
+ - fix(custom-select): dropdown with `dropdownWidth="auto"` now correctly sizes to content width and respects the trigger minimum width. Long option labels no longer get truncated: `auto` keeps them on a single line (dropdown grows to the longest option), while `fixed` and `full` wrap long labels onto new lines. - [see commit 68dedc3](https://github.com/db-ux-design-system/core-web/commit/68dedc33c324b48339d5bb73a85fdff3045ed059)
14
+
15
+ - fix(drawer): prevent backdrop drag-close when selection starts inside content - [see commit b53ff8a](https://github.com/db-ux-design-system/core-web/commit/b53ff8a4f0a5350c5be41fad072e14797676bba7)
16
+
3
17
  ## 4.12.0
4
18
 
5
19
  _version bump_
@@ -955,6 +955,9 @@ class DBButton {
955
955
  else if (this.click) {
956
956
  return "button";
957
957
  }
958
+ else if (this.commandfor()) {
959
+ return "button";
960
+ }
958
961
  return "submit";
959
962
  }
960
963
  setupObserver(element) {
@@ -981,6 +984,7 @@ class DBButton {
981
984
  this.getBoolean = getBoolean;
982
985
  this.getBooleanAsString = getBooleanAsString;
983
986
  this.type = input(...(ngDevMode ? [undefined, { debugName: "type" }] : /* istanbul ignore next */ []));
987
+ this.commandfor = input(...(ngDevMode ? [undefined, { debugName: "commandfor" }] : /* istanbul ignore next */ []));
984
988
  this.id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : /* istanbul ignore next */ []));
985
989
  this.propOverrides = input(...(ngDevMode ? [undefined, { debugName: "propOverrides" }] : /* istanbul ignore next */ []));
986
990
  this.className = input(...(ngDevMode ? [undefined, { debugName: "className" }] : /* istanbul ignore next */ []));
@@ -999,6 +1003,7 @@ class DBButton {
999
1003
  this.name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
1000
1004
  this.form = input(...(ngDevMode ? [undefined, { debugName: "form" }] : /* istanbul ignore next */ []));
1001
1005
  this.value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
1006
+ this.command = input(...(ngDevMode ? [undefined, { debugName: "command" }] : /* istanbul ignore next */ []));
1002
1007
  this.text = input(...(ngDevMode ? [undefined, { debugName: "text" }] : /* istanbul ignore next */ []));
1003
1008
  this.click = output();
1004
1009
  this._ref = viewChild("_ref", ...(ngDevMode ? [{ debugName: "_ref" }] : /* istanbul ignore next */ []));
@@ -1056,7 +1061,7 @@ class DBButton {
1056
1061
  this.observer()?.disconnect();
1057
1062
  }
1058
1063
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DBButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1059
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: DBButton, isStandalone: true, selector: "db-button", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, propOverrides: { classPropertyName: "propOverrides", publicName: "propOverrides", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, iconLeading: { classPropertyName: "iconLeading", publicName: "iconLeading", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, showIconLeading: { classPropertyName: "showIconLeading", publicName: "showIconLeading", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, iconTrailing: { classPropertyName: "iconTrailing", publicName: "iconTrailing", isSignal: true, isRequired: false, transformFunction: null }, showIconTrailing: { classPropertyName: "showIconTrailing", publicName: "showIconTrailing", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "wrap", isSignal: true, isRequired: false, transformFunction: null }, noText: { classPropertyName: "noText", publicName: "noText", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { click: "click" }, viewQueries: [{ propertyName: "_ref", first: true, predicate: ["_ref"], descendants: true, isSignal: true }], ngImport: i0, template: `<button
1064
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: DBButton, isStandalone: true, selector: "db-button", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, commandfor: { classPropertyName: "commandfor", publicName: "commandfor", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, propOverrides: { classPropertyName: "propOverrides", publicName: "propOverrides", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, iconLeading: { classPropertyName: "iconLeading", publicName: "iconLeading", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, showIconLeading: { classPropertyName: "showIconLeading", publicName: "showIconLeading", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, iconTrailing: { classPropertyName: "iconTrailing", publicName: "iconTrailing", isSignal: true, isRequired: false, transformFunction: null }, showIconTrailing: { classPropertyName: "showIconTrailing", publicName: "showIconTrailing", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "wrap", isSignal: true, isRequired: false, transformFunction: null }, noText: { classPropertyName: "noText", publicName: "noText", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, command: { classPropertyName: "command", publicName: "command", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { click: "click" }, viewQueries: [{ propertyName: "_ref", first: true, predicate: ["_ref"], descendants: true, isSignal: true }], ngImport: i0, template: `<button
1060
1065
  #_ref
1061
1066
  [attr.id]="id() ?? propOverrides()?.id"
1062
1067
  [class]="cls('db-button', className())"
@@ -1074,6 +1079,8 @@ class DBButton {
1074
1079
  [attr.name]="name()"
1075
1080
  [attr.form]="form()"
1076
1081
  [attr.value]="value()"
1082
+ [attr.command]="command()"
1083
+ [attr.commandfor]="commandfor()"
1077
1084
  >
1078
1085
  @if(text()){{{text()}}} <ng-content></ng-content>
1079
1086
  </button> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
@@ -1098,10 +1105,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
1098
1105
  [attr.name]="name()"
1099
1106
  [attr.form]="form()"
1100
1107
  [attr.value]="value()"
1108
+ [attr.command]="command()"
1109
+ [attr.commandfor]="commandfor()"
1101
1110
  >
1102
1111
  @if(text()){{{text()}}} <ng-content></ng-content>
1103
1112
  </button> `, styles: [":host{display:contents}\n"] }]
1104
- }], ctorParameters: () => [], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], propOverrides: [{ type: i0.Input, args: [{ isSignal: true, alias: "propOverrides", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], iconLeading: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeading", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], showIconLeading: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIconLeading", required: false }] }], showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }], iconTrailing: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTrailing", required: false }] }], showIconTrailing: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIconTrailing", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], wrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrap", required: false }] }], noText: [{ type: i0.Input, args: [{ isSignal: true, alias: "noText", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], click: [{ type: i0.Output, args: ["click"] }], _ref: [{ type: i0.ViewChild, args: ["_ref", { isSignal: true }] }] } });
1113
+ }], ctorParameters: () => [], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], commandfor: [{ type: i0.Input, args: [{ isSignal: true, alias: "commandfor", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], propOverrides: [{ type: i0.Input, args: [{ isSignal: true, alias: "propOverrides", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], iconLeading: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeading", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], showIconLeading: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIconLeading", required: false }] }], showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }], iconTrailing: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTrailing", required: false }] }], showIconTrailing: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIconTrailing", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], wrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrap", required: false }] }], noText: [{ type: i0.Input, args: [{ isSignal: true, alias: "noText", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], command: [{ type: i0.Input, args: [{ isSignal: true, alias: "command", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], click: [{ type: i0.Output, args: ["click"] }], _ref: [{ type: i0.ViewChild, args: ["_ref", { isSignal: true }] }] } });
1105
1114
 
1106
1115
  const ButtonVariantList = ['outlined', 'brand', 'filled', 'ghost'];
1107
1116
  const ButtonTypeList = ['button', 'reset', 'submit'];
@@ -2074,24 +2083,69 @@ const handleDataOutside = (el) => {
2074
2083
  const handleFixedDropdown = (element, parent, placement) => {
2075
2084
  if (!element || !parent)
2076
2085
  return;
2077
- // We skip this if we are in mobile it's already fixed
2086
+ const fullWidth = element.dataset['width'] === 'full';
2087
+ const autoWidth = element.dataset['width'] === 'auto';
2088
+ // Reset width-specific inline styles first so a previous mode (e.g. "auto")
2089
+ // doesn't leave a stale minInlineSize/inlineSize behind when the dropdown
2090
+ // width changes at runtime. This must happen before getFloatingProps
2091
+ // measures the element, otherwise the dropdown would be measured with a
2092
+ // width it no longer has and positioned incorrectly. It also has to run
2093
+ // before the mobile bailout below: otherwise a desktop minInlineSize would
2094
+ // survive into the mobile sheet, where CSS min-inline-size beats the
2095
+ // mobile max-inline-size guard and overflows the viewport.
2096
+ element.style.inlineSize = '';
2097
+ element.style.minInlineSize = '';
2098
+ // We skip the rest if we are in mobile, it's already fixed via CSS.
2078
2099
  if (getComputedStyle(element).zIndex === '9999')
2079
2100
  return;
2080
- const { top, bottom, childHeight, childWidth, width, right, left, correctedPlacement } = getFloatingProps(element, parent, placement);
2081
- const fullWidth = element.dataset['width'] === 'full';
2101
+ const { top, bottom, childHeight, childWidth, width, right, left, correctedPlacement, innerWidth } = getFloatingProps(element, parent, placement);
2102
+ // For auto width the dropdown is forced to be at least as wide as the trigger,
2103
+ // but clamped to its own max-inline-size: CSS lets a min-inline-size override
2104
+ // the max when the minimum is larger, so a trigger wider than the viewport
2105
+ // limit would otherwise drop the side margins or overflow horizontally.
2106
+ let autoMinWidth = width;
2107
+ if (autoWidth) {
2108
+ const maxInlineSize = parseFloat(getComputedStyle(element).maxInlineSize);
2109
+ if (!isNaN(maxInlineSize) && maxInlineSize > 0) {
2110
+ autoMinWidth = Math.min(width, maxInlineSize);
2111
+ }
2112
+ }
2082
2113
  if (fullWidth) {
2083
2114
  element.style.inlineSize = `${width}px`;
2084
2115
  }
2085
- if (correctedPlacement === 'top' || correctedPlacement === 'bottom' || correctedPlacement === 'top-start' || correctedPlacement === 'bottom-start') {
2116
+ else if (autoWidth) {
2117
+ element.style.minInlineSize = `${autoMinWidth}px`;
2118
+ }
2119
+ // getFloatingProps measured childWidth before the inline styles were
2120
+ // (re)applied, so use the width the dropdown will actually have:
2121
+ // - auto: the clamped minimum, so end-aligned dropdowns don't extend past
2122
+ // the trigger's right edge.
2123
+ // - full: the trigger width (the reset above drops it to content width).
2124
+ let effectiveChildWidth = childWidth;
2125
+ if (autoWidth) {
2126
+ effectiveChildWidth = Math.max(childWidth, autoMinWidth);
2127
+ }
2128
+ else if (fullWidth) {
2129
+ effectiveChildWidth = width;
2130
+ }
2131
+ // getFloatingProps detects horizontal overflow assuming a centered element
2132
+ // (it halves childWidth). The dropdown is actually start-aligned (inset =
2133
+ // left), so for the wider auto dropdown re-check overflow against its full
2134
+ // width and flip to end-alignment when it would extend past the viewport.
2135
+ let dropdownPlacement = correctedPlacement;
2136
+ if (autoWidth && (dropdownPlacement === 'top' || dropdownPlacement === 'bottom' || dropdownPlacement === 'top-start' || dropdownPlacement === 'bottom-start') && left + effectiveChildWidth > innerWidth) {
2137
+ dropdownPlacement = dropdownPlacement.startsWith('top') ? 'top-end' : 'bottom-end';
2138
+ }
2139
+ if (dropdownPlacement === 'top' || dropdownPlacement === 'bottom' || dropdownPlacement === 'top-start' || dropdownPlacement === 'bottom-start') {
2086
2140
  element.style.insetInlineStart = `${left}px`;
2087
2141
  }
2088
- else if (correctedPlacement === 'top-end' || correctedPlacement === 'bottom-end') {
2089
- element.style.insetInlineStart = `${right - childWidth}px`;
2142
+ else if (dropdownPlacement === 'top-end' || dropdownPlacement === 'bottom-end') {
2143
+ element.style.insetInlineStart = `${Math.max(right - effectiveChildWidth, 0)}px`;
2090
2144
  }
2091
- if (correctedPlacement?.startsWith('top')) {
2145
+ if (dropdownPlacement?.startsWith('top')) {
2092
2146
  element.style.insetBlockStart = `${top - childHeight}px`;
2093
2147
  }
2094
- else if (correctedPlacement?.startsWith('bottom')) {
2148
+ else if (dropdownPlacement?.startsWith('bottom')) {
2095
2149
  element.style.insetBlockStart = `${bottom}px`;
2096
2150
  }
2097
2151
  element.style.position = 'fixed';
@@ -2638,7 +2692,8 @@ class DBCustomSelectListItem {
2638
2692
  [disabled]="getBoolean(disabled(), 'disabled')"
2639
2693
  [value]="value()"
2640
2694
  (change)="handleChange($event)" />
2641
- @if(label()){{{label()}}} <ng-content></ng-content
2695
+ <span class="db-custom-select-list-item-label"
2696
+ >@if(label()){{{label()}}} <ng-content></ng-content></span
2642
2697
  ></label>
2643
2698
  }@else{
2644
2699
  <span>{{groupTitle()}}</span>
@@ -2675,7 +2730,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
2675
2730
  [disabled]="getBoolean(disabled(), 'disabled')"
2676
2731
  [value]="value()"
2677
2732
  (change)="handleChange($event)" />
2678
- @if(label()){{{label()}}} <ng-content></ng-content
2733
+ <span class="db-custom-select-list-item-label"
2734
+ >@if(label()){{{label()}}} <ng-content></ng-content></span
2679
2735
  ></label>
2680
2736
  }@else{
2681
2737
  <span>{{groupTitle()}}</span>
@@ -4196,6 +4252,9 @@ class DBCustomSelect {
4196
4252
  .toLowerCase()
4197
4253
  .includes(filterText.toLowerCase())));
4198
4254
  }
4255
+ if (this.detailsRef()?.nativeElement?.open) {
4256
+ this.handleAutoPlacement();
4257
+ }
4199
4258
  }
4200
4259
  handleClearAll(event) {
4201
4260
  event.stopPropagation();
@@ -4531,6 +4590,10 @@ class DBCustomSelect {
4531
4590
  // ---
4532
4591
  this._options.set(this.options());
4533
4592
  this.amountOptions.set(this.options()?.filter((option) => !option.isGroupTitle).length ?? 0);
4593
+ // Reposition open auto-width dropdowns: replacing options can change their content width.
4594
+ if (this.detailsRef()?.nativeElement?.open) {
4595
+ this.handleAutoPlacement();
4596
+ }
4534
4597
  }, Number(VERSION.major) < 19
4535
4598
  ? { allowSignalWrites: true }
4536
4599
  : undefined);
@@ -4927,7 +4990,7 @@ class DBCustomSelect {
4927
4990
  role="status"
4928
4991
  >{{_voiceOverFallback()}}</span
4929
4992
  >
4930
- </div> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: DBTag, selector: "db-tag", inputs: ["removeButton", "id", "propOverrides", "className", "semantic", "emphasis", "icon", "showCheckState", "showIcon", "noText", "overflow", "text", "behavior"], outputs: ["remove"] }, { kind: "component", type: DBCustomSelectDropdown, selector: "db-custom-select-dropdown", inputs: ["id", "propOverrides", "className", "width"] }, { kind: "component", type: DBInput, selector: "db-input", inputs: ["invalidMessage", "id", "propOverrides", "dataListId", "message", "showMessage", "value", "validMessage", "validation", "required", "minLength", "maxLength", "pattern", "dataList", "className", "variant", "showLabel", "showIconLeading", "showIcon", "iconLeading", "icon", "iconTrailing", "showRequiredAsterisk", "showIconTrailing", "label", "fieldSizing", "name", "type", "multiple", "accept", "placeholder", "disabled", "step", "maxlength", "minlength", "max", "min", "readOnly", "readonly", "form", "size", "autocomplete", "autofocus", "enterkeyhint", "inputmode", "ariaDescribedBy", "messageSize", "messageIcon", "validMessageSize", "invalidMessageSize"], outputs: ["valueChange", "disabledChange", "input", "change", "blur", "focus"] }, { kind: "component", type: DBCustomSelectList, selector: "db-custom-select-list", inputs: ["multiple", "label", "id", "propOverrides", "className"] }, { kind: "component", type: DBCustomSelectListItem, selector: "db-custom-select-list-item", inputs: ["isGroupTitle", "showDivider", "type", "checked", "id", "propOverrides", "className", "groupTitle", "icon", "showIcon", "name", "disabled", "value", "label"], outputs: ["checkedChange", "disabledChange", "change"] }, { kind: "component", type: DBInfotext, selector: "db-infotext", inputs: ["id", "propOverrides", "className", "icon", "semantic", "size", "wrap", "showIcon", "text"] }, { kind: "component", type: DBButton, selector: "db-button", inputs: ["type", "id", "propOverrides", "className", "disabled", "iconLeading", "icon", "showIconLeading", "showIcon", "iconTrailing", "showIconTrailing", "size", "width", "variant", "wrap", "noText", "name", "form", "value", "text"], outputs: ["click"] }, { kind: "component", type: DBTooltip, selector: "db-tooltip", inputs: ["id", "propOverrides", "variant", "placement", "className", "emphasis", "wrap", "animation", "delay", "width", "showArrow", "text"] }] }); }
4993
+ </div> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: DBTag, selector: "db-tag", inputs: ["removeButton", "id", "propOverrides", "className", "semantic", "emphasis", "icon", "showCheckState", "showIcon", "noText", "overflow", "text", "behavior"], outputs: ["remove"] }, { kind: "component", type: DBCustomSelectDropdown, selector: "db-custom-select-dropdown", inputs: ["id", "propOverrides", "className", "width"] }, { kind: "component", type: DBInput, selector: "db-input", inputs: ["invalidMessage", "id", "propOverrides", "dataListId", "message", "showMessage", "value", "validMessage", "validation", "required", "minLength", "maxLength", "pattern", "dataList", "className", "variant", "showLabel", "showIconLeading", "showIcon", "iconLeading", "icon", "iconTrailing", "showRequiredAsterisk", "showIconTrailing", "label", "fieldSizing", "name", "type", "multiple", "accept", "placeholder", "disabled", "step", "maxlength", "minlength", "max", "min", "readOnly", "readonly", "form", "size", "autocomplete", "autofocus", "enterkeyhint", "inputmode", "ariaDescribedBy", "messageSize", "messageIcon", "validMessageSize", "invalidMessageSize"], outputs: ["valueChange", "disabledChange", "input", "change", "blur", "focus"] }, { kind: "component", type: DBCustomSelectList, selector: "db-custom-select-list", inputs: ["multiple", "label", "id", "propOverrides", "className"] }, { kind: "component", type: DBCustomSelectListItem, selector: "db-custom-select-list-item", inputs: ["isGroupTitle", "showDivider", "type", "checked", "id", "propOverrides", "className", "groupTitle", "icon", "showIcon", "name", "disabled", "value", "label"], outputs: ["checkedChange", "disabledChange", "change"] }, { kind: "component", type: DBInfotext, selector: "db-infotext", inputs: ["id", "propOverrides", "className", "icon", "semantic", "size", "wrap", "showIcon", "text"] }, { kind: "component", type: DBButton, selector: "db-button", inputs: ["type", "commandfor", "id", "propOverrides", "className", "disabled", "iconLeading", "icon", "showIconLeading", "showIcon", "iconTrailing", "showIconTrailing", "size", "width", "variant", "wrap", "noText", "name", "form", "value", "command", "text"], outputs: ["click"] }, { kind: "component", type: DBTooltip, selector: "db-tooltip", inputs: ["id", "propOverrides", "variant", "placement", "className", "emphasis", "wrap", "animation", "delay", "width", "showArrow", "text"] }] }); }
4931
4994
  }
4932
4995
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DBCustomSelect, decorators: [{
4933
4996
  type: Component,
@@ -5375,6 +5438,18 @@ const DividerVariantList = ['horizontal', 'vertical'];
5375
5438
 
5376
5439
  const defaultProps$q = {};
5377
5440
  class DBDrawer {
5441
+ isNotModal() {
5442
+ return (this.position() === "absolute" ||
5443
+ this.backdrop() === "none" ||
5444
+ this.variant() === "inside");
5445
+ }
5446
+ handleBackdropPointerDown(event) {
5447
+ // Remember whether the pointer interaction started on the backdrop
5448
+ // (the DIALOG element itself) so we only close on a real backdrop
5449
+ // click and not when a drag started inside the content and ended
5450
+ // on the backdrop.
5451
+ this.backdropPointerDown.set(event?.target?.nodeName === "DIALOG");
5452
+ }
5378
5453
  handleClose(event, forceClose) {
5379
5454
  if (!event)
5380
5455
  return;
@@ -5395,11 +5470,15 @@ class DBDrawer {
5395
5470
  }
5396
5471
  if (event.target?.nodeName === "DIALOG" &&
5397
5472
  event.type === "click" &&
5398
- this.backdrop() !== "none") {
5473
+ this.backdrop() !== "none" &&
5474
+ this.backdropPointerDown()) {
5399
5475
  if (this.close) {
5400
5476
  this.close.emit(event);
5401
5477
  }
5402
5478
  }
5479
+ // Reset after handling the click so the next interaction
5480
+ // starts from a clean state.
5481
+ this.backdropPointerDown.set(false);
5403
5482
  }
5404
5483
  }
5405
5484
  handleDialogOpen() {
@@ -5409,12 +5488,15 @@ class DBDrawer {
5409
5488
  if (this.dialogContainerRef()?.nativeElement) {
5410
5489
  (this.dialogContainerRef()?.nativeElement).removeAttribute("data-transition");
5411
5490
  }
5412
- if (this.position() === "absolute" ||
5413
- this.backdrop() === "none" ||
5414
- this.variant() === "inside") {
5491
+ if (this.isNotModal()) {
5415
5492
  this._ref()?.nativeElement.show();
5416
5493
  }
5417
5494
  else {
5495
+ // Set the closedby attribute imperatively: the JSX
5496
+ // dialog type does not know this attribute yet, and it
5497
+ // only applies to modal dialogs. "any" enables native
5498
+ // light dismiss (backdrop click / Esc).
5499
+ this._ref()?.nativeElement.setAttribute("closedby", "any");
5418
5500
  this._ref()?.nativeElement.showModal();
5419
5501
  }
5420
5502
  void delay(() => {
@@ -5473,6 +5555,7 @@ class DBDrawer {
5473
5555
  this._ref = viewChild("_ref", ...(ngDevMode ? [{ debugName: "_ref" }] : /* istanbul ignore next */ []));
5474
5556
  this.dialogContainerRef = viewChild("dialogContainerRef", ...(ngDevMode ? [{ debugName: "dialogContainerRef" }] : /* istanbul ignore next */ []));
5475
5557
  this.initialized = signal(false, ...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
5558
+ this.backdropPointerDown = signal(false, ...(ngDevMode ? [{ debugName: "backdropPointerDown" }] : /* istanbul ignore next */ []));
5476
5559
  this.observer = signal(undefined, ...(ngDevMode ? [{ debugName: "observer" }] : /* istanbul ignore next */ []));
5477
5560
  if (typeof window !== "undefined") {
5478
5561
  effect(() => {
@@ -5562,6 +5645,7 @@ class DBDrawer {
5562
5645
  [attr.id]="id() ?? propOverrides()?.id"
5563
5646
  #_ref
5564
5647
  (click)="handleClose($event)"
5648
+ (mousedown)="handleBackdropPointerDown($event)"
5565
5649
  (keydown)="handleClose($event)"
5566
5650
  [attr.data-position]="position()"
5567
5651
  [attr.data-backdrop]="backdrop()"
@@ -5592,7 +5676,7 @@ class DBDrawer {
5592
5676
  </header>
5593
5677
  <div class="db-drawer-content"><ng-content></ng-content></div>
5594
5678
  </article>
5595
- </dialog> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: DBButton, selector: "db-button", inputs: ["type", "id", "propOverrides", "className", "disabled", "iconLeading", "icon", "showIconLeading", "showIcon", "iconTrailing", "showIconTrailing", "size", "width", "variant", "wrap", "noText", "name", "form", "value", "text"], outputs: ["click"] }] }); }
5679
+ </dialog> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: DBButton, selector: "db-button", inputs: ["type", "commandfor", "id", "propOverrides", "className", "disabled", "iconLeading", "icon", "showIconLeading", "showIcon", "iconTrailing", "showIconTrailing", "size", "width", "variant", "wrap", "noText", "name", "form", "value", "command", "text"], outputs: ["click"] }] }); }
5596
5680
  }
5597
5681
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DBDrawer, decorators: [{
5598
5682
  type: Component,
@@ -5601,6 +5685,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
5601
5685
  [attr.id]="id() ?? propOverrides()?.id"
5602
5686
  #_ref
5603
5687
  (click)="handleClose($event)"
5688
+ (mousedown)="handleBackdropPointerDown($event)"
5604
5689
  (keydown)="handleClose($event)"
5605
5690
  [attr.data-position]="position()"
5606
5691
  [attr.data-backdrop]="backdrop()"
@@ -5995,7 +6080,7 @@ class DBHeader {
5995
6080
  <div class="db-header-secondary-action">
5996
6081
  <ng-content *ngTemplateOutlet="dbSecondaryAction"> </ng-content></div
5997
6082
  ></db-drawer>
5998
- </header> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DBButton, selector: "db-button", inputs: ["type", "id", "propOverrides", "className", "disabled", "iconLeading", "icon", "showIconLeading", "showIcon", "iconTrailing", "showIconTrailing", "size", "width", "variant", "wrap", "noText", "name", "form", "value", "text"], outputs: ["click"] }, { kind: "component", type: DBDrawer, selector: "db-drawer", inputs: ["open", "position", "backdrop", "variant", "id", "propOverrides", "direction", "className", "spacing", "width", "rounded", "closeButtonId", "closeButtonText"], outputs: ["close"] }] }); }
6083
+ </header> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DBButton, selector: "db-button", inputs: ["type", "commandfor", "id", "propOverrides", "className", "disabled", "iconLeading", "icon", "showIconLeading", "showIcon", "iconTrailing", "showIconTrailing", "size", "width", "variant", "wrap", "noText", "name", "form", "value", "command", "text"], outputs: ["click"] }, { kind: "component", type: DBDrawer, selector: "db-drawer", inputs: ["open", "position", "backdrop", "variant", "id", "propOverrides", "direction", "className", "spacing", "width", "rounded", "closeButtonId", "closeButtonText"], outputs: ["close"] }] }); }
5999
6084
  }
6000
6085
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DBHeader, decorators: [{
6001
6086
  type: Component,
@@ -6656,7 +6741,7 @@ class DBNavigationItem {
6656
6741
  }@else{ @if(text()){{{text()}}}@else{
6657
6742
  <ng-content *ngTemplateOutlet="dbNavigationContent"></ng-content>
6658
6743
  } }
6659
- </li> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DBButton, selector: "db-button", inputs: ["type", "id", "propOverrides", "className", "disabled", "iconLeading", "icon", "showIconLeading", "showIcon", "iconTrailing", "showIconTrailing", "size", "width", "variant", "wrap", "noText", "name", "form", "value", "text"], outputs: ["click"] }] }); }
6744
+ </li> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DBButton, selector: "db-button", inputs: ["type", "commandfor", "id", "propOverrides", "className", "disabled", "iconLeading", "icon", "showIconLeading", "showIcon", "iconTrailing", "showIconTrailing", "size", "width", "variant", "wrap", "noText", "name", "form", "value", "command", "text"], outputs: ["click"] }] }); }
6660
6745
  }
6661
6746
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DBNavigationItem, decorators: [{
6662
6747
  type: Component,
@@ -6870,7 +6955,7 @@ class DBNotification {
6870
6955
  >{{closeButtonText() ?? DEFAULT_CLOSE_BUTTON}}</db-button
6871
6956
  >
6872
6957
  }
6873
- </div> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: DBButton, selector: "db-button", inputs: ["type", "id", "propOverrides", "className", "disabled", "iconLeading", "icon", "showIconLeading", "showIcon", "iconTrailing", "showIconTrailing", "size", "width", "variant", "wrap", "noText", "name", "form", "value", "text"], outputs: ["click"] }] }); }
6958
+ </div> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: DBButton, selector: "db-button", inputs: ["type", "commandfor", "id", "propOverrides", "className", "disabled", "iconLeading", "icon", "showIconLeading", "showIcon", "iconTrailing", "showIconTrailing", "size", "width", "variant", "wrap", "noText", "name", "form", "value", "command", "text"], outputs: ["click"] }] }); }
6874
6959
  }
6875
6960
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DBNotification, decorators: [{
6876
6961
  type: Component,
@@ -10606,7 +10691,7 @@ class DBTabs {
10606
10691
  </db-button>
10607
10692
  }
10608
10693
  <ng-content></ng-content>
10609
- </div> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: DBButton, selector: "db-button", inputs: ["type", "id", "propOverrides", "className", "disabled", "iconLeading", "icon", "showIconLeading", "showIcon", "iconTrailing", "showIconTrailing", "size", "width", "variant", "wrap", "noText", "name", "form", "value", "text"], outputs: ["click"] }, { kind: "component", type: DBTabList, selector: "db-tab-list", inputs: ["id", "propOverrides", "className"] }, { kind: "component", type: DBTabItem, selector: "db-tab-item", inputs: ["active", "name", "className", "id", "propOverrides", "iconLeading", "icon", "iconTrailing", "showIconLeading", "showIcon", "showIconTrailing", "noText", "disabled", "checked", "label"], outputs: ["disabledChange", "checkedChange", "change"] }, { kind: "component", type: DBTabPanel, selector: "db-tab-panel", inputs: ["className", "id", "propOverrides", "content"] }] }); }
10694
+ </div> `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: DBButton, selector: "db-button", inputs: ["type", "commandfor", "id", "propOverrides", "className", "disabled", "iconLeading", "icon", "showIconLeading", "showIcon", "iconTrailing", "showIconTrailing", "size", "width", "variant", "wrap", "noText", "name", "form", "value", "command", "text"], outputs: ["click"] }, { kind: "component", type: DBTabList, selector: "db-tab-list", inputs: ["id", "propOverrides", "className"] }, { kind: "component", type: DBTabItem, selector: "db-tab-item", inputs: ["active", "name", "className", "id", "propOverrides", "iconLeading", "icon", "iconTrailing", "showIconLeading", "showIcon", "showIconTrailing", "noText", "disabled", "checked", "label"], outputs: ["disabledChange", "checkedChange", "change"] }, { kind: "component", type: DBTabPanel, selector: "db-tab-panel", inputs: ["className", "id", "propOverrides", "content"] }] }); }
10610
10695
  }
10611
10696
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DBTabs, decorators: [{
10612
10697
  type: Component,