@besaitech/ng-design-system 0.0.80 → 0.0.81

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/index.d.ts CHANGED
@@ -2901,6 +2901,8 @@ declare class SdsSelect implements ControlValueAccessor, OnDestroy {
2901
2901
  private readonly cvaDisabled;
2902
2902
  private readonly trigger;
2903
2903
  private panelEl;
2904
+ /** Body-appending, positioning, follow-on-scroll and teardown — see SdsOverlayPanel. */
2905
+ private readonly overlay;
2904
2906
  protected readonly isDisabled: _angular_core.Signal<boolean>;
2905
2907
  protected readonly filled: _angular_core.Signal<boolean>;
2906
2908
  protected readonly onBrand: _angular_core.Signal<boolean>;
@@ -2946,11 +2948,8 @@ declare class SdsSelect implements ControlValueAccessor, OnDestroy {
2946
2948
  private typeTimer?;
2947
2949
  private typeAhead;
2948
2950
  private scrollHighlightedIntoView;
2949
- private readonly reflow;
2950
- private listening;
2951
- private addReflowListeners;
2952
- private removeReflowListeners;
2953
- private positionPanel;
2951
+ /** Attach once the panel exists — it is rendered inside an `@if`. */
2952
+ private attachPanel;
2954
2953
  protected onDocumentClick(event: MouseEvent): void;
2955
2954
  ngOnDestroy(): void;
2956
2955
  private setValue;
@@ -3060,6 +3059,8 @@ declare class SdsMultiSelect implements ControlValueAccessor, OnDestroy {
3060
3059
  private readonly cvaDisabled;
3061
3060
  private readonly trigger;
3062
3061
  private panelEl;
3062
+ /** Body-appending, positioning, follow-on-scroll and teardown — see SdsOverlayPanel. */
3063
+ private readonly overlay;
3063
3064
  protected readonly isDisabled: _angular_core.Signal<boolean>;
3064
3065
  protected readonly normalizedOptions: _angular_core.Signal<NormOption[]>;
3065
3066
  protected readonly filteredOptions: _angular_core.Signal<NormOption[]>;
@@ -3109,11 +3110,8 @@ declare class SdsMultiSelect implements ControlValueAccessor, OnDestroy {
3109
3110
  private typeTimer?;
3110
3111
  private typeAhead;
3111
3112
  private scrollHighlightedIntoView;
3112
- private readonly reflow;
3113
- private listening;
3114
- private addReflowListeners;
3115
- private removeReflowListeners;
3116
- private positionPanel;
3113
+ /** Attach once the panel exists — it is rendered inside an `@if`. */
3114
+ private attachPanel;
3117
3115
  protected onDocumentClick(event: MouseEvent): void;
3118
3116
  ngOnDestroy(): void;
3119
3117
  private setValue;
@@ -3127,6 +3125,79 @@ declare class SdsMultiSelect implements ControlValueAccessor, OnDestroy {
3127
3125
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsMultiSelect, "sds-multi-select", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "display": { "alias": "display"; "required": false; "isSignal": true; }; "maxSelectedLabels": { "alias": "maxSelectedLabels"; "required": false; "isSignal": true; }; "selectedItemsLabel": { "alias": "selectedItemsLabel"; "required": false; "isSignal": true; }; "showToggleAll": { "alias": "showToggleAll"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "removeLabel": { "alias": "removeLabel"; "required": false; "isSignal": true; }; "clearLabel": { "alias": "clearLabel"; "required": false; "isSignal": true; }; "filterLabel": { "alias": "filterLabel"; "required": false; "isSignal": true; }; "selectAllLabel": { "alias": "selectAllLabel"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; }, ["optionTpl", "emptyTpl", "footerTpl"], never, true, never>;
3128
3126
  }
3129
3127
 
3128
+ /**
3129
+ * Where a floating panel goes, and the plumbing that keeps it there.
3130
+ *
3131
+ * <p><b>Why this exists.</b> Ten components in this library append a panel to `<body>` and position
3132
+ * it against their trigger, and nine of them had their own copy of the same twenty-odd lines. The
3133
+ * copies had already drifted: some clamp the panel inside the viewport vertically and some only
3134
+ * flip it, some match the trigger's width and some do not. Worse, the *lifecycle* was duplicated
3135
+ * too — and `sds-autocomplete` shipped a version that removed the panel through a `viewChild`
3136
+ * already cleared by `ngOnDestroy`, orphaning it in `<body>` for ever. That bug could only exist in
3137
+ * one copy of nine.
3138
+ */
3139
+ type SdsPanelAlign = 'start' | 'end';
3140
+ type SdsPanelDirection = 'below' | 'above';
3141
+ interface SdsPanelOptions {
3142
+ /** Space between trigger and panel. */
3143
+ gap?: number;
3144
+ /** Space kept clear of the viewport edges. */
3145
+ margin?: number;
3146
+ /** Which edge of the panel lines up with the trigger. */
3147
+ align?: SdsPanelAlign;
3148
+ /** Open upwards when there is room, instead of the default "below unless it does not fit". */
3149
+ prefer?: SdsPanelDirection;
3150
+ }
3151
+ interface SdsRect {
3152
+ top: number;
3153
+ bottom: number;
3154
+ left: number;
3155
+ right: number;
3156
+ }
3157
+ interface SdsSize {
3158
+ width: number;
3159
+ height: number;
3160
+ }
3161
+ /**
3162
+ * The arithmetic, with no DOM in it.
3163
+ *
3164
+ * <p>Vertical: below the trigger, flipped above when it does not fit below and fits better above —
3165
+ * then <b>clamped inside the viewport</b>. The clamp is not decoration: without it a panel taller
3166
+ * than the space either side is pushed off the top edge and its first rows become unreachable, and
3167
+ * four of the nine copies were missing it.
3168
+ *
3169
+ * <p>Horizontal: the panel's start (or end) edge meets the trigger's, then clamped the same way. A
3170
+ * panel wider than the viewport pins to the left margin rather than running off both sides.
3171
+ */
3172
+ declare function placePanel(trigger: SdsRect, panel: SdsSize, viewport: SdsSize, options?: SdsPanelOptions): {
3173
+ top: number;
3174
+ left: number;
3175
+ };
3176
+ /**
3177
+ * The DOM half: append to `<body>`, place, follow scroll and resize, and — the part that was worth
3178
+ * centralising — take it all down again exactly once.
3179
+ *
3180
+ * <p>Hold one of these per component and call {@link detach} from `ngOnDestroy`. It keeps its own
3181
+ * reference to the panel element, so it does not depend on a `viewChild` that Angular has already
3182
+ * cleared by the time the component is torn down.
3183
+ */
3184
+ declare class SdsOverlayPanel {
3185
+ private trigger;
3186
+ private panel;
3187
+ private options;
3188
+ private listening;
3189
+ private readonly reflow;
3190
+ /** Attach (or re-attach) the panel to the body and start following the trigger. */
3191
+ attach(trigger: HTMLElement, panel: HTMLElement, options?: SdsPanelOptions & {
3192
+ matchTriggerWidth?: boolean;
3193
+ }): void;
3194
+ reposition(): void;
3195
+ /** Does the panel contain this node? For "did the click land outside" checks. */
3196
+ contains(node: Node | null): boolean;
3197
+ /** Stop following, and remove the panel from the body. Safe to call more than once. */
3198
+ detach(): void;
3199
+ }
3200
+
3130
3201
  /**
3131
3202
  * Where the options come from.
3132
3203
  *
@@ -3229,15 +3300,8 @@ declare class SdsAutocomplete implements ControlValueAccessor, OnDestroy {
3229
3300
  private readonly cvaDisabled;
3230
3301
  /** Every option this control has seen, by value — how a chip keeps its label after a new search. */
3231
3302
  private readonly seen;
3232
- /**
3233
- * A plain reference to the body-appended panel, not just the viewChild.
3234
- *
3235
- * <p>On destroy the viewChild is already cleared — it lives inside an `@if` — so removing through
3236
- * it removes nothing and the panel is orphaned in `<body>` for ever. A test caught it: a leaked
3237
- * panel from one spec was still in the document when the next one queried for its own.
3238
- * `sds-select` keeps the same raw handle, for the same reason.
3239
- */
3240
- private panelEl;
3303
+ /** Body-appending, positioning, follow-on-scroll and teardown all live in here now. */
3304
+ private readonly overlay;
3241
3305
  private timer;
3242
3306
  private seq;
3243
3307
  private destroyed;
@@ -3269,11 +3333,8 @@ declare class SdsAutocomplete implements ControlValueAccessor, OnDestroy {
3269
3333
  protected onKeydown(event: KeyboardEvent): void;
3270
3334
  protected close(): void;
3271
3335
  protected onDocumentClick(event: MouseEvent): void;
3272
- private readonly reflow;
3273
- private listening;
3274
- private addReflow;
3275
- private removeReflow;
3276
- private position;
3336
+ /** Attach once the panel exists in the DOM — it is inside an `@if`. */
3337
+ private place;
3277
3338
  ngOnDestroy(): void;
3278
3339
  private setValue;
3279
3340
  private onChange;
@@ -3422,6 +3483,8 @@ declare class SdsPhoneInput implements ControlValueAccessor, Validator, OnDestro
3422
3483
  private readonly anchor;
3423
3484
  private readonly field;
3424
3485
  private panelEl;
3486
+ /** Body-appending, positioning, follow-on-scroll and teardown — see SdsOverlayPanel. */
3487
+ private readonly overlay;
3425
3488
  protected readonly isDisabled: _angular_core.Signal<boolean>;
3426
3489
  /** Countries after applying [onlyCountries] and [preferredCountries] ordering. */
3427
3490
  protected readonly availableCountries: _angular_core.Signal<SdsPhoneCountry[]>;
@@ -3452,11 +3515,8 @@ declare class SdsPhoneInput implements ControlValueAccessor, Validator, OnDestro
3452
3515
  private handleNavKey;
3453
3516
  private move;
3454
3517
  private scrollHighlightedIntoView;
3455
- private readonly reflow;
3456
- private listening;
3457
- private addReflowListeners;
3458
- private removeReflowListeners;
3459
- private positionPanel;
3518
+ /** Attach once the panel exists — it is rendered inside an `@if`. */
3519
+ private attachPanel;
3460
3520
  protected onDocumentClick(event: MouseEvent): void;
3461
3521
  protected markTouched(): void;
3462
3522
  ngOnDestroy(): void;
@@ -5793,5 +5853,5 @@ declare const SDS_CHART_CONFIG: InjectionToken<SdsChartConfig>;
5793
5853
  */
5794
5854
  declare function provideSdsCharts(config: SdsChartConfig): Provider;
5795
5855
 
5796
- export { SDS_ALLERGENS, SDS_ALLERGEN_ICONS, SDS_ALLERGEN_LABELS_EN, SDS_CHART_CONFIG, SDS_CHART_LABELS_EN, SDS_ICONS, SDS_PHONE_COUNTRIES, SDS_THEME_STORAGE_KEY, SDS_UI_PREF_LANG_PARAM, SDS_UI_PREF_THEME_PARAM, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAddressAutocomplete, SdsAddressExtra, SdsAllergenIcon, SdsAutocomplete, SdsAvatar, SdsBadge, SdsBulkBar, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsChecklistRow, SdsChip, SdsChipGroup, SdsDatePicker, SdsDateRangePicker, SdsEnvBanner, SdsFileDrop, SdsFormActions, SdsIcon, SdsImageCropper, SdsInput, SdsInputNumber, SdsLanguageSwitcher, SdsLocalizedInput, SdsMenu, SdsMenuItem, SdsMenuTrigger, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsRadio, SdsRangeCalendar, SdsScore, SdsSearchCommand, SdsSegmented, SdsSelect, SdsSelectEmpty, SdsSelectFooter, SdsSelectOption, SdsSeverity, SdsShell, SdsSidebar, SdsSortableHandle, SdsSortableItem, SdsSortableList, SdsStatusTile, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableEmpty, SdsTableHeader, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsThemeService, SdsThemeToggle, SdsTimeInput, SdsToastHost, SdsToastService, SdsToggleSwitch, SdsTopbar, SdsTriStateChip, SdsUserMenu, SidebarStore, addDays, addMonths, addMonthsKeepDay, appendUiPrefs, diffInDays, formatDateRange, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isSameRange, isSdsThemeMode, isoDay, pad2, provideSdsCharts, readUiPrefs, sdsFileMatchesAccept, sdsFormatBytes, sdsFormatNational, sdsLastDays, sdsLastMonths, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth, stripUiPrefs };
5797
- export type { SdsAccordionActive, SdsAccordionValue, SdsAddressAutocompleteAppearance, SdsAddressAutocompleteShape, SdsAddressAutocompleteSize, SdsAddressExtraContext, SdsAddressExtraPosition, SdsAddressLocateFn, SdsAddressSearchFn, SdsAddressSuggestion, SdsAllergen, SdsAutocompleteDisplay, SdsAutocompleteSearchFn, SdsAutocompleteSize, SdsAvatarShape, SdsAvatarStatus, SdsBadgeSize, SdsBadgeVariant, SdsBulkBarPosition, SdsButtonShape, SdsButtonSize, SdsButtonVariant, SdsCardVariant, SdsChartConfig, SdsChartLabels, SdsCheckboxSize, SdsChecklistStatus, SdsChipOption, SdsChipSize, SdsCropRect, SdsDatePickerSize, SdsDateRange, SdsDateRangePickerSize, SdsDateRangePreset, SdsEnvBannerEnv, SdsFileDropAppearance, SdsFileRejection, SdsFileRejectionReason, SdsFormActionsPosition, SdsIconName, SdsIconSize, SdsImageCropperBlobOptions, SdsImageCropperShape, SdsInputAppearance, SdsInputNumberAppearance, SdsInputNumberButtonLayout, SdsInputNumberCurrencyDisplay, SdsInputNumberMode, SdsInputNumberSize, SdsInputShape, SdsInputSize, SdsInputType, SdsKpiChangeText, SdsLanguageOption, SdsLanguageSwitcherAlign, SdsLanguageSwitcherAppearance, SdsLanguageSwitcherDirection, SdsLocalizedInputSize, SdsLocalizedValue, SdsMenuAction, SdsMenuAlign, SdsMenuEntry, SdsMenuItemTone, SdsMenuSeparator, SdsMultiSelectDisplay, SdsMultiSelectSize, SdsNavItemBadgeTone, SdsOtpInputSize, SdsPaginatorSize, SdsPaginatorState, SdsPhoneCountry, SdsPhoneInputSize, SdsPhoneValue, SdsRadioSize, SdsScoreSize, SdsScoreTier, SdsScoreVariant, SdsSearchAppearance, SdsSearchItem, SdsSegmentedOption, SdsSegmentedSize, SdsSelectAppearance, SdsSelectEmptyContext, SdsSelectFooterContext, SdsSelectOptionContext, SdsSelectSize, SdsSeverityLevel, SdsSeveritySize, SdsSeverityVariant, SdsShellBackground, SdsSidebarAppearance, SdsSortOrder, SdsSortableAppearance, SdsSortableItemContext, SdsSortableReorderEvent, SdsSparklineSummaryText, SdsStatusTileState, SdsTabValue, SdsTableCellCommitEvent, SdsTableCellContext, SdsTableCellErrors, SdsTableColumn, SdsTableEditTrigger, SdsTableEditor, SdsTableEmptyContext, SdsTableHeaderContext, SdsTableLazyEvent, SdsTableRowExpansionContext, SdsTableSelectOption, SdsTableSize, SdsTableSortEvent, SdsTabsVariant, SdsTextareaAppearance, SdsTextareaResize, SdsTextareaSize, SdsTheme, SdsThemeMode, SdsThemeToggleAppearance, SdsTimeInputAppearance, SdsTimeInputSize, SdsToast, SdsToastKind, SdsToggleSwitchSize, SdsTopbarAppearance, SdsTrendDirection, SdsTriState, SdsTriStateChipSize, SdsUiPrefs, SdsUserMenuAlign, SdsUserMenuAppearance };
5856
+ export { SDS_ALLERGENS, SDS_ALLERGEN_ICONS, SDS_ALLERGEN_LABELS_EN, SDS_CHART_CONFIG, SDS_CHART_LABELS_EN, SDS_ICONS, SDS_PHONE_COUNTRIES, SDS_THEME_STORAGE_KEY, SDS_UI_PREF_LANG_PARAM, SDS_UI_PREF_THEME_PARAM, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAddressAutocomplete, SdsAddressExtra, SdsAllergenIcon, SdsAutocomplete, SdsAvatar, SdsBadge, SdsBulkBar, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsChecklistRow, SdsChip, SdsChipGroup, SdsDatePicker, SdsDateRangePicker, SdsEnvBanner, SdsFileDrop, SdsFormActions, SdsIcon, SdsImageCropper, SdsInput, SdsInputNumber, SdsLanguageSwitcher, SdsLocalizedInput, SdsMenu, SdsMenuItem, SdsMenuTrigger, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsOverlayPanel, SdsPaginator, SdsPhoneInput, SdsRadio, SdsRangeCalendar, SdsScore, SdsSearchCommand, SdsSegmented, SdsSelect, SdsSelectEmpty, SdsSelectFooter, SdsSelectOption, SdsSeverity, SdsShell, SdsSidebar, SdsSortableHandle, SdsSortableItem, SdsSortableList, SdsStatusTile, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableEmpty, SdsTableHeader, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsThemeService, SdsThemeToggle, SdsTimeInput, SdsToastHost, SdsToastService, SdsToggleSwitch, SdsTopbar, SdsTriStateChip, SdsUserMenu, SidebarStore, addDays, addMonths, addMonthsKeepDay, appendUiPrefs, diffInDays, formatDateRange, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isSameRange, isSdsThemeMode, isoDay, pad2, placePanel, provideSdsCharts, readUiPrefs, sdsFileMatchesAccept, sdsFormatBytes, sdsFormatNational, sdsLastDays, sdsLastMonths, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth, stripUiPrefs };
5857
+ export type { SdsAccordionActive, SdsAccordionValue, SdsAddressAutocompleteAppearance, SdsAddressAutocompleteShape, SdsAddressAutocompleteSize, SdsAddressExtraContext, SdsAddressExtraPosition, SdsAddressLocateFn, SdsAddressSearchFn, SdsAddressSuggestion, SdsAllergen, SdsAutocompleteDisplay, SdsAutocompleteSearchFn, SdsAutocompleteSize, SdsAvatarShape, SdsAvatarStatus, SdsBadgeSize, SdsBadgeVariant, SdsBulkBarPosition, SdsButtonShape, SdsButtonSize, SdsButtonVariant, SdsCardVariant, SdsChartConfig, SdsChartLabels, SdsCheckboxSize, SdsChecklistStatus, SdsChipOption, SdsChipSize, SdsCropRect, SdsDatePickerSize, SdsDateRange, SdsDateRangePickerSize, SdsDateRangePreset, SdsEnvBannerEnv, SdsFileDropAppearance, SdsFileRejection, SdsFileRejectionReason, SdsFormActionsPosition, SdsIconName, SdsIconSize, SdsImageCropperBlobOptions, SdsImageCropperShape, SdsInputAppearance, SdsInputNumberAppearance, SdsInputNumberButtonLayout, SdsInputNumberCurrencyDisplay, SdsInputNumberMode, SdsInputNumberSize, SdsInputShape, SdsInputSize, SdsInputType, SdsKpiChangeText, SdsLanguageOption, SdsLanguageSwitcherAlign, SdsLanguageSwitcherAppearance, SdsLanguageSwitcherDirection, SdsLocalizedInputSize, SdsLocalizedValue, SdsMenuAction, SdsMenuAlign, SdsMenuEntry, SdsMenuItemTone, SdsMenuSeparator, SdsMultiSelectDisplay, SdsMultiSelectSize, SdsNavItemBadgeTone, SdsOtpInputSize, SdsPaginatorSize, SdsPaginatorState, SdsPanelAlign, SdsPanelDirection, SdsPanelOptions, SdsPhoneCountry, SdsPhoneInputSize, SdsPhoneValue, SdsRadioSize, SdsRect, SdsScoreSize, SdsScoreTier, SdsScoreVariant, SdsSearchAppearance, SdsSearchItem, SdsSegmentedOption, SdsSegmentedSize, SdsSelectAppearance, SdsSelectEmptyContext, SdsSelectFooterContext, SdsSelectOptionContext, SdsSelectSize, SdsSeverityLevel, SdsSeveritySize, SdsSeverityVariant, SdsShellBackground, SdsSidebarAppearance, SdsSize, SdsSortOrder, SdsSortableAppearance, SdsSortableItemContext, SdsSortableReorderEvent, SdsSparklineSummaryText, SdsStatusTileState, SdsTabValue, SdsTableCellCommitEvent, SdsTableCellContext, SdsTableCellErrors, SdsTableColumn, SdsTableEditTrigger, SdsTableEditor, SdsTableEmptyContext, SdsTableHeaderContext, SdsTableLazyEvent, SdsTableRowExpansionContext, SdsTableSelectOption, SdsTableSize, SdsTableSortEvent, SdsTabsVariant, SdsTextareaAppearance, SdsTextareaResize, SdsTextareaSize, SdsTheme, SdsThemeMode, SdsThemeToggleAppearance, SdsTimeInputAppearance, SdsTimeInputSize, SdsToast, SdsToastKind, SdsToggleSwitchSize, SdsTopbarAppearance, SdsTrendDirection, SdsTriState, SdsTriStateChipSize, SdsUiPrefs, SdsUserMenuAlign, SdsUserMenuAppearance };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besaitech/ng-design-system",
3
- "version": "0.0.80",
3
+ "version": "0.0.81",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"