@quadrel-enterprise-ui/framework 20.17.0 → 20.17.1

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
@@ -12973,10 +12973,25 @@ interface QdSectionConfig {
12973
12973
  */
12974
12974
  action?: QdLegacySectionActionConfig;
12975
12975
  /**
12976
- * @description Configures the actions of the section
12976
+ * @description Configures the actions shown on the right of the section toolbar.
12977
12977
  *
12978
- * - **Single Action**: If only one action is defined, a standard QdButton is displayed with an optional specified icon.
12979
- * - **Multiple Actions**: If multiple action types are defined, a QdMenuButton is used, showing each action as a dropdown menu item.
12978
+ * The toolbar has two layouts that depend on the screen width.
12979
+ * "Mobile" means the screen is narrower than 960px (the `md` breakpoint).
12980
+ * "Desktop" means it is 960px or wider.
12981
+ *
12982
+ * **One action:**
12983
+ * - Desktop: a single button showing the label, plus the icon if one is set.
12984
+ * - Mobile: if the action has an icon, the button shrinks to show only that icon.
12985
+ * If it has no icon, the full text button stays visible. The button is never hidden.
12986
+ *
12987
+ * **Two or more actions:**
12988
+ * - Desktop: one menu button that opens a dropdown listing every action. Icons are not shown inside the dropdown.
12989
+ * - Mobile: the same dropdown, but an `addNew` action (if present) is taken out of the dropdown
12990
+ * and shown next to it as a separate compact plus button.
12991
+ *
12992
+ * **The `addNew` action:**
12993
+ * - It uses a plus icon by default. On desktop it shows the plus icon with its label;
12994
+ * on mobile it shrinks to the plus icon only.
12980
12995
  */
12981
12996
  actions?: (QdPredefinedSectionActionConfig | QdSectionActionConfig)[];
12982
12997
  /**
@@ -13050,6 +13065,7 @@ interface QdPredefinedSectionActionConfig {
13050
13065
  *
13051
13066
  * - By default, a plus icon is applied, but this can be overridden by specifying a custom icon.
13052
13067
  * - If left undefined, the `plus` icon will be used.
13068
+ * - Desktop: the button shows the icon next to the label. Mobile (screen narrower than 960px): the button shrinks to show only the icon.
13053
13069
  */
13054
13070
  icon?: string;
13055
13071
  /**
@@ -13131,10 +13147,17 @@ interface QdSectionActionConfig {
13131
13147
  */
13132
13148
  handler: () => void;
13133
13149
  /**
13134
- * @description Defines the icon to display for the action.
13150
+ * @description Defines the icon to display for this action. Leave it empty if no icon is needed.
13135
13151
  *
13136
- * - The icon visually represents the action in the UI.
13137
- * - **Note**: If multiple actions are present, the icon is ignored because the actions are displayed in a dropdown menu (MenuButton).
13152
+ * The icon is only used when this is the **only** action (a single button).
13153
+ * With two or more actions it is ignored, because they are shown in a dropdown menu.
13154
+ *
13155
+ * For a single action:
13156
+ * - Desktop: the button shows the icon next to the label.
13157
+ * - Mobile (screen narrower than 960px): the button shrinks to show only the icon.
13158
+ * If no icon is set, the text button stays visible instead.
13159
+ *
13160
+ * - For a list of available icons, see {@link https://quadrel.ezv.admin.ch/?path=/story/components-icon--icons-set}.
13138
13161
  */
13139
13162
  icon?: string;
13140
13163
  /**
@@ -14545,6 +14568,17 @@ declare class QdSectionToolbarComponent implements AfterViewInit {
14545
14568
  static ɵcmp: i0.ɵɵComponentDeclaration<QdSectionToolbarComponent, "qd-section-toolbar", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, false, never>;
14546
14569
  }
14547
14570
 
14571
+ /**
14572
+ * Renders the configured section actions in the toolbar.
14573
+ *
14574
+ * The presentation is viewport-adaptive, expressed through three streams:
14575
+ * - Below `md` (mobile): one action is shown directly (`singleAction$`); if an
14576
+ * `addNew` action is paired with exactly one other action, that one remaining
14577
+ * action is shown directly as well (`remainingSingleAction$`); any larger set
14578
+ * collapses into a dropdown (`groupedActionsMenu$`).
14579
+ * - At or above `md` (desktop): every action is shown directly, and the dropdown
14580
+ * (`groupedActionsMenu$`) appears only when more than one action exists.
14581
+ */
14548
14582
  declare class QdSectionToolbarActionComponent implements OnInit, OnDestroy {
14549
14583
  private readonly actionService;
14550
14584
  private readonly changeDetectorRef;
@@ -14552,7 +14586,8 @@ declare class QdSectionToolbarActionComponent implements OnInit, OnDestroy {
14552
14586
  private readonly eventBroker;
14553
14587
  set config(config: QdSectionConfig);
14554
14588
  singleAction$: Observable<QdSingleActionConfig | null>;
14555
- multipleActions$: Observable<QdMenuButtonConfig | null>;
14589
+ remainingSingleAction$: Observable<QdSingleActionConfig | null>;
14590
+ groupedActionsMenu$: Observable<QdMenuButtonConfig | null>;
14556
14591
  private _config;
14557
14592
  private readonly _viewonly$;
14558
14593
  private readonly _destroy$;
@@ -14562,7 +14597,8 @@ declare class QdSectionToolbarActionComponent implements OnInit, OnDestroy {
14562
14597
  private initActionStreams;
14563
14598
  private createVisibleActionsStream;
14564
14599
  private createSingleActionStream;
14565
- private createMultipleActionsStream;
14600
+ private createRemainingSingleActionStream;
14601
+ private createGroupedActionsMenuStream;
14566
14602
  private getLabel;
14567
14603
  private executeAction;
14568
14604
  private validateConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quadrel-enterprise-ui/framework",
3
- "version": "20.17.0",
3
+ "version": "20.17.1",
4
4
  "exports": {
5
5
  "./jest-preset": "./jest-preset.js",
6
6
  "./package.json": {