@genexus/genexus-ide-ui 0.0.22 → 0.0.24

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.
Files changed (144) hide show
  1. package/dist/cjs/ch-action-group_2.cjs.entry.js +211 -0
  2. package/dist/cjs/ch-dropdown-item.cjs.entry.js +36 -5
  3. package/dist/cjs/ch-dropdown.cjs.entry.js +50 -52
  4. package/dist/cjs/{ch-grid_4.cjs.entry.js → ch-grid_8.cjs.entry.js} +143 -0
  5. package/dist/cjs/{ch-suggest_5.cjs.entry.js → ch-suggest_4.cjs.entry.js} +0 -65
  6. package/dist/cjs/ch-test-action-group.cjs.entry.js +79 -0
  7. package/dist/cjs/ch-test-dropdown.cjs.entry.js +54 -0
  8. package/dist/cjs/ch-window_2.cjs.entry.js +25 -6
  9. package/dist/cjs/format-date-f2c49d1a.js +28 -0
  10. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  11. package/dist/cjs/gx-ide-team-dev-commit.cjs.entry.js +15 -35
  12. package/dist/cjs/gx-ide-team-dev-select-recent-comment.cjs.entry.js +5 -15
  13. package/dist/cjs/gx-ide-team-dev-update-partial-selection.cjs.entry.js +102 -0
  14. package/dist/cjs/gx-ide-team-dev-update-to-revision.cjs.entry.js +53 -0
  15. package/dist/cjs/gx-ide-team-dev-update.cjs.entry.js +278 -0
  16. package/dist/cjs/gx-ide-top-bar.cjs.entry.js +37 -0
  17. package/dist/cjs/{gxg-combo-box_8.cjs.entry.js → gxg-combo-box_6.cjs.entry.js} +0 -132
  18. package/dist/cjs/gxg-form-checkbox-group_2.cjs.entry.js +140 -0
  19. package/dist/cjs/{gx-ide-top-bar_2.cjs.entry.js → gxg-form-radio-group.cjs.entry.js} +0 -31
  20. package/dist/cjs/gxg-text.cjs.entry.js +72 -0
  21. package/dist/cjs/loader.cjs.js +1 -1
  22. package/dist/collection/collection-manifest.json +7 -0
  23. package/dist/collection/common/format-date.js +11 -0
  24. package/dist/collection/components/team-dev-commit/gx-ide-assets/team-dev-commit/langs/team-dev-commit.lang.en.json +1 -1
  25. package/dist/collection/components/team-dev-commit/team-dev-commit.js +35 -26
  26. package/dist/collection/components/team-dev-select-recent-comment/team-dev-select-recent-comment.js +6 -16
  27. package/dist/collection/components/team-dev-update/gx-ide-assets/team-dev-update/langs/team-dev-update.lang.en.json +45 -0
  28. package/dist/collection/components/team-dev-update/gx-ide-assets/team-dev-update/langs/team-dev-update.lang.ja.json +3 -0
  29. package/dist/collection/components/team-dev-update/gx-ide-assets/team-dev-update/langs/team-dev-update.lang.zh.json +3 -0
  30. package/dist/collection/components/team-dev-update/team-dev-update.css +216 -0
  31. package/dist/collection/components/team-dev-update/team-dev-update.js +524 -0
  32. package/dist/collection/components/team-dev-update-partial-selection/gx-ide-assets/team-dev-update-partial-selection/langs/team-dev-update-partial-selection.lang.en.json +15 -0
  33. package/dist/collection/components/team-dev-update-partial-selection/gx-ide-assets/team-dev-update-partial-selection/langs/team-dev-update-partial-selection.lang.ja.json +3 -0
  34. package/dist/collection/components/team-dev-update-partial-selection/gx-ide-assets/team-dev-update-partial-selection/langs/team-dev-update-partial-selection.lang.zh.json +3 -0
  35. package/dist/collection/components/team-dev-update-partial-selection/team-dev-update-partial-selection.css +149 -0
  36. package/dist/collection/components/team-dev-update-partial-selection/team-dev-update-partial-selection.js +238 -0
  37. package/dist/collection/components/team-dev-update-to-revision/gx-ide-assets/team-dev-update-to-revision/langs/team-dev-update-to-revision.lang.en.json +11 -0
  38. package/dist/collection/components/team-dev-update-to-revision/gx-ide-assets/team-dev-update-to-revision/langs/team-dev-update-to-revision.lang.ja.json +3 -0
  39. package/dist/collection/components/team-dev-update-to-revision/gx-ide-assets/team-dev-update-to-revision/langs/team-dev-update-to-revision.lang.zh.json +3 -0
  40. package/dist/collection/components/team-dev-update-to-revision/team-dev-update-to-revision.css +147 -0
  41. package/dist/collection/components/team-dev-update-to-revision/team-dev-update-to-revision.js +136 -0
  42. package/dist/components/action-group-item.js +54 -0
  43. package/dist/components/action-group.js +214 -0
  44. package/dist/components/ch-action-group-item.js +6 -0
  45. package/dist/components/ch-action-group.js +6 -0
  46. package/dist/components/ch-dropdown-item-separator.js +1 -28
  47. package/dist/components/ch-dropdown-item.js +1 -53
  48. package/dist/components/ch-dropdown.js +1 -284
  49. package/dist/components/ch-grid-rowset-empty.js +1 -24
  50. package/dist/components/ch-grid-rowset-empty2.js +26 -0
  51. package/dist/components/ch-test-action-group.js +137 -0
  52. package/dist/components/ch-test-dropdown.js +104 -0
  53. package/dist/components/ch-window2.js +25 -6
  54. package/dist/components/dropdown-item-separator.js +30 -0
  55. package/dist/components/dropdown-item.js +109 -0
  56. package/dist/components/dropdown.js +294 -0
  57. package/dist/components/format-date.js +25 -0
  58. package/dist/components/gx-ide-team-dev-commit.js +16 -35
  59. package/dist/components/gx-ide-team-dev-select-recent-comment.js +5 -15
  60. package/dist/components/gx-ide-team-dev-update-partial-selection.d.ts +11 -0
  61. package/dist/components/gx-ide-team-dev-update-partial-selection.js +213 -0
  62. package/dist/components/gx-ide-team-dev-update-to-revision.d.ts +11 -0
  63. package/dist/components/gx-ide-team-dev-update-to-revision.js +131 -0
  64. package/dist/components/gx-ide-team-dev-update.d.ts +11 -0
  65. package/dist/components/gx-ide-team-dev-update.js +473 -0
  66. package/dist/components/index.d.ts +3 -0
  67. package/dist/components/index.js +7 -0
  68. package/dist/esm/ch-action-group_2.entry.js +206 -0
  69. package/dist/esm/ch-dropdown-item.entry.js +36 -5
  70. package/dist/esm/ch-dropdown.entry.js +50 -52
  71. package/dist/esm/{ch-grid_4.entry.js → ch-grid_8.entry.js} +140 -1
  72. package/dist/esm/{ch-suggest_5.entry.js → ch-suggest_4.entry.js} +1 -65
  73. package/dist/esm/ch-test-action-group.entry.js +75 -0
  74. package/dist/esm/ch-test-dropdown.entry.js +50 -0
  75. package/dist/esm/ch-window_2.entry.js +25 -6
  76. package/dist/esm/format-date-e9ca0786.js +25 -0
  77. package/dist/esm/genexus-ide-ui.js +1 -1
  78. package/dist/esm/gx-ide-team-dev-commit.entry.js +15 -35
  79. package/dist/esm/gx-ide-team-dev-select-recent-comment.entry.js +5 -15
  80. package/dist/esm/gx-ide-team-dev-update-partial-selection.entry.js +98 -0
  81. package/dist/esm/gx-ide-team-dev-update-to-revision.entry.js +49 -0
  82. package/dist/esm/gx-ide-team-dev-update.entry.js +274 -0
  83. package/dist/esm/gx-ide-top-bar.entry.js +33 -0
  84. package/dist/esm/{gxg-combo-box_8.entry.js → gxg-combo-box_6.entry.js} +2 -132
  85. package/dist/esm/gxg-form-checkbox-group_2.entry.js +135 -0
  86. package/dist/esm/{gx-ide-top-bar_2.entry.js → gxg-form-radio-group.entry.js} +2 -32
  87. package/dist/esm/gxg-text.entry.js +68 -0
  88. package/dist/esm/loader.js +1 -1
  89. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  90. package/dist/genexus-ide-ui/gx-ide-assets/team-dev-commit/langs/team-dev-commit.lang.en.json +1 -1
  91. package/dist/genexus-ide-ui/gx-ide-assets/team-dev-update/langs/team-dev-update.lang.en.json +45 -0
  92. package/dist/genexus-ide-ui/gx-ide-assets/team-dev-update/langs/team-dev-update.lang.ja.json +3 -0
  93. package/dist/genexus-ide-ui/gx-ide-assets/team-dev-update/langs/team-dev-update.lang.zh.json +3 -0
  94. package/dist/genexus-ide-ui/gx-ide-assets/team-dev-update-partial-selection/langs/team-dev-update-partial-selection.lang.en.json +15 -0
  95. package/dist/genexus-ide-ui/gx-ide-assets/team-dev-update-partial-selection/langs/team-dev-update-partial-selection.lang.ja.json +3 -0
  96. package/dist/genexus-ide-ui/gx-ide-assets/team-dev-update-partial-selection/langs/team-dev-update-partial-selection.lang.zh.json +3 -0
  97. package/dist/genexus-ide-ui/gx-ide-assets/team-dev-update-to-revision/langs/team-dev-update-to-revision.lang.en.json +11 -0
  98. package/dist/genexus-ide-ui/gx-ide-assets/team-dev-update-to-revision/langs/team-dev-update-to-revision.lang.ja.json +3 -0
  99. package/dist/genexus-ide-ui/gx-ide-assets/team-dev-update-to-revision/langs/team-dev-update-to-revision.lang.zh.json +3 -0
  100. package/dist/genexus-ide-ui/p-097a3eeb.entry.js +1 -0
  101. package/dist/genexus-ide-ui/p-16bd5578.entry.js +1 -0
  102. package/dist/genexus-ide-ui/p-32b8abf6.entry.js +1 -0
  103. package/dist/genexus-ide-ui/p-3bdcb73b.entry.js +1 -0
  104. package/dist/genexus-ide-ui/p-4bbe1c18.entry.js +1 -0
  105. package/dist/genexus-ide-ui/p-53d36ef7.entry.js +1 -0
  106. package/dist/genexus-ide-ui/p-5884a014.entry.js +1 -0
  107. package/dist/genexus-ide-ui/p-5c64c57f.entry.js +1 -0
  108. package/dist/genexus-ide-ui/p-5ff04ebe.entry.js +1 -0
  109. package/dist/genexus-ide-ui/p-6e80380b.entry.js +1 -0
  110. package/dist/genexus-ide-ui/p-718759e7.entry.js +1 -0
  111. package/dist/genexus-ide-ui/p-72303355.js +1 -0
  112. package/dist/genexus-ide-ui/p-757f8567.entry.js +1 -0
  113. package/dist/genexus-ide-ui/p-9c82381c.entry.js +1 -0
  114. package/dist/genexus-ide-ui/p-a0e85c2a.entry.js +1 -0
  115. package/dist/genexus-ide-ui/p-afe9515e.entry.js +1 -0
  116. package/dist/genexus-ide-ui/p-dbebb1a0.entry.js +1 -0
  117. package/dist/genexus-ide-ui/p-f8561da6.entry.js +1 -0
  118. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/action-group/action-group.css +48 -0
  119. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/action-group-item/action-group-item.css +4 -0
  120. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/dropdown/dropdown.css +32 -88
  121. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/dropdown-item/dropdown-item.css +9 -22
  122. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/test/test-action-group/test-action-group.css +52 -0
  123. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/test/test-dropdown/test-dropdown.css +36 -0
  124. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/window/ch-window.css +3 -1
  125. package/dist/types/common/format-date.d.ts +1 -0
  126. package/dist/types/common/types.d.ts +1 -0
  127. package/dist/types/components/team-dev-commit/team-dev-commit.d.ts +13 -7
  128. package/dist/types/components/team-dev-select-recent-comment/team-dev-select-recent-comment.d.ts +1 -31
  129. package/dist/types/components/team-dev-update/team-dev-update.d.ts +173 -0
  130. package/dist/types/components/team-dev-update-partial-selection/team-dev-update-partial-selection.d.ts +61 -0
  131. package/dist/types/components/team-dev-update-to-revision/team-dev-update-to-revision.d.ts +41 -0
  132. package/dist/types/components.d.ts +216 -2
  133. package/package.json +3 -3
  134. package/dist/cjs/ch-grid-column-resize_4.cjs.entry.js +0 -150
  135. package/dist/esm/ch-grid-column-resize_4.entry.js +0 -143
  136. package/dist/genexus-ide-ui/p-04f094d1.entry.js +0 -1
  137. package/dist/genexus-ide-ui/p-192f1342.entry.js +0 -1
  138. package/dist/genexus-ide-ui/p-54cef7ae.entry.js +0 -1
  139. package/dist/genexus-ide-ui/p-554ed73a.entry.js +0 -1
  140. package/dist/genexus-ide-ui/p-6d378d61.entry.js +0 -1
  141. package/dist/genexus-ide-ui/p-b26b5d74.entry.js +0 -1
  142. package/dist/genexus-ide-ui/p-c10d5f34.entry.js +0 -1
  143. package/dist/genexus-ide-ui/p-d5c29251.entry.js +0 -1
  144. package/dist/genexus-ide-ui/p-f1a3397d.entry.js +0 -1
@@ -0,0 +1,211 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-5a32426a.js');
6
+
7
+ const actionGroupCss = "*,::after,::before{box-sizing:border-box}:host{display:grid;position:relative;width:100%;grid-template:\"more-actions actions\" 1fr/min-content 1fr;overflow:hidden}.more-actions{grid-area:more-actions}.more-actions::part(expandable-button){width:1.375em;height:1.375em}.more-actions::part(expandable-button)::before{content:\"\";width:100%;height:100%;background-color:currentColor;-webkit-mask:url('data:image/svg+xml,<svg viewBox=\"0 0 25 25\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.26837 10.5625C4.16837 10.5625 3.26837 11.4625 3.26837 12.5625C3.26837 13.6625 4.16837 14.5625 5.26837 14.5625C6.36837 14.5625 7.26837 13.6625 7.26837 12.5625C7.26837 11.4625 6.36837 10.5625 5.26837 10.5625ZM19.2684 10.5625C18.1684 10.5625 17.2684 11.4625 17.2684 12.5625C17.2684 13.6625 18.1684 14.5625 19.2684 14.5625C20.3684 14.5625 21.2684 13.6625 21.2684 12.5625C21.2684 11.4625 20.3684 10.5625 19.2684 10.5625ZM12.2684 10.5625C11.1684 10.5625 10.2684 11.4625 10.2684 12.5625C10.2684 13.6625 11.1684 14.5625 12.2684 14.5625C13.3684 14.5625 14.2684 13.6625 14.2684 12.5625C14.2684 11.4625 13.3684 10.5625 12.2684 10.5625Z\"/></svg>') 50% 50%/1.25em 1.25em no-repeat}.actions{grid-area:actions;display:grid;grid-auto-flow:column;grid-auto-columns:max-content;width:100%;max-width:100%}.actions--responsive{position:absolute;inset:0}.actions--scroll{overflow-x:auto}.actions--multiline{display:flex;flex-wrap:wrap}";
8
+
9
+ const FLOATING_POINT_ERROR = 1;
10
+ const ChActionGroup = class {
11
+ constructor(hostRef) {
12
+ index.registerInstance(this, hostRef);
13
+ this.displayedItemsCountChange = index.createEvent(this, "displayedItemsCountChange", 7);
14
+ this.needForRAF = true; // To prevent redundant RAF (request animation frame) calls
15
+ this.totalItems = -1;
16
+ /**
17
+ * The visible actions when `itemsOverflowBehavior === "ResponsiveCollapse"`.
18
+ */
19
+ this.displayedItems = -1;
20
+ /**
21
+ * This attribute lets you specify the label for the more actions button.
22
+ * Important for accessibility.
23
+ */
24
+ this.buttonLabel = "More actions";
25
+ /**
26
+ * This attribute determines how items behave when the content of the ActionGroup overflows horizontal. This property is needed
27
+ * to make the control responsive to changes in the Width of the container of ActionGroup.
28
+ *
29
+ * | Value | Details |
30
+ * | --------------------- | ------------------------------------------------------------------------------------------------ |
31
+ * | `Add Scroll` | The items of the ActionGroup that overflow horizontally are shown by means of a scroll. |
32
+ * | `Multiline` | The ActionGroup items that overflow horizontally are shown in a second line of the control. |
33
+ * | `Responsive Collapse` | The Action Group items, when they start to overflow the control, are placed in the More Actions. |
34
+ */
35
+ this.itemsOverflowBehavior = "ResponsiveCollapse";
36
+ /**
37
+ * Determine which mouse actions on the expandable button display the dropdown
38
+ * section.
39
+ */
40
+ this.expandBehavior = "ClickOrHover";
41
+ /**
42
+ * @todo Check a better convention for this property, for example, "ActionsInlineAlignment"
43
+ * This attribute determines the position of the More Actions button in the Action Group.
44
+ *
45
+ * | Value | Details |
46
+ * | --------| --------------------------------------------------------------------- |
47
+ * | `Start` | The More Actions Button is displayed to the left of the ActionGroup. |
48
+ * | `End` | The More Actions Button is displayed to the right of the ActionGroup. |
49
+ */
50
+ this.moreActionsButtonPosition = "Start";
51
+ /**
52
+ * Specifies the position of the dropdown section that is placed relative to
53
+ * the more actions button.
54
+ */
55
+ this.moreActionsDropdownPosition = "InsideStart_OutsideEnd";
56
+ /**
57
+ * Determine if the dropdowns should be opened when the action is focused.
58
+ */
59
+ this.openOnFocus = false;
60
+ /**
61
+ * Update the visibility of the actions.
62
+ * Only works if itemsOverflowBehavior === "ResponsiveCollapse"
63
+ */
64
+ this.updateDisplayedActions = () => {
65
+ const actionGroupItems = this.slotItems.assignedElements();
66
+ // The column-gap property must be taken into account
67
+ const columnGap = getComputedStyle(this.actionsContainer).columnGap;
68
+ const columnGapValue = columnGap != null && columnGap.endsWith("px")
69
+ ? Number(columnGap.replace("px", ""))
70
+ : 0;
71
+ // Since the last item does not add column-gap, we have to adjust the measurement
72
+ let availableWidth = this.actionsContainer.clientWidth + columnGapValue - FLOATING_POINT_ERROR;
73
+ let displayedItems = 0;
74
+ // Check which items are visible
75
+ actionGroupItems.forEach(action => {
76
+ const actionWidth = action.clientWidth;
77
+ availableWidth -= actionWidth + columnGapValue;
78
+ if (availableWidth >= 0) {
79
+ action.floating = false;
80
+ displayedItems++;
81
+ }
82
+ else {
83
+ action.floating = true;
84
+ }
85
+ });
86
+ this.totalItems = actionGroupItems.length;
87
+ this.displayedItems = displayedItems;
88
+ this.displayedItemsCountChange.emit(displayedItems);
89
+ };
90
+ this.updateDisplayedActionInFrame = () => {
91
+ if (!this.needForRAF) {
92
+ return;
93
+ }
94
+ this.needForRAF = false; // No need to call RAF up until next frame
95
+ requestAnimationFrame(() => {
96
+ this.needForRAF = true; // RAF now consumes the movement instruction so a new one can come
97
+ this.updateDisplayedActions();
98
+ });
99
+ };
100
+ this.updateActionsWatcher = () => {
101
+ if (this.itemsOverflowBehavior !== "ResponsiveCollapse") {
102
+ return;
103
+ }
104
+ // Avoid memory leaks by disconnecting and re-connecting the observer
105
+ this.disconnectActionsObserver();
106
+ this.connectActionsObserver();
107
+ };
108
+ }
109
+ handleOverflowBehaviorChange(newValue) {
110
+ if (newValue !== "ResponsiveCollapse") {
111
+ const actionGroupItems = this.slotItems.assignedElements();
112
+ // Reset floating
113
+ actionGroupItems.forEach(item => {
114
+ item.floating = false;
115
+ });
116
+ }
117
+ this.setResponsiveCollapse();
118
+ }
119
+ connectActionsObserver() {
120
+ this.actionsWatcher = new ResizeObserver(this.updateDisplayedActionInFrame);
121
+ // Observe the actions
122
+ const actionGroupItems = this.slotItems.assignedElements();
123
+ actionGroupItems.forEach(action => {
124
+ this.actionsWatcher.observe(action);
125
+ });
126
+ }
127
+ connectActionsContainerObserver() {
128
+ this.actionsContainerWatcher = new ResizeObserver(this.updateDisplayedActionInFrame);
129
+ this.actionsContainerWatcher.observe(this.el);
130
+ }
131
+ disconnectActionsObserver() {
132
+ if (this.actionsWatcher) {
133
+ this.actionsWatcher.disconnect();
134
+ this.actionsWatcher = null;
135
+ }
136
+ }
137
+ disconnectActionsContainerObserver() {
138
+ if (this.actionsContainerWatcher) {
139
+ this.actionsContainerWatcher.disconnect();
140
+ this.actionsContainerWatcher = null;
141
+ }
142
+ }
143
+ setResponsiveCollapse() {
144
+ this.disconnectActionsObserver();
145
+ this.disconnectActionsContainerObserver();
146
+ if (this.itemsOverflowBehavior !== "ResponsiveCollapse") {
147
+ return;
148
+ }
149
+ this.connectActionsObserver();
150
+ this.connectActionsContainerObserver();
151
+ }
152
+ componentDidLoad() {
153
+ this.setResponsiveCollapse();
154
+ }
155
+ disconnectedCallback() {
156
+ this.disconnectActionsObserver();
157
+ this.disconnectActionsContainerObserver();
158
+ }
159
+ render() {
160
+ // @todo TODO: Improve accessibility and keyboard navigation
161
+ return (index.h(index.Host, { role: "menubar", "aria-label": this.accessibleName }, this.itemsOverflowBehavior === "ResponsiveCollapse" &&
162
+ this.totalItems !== this.displayedItems && (index.h("ch-dropdown", { exportparts: "expandable-button:more-actions-button,separation:more-actions-separation,list:more-actions-list,section:more-actions-section,mask:more-actions-mask", buttonLabel: this.buttonLabel, class: "more-actions", part: "more-actions", expandBehavior: this.expandBehavior, openOnFocus: this.openOnFocus, position: this.moreActionsDropdownPosition }, index.h("slot", { name: "more-items", slot: "items" }))), index.h("div", { class: {
163
+ actions: true,
164
+ "actions--scroll": this.itemsOverflowBehavior === "AddScroll",
165
+ "actions--multiline": this.itemsOverflowBehavior === "Multiline",
166
+ "actions--responsive": this.itemsOverflowBehavior === "ResponsiveCollapse"
167
+ }, part: "actions", ref: el => (this.actionsContainer = el) }, index.h("slot", { name: "items", onSlotchange: this.updateActionsWatcher, ref: el => (this.slotItems = el) }))));
168
+ }
169
+ get el() { return index.getElement(this); }
170
+ static get watchers() { return {
171
+ "itemsOverflowBehavior": ["handleOverflowBehaviorChange"]
172
+ }; }
173
+ };
174
+ ChActionGroup.style = actionGroupCss;
175
+
176
+ const actionGroupItemCss = "ch-action-group-item[floating]{position:absolute;visibility:hidden}";
177
+
178
+ const ChActionGroupItem = class {
179
+ constructor(hostRef) {
180
+ index.registerInstance(this, hostRef);
181
+ /**
182
+ * `true` to ignore the floating property value.
183
+ */
184
+ this.avoidFloating = false;
185
+ /**
186
+ * `true` if the control is floating. Useful to implement the
187
+ * `"ResponsiveCollapse"` value for the `itemsOverflowBehavior` property of
188
+ * the ch-action-group control.
189
+ */
190
+ this.floating = false;
191
+ }
192
+ componentWillLoad() {
193
+ if (this.avoidFloating) {
194
+ return;
195
+ }
196
+ const parentAction = this.el.closest("ch-action-group");
197
+ // Hide items at the start to improve CLS
198
+ if (parentAction) {
199
+ this.floating =
200
+ parentAction.itemsOverflowBehavior === "ResponsiveCollapse";
201
+ }
202
+ }
203
+ render() {
204
+ return index.h("slot", null);
205
+ }
206
+ get el() { return index.getElement(this); }
207
+ };
208
+ ChActionGroupItem.style = actionGroupItemCss;
209
+
210
+ exports.ch_action_group = ChActionGroup;
211
+ exports.ch_action_group_item = ChActionGroupItem;
@@ -4,18 +4,46 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5a32426a.js');
6
6
 
7
- const dropdownItemCss = ":where(a,button){all:unset}*,::before,::after{box-sizing:border-box}@media (prefers-color-scheme: light){.action:focus,.action:hover{background-color:#ccc}.action:active{background-color:#e9e9e9}}@media (prefers-color-scheme: dark){.action:focus,.action:hover{background-color:#3e3e40}.action:active{background-color:#575965}}:host{display:flex;width:100%;height:100%}.action{display:flex;align-items:center;column-gap:8px;width:100%;height:100%;cursor:pointer;padding-block:8px;padding-inline:16px;font-size:0.875em;text-align:start;transition-property:background-color, border-color, box-shadow, color, filter, opacity;transition-duration:250ms}.left-img,.right-img{display:block;width:24px;height:24px;min-width:24px}.content{width:100%}";
7
+ const dropdownItemCss = ":where(a,button){all:unset}*,::before,::after{box-sizing:border-box}:host{display:flex;width:100%;height:100%}:host([force-containing-block]){transform:translateX(0);--ch-window-relative-position:true}.action{display:flex;align-items:center;width:100%;height:100%;cursor:pointer;text-align:start}.left-img,.right-img{display:block;width:24px;height:24px;min-width:24px}.content{width:100%}.dummy-wrapper{display:contents}";
8
8
 
9
+ const DROPDOWN_ITEM = "ch-dropdown-item";
9
10
  const ChDropDownItem = class {
10
11
  constructor(hostRef) {
11
12
  index.registerInstance(this, hostRef);
12
13
  this.actionClick = index.createEvent(this, "actionClick", 7);
13
14
  this.focusChange = index.createEvent(this, "focusChange", 7);
15
+ this.hasItems = false;
16
+ /**
17
+ * Determine which actions on the expandable button display the dropdown
18
+ * section.
19
+ * Only works if the control has subitems.
20
+ */
21
+ this.expandBehavior = "ClickOrHover";
22
+ /**
23
+ * `true` to force the control to make its own containing block.
24
+ */
25
+ this.forceContainingBlock = true;
26
+ /**
27
+ * Determine if the dropdown section should be opened when the expandable
28
+ * button of the control is focused.
29
+ * Only works if the control has subitems.
30
+ */
31
+ this.openOnFocus = false;
32
+ /**
33
+ * Specifies the position of the dropdown section that is placed relative to
34
+ * the expandable button.
35
+ */
36
+ this.position = "Center_OutsideEnd";
14
37
  this.dropDownItemContent = () => [
15
- !!this.leftImgSrc && (index.h("img", { "aria-hidden": "true", class: "left-img", part: "dropdown-item__left-img", alt: "", src: this.leftImgSrc, loading: "lazy" })),
16
- index.h("span", { class: "content", part: "dropdown-item__content" }, index.h("slot", null)),
17
- !!this.rightImgSrc && (index.h("img", { "aria-hidden": "true", class: "right-img", part: "dropdown-item__right-img", alt: "", src: this.rightImgSrc, loading: "lazy" }))
38
+ !!this.leftImgSrc && (index.h("img", { "aria-hidden": "true", class: "left-img", part: "left-img", alt: "", src: this.leftImgSrc, loading: "lazy" })),
39
+ index.h("span", { class: "content", part: "content" }, index.h("slot", null)),
40
+ !!this.rightImgSrc && (index.h("img", { "aria-hidden": "true", class: "right-img", part: "right-img", alt: "", src: this.rightImgSrc, loading: "lazy" }))
18
41
  ];
42
+ this.checkItems = () => {
43
+ this.hasItems = !!this.element.querySelector(`:scope>${DROPDOWN_ITEM}`);
44
+ };
45
+ this.noItemsRender = () => this.href ? (index.h("a", { class: "action", part: "action target", href: this.href, onClick: this.handleActionClick, onFocus: this.handleFocus, ref: el => (this.mainElement = el) }, this.dropDownItemContent(), index.h("slot", { name: "items", onSlotchange: this.checkItems }))) : (index.h("button", { class: "action", part: "action button", type: "button", onClick: this.handleActionClick, onFocus: this.handleFocus, ref: el => (this.mainElement = el) }, this.dropDownItemContent(), index.h("slot", { name: "items", onSlotchange: this.checkItems })));
46
+ this.itemsRender = () => (index.h("ch-dropdown", { class: "action", exportparts: "expandable-button:action,expandable-button:button,expandable-button:expandable-action,separation,list,section,mask,header,footer,window", expandBehavior: this.expandBehavior, nestedDropdown: true, openOnFocus: this.openOnFocus, position: this.position }, index.h("div", { class: "dummy-wrapper", slot: "action" }, this.dropDownItemContent()), index.h("slot", { name: "items", slot: "items", onSlotchange: this.checkItems })));
19
47
  this.handleActionClick = () => {
20
48
  this.actionClick.emit(this.element.id);
21
49
  };
@@ -29,8 +57,11 @@ const ChDropDownItem = class {
29
57
  async handleFocusElement() {
30
58
  this.mainElement.focus();
31
59
  }
60
+ componentWillLoad() {
61
+ this.checkItems();
62
+ }
32
63
  render() {
33
- return (index.h(index.Host, { role: "listitem" }, this.href ? (index.h("a", { class: "action", part: "dropdown-item__target", href: this.href, onClick: this.handleActionClick, onFocus: this.handleFocus, ref: el => (this.mainElement = el) }, this.dropDownItemContent())) : (index.h("button", { class: "action", part: "dropdown-item__button", type: "button", onClick: this.handleActionClick, onFocus: this.handleFocus, ref: el => (this.mainElement = el) }, this.dropDownItemContent()))));
64
+ return (index.h(index.Host, { role: "listitem" }, this.hasItems ? this.itemsRender() : this.noItemsRender()));
34
65
  }
35
66
  get element() { return index.getElement(this); }
36
67
  };
@@ -4,8 +4,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5a32426a.js');
6
6
 
7
- const dropdownCss = ":where(button){all:unset}*,::before,::after{box-sizing:border-box}@media (prefers-color-scheme: light){.section{background-color:#fbfbfb;color:#000}}@media (prefers-color-scheme: dark){.section{background-color:#242426;color:#e9e9e9}}:host{--ch-dropdown-rtl-initial-X:1;--ch-dropdown-translateX:0;--ch-dropdown-translateY:0;display:flex;position:relative;width:100%;height:100%}.expandable-button{display:flex;position:relative;width:100%;height:100%;cursor:pointer;z-index:108}.expandable-button:focus-within{box-shadow:0px 0px 0 1px currentColor;transition:box-shadow 250ms}.dummy-separation{display:flex;position:absolute;z-index:107}.dummy-separation--vertical{width:100%;height:var(--separation-between-button-size)}.dummy-separation--top{inset-block-start:var(--separation-between-button)}.dummy-separation--bottom{inset-block-end:var(--separation-between-button)}.dummy-separation--horizontal{width:var(--separation-between-button-size);height:100%}.dummy-separation--left{inset-inline-start:var(--separation-between-button)}.dummy-separation--right{inset-inline-end:var(--separation-between-button)}.section{position:absolute;border-radius:5px;box-shadow:0 3px 4px #80808024, 0 3px 3px -2px #8080801f, 0 1px 8px #80808030;width:max-content;max-width:350px;z-index:107}.header+.list,.list+.footer{margin-block-start:8px}.list{display:flex;flex-direction:column;gap:4px}.position--top{inset-block-start:var(--separation-between-button);transform:translate(var(--ch-dropdown-translateX), -100%)}.position--right{inset-inline-end:var(--separation-between-button);transform:translate(calc(100% * var(--ch-dropdown-rtl-initial-X)), var(--ch-dropdown-translateY))}.position--bottom{inset-block-end:var(--separation-between-button);transform:translate(var(--ch-dropdown-translateX), 100%)}.position--left{inset-inline-start:var(--separation-between-button);transform:translate(calc(-100% * var(--ch-dropdown-rtl-initial-X)), var(--ch-dropdown-translateY))}.align--left{inset-inline-start:0}.align--center{inset-inline-start:50%;--ch-dropdown-translateX:calc(-50% * var(--ch-dropdown-rtl-initial-X))}.align--right{inset-inline-end:0}.valign--top{inset-block-start:0}.valign--middle{inset-block-start:50%;--ch-dropdown-translateY:calc(-50% * var(--ch-dropdown-rtl-initial-X))}.valign--bottom{inset-block-end:0}";
7
+ const dropdownCss = ":where(button){all:unset}*,::before,::after{box-sizing:border-box}:host{--separation:0px;--separation-x:var(--separation);--separation-y:var(--separation);display:flex;position:relative;width:100%;height:100%}.expandable-button{display:flex;align-items:center;justify-content:center;position:relative;width:100%;height:100%;cursor:pointer;z-index:108}.expandable-button:focus-within{transition:box-shadow 250ms}::slotted([slot=action]){pointer-events:none}.separation{display:flex;position:absolute;z-index:107}.separation--y{width:100%;height:var(--separation-y)}.separation--y-outside-start{inset-block-start:calc(var(--separation-y) * -1)}.separation--y-outside-start+ch-window{--ch-window-offset-y:calc(var(--separation-y) * -1)}.separation--y-outside-end{inset-block-end:calc(var(--separation-y) * -1)}.separation--y-outside-end+ch-window{--ch-window-offset-y:var(--separation-y)}.separation--x{width:var(--separation-x);height:100%}.separation--x-outside-start{inset-inline-start:calc(var(--separation-x) * -1)}.separation--x-outside-start+ch-window{--ch-window-offset-x:calc(var(--separation-x) * -1)}.separation--x-outside-end{inset-inline-end:calc(var(--separation-x) * -1)}.separation--x-outside-end+ch-window{--ch-window-offset-x:var(--separation-x)}.list{display:flex;flex-direction:column}";
8
8
 
9
+ const mapDropdownAlignToChWindowAlign = {
10
+ OutsideStart: "outside-start",
11
+ InsideStart: "inside-start",
12
+ Center: "center",
13
+ InsideEnd: "inside-end",
14
+ OutsideEnd: "outside-end"
15
+ };
9
16
  const EXPANDABLE_BUTTON_ID = "expandable-button";
10
17
  const SECTION_ID = "section";
11
18
  const DROPDOWN_ITEM_TAG_NAME = "ch-dropdown-item";
@@ -50,11 +57,6 @@ const ChDropDown = class {
50
57
  this.showFooter = false;
51
58
  this.expanded = false;
52
59
  this.expandedWithHover = false;
53
- /**
54
- * Specifies the horizontal alignment the dropdown section has when using
55
- * `position === "Top"` or `position === "Bottom"`.
56
- */
57
- this.align = "Center";
58
60
  /**
59
61
  * This attribute lets you specify the label for the expandable button.
60
62
  * Important for accessibility.
@@ -64,7 +66,12 @@ const ChDropDown = class {
64
66
  * Determine which actions on the expandable button display the dropdown
65
67
  * section.
66
68
  */
67
- this.expandBehavior = "Click or Hover";
69
+ this.expandBehavior = "ClickOrHover";
70
+ /**
71
+ * This attribute lets you specify if the control is nested in another
72
+ * dropdown. Useful to manage keyboard interaction.
73
+ */
74
+ this.nestedDropdown = false;
68
75
  /**
69
76
  * Determine if the dropdown section should be opened when the expandable
70
77
  * button of the control is focused.
@@ -74,17 +81,7 @@ const ChDropDown = class {
74
81
  * Specifies the position of the dropdown section that is placed relative to
75
82
  * the expandable button.
76
83
  */
77
- this.position = "Bottom";
78
- /**
79
- * Specifies the separation (in pixels) between the expandable button and the
80
- * dropdown section of the control.
81
- */
82
- this.dropdownSeparation = 12;
83
- /**
84
- * Specifies the vertical alignment the dropdown section has when using
85
- * `position === "Right"` or `position === "Left"`.
86
- */
87
- this.valign = "Middle";
84
+ this.position = "Center_OutsideEnd";
88
85
  this.closeDropdown = () => {
89
86
  this.closeDropdownWithHover();
90
87
  this.expanded = false;
@@ -98,7 +95,7 @@ const ChDropDown = class {
98
95
  }
99
96
  };
100
97
  this.closeDropdownWhenClickingOutside = (event) => {
101
- if (event.composedPath().find(el => el === this.element) === undefined) {
98
+ if (event.composedPath().find(el => el === this.el) === undefined) {
102
99
  this.closeDropdown();
103
100
  }
104
101
  };
@@ -116,15 +113,14 @@ const ChDropDown = class {
116
113
  if (event.code !== TAB_KEY) {
117
114
  return;
118
115
  }
119
- const nextFocusedElement = event.target;
120
- const isChildElement = nextFocusedElement.closest("ch-dropdown") === this.element;
116
+ const isChildElement = event.composedPath().includes(this.el);
121
117
  if (isChildElement) {
122
118
  return;
123
119
  }
124
120
  this.closeDropdown();
125
121
  };
126
122
  this.handleMouseLeave = () => {
127
- const focusedElementIsInsideDropDown = document.activeElement.closest("ch-dropdown") === this.element;
123
+ const focusedElementIsInsideDropDown = document.activeElement.closest("ch-dropdown") === this.el;
128
124
  if (focusedElementIsInsideDropDown) {
129
125
  this.expanded = true;
130
126
  }
@@ -140,11 +136,13 @@ const ChDropDown = class {
140
136
  this.expandedChange.emit(true);
141
137
  }
142
138
  };
143
- this.handleButtonClick = () => {
139
+ this.handleButtonClick = (event) => {
140
+ event.stopPropagation();
144
141
  this.expandedChange.emit(!this.expanded);
145
142
  this.expanded = !this.expanded;
146
143
  };
147
- this.handleButtonFocus = () => {
144
+ this.handleButtonFocus = (event) => {
145
+ event.stopPropagation();
148
146
  if (this.expanded) {
149
147
  return;
150
148
  }
@@ -163,9 +161,11 @@ const ChDropDown = class {
163
161
  capture: true
164
162
  });
165
163
  // Keyboard events
166
- document.body.addEventListener("keydown", this.handleKeyDownEvents, {
167
- capture: true
168
- });
164
+ if (!this.nestedDropdown) {
165
+ document.body.addEventListener("keydown", this.handleKeyDownEvents, {
166
+ capture: true
167
+ });
168
+ }
169
169
  document.body.addEventListener("keyup", this.handleKeyUpEvents, {
170
170
  capture: true
171
171
  });
@@ -176,9 +176,11 @@ const ChDropDown = class {
176
176
  capture: true
177
177
  });
178
178
  // Keyboard events
179
- document.body.removeEventListener("keydown", this.handleKeyDownEvents, {
180
- capture: true
181
- });
179
+ if (!this.nestedDropdown) {
180
+ document.body.removeEventListener("keydown", this.handleKeyDownEvents, {
181
+ capture: true
182
+ });
183
+ }
182
184
  document.body.removeEventListener("keyup", this.handleKeyUpEvents, {
183
185
  capture: true
184
186
  });
@@ -193,7 +195,7 @@ const ChDropDown = class {
193
195
  this.currentFocusedItem = event.target;
194
196
  }
195
197
  focusFirstDropDownItem() {
196
- this.currentFocusedItem = this.element.querySelector(DROPDOWN_ITEM_SELECTOR);
198
+ this.currentFocusedItem = this.el.querySelector(DROPDOWN_ITEM_SELECTOR);
197
199
  if (this.currentFocusedItem) {
198
200
  this.currentFocusedItem.handleFocusElement();
199
201
  }
@@ -222,40 +224,36 @@ const ChDropDown = class {
222
224
  * works if `openOnFocus = "false"`
223
225
  */
224
226
  returnFocusToButton() {
225
- if (!this.openOnFocus) {
227
+ if (!this.openOnFocus && !this.nestedDropdown) {
226
228
  this.expandableButton.focus();
227
229
  }
228
230
  }
229
231
  componentWillLoad() {
230
- this.showHeader = !!this.element.querySelector(':scope > [slot="header"]');
231
- this.showFooter = !!this.element.querySelector(':scope > [slot="footer"]');
232
+ this.showHeader = !!this.el.querySelector(':scope > [slot="header"]');
233
+ this.showFooter = !!this.el.querySelector(':scope > [slot="footer"]');
232
234
  }
233
235
  render() {
234
- const hasVerticalPosition = this.position === "Bottom" || this.position === "Top";
236
+ const aligns = this.position.split("_");
237
+ const alignX = aligns[0];
238
+ const alignY = aligns[1];
239
+ const hasVerticalPosition = alignY === "OutsideStart" || alignY === "OutsideEnd";
240
+ const xAlignMapping = mapDropdownAlignToChWindowAlign[alignX];
241
+ const yAlignMapping = mapDropdownAlignToChWindowAlign[alignY];
235
242
  const isExpanded = this.expanded || this.expandedWithHover;
236
- return (index.h(index.Host, { onMouseLeave: this.expandBehavior === "Click or Hover"
243
+ return (index.h(index.Host, { onMouseLeave: this.expandBehavior === "ClickOrHover"
237
244
  ? this.handleMouseLeave
238
- : undefined, style: {
239
- "--separation-between-button": `-${this.dropdownSeparation}px`,
240
- "--separation-between-button-size": `${this.dropdownSeparation}px`
241
- } }, index.h("button", { id: EXPANDABLE_BUTTON_ID, "aria-controls": SECTION_ID, "aria-expanded": this.expanded.toString(), "aria-haspopup": "true", "aria-label": this.buttonLabel, class: "expandable-button", part: "dropdown__expandable-button", type: "button", onClick: this.handleButtonClick, onFocus: this.openOnFocus ? this.handleButtonFocus : undefined, onMouseEnter: this.expandBehavior === "Click or Hover"
245
+ : undefined }, index.h("button", { id: EXPANDABLE_BUTTON_ID, "aria-controls": SECTION_ID, "aria-expanded": this.expanded.toString(), "aria-haspopup": "true", "aria-label": this.buttonLabel, class: "expandable-button", part: "expandable-button", type: "button", onClick: this.handleButtonClick, onFocus: this.openOnFocus ? this.handleButtonFocus : undefined, onMouseEnter: this.expandBehavior === "ClickOrHover"
242
246
  ? this.handleMouseEnter
243
- : undefined, ref: el => (this.expandableButton = el) }, index.h("slot", { name: "action" })), this.expandBehavior === "Click or Hover" && this.expandedWithHover && (
247
+ : undefined, ref: el => (this.expandableButton = el) }, index.h("slot", { name: "action" })), this.expandBehavior === "ClickOrHover" && (
244
248
  // Necessary since the separation between the button and the section
245
249
  // triggers the onMouseLeave event
246
250
  index.h("div", { "aria-hidden": "true", class: {
247
- "dummy-separation": true,
248
- [`dummy-separation--${this.position.toLowerCase()}`]: true,
249
- "dummy-separation--vertical": hasVerticalPosition,
250
- "dummy-separation--horizontal": !hasVerticalPosition
251
- }, part: "dropdown__separation" })), index.h("section", { id: SECTION_ID, "aria-labelledby": EXPANDABLE_BUTTON_ID, class: {
252
- section: true,
253
- [`position--${this.position.toLowerCase()}`]: true,
254
- [`align--${this.align.toLowerCase()}`]: hasVerticalPosition,
255
- [`valign--${this.valign.toLowerCase()}`]: !hasVerticalPosition
256
- }, part: "dropdown__section", hidden: !isExpanded }, this.showHeader && (index.h("header", { class: "header", part: "dropdown__header" }, index.h("slot", { name: "header" }))), index.h("div", { role: "list", class: "list", part: "dropdown__list" }, index.h("slot", { name: "items" })), this.showFooter && (index.h("footer", { class: "footer", part: "dropdown__footer" }, index.h("slot", { name: "footer" }))))));
251
+ separation: true,
252
+ [`separation--y separation--y-${yAlignMapping}`]: hasVerticalPosition,
253
+ [`separation--x separation--x-${xAlignMapping}`]: !hasVerticalPosition
254
+ }, part: "separation" })), index.h("ch-window", { part: "window", exportparts: "window:section,mask,header,footer", container: this.el, closeOnEscape: true, hidden: !isExpanded, modal: false, showFooter: this.showFooter, showHeader: this.showHeader, xAlign: xAlignMapping, yAlign: yAlignMapping }, this.showHeader && index.h("slot", { name: "header", slot: "header" }), index.h("div", { role: "list", class: "list", part: "list" }, index.h("slot", { name: "items" })), this.showFooter && index.h("slot", { name: "footer", slot: "footer" }))));
257
255
  }
258
- get element() { return index.getElement(this); }
256
+ get el() { return index.getElement(this); }
259
257
  static get watchers() { return {
260
258
  "expanded": ["handleExpandedChange"]
261
259
  }; }