@sdcorejs/angular 21.3.0 → 21.3.2

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 (199) hide show
  1. package/README.md +2 -2
  2. package/assets/STYLE-GUIDE.md +25 -5
  3. package/assets/THEME.md +237 -5
  4. package/assets/licenses/tiptap-oss-NOTICES.txt +332 -0
  5. package/assets/scss/ckeditor5.scss +2 -88
  6. package/assets/scss/core/_control.scss +39 -0
  7. package/assets/scss/core/form.scss +156 -45
  8. package/assets/scss/core/view.scss +24 -0
  9. package/assets/scss/editor-content.scss +173 -0
  10. package/assets/scss/sd-core.scss +1 -0
  11. package/assets/scss/themes/_component-tokens.scss +93 -31
  12. package/assets/scss/themes/_material-tokens.scss +112 -0
  13. package/assets/scss/themes/_presets.scss +25 -0
  14. package/assets/scss/themes/_scales.scss +10 -0
  15. package/assets/scss/themes/_semantic.scss +13 -0
  16. package/assets/scss/themes/default.scss +8 -2
  17. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +5 -5
  18. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
  19. package/fesm2022/sdcorejs-angular-components-avatar.mjs +142 -11
  20. package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
  21. package/fesm2022/sdcorejs-angular-components-badge.mjs +542 -24
  22. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  23. package/fesm2022/sdcorejs-angular-components-button.mjs +31 -3
  24. package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
  25. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +5 -20
  26. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
  27. package/fesm2022/sdcorejs-angular-components-data-state.mjs +1 -1
  28. package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
  29. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs +1872 -0
  30. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs.map +1 -0
  31. package/fesm2022/sdcorejs-angular-components-editor.mjs +457 -756
  32. package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
  33. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +2209 -106
  34. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
  35. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +2616 -1054
  36. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  37. package/fesm2022/sdcorejs-angular-components-history.mjs +5 -2
  38. package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
  39. package/fesm2022/sdcorejs-angular-components-image-editor.mjs +1 -1
  40. package/fesm2022/sdcorejs-angular-components-image-editor.mjs.map +1 -1
  41. package/fesm2022/sdcorejs-angular-components-import-excel.mjs +21 -6
  42. package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
  43. package/fesm2022/sdcorejs-angular-components-inform.mjs +1 -1
  44. package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
  45. package/fesm2022/sdcorejs-angular-components-kanban.mjs +451 -0
  46. package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -0
  47. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +177 -283
  48. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
  49. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +1 -308
  50. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
  51. package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
  52. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  53. package/fesm2022/sdcorejs-angular-components-operator.mjs +260 -43
  54. package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
  55. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +12 -12
  56. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  57. package/fesm2022/sdcorejs-angular-components-query-builder.mjs +1 -1
  58. package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
  59. package/fesm2022/sdcorejs-angular-components-section.mjs +5 -4
  60. package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
  61. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
  62. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  63. package/fesm2022/sdcorejs-angular-components-stepper.mjs +5 -1
  64. package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
  65. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +192 -42
  66. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  67. package/fesm2022/sdcorejs-angular-components-tab.mjs +12 -4
  68. package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
  69. package/fesm2022/sdcorejs-angular-components-table.mjs +564 -110
  70. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  71. package/fesm2022/sdcorejs-angular-components-tree.mjs +1 -1
  72. package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
  73. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +1 -1
  74. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  75. package/fesm2022/sdcorejs-angular-components-view.mjs +2 -2
  76. package/fesm2022/sdcorejs-angular-components-view.mjs.map +1 -1
  77. package/fesm2022/sdcorejs-angular-components-window.mjs +484 -0
  78. package/fesm2022/sdcorejs-angular-components-window.mjs.map +1 -0
  79. package/fesm2022/sdcorejs-angular-components.mjs +2 -0
  80. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  81. package/fesm2022/sdcorejs-angular-configurations.mjs.map +1 -1
  82. package/fesm2022/sdcorejs-angular-directives.mjs +18 -1
  83. package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
  84. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +15 -2
  85. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  86. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +2 -2
  87. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
  88. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +454 -125
  89. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  90. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +75 -13
  91. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  92. package/fesm2022/sdcorejs-angular-forms-date.mjs +71 -18
  93. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  94. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +75 -16
  95. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  96. package/fesm2022/sdcorejs-angular-forms-directives.mjs +82 -2
  97. package/fesm2022/sdcorejs-angular-forms-directives.mjs.map +1 -1
  98. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +2 -2
  99. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
  100. package/fesm2022/sdcorejs-angular-forms-input-color.mjs +1 -1
  101. package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
  102. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +40 -5
  103. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  104. package/fesm2022/sdcorejs-angular-forms-input.mjs +50 -7
  105. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  106. package/fesm2022/sdcorejs-angular-forms-models.mjs +88 -5
  107. package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
  108. package/fesm2022/sdcorejs-angular-forms-radio.mjs +2 -2
  109. package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
  110. package/fesm2022/sdcorejs-angular-forms-segmented.mjs +243 -0
  111. package/fesm2022/sdcorejs-angular-forms-segmented.mjs.map +1 -0
  112. package/fesm2022/sdcorejs-angular-forms-select.mjs +63 -15
  113. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  114. package/fesm2022/sdcorejs-angular-forms-switch.mjs +2 -2
  115. package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
  116. package/fesm2022/sdcorejs-angular-forms-textarea.mjs +2 -2
  117. package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
  118. package/fesm2022/sdcorejs-angular-forms-time.mjs +2 -2
  119. package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -1
  120. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
  121. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
  122. package/fesm2022/sdcorejs-angular-forms.mjs +8 -0
  123. package/fesm2022/sdcorejs-angular-forms.mjs.map +1 -1
  124. package/fesm2022/sdcorejs-angular-i18n.mjs +1830 -17
  125. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  126. package/fesm2022/sdcorejs-angular-interceptors.mjs +1 -1
  127. package/fesm2022/sdcorejs-angular-interceptors.mjs.map +1 -1
  128. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-MlNJ6DDc.mjs +478 -0
  129. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-MlNJ6DDc.mjs.map +1 -0
  130. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-_PcU75h9.mjs +214 -0
  131. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-_PcU75h9.mjs.map +1 -0
  132. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-qcvv7QK6.mjs +277 -0
  133. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-qcvv7QK6.mjs.map +1 -0
  134. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-B1fYY5yX.mjs +1556 -0
  135. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-B1fYY5yX.mjs.map +1 -0
  136. package/fesm2022/sdcorejs-angular-modules-generic.mjs +2 -0
  137. package/fesm2022/sdcorejs-angular-modules-generic.mjs.map +1 -0
  138. package/fesm2022/sdcorejs-angular-modules-icon.mjs +96 -3
  139. package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
  140. package/fesm2022/sdcorejs-angular-modules-layout.mjs +1825 -62
  141. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  142. package/fesm2022/sdcorejs-angular-modules.mjs +1 -0
  143. package/fesm2022/sdcorejs-angular-modules.mjs.map +1 -1
  144. package/fesm2022/sdcorejs-angular-pipes.mjs +27 -7
  145. package/fesm2022/sdcorejs-angular-pipes.mjs.map +1 -1
  146. package/fesm2022/sdcorejs-angular-services-confirm.mjs +2 -2
  147. package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
  148. package/fesm2022/sdcorejs-angular-services-date-time.mjs +143 -0
  149. package/fesm2022/sdcorejs-angular-services-date-time.mjs.map +1 -0
  150. package/fesm2022/sdcorejs-angular-services-storage.mjs +44 -8
  151. package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
  152. package/fesm2022/sdcorejs-angular-services.mjs +1 -0
  153. package/fesm2022/sdcorejs-angular-services.mjs.map +1 -1
  154. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs +4 -0
  155. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs.map +1 -1
  156. package/fesm2022/sdcorejs-angular-utilities-theme.mjs +10 -0
  157. package/fesm2022/sdcorejs-angular-utilities-theme.mjs.map +1 -1
  158. package/package.json +48 -7
  159. package/types/sdcorejs-angular-components-avatar.d.ts +67 -2
  160. package/types/sdcorejs-angular-components-badge.d.ts +188 -6
  161. package/types/sdcorejs-angular-components-button.d.ts +20 -1
  162. package/types/sdcorejs-angular-components-ckeditor-styles.d.ts +3 -18
  163. package/types/sdcorejs-angular-components-editor-engine.d.ts +246 -0
  164. package/types/sdcorejs-angular-components-editor.d.ts +20 -17
  165. package/types/sdcorejs-angular-components-file-explorer.d.ts +449 -57
  166. package/types/sdcorejs-angular-components-form-generic.d.ts +301 -37
  167. package/types/sdcorejs-angular-components-kanban.d.ts +179 -0
  168. package/types/sdcorejs-angular-components-mini-editor.d.ts +33 -70
  169. package/types/sdcorejs-angular-components-modal-resizable.d.ts +1 -124
  170. package/types/sdcorejs-angular-components-operator.d.ts +137 -8
  171. package/types/sdcorejs-angular-components-section.d.ts +2 -1
  172. package/types/sdcorejs-angular-components-tab-router.d.ts +31 -18
  173. package/types/sdcorejs-angular-components-tab.d.ts +3 -1
  174. package/types/sdcorejs-angular-components-table.d.ts +84 -6
  175. package/types/sdcorejs-angular-components-window.d.ts +81 -0
  176. package/types/sdcorejs-angular-components.d.ts +2 -0
  177. package/types/sdcorejs-angular-configurations.d.ts +8 -1
  178. package/types/sdcorejs-angular-forms-autocomplete.d.ts +5 -0
  179. package/types/sdcorejs-angular-forms-chip-calendar.d.ts +163 -18
  180. package/types/sdcorejs-angular-forms-date-range.d.ts +24 -2
  181. package/types/sdcorejs-angular-forms-date.d.ts +23 -2
  182. package/types/sdcorejs-angular-forms-directives.d.ts +47 -2
  183. package/types/sdcorejs-angular-forms-input-number.d.ts +23 -2
  184. package/types/sdcorejs-angular-forms-input.d.ts +23 -2
  185. package/types/sdcorejs-angular-forms-models.d.ts +38 -3
  186. package/types/sdcorejs-angular-forms-segmented.d.ts +90 -0
  187. package/types/sdcorejs-angular-forms-select.d.ts +32 -2
  188. package/types/sdcorejs-angular-forms.d.ts +8 -6
  189. package/types/sdcorejs-angular-i18n.d.ts +360 -1
  190. package/types/sdcorejs-angular-modules-generic.d.ts +316 -0
  191. package/types/sdcorejs-angular-modules-icon.d.ts +37 -6
  192. package/types/sdcorejs-angular-modules-layout.d.ts +536 -86
  193. package/types/sdcorejs-angular-modules.d.ts +1 -0
  194. package/types/sdcorejs-angular-pipes.d.ts +2 -0
  195. package/types/sdcorejs-angular-services-date-time.d.ts +57 -0
  196. package/types/sdcorejs-angular-services-storage.d.ts +8 -1
  197. package/types/sdcorejs-angular-services.d.ts +1 -0
  198. package/types/sdcorejs-angular-utilities-read-state.d.ts +2 -0
  199. package/types/sdcorejs-angular-utilities-theme.d.ts +1 -1
@@ -1,12 +1,488 @@
1
- import { NgComponentOutlet, NgTemplateOutlet, DOCUMENT } from '@angular/common';
1
+ import { NgTemplateOutlet, NgComponentOutlet, DOCUMENT } from '@angular/common';
2
+ import * as i1 from '@angular/cdk/a11y';
3
+ import { A11yModule } from '@angular/cdk/a11y';
2
4
  import * as i0 from '@angular/core';
3
- import { input, computed, ChangeDetectionStrategy, Component, inject, ElementRef, output, signal, viewChild, effect, untracked, Injector, NgZone, afterNextRender, DestroyRef } from '@angular/core';
5
+ import { isDevMode, inject, input, viewChildren, computed, ChangeDetectionStrategy, Component, TemplateRef, Directive, output, viewChild, ElementRef, signal, effect, untracked, contentChildren, Injector, NgZone, DestroyRef, afterNextRender } from '@angular/core';
6
+ import { MatTooltip } from '@angular/material/tooltip';
4
7
  import { SdBreadcrumb } from '@sdcorejs/angular/components/breadcrumb';
5
- import { SdButton } from '@sdcorejs/angular/components/button';
8
+ import { SdButton, SdButtonItem } from '@sdcorejs/angular/components/button';
9
+ import { SdInform, SdInformActionDirective } from '@sdcorejs/angular/components/inform';
6
10
  import { SdDataState } from '@sdcorejs/angular/components/data-state';
7
11
  import { I18nService, SdTranslatePipe } from '@sdcorejs/angular/i18n';
12
+ import { SdDateTimeService } from '@sdcorejs/angular/services/date-time';
8
13
  import { SdIcon } from '@sdcorejs/angular/modules/icon';
9
14
  import { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';
15
+ import { MatCheckbox } from '@angular/material/checkbox';
16
+
17
+ /** Resolves original callbacks without wrappers; canonical groups win as a whole. */
18
+ function sdFileExplorerNormalizeConfig(config) {
19
+ const capabilities = config.capabilities;
20
+ const legacy = config;
21
+ return {
22
+ ...config,
23
+ list: config.dataSource ? config.dataSource.onList : legacy.list,
24
+ search: config.dataSource ? config.dataSource.onSearch : legacy.search,
25
+ share: capabilities?.share ? capabilities.share.onShare : legacy.share,
26
+ download: capabilities?.download ? capabilities.download.onDownload : legacy.download,
27
+ preview: capabilities?.preview ? capabilities.preview.onPreview : legacy.preview,
28
+ upload: capabilities?.upload ? capabilities.upload.onUpload : legacy.upload,
29
+ createFolder: capabilities?.createFolder ? capabilities.createFolder.onCreateFolder : legacy.createFolder,
30
+ shareable: capabilities?.share?.shareable,
31
+ downloadable: capabilities?.download?.downloadable,
32
+ previewable: capabilities?.preview?.previewable,
33
+ uploadable: capabilities?.upload?.uploadable,
34
+ creatable: capabilities?.createFolder?.creatable,
35
+ };
36
+ }
37
+ /** Eligibility defaults true for a supported callback and is checked again at dispatch. */
38
+ function sdFileExplorerEligible(state, context) {
39
+ return typeof state === 'function' ? !!state(context) : state !== false;
40
+ }
41
+
42
+ const SD_FILE_EXPLORER_MOVE_MIME = 'application/x-sd-file-explorer-move';
43
+ /** Whole-batch validation keeps original caller objects and rejects stale destinations. */
44
+ function sdFileExplorerValidateMove(items, target, known, visible = known) {
45
+ if (!items.length || (target !== null && (target.kind !== 'folder' || !known.includes(target))))
46
+ return false;
47
+ const ids = new Set();
48
+ const knownIds = new Map();
49
+ for (const item of known) {
50
+ if (knownIds.has(item.id) && knownIds.get(item.id) !== item)
51
+ return false;
52
+ knownIds.set(item.id, item);
53
+ }
54
+ const visibleIds = new Map();
55
+ for (const item of visible) {
56
+ if (visibleIds.has(item.id) && visibleIds.get(item.id) !== item)
57
+ return false;
58
+ visibleIds.set(item.id, item);
59
+ }
60
+ for (const item of items) {
61
+ if (item.kind !== 'file' ||
62
+ !visible.includes(item) ||
63
+ knownIds.get(item.id)?.kind === 'folder' ||
64
+ ids.has(item.id) ||
65
+ item.parentId === (target?.id ?? null))
66
+ return false;
67
+ ids.add(item.id);
68
+ }
69
+ return true;
70
+ }
71
+ /** Tokens resolve only inside the originating instance and only during its current gesture. */
72
+ class SdFileExplorerDragSession {
73
+ #token = null;
74
+ #items = [];
75
+ get activeItems() {
76
+ return this.#token === null ? null : this.#items;
77
+ }
78
+ start(items) {
79
+ this.#token = crypto.randomUUID();
80
+ this.#items = Object.freeze([...items]);
81
+ return this.#token;
82
+ }
83
+ resolve(token) {
84
+ return this.#token !== null && token === this.#token ? this.#items : null;
85
+ }
86
+ clear() {
87
+ this.#token = null;
88
+ this.#items = [];
89
+ }
90
+ }
91
+
92
+ /** Defaults of `fileCommands` and `folderCommands`: `text` and `secondary`, flat or grouped. */
93
+ const SD_FILE_EXPLORER_COMMAND_DEFAULTS = { leafType: 'text', groupType: 'text', color: 'secondary' };
94
+ /** Trigger icon of a group that declares no `prefixIcon`. */
95
+ const GROUP_ICON = 'more_vert';
96
+ // why: mỗi hàng của danh sách resolve lại cùng một bộ định nghĩa — cảnh báo theo định nghĩa (hoặc theo nội dung
97
+ // với giá trị không phải object) để console chỉ nhắc một lần, không phải một lần cho mỗi tệp.
98
+ const warnedDefinitions = new WeakSet();
99
+ const warnedMessages = new Set();
100
+ function text(value) {
101
+ return typeof value === 'string' && value.trim() ? value : undefined;
102
+ }
103
+ function evaluate(state, context) {
104
+ return typeof state === 'function' ? !!state(context) : !!state;
105
+ }
106
+ function warn(definition, message) {
107
+ if (!isDevMode())
108
+ return;
109
+ if (definition !== null && typeof definition === 'object') {
110
+ if (warnedDefinitions.has(definition))
111
+ return;
112
+ warnedDefinitions.add(definition);
113
+ }
114
+ else {
115
+ if (warnedMessages.has(message))
116
+ return;
117
+ warnedMessages.add(message);
118
+ }
119
+ console.warn(message);
120
+ }
121
+ /**
122
+ * Why a definition cannot be rendered, or `null` when it is a usable leaf or group. TypeScript already rejects these
123
+ * shapes; this guards plain JavaScript and loosely typed configuration.
124
+ */
125
+ function problem(definition, inGroup) {
126
+ if (definition === null || typeof definition !== 'object')
127
+ return 'is not an action object';
128
+ const { click, onClick, children, title, tooltip } = definition;
129
+ if (children !== undefined && children !== null && !Array.isArray(children))
130
+ return '`children` must be an array';
131
+ if (Array.isArray(children)) {
132
+ if (inGroup)
133
+ return 'is a group inside a group; groups are one level deep';
134
+ if (typeof click === 'function' || typeof onClick === 'function')
135
+ return 'declares both `click` and `children`; a group only opens its menu';
136
+ }
137
+ else if (typeof click !== 'function' && typeof onClick !== 'function') {
138
+ return 'needs `click` (an action) or `children` (a group)';
139
+ }
140
+ if (!text(title) && !text(tooltip))
141
+ return 'needs a `title` or a `tooltip` as its accessible name';
142
+ return null;
143
+ }
144
+ /** Selection capability is configuration-level. A context predicate cannot prove that every future selection is hidden. */
145
+ function sdFileExplorerHasActionCapability(actions) {
146
+ if (!Array.isArray(actions))
147
+ return false;
148
+ return actions.some((definition) => {
149
+ if (problem(definition, false) || definition.hidden === true)
150
+ return false;
151
+ return Array.isArray(definition.children)
152
+ ? definition.children.some((child) => !problem(child, true) && child.hidden !== true)
153
+ : true;
154
+ });
155
+ }
156
+ function resolveMenu(group, context, path) {
157
+ const items = [];
158
+ group.children.forEach((child, index) => {
159
+ const reason = problem(child, true);
160
+ if (reason) {
161
+ warn(child, `[sd-file-explorer] ${path}.children[${index}] ignored: ${reason}.`);
162
+ return;
163
+ }
164
+ if (evaluate(child.hidden, context))
165
+ return;
166
+ const title = text(child.title);
167
+ const tooltip = text(child.tooltip);
168
+ const loading = evaluate(child.loading, context);
169
+ items.push({
170
+ key: String(index),
171
+ definition: child,
172
+ label: (title ?? tooltip),
173
+ tooltip: title ? tooltip : undefined,
174
+ prefixIcon: child.prefixIcon ?? undefined,
175
+ suffixIcon: child.suffixIcon ?? undefined,
176
+ fontSet: child.fontSet ?? undefined,
177
+ color: child.color ?? undefined,
178
+ disabled: evaluate(child.disabled, context) || loading,
179
+ loading,
180
+ });
181
+ });
182
+ return items;
183
+ }
184
+ /**
185
+ * Visible actions of one collection for one context (the selected files, or one item), in declared order.
186
+ *
187
+ * Hidden entries, groups without a visible child and definitions that cannot be rendered are left out; nothing is
188
+ * regrouped or moved into an overflow menu. `source` names the collection in dev-mode warnings.
189
+ */
190
+ function sdFileExplorerResolveActions(actions, context, defaults, source = 'actions') {
191
+ if (!Array.isArray(actions))
192
+ return [];
193
+ const resolved = [];
194
+ actions.forEach((definition, index) => {
195
+ const path = `${source}[${index}]`;
196
+ const reason = problem(definition, false);
197
+ if (reason) {
198
+ warn(definition, `[sd-file-explorer] ${path} ignored: ${reason}.`);
199
+ return;
200
+ }
201
+ if (evaluate(definition.hidden, context))
202
+ return;
203
+ const isGroup = Array.isArray(definition.children);
204
+ const button = {
205
+ key: String(index),
206
+ title: text(definition.title),
207
+ tooltip: text(definition.tooltip),
208
+ prefixIcon: definition.prefixIcon ?? undefined,
209
+ suffixIcon: definition.suffixIcon ?? undefined,
210
+ fontSet: definition.fontSet ?? undefined,
211
+ color: definition.color ?? defaults.color,
212
+ type: definition.type ?? (isGroup ? defaults.groupType : defaults.leafType),
213
+ disabled: evaluate(definition.disabled, context),
214
+ loading: evaluate(definition.loading, context),
215
+ };
216
+ if (!isGroup) {
217
+ resolved.push({ ...button, kind: 'leaf', definition: definition });
218
+ return;
219
+ }
220
+ const group = definition;
221
+ const children = resolveMenu(group, context, path);
222
+ if (children.length) {
223
+ resolved.push({ ...button, kind: 'group', definition: group, prefixIcon: group.prefixIcon ?? GROUP_ICON, children });
224
+ }
225
+ });
226
+ return resolved;
227
+ }
228
+ /** `true` when the action must not run now: hidden, disabled or loading for `context`, evaluated at call time. */
229
+ function sdFileExplorerActionBlocked(action, context) {
230
+ return evaluate(action.hidden, context) || evaluate(action.disabled, context) || evaluate(action.loading, context);
231
+ }
232
+ /** `true` while an entry, or an item of one of its groups, is loading: the compact trigger of the item shows it. */
233
+ function sdFileExplorerActionsBusy(resolved) {
234
+ return resolved.some(entry => entry.loading || (entry.kind === 'group' && entry.children.some(child => child.loading)));
235
+ }
236
+ /**
237
+ * Entries of the compact command drawer, from the commands resolved for its item: same order, filtering and states as
238
+ * the desktop buttons, shown as menu-like entries. The drawer has no button variants, so `type` is dropped; a color is
239
+ * kept only when declared, for the icons. A group becomes a section with a text-only heading — its icon and color stay
240
+ * on the desktop trigger — whose children are disabled while the group itself is disabled or loading. `keys` renames
241
+ * entries by declared index (the row shortcuts: `share`, `download`).
242
+ */
243
+ function sdFileExplorerSheetEntries(resolved, keys) {
244
+ return resolved.map(entry => {
245
+ const key = keys?.[Number(entry.key)] ?? entry.key;
246
+ if (entry.kind === 'leaf') {
247
+ return {
248
+ kind: 'leaf',
249
+ key,
250
+ label: (entry.title ?? entry.tooltip),
251
+ prefixIcon: entry.prefixIcon,
252
+ suffixIcon: entry.suffixIcon,
253
+ fontSet: entry.fontSet,
254
+ color: entry.definition.color ?? undefined,
255
+ disabled: entry.disabled || entry.loading,
256
+ loading: entry.loading,
257
+ definition: entry.definition,
258
+ };
259
+ }
260
+ const blocked = entry.disabled || entry.loading;
261
+ const children = entry.children.map((child) => ({
262
+ kind: 'leaf',
263
+ key: child.key,
264
+ label: child.label,
265
+ prefixIcon: child.prefixIcon,
266
+ suffixIcon: child.suffixIcon,
267
+ fontSet: child.fontSet,
268
+ color: child.color,
269
+ disabled: child.disabled || blocked,
270
+ loading: child.loading,
271
+ definition: child.definition,
272
+ }));
273
+ return {
274
+ kind: 'group',
275
+ key,
276
+ label: (entry.title ?? entry.tooltip),
277
+ disabled: entry.disabled,
278
+ loading: entry.loading,
279
+ definition: entry.definition,
280
+ children,
281
+ };
282
+ });
283
+ }
284
+
285
+ /**
286
+ * Action area of the explorer (internal): `selector.actions`, `fileCommands` or `folderCommands` for one context.
287
+ *
288
+ * A leaf renders as an `sd-button` that runs its `click`; a group as an `sd-button` whose projected
289
+ * `sd-button-item`s open in the button's own Action Popover. Siblings keep their declared order and wrap onto another
290
+ * line when the area is narrow — nothing is folded into an automatic overflow menu.
291
+ *
292
+ * The host carries `sd-file-explorer-actions--open` while one of its menus is open and `--busy` while an entry is
293
+ * loading, so the row, card or tree node can keep an area that is otherwise revealed on hover visible.
294
+ */
295
+ class SdFileExplorerActions {
296
+ #i18n = inject(I18nService);
297
+ /** Definitions to render. */
298
+ actions = input(undefined, ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
299
+ /** Value handed to `click` and to the state predicates: the selected files, or one item. */
300
+ context = input.required(...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
301
+ /** Variant of leaves (flat buttons) without `type`. */
302
+ defaultLeafType = input('text', ...(ngDevMode ? [{ debugName: "defaultLeafType" }] : /* istanbul ignore next */ []));
303
+ /** Variant of group triggers without `type`. */
304
+ defaultGroupType = input('text', ...(ngDevMode ? [{ debugName: "defaultGroupType" }] : /* istanbul ignore next */ []));
305
+ /** Color of definitions without `color`. */
306
+ defaultColor = input('secondary', ...(ngDevMode ? [{ debugName: "defaultColor" }] : /* istanbul ignore next */ []));
307
+ /** `sd-button` size of every entry. */
308
+ size = input('sm', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
309
+ /** Collection name used in dev-mode warnings. */
310
+ source = input('actions', ...(ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []));
311
+ /** Prefix of the entries' `data-autoid`, suffixed with the declared index (and the child index in menus). */
312
+ autoId = input(undefined, ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
313
+ // why: Angular query không dùng được trên field private kiểu ES (#) — dùng `private` của TypeScript.
314
+ buttons = viewChildren(SdButton, ...(ngDevMode ? [{ debugName: "buttons" }] : /* istanbul ignore next */ []));
315
+ entries = computed(() => sdFileExplorerResolveActions(this.actions(), this.context(), { leafType: this.defaultLeafType(), groupType: this.defaultGroupType(), color: this.defaultColor() }, this.source()), ...(ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []));
316
+ // why: lệnh theo item cần gọn; giữ definition gốc để menu/drawer vẫn có nhãn và selector vẫn có title.
317
+ iconOnlyCommands = computed(() => this.source() === 'fileCommands' || this.source() === 'folderCommands', ...(ngDevMode ? [{ debugName: "iconOnlyCommands" }] : /* istanbul ignore next */ []));
318
+ open = computed(() => this.buttons().some(button => button.popover.opened()), ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
319
+ busy = computed(() => sdFileExplorerActionsBusy(this.entries()), ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
320
+ loadingLabel = computed(() => this.#i18n.t('core.component.file-explorer.action-loading'), ...(ngDevMode ? [{ debugName: "loadingLabel" }] : /* istanbul ignore next */ []));
321
+ run(action, group) {
322
+ const actions = this.actions();
323
+ // A stale rendered button or menu must not dispatch a definition the consumer has withdrawn.
324
+ if (group ? !actions?.includes(group) || !group.children.includes(action) : !actions?.includes(action))
325
+ return;
326
+ const context = this.context();
327
+ // why: trạng thái do consumer giữ có thể đã đổi sau lần render cuối (ví dụ bật loading ngay trong click trước, khi
328
+ // Angular chưa kịp vẽ lại nút) — đánh giá lại lúc bấm để click lặp hay menu cũ không chạy callback lần nữa.
329
+ if ((group && sdFileExplorerActionBlocked(group, context)) || sdFileExplorerActionBlocked(action, context))
330
+ return;
331
+ (action.onClick ?? action.click)?.(context);
332
+ }
333
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
334
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdFileExplorerActions, isStandalone: true, selector: "sd-file-explorer-actions", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, defaultLeafType: { classPropertyName: "defaultLeafType", publicName: "defaultLeafType", isSignal: true, isRequired: false, transformFunction: null }, defaultGroupType: { classPropertyName: "defaultGroupType", publicName: "defaultGroupType", isSignal: true, isRequired: false, transformFunction: null }, defaultColor: { classPropertyName: "defaultColor", publicName: "defaultColor", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.sd-file-explorer-actions--open": "open()", "class.sd-file-explorer-actions--busy": "busy()" }, classAttribute: "sd-file-explorer-actions" }, viewQueries: [{ propertyName: "buttons", predicate: SdButton, descendants: true, isSignal: true }], ngImport: i0, template: `
335
+ @let _autoId = autoId();
336
+ @let _size = size();
337
+ @for (entry of entries(); track entry.key) {
338
+ @let _entryAutoId = _autoId ? _autoId + '-' + entry.key : null;
339
+ @let _iconOnly = iconOnlyCommands() && !!(entry.prefixIcon || entry.suffixIcon);
340
+ @let _title = iconOnlyCommands() ? (entry.title ?? entry.tooltip) : entry.title;
341
+ @if (entry.kind === 'leaf') {
342
+ <sd-button
343
+ class="action"
344
+ [class.action--dual-icon]="_iconOnly && !!entry.prefixIcon && !!entry.suffixIcon"
345
+ [type]="entry.type"
346
+ [color]="entry.color"
347
+ [size]="_size"
348
+ [title]="_iconOnly ? undefined : _title"
349
+ [tooltip]="_iconOnly ? (entry.tooltip ?? entry.title) : entry.tooltip"
350
+ [prefixIcon]="entry.prefixIcon"
351
+ [suffixIcon]="entry.suffixIcon"
352
+ [fontSet]="entry.fontSet"
353
+ [disabled]="entry.disabled"
354
+ [loading]="entry.loading"
355
+ [attr.data-autoid]="_entryAutoId"
356
+ (click)="run(entry.definition)" />
357
+ } @else {
358
+ <sd-button
359
+ class="action action--group"
360
+ [class.action--dual-icon]="_iconOnly && !!entry.prefixIcon && !!entry.suffixIcon"
361
+ [type]="entry.type"
362
+ [color]="entry.color"
363
+ [size]="_size"
364
+ [title]="_iconOnly ? undefined : _title"
365
+ [tooltip]="_iconOnly ? (entry.tooltip ?? entry.title) : entry.tooltip"
366
+ [prefixIcon]="entry.prefixIcon"
367
+ [suffixIcon]="entry.suffixIcon"
368
+ [fontSet]="entry.fontSet"
369
+ [disabled]="entry.disabled"
370
+ [loading]="entry.loading"
371
+ [attr.data-autoid]="_entryAutoId">
372
+ @for (child of entry.children; track child.key) {
373
+ <sd-button-item
374
+ [color]="child.color"
375
+ [prefixIcon]="child.prefixIcon"
376
+ [suffixIcon]="child.suffixIcon"
377
+ [fontSet]="child.fontSet"
378
+ [tooltip]="child.tooltip"
379
+ [disabled]="child.disabled"
380
+ [autoId]="_entryAutoId ? _entryAutoId + '-' + child.key : null"
381
+ (click)="run(child.definition, entry.definition)">
382
+ <!-- why: sd-button-item has no loading input; a busy item shows a spinner here and is disabled. -->
383
+ @if (child.loading) {
384
+ <span class="spinner" aria-hidden="true"></span>
385
+ }
386
+ {{ child.label }}
387
+ @if (child.loading) {
388
+ <span class="visually-hidden">{{ loadingLabel() }}</span>
389
+ }
390
+ </sd-button-item>
391
+ }
392
+ </sd-button>
393
+ }
394
+ }
395
+ `, isInline: true, styles: [":host{display:inline-flex;flex-wrap:wrap;align-items:center;gap:2px;min-width:0;max-width:100%}sd-button{min-width:0;max-width:100%}:host ::ng-deep>sd-button>button.c-button{max-width:100%}:host ::ng-deep>sd-button.action--dual-icon>button.c-button.c-square{width:auto!important;padding-inline:6px!important}.spinner{display:inline-block;width:14px;height:14px;margin-inline-end:8px;vertical-align:-2px;border:2px solid color-mix(in srgb,currentColor 25%,transparent);border-top-color:currentColor;border-radius:50%;animation:sd-file-explorer-actions-spin .8s linear infinite}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}@keyframes sd-file-explorer-actions-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdButtonItem, selector: "sd-button-item", inputs: ["color", "prefixIcon", "suffixIcon", "fontSet", "disabled", "tooltip", "autoId"], outputs: ["click"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
396
+ }
397
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerActions, decorators: [{
398
+ type: Component,
399
+ args: [{ selector: 'sd-file-explorer-actions', standalone: true, imports: [SdButton, SdButtonItem], changeDetection: ChangeDetectionStrategy.OnPush, host: {
400
+ class: 'sd-file-explorer-actions',
401
+ '[class.sd-file-explorer-actions--open]': 'open()',
402
+ '[class.sd-file-explorer-actions--busy]': 'busy()',
403
+ }, template: `
404
+ @let _autoId = autoId();
405
+ @let _size = size();
406
+ @for (entry of entries(); track entry.key) {
407
+ @let _entryAutoId = _autoId ? _autoId + '-' + entry.key : null;
408
+ @let _iconOnly = iconOnlyCommands() && !!(entry.prefixIcon || entry.suffixIcon);
409
+ @let _title = iconOnlyCommands() ? (entry.title ?? entry.tooltip) : entry.title;
410
+ @if (entry.kind === 'leaf') {
411
+ <sd-button
412
+ class="action"
413
+ [class.action--dual-icon]="_iconOnly && !!entry.prefixIcon && !!entry.suffixIcon"
414
+ [type]="entry.type"
415
+ [color]="entry.color"
416
+ [size]="_size"
417
+ [title]="_iconOnly ? undefined : _title"
418
+ [tooltip]="_iconOnly ? (entry.tooltip ?? entry.title) : entry.tooltip"
419
+ [prefixIcon]="entry.prefixIcon"
420
+ [suffixIcon]="entry.suffixIcon"
421
+ [fontSet]="entry.fontSet"
422
+ [disabled]="entry.disabled"
423
+ [loading]="entry.loading"
424
+ [attr.data-autoid]="_entryAutoId"
425
+ (click)="run(entry.definition)" />
426
+ } @else {
427
+ <sd-button
428
+ class="action action--group"
429
+ [class.action--dual-icon]="_iconOnly && !!entry.prefixIcon && !!entry.suffixIcon"
430
+ [type]="entry.type"
431
+ [color]="entry.color"
432
+ [size]="_size"
433
+ [title]="_iconOnly ? undefined : _title"
434
+ [tooltip]="_iconOnly ? (entry.tooltip ?? entry.title) : entry.tooltip"
435
+ [prefixIcon]="entry.prefixIcon"
436
+ [suffixIcon]="entry.suffixIcon"
437
+ [fontSet]="entry.fontSet"
438
+ [disabled]="entry.disabled"
439
+ [loading]="entry.loading"
440
+ [attr.data-autoid]="_entryAutoId">
441
+ @for (child of entry.children; track child.key) {
442
+ <sd-button-item
443
+ [color]="child.color"
444
+ [prefixIcon]="child.prefixIcon"
445
+ [suffixIcon]="child.suffixIcon"
446
+ [fontSet]="child.fontSet"
447
+ [tooltip]="child.tooltip"
448
+ [disabled]="child.disabled"
449
+ [autoId]="_entryAutoId ? _entryAutoId + '-' + child.key : null"
450
+ (click)="run(child.definition, entry.definition)">
451
+ <!-- why: sd-button-item has no loading input; a busy item shows a spinner here and is disabled. -->
452
+ @if (child.loading) {
453
+ <span class="spinner" aria-hidden="true"></span>
454
+ }
455
+ {{ child.label }}
456
+ @if (child.loading) {
457
+ <span class="visually-hidden">{{ loadingLabel() }}</span>
458
+ }
459
+ </sd-button-item>
460
+ }
461
+ </sd-button>
462
+ }
463
+ }
464
+ `, styles: [":host{display:inline-flex;flex-wrap:wrap;align-items:center;gap:2px;min-width:0;max-width:100%}sd-button{min-width:0;max-width:100%}:host ::ng-deep>sd-button>button.c-button{max-width:100%}:host ::ng-deep>sd-button.action--dual-icon>button.c-button.c-square{width:auto!important;padding-inline:6px!important}.spinner{display:inline-block;width:14px;height:14px;margin-inline-end:8px;vertical-align:-2px;border:2px solid color-mix(in srgb,currentColor 25%,transparent);border-top-color:currentColor;border-radius:50%;animation:sd-file-explorer-actions-spin .8s linear infinite}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}@keyframes sd-file-explorer-actions-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"] }]
465
+ }], propDecorators: { actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: true }] }], defaultLeafType: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultLeafType", required: false }] }], defaultGroupType: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultGroupType", required: false }] }], defaultColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultColor", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], buttons: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => SdButton), { isSignal: true }] }] } });
466
+
467
+ /** List-only custom metadata column. Pass the parent option as its required type anchor. */
468
+ // Public column-definition name follows the reviewed Explorer contract.
469
+ // eslint-disable-next-line @angular-eslint/directive-class-suffix
470
+ class SdFileExplorerColumnDef {
471
+ id = input.required({ ...(ngDevMode ? { debugName: "id" } : /* istanbul ignore next */ {}), alias: 'sdFileExplorerColumnDef' });
472
+ for = input.required({ ...(ngDevMode ? { debugName: "for" } : /* istanbul ignore next */ {}), alias: 'sdFileExplorerColumnFor' });
473
+ title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
474
+ width = input('160px', ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
475
+ template = inject(TemplateRef);
476
+ static ngTemplateContextGuard(_directive, _context) {
477
+ return true;
478
+ }
479
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerColumnDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
480
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.17", type: SdFileExplorerColumnDef, isStandalone: true, selector: "ng-template[sdFileExplorerColumnDef]", inputs: { id: { classPropertyName: "id", publicName: "sdFileExplorerColumnDef", isSignal: true, isRequired: true, transformFunction: null }, for: { classPropertyName: "for", publicName: "sdFileExplorerColumnFor", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
481
+ }
482
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerColumnDef, decorators: [{
483
+ type: Directive,
484
+ args: [{ selector: 'ng-template[sdFileExplorerColumnDef]', standalone: true }]
485
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "sdFileExplorerColumnDef", required: true }] }], for: [{ type: i0.Input, args: [{ isSignal: true, alias: "sdFileExplorerColumnFor", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }] } });
10
486
 
11
487
  // AUTO-GENERATED by scripts/generate-file-explorer-icons.mjs from ./assets/icons. DO NOT EDIT.
12
488
  // Run `npm run generate:file-explorer-icons` at the repo root after changing the SVG files or manifest.json.
@@ -351,11 +827,15 @@ function sdFileExplorerParseDate(value) {
351
827
  const date = value instanceof Date ? value : new Date(value);
352
828
  return Number.isNaN(date.getTime()) ? null : date;
353
829
  }
830
+ const zonedOf = (dateTime) => (dateTime && dateTime.timeZone !== 'local' ? dateTime : undefined);
354
831
  /**
355
832
  * Compact modification date: "today" / "yesterday" labels, day + month within the current year,
356
833
  * full date otherwise. Order of day and month follows the locale.
357
834
  */
358
- function sdFileExplorerFormatDate(value, now, locale, labels) {
835
+ function sdFileExplorerFormatDate(value, now, locale, labels, dateTime) {
836
+ const zoned = zonedOf(dateTime);
837
+ if (zoned)
838
+ return formatZonedDate(value, now, locale, labels, zoned);
359
839
  const date = sdFileExplorerParseDate(value);
360
840
  if (!date)
361
841
  return '';
@@ -366,26 +846,39 @@ function sdFileExplorerFormatDate(value, now, locale, labels) {
366
846
  return labels.today;
367
847
  if (day === new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1).getTime())
368
848
  return labels.yesterday;
369
- const options = date.getFullYear() === now.getFullYear() ? { day: '2-digit', month: '2-digit' } : { day: '2-digit', month: '2-digit', year: 'numeric' };
849
+ return dayMonthYear(date, locale, date.getFullYear() === now.getFullYear());
850
+ }
851
+ /** Calendar days of the configured zone; yesterday is the day of the last millisecond before today began there. */
852
+ function formatZonedDate(value, now, locale, labels, zoned) {
853
+ const date = value === null || value === undefined || value === '' ? null : zoned.parse(value);
854
+ if (!date)
855
+ return '';
856
+ const day = zoned.toFormat(date, 'yyyy/MM/dd');
857
+ if (day === zoned.toFormat(now, 'yyyy/MM/dd'))
858
+ return labels.today;
859
+ if (day === zoned.toFormat(zoned.begin(now).getTime() - 1, 'yyyy/MM/dd'))
860
+ return labels.yesterday;
861
+ return dayMonthYear(date, locale, zoned.toFormat(date, 'yyyy') === zoned.toFormat(now, 'yyyy'), zoned.timeZone);
862
+ }
863
+ function dayMonthYear(date, locale, sameYear, timeZone) {
864
+ const options = sameYear
865
+ ? { day: '2-digit', month: '2-digit' }
866
+ : { day: '2-digit', month: '2-digit', year: 'numeric' };
370
867
  // why: lấy THỨ TỰ ngày/tháng theo locale nhưng luôn nối bằng "/" — Chrome format vi-VN ngày+tháng thành "21-09".
371
- return new Intl.DateTimeFormat(locale, options)
868
+ return new Intl.DateTimeFormat(locale, timeZone ? { ...options, timeZone } : options)
372
869
  .formatToParts(date)
373
870
  .filter(part => part.type === 'day' || part.type === 'month' || part.type === 'year')
374
871
  .map(part => part.value)
375
872
  .join('/');
376
873
  }
377
874
  /** Full date and time, used as tooltip and in the preview metadata. */
378
- function sdFileExplorerFormatDateTime(value, locale) {
379
- const date = sdFileExplorerParseDate(value);
875
+ function sdFileExplorerFormatDateTime(value, locale, dateTime) {
876
+ const zoned = zonedOf(dateTime);
877
+ const date = zoned ? (value === null || value === undefined || value === '' ? null : zoned.parse(value)) : sdFileExplorerParseDate(value);
380
878
  if (!date)
381
879
  return '';
382
- return new Intl.DateTimeFormat(locale, {
383
- day: '2-digit',
384
- month: '2-digit',
385
- year: 'numeric',
386
- hour: '2-digit',
387
- minute: '2-digit',
388
- }).format(date);
880
+ const options = { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' };
881
+ return new Intl.DateTimeFormat(locale, zoned ? { ...options, timeZone: zoned.timeZone } : options).format(date);
389
882
  }
390
883
  /** Lower-cases and strips Vietnamese accents so "tai lieu" matches "Tài liệu". */
391
884
  function sdFileExplorerNormalize(value) {
@@ -443,25 +936,375 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
443
936
  }, template: `<img [src]="src()" alt="" draggable="false" />`, styles: [":host{display:inline-flex;flex:none;width:var(--sd-file-explorer-icon-size, 32px);height:var(--sd-file-explorer-icon-size, 32px)}img{display:block;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;user-select:none}\n"] }]
444
937
  }], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
445
938
 
939
+ /** Never the whole viewport: a strip of backdrop stays visible to tap the drawer away. */
940
+ const SHEET_WIDTH = 'min(400px, calc(100vw - 56px))';
941
+ let nextSheetId = 0;
942
+ /**
943
+ * Command drawer of the compact layout (internal): the commands of one item in a Core `<sd-side-drawer>` that covers
944
+ * the viewport — portalled to `<body>`, with its backdrop, `Escape`, close button, focus trap and page scroll lock.
945
+ *
946
+ * The explorer owns the item and decides when the drawer opens and closes: `show()` / `hide()`. The drawer lists the
947
+ * same commands as the desktop buttons, as menu-like entries; a group is a labelled section with its children. A
948
+ * pressed entry is only reported (`activate`): the explorer checks it again, closes the drawer and runs it. `close`
949
+ * reports that the user closed the drawer (close button, `Escape`, backdrop).
950
+ *
951
+ * Content projected into the drawer belongs to this view, so its encapsulated styles still apply in `<body>`; the
952
+ * drawer element itself is styled through the class this component passes as `drawerClass`.
953
+ */
954
+ class SdFileExplorerCommandSheet {
955
+ #i18n = inject(I18nService);
956
+ /** Content for the item whose commands are shown; `null` while nothing is open. */
957
+ sheet = input(null, ...(ngDevMode ? [{ debugName: "sheet" }] : /* istanbul ignore next */ []));
958
+ /** Touch screen: 48 px entries and a 44 px close button. */
959
+ touch = input(false, ...(ngDevMode ? [{ debugName: "touch" }] : /* istanbul ignore next */ []));
960
+ /** E2E scope of the content and its entries. */
961
+ autoId = input(undefined, ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
962
+ /** An entry was pressed. Nothing has run yet. */
963
+ activate = output();
964
+ /** The user closed the drawer (close button, `Escape` or backdrop). */
965
+ close = output();
966
+ // why: query signal, not an ES private field — Angular queries need a TypeScript `private` member.
967
+ drawer = viewChild.required(SdSideDrawer);
968
+ width = SHEET_WIDTH;
969
+ sheetId = `sd-file-explorer-commands-${nextSheetId++}`;
970
+ // why: sd-side-drawer renders in <body>, out of reach of this view's encapsulated styles. The explorer-owned class
971
+ // scopes the few rules aimed at the drawer itself (the close button size) to this drawer only.
972
+ drawerClass = computed(() => ({
973
+ 'sd-file-explorer-command-drawer': true,
974
+ 'sd-file-explorer-command-drawer--touch': this.touch(),
975
+ }), ...(ngDevMode ? [{ debugName: "drawerClass" }] : /* istanbul ignore next */ []));
976
+ // why: sd-side-drawer adds its own `components-side-drawer-` prefix; drop the explorer's `components-` to avoid a repeat.
977
+ drawerAutoId = computed(() => this.autoId()?.replace(/^components-/, ''), ...(ngDevMode ? [{ debugName: "drawerAutoId" }] : /* istanbul ignore next */ []));
978
+ loadingLabel = computed(() => this.#i18n.t('core.component.file-explorer.action-loading'), ...(ngDevMode ? [{ debugName: "loadingLabel" }] : /* istanbul ignore next */ []));
979
+ /** Opens the drawer; its content follows `sheet`. */
980
+ show() {
981
+ this.drawer().open();
982
+ }
983
+ /** Closes the drawer at once — focus trap, backdrop and page scroll lock included — without reporting `close`. */
984
+ hide() {
985
+ const drawer = this.drawer();
986
+ if (drawer.isOpened())
987
+ drawer.forceClose();
988
+ }
989
+ accent(color) {
990
+ return color ? `var(--sd-${color})` : null;
991
+ }
992
+ onDrawerClosed() {
993
+ // Closed by the explorer (it has already let go of the item) or by the user: the explorer tells them apart.
994
+ if (this.sheet())
995
+ this.close.emit();
996
+ }
997
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerCommandSheet, deps: [], target: i0.ɵɵFactoryTarget.Component });
998
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdFileExplorerCommandSheet, isStandalone: true, selector: "sd-file-explorer-command-sheet", inputs: { sheet: { classPropertyName: "sheet", publicName: "sheet", isSignal: true, isRequired: false, transformFunction: null }, touch: { classPropertyName: "touch", publicName: "touch", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activate: "activate", close: "close" }, host: { classAttribute: "sd-file-explorer-command-sheet" }, viewQueries: [{ propertyName: "drawer", first: true, predicate: SdSideDrawer, descendants: true, isSignal: true }], ngImport: i0, template: `
999
+ @let _sheet = sheet();
1000
+ @let _autoId = autoId();
1001
+ <sd-side-drawer
1002
+ [width]="width"
1003
+ [title]="_sheet?.title ?? ''"
1004
+ [drawerClass]="drawerClass()"
1005
+ [autoId]="drawerAutoId()"
1006
+ (sdClosed)="onDrawerClosed()">
1007
+ @if (_sheet) {
1008
+ <div class="sheet" [class.sheet--touch]="touch()" [attr.data-autoid]="_autoId ?? null">
1009
+ <p class="context">
1010
+ <sd-file-explorer-file-icon [icon]="_sheet.icon" [size]="24" />
1011
+ <span class="context-text">{{ _sheet.context }}</span>
1012
+ </p>
1013
+ <div class="entries">
1014
+ @for (entry of _sheet.entries; track entry.key) {
1015
+ @if (entry.kind === 'group') {
1016
+ @let _labelId = sheetId + '-group-' + entry.key;
1017
+ <div
1018
+ class="group"
1019
+ role="group"
1020
+ [attr.aria-labelledby]="entry.loading ? _labelId + ' ' + _labelId + '-busy' : _labelId"
1021
+ [attr.aria-disabled]="entry.disabled ? true : null"
1022
+ [attr.aria-busy]="entry.loading ? true : null">
1023
+ <!-- why: the heading is not a control: text only, so it never repeats the icon of a child (a "Share"
1024
+ group over a "Share" item). The group's icon stays on its desktop trigger; a busy group still
1025
+ shows its spinner and says "in progress". -->
1026
+ <p class="group-label">
1027
+ @if (entry.loading) {
1028
+ <span class="spinner" aria-hidden="true"></span>
1029
+ }
1030
+ <span class="group-title" [id]="_labelId">{{ entry.label }}</span>
1031
+ @if (entry.loading) {
1032
+ <span class="visually-hidden" [id]="_labelId + '-busy'">{{ loadingLabel() }}</span>
1033
+ }
1034
+ </p>
1035
+ @for (child of entry.children; track child.key) {
1036
+ <ng-container
1037
+ [ngTemplateOutlet]="command"
1038
+ [ngTemplateOutletContext]="{
1039
+ $implicit: child,
1040
+ group: entry,
1041
+ autoId: _autoId ? _autoId + '-' + entry.key + '-' + child.key : null,
1042
+ }" />
1043
+ }
1044
+ </div>
1045
+ } @else {
1046
+ <ng-container
1047
+ [ngTemplateOutlet]="command"
1048
+ [ngTemplateOutletContext]="{ $implicit: entry, group: null, autoId: _autoId ? _autoId + '-' + entry.key : null }" />
1049
+ }
1050
+ }
1051
+ </div>
1052
+ </div>
1053
+ }
1054
+ </sd-side-drawer>
1055
+
1056
+ <!-- One entry: neutral label, icons in the declared color (as Core menu items), spinner + hidden text while loading. -->
1057
+ <ng-template #command let-command let-group="group" let-entryAutoId="autoId">
1058
+ <button
1059
+ type="button"
1060
+ class="command"
1061
+ [disabled]="command.disabled"
1062
+ [style.--sd-fe-command-accent]="accent(command.color)"
1063
+ [attr.data-autoid]="entryAutoId"
1064
+ (click)="activate.emit({ command, group })">
1065
+ @if (command.loading) {
1066
+ <span class="spinner" aria-hidden="true"></span>
1067
+ } @else if (command.prefixIcon) {
1068
+ <sd-icon class="command-icon" size="20px" [name]="command.prefixIcon" [fontSet]="command.fontSet" />
1069
+ }
1070
+ <span class="command-label">{{ command.label }}</span>
1071
+ @if (command.suffixIcon && !command.loading) {
1072
+ <sd-icon class="command-icon" size="20px" [name]="command.suffixIcon" [fontSet]="command.fontSet" />
1073
+ }
1074
+ @if (command.loading) {
1075
+ <span class="visually-hidden">{{ loadingLabel() }}</span>
1076
+ }
1077
+ </button>
1078
+ </ng-template>
1079
+ `, isInline: true, styles: [".sheet{display:flex;flex-direction:column;gap:12px;padding-bottom:env(safe-area-inset-bottom,0px)}.context{display:flex;align-items:center;gap:8px;margin:0;color:var(--sd-text-secondary, #44474f);font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px)}.context-text{min-width:0;overflow-wrap:anywhere}.entries{display:flex;flex-direction:column;gap:2px;margin:0 -8px}.group{display:flex;flex-direction:column;gap:2px;padding-block:4px;border-block:1px solid var(--sd-border, #dde0e5)}.group:first-child{padding-top:0;border-top:0}.group:last-child{padding-bottom:0;border-bottom:0}.group+.group{border-top:0}.group-label{display:flex;align-items:center;gap:8px;margin:0;padding:8px 8px 4px;color:var(--sd-text-secondary, #44474f);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-16, 16px);overflow-wrap:anywhere}.group-title{min-width:0}.command{display:flex;align-items:center;gap:12px;box-sizing:border-box;width:100%;min-height:44px;padding:10px 8px;border:0;border-radius:var(--sd-radius-8, 8px);background:transparent;color:inherit;font:inherit;font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);text-align:start;overflow-wrap:anywhere;cursor:pointer;-webkit-tap-highlight-color:transparent}.command:hover:not(:disabled),.command:focus-visible{background:color-mix(in srgb,var(--sd-fe-command-accent, var(--sd-text, #1a1b1f)) 8%,transparent)}.command:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.command:disabled{opacity:.45;cursor:default}.sheet--touch .command{min-height:48px}.command-label{flex:1;min-width:0}.command-icon{flex:none;color:var(--sd-fe-command-accent, inherit)}.spinner{flex:none;width:16px;height:16px;margin:2px;box-sizing:border-box;border:2px solid color-mix(in srgb,currentColor 25%,transparent);border-top-color:currentColor;border-radius:50%;animation:sd-file-explorer-command-spin .8s linear infinite}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}::ng-deep .sd-side-drawer.sd-file-explorer-command-drawer .sd-side-drawer-header{background-color:var(--sd-side-drawer-surface, var(--sd-surface, #ffffff))}::ng-deep .sd-side-drawer.sd-file-explorer-command-drawer--touch .sd-side-drawer-close-btn{width:44px;height:44px}@keyframes sd-file-explorer-command-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "container", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1080
+ }
1081
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerCommandSheet, decorators: [{
1082
+ type: Component,
1083
+ args: [{ selector: 'sd-file-explorer-command-sheet', standalone: true, imports: [NgTemplateOutlet, SdIcon, SdSideDrawer, SdFileExplorerFileIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
1084
+ class: 'sd-file-explorer-command-sheet',
1085
+ }, template: `
1086
+ @let _sheet = sheet();
1087
+ @let _autoId = autoId();
1088
+ <sd-side-drawer
1089
+ [width]="width"
1090
+ [title]="_sheet?.title ?? ''"
1091
+ [drawerClass]="drawerClass()"
1092
+ [autoId]="drawerAutoId()"
1093
+ (sdClosed)="onDrawerClosed()">
1094
+ @if (_sheet) {
1095
+ <div class="sheet" [class.sheet--touch]="touch()" [attr.data-autoid]="_autoId ?? null">
1096
+ <p class="context">
1097
+ <sd-file-explorer-file-icon [icon]="_sheet.icon" [size]="24" />
1098
+ <span class="context-text">{{ _sheet.context }}</span>
1099
+ </p>
1100
+ <div class="entries">
1101
+ @for (entry of _sheet.entries; track entry.key) {
1102
+ @if (entry.kind === 'group') {
1103
+ @let _labelId = sheetId + '-group-' + entry.key;
1104
+ <div
1105
+ class="group"
1106
+ role="group"
1107
+ [attr.aria-labelledby]="entry.loading ? _labelId + ' ' + _labelId + '-busy' : _labelId"
1108
+ [attr.aria-disabled]="entry.disabled ? true : null"
1109
+ [attr.aria-busy]="entry.loading ? true : null">
1110
+ <!-- why: the heading is not a control: text only, so it never repeats the icon of a child (a "Share"
1111
+ group over a "Share" item). The group's icon stays on its desktop trigger; a busy group still
1112
+ shows its spinner and says "in progress". -->
1113
+ <p class="group-label">
1114
+ @if (entry.loading) {
1115
+ <span class="spinner" aria-hidden="true"></span>
1116
+ }
1117
+ <span class="group-title" [id]="_labelId">{{ entry.label }}</span>
1118
+ @if (entry.loading) {
1119
+ <span class="visually-hidden" [id]="_labelId + '-busy'">{{ loadingLabel() }}</span>
1120
+ }
1121
+ </p>
1122
+ @for (child of entry.children; track child.key) {
1123
+ <ng-container
1124
+ [ngTemplateOutlet]="command"
1125
+ [ngTemplateOutletContext]="{
1126
+ $implicit: child,
1127
+ group: entry,
1128
+ autoId: _autoId ? _autoId + '-' + entry.key + '-' + child.key : null,
1129
+ }" />
1130
+ }
1131
+ </div>
1132
+ } @else {
1133
+ <ng-container
1134
+ [ngTemplateOutlet]="command"
1135
+ [ngTemplateOutletContext]="{ $implicit: entry, group: null, autoId: _autoId ? _autoId + '-' + entry.key : null }" />
1136
+ }
1137
+ }
1138
+ </div>
1139
+ </div>
1140
+ }
1141
+ </sd-side-drawer>
1142
+
1143
+ <!-- One entry: neutral label, icons in the declared color (as Core menu items), spinner + hidden text while loading. -->
1144
+ <ng-template #command let-command let-group="group" let-entryAutoId="autoId">
1145
+ <button
1146
+ type="button"
1147
+ class="command"
1148
+ [disabled]="command.disabled"
1149
+ [style.--sd-fe-command-accent]="accent(command.color)"
1150
+ [attr.data-autoid]="entryAutoId"
1151
+ (click)="activate.emit({ command, group })">
1152
+ @if (command.loading) {
1153
+ <span class="spinner" aria-hidden="true"></span>
1154
+ } @else if (command.prefixIcon) {
1155
+ <sd-icon class="command-icon" size="20px" [name]="command.prefixIcon" [fontSet]="command.fontSet" />
1156
+ }
1157
+ <span class="command-label">{{ command.label }}</span>
1158
+ @if (command.suffixIcon && !command.loading) {
1159
+ <sd-icon class="command-icon" size="20px" [name]="command.suffixIcon" [fontSet]="command.fontSet" />
1160
+ }
1161
+ @if (command.loading) {
1162
+ <span class="visually-hidden">{{ loadingLabel() }}</span>
1163
+ }
1164
+ </button>
1165
+ </ng-template>
1166
+ `, styles: [".sheet{display:flex;flex-direction:column;gap:12px;padding-bottom:env(safe-area-inset-bottom,0px)}.context{display:flex;align-items:center;gap:8px;margin:0;color:var(--sd-text-secondary, #44474f);font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px)}.context-text{min-width:0;overflow-wrap:anywhere}.entries{display:flex;flex-direction:column;gap:2px;margin:0 -8px}.group{display:flex;flex-direction:column;gap:2px;padding-block:4px;border-block:1px solid var(--sd-border, #dde0e5)}.group:first-child{padding-top:0;border-top:0}.group:last-child{padding-bottom:0;border-bottom:0}.group+.group{border-top:0}.group-label{display:flex;align-items:center;gap:8px;margin:0;padding:8px 8px 4px;color:var(--sd-text-secondary, #44474f);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-16, 16px);overflow-wrap:anywhere}.group-title{min-width:0}.command{display:flex;align-items:center;gap:12px;box-sizing:border-box;width:100%;min-height:44px;padding:10px 8px;border:0;border-radius:var(--sd-radius-8, 8px);background:transparent;color:inherit;font:inherit;font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);text-align:start;overflow-wrap:anywhere;cursor:pointer;-webkit-tap-highlight-color:transparent}.command:hover:not(:disabled),.command:focus-visible{background:color-mix(in srgb,var(--sd-fe-command-accent, var(--sd-text, #1a1b1f)) 8%,transparent)}.command:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.command:disabled{opacity:.45;cursor:default}.sheet--touch .command{min-height:48px}.command-label{flex:1;min-width:0}.command-icon{flex:none;color:var(--sd-fe-command-accent, inherit)}.spinner{flex:none;width:16px;height:16px;margin:2px;box-sizing:border-box;border:2px solid color-mix(in srgb,currentColor 25%,transparent);border-top-color:currentColor;border-radius:50%;animation:sd-file-explorer-command-spin .8s linear infinite}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}::ng-deep .sd-side-drawer.sd-file-explorer-command-drawer .sd-side-drawer-header{background-color:var(--sd-side-drawer-surface, var(--sd-surface, #ffffff))}::ng-deep .sd-side-drawer.sd-file-explorer-command-drawer--touch .sd-side-drawer-close-btn{width:44px;height:44px}@keyframes sd-file-explorer-command-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"] }]
1167
+ }], propDecorators: { sheet: [{ type: i0.Input, args: [{ isSignal: true, alias: "sheet", required: false }] }], touch: [{ type: i0.Input, args: [{ isSignal: true, alias: "touch", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], activate: [{ type: i0.Output, args: ["activate"] }], close: [{ type: i0.Output, args: ["close"] }], drawer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdSideDrawer), { isSignal: true }] }] } });
1168
+
1169
+ /**
1170
+ * Compact actions trigger of one row, card or tree node (internal): a `more_vert` icon button that asks the explorer to
1171
+ * open the item's command drawer, emitting itself so focus can come back to it when the drawer closes.
1172
+ *
1173
+ * While one of the item's commands is loading it shows a spinner instead of the icon and stays clickable, so the drawer
1174
+ * can still show which command is busy and run the others.
1175
+ */
1176
+ class SdFileExplorerMenuTrigger {
1177
+ #i18n = inject(I18nService);
1178
+ /** Accessible name and tooltip: "Actions for {name}" ("… (In progress)" while busy). */
1179
+ label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
1180
+ /** One of the item's commands is loading. */
1181
+ busy = input(false, ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
1182
+ /** The item's command drawer is open. */
1183
+ expanded = input(false, ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
1184
+ /** Touch screen: 48 px target, no tooltip. */
1185
+ touch = input(false, ...(ngDevMode ? [{ debugName: "touch" }] : /* istanbul ignore next */ []));
1186
+ /** `null` keeps the button in the tab order; the tree passes `-1` for every node but its tab stop. */
1187
+ tabIndex = input(null, ...(ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []));
1188
+ autoId = input(undefined, ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
1189
+ /** Pressed: emits the native button, the element focus returns to. */
1190
+ activate = output();
1191
+ accessibleName = computed(() => this.busy() ? `${this.label()} (${this.#i18n.t('core.component.file-explorer.action-loading')})` : this.label(), ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
1192
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerMenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Component });
1193
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdFileExplorerMenuTrigger, isStandalone: true, selector: "sd-file-explorer-menu-trigger", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, busy: { classPropertyName: "busy", publicName: "busy", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, touch: { classPropertyName: "touch", publicName: "touch", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activate: "activate" }, host: { properties: { "class.sd-file-explorer-menu-trigger--touch": "touch()" }, classAttribute: "sd-file-explorer-menu-trigger" }, ngImport: i0, template: `
1194
+ <!-- why: no tooltip on touch screens — MatTooltip would take over touch gestures (touch-action: none) and block
1195
+ scrolling the list from the button; the accessible name is there either way. The tooltip repeats the name, so
1196
+ Material does not add it as a description read twice. -->
1197
+ <button
1198
+ #button
1199
+ type="button"
1200
+ class="trigger"
1201
+ aria-haspopup="dialog"
1202
+ [attr.aria-expanded]="expanded()"
1203
+ [attr.aria-label]="accessibleName()"
1204
+ [attr.tabindex]="tabIndex()"
1205
+ [attr.data-autoid]="autoId() ?? null"
1206
+ [matTooltip]="accessibleName()"
1207
+ [matTooltipDisabled]="touch()"
1208
+ (click)="activate.emit(button)">
1209
+ @if (busy()) {
1210
+ <span class="spinner" aria-hidden="true"></span>
1211
+ } @else {
1212
+ <sd-icon name="more_vert" size="20px" />
1213
+ }
1214
+ </button>
1215
+ `, isInline: true, styles: [":host{display:inline-flex;flex:none}.trigger{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary, var(--sd-text-secondary, #44474f));cursor:pointer;-webkit-tap-highlight-color:transparent}.trigger:hover,.trigger[aria-expanded=true]{background:var(--sd-fe-hover-strong, rgba(26, 27, 31, .08));color:var(--sd-fe-text, var(--sd-text, #1a1b1f))}.trigger:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-file-explorer-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}:host(.sd-file-explorer-menu-trigger--touch) .trigger{width:var(--sd-space-48, 48px);height:var(--sd-space-48, 48px)}.spinner{width:16px;height:16px;box-sizing:border-box;border:2px solid color-mix(in srgb,currentColor 25%,transparent);border-top-color:currentColor;border-radius:50%;animation:sd-file-explorer-menu-trigger-spin .8s linear infinite}@keyframes sd-file-explorer-menu-trigger-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"], dependencies: [{ kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1216
+ }
1217
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerMenuTrigger, decorators: [{
1218
+ type: Component,
1219
+ args: [{ selector: 'sd-file-explorer-menu-trigger', standalone: true, imports: [MatTooltip, SdIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
1220
+ class: 'sd-file-explorer-menu-trigger',
1221
+ '[class.sd-file-explorer-menu-trigger--touch]': 'touch()',
1222
+ }, template: `
1223
+ <!-- why: no tooltip on touch screens — MatTooltip would take over touch gestures (touch-action: none) and block
1224
+ scrolling the list from the button; the accessible name is there either way. The tooltip repeats the name, so
1225
+ Material does not add it as a description read twice. -->
1226
+ <button
1227
+ #button
1228
+ type="button"
1229
+ class="trigger"
1230
+ aria-haspopup="dialog"
1231
+ [attr.aria-expanded]="expanded()"
1232
+ [attr.aria-label]="accessibleName()"
1233
+ [attr.tabindex]="tabIndex()"
1234
+ [attr.data-autoid]="autoId() ?? null"
1235
+ [matTooltip]="accessibleName()"
1236
+ [matTooltipDisabled]="touch()"
1237
+ (click)="activate.emit(button)">
1238
+ @if (busy()) {
1239
+ <span class="spinner" aria-hidden="true"></span>
1240
+ } @else {
1241
+ <sd-icon name="more_vert" size="20px" />
1242
+ }
1243
+ </button>
1244
+ `, styles: [":host{display:inline-flex;flex:none}.trigger{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary, var(--sd-text-secondary, #44474f));cursor:pointer;-webkit-tap-highlight-color:transparent}.trigger:hover,.trigger[aria-expanded=true]{background:var(--sd-fe-hover-strong, rgba(26, 27, 31, .08));color:var(--sd-fe-text, var(--sd-text, #1a1b1f))}.trigger:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-file-explorer-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}:host(.sd-file-explorer-menu-trigger--touch) .trigger{width:var(--sd-space-48, 48px);height:var(--sd-space-48, 48px)}.spinner{width:16px;height:16px;box-sizing:border-box;border:2px solid color-mix(in srgb,currentColor 25%,transparent);border-top-color:currentColor;border-radius:50%;animation:sd-file-explorer-menu-trigger-spin .8s linear infinite}@keyframes sd-file-explorer-menu-trigger-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"] }]
1245
+ }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], busy: [{ type: i0.Input, args: [{ isSignal: true, alias: "busy", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], touch: [{ type: i0.Input, args: [{ isSignal: true, alias: "touch", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], activate: [{ type: i0.Output, args: ["activate"] }] } });
1246
+
1247
+ let nextTreeId = 0;
1248
+ /** Events from a folder command (or the space between them), or from the compact actions trigger, belong to it. */
1249
+ const COMMAND_AREAS = '.node-actions, .sd-file-explorer-menu-trigger';
446
1250
  /**
447
1251
  * Folder tree of the explorer (internal). Rendered as a flat `role="tree"` list whose depth is carried by
448
1252
  * `aria-level`, with a roving tabindex and the WAI-ARIA tree keyboard model.
1253
+ *
1254
+ * Folder commands sit at the end of each folder node. On desktop they are rendered for the hovered or focused node
1255
+ * only — taking no room while hidden, so names keep the full width — and `Tab` from the focused node reaches them
1256
+ * while the tree keeps a single tab stop. A node with commands is named by its label alone and wraps its commands
1257
+ * onto a second line when they do not fit next to the name.
1258
+ *
1259
+ * In the compact layout a folder node carries one actions trigger instead, which asks the explorer for its command
1260
+ * drawer; only the trigger of the tab-stop node is in the tab order.
449
1261
  */
450
1262
  class SdFileExplorerFolderTree {
1263
+ moveDropTarget = input(...(ngDevMode ? [undefined, { debugName: "moveDropTarget" }] : /* istanbul ignore next */ []));
451
1264
  #host = inject(ElementRef);
452
1265
  #i18n = inject(I18nService);
1266
+ /** Prefix of the label ids that name nodes with commands. */
1267
+ treeId = `sd-file-explorer-tree-${nextTreeId++}`;
453
1268
  /** Visible nodes in display order. */
454
1269
  nodes = input.required(...(ngDevMode ? [{ debugName: "nodes" }] : /* istanbul ignore next */ []));
455
1270
  /** Accessible name of the tree. */
456
1271
  label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
1272
+ /** Commands of every folder node; the root has none. */
1273
+ commands = input(undefined, ...(ngDevMode ? [{ debugName: "commands" }] : /* istanbul ignore next */ []));
1274
+ /** Touch screen: commands always visible, with 48 px buttons (44 px compact trigger). */
1275
+ touch = input(false, ...(ngDevMode ? [{ debugName: "touch" }] : /* istanbul ignore next */ []));
1276
+ /** Compact layout: an actions trigger per folder node instead of its commands. */
1277
+ compact = input(false, ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
1278
+ /** Id of the folder whose command drawer is open from the tree. */
1279
+ menuOpenId = input(null, ...(ngDevMode ? [{ debugName: "menuOpenId" }] : /* istanbul ignore next */ []));
457
1280
  /** A node was activated (click, Enter, Space). */
458
1281
  select = output();
459
1282
  /** Expand / collapse requested. */
460
1283
  toggle = output();
461
1284
  /** Retry loading the children of a node whose listing failed. */
462
1285
  retry = output();
1286
+ /** Compact actions trigger of a folder pressed. */
1287
+ openCommands = output();
463
1288
  focusedKey = signal(null, ...(ngDevMode ? [{ debugName: "focusedKey" }] : /* istanbul ignore next */ []));
464
1289
  retryLabel = computed(() => this.#i18n.t('core.component.file-explorer.retry'), ...(ngDevMode ? [{ debugName: "retryLabel" }] : /* istanbul ignore next */ []));
1290
+ /**
1291
+ * Compact: trigger state per folder node key, for folders whose drawer would list something; `null` on desktop,
1292
+ * where the nodes render their commands.
1293
+ */
1294
+ menus = computed(() => {
1295
+ if (!this.compact())
1296
+ return null;
1297
+ const commands = this.commands();
1298
+ const menus = new Map();
1299
+ for (const node of this.nodes()) {
1300
+ if (!node.item)
1301
+ continue;
1302
+ const resolved = sdFileExplorerResolveActions(commands, node.item, SD_FILE_EXPLORER_COMMAND_DEFAULTS, 'folderCommands');
1303
+ if (resolved.length)
1304
+ menus.set(node.key, { busy: sdFileExplorerActionsBusy(resolved) });
1305
+ }
1306
+ return menus;
1307
+ }, ...(ngDevMode ? [{ debugName: "menus" }] : /* istanbul ignore next */ []));
465
1308
  /** Node owning the roving tabindex: the focused node if still visible, else the selected one. */
466
1309
  activeKey = computed(() => {
467
1310
  const nodes = this.nodes();
@@ -474,6 +1317,9 @@ class SdFileExplorerFolderTree {
474
1317
  const key = node.expanded ? 'core.component.file-explorer.collapse' : 'core.component.file-explorer.expand';
475
1318
  return this.#i18n.t(key, { name: node.name });
476
1319
  }
1320
+ menuLabel(node) {
1321
+ return this.#i18n.t('core.component.file-explorer.item-actions', { name: node.name });
1322
+ }
477
1323
  onToggle(event, node) {
478
1324
  // why: nút toggle nằm trong treeitem — chặn bubble để bấm mũi tên không đồng thời điều hướng vào thư mục.
479
1325
  event.stopPropagation();
@@ -483,7 +1329,15 @@ class SdFileExplorerFolderTree {
483
1329
  event.stopPropagation();
484
1330
  this.retry.emit(node);
485
1331
  }
1332
+ onClick(event, node) {
1333
+ if (this.#fromCommands(event))
1334
+ return;
1335
+ this.select.emit(node);
1336
+ }
486
1337
  onKeydown(event, index) {
1338
+ // why: phím bấm trên nút lệnh thuộc về nút đó — Enter/Space không được mở thư mục, mũi tên không được dời focus khỏi nút.
1339
+ if (this.#fromCommands(event))
1340
+ return;
487
1341
  const nodes = this.nodes();
488
1342
  const node = nodes[index];
489
1343
  if (!node)
@@ -537,16 +1391,35 @@ class SdFileExplorerFolderTree {
537
1391
  const element = this.#host.nativeElement.querySelectorAll('[role="treeitem"]')[index];
538
1392
  element?.focus();
539
1393
  }
1394
+ /** The event started on a folder command (or the space between them) or on the actions trigger of the node. */
1395
+ #fromCommands(event) {
1396
+ const target = event.target instanceof Element ? event.target : null;
1397
+ const area = target?.closest(COMMAND_AREAS);
1398
+ return !!area && event.currentTarget instanceof Element && event.currentTarget.contains(area);
1399
+ }
540
1400
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerFolderTree, deps: [], target: i0.ɵɵFactoryTarget.Component });
541
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdFileExplorerFolderTree, isStandalone: true, selector: "sd-file-explorer-folder-tree", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { select: "select", toggle: "toggle", retry: "retry" }, host: { classAttribute: "sd-file-explorer-folder-tree" }, ngImport: i0, template: `
1401
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdFileExplorerFolderTree, isStandalone: true, selector: "sd-file-explorer-folder-tree", inputs: { moveDropTarget: { classPropertyName: "moveDropTarget", publicName: "moveDropTarget", isSignal: true, isRequired: false, transformFunction: null }, nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, commands: { classPropertyName: "commands", publicName: "commands", isSignal: true, isRequired: false, transformFunction: null }, touch: { classPropertyName: "touch", publicName: "touch", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, menuOpenId: { classPropertyName: "menuOpenId", publicName: "menuOpenId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { select: "select", toggle: "toggle", retry: "retry", openCommands: "openCommands" }, host: { properties: { "class.sd-file-explorer-folder-tree--touch": "touch()", "class.sd-file-explorer-folder-tree--compact": "compact()" }, classAttribute: "sd-file-explorer-folder-tree" }, ngImport: i0, template: `
542
1402
  @let _nodes = nodes();
543
1403
  @let _active = activeKey();
1404
+ @let _commands = commands();
1405
+ @let _hasCommands = !!_commands?.length;
1406
+ @let _touch = touch();
1407
+ @let _commandSize = _touch ? 'lg' : 'sm';
1408
+ @let _menus = menus();
1409
+ @let _menuOpenId = menuOpenId();
544
1410
  <ul class="tree" role="tree" [attr.aria-label]="label()">
545
1411
  @for (node of _nodes; track node.key; let i = $index) {
1412
+ @let _nodeCommands = _hasCommands && !!node.item;
1413
+ @let _labelId = treeId + '-label-' + i;
546
1414
  <li
547
1415
  class="node"
548
1416
  role="treeitem"
1417
+ [attr.data-move-target]="node.id ?? ''"
1418
+ [class.move-drop-target]="moveDropTarget() === node.id"
549
1419
  [class.node--selected]="node.selected"
1420
+ [class.node--commands]="_nodeCommands"
1421
+ [class.node--error]="node.status === 'error'"
1422
+ [attr.aria-labelledby]="_nodeCommands ? _labelId : null"
550
1423
  [attr.aria-level]="node.level"
551
1424
  [attr.aria-selected]="node.selected"
552
1425
  [attr.aria-expanded]="node.expandable ? node.expanded : null"
@@ -554,7 +1427,7 @@ class SdFileExplorerFolderTree {
554
1427
  [attr.tabindex]="node.key === _active ? 0 : -1"
555
1428
  [attr.data-autoid]="node.autoId"
556
1429
  [style.--sd-file-explorer-tree-indent]="(node.level > 1 ? node.level - 2 : 0) * 22 + 'px'"
557
- (click)="select.emit(node)"
1430
+ (click)="onClick($event, node)"
558
1431
  (keydown)="onKeydown($event, i)"
559
1432
  (focus)="focusedKey.set(node.key)">
560
1433
  @if (node.level > 1) {
@@ -574,7 +1447,7 @@ class SdFileExplorerFolderTree {
574
1447
  }
575
1448
  }
576
1449
  <sd-file-explorer-file-icon [icon]="node.expanded ? 'folder-open' : 'folder-closed'" [size]="28" />
577
- <span class="label" [title]="node.name">{{ node.name }}</span>
1450
+ <span class="label" [id]="_labelId" [title]="node.name">{{ node.name }}</span>
578
1451
  @if (node.status === 'loading') {
579
1452
  <span class="spinner" aria-hidden="true"></span>
580
1453
  } @else if (node.status === 'error') {
@@ -588,22 +1461,64 @@ class SdFileExplorerFolderTree {
588
1461
  <sd-icon name="refresh" size="16px" />
589
1462
  </button>
590
1463
  }
1464
+ @if (_nodeCommands) {
1465
+ @if (node.item; as folder) {
1466
+ @if (!_menus) {
1467
+ <sd-file-explorer-actions
1468
+ class="node-actions"
1469
+ source="folderCommands"
1470
+ [actions]="_commands"
1471
+ [context]="folder"
1472
+ [size]="_commandSize"
1473
+ [autoId]="node.autoId ? node.autoId + '-command' : undefined" />
1474
+ } @else {
1475
+ @if (_menus.get(node.key); as menu) {
1476
+ <sd-file-explorer-menu-trigger
1477
+ class="node-menu"
1478
+ [label]="menuLabel(node)"
1479
+ [busy]="menu.busy"
1480
+ [expanded]="folder.id === _menuOpenId"
1481
+ [touch]="_touch"
1482
+ [tabIndex]="node.key === _active ? 0 : -1"
1483
+ [autoId]="node.autoId ? node.autoId + '-commands' : undefined"
1484
+ (activate)="openCommands.emit({ item: folder, trigger: $event })" />
1485
+ }
1486
+ }
1487
+ }
1488
+ }
591
1489
  </li>
592
1490
  }
593
1491
  </ul>
594
- `, isInline: true, styles: [":host{display:block}.tree{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.node{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 10px;border-radius:var(--sd-radius-8, 8px);color:var(--sd-fe-text);font-size:var(--sd-font-size-15, 15px);line-height:var(--sd-line-height-20, 20px);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none}.node:hover{background:var(--sd-fe-hover)}.node:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.node--selected{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent);font-weight:var(--sd-font-weight-semibold, 600)}.node--selected:hover{background:var(--sd-fe-accent-soft)}.indent{flex:none;width:var(--sd-file-explorer-tree-indent, 0);margin-right:-8px}.toggle{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:24px;margin-right:-1px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.toggle:hover{color:var(--sd-fe-text)}.label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.retry{flex:none;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:var(--sd-radius-6, 6px);background:transparent;color:var(--sd-fe-error);cursor:pointer}.retry:hover{background:color-mix(in srgb,var(--sd-fe-error) 10%,transparent)}.spinner{flex:none;width:14px;height:14px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 25%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-tree-spin .8s linear infinite}@keyframes sd-file-explorer-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1492
+ `, isInline: true, styles: ["@charset \"UTF-8\";:host{display:block}.tree{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.node{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 10px;border-radius:var(--sd-radius-8, 8px);color:var(--sd-fe-text);font-size:var(--sd-font-size-15, 15px);line-height:var(--sd-line-height-20, 20px);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none}.node:hover{background:var(--sd-fe-hover)}.node:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.node--selected{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent);font-weight:var(--sd-font-weight-semibold, 600)}.node--selected:hover{background:var(--sd-fe-accent-soft)}.indent{flex:none;width:var(--sd-file-explorer-tree-indent, 0);margin-right:-8px}.toggle{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:24px;margin-right:-1px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.toggle:hover{color:var(--sd-fe-text)}.label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-folder-tree--touch) .node{min-height:var(--sd-space-48, 48px)}:host(.sd-file-explorer-folder-tree--touch) .node--error{flex-wrap:wrap}:host(.sd-file-explorer-folder-tree--touch) .node--error .label{flex:1 1 8ch;min-inline-size:min(100%,8ch);white-space:normal;overflow-wrap:anywhere}:host(.sd-file-explorer-folder-tree--touch) .node--error .retry{margin-inline-start:auto}:host(.sd-file-explorer-folder-tree--touch) .toggle,:host(.sd-file-explorer-folder-tree--touch) .retry{width:var(--sd-space-48, 48px);height:var(--sd-space-48, 48px)}.retry{flex:none;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:var(--sd-radius-6, 6px);background:transparent;color:var(--sd-fe-error);cursor:pointer}.retry:hover{background:color-mix(in srgb,var(--sd-fe-error) 10%,transparent)}.node-actions{display:none;flex:0 1 auto;min-width:0;margin-inline:auto -6px}.node:hover .node-actions,.node:focus-within .node-actions,.node-actions.sd-file-explorer-actions--open,.node-actions.sd-file-explorer-actions--busy,:host(.sd-file-explorer-folder-tree--touch) .node-actions{display:inline-flex}.node--commands{flex-wrap:wrap;row-gap:2px;padding-block:2px}:host(.sd-file-explorer-folder-tree--touch) .node--commands .label{flex:1 1 auto}.node-menu{flex:none;margin-inline:auto -6px}:host(.sd-file-explorer-folder-tree--compact) .node--commands:not(.node--error){flex-wrap:nowrap}:host(.sd-file-explorer-folder-tree--compact) .node--commands:not(.node--error) .label{flex:1 1 0}.spinner{flex:none;width:14px;height:14px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 25%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-tree-spin .8s linear infinite}@keyframes sd-file-explorer-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}.move-drop-target:after{content:\"\\21b3\";font-weight:700;color:var(--sd-fe-text)}.move-drop-target{outline:2px solid var(--sd-fe-accent);outline-offset:-2px}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdFileExplorerActions, selector: "sd-file-explorer-actions", inputs: ["actions", "context", "defaultLeafType", "defaultGroupType", "defaultColor", "size", "source", "autoId"] }, { kind: "component", type: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }, { kind: "component", type: SdFileExplorerMenuTrigger, selector: "sd-file-explorer-menu-trigger", inputs: ["label", "busy", "expanded", "touch", "tabIndex", "autoId"], outputs: ["activate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
595
1493
  }
596
1494
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerFolderTree, decorators: [{
597
1495
  type: Component,
598
- args: [{ selector: 'sd-file-explorer-folder-tree', standalone: true, imports: [SdIcon, SdFileExplorerFileIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'sd-file-explorer-folder-tree' }, template: `
1496
+ args: [{ selector: 'sd-file-explorer-folder-tree', standalone: true, imports: [SdIcon, SdFileExplorerActions, SdFileExplorerFileIcon, SdFileExplorerMenuTrigger], changeDetection: ChangeDetectionStrategy.OnPush, host: {
1497
+ class: 'sd-file-explorer-folder-tree',
1498
+ '[class.sd-file-explorer-folder-tree--touch]': 'touch()',
1499
+ '[class.sd-file-explorer-folder-tree--compact]': 'compact()',
1500
+ }, template: `
599
1501
  @let _nodes = nodes();
600
1502
  @let _active = activeKey();
1503
+ @let _commands = commands();
1504
+ @let _hasCommands = !!_commands?.length;
1505
+ @let _touch = touch();
1506
+ @let _commandSize = _touch ? 'lg' : 'sm';
1507
+ @let _menus = menus();
1508
+ @let _menuOpenId = menuOpenId();
601
1509
  <ul class="tree" role="tree" [attr.aria-label]="label()">
602
1510
  @for (node of _nodes; track node.key; let i = $index) {
1511
+ @let _nodeCommands = _hasCommands && !!node.item;
1512
+ @let _labelId = treeId + '-label-' + i;
603
1513
  <li
604
1514
  class="node"
605
1515
  role="treeitem"
1516
+ [attr.data-move-target]="node.id ?? ''"
1517
+ [class.move-drop-target]="moveDropTarget() === node.id"
606
1518
  [class.node--selected]="node.selected"
1519
+ [class.node--commands]="_nodeCommands"
1520
+ [class.node--error]="node.status === 'error'"
1521
+ [attr.aria-labelledby]="_nodeCommands ? _labelId : null"
607
1522
  [attr.aria-level]="node.level"
608
1523
  [attr.aria-selected]="node.selected"
609
1524
  [attr.aria-expanded]="node.expandable ? node.expanded : null"
@@ -611,7 +1526,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
611
1526
  [attr.tabindex]="node.key === _active ? 0 : -1"
612
1527
  [attr.data-autoid]="node.autoId"
613
1528
  [style.--sd-file-explorer-tree-indent]="(node.level > 1 ? node.level - 2 : 0) * 22 + 'px'"
614
- (click)="select.emit(node)"
1529
+ (click)="onClick($event, node)"
615
1530
  (keydown)="onKeydown($event, i)"
616
1531
  (focus)="focusedKey.set(node.key)">
617
1532
  @if (node.level > 1) {
@@ -631,7 +1546,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
631
1546
  }
632
1547
  }
633
1548
  <sd-file-explorer-file-icon [icon]="node.expanded ? 'folder-open' : 'folder-closed'" [size]="28" />
634
- <span class="label" [title]="node.name">{{ node.name }}</span>
1549
+ <span class="label" [id]="_labelId" [title]="node.name">{{ node.name }}</span>
635
1550
  @if (node.status === 'loading') {
636
1551
  <span class="spinner" aria-hidden="true"></span>
637
1552
  } @else if (node.status === 'error') {
@@ -645,17 +1560,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
645
1560
  <sd-icon name="refresh" size="16px" />
646
1561
  </button>
647
1562
  }
1563
+ @if (_nodeCommands) {
1564
+ @if (node.item; as folder) {
1565
+ @if (!_menus) {
1566
+ <sd-file-explorer-actions
1567
+ class="node-actions"
1568
+ source="folderCommands"
1569
+ [actions]="_commands"
1570
+ [context]="folder"
1571
+ [size]="_commandSize"
1572
+ [autoId]="node.autoId ? node.autoId + '-command' : undefined" />
1573
+ } @else {
1574
+ @if (_menus.get(node.key); as menu) {
1575
+ <sd-file-explorer-menu-trigger
1576
+ class="node-menu"
1577
+ [label]="menuLabel(node)"
1578
+ [busy]="menu.busy"
1579
+ [expanded]="folder.id === _menuOpenId"
1580
+ [touch]="_touch"
1581
+ [tabIndex]="node.key === _active ? 0 : -1"
1582
+ [autoId]="node.autoId ? node.autoId + '-commands' : undefined"
1583
+ (activate)="openCommands.emit({ item: folder, trigger: $event })" />
1584
+ }
1585
+ }
1586
+ }
1587
+ }
648
1588
  </li>
649
1589
  }
650
1590
  </ul>
651
- `, styles: [":host{display:block}.tree{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.node{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 10px;border-radius:var(--sd-radius-8, 8px);color:var(--sd-fe-text);font-size:var(--sd-font-size-15, 15px);line-height:var(--sd-line-height-20, 20px);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none}.node:hover{background:var(--sd-fe-hover)}.node:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.node--selected{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent);font-weight:var(--sd-font-weight-semibold, 600)}.node--selected:hover{background:var(--sd-fe-accent-soft)}.indent{flex:none;width:var(--sd-file-explorer-tree-indent, 0);margin-right:-8px}.toggle{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:24px;margin-right:-1px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.toggle:hover{color:var(--sd-fe-text)}.label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.retry{flex:none;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:var(--sd-radius-6, 6px);background:transparent;color:var(--sd-fe-error);cursor:pointer}.retry:hover{background:color-mix(in srgb,var(--sd-fe-error) 10%,transparent)}.spinner{flex:none;width:14px;height:14px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 25%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-tree-spin .8s linear infinite}@keyframes sd-file-explorer-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"] }]
652
- }], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], select: [{ type: i0.Output, args: ["select"] }], toggle: [{ type: i0.Output, args: ["toggle"] }], retry: [{ type: i0.Output, args: ["retry"] }] } });
1591
+ `, styles: ["@charset \"UTF-8\";:host{display:block}.tree{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.node{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 10px;border-radius:var(--sd-radius-8, 8px);color:var(--sd-fe-text);font-size:var(--sd-font-size-15, 15px);line-height:var(--sd-line-height-20, 20px);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none}.node:hover{background:var(--sd-fe-hover)}.node:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.node--selected{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent);font-weight:var(--sd-font-weight-semibold, 600)}.node--selected:hover{background:var(--sd-fe-accent-soft)}.indent{flex:none;width:var(--sd-file-explorer-tree-indent, 0);margin-right:-8px}.toggle{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:24px;margin-right:-1px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.toggle:hover{color:var(--sd-fe-text)}.label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-folder-tree--touch) .node{min-height:var(--sd-space-48, 48px)}:host(.sd-file-explorer-folder-tree--touch) .node--error{flex-wrap:wrap}:host(.sd-file-explorer-folder-tree--touch) .node--error .label{flex:1 1 8ch;min-inline-size:min(100%,8ch);white-space:normal;overflow-wrap:anywhere}:host(.sd-file-explorer-folder-tree--touch) .node--error .retry{margin-inline-start:auto}:host(.sd-file-explorer-folder-tree--touch) .toggle,:host(.sd-file-explorer-folder-tree--touch) .retry{width:var(--sd-space-48, 48px);height:var(--sd-space-48, 48px)}.retry{flex:none;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:var(--sd-radius-6, 6px);background:transparent;color:var(--sd-fe-error);cursor:pointer}.retry:hover{background:color-mix(in srgb,var(--sd-fe-error) 10%,transparent)}.node-actions{display:none;flex:0 1 auto;min-width:0;margin-inline:auto -6px}.node:hover .node-actions,.node:focus-within .node-actions,.node-actions.sd-file-explorer-actions--open,.node-actions.sd-file-explorer-actions--busy,:host(.sd-file-explorer-folder-tree--touch) .node-actions{display:inline-flex}.node--commands{flex-wrap:wrap;row-gap:2px;padding-block:2px}:host(.sd-file-explorer-folder-tree--touch) .node--commands .label{flex:1 1 auto}.node-menu{flex:none;margin-inline:auto -6px}:host(.sd-file-explorer-folder-tree--compact) .node--commands:not(.node--error){flex-wrap:nowrap}:host(.sd-file-explorer-folder-tree--compact) .node--commands:not(.node--error) .label{flex:1 1 0}.spinner{flex:none;width:14px;height:14px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 25%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-tree-spin .8s linear infinite}@keyframes sd-file-explorer-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}.move-drop-target:after{content:\"\\21b3\";font-weight:700;color:var(--sd-fe-text)}.move-drop-target{outline:2px solid var(--sd-fe-accent);outline-offset:-2px}\n"] }]
1592
+ }], propDecorators: { moveDropTarget: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveDropTarget", required: false }] }], nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], commands: [{ type: i0.Input, args: [{ isSignal: true, alias: "commands", required: false }] }], touch: [{ type: i0.Input, args: [{ isSignal: true, alias: "touch", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], menuOpenId: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuOpenId", required: false }] }], select: [{ type: i0.Output, args: ["select"] }], toggle: [{ type: i0.Output, args: ["toggle"] }], retry: [{ type: i0.Output, args: ["retry"] }], openCommands: [{ type: i0.Output, args: ["openCommands"] }] } });
653
1593
 
1594
+ /** Rows and cards ignore clicks and Enter / Space coming from these areas: they belong to a checkbox or a command. */
1595
+ const CONTROL_AREAS = '.cell--select, .card-top, .commands, .sd-file-explorer-menu-trigger';
654
1596
  /**
655
1597
  * Items of the current folder (or search results) as a list or a grid (internal).
656
- * Rows and cards are focusable; `Enter` / `Space` activate them like a click.
1598
+ * Rows and cards are focusable; `Enter` / `Space` activate them like a click. Selection checkboxes and commands sit
1599
+ * next to the name and never activate the item.
1600
+ *
1601
+ * In the compact layout a row or card carries one actions trigger instead of its commands and row shortcuts: the
1602
+ * explorer lists them in its command drawer.
657
1603
  */
658
1604
  class SdFileExplorerItemList {
1605
+ canMove = input(false, ...(ngDevMode ? [{ debugName: "canMove" }] : /* istanbul ignore next */ []));
1606
+ moveDropTarget = input(...(ngDevMode ? [undefined, { debugName: "moveDropTarget" }] : /* istanbul ignore next */ []));
1607
+ movePending = input(false, ...(ngDevMode ? [{ debugName: "movePending" }] : /* istanbul ignore next */ []));
1608
+ move = output();
1609
+ columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
1610
+ columnWidths = computed(() => this.columns()
1611
+ .map(column => column.width())
1612
+ .join(' '), ...(ngDevMode ? [{ debugName: "columnWidths" }] : /* istanbul ignore next */ []));
659
1613
  /** Items to render, already formatted. */
660
1614
  items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
661
1615
  /** `list` or `grid`. */
@@ -664,43 +1618,133 @@ class SdFileExplorerItemList {
664
1618
  canDownload = input(false, ...(ngDevMode ? [{ debugName: "canDownload" }] : /* istanbul ignore next */ []));
665
1619
  /** Show share buttons for files. */
666
1620
  canShare = input(false, ...(ngDevMode ? [{ debugName: "canShare" }] : /* istanbul ignore next */ []));
667
- /** Narrow layout: hides the modified column. */
1621
+ /** Narrow layout: hides the modified column and replaces commands and row shortcuts with an actions trigger. */
668
1622
  compact = input(false, ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
1623
+ /** Touch screen: commands always visible, with 48 px touch targets. */
1624
+ touch = input(false, ...(ngDevMode ? [{ debugName: "touch" }] : /* istanbul ignore next */ []));
669
1625
  /** Id of the file currently shown in the preview panel. */
670
1626
  activeId = input(null, ...(ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []));
671
1627
  /** Accessible name of the list. */
672
1628
  label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
1629
+ /** Selection state; `null` hides every checkbox. */
1630
+ selection = input(null, ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
1631
+ /** Commands of file rows and cards. */
1632
+ fileCommands = input(undefined, ...(ngDevMode ? [{ debugName: "fileCommands" }] : /* istanbul ignore next */ []));
1633
+ /** Commands of folder rows and cards. */
1634
+ folderCommands = input(undefined, ...(ngDevMode ? [{ debugName: "folderCommands" }] : /* istanbul ignore next */ []));
1635
+ /** Id of the item whose command drawer is open from this list. */
1636
+ menuOpenId = input(null, ...(ngDevMode ? [{ debugName: "menuOpenId" }] : /* istanbul ignore next */ []));
673
1637
  /** Row / card activated. */
674
1638
  activate = output();
1639
+ /** Compact actions trigger pressed. */
1640
+ openCommands = output();
675
1641
  /** Download button pressed. */
676
1642
  download = output();
677
1643
  /** Share button pressed. */
678
1644
  share = output();
679
- /** Width of the row action column: one 32 px icon button per enabled action. */
1645
+ /** Checkbox of a file toggled. */
1646
+ toggleSelect = output();
1647
+ /** Select-all checkbox toggled. */
1648
+ toggleSelectAll = output();
1649
+ /**
1650
+ * Width of the row action column: one 32 px icon button per row shortcut on desktop; the actions trigger (32 px,
1651
+ * 48 px on touch) in compact.
1652
+ */
680
1653
  actionsWidth = computed(() => {
1654
+ if (this.compact())
1655
+ return this.menuColumn() ? `${(this.touch() ? 48 : 32) + 4}px` : null;
681
1656
  const count = (this.canDownload() ? 1 : 0) + (this.canShare() ? 1 : 0);
682
1657
  if (!count)
683
1658
  return null;
684
- return `${count * 32 + (count - 1) * 2 + (this.compact() ? 4 : 12)}px`;
1659
+ return `${count * 32 + (count - 1) * 2 + 12}px`;
685
1660
  }, ...(ngDevMode ? [{ debugName: "actionsWidth" }] : /* istanbul ignore next */ []));
1661
+ hasCommands = computed(() => !!(this.fileCommands()?.length || this.folderCommands()?.length), ...(ngDevMode ? [{ debugName: "hasCommands" }] : /* istanbul ignore next */ []));
1662
+ rows = computed(() => {
1663
+ const selection = this.selection();
1664
+ const fileCommands = this.fileCommands();
1665
+ const folderCommands = this.folderCommands();
1666
+ const compact = this.compact();
1667
+ // why: only list rows carry the download / share shortcuts — grid cards never did — so only they bring them into
1668
+ // the drawer. The explorer turns them off as soon as fileCommands is declared.
1669
+ const shortcuts = this.view() === 'list' && (this.canDownload() || this.canShare());
1670
+ return this.items().map(view => {
1671
+ const isFile = view.item.kind === 'file';
1672
+ const commands = isFile ? fileCommands : folderCommands;
1673
+ const source = isFile ? 'fileCommands' : 'folderCommands';
1674
+ return {
1675
+ view,
1676
+ selectable: !!selection && isFile,
1677
+ selected: !!selection?.selectedIds.has(view.item.id),
1678
+ selectDisabled: !!selection?.disabledIds.has(view.item.id),
1679
+ commands: !compact && commands?.length ? commands : null,
1680
+ source,
1681
+ menu: compact ? this.#menu(commands, view.item, source, isFile && shortcuts) : null,
1682
+ };
1683
+ });
1684
+ }, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
1685
+ /** Compact list with at least one actions trigger: the action column holds them. */
1686
+ menuColumn = computed(() => this.rows().some(row => row.menu), ...(ngDevMode ? [{ debugName: "menuColumn" }] : /* istanbul ignore next */ []));
1687
+ /** Trigger state of one item: `null` when its drawer would be empty. Same filtering as the drawer and the buttons. */
1688
+ #menu(commands, item, source, shortcuts) {
1689
+ const resolved = sdFileExplorerResolveActions(commands, item, SD_FILE_EXPLORER_COMMAND_DEFAULTS, source);
1690
+ return resolved.length || shortcuts ? { busy: sdFileExplorerActionsBusy(resolved) } : null;
1691
+ }
1692
+ onClick(event, view) {
1693
+ if (this.#fromControl(event))
1694
+ return;
1695
+ this.activate.emit(view);
1696
+ }
686
1697
  onKeydown(event, view) {
687
1698
  if (event.key !== 'Enter' && event.key !== ' ')
688
1699
  return;
1700
+ if (this.#fromControl(event))
1701
+ return;
689
1702
  event.preventDefault();
690
1703
  this.activate.emit(view);
691
1704
  }
1705
+ /** The event started on a checkbox or a command (or the space around it) inside the row / card. */
1706
+ #fromControl(event) {
1707
+ const target = event.target instanceof Element ? event.target : null;
1708
+ const area = target?.closest(CONTROL_AREAS);
1709
+ return !!area && event.currentTarget instanceof Element && event.currentTarget.contains(area);
1710
+ }
692
1711
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerItemList, deps: [], target: i0.ɵɵFactoryTarget.Component });
693
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdFileExplorerItemList, isStandalone: true, selector: "sd-file-explorer-item-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, canDownload: { classPropertyName: "canDownload", publicName: "canDownload", isSignal: true, isRequired: false, transformFunction: null }, canShare: { classPropertyName: "canShare", publicName: "canShare", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, activeId: { classPropertyName: "activeId", publicName: "activeId", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activate: "activate", download: "download", share: "share" }, host: { properties: { "class.sd-file-explorer-item-list--compact": "compact()", "style.--sd-fe-actions-width": "actionsWidth()" }, classAttribute: "sd-file-explorer-item-list" }, ngImport: i0, template: `
694
- @let _items = items();
1712
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdFileExplorerItemList, isStandalone: true, selector: "sd-file-explorer-item-list", inputs: { canMove: { classPropertyName: "canMove", publicName: "canMove", isSignal: true, isRequired: false, transformFunction: null }, moveDropTarget: { classPropertyName: "moveDropTarget", publicName: "moveDropTarget", isSignal: true, isRequired: false, transformFunction: null }, movePending: { classPropertyName: "movePending", publicName: "movePending", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, canDownload: { classPropertyName: "canDownload", publicName: "canDownload", isSignal: true, isRequired: false, transformFunction: null }, canShare: { classPropertyName: "canShare", publicName: "canShare", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, touch: { classPropertyName: "touch", publicName: "touch", isSignal: true, isRequired: false, transformFunction: null }, activeId: { classPropertyName: "activeId", publicName: "activeId", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, fileCommands: { classPropertyName: "fileCommands", publicName: "fileCommands", isSignal: true, isRequired: false, transformFunction: null }, folderCommands: { classPropertyName: "folderCommands", publicName: "folderCommands", isSignal: true, isRequired: false, transformFunction: null }, menuOpenId: { classPropertyName: "menuOpenId", publicName: "menuOpenId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { move: "move", activate: "activate", openCommands: "openCommands", download: "download", share: "share", toggleSelect: "toggleSelect", toggleSelectAll: "toggleSelectAll" }, host: { properties: { "class.sd-file-explorer-item-list--compact": "compact()", "class.sd-file-explorer-item-list--touch": "touch()", "style.--sd-fe-actions-width": "actionsWidth()" }, classAttribute: "sd-file-explorer-item-list" }, ngImport: i0, template: `
1713
+ @let _rows = rows();
695
1714
  @let _canDownload = canDownload();
696
1715
  @let _canShare = canShare();
697
- @let _hasActions = _canDownload || _canShare;
698
1716
  @let _compact = compact();
1717
+ @let _touch = touch();
1718
+ @let _actionColumn = _compact ? menuColumn() : _canDownload || _canShare;
699
1719
  @let _activeId = activeId();
1720
+ @let _menuOpenId = menuOpenId();
1721
+ @let _selection = selection();
1722
+ @let _commandSize = _touch && !_compact ? 'lg' : 'sm';
700
1723
  @if (view() === 'list') {
701
- <div class="list" role="table" [attr.aria-label]="label()">
1724
+ <div
1725
+ class="list"
1726
+ role="table"
1727
+ [class.list--selectable]="!!_selection"
1728
+ [class.list--custom]="columns().length > 0"
1729
+ [style.--sd-fe-custom-cols]="columnWidths()"
1730
+ [attr.aria-label]="label()"
1731
+ [attr.aria-colcount]="(_selection ? 1 : 0) + (_compact ? 2 : 3) + columns().length + (_actionColumn ? 1 : 0)">
702
1732
  <div class="list-head" role="rowgroup">
703
1733
  <div class="row row--head" role="row">
1734
+ @if (_selection) {
1735
+ <span class="cell cell--select" role="columnheader">
1736
+ <mat-checkbox
1737
+ class="select-all"
1738
+ color="primary"
1739
+ [checked]="_selection.state === 'all'"
1740
+ [indeterminate]="_selection.state === 'some'"
1741
+ [disabled]="!_selection.eligibleCount"
1742
+ [aria-label]="_selection.allLabel"
1743
+ [matTooltip]="_selection.allLabel"
1744
+ [attr.data-autoid]="_selection.autoId ?? null"
1745
+ (change)="toggleSelectAll.emit()" />
1746
+ </span>
1747
+ }
704
1748
  <span class="cell cell--name" role="columnheader">{{ 'core.component.file-explorer.column.name' | sdTranslate }}</span>
705
1749
  @if (!_compact) {
706
1750
  <span class="cell cell--modified" role="columnheader">{{
@@ -708,37 +1752,105 @@ class SdFileExplorerItemList {
708
1752
  }}</span>
709
1753
  }
710
1754
  <span class="cell cell--size" role="columnheader">{{ 'core.component.file-explorer.column.size' | sdTranslate }}</span>
711
- @if (_hasActions) {
712
- <span class="cell cell--action" role="columnheader"></span>
1755
+ @for (column of columns(); track column.id(); let index = $index) {
1756
+ <span class="cell cell--custom" role="columnheader" [style.grid-column]="5 + index">{{ column.title() }}</span>
1757
+ }
1758
+ @if (_actionColumn) {
1759
+ <span class="cell cell--action" role="columnheader" [style.grid-column]="5 + columns().length"></span>
713
1760
  }
714
1761
  </div>
715
1762
  </div>
716
1763
  <div role="rowgroup">
717
- @for (view of _items; track view.item.id) {
1764
+ @for (row of _rows; track row.view.item.id; let rowIndex = $index) {
1765
+ @let view = row.view;
718
1766
  <div
719
1767
  class="row"
720
1768
  role="row"
721
1769
  tabindex="0"
722
1770
  [class.row--active]="view.item.id === _activeId"
1771
+ [class.row--selected]="row.selected"
1772
+ [class.row--commands]="!!row.commands"
1773
+ [class.row--movable]="canMove() && view.item.kind === 'file'"
723
1774
  [attr.data-item-id]="view.item.id"
1775
+ [attr.data-move-target]="view.item.kind === 'folder' ? view.item.id : null"
1776
+ [class.move-drop-target]="view.item.kind === 'folder' && moveDropTarget() === view.item.id"
724
1777
  [attr.data-autoid]="view.autoId"
725
- (click)="activate.emit(view)"
1778
+ (click)="onClick($event, view)"
726
1779
  (keydown)="onKeydown($event, view)">
1780
+ @if (_selection) {
1781
+ <span class="cell cell--select" role="cell">
1782
+ @if (row.selectable) {
1783
+ <mat-checkbox
1784
+ class="select"
1785
+ color="primary"
1786
+ [checked]="row.selected"
1787
+ [disabled]="row.selectDisabled"
1788
+ [aria-label]="view.selectLabel"
1789
+ [attr.data-autoid]="view.autoId ? view.autoId + '-select' : null"
1790
+ (change)="toggleSelect.emit(view.item)" />
1791
+ }
1792
+ </span>
1793
+ }
727
1794
  <span class="cell cell--name" role="cell">
728
1795
  <sd-file-explorer-file-icon [icon]="view.icon" [size]="32" />
729
- <span class="name" [title]="view.item.name">{{ view.item.name }}</span>
1796
+ <span class="name" [draggable]="canMove() && view.item.kind === 'file'" [title]="view.item.name">{{ view.item.name }}</span>
1797
+ @if (view.item.kind === 'folder' && moveDropTarget() === view.item.id) {
1798
+ <span class="move-drop-label">{{ 'core.component.file-explorer.move.confirm' | sdTranslate }}</span>
1799
+ }
1800
+ @if (canMove() && view.item.kind === 'file') {
1801
+ <sd-button
1802
+ htmlType="button"
1803
+ class="move-file-button commands"
1804
+ type="text"
1805
+ color="secondary"
1806
+ size="sm"
1807
+ prefixIcon="drive_file_move"
1808
+ [disabled]="movePending()"
1809
+ [tooltip]="('core.component.file-explorer.move.to' | sdTranslate) + ': ' + view.item.name"
1810
+ (click)="$event.stopPropagation(); move.emit(view.item)"
1811
+ (keydown)="$event.stopPropagation()" />
1812
+ }
1813
+ @if (row.commands) {
1814
+ <sd-file-explorer-actions
1815
+ class="commands"
1816
+ [actions]="row.commands"
1817
+ [context]="view.item"
1818
+ [size]="_commandSize"
1819
+ [source]="row.source"
1820
+ [autoId]="view.autoId ? view.autoId + '-command' : undefined" />
1821
+ }
730
1822
  </span>
731
1823
  @if (!_compact) {
732
1824
  <span class="cell cell--modified" role="cell" [title]="view.modifiedTitle">{{ view.modifiedLabel || '—' }}</span>
733
1825
  }
734
1826
  <span class="cell cell--size" role="cell">{{ view.sizeLabel || '—' }}</span>
735
- @if (_hasActions) {
1827
+ @for (column of columns(); track column.id(); let index = $index) {
1828
+ <span class="cell cell--custom" role="cell" [style.grid-column]="5 + index">
1829
+ <ng-container
1830
+ [ngTemplateOutlet]="column.template"
1831
+ [ngTemplateOutletContext]="{ $implicit: view.item, item: view.item, data: view.item.data, index: rowIndex }" />
1832
+ </span>
1833
+ }
1834
+ @if (_actionColumn) {
736
1835
  <!-- why: sd-button already keeps its click from reaching the row; Enter/Space are stopped here so the key does not open the file too. -->
737
- <span class="cell cell--action" role="cell">
738
- @if (view.item.kind === 'file') {
1836
+ <span class="cell cell--action" role="cell" [style.grid-column]="5 + columns().length">
1837
+ @if (_compact) {
1838
+ @if (row.menu; as menu) {
1839
+ <sd-file-explorer-menu-trigger
1840
+ class="row-menu"
1841
+ [label]="view.actionsLabel"
1842
+ [busy]="menu.busy"
1843
+ [expanded]="view.item.id === _menuOpenId"
1844
+ [touch]="_touch"
1845
+ [autoId]="view.autoId ? view.autoId + '-commands' : undefined"
1846
+ (activate)="openCommands.emit({ item: view.item, trigger: $event })" />
1847
+ }
1848
+ } @else if (view.item.kind === 'file') {
739
1849
  @if (_canShare) {
740
1850
  <sd-button
741
1851
  class="row-action row-share"
1852
+ [disabled]="view.shareDisabled ?? false"
1853
+ [attr.aria-description]="view.shareDisabled ? view.unavailableReason : null"
742
1854
  type="text"
743
1855
  color="secondary"
744
1856
  size="sm"
@@ -752,6 +1864,8 @@ class SdFileExplorerItemList {
752
1864
  @if (_canDownload) {
753
1865
  <sd-button
754
1866
  class="row-action row-download"
1867
+ [disabled]="view.downloadDisabled ?? false"
1868
+ [attr.aria-description]="view.downloadDisabled ? view.unavailableReason : null"
755
1869
  type="text"
756
1870
  color="secondary"
757
1871
  size="sm"
@@ -770,17 +1884,69 @@ class SdFileExplorerItemList {
770
1884
  </div>
771
1885
  </div>
772
1886
  } @else {
1887
+ @let _cardTop = !!_selection || hasCommands();
1888
+ @if (_selection) {
1889
+ <div class="grid-head">
1890
+ <mat-checkbox
1891
+ class="select-all"
1892
+ color="primary"
1893
+ [checked]="_selection.state === 'all'"
1894
+ [indeterminate]="_selection.state === 'some'"
1895
+ [disabled]="!_selection.eligibleCount"
1896
+ [aria-label]="_selection.allLabel"
1897
+ [matTooltip]="_selection.allLabel"
1898
+ [attr.data-autoid]="_selection.autoId ?? null"
1899
+ (change)="toggleSelectAll.emit()" />
1900
+ </div>
1901
+ }
773
1902
  <ul class="grid" [attr.aria-label]="label()">
774
- @for (view of _items; track view.item.id) {
1903
+ @for (row of _rows; track row.view.item.id) {
1904
+ @let view = row.view;
775
1905
  <li
776
1906
  class="card"
777
1907
  tabindex="0"
778
1908
  [class.card--active]="view.item.id === _activeId"
1909
+ [class.card--selected]="row.selected"
779
1910
  [attr.data-item-id]="view.item.id"
1911
+ [attr.data-move-target]="view.item.kind === 'folder' ? view.item.id : null"
1912
+ [class.move-drop-target]="view.item.kind === 'folder' && moveDropTarget() === view.item.id"
780
1913
  [attr.data-autoid]="view.autoId"
781
1914
  [attr.aria-label]="view.item.name + ', ' + view.typeLabel"
782
- (click)="activate.emit(view)"
1915
+ (click)="onClick($event, view)"
783
1916
  (keydown)="onKeydown($event, view)">
1917
+ @if (_cardTop) {
1918
+ <span class="card-top">
1919
+ @if (row.selectable) {
1920
+ <mat-checkbox
1921
+ class="select"
1922
+ color="primary"
1923
+ [checked]="row.selected"
1924
+ [disabled]="row.selectDisabled"
1925
+ [aria-label]="view.selectLabel"
1926
+ [attr.data-autoid]="view.autoId ? view.autoId + '-select' : null"
1927
+ (change)="toggleSelect.emit(view.item)" />
1928
+ }
1929
+ @if (row.commands) {
1930
+ <sd-file-explorer-actions
1931
+ class="commands"
1932
+ [actions]="row.commands"
1933
+ [context]="view.item"
1934
+ [size]="_commandSize"
1935
+ [source]="row.source"
1936
+ [autoId]="view.autoId ? view.autoId + '-command' : undefined" />
1937
+ }
1938
+ @if (row.menu; as menu) {
1939
+ <sd-file-explorer-menu-trigger
1940
+ class="card-menu"
1941
+ [label]="view.actionsLabel"
1942
+ [busy]="menu.busy"
1943
+ [expanded]="view.item.id === _menuOpenId"
1944
+ [touch]="_touch"
1945
+ [autoId]="view.autoId ? view.autoId + '-commands' : undefined"
1946
+ (activate)="openCommands.emit({ item: view.item, trigger: $event })" />
1947
+ }
1948
+ </span>
1949
+ }
784
1950
  <span class="thumb">
785
1951
  @if (view.item.thumbnailUrl) {
786
1952
  <img [src]="view.item.thumbnailUrl" alt="" loading="lazy" />
@@ -788,30 +1954,80 @@ class SdFileExplorerItemList {
788
1954
  <sd-file-explorer-file-icon [icon]="view.icon" [size]="48" />
789
1955
  }
790
1956
  </span>
791
- <span class="card-name" [title]="view.item.name">{{ view.item.name }}</span>
1957
+ <span class="card-name" [draggable]="canMove() && view.item.kind === 'file'" [title]="view.item.name">{{
1958
+ view.item.name
1959
+ }}</span>
1960
+ @if (canMove() && view.item.kind === 'file') {
1961
+ <sd-button
1962
+ htmlType="button"
1963
+ class="move-file-button commands"
1964
+ type="text"
1965
+ color="secondary"
1966
+ size="sm"
1967
+ prefixIcon="drive_file_move"
1968
+ [disabled]="movePending()"
1969
+ [tooltip]="('core.component.file-explorer.move.to' | sdTranslate) + ': ' + view.item.name"
1970
+ (click)="$event.stopPropagation(); move.emit(view.item)"
1971
+ (keydown)="$event.stopPropagation()" />
1972
+ }
792
1973
  </li>
793
1974
  }
794
1975
  </ul>
795
1976
  }
796
- `, isInline: true, styles: [":host{display:block}.list{width:100%}.row{display:grid;grid-template-columns:minmax(0,1fr) 128px 88px var(--sd-fe-actions-width, 44px);align-items:center;min-height:62px;border-bottom:1px solid var(--sd-fe-border);color:var(--sd-fe-text);font-size:var(--sd-font-size-15, 15px);cursor:pointer;outline:none;transition:background-color var(--sd-duration-fast, .12s) ease}.row:hover{background:var(--sd-fe-hover)}.row:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.list:not(:has(.cell--action)) .row{grid-template-columns:minmax(0,1fr) 128px 88px}.row--head{min-height:34px;color:var(--sd-fe-text-secondary);font-size:var(--sd-font-size-13, 13px);cursor:default}.row--head:hover{background:transparent}.row--active,.row--active:hover{background:var(--sd-fe-accent-soft)}.cell{min-width:0;padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell--name{display:flex;align-items:center;gap:16px}.row:not(.row--head) .cell--modified,.row:not(.row--head) .cell--size{color:var(--sd-fe-text-secondary);font-size:var(--sd-font-size-13, 13px)}.cell--action{display:flex;align-items:center;justify-content:flex-end;gap:2px;padding:0 4px 0 0;overflow:visible}.name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .row{grid-template-columns:minmax(0,1fr) 66px var(--sd-fe-actions-width, 36px);min-height:55px;font-size:var(--sd-font-size-14, 14px)}:host(.sd-file-explorer-item-list--compact) .list:not(:has(.cell--action)) .row{grid-template-columns:minmax(0,1fr) 66px}:host(.sd-file-explorer-item-list--compact) .row--head{min-height:30px;font-size:var(--sd-font-size-12, 12px)}:host(.sd-file-explorer-item-list--compact) .cell--name{gap:12px}:host(.sd-file-explorer-item-list--compact) .cell{padding:0 4px}:host(.sd-file-explorer-item-list--compact) .cell--action{padding:0}.grid{list-style:none;margin:0;padding:4px 0 0;display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:18px 20px}.card{display:flex;flex-direction:column;gap:12px;min-width:0;padding:12px 12px 14px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-12, 12px);background:var(--sd-fe-surface);color:var(--sd-fe-text);cursor:pointer;outline:none;transition:border-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease}.card:hover{border-color:var(--sd-fe-border-strong);box-shadow:0 2px 8px #0f172a0f}.card:focus-visible{box-shadow:0 0 0 2px var(--sd-fe-accent)}.card--active{border-color:var(--sd-fe-accent)}.thumb{display:flex;align-items:center;justify-content:center;height:104px;overflow:hidden;border-radius:var(--sd-radius-8, 8px);background:var(--sd-fe-muted-surface)}.thumb img{width:100%;height:100%;object-fit:cover}.card-name{padding:0 2px;overflow:hidden;font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600);text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .grid{grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:12px}@media(prefers-reduced-motion:reduce){.row,.card{transition:none}}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1977
+ `, isInline: true, styles: [":host{display:block}.list{width:100%}.row{display:grid;grid-template-columns:var(--sd-fe-select-col, 0px) minmax(0,1fr) var(--sd-fe-modified-col, 128px) var(--sd-fe-size-col, 88px) var(--sd-fe-custom-cols, ) var(--sd-fe-actions-width, 0px);align-items:center;min-height:62px;border-bottom:1px solid var(--sd-fe-border);color:var(--sd-fe-text);font-size:var(--sd-font-size-15, 15px);cursor:pointer;outline:none;transition:background-color var(--sd-duration-fast, .12s) ease}.row:hover{background:var(--sd-fe-hover)}.row:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.list--selectable{--sd-fe-select-col: 44px}.list--custom{min-width:max-content}.list--custom .cell--name{min-width:180px}.cell--select{grid-column:1}.cell--name{grid-column:2}.cell--modified{grid-column:3}.cell--size{grid-column:4}.cell--action{grid-column:5}.row--head{min-height:34px;color:var(--sd-fe-text-secondary);font-size:var(--sd-font-size-13, 13px);cursor:default}.row--head:hover{background:transparent}.row--active,.row--selected,.row--active:hover,.row--selected:hover{background:var(--sd-fe-accent-soft)}.cell{min-width:0;padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell--name{display:flex;align-items:center;gap:16px}.row:not(.row--head) .cell--modified,.row:not(.row--head) .cell--size{color:var(--sd-fe-text-secondary);font-size:var(--sd-font-size-13, 13px)}.cell--action{display:flex;align-items:center;justify-content:flex-end;gap:2px;padding:0 4px 0 0;overflow:visible}.name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row--movable .cell--name{flex-wrap:wrap;row-gap:16px;padding-block:8px;overflow:visible}.row--movable .name{flex:1 1 4.5rem}.cell--select{display:flex;align-items:center;justify-content:center;padding:0;overflow:visible}.row--commands .cell--name{flex-wrap:wrap;row-gap:4px;padding-block:8px;overflow:visible}.row--commands .name{flex:1 1 4.5rem}.commands,.card-menu{margin-inline-start:auto}.commands{opacity:0}.row:hover .commands,.row:focus-within .commands,.card:hover .commands,.card:focus-within .commands,.commands.sd-file-explorer-actions--open,.commands.sd-file-explorer-actions--busy,:host(.sd-file-explorer-item-list--touch) .commands{opacity:1}:host(.sd-file-explorer-item-list--compact){--sd-fe-modified-col: 0px;--sd-fe-size-col: 66px}:host(.sd-file-explorer-item-list--compact) .row{min-height:55px;font-size:var(--sd-font-size-14, 14px)}:host(.sd-file-explorer-item-list--compact) .row--head{min-height:30px;font-size:var(--sd-font-size-12, 12px)}:host(.sd-file-explorer-item-list--compact) .cell--name{gap:12px}:host(.sd-file-explorer-item-list--compact) .cell{padding:0 4px}:host(.sd-file-explorer-item-list--compact) .cell--action{padding:0}.grid{list-style:none;margin:0;padding:4px 0 0;display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:18px 20px}.card{display:flex;flex-direction:column;gap:12px;min-width:0;padding:12px 12px 14px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-12, 12px);background:var(--sd-fe-surface);color:var(--sd-fe-text);cursor:pointer;outline:none;transition:border-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease}.card:hover{border-color:var(--sd-fe-border-strong);box-shadow:0 2px 8px #0f172a0f}.card:focus-visible{box-shadow:0 0 0 2px var(--sd-fe-accent)}.card--active{border-color:var(--sd-fe-accent)}.card--selected{border-color:var(--sd-fe-accent);background:var(--sd-fe-accent-soft)}.card-top{display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-height:40px;margin-block:-4px}.grid-head{display:flex;align-items:center;margin-bottom:12px;padding:0 0 4px 13px;border-bottom:1px solid var(--sd-fe-border)}.thumb{display:flex;align-items:center;justify-content:center;height:104px;overflow:hidden;border-radius:var(--sd-radius-8, 8px);background:var(--sd-fe-muted-surface)}.thumb img{width:100%;height:100%;object-fit:cover}.card-name{padding:0 2px;overflow:hidden;font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600);text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .grid{grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:12px}@media(prefers-reduced-motion:reduce){.row,.card{transition:none}}.move-file-button{flex-shrink:0}.move-drop-target{outline:2px solid var(--sd-fe-accent);outline-offset:-2px}.move-drop-label{color:var(--sd-fe-text);font-weight:600}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdFileExplorerActions, selector: "sd-file-explorer-actions", inputs: ["actions", "context", "defaultLeafType", "defaultGroupType", "defaultColor", "size", "source", "autoId"] }, { kind: "component", type: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }, { kind: "component", type: SdFileExplorerMenuTrigger, selector: "sd-file-explorer-menu-trigger", inputs: ["label", "busy", "expanded", "touch", "tabIndex", "autoId"], outputs: ["activate"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
797
1978
  }
798
1979
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerItemList, decorators: [{
799
1980
  type: Component,
800
- args: [{ selector: 'sd-file-explorer-item-list', standalone: true, imports: [SdButton, SdTranslatePipe, SdFileExplorerFileIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
1981
+ args: [{ selector: 'sd-file-explorer-item-list', standalone: true, imports: [
1982
+ NgTemplateOutlet,
1983
+ MatCheckbox,
1984
+ MatTooltip,
1985
+ SdButton,
1986
+ SdTranslatePipe,
1987
+ SdFileExplorerActions,
1988
+ SdFileExplorerFileIcon,
1989
+ SdFileExplorerMenuTrigger,
1990
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
801
1991
  class: 'sd-file-explorer-item-list',
802
1992
  '[class.sd-file-explorer-item-list--compact]': 'compact()',
1993
+ '[class.sd-file-explorer-item-list--touch]': 'touch()',
803
1994
  '[style.--sd-fe-actions-width]': 'actionsWidth()',
804
1995
  }, template: `
805
- @let _items = items();
1996
+ @let _rows = rows();
806
1997
  @let _canDownload = canDownload();
807
1998
  @let _canShare = canShare();
808
- @let _hasActions = _canDownload || _canShare;
809
1999
  @let _compact = compact();
2000
+ @let _touch = touch();
2001
+ @let _actionColumn = _compact ? menuColumn() : _canDownload || _canShare;
810
2002
  @let _activeId = activeId();
2003
+ @let _menuOpenId = menuOpenId();
2004
+ @let _selection = selection();
2005
+ @let _commandSize = _touch && !_compact ? 'lg' : 'sm';
811
2006
  @if (view() === 'list') {
812
- <div class="list" role="table" [attr.aria-label]="label()">
2007
+ <div
2008
+ class="list"
2009
+ role="table"
2010
+ [class.list--selectable]="!!_selection"
2011
+ [class.list--custom]="columns().length > 0"
2012
+ [style.--sd-fe-custom-cols]="columnWidths()"
2013
+ [attr.aria-label]="label()"
2014
+ [attr.aria-colcount]="(_selection ? 1 : 0) + (_compact ? 2 : 3) + columns().length + (_actionColumn ? 1 : 0)">
813
2015
  <div class="list-head" role="rowgroup">
814
2016
  <div class="row row--head" role="row">
2017
+ @if (_selection) {
2018
+ <span class="cell cell--select" role="columnheader">
2019
+ <mat-checkbox
2020
+ class="select-all"
2021
+ color="primary"
2022
+ [checked]="_selection.state === 'all'"
2023
+ [indeterminate]="_selection.state === 'some'"
2024
+ [disabled]="!_selection.eligibleCount"
2025
+ [aria-label]="_selection.allLabel"
2026
+ [matTooltip]="_selection.allLabel"
2027
+ [attr.data-autoid]="_selection.autoId ?? null"
2028
+ (change)="toggleSelectAll.emit()" />
2029
+ </span>
2030
+ }
815
2031
  <span class="cell cell--name" role="columnheader">{{ 'core.component.file-explorer.column.name' | sdTranslate }}</span>
816
2032
  @if (!_compact) {
817
2033
  <span class="cell cell--modified" role="columnheader">{{
@@ -819,37 +2035,105 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
819
2035
  }}</span>
820
2036
  }
821
2037
  <span class="cell cell--size" role="columnheader">{{ 'core.component.file-explorer.column.size' | sdTranslate }}</span>
822
- @if (_hasActions) {
823
- <span class="cell cell--action" role="columnheader"></span>
2038
+ @for (column of columns(); track column.id(); let index = $index) {
2039
+ <span class="cell cell--custom" role="columnheader" [style.grid-column]="5 + index">{{ column.title() }}</span>
2040
+ }
2041
+ @if (_actionColumn) {
2042
+ <span class="cell cell--action" role="columnheader" [style.grid-column]="5 + columns().length"></span>
824
2043
  }
825
2044
  </div>
826
2045
  </div>
827
2046
  <div role="rowgroup">
828
- @for (view of _items; track view.item.id) {
2047
+ @for (row of _rows; track row.view.item.id; let rowIndex = $index) {
2048
+ @let view = row.view;
829
2049
  <div
830
2050
  class="row"
831
2051
  role="row"
832
2052
  tabindex="0"
833
2053
  [class.row--active]="view.item.id === _activeId"
2054
+ [class.row--selected]="row.selected"
2055
+ [class.row--commands]="!!row.commands"
2056
+ [class.row--movable]="canMove() && view.item.kind === 'file'"
834
2057
  [attr.data-item-id]="view.item.id"
2058
+ [attr.data-move-target]="view.item.kind === 'folder' ? view.item.id : null"
2059
+ [class.move-drop-target]="view.item.kind === 'folder' && moveDropTarget() === view.item.id"
835
2060
  [attr.data-autoid]="view.autoId"
836
- (click)="activate.emit(view)"
2061
+ (click)="onClick($event, view)"
837
2062
  (keydown)="onKeydown($event, view)">
2063
+ @if (_selection) {
2064
+ <span class="cell cell--select" role="cell">
2065
+ @if (row.selectable) {
2066
+ <mat-checkbox
2067
+ class="select"
2068
+ color="primary"
2069
+ [checked]="row.selected"
2070
+ [disabled]="row.selectDisabled"
2071
+ [aria-label]="view.selectLabel"
2072
+ [attr.data-autoid]="view.autoId ? view.autoId + '-select' : null"
2073
+ (change)="toggleSelect.emit(view.item)" />
2074
+ }
2075
+ </span>
2076
+ }
838
2077
  <span class="cell cell--name" role="cell">
839
2078
  <sd-file-explorer-file-icon [icon]="view.icon" [size]="32" />
840
- <span class="name" [title]="view.item.name">{{ view.item.name }}</span>
2079
+ <span class="name" [draggable]="canMove() && view.item.kind === 'file'" [title]="view.item.name">{{ view.item.name }}</span>
2080
+ @if (view.item.kind === 'folder' && moveDropTarget() === view.item.id) {
2081
+ <span class="move-drop-label">{{ 'core.component.file-explorer.move.confirm' | sdTranslate }}</span>
2082
+ }
2083
+ @if (canMove() && view.item.kind === 'file') {
2084
+ <sd-button
2085
+ htmlType="button"
2086
+ class="move-file-button commands"
2087
+ type="text"
2088
+ color="secondary"
2089
+ size="sm"
2090
+ prefixIcon="drive_file_move"
2091
+ [disabled]="movePending()"
2092
+ [tooltip]="('core.component.file-explorer.move.to' | sdTranslate) + ': ' + view.item.name"
2093
+ (click)="$event.stopPropagation(); move.emit(view.item)"
2094
+ (keydown)="$event.stopPropagation()" />
2095
+ }
2096
+ @if (row.commands) {
2097
+ <sd-file-explorer-actions
2098
+ class="commands"
2099
+ [actions]="row.commands"
2100
+ [context]="view.item"
2101
+ [size]="_commandSize"
2102
+ [source]="row.source"
2103
+ [autoId]="view.autoId ? view.autoId + '-command' : undefined" />
2104
+ }
841
2105
  </span>
842
2106
  @if (!_compact) {
843
2107
  <span class="cell cell--modified" role="cell" [title]="view.modifiedTitle">{{ view.modifiedLabel || '—' }}</span>
844
2108
  }
845
2109
  <span class="cell cell--size" role="cell">{{ view.sizeLabel || '—' }}</span>
846
- @if (_hasActions) {
2110
+ @for (column of columns(); track column.id(); let index = $index) {
2111
+ <span class="cell cell--custom" role="cell" [style.grid-column]="5 + index">
2112
+ <ng-container
2113
+ [ngTemplateOutlet]="column.template"
2114
+ [ngTemplateOutletContext]="{ $implicit: view.item, item: view.item, data: view.item.data, index: rowIndex }" />
2115
+ </span>
2116
+ }
2117
+ @if (_actionColumn) {
847
2118
  <!-- why: sd-button already keeps its click from reaching the row; Enter/Space are stopped here so the key does not open the file too. -->
848
- <span class="cell cell--action" role="cell">
849
- @if (view.item.kind === 'file') {
2119
+ <span class="cell cell--action" role="cell" [style.grid-column]="5 + columns().length">
2120
+ @if (_compact) {
2121
+ @if (row.menu; as menu) {
2122
+ <sd-file-explorer-menu-trigger
2123
+ class="row-menu"
2124
+ [label]="view.actionsLabel"
2125
+ [busy]="menu.busy"
2126
+ [expanded]="view.item.id === _menuOpenId"
2127
+ [touch]="_touch"
2128
+ [autoId]="view.autoId ? view.autoId + '-commands' : undefined"
2129
+ (activate)="openCommands.emit({ item: view.item, trigger: $event })" />
2130
+ }
2131
+ } @else if (view.item.kind === 'file') {
850
2132
  @if (_canShare) {
851
2133
  <sd-button
852
2134
  class="row-action row-share"
2135
+ [disabled]="view.shareDisabled ?? false"
2136
+ [attr.aria-description]="view.shareDisabled ? view.unavailableReason : null"
853
2137
  type="text"
854
2138
  color="secondary"
855
2139
  size="sm"
@@ -863,6 +2147,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
863
2147
  @if (_canDownload) {
864
2148
  <sd-button
865
2149
  class="row-action row-download"
2150
+ [disabled]="view.downloadDisabled ?? false"
2151
+ [attr.aria-description]="view.downloadDisabled ? view.unavailableReason : null"
866
2152
  type="text"
867
2153
  color="secondary"
868
2154
  size="sm"
@@ -881,17 +2167,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
881
2167
  </div>
882
2168
  </div>
883
2169
  } @else {
2170
+ @let _cardTop = !!_selection || hasCommands();
2171
+ @if (_selection) {
2172
+ <div class="grid-head">
2173
+ <mat-checkbox
2174
+ class="select-all"
2175
+ color="primary"
2176
+ [checked]="_selection.state === 'all'"
2177
+ [indeterminate]="_selection.state === 'some'"
2178
+ [disabled]="!_selection.eligibleCount"
2179
+ [aria-label]="_selection.allLabel"
2180
+ [matTooltip]="_selection.allLabel"
2181
+ [attr.data-autoid]="_selection.autoId ?? null"
2182
+ (change)="toggleSelectAll.emit()" />
2183
+ </div>
2184
+ }
884
2185
  <ul class="grid" [attr.aria-label]="label()">
885
- @for (view of _items; track view.item.id) {
2186
+ @for (row of _rows; track row.view.item.id) {
2187
+ @let view = row.view;
886
2188
  <li
887
2189
  class="card"
888
2190
  tabindex="0"
889
2191
  [class.card--active]="view.item.id === _activeId"
2192
+ [class.card--selected]="row.selected"
890
2193
  [attr.data-item-id]="view.item.id"
2194
+ [attr.data-move-target]="view.item.kind === 'folder' ? view.item.id : null"
2195
+ [class.move-drop-target]="view.item.kind === 'folder' && moveDropTarget() === view.item.id"
891
2196
  [attr.data-autoid]="view.autoId"
892
2197
  [attr.aria-label]="view.item.name + ', ' + view.typeLabel"
893
- (click)="activate.emit(view)"
2198
+ (click)="onClick($event, view)"
894
2199
  (keydown)="onKeydown($event, view)">
2200
+ @if (_cardTop) {
2201
+ <span class="card-top">
2202
+ @if (row.selectable) {
2203
+ <mat-checkbox
2204
+ class="select"
2205
+ color="primary"
2206
+ [checked]="row.selected"
2207
+ [disabled]="row.selectDisabled"
2208
+ [aria-label]="view.selectLabel"
2209
+ [attr.data-autoid]="view.autoId ? view.autoId + '-select' : null"
2210
+ (change)="toggleSelect.emit(view.item)" />
2211
+ }
2212
+ @if (row.commands) {
2213
+ <sd-file-explorer-actions
2214
+ class="commands"
2215
+ [actions]="row.commands"
2216
+ [context]="view.item"
2217
+ [size]="_commandSize"
2218
+ [source]="row.source"
2219
+ [autoId]="view.autoId ? view.autoId + '-command' : undefined" />
2220
+ }
2221
+ @if (row.menu; as menu) {
2222
+ <sd-file-explorer-menu-trigger
2223
+ class="card-menu"
2224
+ [label]="view.actionsLabel"
2225
+ [busy]="menu.busy"
2226
+ [expanded]="view.item.id === _menuOpenId"
2227
+ [touch]="_touch"
2228
+ [autoId]="view.autoId ? view.autoId + '-commands' : undefined"
2229
+ (activate)="openCommands.emit({ item: view.item, trigger: $event })" />
2230
+ }
2231
+ </span>
2232
+ }
895
2233
  <span class="thumb">
896
2234
  @if (view.item.thumbnailUrl) {
897
2235
  <img [src]="view.item.thumbnailUrl" alt="" loading="lazy" />
@@ -899,13 +2237,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
899
2237
  <sd-file-explorer-file-icon [icon]="view.icon" [size]="48" />
900
2238
  }
901
2239
  </span>
902
- <span class="card-name" [title]="view.item.name">{{ view.item.name }}</span>
2240
+ <span class="card-name" [draggable]="canMove() && view.item.kind === 'file'" [title]="view.item.name">{{
2241
+ view.item.name
2242
+ }}</span>
2243
+ @if (canMove() && view.item.kind === 'file') {
2244
+ <sd-button
2245
+ htmlType="button"
2246
+ class="move-file-button commands"
2247
+ type="text"
2248
+ color="secondary"
2249
+ size="sm"
2250
+ prefixIcon="drive_file_move"
2251
+ [disabled]="movePending()"
2252
+ [tooltip]="('core.component.file-explorer.move.to' | sdTranslate) + ': ' + view.item.name"
2253
+ (click)="$event.stopPropagation(); move.emit(view.item)"
2254
+ (keydown)="$event.stopPropagation()" />
2255
+ }
903
2256
  </li>
904
2257
  }
905
2258
  </ul>
906
2259
  }
907
- `, styles: [":host{display:block}.list{width:100%}.row{display:grid;grid-template-columns:minmax(0,1fr) 128px 88px var(--sd-fe-actions-width, 44px);align-items:center;min-height:62px;border-bottom:1px solid var(--sd-fe-border);color:var(--sd-fe-text);font-size:var(--sd-font-size-15, 15px);cursor:pointer;outline:none;transition:background-color var(--sd-duration-fast, .12s) ease}.row:hover{background:var(--sd-fe-hover)}.row:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.list:not(:has(.cell--action)) .row{grid-template-columns:minmax(0,1fr) 128px 88px}.row--head{min-height:34px;color:var(--sd-fe-text-secondary);font-size:var(--sd-font-size-13, 13px);cursor:default}.row--head:hover{background:transparent}.row--active,.row--active:hover{background:var(--sd-fe-accent-soft)}.cell{min-width:0;padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell--name{display:flex;align-items:center;gap:16px}.row:not(.row--head) .cell--modified,.row:not(.row--head) .cell--size{color:var(--sd-fe-text-secondary);font-size:var(--sd-font-size-13, 13px)}.cell--action{display:flex;align-items:center;justify-content:flex-end;gap:2px;padding:0 4px 0 0;overflow:visible}.name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .row{grid-template-columns:minmax(0,1fr) 66px var(--sd-fe-actions-width, 36px);min-height:55px;font-size:var(--sd-font-size-14, 14px)}:host(.sd-file-explorer-item-list--compact) .list:not(:has(.cell--action)) .row{grid-template-columns:minmax(0,1fr) 66px}:host(.sd-file-explorer-item-list--compact) .row--head{min-height:30px;font-size:var(--sd-font-size-12, 12px)}:host(.sd-file-explorer-item-list--compact) .cell--name{gap:12px}:host(.sd-file-explorer-item-list--compact) .cell{padding:0 4px}:host(.sd-file-explorer-item-list--compact) .cell--action{padding:0}.grid{list-style:none;margin:0;padding:4px 0 0;display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:18px 20px}.card{display:flex;flex-direction:column;gap:12px;min-width:0;padding:12px 12px 14px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-12, 12px);background:var(--sd-fe-surface);color:var(--sd-fe-text);cursor:pointer;outline:none;transition:border-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease}.card:hover{border-color:var(--sd-fe-border-strong);box-shadow:0 2px 8px #0f172a0f}.card:focus-visible{box-shadow:0 0 0 2px var(--sd-fe-accent)}.card--active{border-color:var(--sd-fe-accent)}.thumb{display:flex;align-items:center;justify-content:center;height:104px;overflow:hidden;border-radius:var(--sd-radius-8, 8px);background:var(--sd-fe-muted-surface)}.thumb img{width:100%;height:100%;object-fit:cover}.card-name{padding:0 2px;overflow:hidden;font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600);text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .grid{grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:12px}@media(prefers-reduced-motion:reduce){.row,.card{transition:none}}\n"] }]
908
- }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], canDownload: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDownload", required: false }] }], canShare: [{ type: i0.Input, args: [{ isSignal: true, alias: "canShare", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], activeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeId", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], activate: [{ type: i0.Output, args: ["activate"] }], download: [{ type: i0.Output, args: ["download"] }], share: [{ type: i0.Output, args: ["share"] }] } });
2260
+ `, styles: [":host{display:block}.list{width:100%}.row{display:grid;grid-template-columns:var(--sd-fe-select-col, 0px) minmax(0,1fr) var(--sd-fe-modified-col, 128px) var(--sd-fe-size-col, 88px) var(--sd-fe-custom-cols, ) var(--sd-fe-actions-width, 0px);align-items:center;min-height:62px;border-bottom:1px solid var(--sd-fe-border);color:var(--sd-fe-text);font-size:var(--sd-font-size-15, 15px);cursor:pointer;outline:none;transition:background-color var(--sd-duration-fast, .12s) ease}.row:hover{background:var(--sd-fe-hover)}.row:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.list--selectable{--sd-fe-select-col: 44px}.list--custom{min-width:max-content}.list--custom .cell--name{min-width:180px}.cell--select{grid-column:1}.cell--name{grid-column:2}.cell--modified{grid-column:3}.cell--size{grid-column:4}.cell--action{grid-column:5}.row--head{min-height:34px;color:var(--sd-fe-text-secondary);font-size:var(--sd-font-size-13, 13px);cursor:default}.row--head:hover{background:transparent}.row--active,.row--selected,.row--active:hover,.row--selected:hover{background:var(--sd-fe-accent-soft)}.cell{min-width:0;padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell--name{display:flex;align-items:center;gap:16px}.row:not(.row--head) .cell--modified,.row:not(.row--head) .cell--size{color:var(--sd-fe-text-secondary);font-size:var(--sd-font-size-13, 13px)}.cell--action{display:flex;align-items:center;justify-content:flex-end;gap:2px;padding:0 4px 0 0;overflow:visible}.name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row--movable .cell--name{flex-wrap:wrap;row-gap:16px;padding-block:8px;overflow:visible}.row--movable .name{flex:1 1 4.5rem}.cell--select{display:flex;align-items:center;justify-content:center;padding:0;overflow:visible}.row--commands .cell--name{flex-wrap:wrap;row-gap:4px;padding-block:8px;overflow:visible}.row--commands .name{flex:1 1 4.5rem}.commands,.card-menu{margin-inline-start:auto}.commands{opacity:0}.row:hover .commands,.row:focus-within .commands,.card:hover .commands,.card:focus-within .commands,.commands.sd-file-explorer-actions--open,.commands.sd-file-explorer-actions--busy,:host(.sd-file-explorer-item-list--touch) .commands{opacity:1}:host(.sd-file-explorer-item-list--compact){--sd-fe-modified-col: 0px;--sd-fe-size-col: 66px}:host(.sd-file-explorer-item-list--compact) .row{min-height:55px;font-size:var(--sd-font-size-14, 14px)}:host(.sd-file-explorer-item-list--compact) .row--head{min-height:30px;font-size:var(--sd-font-size-12, 12px)}:host(.sd-file-explorer-item-list--compact) .cell--name{gap:12px}:host(.sd-file-explorer-item-list--compact) .cell{padding:0 4px}:host(.sd-file-explorer-item-list--compact) .cell--action{padding:0}.grid{list-style:none;margin:0;padding:4px 0 0;display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:18px 20px}.card{display:flex;flex-direction:column;gap:12px;min-width:0;padding:12px 12px 14px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-12, 12px);background:var(--sd-fe-surface);color:var(--sd-fe-text);cursor:pointer;outline:none;transition:border-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease}.card:hover{border-color:var(--sd-fe-border-strong);box-shadow:0 2px 8px #0f172a0f}.card:focus-visible{box-shadow:0 0 0 2px var(--sd-fe-accent)}.card--active{border-color:var(--sd-fe-accent)}.card--selected{border-color:var(--sd-fe-accent);background:var(--sd-fe-accent-soft)}.card-top{display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-height:40px;margin-block:-4px}.grid-head{display:flex;align-items:center;margin-bottom:12px;padding:0 0 4px 13px;border-bottom:1px solid var(--sd-fe-border)}.thumb{display:flex;align-items:center;justify-content:center;height:104px;overflow:hidden;border-radius:var(--sd-radius-8, 8px);background:var(--sd-fe-muted-surface)}.thumb img{width:100%;height:100%;object-fit:cover}.card-name{padding:0 2px;overflow:hidden;font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600);text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .grid{grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:12px}@media(prefers-reduced-motion:reduce){.row,.card{transition:none}}.move-file-button{flex-shrink:0}.move-drop-target{outline:2px solid var(--sd-fe-accent);outline-offset:-2px}.move-drop-label{color:var(--sd-fe-text);font-weight:600}\n"] }]
2261
+ }], propDecorators: { canMove: [{ type: i0.Input, args: [{ isSignal: true, alias: "canMove", required: false }] }], moveDropTarget: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveDropTarget", required: false }] }], movePending: [{ type: i0.Input, args: [{ isSignal: true, alias: "movePending", required: false }] }], move: [{ type: i0.Output, args: ["move"] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], canDownload: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDownload", required: false }] }], canShare: [{ type: i0.Input, args: [{ isSignal: true, alias: "canShare", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], touch: [{ type: i0.Input, args: [{ isSignal: true, alias: "touch", required: false }] }], activeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeId", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], fileCommands: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileCommands", required: false }] }], folderCommands: [{ type: i0.Input, args: [{ isSignal: true, alias: "folderCommands", required: false }] }], menuOpenId: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuOpenId", required: false }] }], activate: [{ type: i0.Output, args: ["activate"] }], openCommands: [{ type: i0.Output, args: ["openCommands"] }], download: [{ type: i0.Output, args: ["download"] }], share: [{ type: i0.Output, args: ["share"] }], toggleSelect: [{ type: i0.Output, args: ["toggleSelect"] }], toggleSelectAll: [{ type: i0.Output, args: ["toggleSelectAll"] }] } });
909
2262
 
910
2263
  /**
911
2264
  * File detail of the explorer (internal): an `<sd-side-drawer>` opened in the explorer's item area (right of the
@@ -930,6 +2283,8 @@ class SdFileExplorerPreviewPanel {
930
2283
  canDownload = input(false, ...(ngDevMode ? [{ debugName: "canDownload" }] : /* istanbul ignore next */ []));
931
2284
  /** Show the share button. */
932
2285
  canShare = input(false, ...(ngDevMode ? [{ debugName: "canShare" }] : /* istanbul ignore next */ []));
2286
+ /** Matches the explorer's narrow layout; footer buttons retain Core's 48 px touch span. */
2287
+ compact = input(false, ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
933
2288
  /** Element the drawer opens inside: the explorer's item area, right of the folder tree. */
934
2289
  container = input(null, ...(ngDevMode ? [{ debugName: "container" }] : /* istanbul ignore next */ []));
935
2290
  /** E2E scope of the detail content and its buttons. */
@@ -1021,7 +2376,7 @@ class SdFileExplorerPreviewPanel {
1021
2376
  }
1022
2377
  }
1023
2378
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerPreviewPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
1024
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdFileExplorerPreviewPanel, isStandalone: true, selector: "sd-file-explorer-preview-panel", inputs: { view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, meta: { classPropertyName: "meta", publicName: "meta", isSignal: true, isRequired: false, transformFunction: null }, canDownload: { classPropertyName: "canDownload", publicName: "canDownload", isSignal: true, isRequired: false, transformFunction: null }, canShare: { classPropertyName: "canShare", publicName: "canShare", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", download: "download", share: "share", retry: "retry", imageError: "imageError" }, host: { classAttribute: "sd-file-explorer-preview-panel" }, viewQueries: [{ propertyName: "drawer", first: true, predicate: SdSideDrawer, descendants: true, isSignal: true }], ngImport: i0, template: `
2379
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdFileExplorerPreviewPanel, isStandalone: true, selector: "sd-file-explorer-preview-panel", inputs: { view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, meta: { classPropertyName: "meta", publicName: "meta", isSignal: true, isRequired: false, transformFunction: null }, canDownload: { classPropertyName: "canDownload", publicName: "canDownload", isSignal: true, isRequired: false, transformFunction: null }, canShare: { classPropertyName: "canShare", publicName: "canShare", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", download: "download", share: "share", retry: "retry", imageError: "imageError" }, host: { classAttribute: "sd-file-explorer-preview-panel" }, viewQueries: [{ propertyName: "drawer", first: true, predicate: SdSideDrawer, descendants: true, isSignal: true }], ngImport: i0, template: `
1025
2380
  @let _view = view();
1026
2381
  @let _state = state();
1027
2382
  @let _autoId = autoId();
@@ -1106,6 +2461,9 @@ class SdFileExplorerPreviewPanel {
1106
2461
  <sd-button
1107
2462
  sdFooterRight
1108
2463
  class="share-button"
2464
+ [size]="compact() ? 'sm' : 'md'"
2465
+ [disabled]="_view?.shareDisabled ?? false"
2466
+ [attr.aria-description]="_view?.shareDisabled ? _view?.unavailableReason : null"
1109
2467
  [type]="_canDownload ? 'outline' : 'fill'"
1110
2468
  [color]="_canDownload ? 'secondary' : 'primary'"
1111
2469
  prefixIcon="share"
@@ -1117,6 +2475,9 @@ class SdFileExplorerPreviewPanel {
1117
2475
  <sd-button
1118
2476
  sdFooterRight
1119
2477
  class="download-button"
2478
+ [size]="compact() ? 'sm' : 'md'"
2479
+ [disabled]="_view?.downloadDisabled ?? false"
2480
+ [attr.aria-description]="_view?.downloadDisabled ? _view?.unavailableReason : null"
1120
2481
  type="fill"
1121
2482
  color="primary"
1122
2483
  prefixIcon="file_download"
@@ -1140,7 +2501,7 @@ class SdFileExplorerPreviewPanel {
1140
2501
  </div>
1141
2502
  }
1142
2503
  </ng-template>
1143
- `, isInline: true, styles: [":host{display:none}.detail{display:flex;flex-direction:column;height:100%}.stage{display:flex;flex:0 1 216px;align-items:center;justify-content:center;min-height:140px;padding:14px;overflow:hidden;border-radius:var(--sd-radius-12, 12px);background:var(--sd-fe-preview-bg)}.stage--pdf{flex-basis:380px;min-height:240px;padding:0;background:var(--sd-fe-muted-surface)}.stage--pdf>*{width:100%;height:100%;min-height:0}.stage--video{flex:none;min-height:216px;padding:0;background:var(--sd-fe-muted-surface)}.stage--video>*{width:100%}.image{display:block;max-width:100%;max-height:100%;border-radius:var(--sd-radius-6, 6px);object-fit:contain}.placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px;text-align:center;color:var(--sd-fe-text-secondary)}.placeholder--error{color:var(--sd-fe-error)}.placeholder--error sd-button{margin-top:4px}.placeholder-title{margin:4px 0 0;color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600)}.placeholder-hint{margin:0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-fe-text-secondary)}.spinner{width:28px;height:28px;border:3px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-preview-spin .8s linear infinite}.meta{flex:none;margin:20px 0 0;padding:4px 0 0;border-top:1px solid var(--sd-fe-border)}.meta-row{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:baseline;gap:12px;padding:10px 0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px)}.meta-row dt{color:var(--sd-fe-text-secondary)}.meta-row dd{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes sd-file-explorer-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "container", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2504
+ `, isInline: true, styles: [":host{display:none}.detail{display:flex;flex-direction:column;height:100%}.stage{display:flex;flex:0 1 216px;align-items:center;justify-content:center;min-height:140px;padding:14px;overflow:hidden;border-radius:var(--sd-radius-12, 12px);background:var(--sd-fe-preview-bg)}.stage--pdf{flex-basis:380px;min-height:240px;padding:0;background:var(--sd-fe-muted-surface)}.stage--pdf>*{width:100%;height:100%;min-height:0}.stage--video{flex:none;min-height:216px;padding:0;background:var(--sd-fe-muted-surface)}.stage--video>*{width:100%}.image{display:block;max-width:100%;max-height:100%;border-radius:var(--sd-radius-6, 6px);object-fit:contain}.placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px;text-align:center;color:var(--sd-fe-text-secondary)}.placeholder--error{color:var(--sd-fe-error)}.placeholder--error sd-button{margin-top:4px}.placeholder-title{margin:4px 0 0;color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600)}.placeholder-hint{margin:0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-fe-text-secondary)}.spinner{width:28px;height:28px;border:3px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-preview-spin .8s linear infinite}.meta{flex:none;margin:20px 0 0;padding:4px 0 0;border-top:1px solid var(--sd-fe-border)}.meta-row{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:baseline;gap:12px;padding:10px 0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px)}.meta-row dt{color:var(--sd-fe-text-secondary)}.meta-row dd{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes sd-file-explorer-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "container", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1144
2505
  }
1145
2506
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerPreviewPanel, decorators: [{
1146
2507
  type: Component,
@@ -1231,6 +2592,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
1231
2592
  <sd-button
1232
2593
  sdFooterRight
1233
2594
  class="share-button"
2595
+ [size]="compact() ? 'sm' : 'md'"
2596
+ [disabled]="_view?.shareDisabled ?? false"
2597
+ [attr.aria-description]="_view?.shareDisabled ? _view?.unavailableReason : null"
1234
2598
  [type]="_canDownload ? 'outline' : 'fill'"
1235
2599
  [color]="_canDownload ? 'secondary' : 'primary'"
1236
2600
  prefixIcon="share"
@@ -1242,6 +2606,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
1242
2606
  <sd-button
1243
2607
  sdFooterRight
1244
2608
  class="download-button"
2609
+ [size]="compact() ? 'sm' : 'md'"
2610
+ [disabled]="_view?.downloadDisabled ?? false"
2611
+ [attr.aria-description]="_view?.downloadDisabled ? _view?.unavailableReason : null"
1245
2612
  type="fill"
1246
2613
  color="primary"
1247
2614
  prefixIcon="file_download"
@@ -1266,7 +2633,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
1266
2633
  }
1267
2634
  </ng-template>
1268
2635
  `, styles: [":host{display:none}.detail{display:flex;flex-direction:column;height:100%}.stage{display:flex;flex:0 1 216px;align-items:center;justify-content:center;min-height:140px;padding:14px;overflow:hidden;border-radius:var(--sd-radius-12, 12px);background:var(--sd-fe-preview-bg)}.stage--pdf{flex-basis:380px;min-height:240px;padding:0;background:var(--sd-fe-muted-surface)}.stage--pdf>*{width:100%;height:100%;min-height:0}.stage--video{flex:none;min-height:216px;padding:0;background:var(--sd-fe-muted-surface)}.stage--video>*{width:100%}.image{display:block;max-width:100%;max-height:100%;border-radius:var(--sd-radius-6, 6px);object-fit:contain}.placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px;text-align:center;color:var(--sd-fe-text-secondary)}.placeholder--error{color:var(--sd-fe-error)}.placeholder--error sd-button{margin-top:4px}.placeholder-title{margin:4px 0 0;color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600)}.placeholder-hint{margin:0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-fe-text-secondary)}.spinner{width:28px;height:28px;border:3px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-preview-spin .8s linear infinite}.meta{flex:none;margin:20px 0 0;padding:4px 0 0;border-top:1px solid var(--sd-fe-border)}.meta-row{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:baseline;gap:12px;padding:10px 0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px)}.meta-row dt{color:var(--sd-fe-text-secondary)}.meta-row dd{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes sd-file-explorer-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"] }]
1269
- }], ctorParameters: () => [], propDecorators: { view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: true }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], canDownload: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDownload", required: false }] }], canShare: [{ type: i0.Input, args: [{ isSignal: true, alias: "canShare", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], download: [{ type: i0.Output, args: ["download"] }], share: [{ type: i0.Output, args: ["share"] }], retry: [{ type: i0.Output, args: ["retry"] }], imageError: [{ type: i0.Output, args: ["imageError"] }], drawer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdSideDrawer), { isSignal: true }] }] } });
2636
+ }], ctorParameters: () => [], propDecorators: { view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: true }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], canDownload: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDownload", required: false }] }], canShare: [{ type: i0.Input, args: [{ isSignal: true, alias: "canShare", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], download: [{ type: i0.Output, args: ["download"] }], share: [{ type: i0.Output, args: ["share"] }], retry: [{ type: i0.Output, args: ["retry"] }], imageError: [{ type: i0.Output, args: ["imageError"] }], drawer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdSideDrawer), { isSignal: true }] }] } });
1270
2637
 
1271
2638
  let nextTransferPanelId = 0;
1272
2639
  /**
@@ -1400,7 +2767,7 @@ class SdFileExplorerTransferPanel {
1400
2767
  }
1401
2768
  </ul>
1402
2769
  </section>
1403
- `, isInline: true, styles: [":host{display:block}.panel{padding:12px 20px 18px}:host(.sd-file-explorer-transfer-panel--compact) .panel{padding:10px 14px 14px}.head{display:flex;align-items:center;gap:10px;min-height:32px}.head-icon{flex:none;width:22px;height:22px;color:var(--sd-fe-accent)}.title{flex:1;min-width:0;margin:0;overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);color:var(--sd-fe-text);text-overflow:ellipsis;white-space:nowrap}.cards{list-style:none;margin:12px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:12px 20px;max-height:188px;overflow-y:auto}.cards[hidden]{display:none}.card{display:flex;flex-direction:column;gap:11px;min-width:0;padding:12px 14px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-10, 10px);background:var(--sd-fe-surface)}.card-row{display:flex;align-items:center;gap:10px;min-height:22px}.direction{flex:none;color:var(--sd-fe-accent)}.name{flex:1;min-width:0;overflow:hidden;font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-fe-text);text-overflow:ellipsis;white-space:nowrap}.status{flex:none;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary);font-variant-numeric:tabular-nums}.bar{position:relative;height:6px;overflow:hidden;border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-track)}.bar-fill{position:absolute;inset:0 auto 0 0;border-radius:inherit;background:var(--sd-fe-accent);transition:width var(--sd-duration-base, .2s) ease}.bar--indeterminate .bar-fill{width:36%!important;animation:sd-file-explorer-indeterminate 1.3s ease-in-out infinite}.card--success .bar-fill{background:var(--sd-fe-success)}.card--error{border-color:color-mix(in srgb,var(--sd-fe-error) 35%,var(--sd-fe-border))}.card--error .bar-fill{background:var(--sd-fe-error)}.card--error .status{color:var(--sd-fe-error);font-weight:var(--sd-font-weight-semibold, 600)}.card--muted .bar-fill{background:var(--sd-fe-border-strong)}.error{margin:-4px 0 0;overflow:hidden;font-size:var(--sd-font-size-12, 12px);color:var(--sd-fe-error);text-overflow:ellipsis;white-space:nowrap}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-file-explorer-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.card-action{flex:none;margin:-5px -6px -5px -2px}.clear-button{flex:none}@keyframes sd-file-explorer-indeterminate{0%{left:-36%}to{left:100%}}@media(prefers-reduced-motion:reduce){.bar--indeterminate .bar-fill{animation-duration:3s}.bar-fill{transition:none}}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2770
+ `, isInline: true, styles: [":host{display:block}.panel{padding:12px 20px 18px}:host(.sd-file-explorer-transfer-panel--compact) .panel{padding:10px 14px 14px}.head{display:flex;align-items:center;gap:10px;min-height:32px}.head-icon{flex:none;width:22px;height:22px;color:var(--sd-fe-accent)}.title{flex:1;min-width:0;margin:0;overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);color:var(--sd-fe-text);text-overflow:ellipsis;white-space:nowrap}.cards{list-style:none;margin:12px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:12px 20px;max-height:188px;overflow-y:auto}.cards[hidden]{display:none}.card{display:flex;flex-direction:column;gap:11px;min-width:0;padding:12px 14px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-10, 10px);background:var(--sd-fe-surface)}.card-row{display:flex;align-items:center;gap:10px;min-height:22px}.direction{flex:none;color:var(--sd-fe-accent)}.name{flex:1;min-width:0;overflow:hidden;font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-fe-text);text-overflow:ellipsis;white-space:nowrap}.status{flex:none;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary);font-variant-numeric:tabular-nums}.bar{position:relative;height:6px;overflow:hidden;border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-track)}.bar-fill{position:absolute;inset:0 auto 0 0;border-radius:inherit;background:var(--sd-fe-accent);transition:width var(--sd-duration-base, .2s) ease}.bar--indeterminate .bar-fill{width:36%!important;animation:sd-file-explorer-indeterminate 1.3s ease-in-out infinite}.card--success .bar-fill{background:var(--sd-fe-success)}.card--error{border-color:color-mix(in srgb,var(--sd-fe-error) 35%,var(--sd-fe-border))}.card--error .bar-fill{background:var(--sd-fe-error)}.card--error .status{color:var(--sd-fe-error);font-weight:var(--sd-font-weight-semibold, 600)}.card--muted .bar-fill{background:var(--sd-fe-border-strong)}.error{margin:-4px 0 0;overflow:hidden;font-size:var(--sd-font-size-12, 12px);color:var(--sd-fe-error);text-overflow:ellipsis;white-space:nowrap}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-file-explorer-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.card-action{flex:none;margin:-5px -6px -5px -2px}.clear-button{flex:none}@keyframes sd-file-explorer-indeterminate{0%{left:-36%}to{left:100%}}@media(prefers-reduced-motion:reduce){.bar--indeterminate .bar-fill{animation-duration:3s}.bar-fill{transition:none}}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1404
2771
  }
1405
2772
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorerTransferPanel, decorators: [{
1406
2773
  type: Component,
@@ -1519,6 +2886,8 @@ const SEARCH_DEBOUNCE_MS = 300;
1519
2886
  const MAX_PARALLEL_UPLOADS = 3;
1520
2887
  /** Below this host width the explorer switches to the compact (mobile) layout. */
1521
2888
  const COMPACT_MAX_WIDTH = 720;
2889
+ /** Primary pointer is a finger: commands stay visible and use 48 px targets. */
2890
+ const TOUCH_QUERY = '(pointer: coarse)';
1522
2891
  /** How long a saved download's object URL stays alive before it is revoked. */
1523
2892
  const DOWNLOAD_URL_TTL_MS = 40_000;
1524
2893
  const ACTIVE_STATUSES = new Set(['queued', 'preparing', 'transferring']);
@@ -1528,7 +2897,7 @@ let nextExplorerId = 0;
1528
2897
  * Google-Drive-like file browser: folder tree, breadcrumb, list / grid, search, file detail drawer, uploads with
1529
2898
  * drag-and-drop, downloads and a transfer queue — all inside one element.
1530
2899
  *
1531
- * Storage-agnostic: every read and write goes through the callbacks of `SdFileExplorerOption`.
2900
+ * Storage-agnostic: every read and write goes through the callbacks of `SdFileExplorerOption<T>`.
1532
2901
  *
1533
2902
  * @example
1534
2903
  * ```html
@@ -1536,13 +2905,52 @@ let nextExplorerId = 0;
1536
2905
  * ```
1537
2906
  */
1538
2907
  class SdFileExplorer {
2908
+ #moveDrag = new SdFileExplorerDragSession();
2909
+ #moveController = null;
2910
+ #moveRefreshFolders = [];
2911
+ #moveReturnFocus = null;
2912
+ #moveDragSelectionRequired = false;
2913
+ #movePickerSelectionRequired = false;
2914
+ movePending = signal(false, ...(ngDevMode ? [{ debugName: "movePending" }] : /* istanbul ignore next */ []));
2915
+ moveStatus = signal('', ...(ngDevMode ? [{ debugName: "moveStatus" }] : /* istanbul ignore next */ []));
2916
+ moveRefreshError = signal(false, ...(ngDevMode ? [{ debugName: "moveRefreshError" }] : /* istanbul ignore next */ []));
2917
+ movePickerItems = signal(null, ...(ngDevMode ? [{ debugName: "movePickerItems" }] : /* istanbul ignore next */ []));
2918
+ moveTarget = signal(null, ...(ngDevMode ? [{ debugName: "moveTarget" }] : /* istanbul ignore next */ []));
2919
+ moveDropTarget = signal(undefined, ...(ngDevMode ? [{ debugName: "moveDropTarget" }] : /* istanbul ignore next */ []));
2920
+ canMove = computed(() => typeof this.#config().move?.onMove === 'function', ...(ngDevMode ? [{ debugName: "canMove" }] : /* istanbul ignore next */ []));
2921
+ movePickerNodes = computed(() => this.treeNodes().map(node => ({ ...node, selected: node.id === (this.moveTarget()?.id ?? null) })), ...(ngDevMode ? [{ debugName: "movePickerNodes" }] : /* istanbul ignore next */ []));
2922
+ canSubmitMove = computed(() => {
2923
+ const items = this.movePickerItems();
2924
+ if (!items || this.movePending())
2925
+ return false;
2926
+ return this.#moveAllowed(items, this.moveTarget(), 'menu', new AbortController().signal, this.#movePickerSelectionRequired);
2927
+ }, ...(ngDevMode ? [{ debugName: "canSubmitMove" }] : /* istanbul ignore next */ []));
2928
+ columnDefs = contentChildren(SdFileExplorerColumnDef, ...(ngDevMode ? [{ debugName: "columnDefs" }] : /* istanbul ignore next */ []));
2929
+ #warnedColumns = new WeakSet();
2930
+ columns = computed(() => {
2931
+ const seen = new Set();
2932
+ return this.columnDefs().filter(column => {
2933
+ const id = column.id().trim();
2934
+ if (!id || seen.has(id)) {
2935
+ if (isDevMode() && !this.#warnedColumns.has(column)) {
2936
+ this.#warnedColumns.add(column);
2937
+ console.warn(`[sd-file-explorer] ignored empty or duplicate column id: ${id}`);
2938
+ }
2939
+ return false;
2940
+ }
2941
+ seen.add(id);
2942
+ return true;
2943
+ });
2944
+ }, ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
1539
2945
  #i18n = inject(I18nService);
2946
+ #dateTime = inject(SdDateTimeService);
1540
2947
  #host = inject(ElementRef);
1541
2948
  #document = inject(DOCUMENT);
1542
2949
  #injector = inject(Injector);
1543
2950
  #zone = inject(NgZone);
1544
- /** Data callbacks and display settings. See `SdFileExplorerOption`. */
2951
+ /** Data callbacks and display settings. See `SdFileExplorerOption<T>`. */
1545
2952
  option = input.required(...(ngDevMode ? [{ debugName: "option" }] : /* istanbul ignore next */ []));
2953
+ #config = computed(() => sdFileExplorerNormalizeConfig(this.option()), ...(ngDevMode ? [{ debugName: "#config" }] : /* istanbul ignore next */ []));
1546
2954
  /**
1547
2955
  * Emitted exactly once each time the user opens a file (click, `Enter` or `Space` on a file in the list,
1548
2956
  * grid or search results), right before the detail drawer starts loading. Never emitted for folders.
@@ -1557,6 +2965,14 @@ class SdFileExplorer {
1557
2965
  #previewItem = signal(null, ...(ngDevMode ? [{ debugName: "#previewItem" }] : /* istanbul ignore next */ []));
1558
2966
  #transfers = signal([], ...(ngDevMode ? [{ debugName: "#transfers" }] : /* istanbul ignore next */ []));
1559
2967
  #width = signal(0, ...(ngDevMode ? [{ debugName: "#width" }] : /* istanbul ignore next */ []));
2968
+ #touch = signal(false, ...(ngDevMode ? [{ debugName: "#touch" }] : /* istanbul ignore next */ []));
2969
+ /**
2970
+ * Ids the user selected. Only those still visible and eligible count — see `selectedItems` — and the others are
2971
+ * forgotten once the view settles, so a file that leaves the view or gets disabled is never selected again by itself.
2972
+ */
2973
+ #selectedIds = signal(new Set(), ...(ngDevMode ? [{ debugName: "#selectedIds" }] : /* istanbul ignore next */ []));
2974
+ /** Item whose commands the compact drawer shows; `null` while it is closed. */
2975
+ #commandTarget = signal(null, ...(ngDevMode ? [{ debugName: "#commandTarget" }] : /* istanbul ignore next */ []));
1560
2976
  view = signal('list', ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
1561
2977
  keyword = signal('', ...(ngDevMode ? [{ debugName: "keyword" }] : /* istanbul ignore next */ []));
1562
2978
  previewState = signal({ status: 'idle' }, ...(ngDevMode ? [{ debugName: "previewState" }] : /* istanbul ignore next */ []));
@@ -1587,6 +3003,7 @@ class SdFileExplorer {
1587
3003
  shareInput = viewChild('shareInput', ...(ngDevMode ? [{ debugName: "shareInput" }] : /* istanbul ignore next */ []));
1588
3004
  shareDialog = viewChild('shareDialog', ...(ngDevMode ? [{ debugName: "shareDialog" }] : /* istanbul ignore next */ []));
1589
3005
  sidebar = viewChild('sidebar', ...(ngDevMode ? [{ debugName: "sidebar" }] : /* istanbul ignore next */ []));
3006
+ commandDrawer = viewChild(SdFileExplorerCommandSheet, ...(ngDevMode ? [{ debugName: "commandDrawer" }] : /* istanbul ignore next */ []));
1590
3007
  // ---- Non-reactive bookkeeping ----
1591
3008
  #listControllers = new Map();
1592
3009
  #jobs = new Map();
@@ -1600,6 +3017,8 @@ class SdFileExplorer {
1600
3017
  #previewObjectUrl = null;
1601
3018
  #shareController = null;
1602
3019
  #shareReturnFocus = null;
3020
+ /** Command pressed in the compact drawer, waiting for the drawer to finish closing; any context change drops it. */
3021
+ #pendingCommand = null;
1603
3022
  #dragDepth = 0;
1604
3023
  #listFn = null;
1605
3024
  #resizeObserver = null;
@@ -1610,17 +3029,20 @@ class SdFileExplorer {
1610
3029
  const width = this.#width();
1611
3030
  return width > 0 && width < COMPACT_MAX_WIDTH;
1612
3031
  }, ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
3032
+ touch = this.#touch.asReadonly();
1613
3033
  autoId = computed(() => {
1614
- const scope = this.option().autoId;
3034
+ const scope = this.#config().autoId;
1615
3035
  return scope ? `components-file-explorer-${scope}` : undefined;
1616
3036
  }, ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
1617
3037
  locale = this.#i18n.locale;
1618
- rootLabel = computed(() => this.option().rootLabel || this.#i18n.t('core.component.file-explorer.root'), ...(ngDevMode ? [{ debugName: "rootLabel" }] : /* istanbul ignore next */ []));
1619
- canUpload = computed(() => typeof this.option().upload === 'function', ...(ngDevMode ? [{ debugName: "canUpload" }] : /* istanbul ignore next */ []));
1620
- canDownload = computed(() => typeof this.option().download === 'function', ...(ngDevMode ? [{ debugName: "canDownload" }] : /* istanbul ignore next */ []));
1621
- canCreateFolder = computed(() => typeof this.option().createFolder === 'function', ...(ngDevMode ? [{ debugName: "canCreateFolder" }] : /* istanbul ignore next */ []));
1622
- canShare = computed(() => typeof this.option().share === 'function', ...(ngDevMode ? [{ debugName: "canShare" }] : /* istanbul ignore next */ []));
1623
- #serverSearch = computed(() => typeof this.option().search === 'function', ...(ngDevMode ? [{ debugName: "#serverSearch" }] : /* istanbul ignore next */ []));
3038
+ rootLabel = computed(() => this.#config().rootLabel || this.#i18n.t('core.component.file-explorer.root'), ...(ngDevMode ? [{ debugName: "rootLabel" }] : /* istanbul ignore next */ []));
3039
+ canUpload = computed(() => typeof this.#config().upload === 'function', ...(ngDevMode ? [{ debugName: "canUpload" }] : /* istanbul ignore next */ []));
3040
+ canDownload = computed(() => typeof this.#config().download === 'function', ...(ngDevMode ? [{ debugName: "canDownload" }] : /* istanbul ignore next */ []));
3041
+ canCreateFolder = computed(() => typeof this.#config().createFolder === 'function', ...(ngDevMode ? [{ debugName: "canCreateFolder" }] : /* istanbul ignore next */ []));
3042
+ canShare = computed(() => typeof this.#config().share === 'function', ...(ngDevMode ? [{ debugName: "canShare" }] : /* istanbul ignore next */ []));
3043
+ uploadDisabled = computed(() => this.movePending() || !sdFileExplorerEligible(this.#config().uploadable, { parentId: this.#currentId() }), ...(ngDevMode ? [{ debugName: "uploadDisabled" }] : /* istanbul ignore next */ []));
3044
+ createDisabled = computed(() => this.movePending() || !sdFileExplorerEligible(this.#config().creatable, { parentId: this.#currentId() }), ...(ngDevMode ? [{ debugName: "createDisabled" }] : /* istanbul ignore next */ []));
3045
+ #serverSearch = computed(() => typeof this.#config().search === 'function', ...(ngDevMode ? [{ debugName: "#serverSearch" }] : /* istanbul ignore next */ []));
1624
3046
  currentName = computed(() => {
1625
3047
  const path = this.#path();
1626
3048
  return path.length ? path[path.length - 1].name : this.rootLabel();
@@ -1655,6 +3077,188 @@ class SdFileExplorer {
1655
3077
  const format = this.#itemFormatter();
1656
3078
  return sdFileExplorerFoldersFirst(this.#visibleItems()).map(format);
1657
3079
  }, ...(ngDevMode ? [{ debugName: "itemViews" }] : /* istanbul ignore next */ []));
3080
+ // ---- Selection ----
3081
+ /** The row download / share shortcuts stay until the consumer declares `fileCommands` (even `[]`). */
3082
+ rowShortcuts = computed(() => this.#config().fileCommands == null, ...(ngDevMode ? [{ debugName: "rowShortcuts" }] : /* istanbul ignore next */ []));
3083
+ #configuredSelector = computed(() => {
3084
+ const selector = this.#config().selector;
3085
+ return selector && selector.visible !== false ? selector : null;
3086
+ }, ...(ngDevMode ? [{ debugName: "#configuredSelector" }] : /* istanbul ignore next */ []));
3087
+ #pickerSelection = computed(() => {
3088
+ const selector = this.#configuredSelector();
3089
+ return (!!selector &&
3090
+ (selector.mode === 'picker' ||
3091
+ (selector.mode === undefined && (typeof selector.onSelect === 'function' || typeof selector.onSelectAll === 'function'))));
3092
+ }, ...(ngDevMode ? [{ debugName: "#pickerSelection" }] : /* istanbul ignore next */ []));
3093
+ /** Selection actions remain caller-owned when declared, including an intentional empty array. */
3094
+ selectionActions = computed(() => {
3095
+ const selector = this.#configuredSelector();
3096
+ if (!selector)
3097
+ return [];
3098
+ if (selector.actions !== undefined)
3099
+ return selector.actions ?? [];
3100
+ if (this.#pickerSelection())
3101
+ return [];
3102
+ const config = this.#config();
3103
+ const actions = [];
3104
+ if (typeof config.move?.onMove === 'function')
3105
+ actions.push({
3106
+ title: this.#i18n.t('core.component.file-explorer.move.to'),
3107
+ prefixIcon: 'drive_file_move',
3108
+ type: 'outline',
3109
+ disabled: () => this.movePending() || this.moveRefreshError(),
3110
+ onClick: items => this.openMovePicker(items),
3111
+ });
3112
+ if (typeof config.share === 'function')
3113
+ actions.push({
3114
+ title: this.#i18n.t('core.component.file-explorer.share'),
3115
+ prefixIcon: 'share',
3116
+ disabled: items => items.length !== 1 || !sdFileExplorerEligible(config.shareable, items[0]),
3117
+ onClick: items => {
3118
+ if (items.length === 1)
3119
+ this.openShare(items[0]);
3120
+ },
3121
+ });
3122
+ if (typeof config.download === 'function')
3123
+ actions.push({
3124
+ title: this.#i18n.t('core.component.file-explorer.download'),
3125
+ prefixIcon: 'file_download',
3126
+ disabled: items => !items.length || items.some(item => !sdFileExplorerEligible(config.downloadable, item)),
3127
+ onClick: items => {
3128
+ for (const item of items)
3129
+ this.downloadItem(item);
3130
+ },
3131
+ });
3132
+ return actions;
3133
+ }, ...(ngDevMode ? [{ debugName: "selectionActions" }] : /* istanbul ignore next */ []));
3134
+ #selector = computed(() => {
3135
+ const selector = this.#configuredSelector();
3136
+ if (!selector || this.#pickerSelection())
3137
+ return selector;
3138
+ // Keep intermediate selections reachable even when actions are hidden until a particular combination is selected.
3139
+ return sdFileExplorerHasActionCapability(this.selectionActions()) ? selector : null;
3140
+ }, ...(ngDevMode ? [{ debugName: "#selector" }] : /* istanbul ignore next */ []));
3141
+ /** Files of the current folder or search results, in display order. Folders are never selectable. */
3142
+ #visibleFiles = computed(() => this.#visibleItems().filter(item => item.kind === 'file'), ...(ngDevMode ? [{ debugName: "#visibleFiles" }] : /* istanbul ignore next */ []));
3143
+ #selectionCandidates = computed(() => {
3144
+ const selector = this.#configuredSelector();
3145
+ if (!selector)
3146
+ return [];
3147
+ const disabled = selector.disabled;
3148
+ return disabled ? this.#visibleFiles().filter(item => !disabled(item)) : this.#visibleFiles();
3149
+ }, ...(ngDevMode ? [{ debugName: "#selectionCandidates" }] : /* istanbul ignore next */ []));
3150
+ #eligibleFiles = computed(() => (this.#selector() ? this.#selectionCandidates() : []), ...(ngDevMode ? [{ debugName: "#eligibleFiles" }] : /* istanbul ignore next */ []));
3151
+ /**
3152
+ * Frozen snapshot of the selection handed to callbacks and actions: selected files that are still visible and
3153
+ * eligible, in display order. A file that a refresh drops, or that becomes disabled, leaves it.
3154
+ */
3155
+ selectedItems = computed(() => {
3156
+ const ids = this.#selectedIds();
3157
+ return Object.freeze(this.#eligibleFiles().filter(item => ids.has(item.id)));
3158
+ }, ...(ngDevMode ? [{ debugName: "selectedItems" }] : /* istanbul ignore next */ []));
3159
+ /** Selection state of the item list; `null` (no checkbox, no band) without selector or without files in view. */
3160
+ selectionView = computed(() => {
3161
+ const files = this.#visibleFiles();
3162
+ if (!this.#selector() || !files.length)
3163
+ return null;
3164
+ const eligible = this.#eligibleFiles();
3165
+ const selected = this.selectedItems();
3166
+ const eligibleIds = new Set(eligible.map(item => item.id));
3167
+ const autoId = this.autoId();
3168
+ return {
3169
+ selectedIds: new Set(selected.map(item => item.id)),
3170
+ disabledIds: new Set(files.filter(item => !eligibleIds.has(item.id)).map(item => item.id)),
3171
+ state: !selected.length ? 'none' : selected.length === eligible.length ? 'all' : 'some',
3172
+ eligibleCount: eligible.length,
3173
+ allLabel: this.#i18n.t('core.component.file-explorer.selection.select-all', { count: eligible.length }),
3174
+ autoId: autoId ? `${autoId}-select-all` : undefined,
3175
+ };
3176
+ }, ...(ngDevMode ? [{ debugName: "selectionView" }] : /* istanbul ignore next */ []));
3177
+ /**
3178
+ * Status sentence of the band, split around the number so the template can set it in semibold: "2 tệp đã chọn",
3179
+ * "已选择 2 个文件". Nothing selected: `count` is 0 and `before` holds the whole sentence.
3180
+ */
3181
+ selectionSummary = computed(() => {
3182
+ const count = this.selectedItems().length;
3183
+ if (!count)
3184
+ return { count, before: this.#i18n.t('core.component.file-explorer.selection.none'), after: '' };
3185
+ // why: không truyền params thì I18nService giữ nguyên `{count}` — tách câu đã dịch tại đó, đúng vị trí của từng ngôn ngữ.
3186
+ const message = this.#i18n.t(`core.component.file-explorer.selection.${count === 1 ? 'selected-one' : 'selected'}`);
3187
+ const placeholder = '{count}';
3188
+ const at = message.indexOf(placeholder);
3189
+ if (at < 0)
3190
+ return { count, before: '', after: ` ${message}` };
3191
+ return { count, before: message.slice(0, at), after: message.slice(at + placeholder.length) };
3192
+ }, ...(ngDevMode ? [{ debugName: "selectionSummary" }] : /* istanbul ignore next */ []));
3193
+ // ---- Compact command drawer ----
3194
+ // why: mỗi lối tắt là một computed riêng — định nghĩa giữ nguyên object khi chỉ lối tắt kia đổi, nên lần kiểm tra ngay
3195
+ // trước khi chạy lệnh (definition còn được khai không) không hủy nhầm "Chia sẻ" chỉ vì `download` vừa đổi.
3196
+ #shareShortcut = computed(() => this.canShare()
3197
+ ? {
3198
+ title: this.#i18n.t('core.component.file-explorer.share'),
3199
+ prefixIcon: 'share',
3200
+ disabled: item => this.movePending() || !sdFileExplorerEligible(this.#config().shareable, item),
3201
+ click: item => this.openShare(item),
3202
+ }
3203
+ : null, ...(ngDevMode ? [{ debugName: "#shareShortcut" }] : /* istanbul ignore next */ []));
3204
+ #downloadShortcut = computed(() => this.canDownload()
3205
+ ? {
3206
+ title: this.#i18n.t('core.component.file-explorer.download'),
3207
+ prefixIcon: 'file_download',
3208
+ disabled: item => this.movePending() || !sdFileExplorerEligible(this.#config().downloadable, item),
3209
+ click: item => this.downloadItem(item),
3210
+ }
3211
+ : null, ...(ngDevMode ? [{ debugName: "#downloadShortcut" }] : /* istanbul ignore next */ []));
3212
+ /** Row shortcuts as commands, for the drawer while `fileCommands` is undeclared: share, then download, as on the row. */
3213
+ #shortcuts = computed(() => {
3214
+ const commands = [];
3215
+ const keys = [];
3216
+ const share = this.#shareShortcut();
3217
+ const download = this.#downloadShortcut();
3218
+ if (share) {
3219
+ commands.push(share);
3220
+ keys.push('share');
3221
+ }
3222
+ if (download) {
3223
+ commands.push(download);
3224
+ keys.push('download');
3225
+ }
3226
+ return { commands, keys };
3227
+ }, ...(ngDevMode ? [{ debugName: "#shortcuts" }] : /* istanbul ignore next */ []));
3228
+ /** Current version of the drawer's item — looked up by id in the list it was opened from; `null` once it is gone. */
3229
+ #commandItem = computed(() => {
3230
+ const target = this.#commandTarget();
3231
+ return target ? this.#findCommandItem(target.id, target.origin) : null;
3232
+ }, ...(ngDevMode ? [{ debugName: "#commandItem" }] : /* istanbul ignore next */ []));
3233
+ /** Content of the drawer: the item's commands resolved for it now; `null` when nothing is left to show. */
3234
+ // why: kiểu tường minh như contentState — d.ts ổn định giữa các máy build.
3235
+ commandSheet = computed(() => {
3236
+ const target = this.#commandTarget();
3237
+ const item = this.#commandItem();
3238
+ if (!target || !item)
3239
+ return null;
3240
+ const definitions = this.#commandDefinitions(item, target.origin);
3241
+ const source = item.kind === 'folder' ? 'folderCommands' : 'fileCommands';
3242
+ const resolved = sdFileExplorerResolveActions(definitions, item, SD_FILE_EXPLORER_COMMAND_DEFAULTS, source);
3243
+ if (!resolved.length)
3244
+ return null;
3245
+ const shortcuts = this.#shortcuts();
3246
+ const view = this.#itemFormatter()(item);
3247
+ return {
3248
+ title: item.name,
3249
+ context: [view.typeLabel, view.sizeLabel].filter(Boolean).join(' · '),
3250
+ icon: view.icon,
3251
+ entries: sdFileExplorerSheetEntries(resolved, definitions === shortcuts.commands ? shortcuts.keys : undefined),
3252
+ };
3253
+ }, ...(ngDevMode ? [{ debugName: "commandSheet" }] : /* istanbul ignore next */ []));
3254
+ itemsMenuOpenId = computed(() => {
3255
+ const target = this.#commandTarget();
3256
+ return target && target.origin !== 'tree' ? target.id : null;
3257
+ }, ...(ngDevMode ? [{ debugName: "itemsMenuOpenId" }] : /* istanbul ignore next */ []));
3258
+ treeMenuOpenId = computed(() => {
3259
+ const target = this.#commandTarget();
3260
+ return target?.origin === 'tree' ? target.id : null;
3261
+ }, ...(ngDevMode ? [{ debugName: "treeMenuOpenId" }] : /* istanbul ignore next */ []));
1658
3262
  // why: như shareFeedback — kiểu tường minh để d.ts ổn định giữa các máy build.
1659
3263
  contentState = computed(() => {
1660
3264
  const keyword = this.#trimmedKeyword();
@@ -1861,34 +3465,99 @@ class SdFileExplorer {
1861
3465
  const type = sdFileExplorerFileType(item);
1862
3466
  return {
1863
3467
  item,
3468
+ downloadDisabled: this.movePending() || !sdFileExplorerEligible(this.#config().downloadable, item),
3469
+ shareDisabled: this.movePending() || !sdFileExplorerEligible(this.#config().shareable, item),
3470
+ unavailableReason: t('action-unavailable'),
1864
3471
  type,
1865
3472
  icon: sdFileExplorerIconName(item),
1866
3473
  typeLabel: t(`type.${type}`),
1867
3474
  sizeLabel: item.kind === 'file' ? sdFileExplorerFormatSize(item.size, locale) : '',
1868
- modifiedLabel: sdFileExplorerFormatDate(item.modifiedAt, now, locale, labels),
1869
- modifiedTitle: sdFileExplorerFormatDateTime(item.modifiedAt, locale),
3475
+ modifiedLabel: sdFileExplorerFormatDate(item.modifiedAt, now, locale, labels, this.#dateTime),
3476
+ modifiedTitle: sdFileExplorerFormatDateTime(item.modifiedAt, locale, this.#dateTime),
1870
3477
  downloadLabel: t('download-item', { name: item.name }),
1871
3478
  shareLabel: t('share-item', { name: item.name }),
3479
+ selectLabel: t('selection.select-item', { name: item.name }),
3480
+ actionsLabel: t('item-actions', { name: item.name }),
1872
3481
  autoId: autoId ? `${autoId}-item-${sdFileExplorerSafeId(item.id)}` : undefined,
1873
3482
  };
1874
3483
  };
1875
3484
  }, ...(ngDevMode ? [{ debugName: "#itemFormatter" }] : /* istanbul ignore next */ []));
1876
3485
  constructor() {
3486
+ const destroyRef = inject(DestroyRef);
3487
+ let previewProvider;
3488
+ let shareProvider;
3489
+ let moveProvider;
3490
+ let searchProvider;
3491
+ effect(() => {
3492
+ const config = this.#config();
3493
+ const previewChanged = previewProvider !== config.preview;
3494
+ const shareChanged = shareProvider !== config.share;
3495
+ const moveChanged = moveProvider?.onMove !== config.move?.onMove;
3496
+ const searchChanged = searchProvider !== config.search;
3497
+ previewProvider = config.preview;
3498
+ shareProvider = config.share;
3499
+ moveProvider = config.move;
3500
+ searchProvider = config.search;
3501
+ untracked(() => {
3502
+ const item = this.#previewItem();
3503
+ if (previewChanged && item)
3504
+ void this.#loadPreview(item);
3505
+ const shareItem = this.shareItem();
3506
+ if (shareChanged && shareItem) {
3507
+ this.#shareController?.abort();
3508
+ if (config.share && sdFileExplorerEligible(config.shareable, shareItem))
3509
+ void this.#loadShareLink(shareItem);
3510
+ else
3511
+ this.closeShare();
3512
+ }
3513
+ if (moveChanged && this.#moveController)
3514
+ this.cancelMove();
3515
+ if (searchChanged && this.#listFn === config.list)
3516
+ this.#scheduleSearch(true);
3517
+ });
3518
+ });
3519
+ // why: trên màn hình cảm ứng không có hover — lệnh của hàng/thẻ/cây luôn hiện và dùng vùng chạm 48px.
3520
+ // Đọc ngay trong constructor (không đợi render) để lần vẽ đầu đã đúng cỡ, rồi theo dõi khi thiết bị đổi con trỏ.
3521
+ const touchQuery = this.#document.defaultView?.matchMedia?.(TOUCH_QUERY);
3522
+ if (touchQuery) {
3523
+ this.#touch.set(touchQuery.matches);
3524
+ const onTouchChange = (event) => this.#touch.set(event.matches);
3525
+ touchQuery.addEventListener?.('change', onTouchChange);
3526
+ destroyRef.onDestroy(() => touchQuery.removeEventListener?.('change', onTouchChange));
3527
+ }
1877
3528
  // why: chỉ reset khi hàm `list` đổi (đổi nguồn lưu trữ). Consumer tạo lại object option với cùng callback
1878
3529
  // (ví dụ đổi title) không được xoá cache/điều hướng của người dùng.
1879
3530
  effect(() => {
1880
- const option = this.option();
3531
+ const option = this.#config();
3532
+ const selecting = !!this.#selector();
1881
3533
  untracked(() => {
3534
+ if (!selecting)
3535
+ this.#clearSelection();
1882
3536
  if (this.#listFn === option.list)
1883
3537
  return;
1884
3538
  const firstRun = this.#listFn === null;
1885
3539
  this.#listFn = option.list;
3540
+ if (this.#moveController)
3541
+ this.cancelMove();
3542
+ this.moveRefreshError.set(false);
3543
+ this.#moveRefreshFolders = [];
3544
+ this.#moveDrag.clear();
1886
3545
  if (firstRun)
1887
3546
  this.view.set(option.defaultView ?? 'list');
1888
3547
  this.#resetNavigation();
1889
3548
  this.#ensureLoaded(null);
1890
3549
  });
1891
3550
  });
3551
+ // why: tệp bị lần tải lại bỏ khỏi danh sách hoặc bị consumer khóa (selector.disabled) rời lựa chọn hẳn — không
3552
+ // được tự chọn lại khi xuất hiện/mở khóa lần sau. Chỉ dọn khi nội dung đã ổn định (không dọn lúc đang tải) và không
3553
+ // gọi callback: đây không phải thao tác của người dùng hay một lần đổi phạm vi. Tạo SAU effect option để khi
3554
+ // selector bị ẩn, #clearSelection (có onClear) chạy trước lần dọn im lặng này.
3555
+ effect(() => {
3556
+ const eligible = this.#eligibleFiles();
3557
+ if (this.contentState() === 'loading')
3558
+ return;
3559
+ untracked(() => this.#keepEligibleSelection(eligible));
3560
+ });
1892
3561
  afterNextRender(() => {
1893
3562
  const host = this.#host.nativeElement;
1894
3563
  this.#width.set(host.getBoundingClientRect().width);
@@ -1901,19 +3570,213 @@ class SdFileExplorer {
1901
3570
  });
1902
3571
  this.#resizeObserver.observe(host);
1903
3572
  });
1904
- // why: rời khỏi layout compact thì drawer không còn ý nghĩa — đóng để lần thu nhỏ sau không bật lại scrim.
3573
+ // why: rời khỏi layout compact thì drawer không còn ý nghĩa — đóng để lần thu nhỏ sau không bật lại scrim. Drawer
3574
+ // lệnh cũng đóng: hàng/thẻ/cây lại hiện lệnh của chúng (xoay ngang máy, kéo rộng cửa sổ).
3575
+ effect(() => {
3576
+ if (this.compact())
3577
+ return;
3578
+ untracked(() => {
3579
+ this.sidebarOpen.set(false);
3580
+ this.#closeCommands();
3581
+ });
3582
+ });
3583
+ // why: mục của drawer lệnh rời danh sách (lần tải lại bỏ nó, kết quả tìm kiếm đổi) hoặc không còn lệnh nào hiện —
3584
+ // đóng drawer thay vì giữ một ảnh chụp cũ có thể chạy lệnh trên mục đã mất.
1905
3585
  effect(() => {
1906
- if (!this.compact())
1907
- untracked(() => this.sidebarOpen.set(false));
3586
+ if (this.#commandTarget() && !this.commandSheet())
3587
+ untracked(() => this.#closeCommands());
1908
3588
  });
1909
- inject(DestroyRef).onDestroy(() => this.#teardown());
3589
+ // why: nút Back của trình duyệt / Android khi drawer lệnh đang mở — đóng drawer theo điều hướng của trang. Drawer không
3590
+ // giữ mục lịch sử nào (không pushState, không history.back): Back vẫn điều hướng như bình thường.
3591
+ const view = this.#document.defaultView;
3592
+ if (view) {
3593
+ const onPopState = () => this.#closeCommands();
3594
+ view.addEventListener('popstate', onPopState);
3595
+ destroyRef.onDestroy(() => view.removeEventListener('popstate', onPopState));
3596
+ }
3597
+ destroyRef.onDestroy(() => this.#teardown());
1910
3598
  }
1911
3599
  // ---- Public API ----
3600
+ /** Moves visible files through the caller's storage callback. False includes cancellation, rejection or refresh failure. */
3601
+ async moveFiles(items, targetFolder, source = 'api') {
3602
+ return this.#performMove(items, targetFolder, source, false);
3603
+ }
3604
+ async #performMove(items, targetFolder, source, selectionRequired) {
3605
+ const move = this.#config().move;
3606
+ if (!move ||
3607
+ this.movePending() ||
3608
+ this.moveRefreshError() ||
3609
+ this.folderSubmitting() ||
3610
+ this.#transfers().some(transfer => transfer.direction === 'upload' && ACTIVE_STATUSES.has(transfer.status)) ||
3611
+ this.#destroyed)
3612
+ return false;
3613
+ const controller = new AbortController();
3614
+ if (!this.#moveAllowed(items, targetFolder, source, controller.signal, selectionRequired))
3615
+ return false;
3616
+ const request = Object.freeze({
3617
+ items: Object.freeze([...items]),
3618
+ targetFolder,
3619
+ source,
3620
+ signal: controller.signal,
3621
+ });
3622
+ const sourceParents = items.map(item => item.parentId);
3623
+ const movedIds = new Set(items.map(item => item.id));
3624
+ const cachedSources = [...this.#folders()].filter(([, folder]) => folder.items.some(item => movedIds.has(item.id))).map(([id]) => id);
3625
+ this.#moveController = controller;
3626
+ this.movePending.set(true);
3627
+ this.moveStatus.set(this.#i18n.t('core.component.file-explorer.move.pending'));
3628
+ try {
3629
+ const accepted = await move.onMove(request);
3630
+ if (controller.signal.aborted || this.#destroyed || this.#config().move?.onMove !== move.onMove)
3631
+ return false;
3632
+ if (accepted === false) {
3633
+ this.moveStatus.set(this.#i18n.t('core.component.file-explorer.move.cancelled'));
3634
+ return false;
3635
+ }
3636
+ this.#moveRefreshFolders = [...new Set([...sourceParents, ...cachedSources, targetFolder?.id ?? null])].filter(id => this.#folders().has(id));
3637
+ this.#clearSelection();
3638
+ return await this.#refreshMove(controller);
3639
+ }
3640
+ catch (error) {
3641
+ if (!controller.signal.aborted && !this.#destroyed)
3642
+ this.moveStatus.set(sdFileExplorerErrorMessage(error) || this.#i18n.t('core.component.file-explorer.move.error'));
3643
+ return false;
3644
+ }
3645
+ finally {
3646
+ if (this.#moveController === controller) {
3647
+ this.#moveController = null;
3648
+ this.movePending.set(false);
3649
+ }
3650
+ }
3651
+ }
3652
+ /** Cooperatively aborts the current mutation. A consumer may already have committed its storage change. */
3653
+ cancelMove() {
3654
+ this.#moveController?.abort();
3655
+ this.#moveController = null;
3656
+ this.movePending.set(false);
3657
+ this.moveStatus.set(this.#i18n.t('core.component.file-explorer.move.cancelled'));
3658
+ this.#moveDrag.clear();
3659
+ }
3660
+ /** Repeats failed listing only; never calls onMove again. */
3661
+ async retryMoveRefresh() {
3662
+ if (!this.moveRefreshError() || this.movePending() || this.#destroyed)
3663
+ return false;
3664
+ const controller = new AbortController();
3665
+ this.#moveController = controller;
3666
+ this.movePending.set(true);
3667
+ try {
3668
+ return await this.#refreshMove(controller);
3669
+ }
3670
+ finally {
3671
+ if (this.#moveController === controller) {
3672
+ this.#moveController = null;
3673
+ this.movePending.set(false);
3674
+ }
3675
+ }
3676
+ }
3677
+ async #refreshMove(controller) {
3678
+ await Promise.all(this.#moveRefreshFolders.map(id => this.#load(id)));
3679
+ if (controller.signal.aborted || this.#destroyed)
3680
+ return false;
3681
+ const failed = this.#moveRefreshFolders.some(id => this.#folders().get(id)?.status !== 'loaded');
3682
+ this.moveRefreshError.set(failed);
3683
+ this.moveStatus.set(this.#i18n.t(failed ? 'core.component.file-explorer.move.refresh-error' : 'core.component.file-explorer.move.done'));
3684
+ if (!failed) {
3685
+ this.#moveRefreshFolders = [];
3686
+ if (this.searching())
3687
+ this.#scheduleSearch(true);
3688
+ }
3689
+ return !failed;
3690
+ }
3691
+ #moveAllowed(items, target, source, signal, selectionRequired = false) {
3692
+ const move = this.#config().move;
3693
+ const visible = this.#visibleItems();
3694
+ const known = [...this.#folders().values()].flatMap(folder => folder.items.filter(item => item.kind === 'folder'));
3695
+ if (!move || !sdFileExplorerValidateMove(items, target, known, visible))
3696
+ return false;
3697
+ if (selectionRequired && items.some(item => !this.#eligibleFiles().includes(item)))
3698
+ return false;
3699
+ return sdFileExplorerEligible(move.movable, { items: Object.freeze([...items]), targetFolder: target, source, signal });
3700
+ }
3701
+ openMovePicker(items, event) {
3702
+ if (!this.canMove() || this.movePending() || !items.length)
3703
+ return;
3704
+ const active = this.#document.activeElement;
3705
+ this.#moveReturnFocus = active instanceof HTMLElement ? active : null;
3706
+ const selected = this.selectedItems();
3707
+ this.#movePickerSelectionRequired = items.every(item => selected.includes(item));
3708
+ this.moveTarget.set(null);
3709
+ this.movePickerItems.set(Object.freeze([...items]));
3710
+ event?.stopPropagation();
3711
+ }
3712
+ closeMovePicker() {
3713
+ if (this.movePending())
3714
+ this.cancelMove();
3715
+ this.movePickerItems.set(null);
3716
+ this.#movePickerSelectionRequired = false;
3717
+ const focus = this.#moveReturnFocus;
3718
+ this.#moveReturnFocus = null;
3719
+ if (focus?.isConnected)
3720
+ afterNextRender(() => focus.focus({ preventScroll: true }), { injector: this.#injector });
3721
+ }
3722
+ submitMoveFromEvent(event) {
3723
+ void this.submitMove(event instanceof MouseEvent && event.detail === 0 ? 'keyboard' : 'menu');
3724
+ }
3725
+ async submitMove(source = 'menu') {
3726
+ const items = this.movePickerItems();
3727
+ if (!items)
3728
+ return;
3729
+ if (await this.#performMove(items, this.moveTarget(), source, this.#movePickerSelectionRequired))
3730
+ this.closeMovePicker();
3731
+ }
3732
+ onMoveDragStart(event) {
3733
+ const element = event.target instanceof Element ? event.target : null;
3734
+ if (!element?.closest('.name, .card-name') ||
3735
+ element.closest('button,input,a,.commands,.card-top,.cell--select') ||
3736
+ !event.dataTransfer ||
3737
+ !this.canMove() ||
3738
+ this.movePending()) {
3739
+ event.preventDefault();
3740
+ return;
3741
+ }
3742
+ const id = element.closest('[data-item-id]')?.dataset['itemId'];
3743
+ const file = this.#visibleItems().find(item => item.id === id && item.kind === 'file');
3744
+ if (!file) {
3745
+ event.preventDefault();
3746
+ return;
3747
+ }
3748
+ const selected = this.selectedItems();
3749
+ this.#moveDragSelectionRequired = selected.includes(file);
3750
+ const items = selected.includes(file) ? selected : [file];
3751
+ event.dataTransfer.setData(SD_FILE_EXPLORER_MOVE_MIME, this.#moveDrag.start(items));
3752
+ event.dataTransfer.effectAllowed = 'move';
3753
+ }
3754
+ onMoveDragEnd() {
3755
+ this.#moveDrag.clear();
3756
+ this.#moveDragSelectionRequired = false;
3757
+ this.moveDropTarget.set(undefined);
3758
+ }
3759
+ #internalDropTarget(event) {
3760
+ const element = event.target instanceof Element ? event.target : null;
3761
+ if (element?.closest('sd-file-explorer') !== this.#host.nativeElement)
3762
+ return null;
3763
+ const node = element.closest('[data-move-target]');
3764
+ if (!node)
3765
+ return null;
3766
+ const id = node.dataset['moveTarget'];
3767
+ if (id === '')
3768
+ return { folder: null };
3769
+ const folder = [...this.#itemById().values()].find(item => item.id === id && item.kind === 'folder');
3770
+ return folder ? { folder } : null;
3771
+ }
1912
3772
  /**
1913
3773
  * Lists the current folder again and drops the cached children of folders that are neither open in the
1914
- * tree nor on the current path. Re-runs the active search, if any.
3774
+ * tree nor on the current path. Re-runs the active search, if any. Clears the file selection and closes the command
3775
+ * drawer of the compact layout.
1915
3776
  */
1916
3777
  reload() {
3778
+ this.#clearSelection();
3779
+ this.#closeCommands();
1917
3780
  const keep = new Set([null, this.#currentId(), ...this.#expanded(), ...this.#path().map(folder => folder.id)]);
1918
3781
  const folders = new Map(this.#folders());
1919
3782
  for (const key of [...folders.keys()]) {
@@ -1933,6 +3796,9 @@ class SdFileExplorer {
1933
3796
  // ---- Navigation ----
1934
3797
  navigate(folder) {
1935
3798
  const id = folder?.id ?? null;
3799
+ if (id !== this.#currentId())
3800
+ this.#clearSelection();
3801
+ this.#closeCommands();
1936
3802
  const path = folder ? this.#buildPath(folder) : [];
1937
3803
  this.#currentId.set(id);
1938
3804
  this.#path.set(path);
@@ -2028,10 +3894,14 @@ class SdFileExplorer {
2028
3894
  this.previewState.set({ status: 'error', message: '' });
2029
3895
  }
2030
3896
  downloadItem(item) {
2031
- const download = this.option().download;
2032
- if (!download)
3897
+ const download = this.#config().download;
3898
+ if (!download || !sdFileExplorerEligible(this.#config().downloadable, item))
2033
3899
  return;
2034
- this.#enqueue('download', item.name, item.parentId, args => download({ item, ...args }));
3900
+ this.#enqueue('download', item.name, item.parentId, args => {
3901
+ if (!sdFileExplorerEligible(this.#config().downloadable, item))
3902
+ throw new Error(this.#i18n.t('core.component.file-explorer.action-unavailable'));
3903
+ return download({ item, ...args });
3904
+ });
2035
3905
  this.transfersCollapsed.set(false);
2036
3906
  }
2037
3907
  downloadPreview() {
@@ -2044,9 +3914,176 @@ class SdFileExplorer {
2044
3914
  if (item)
2045
3915
  this.openShare(item);
2046
3916
  }
3917
+ // ---- Selection ----
3918
+ toggleSelection(item) {
3919
+ const selector = this.#selector();
3920
+ if (!selector || !this.#eligibleFiles().some(file => file.id === item.id))
3921
+ return;
3922
+ // why: dựng lại từ selectedItems (không từ #selectedIds) để bỏ luôn id của tệp đã rời khỏi danh sách.
3923
+ const next = new Set(this.selectedItems().map(file => file.id));
3924
+ if (next.has(item.id))
3925
+ next.delete(item.id);
3926
+ else
3927
+ next.add(item.id);
3928
+ this.#selectedIds.set(next);
3929
+ selector.onSelect?.(item, this.selectedItems());
3930
+ }
3931
+ toggleSelectAll() {
3932
+ const selector = this.#selector();
3933
+ const eligible = this.#eligibleFiles();
3934
+ if (!selector || !eligible.length)
3935
+ return;
3936
+ const all = this.selectedItems().length === eligible.length;
3937
+ this.#selectedIds.set(new Set(all ? [] : eligible.map(item => item.id)));
3938
+ selector.onSelectAll?.(this.selectedItems());
3939
+ }
3940
+ clearSelection() {
3941
+ const active = this.#document.activeElement;
3942
+ if (active instanceof HTMLElement && active.classList.contains('selection-clear') && this.#host.nativeElement.contains(active)) {
3943
+ // Move owned focus before removing the toolbar. A consumer's onClear callback
3944
+ // remains free to move focus elsewhere after the selection is cleared.
3945
+ this.#host.nativeElement.querySelector('.select-all input')?.focus({ preventScroll: true });
3946
+ }
3947
+ this.#clearSelection();
3948
+ }
3949
+ /** Empties the selection, calling `onClear` once when something was selected. */
3950
+ #clearSelection() {
3951
+ if (!this.#selectedIds().size)
3952
+ return;
3953
+ this.#selectedIds.set(new Set());
3954
+ this.#config().selector?.onClear?.();
3955
+ }
3956
+ /** Forgets selected ids that are no longer visible and eligible. Silent: no callback. */
3957
+ #keepEligibleSelection(eligible) {
3958
+ const ids = this.#selectedIds();
3959
+ if (!ids.size)
3960
+ return;
3961
+ const kept = new Set(eligible.filter(item => ids.has(item.id)).map(item => item.id));
3962
+ if (kept.size !== ids.size)
3963
+ this.#selectedIds.set(kept);
3964
+ }
3965
+ // ---- Compact command drawer ----
3966
+ openCommands(item, origin, trigger) {
3967
+ this.#pendingCommand = null;
3968
+ // why: bẫy focus của sd-side-drawer trả focus về phần tử đang giữ focus lúc nó mở. Chạm vào nút trên iOS không
3969
+ // focus nút, nên focus nút trước khi mở để đóng drawer xong focus về đúng hàng / thẻ / nút cây.
3970
+ trigger.focus({ preventScroll: true });
3971
+ this.#commandTarget.set({ id: item.id, origin, trigger });
3972
+ this.commandDrawer()?.show();
3973
+ }
3974
+ /** The user closed the drawer (close button, `Escape`, backdrop). */
3975
+ onCommandsClosed() {
3976
+ const target = this.#commandTarget();
3977
+ if (!target)
3978
+ return;
3979
+ this.#commandTarget.set(null);
3980
+ afterNextRender(() => this.#restoreCommandFocus(target), { injector: this.#injector });
3981
+ }
3982
+ /**
3983
+ * Runs a command pressed in the drawer. The press is checked against the current item, definitions and states: a
3984
+ * stale entry, a state the consumer changed since the last render or a second press runs nothing.
3985
+ *
3986
+ * The drawer closes first, at once. The command runs after the next render: by then the drawer's focus trap is gone
3987
+ * and has handed focus back, so it cannot pull focus away from a dialog or a preview the command opens. Right before
3988
+ * it runs, the same check is made again, and `click` receives the item as listed at that moment.
3989
+ */
3990
+ runCommand({ command, group }) {
3991
+ const target = this.#commandTarget();
3992
+ if (this.#pendingCommand || !target)
3993
+ return;
3994
+ const pending = { id: target.id, origin: target.origin, leaf: command.definition, group: group?.definition ?? null };
3995
+ if (!this.#runnableItem(pending)) {
3996
+ // why: trạng thái do consumer giữ ngoài signal đã đổi từ lần render trước — tính lại để drawer hiện đúng trạng thái.
3997
+ this.#commandTarget.set({ ...target });
3998
+ return;
3999
+ }
4000
+ this.#pendingCommand = pending;
4001
+ this.#commandTarget.set(null);
4002
+ this.commandDrawer()?.hide();
4003
+ afterNextRender(() => {
4004
+ if (this.#pendingCommand !== pending)
4005
+ return;
4006
+ this.#pendingCommand = null;
4007
+ this.#restoreCommandFocus(target);
4008
+ // why: giữa lúc bấm và lần render này consumer vẫn có thể đổi trạng thái, rút định nghĩa hay làm mới danh sách
4009
+ // (drawer đã đóng nên effect "mục biến mất" không còn canh) — kiểm lại ngay trước khi chạy, với bản hiện tại của mục.
4010
+ const item = this.#runnableItem(pending);
4011
+ if (item)
4012
+ (pending.leaf.onClick ?? pending.leaf.click)?.(item);
4013
+ }, { injector: this.#injector });
4014
+ }
4015
+ /** Current version of an item, by id, in the list a drawer was opened from (list / grid items or tree folders). */
4016
+ #findCommandItem(id, origin) {
4017
+ if (origin === 'tree')
4018
+ return this.treeNodes().find(node => node.id === id)?.item ?? null;
4019
+ return this.#visibleItems().find(item => item.id === id) ?? null;
4020
+ }
4021
+ /**
4022
+ * The current item when `command` may run now — the item is still listed where the drawer was opened, the pressed
4023
+ * definition and its group are still declared for it, and neither is hidden, disabled or loading — else `null`.
4024
+ */
4025
+ #runnableItem(command) {
4026
+ const item = this.#findCommandItem(command.id, command.origin);
4027
+ if (!item)
4028
+ return null;
4029
+ const { leaf, group } = command;
4030
+ const definitions = this.#commandDefinitions(item, command.origin);
4031
+ const declared = group ? definitions.includes(group) && group.children.includes(leaf) : definitions.includes(leaf);
4032
+ const blocked = (group !== null && sdFileExplorerActionBlocked(group, item)) || sdFileExplorerActionBlocked(leaf, item);
4033
+ return declared && !blocked ? item : null;
4034
+ }
4035
+ /** Commands of one item in the drawer: the declared ones, or the row shortcuts while `fileCommands` is undeclared. */
4036
+ #commandDefinitions(item, origin) {
4037
+ const option = this.#config();
4038
+ if (item.kind === 'folder')
4039
+ return option.folderCommands ?? [];
4040
+ if (option.fileCommands != null)
4041
+ return option.fileCommands;
4042
+ // why: lối tắt tải xuống / chia sẻ chỉ có trên hàng danh sách — thẻ lưới chưa từng có — nên chỉ hàng mang chúng vào drawer.
4043
+ return origin === 'list' ? this.#shortcuts().commands : [];
4044
+ }
4045
+ /** Closes the drawer without running anything and drops a pressed command that has not run yet. */
4046
+ #closeCommands() {
4047
+ this.#pendingCommand = null;
4048
+ const target = this.#commandTarget();
4049
+ if (!target)
4050
+ return;
4051
+ this.#commandTarget.set(null);
4052
+ this.commandDrawer()?.hide();
4053
+ afterNextRender(() => this.#restoreCommandFocus(target), { injector: this.#injector });
4054
+ }
4055
+ /**
4056
+ * After the drawer closed: when its focus trap could not give focus back — the trigger left the page with its row,
4057
+ * or the layout changed — focus the item's row, card or tree tab stop, the first item, or the search box.
4058
+ */
4059
+ #restoreCommandFocus(target) {
4060
+ const active = this.#document.activeElement;
4061
+ if (this.#destroyed || (active && active !== this.#document.body))
4062
+ return;
4063
+ const host = this.#host.nativeElement;
4064
+ const items = Array.from(host.querySelectorAll('[data-item-id]'));
4065
+ const candidates = [
4066
+ target.trigger.isConnected ? target.trigger : null,
4067
+ target.origin === 'tree'
4068
+ ? host.querySelector('[role="treeitem"][tabindex="0"]')
4069
+ : (items.find(element => element.dataset['itemId'] === target.id) ?? null),
4070
+ items[0] ?? null,
4071
+ this.searchInput()?.nativeElement ?? null,
4072
+ ];
4073
+ for (const candidate of candidates) {
4074
+ candidate?.focus({ preventScroll: true });
4075
+ if (candidate && this.#document.activeElement === candidate)
4076
+ return;
4077
+ }
4078
+ }
2047
4079
  // ---- Search ----
2048
4080
  onKeywordInput(value) {
4081
+ const before = this.#trimmedKeyword();
2049
4082
  this.keyword.set(value);
4083
+ if (this.#trimmedKeyword() !== before) {
4084
+ this.#clearSelection();
4085
+ this.#closeCommands();
4086
+ }
2050
4087
  this.#scheduleSearch(false);
2051
4088
  }
2052
4089
  clearSearch() {
@@ -2061,16 +4098,26 @@ class SdFileExplorer {
2061
4098
  this.uploadFiles(files);
2062
4099
  }
2063
4100
  uploadFiles(files) {
2064
- const upload = this.option().upload;
2065
- if (!upload || files.length === 0)
4101
+ if (this.movePending())
4102
+ return;
4103
+ const upload = this.#config().upload;
4104
+ if (!upload || files.length === 0 || !sdFileExplorerEligible(this.#config().uploadable, { parentId: this.#currentId() }))
2066
4105
  return;
2067
4106
  const parentId = this.#currentId();
2068
4107
  for (const file of files) {
2069
- this.#enqueue('upload', file.name, parentId, args => upload({ file, parentId, ...args }));
4108
+ this.#enqueue('upload', file.name, parentId, args => {
4109
+ if (!sdFileExplorerEligible(this.#config().uploadable, { parentId }))
4110
+ throw new Error(this.#i18n.t('core.component.file-explorer.action-unavailable'));
4111
+ return upload({ file, parentId, ...args });
4112
+ });
2070
4113
  }
2071
4114
  this.transfersCollapsed.set(false);
2072
4115
  }
2073
4116
  onDragEnter(event) {
4117
+ if (event.dataTransfer?.types.includes(SD_FILE_EXPLORER_MOVE_MIME)) {
4118
+ this.onDragOver(event);
4119
+ return;
4120
+ }
2074
4121
  if (!this.#acceptsDrag(event))
2075
4122
  return;
2076
4123
  event.preventDefault();
@@ -2078,6 +4125,20 @@ class SdFileExplorer {
2078
4125
  this.dragActive.set(true);
2079
4126
  }
2080
4127
  onDragOver(event) {
4128
+ if (event.dataTransfer?.types.includes(SD_FILE_EXPLORER_MOVE_MIME)) {
4129
+ const target = this.#internalDropTarget(event);
4130
+ const items = this.#moveDrag.activeItems;
4131
+ const allowed = !event.dataTransfer.types.includes('Files') &&
4132
+ !!items &&
4133
+ !!target &&
4134
+ !this.movePending() &&
4135
+ this.#moveAllowed(items, target.folder, 'drag', new AbortController().signal, this.#moveDragSelectionRequired);
4136
+ if (target && items && allowed)
4137
+ event.preventDefault();
4138
+ event.dataTransfer.dropEffect = allowed ? 'move' : 'none';
4139
+ this.moveDropTarget.set(allowed ? (target.folder?.id ?? null) : undefined);
4140
+ return;
4141
+ }
2081
4142
  if (!this.#acceptsDrag(event))
2082
4143
  return;
2083
4144
  event.preventDefault();
@@ -2093,6 +4154,17 @@ class SdFileExplorer {
2093
4154
  this.dragActive.set(false);
2094
4155
  }
2095
4156
  onDrop(event) {
4157
+ if (event.dataTransfer?.types.includes(SD_FILE_EXPLORER_MOVE_MIME)) {
4158
+ event.preventDefault();
4159
+ const target = this.#internalDropTarget(event);
4160
+ const items = this.#moveDrag.resolve(event.dataTransfer.getData(SD_FILE_EXPLORER_MOVE_MIME));
4161
+ const mixed = event.dataTransfer.types.includes('Files') || event.dataTransfer.files.length > 0;
4162
+ const selectionRequired = this.#moveDragSelectionRequired;
4163
+ this.onMoveDragEnd();
4164
+ if (items && target && !mixed)
4165
+ void this.#performMove(items, target.folder, 'drag', selectionRequired);
4166
+ return;
4167
+ }
2096
4168
  if (!this.#acceptsDrag(event))
2097
4169
  return;
2098
4170
  event.preventDefault();
@@ -2114,6 +4186,8 @@ class SdFileExplorer {
2114
4186
  }
2115
4187
  retryTransfer(id) {
2116
4188
  const job = this.#jobs.get(id);
4189
+ if (job?.direction === 'upload' && this.movePending())
4190
+ return;
2117
4191
  const status = this.#statusOf(id);
2118
4192
  if (!job || (status !== 'error' && status !== 'cancelled'))
2119
4193
  return;
@@ -2150,7 +4224,7 @@ class SdFileExplorer {
2150
4224
  }
2151
4225
  // ---- Share ----
2152
4226
  openShare(item) {
2153
- if (!this.option().share)
4227
+ if (!this.#config().share || !sdFileExplorerEligible(this.#config().shareable, item))
2154
4228
  return;
2155
4229
  const active = this.#document.activeElement;
2156
4230
  this.#shareReturnFocus = active instanceof HTMLElement && this.#host.nativeElement.contains(active) ? active : null;
@@ -2200,8 +4274,8 @@ class SdFileExplorer {
2200
4274
  }
2201
4275
  }
2202
4276
  async #loadShareLink(item) {
2203
- const share = this.option().share;
2204
- if (!share)
4277
+ const share = this.#config().share;
4278
+ if (!share || !sdFileExplorerEligible(this.#config().shareable, item))
2205
4279
  return;
2206
4280
  this.#shareController?.abort();
2207
4281
  const controller = new AbortController();
@@ -2240,9 +4314,11 @@ class SdFileExplorer {
2240
4314
  }
2241
4315
  async submitFolder(event) {
2242
4316
  event.preventDefault();
2243
- const create = this.option().createFolder;
4317
+ if (this.movePending())
4318
+ return;
4319
+ const create = this.#config().createFolder;
2244
4320
  const name = this.folderName().trim();
2245
- if (!create || !name || this.folderSubmitting())
4321
+ if (!create || !name || this.folderSubmitting() || !sdFileExplorerEligible(this.#config().creatable, { parentId: this.#currentId() }))
2246
4322
  return;
2247
4323
  const parentId = this.#currentId();
2248
4324
  this.folderSubmitting.set(true);
@@ -2269,7 +4345,11 @@ class SdFileExplorer {
2269
4345
  onEscape(event) {
2270
4346
  if (event.defaultPrevented)
2271
4347
  return;
2272
- if (this.folderDialogOpen())
4348
+ if (this.movePickerItems())
4349
+ this.closeMovePicker();
4350
+ else if (this.movePending())
4351
+ this.cancelMove();
4352
+ else if (this.folderDialogOpen())
2273
4353
  this.closeFolderDialog();
2274
4354
  else if (this.shareItem())
2275
4355
  this.closeShare();
@@ -2288,6 +4368,8 @@ class SdFileExplorer {
2288
4368
  }
2289
4369
  // ---- Internals: folders ----
2290
4370
  #resetNavigation() {
4371
+ this.#clearSelection();
4372
+ this.#closeCommands();
2291
4373
  for (const controller of this.#listControllers.values())
2292
4374
  controller.abort();
2293
4375
  this.#listControllers.clear();
@@ -2316,7 +4398,7 @@ class SdFileExplorer {
2316
4398
  const previous = this.#folders().get(parentId);
2317
4399
  this.#setFolder(parentId, { status: 'loading', items: previous?.loaded ? previous.items : [], loaded: !!previous?.loaded });
2318
4400
  try {
2319
- const items = await this.option().list({ parentId, signal: controller.signal });
4401
+ const items = await this.#config().list({ parentId, signal: controller.signal });
2320
4402
  if (controller.signal.aborted || this.#destroyed)
2321
4403
  return;
2322
4404
  this.#setFolder(parentId, { status: 'loaded', items: Array.isArray(items) ? items : [], loaded: true });
@@ -2361,7 +4443,7 @@ class SdFileExplorer {
2361
4443
  this.#searchController?.abort();
2362
4444
  this.#searchController = null;
2363
4445
  const keyword = this.#trimmedKeyword();
2364
- const search = this.option().search;
4446
+ const search = this.#config().search;
2365
4447
  if (!keyword || !search) {
2366
4448
  this.#search.set(null);
2367
4449
  return;
@@ -2375,19 +4457,19 @@ class SdFileExplorer {
2375
4457
  }
2376
4458
  async #runSearch(keyword, parentId) {
2377
4459
  this.#searchTimer = null;
2378
- const search = this.option().search;
4460
+ const search = this.#config().search;
2379
4461
  if (!search)
2380
4462
  return;
2381
4463
  const controller = new AbortController();
2382
4464
  this.#searchController = controller;
2383
4465
  try {
2384
4466
  const items = await search({ parentId, keyword, signal: controller.signal });
2385
- if (controller.signal.aborted || this.#destroyed)
4467
+ if (controller.signal.aborted || this.#destroyed || this.#config().search !== search)
2386
4468
  return;
2387
4469
  this.#search.set({ keyword, parentId, status: 'loaded', items: Array.isArray(items) ? items : [] });
2388
4470
  }
2389
4471
  catch (error) {
2390
- if (controller.signal.aborted || this.#destroyed)
4472
+ if (controller.signal.aborted || this.#destroyed || this.#config().search !== search)
2391
4473
  return;
2392
4474
  this.#search.set({ keyword, parentId, status: 'error', items: [], error });
2393
4475
  }
@@ -2397,6 +4479,10 @@ class SdFileExplorer {
2397
4479
  }
2398
4480
  }
2399
4481
  #clearSearch() {
4482
+ if (this.#trimmedKeyword()) {
4483
+ this.#clearSelection();
4484
+ this.#closeCommands();
4485
+ }
2400
4486
  this.keyword.set('');
2401
4487
  this.#scheduleSearch(false);
2402
4488
  }
@@ -2405,9 +4491,9 @@ class SdFileExplorer {
2405
4491
  this.#releasePreview();
2406
4492
  const kind = sdFileExplorerPreviewKind(sdFileExplorerFileType(item));
2407
4493
  const fallback = () => kind === 'image' && item.thumbnailUrl ? { status: 'image', url: item.thumbnailUrl } : { status: 'unavailable' };
2408
- const preview = this.option().preview;
4494
+ const preview = this.#config().preview;
2409
4495
  // why: định dạng không có renderer thì KHÔNG gọi callback — tránh tải cả file chỉ để hiện fallback.
2410
- if (kind === 'none' || !preview) {
4496
+ if (kind === 'none' || !preview || !sdFileExplorerEligible(this.#config().previewable, item)) {
2411
4497
  this.previewState.set(kind === 'none' ? { status: 'unavailable' } : fallback());
2412
4498
  return;
2413
4499
  }
@@ -2557,7 +4643,11 @@ class SdFileExplorer {
2557
4643
  // ---- Internals: DOM helpers ----
2558
4644
  #acceptsDrag(event) {
2559
4645
  const types = event.dataTransfer?.types;
2560
- return this.canUpload() && !!types && Array.from(types).includes('Files');
4646
+ return (this.canUpload() &&
4647
+ !this.uploadDisabled() &&
4648
+ !!types &&
4649
+ !Array.from(types).includes(SD_FILE_EXPLORER_MOVE_MIME) &&
4650
+ Array.from(types).includes('Files'));
2561
4651
  }
2562
4652
  #droppedFiles(transfer) {
2563
4653
  if (!transfer)
@@ -2584,6 +4674,10 @@ class SdFileExplorer {
2584
4674
  }
2585
4675
  #teardown() {
2586
4676
  this.#destroyed = true;
4677
+ this.#moveController?.abort();
4678
+ this.#moveDrag.clear();
4679
+ // A command pressed right before the explorer goes away never runs; sd-side-drawer releases its own scroll lock.
4680
+ this.#pendingCommand = null;
2587
4681
  this.#resizeObserver?.disconnect();
2588
4682
  for (const controller of this.#listControllers.values())
2589
4683
  controller.abort();
@@ -2602,16 +4696,22 @@ class SdFileExplorer {
2602
4696
  this.#shareController?.abort();
2603
4697
  }
2604
4698
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorer, deps: [], target: i0.ɵɵFactoryTarget.Component });
2605
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdFileExplorer, isStandalone: true, selector: "sd-file-explorer", inputs: { option: { classPropertyName: "option", publicName: "option", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "open" }, host: { listeners: { "dragenter": "onDragEnter($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave()", "drop": "onDrop($event)", "keydown.escape": "onEscape($event)" }, properties: { "class.sd-file-explorer--compact": "compact()", "class.sd-file-explorer--dragging": "dragActive()", "attr.data-autoid": "autoId()" }, classAttribute: "sd-file-explorer" }, viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "folderInput", first: true, predicate: ["folderInput"], descendants: true, isSignal: true }, { propertyName: "newFolderButton", first: true, predicate: ["newFolderButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "copyButton", first: true, predicate: ["copyButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "shareInput", first: true, predicate: ["shareInput"], descendants: true, isSignal: true }, { propertyName: "shareDialog", first: true, predicate: ["shareDialog"], descendants: true, isSignal: true }, { propertyName: "sidebar", first: true, predicate: ["sidebar"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _option = option();\n@let _compact = compact();\n@let _autoId = autoId();\n@let _canUpload = canUpload();\n@let _canDownload = canDownload();\n@let _view = view();\n@let _state = contentState();\n@let _keyword = keyword();\n@let _sidebarOpen = sidebarOpen();\n@let _preview = previewView();\n@let _transfers = transferViews();\n@let _heading = heading();\n@let _searching = searching();\n@let _collapsed = transfersCollapsed();\n@let _dialogOpen = folderDialogOpen();\n@let _shareItem = shareItem();\n@let _canShare = canShare();\n@let _modalOpen = _dialogOpen || !!_shareItem;\n\n<header class=\"header\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_option.title) {\n <div class=\"brand\">\n <span class=\"brand-icon\" aria-hidden=\"true\">\n <sd-icon name=\"folder\" size=\"20px\" />\n </span>\n <div class=\"brand-text\">\n <h2 class=\"brand-title\" [title]=\"_option.title\">{{ _option.title }}</h2>\n @if (_option.description) {\n <p class=\"brand-description\">{{ _option.description }}</p>\n }\n </div>\n </div>\n }\n\n <div class=\"search\" role=\"search\">\n <sd-icon class=\"search-icon\" name=\"search\" size=\"20px\" />\n <input\n #searchInput\n type=\"search\"\n class=\"search-input\"\n autocomplete=\"off\"\n [value]=\"_keyword\"\n [placeholder]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.aria-label]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-search' : null\"\n (input)=\"onKeywordInput(searchInput.value)\" />\n @if (_keyword) {\n <button\n type=\"button\"\n class=\"search-clear\"\n [attr.aria-label]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n [title]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\" />\n </button>\n }\n </div>\n\n @if (_canUpload) {\n <sd-button\n class=\"upload-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"file_upload\"\n [title]=\"_compact ? undefined : ('core.component.file-explorer.upload' | sdTranslate)\"\n [tooltip]=\"_compact ? ('core.component.file-explorer.upload' | sdTranslate) : undefined\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-upload' : null\"\n (click)=\"fileInput.click()\" />\n <input\n #fileInput\n type=\"file\"\n class=\"file-input\"\n multiple\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-file-input' : null\"\n (change)=\"onFilesPicked(fileInput)\" />\n }\n</header>\n\n<!-- why: dialog ph\u1EE7 c\u1EA3 explorer n\u00EAn l\u00E0m inert c\u1EA3 v\u00F9ng n\u00E0y, k\u1EC3 c\u1EA3 drawer chi ti\u1EBFt \u0111ang n\u1EB1m trong .main. -->\n<div class=\"body\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_compact && _sidebarOpen) {\n <div class=\"scrim scrim--sidebar\" aria-hidden=\"true\" (click)=\"sidebarOpen.set(false)\"></div>\n }\n <aside\n #sidebar\n class=\"sidebar\"\n [class.sidebar--open]=\"_sidebarOpen\"\n [id]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"'core.component.file-explorer.folders' | sdTranslate\"\n [attr.inert]=\"_compact && !_sidebarOpen ? '' : null\">\n <p class=\"sidebar-label\">{{ 'core.component.file-explorer.folders' | sdTranslate }}</p>\n <div class=\"sidebar-tree\">\n <sd-file-explorer-folder-tree\n [nodes]=\"treeNodes()\"\n [label]=\"'core.component.file-explorer.tree-label' | sdTranslate\"\n (select)=\"onTreeSelect($event)\"\n (toggle)=\"onTreeToggle($event)\"\n (retry)=\"onTreeRetry($event)\" />\n </div>\n @if (canCreateFolder()) {\n <div class=\"sidebar-footer\">\n <sd-button\n #newFolderButton\n class=\"new-folder-button\"\n type=\"outline\"\n color=\"secondary\"\n size=\"md\"\n prefixIcon=\"add\"\n block\n [title]=\"'core.component.file-explorer.new-folder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-new-folder' : null\"\n (click)=\"openFolderDialog()\" />\n </div>\n }\n </aside>\n\n <!-- why: .main l\u00E0 [container] c\u1EE7a drawer chi ti\u1EBFt \u2014 backdrop ch\u1EC9 ph\u1EE7 v\u00F9ng b\u00EAn ph\u1EA3i, c\u00E2y th\u01B0 m\u1EE5c v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c.\n Drawer n\u1EB1m TRONG ph\u1EA7n t\u1EED n\u00E0y n\u00EAn inert \u0111\u1EB7t tr\u00EAn t\u1EEBng kh\u1ED1i con, kh\u00F4ng \u0111\u1EB7t tr\u00EAn .main. -->\n <section #mainRegion class=\"main\" [attr.aria-label]=\"_heading\">\n @if (refreshing()) {\n <div class=\"refresh-bar\" aria-hidden=\"true\"></div>\n }\n <div class=\"toolbar\" [attr.inert]=\"_preview ? '' : null\">\n @if (_compact) {\n <button\n type=\"button\"\n class=\"icon-button\"\n [attr.aria-expanded]=\"_sidebarOpen\"\n [attr.aria-controls]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"\n (_sidebarOpen ? 'core.component.file-explorer.close-folders' : 'core.component.file-explorer.open-folders') | sdTranslate\n \"\n [attr.data-autoid]=\"_autoId ? _autoId + '-menu' : null\"\n (click)=\"toggleSidebar()\">\n <sd-icon name=\"menu\" size=\"24px\" />\n </button>\n }\n <sd-breadcrumb\n class=\"breadcrumb\"\n [items]=\"breadcrumb().items\"\n [maxItems]=\"_compact ? 3 : 5\"\n [ariaLabel]=\"'core.component.file-explorer.breadcrumb' | sdTranslate\"\n (sdItemActivate)=\"onBreadcrumb($event)\" />\n <div class=\"view-toggle\" role=\"group\" [attr.aria-label]=\"'core.component.file-explorer.view' | sdTranslate\">\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'list'\"\n [attr.aria-pressed]=\"_view === 'list'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-list' : null\"\n (click)=\"setView('list')\">\n <sd-icon name=\"format_list_bulleted\" size=\"24px\" />\n </button>\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'grid'\"\n [attr.aria-pressed]=\"_view === 'grid'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-grid' : null\"\n (click)=\"setView('grid')\">\n <sd-icon name=\"grid_view\" size=\"24px\" />\n </button>\n </div>\n </div>\n\n <div class=\"heading-row\" [attr.inert]=\"_preview ? '' : null\">\n <h3 class=\"heading\" [title]=\"_heading\">{{ _heading }}</h3>\n @if (_state === 'items') {\n <span class=\"count\">{{ itemCountLabel() }}</span>\n }\n </div>\n\n <div class=\"scroller\" [attr.inert]=\"_preview ? '' : null\">\n @switch (_state) {\n @case ('loading') {\n <sd-data-state\n state=\"loading\"\n compact\n [title]=\"(_searching ? 'core.component.file-explorer.search-loading' : 'core.component.file-explorer.loading') | sdTranslate\" />\n }\n @case ('error') {\n <sd-data-state\n state=\"error\"\n retryable\n [title]=\"(_searching ? 'core.component.file-explorer.search-error' : 'core.component.file-explorer.load-error') | sdTranslate\"\n [message]=\"errorMessage()\"\n [retryLabel]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (sdRetry)=\"retryContent()\" />\n }\n @case ('empty') {\n <sd-data-state\n state=\"empty\"\n [icon]=\"_searching ? 'search_off' : 'folder_open'\"\n [title]=\"emptyTitle()\"\n [message]=\"emptyMessage()\" />\n }\n @default {\n <sd-file-explorer-item-list\n [items]=\"itemViews()\"\n [view]=\"_view\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [compact]=\"_compact\"\n [activeId]=\"_preview ? _preview.item.id : null\"\n [label]=\"_heading\"\n (activate)=\"onActivate($event)\"\n (download)=\"downloadItem($event.item)\"\n (share)=\"openShare($event.item)\" />\n }\n }\n </div>\n </section>\n</div>\n\n@if (_transfers.length) {\n <sd-file-explorer-transfer-panel\n class=\"transfers\"\n [attr.inert]=\"_modalOpen ? '' : null\"\n [transfers]=\"_transfers\"\n [title]=\"transfersTitle()\"\n [collapsed]=\"_collapsed\"\n [canClear]=\"canClearTransfers()\"\n [compact]=\"_compact\"\n [autoId]=\"_autoId ? _autoId + '-transfers' : undefined\"\n (toggleCollapsed)=\"transfersCollapsed.set(!_collapsed)\"\n (clear)=\"clearFinishedTransfers()\"\n (cancel)=\"cancelTransfer($event)\"\n (retry)=\"retryTransfer($event)\"\n (dismiss)=\"dismissTransfer($event)\" />\n}\n\n<!-- why: chi ti\u1EBFt file l\u00E0 sd-side-drawer th\u1EADt, m\u1EDF g\u1ECDn trong v\u00F9ng danh s\u00E1ch b\u00EAn ph\u1EA3i nh\u1EDD [container]:\n header (t\u00ECm ki\u1EBFm, t\u1EA3i l\u00EAn), c\u00E2y th\u01B0 m\u1EE5c v\u00E0 h\u00E0ng ch\u1EDD truy\u1EC1n t\u1EA3i v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c khi drawer m\u1EDF. -->\n<sd-file-explorer-preview-panel\n [view]=\"_preview\"\n [state]=\"previewState()\"\n [meta]=\"previewMeta()\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [container]=\"mainRegion\"\n [autoId]=\"_autoId ? _autoId + '-preview' : undefined\"\n (close)=\"closePreview()\"\n (download)=\"downloadPreview()\"\n (share)=\"sharePreview()\"\n (retry)=\"retryPreview()\"\n (imageError)=\"onPreviewImageError()\" />\n\n@if (dragActive()) {\n <div class=\"drop-overlay\" aria-hidden=\"true\">\n <div class=\"drop-card\">\n <sd-icon name=\"file_upload\" size=\"40px\" />\n <p class=\"drop-title\">{{ dropTitle() }}</p>\n </div>\n </div>\n}\n\n@if (_dialogOpen) {\n @let _folderName = folderName();\n @let _folderError = folderError();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeFolderDialog()\"></div>\n <form\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n novalidate\n [attr.aria-labelledby]=\"instanceId + '-folder-title'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-dialog' : null\"\n (submit)=\"submitFolder($event)\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-folder-title'\">{{ folderDialogTitle() }}</h3>\n <label class=\"field-label\" [for]=\"instanceId + '-folder-name'\">{{\n 'core.component.file-explorer.new-folder-name' | sdTranslate\n }}</label>\n <input\n #folderInput\n class=\"field-input\"\n autocomplete=\"off\"\n maxlength=\"255\"\n [id]=\"instanceId + '-folder-name'\"\n [value]=\"_folderName\"\n [attr.aria-invalid]=\"_folderError ? true : null\"\n [attr.aria-describedby]=\"_folderError ? instanceId + '-folder-error' : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-name' : null\"\n (input)=\"folderName.set(folderInput.value)\" />\n @if (_folderError) {\n <p class=\"field-error\" role=\"alert\" [id]=\"instanceId + '-folder-error'\">{{ _folderError }}</p>\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"cancel-button\"\n type=\"text\"\n color=\"secondary\"\n size=\"md\"\n [title]=\"'core.component.file-explorer.cancel' | sdTranslate\"\n (click)=\"closeFolderDialog()\" />\n <sd-button\n class=\"submit-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n htmlType=\"submit\"\n [title]=\"'core.component.file-explorer.create' | sdTranslate\"\n [disabled]=\"!_folderName.trim()\"\n [loading]=\"folderSubmitting()\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-submit' : null\" />\n </div>\n </form>\n}\n\n@if (_shareItem) {\n @let _shareState = shareState();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeShare()\"></div>\n <div\n #shareDialog\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"instanceId + '-share-title'\"\n [attr.aria-busy]=\"_shareState.status === 'loading' ? true : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-dialog' : null\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-share-title'\" [title]=\"_shareItem.name\">{{ shareTitle() }}</h3>\n @switch (_shareState.status) {\n @case ('loading') {\n <p class=\"share-status\" role=\"status\">\n <span class=\"spinner\" aria-hidden=\"true\"></span>\n {{ 'core.component.file-explorer.share.loading' | sdTranslate }}\n </p>\n }\n @case ('error') {\n <p class=\"field-error\" role=\"alert\">{{ _shareState.message }}</p>\n }\n @case ('ready') {\n <label class=\"field-label\" [for]=\"instanceId + '-share-link'\">{{ 'core.component.file-explorer.share.link' | sdTranslate }}</label>\n <input\n #shareInput\n class=\"field-input\"\n readonly\n [id]=\"instanceId + '-share-link'\"\n [value]=\"_shareState.url\"\n [attr.aria-describedby]=\"instanceId + '-share-feedback'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-link' : null\"\n (focus)=\"shareInput.select()\" />\n <p class=\"share-feedback\" role=\"status\" aria-live=\"polite\" [id]=\"instanceId + '-share-feedback'\">{{ shareFeedbackLabel() }}</p>\n }\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"close-button\"\n type=\"text\"\n color=\"secondary\"\n size=\"md\"\n [title]=\"'core.component.file-explorer.close' | sdTranslate\"\n (click)=\"closeShare()\" />\n @if (_shareState.status === 'error') {\n <sd-button\n class=\"retry-button\"\n type=\"outline\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"refresh\"\n [title]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (click)=\"retryShare()\" />\n } @else {\n <sd-button\n #copyButton\n class=\"copy-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"content_copy\"\n [title]=\"\n (shareFeedback() === 'copied' ? 'core.component.file-explorer.share.copied' : 'core.component.file-explorer.share.copy')\n | sdTranslate\n \"\n [disabled]=\"_shareState.status !== 'ready'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-copy' : null\"\n (click)=\"copyShareLink()\" />\n }\n </div>\n </div>\n}\n", styles: [":host{--sd-fe-accent: var(--sd-file-explorer-accent, var(--sd-primary, #005cbb));--sd-fe-accent-strong: var(--sd-file-explorer-accent-strong, color-mix(in srgb, var(--sd-fe-accent) 84%, var(--sd-file-explorer-mix-shade, #000000)));--sd-fe-accent-contrast: var(--sd-file-explorer-accent-contrast, var(--sd-primary-contrast, #ffffff));--sd-fe-accent-soft: var(--sd-file-explorer-accent-soft, color-mix(in srgb, var(--sd-fe-accent) 10%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-surface: var(--sd-file-explorer-surface, #ffffff);--sd-fe-sidebar-bg: var(--sd-file-explorer-sidebar-bg, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 26%, var(--sd-fe-surface)));--sd-fe-muted-surface: var( --sd-file-explorer-muted-surface, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 50%, var(--sd-fe-surface)) );--sd-fe-preview-bg: var(--sd-file-explorer-preview-bg, color-mix(in srgb, var(--sd-fe-accent) 9%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-border: var(--sd-file-explorer-border, color-mix(in srgb, var(--sd-border, #c4c6d0) 55%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-border-strong: var(--sd-file-explorer-border-strong, var(--sd-border, #c4c6d0));--sd-fe-text: var(--sd-file-explorer-text, var(--sd-text, #1a1b1f));--sd-fe-text-secondary: var(--sd-file-explorer-text-secondary, color-mix(in srgb, var(--sd-text-secondary, #44474f) 84%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-hover: color-mix(in srgb, var(--sd-fe-text) 4%, transparent);--sd-fe-hover-strong: color-mix(in srgb, var(--sd-fe-text) 8%, transparent);--sd-fe-track: color-mix(in srgb, var(--sd-fe-text) 7%, var(--sd-fe-surface));--sd-fe-success: var(--sd-file-explorer-success, var(--sd-success, #2e7d32));--sd-fe-error: var(--sd-file-explorer-error, var(--sd-error, #ba1a1a));--sd-fe-radius: var(--sd-file-explorer-radius, 16px);--sd-fe-scrim: var(--sd-file-explorer-scrim, rgba(0, 0, 0, .4));--sd-side-drawer-contained-z-index: 9;position:relative;display:flex;flex-direction:column;height:100%;min-height:480px;overflow:hidden;border:1px solid var(--sd-fe-border);border-radius:var(--sd-fe-radius);background:var(--sd-fe-surface);color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.header{display:grid;grid-template-columns:fit-content(320px) minmax(0,1fr) auto;align-items:center;gap:12px 20px;padding:16px 20px;border-bottom:1px solid var(--sd-fe-border)}.brand{grid-column:1;display:flex;align-items:center;gap:10px;min-width:0}.brand-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--sd-fe-accent) 14%,var(--sd-file-explorer-mix-tint, #ffffff));color:var(--sd-fe-accent)}.brand-text{min-width:0}.brand-title{margin:0;overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);text-overflow:ellipsis;white-space:nowrap}.brand-description{margin:0;overflow:hidden;font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);color:var(--sd-fe-text-secondary);text-overflow:ellipsis;white-space:nowrap}.search{grid-column:2;justify-self:center;display:flex;align-items:center;gap:8px;width:100%;max-width:520px;height:36px;padding:0 6px 0 12px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-muted-surface);transition:border-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease}.search:focus-within{border-color:var(--sd-fe-accent);background:var(--sd-fe-surface);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.search-icon{flex:none;color:var(--sd-fe-text-secondary)}.search-input{flex:1;min-width:0;height:100%;padding:0;border:0;outline:none;background:transparent;color:var(--sd-fe-text);font:inherit;font-size:var(--sd-font-size-14, 14px)}.search-input::placeholder{color:var(--sd-fe-text-secondary)}.search-input::-webkit-search-cancel-button{display:none}.search-clear{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.search-clear:hover{background:var(--sd-fe-hover-strong)}.upload-button{grid-column:3;justify-self:end}.file-input{display:none}.body{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:238px minmax(0,1fr)}.sidebar{display:flex;flex-direction:column;min-height:0;padding:22px 14px 32px 12px;border-right:1px solid var(--sd-fe-border);background:var(--sd-fe-sidebar-bg)}.sidebar-label{margin:0 0 6px 10px;font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-16, 16px);letter-spacing:.04em;text-transform:uppercase;color:var(--sd-fe-text-secondary)}.sidebar-tree{flex:1;min-height:0;margin:0 -4px;padding:2px 4px;overflow-y:auto}.sidebar-footer{margin:12px 4px 0;padding-top:18px;border-top:1px solid var(--sd-fe-border)}.new-folder-button{display:block}.main{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;padding-top:14px}.refresh-bar{position:absolute;top:0;left:0;right:0;height:2px;overflow:hidden;background:var(--sd-fe-accent-soft)}.refresh-bar:after{content:\"\";position:absolute;top:0;bottom:0;width:30%;background:var(--sd-fe-accent);animation:sd-file-explorer-refresh 1.2s ease-in-out infinite}.toolbar{display:flex;align-items:center;gap:12px;min-height:40px;padding:0 32px}.breadcrumb{flex:1;min-width:0;margin-left:-4px;font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-semibold, 600)}.view-toggle{flex:none;display:flex;gap:2px;padding:2px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-surface)}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-file-explorer-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.icon-button--toggle{width:40px;height:32px}.icon-button--active,.icon-button--active:hover{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent)}.heading-row{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-top:10px;padding:0 32px}.heading{min-width:0;margin:0;overflow:hidden;font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-bold, 700);line-height:26px;text-overflow:ellipsis;white-space:nowrap}.count{flex:none;padding-bottom:12px;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary)}.scroller{flex:1;min-height:0;padding:8px 28px 16px;overflow-y:auto}.scrim{position:absolute;inset:0;background:var(--sd-fe-scrim);animation:sd-file-explorer-fade .18s ease}.transfers{flex:none;border-top:1px solid var(--sd-fe-border);background:var(--sd-fe-surface)}.drop-overlay{position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:16px;border:2px dashed var(--sd-fe-accent);border-radius:var(--sd-fe-radius);background:color-mix(in srgb,var(--sd-fe-accent) 8%,rgba(255,255,255,.86));pointer-events:none}.drop-card{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--sd-fe-accent);text-align:center}.drop-title{margin:0;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600)}.dialog-backdrop{position:absolute;inset:0;z-index:20;background:var(--sd-fe-scrim)}.dialog{position:absolute;top:50%;left:50%;z-index:21;display:flex;flex-direction:column;gap:8px;width:min(400px,100% - 32px);padding:20px;border-radius:14px;background:var(--sd-fe-surface);box-shadow:0 18px 48px #0f172a2e;transform:translate(-50%,-50%)}.dialog:focus{outline:none}.dialog-title{margin:0 0 8px;font-size:17px;font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-24, 24px)}.field-label{font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary)}.field-input{height:40px;padding:0 12px;border:1px solid var(--sd-fe-border-strong);border-radius:var(--sd-radius-8, 8px);background:var(--sd-fe-surface);color:var(--sd-fe-text);font:inherit;font-size:var(--sd-font-size-15, 15px);outline:none}.field-input:focus{border-color:var(--sd-fe-accent);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.field-input[aria-invalid=true]{border-color:var(--sd-fe-error)}.field-error{margin:0;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-error)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.share-status{display:flex;align-items:center;gap:10px;margin:4px 0;font-size:var(--sd-font-size-14, 14px);color:var(--sd-fe-text-secondary)}.share-feedback{min-height:18px;margin:0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-fe-success)}.spinner{flex:none;width:18px;height:18px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-spin .8s linear infinite}:host(.sd-file-explorer--compact) .header{grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;padding:12px 14px}:host(.sd-file-explorer--compact) .brand{grid-row:1;gap:10px}:host(.sd-file-explorer--compact) .upload-button{grid-column:2;grid-row:1}:host(.sd-file-explorer--compact) .search{grid-column:1/-1;grid-row:2;max-width:none}:host(.sd-file-explorer--compact) .header:not(:has(.brand)) .search{grid-column:1;grid-row:1}:host(.sd-file-explorer--compact) .body{grid-template-columns:minmax(0,1fr)}:host(.sd-file-explorer--compact) .sidebar{position:absolute;top:0;bottom:0;left:0;z-index:5;width:min(300px,86%);border-right:1px solid var(--sd-fe-border);box-shadow:12px 0 32px #0f172a1f;visibility:hidden;transform:translate(-100%);transition:transform var(--sd-duration-base, .2s) ease,visibility var(--sd-duration-base, .2s)}:host(.sd-file-explorer--compact) .sidebar--open{visibility:visible;transform:none}:host(.sd-file-explorer--compact) .scrim--sidebar{z-index:4}:host(.sd-file-explorer--compact) .main{padding-top:8px}:host(.sd-file-explorer--compact) .toolbar{gap:6px;min-height:36px;padding:0 12px 0 10px}:host(.sd-file-explorer--compact) .breadcrumb{margin-left:0}:host(.sd-file-explorer--compact) .icon-button--toggle{width:36px}:host(.sd-file-explorer--compact) .heading-row{margin-top:13px;padding:0 14px}:host(.sd-file-explorer--compact) .count{padding-bottom:8px}:host(.sd-file-explorer--compact) .scroller{padding:0 12px 12px}@keyframes sd-file-explorer-spin{to{transform:rotate(360deg)}}@keyframes sd-file-explorer-fade{0%{opacity:0}}@keyframes sd-file-explorer-refresh{0%{left:-30%}to{left:100%}}@media(prefers-reduced-motion:reduce){.scrim{animation:none}.search,:host(.sd-file-explorer--compact) .sidebar{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdBreadcrumb, selector: "sd-breadcrumb", inputs: ["items", "maxItems", "ariaLabel", "separator"], outputs: ["sdItemActivate"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdDataState, selector: "sd-data-state", inputs: ["state", "title", "message", "icon", "fontSet", "iconShape", "retryable", "retryLabel", "actionLabel", "compact", "fullPage"], outputs: ["sdRetry", "sdAction"] }, { kind: "component", type: SdFileExplorerFolderTree, selector: "sd-file-explorer-folder-tree", inputs: ["nodes", "label"], outputs: ["select", "toggle", "retry"] }, { kind: "component", type: SdFileExplorerItemList, selector: "sd-file-explorer-item-list", inputs: ["items", "view", "canDownload", "canShare", "compact", "activeId", "label"], outputs: ["activate", "download", "share"] }, { kind: "component", type: SdFileExplorerPreviewPanel, selector: "sd-file-explorer-preview-panel", inputs: ["view", "state", "meta", "canDownload", "canShare", "container", "autoId"], outputs: ["close", "download", "share", "retry", "imageError"] }, { kind: "component", type: SdFileExplorerTransferPanel, selector: "sd-file-explorer-transfer-panel", inputs: ["transfers", "title", "collapsed", "canClear", "compact", "autoId"], outputs: ["toggleCollapsed", "clear", "cancel", "retry", "dismiss"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4699
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdFileExplorer, isStandalone: true, selector: "sd-file-explorer", inputs: { option: { classPropertyName: "option", publicName: "option", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "open" }, host: { listeners: { "dragenter": "onDragEnter($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave()", "drop": "onDrop($event)", "dragstart": "onMoveDragStart($event)", "dragend": "onMoveDragEnd()", "keydown.escape": "onEscape($event)" }, properties: { "class.sd-file-explorer--compact": "compact()", "class.sd-file-explorer--touch": "touch()", "class.sd-file-explorer--dragging": "dragActive()", "attr.data-autoid": "autoId()" }, classAttribute: "sd-file-explorer" }, queries: [{ propertyName: "columnDefs", predicate: SdFileExplorerColumnDef, isSignal: true }], viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "folderInput", first: true, predicate: ["folderInput"], descendants: true, isSignal: true }, { propertyName: "newFolderButton", first: true, predicate: ["newFolderButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "copyButton", first: true, predicate: ["copyButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "shareInput", first: true, predicate: ["shareInput"], descendants: true, isSignal: true }, { propertyName: "shareDialog", first: true, predicate: ["shareDialog"], descendants: true, isSignal: true }, { propertyName: "sidebar", first: true, predicate: ["sidebar"], descendants: true, isSignal: true }, { propertyName: "commandDrawer", first: true, predicate: SdFileExplorerCommandSheet, descendants: true, isSignal: true }], ngImport: i0, template: "@let _option = option();\n@let _compact = compact();\n@let _autoId = autoId();\n@let _canUpload = canUpload();\n@let _canDownload = canDownload();\n@let _view = view();\n@let _state = contentState();\n@let _keyword = keyword();\n@let _sidebarOpen = sidebarOpen();\n@let _preview = previewView();\n@let _transfers = transferViews();\n@let _heading = heading();\n@let _searching = searching();\n@let _collapsed = transfersCollapsed();\n@let _dialogOpen = folderDialogOpen();\n@let _shareItem = shareItem();\n@let _canShare = canShare();\n@let _modalOpen = _dialogOpen || !!_shareItem || !!movePickerItems();\n@let _touch = touch();\n@let _rowShortcuts = rowShortcuts();\n\n<header class=\"header\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_option.title) {\n <div class=\"brand\">\n <span class=\"brand-icon\" aria-hidden=\"true\">\n <sd-icon name=\"folder\" size=\"20px\" />\n </span>\n <div class=\"brand-text\">\n <h2 class=\"brand-title\" [title]=\"_option.title\">{{ _option.title }}</h2>\n @if (_option.description) {\n <p class=\"brand-description\">{{ _option.description }}</p>\n }\n </div>\n </div>\n }\n\n <div class=\"search\" role=\"search\">\n <sd-icon class=\"search-icon\" name=\"search\" size=\"20px\" />\n <input\n #searchInput\n type=\"search\"\n class=\"search-input\"\n autocomplete=\"off\"\n [value]=\"_keyword\"\n [placeholder]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.aria-label]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-search' : null\"\n (input)=\"onKeywordInput(searchInput.value)\" />\n @if (_keyword) {\n <button\n type=\"button\"\n class=\"search-clear\"\n [attr.aria-label]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n [title]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\" />\n </button>\n }\n </div>\n\n @if (_canUpload) {\n <sd-button\n class=\"upload-button\"\n [disabled]=\"uploadDisabled()\"\n [attr.aria-description]=\"uploadDisabled() ? ('core.component.file-explorer.action-unavailable' | sdTranslate) : null\"\n type=\"fill\"\n color=\"primary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n prefixIcon=\"file_upload\"\n [title]=\"_compact ? undefined : ('core.component.file-explorer.upload' | sdTranslate)\"\n [tooltip]=\"_compact ? ('core.component.file-explorer.upload' | sdTranslate) : undefined\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-upload' : null\"\n (click)=\"fileInput.click()\" />\n <input\n #fileInput\n type=\"file\"\n class=\"file-input\"\n multiple\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-file-input' : null\"\n (change)=\"onFilesPicked(fileInput)\" />\n }\n</header>\n\n@if (moveStatus()) {\n <sd-inform class=\"move-status\" color=\"secondary\" [hideIcon]=\"true\" [title]=\"moveStatus()!\">\n @if (moveRefreshError()) {\n <sd-button\n sdInformAction\n class=\"move-retry-button\"\n type=\"light\"\n color=\"primary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n htmlType=\"button\"\n [title]=\"'core.component.file-explorer.move.retry-refresh' | sdTranslate\"\n [disabled]=\"movePending()\"\n (click)=\"retryMoveRefresh()\" />\n }\n </sd-inform>\n}\n\n<!-- why: dialog ph\u1EE7 c\u1EA3 explorer n\u00EAn l\u00E0m inert c\u1EA3 v\u00F9ng n\u00E0y, k\u1EC3 c\u1EA3 drawer chi ti\u1EBFt \u0111ang n\u1EB1m trong .main. -->\n<div class=\"body\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_compact && _sidebarOpen) {\n <div class=\"scrim scrim--sidebar\" aria-hidden=\"true\" (click)=\"sidebarOpen.set(false)\"></div>\n }\n <aside\n #sidebar\n class=\"sidebar\"\n [class.sidebar--open]=\"_sidebarOpen\"\n [id]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"'core.component.file-explorer.folders' | sdTranslate\"\n [attr.inert]=\"_compact && !_sidebarOpen ? '' : null\">\n <p class=\"sidebar-label\">{{ 'core.component.file-explorer.folders' | sdTranslate }}</p>\n <div class=\"sidebar-tree\">\n <sd-file-explorer-folder-tree\n [nodes]=\"treeNodes()\"\n [moveDropTarget]=\"moveDropTarget()\"\n [label]=\"'core.component.file-explorer.tree-label' | sdTranslate\"\n [commands]=\"_option.folderCommands\"\n [touch]=\"_touch\"\n [compact]=\"_compact\"\n [menuOpenId]=\"treeMenuOpenId()\"\n (select)=\"onTreeSelect($event)\"\n (toggle)=\"onTreeToggle($event)\"\n (retry)=\"onTreeRetry($event)\"\n (openCommands)=\"openCommands($event.item, 'tree', $event.trigger)\" />\n </div>\n @if (canCreateFolder()) {\n <div class=\"sidebar-footer\">\n <sd-button\n #newFolderButton\n class=\"new-folder-button\"\n [disabled]=\"createDisabled()\"\n [attr.aria-description]=\"createDisabled() ? ('core.component.file-explorer.action-unavailable' | sdTranslate) : null\"\n type=\"outline\"\n color=\"secondary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n prefixIcon=\"add\"\n block\n [title]=\"'core.component.file-explorer.new-folder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-new-folder' : null\"\n (click)=\"openFolderDialog()\" />\n </div>\n }\n </aside>\n\n <!-- why: .main l\u00E0 [container] c\u1EE7a drawer chi ti\u1EBFt \u2014 backdrop ch\u1EC9 ph\u1EE7 v\u00F9ng b\u00EAn ph\u1EA3i, c\u00E2y th\u01B0 m\u1EE5c v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c.\n Drawer n\u1EB1m TRONG ph\u1EA7n t\u1EED n\u00E0y n\u00EAn inert \u0111\u1EB7t tr\u00EAn t\u1EEBng kh\u1ED1i con, kh\u00F4ng \u0111\u1EB7t tr\u00EAn .main. -->\n <section #mainRegion class=\"main\" [attr.aria-label]=\"_heading\">\n @if (refreshing()) {\n <div class=\"refresh-bar\" aria-hidden=\"true\"></div>\n }\n <div class=\"toolbar\" [attr.inert]=\"_preview ? '' : null\">\n @if (_compact) {\n <button\n type=\"button\"\n class=\"icon-button\"\n [attr.aria-expanded]=\"_sidebarOpen\"\n [attr.aria-controls]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"\n (_sidebarOpen ? 'core.component.file-explorer.close-folders' : 'core.component.file-explorer.open-folders') | sdTranslate\n \"\n [attr.data-autoid]=\"_autoId ? _autoId + '-menu' : null\"\n (click)=\"toggleSidebar()\">\n <sd-icon name=\"menu\" size=\"24px\" />\n </button>\n }\n <sd-breadcrumb\n class=\"breadcrumb\"\n [items]=\"breadcrumb().items\"\n [maxItems]=\"_compact ? 3 : 5\"\n [ariaLabel]=\"'core.component.file-explorer.breadcrumb' | sdTranslate\"\n (sdItemActivate)=\"onBreadcrumb($event)\" />\n @if (_state === 'items') {\n <span class=\"count\">{{ itemCountLabel() }}</span>\n }\n <div class=\"view-toggle\" role=\"group\" [attr.aria-label]=\"'core.component.file-explorer.view' | sdTranslate\">\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'list'\"\n [attr.aria-pressed]=\"_view === 'list'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-list' : null\"\n (click)=\"setView('list')\">\n <sd-icon name=\"format_list_bulleted\" size=\"24px\" />\n </button>\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'grid'\"\n [attr.aria-pressed]=\"_view === 'grid'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-grid' : null\"\n (click)=\"setView('grid')\">\n <sd-icon name=\"grid_view\" size=\"24px\" />\n </button>\n </div>\n </div>\n\n @let _selection = selectionView();\n @if (_selection && selectedItems().length) {\n @let _selected = selectedItems();\n @let _selectedCount = _selected.length;\n @let _summary = selectionSummary();\n @let _clearLabel = 'core.component.file-explorer.selection.clear' | sdTranslate;\n <!-- why: one band for list and grid. The select-all checkbox lives in the list header / above the grid, not here. -->\n <div\n class=\"selection\"\n role=\"group\"\n [class.selection--active]=\"_selectedCount > 0\"\n [attr.aria-label]=\"'core.component.file-explorer.selection.label' | sdTranslate\"\n [attr.inert]=\"_preview ? '' : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-selection' : null\">\n <div class=\"selection-summary\">\n <!-- why: one plain sentence in the translated word order (\"2 t\u1EC7p \u0111\u00E3 ch\u1ECDn\", \"\u5DF2\u9009\u62E9 2 \u4E2A\u6587\u4EF6\"); only the number is\n heavier. Each part sits in its own span: the markup whitespace between spans is dropped, so the sentence\n keeps exactly the spaces of its translation (\"2\u4EF6\u2026\" stays joined). -->\n <span class=\"selection-status\" role=\"status\">\n <span>{{ _summary.before }}</span>\n @if (_summary.count) {\n <span class=\"selection-count\">{{ _summary.count }}</span>\n }\n <span>{{ _summary.after }}</span>\n </span>\n <button\n type=\"button\"\n class=\"icon-button selection-clear\"\n [disabled]=\"!_selectedCount\"\n [attr.aria-label]=\"_clearLabel\"\n [matTooltip]=\"_clearLabel\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-selection-clear' : null\"\n (click)=\"clearSelection()\">\n <sd-icon name=\"close\" size=\"20px\" />\n </button>\n </div>\n @if (_selectedCount && selectionActions().length) {\n <!-- why: unset types follow the kind (light flat action, text group trigger). sd-button's own sizes: 32 px like the\n row commands, 48 px only on a wide touch layout; a narrow layout keeps 32 px and spaces the lines instead. -->\n <sd-file-explorer-actions\n class=\"selection-actions\"\n source=\"selector.actions\"\n defaultLeafType=\"light\"\n defaultGroupType=\"text\"\n defaultColor=\"primary\"\n [actions]=\"selectionActions()\"\n [context]=\"_selected\"\n [size]=\"_touch && !_compact ? 'lg' : 'sm'\"\n [autoId]=\"_autoId ? _autoId + '-selection-action' : undefined\" />\n }\n </div>\n }\n\n <div class=\"scroller\" [attr.inert]=\"_preview ? '' : null\">\n @switch (_state) {\n @case ('loading') {\n <sd-data-state\n state=\"loading\"\n compact\n [title]=\"(_searching ? 'core.component.file-explorer.search-loading' : 'core.component.file-explorer.loading') | sdTranslate\" />\n }\n @case ('error') {\n <sd-data-state\n state=\"error\"\n retryable\n [title]=\"(_searching ? 'core.component.file-explorer.search-error' : 'core.component.file-explorer.load-error') | sdTranslate\"\n [message]=\"errorMessage()\"\n [retryLabel]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (sdRetry)=\"retryContent()\" />\n }\n @case ('empty') {\n <sd-data-state\n state=\"empty\"\n [icon]=\"_searching ? 'search_off' : 'folder_open'\"\n [title]=\"emptyTitle()\"\n [message]=\"emptyMessage()\" />\n }\n @default {\n <sd-file-explorer-item-list\n [columns]=\"columns()\"\n [moveDropTarget]=\"moveDropTarget()\"\n [canMove]=\"canMove()\"\n [movePending]=\"movePending()\"\n (move)=\"openMovePicker([$event])\"\n [items]=\"itemViews()\"\n [view]=\"_view\"\n [canDownload]=\"_canDownload && _rowShortcuts\"\n [canShare]=\"_canShare && _rowShortcuts\"\n [compact]=\"_compact\"\n [touch]=\"_touch\"\n [activeId]=\"_preview ? _preview.item.id : null\"\n [label]=\"_heading\"\n [selection]=\"_selection\"\n [fileCommands]=\"_option.fileCommands\"\n [folderCommands]=\"_option.folderCommands\"\n [menuOpenId]=\"itemsMenuOpenId()\"\n (activate)=\"onActivate($event)\"\n (download)=\"downloadItem($event.item)\"\n (share)=\"openShare($event.item)\"\n (toggleSelect)=\"toggleSelection($event)\"\n (toggleSelectAll)=\"toggleSelectAll()\"\n (openCommands)=\"openCommands($event.item, _view, $event.trigger)\" />\n }\n }\n </div>\n </section>\n</div>\n\n@if (_transfers.length) {\n <sd-file-explorer-transfer-panel\n class=\"transfers\"\n [attr.inert]=\"_modalOpen ? '' : null\"\n [transfers]=\"_transfers\"\n [title]=\"transfersTitle()\"\n [collapsed]=\"_collapsed\"\n [canClear]=\"canClearTransfers()\"\n [compact]=\"_compact\"\n [autoId]=\"_autoId ? _autoId + '-transfers' : undefined\"\n (toggleCollapsed)=\"transfersCollapsed.set(!_collapsed)\"\n (clear)=\"clearFinishedTransfers()\"\n (cancel)=\"cancelTransfer($event)\"\n (retry)=\"retryTransfer($event)\"\n (dismiss)=\"dismissTransfer($event)\" />\n}\n\n<!-- why: chi ti\u1EBFt file l\u00E0 sd-side-drawer th\u1EADt, m\u1EDF g\u1ECDn trong v\u00F9ng danh s\u00E1ch b\u00EAn ph\u1EA3i nh\u1EDD [container]:\n header (t\u00ECm ki\u1EBFm, t\u1EA3i l\u00EAn), c\u00E2y th\u01B0 m\u1EE5c v\u00E0 h\u00E0ng ch\u1EDD truy\u1EC1n t\u1EA3i v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c khi drawer m\u1EDF. -->\n<sd-file-explorer-preview-panel\n [view]=\"_preview\"\n [compact]=\"_compact\"\n [state]=\"previewState()\"\n [meta]=\"previewMeta()\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [container]=\"mainRegion\"\n [autoId]=\"_autoId ? _autoId + '-preview' : undefined\"\n (close)=\"closePreview()\"\n (download)=\"downloadPreview()\"\n (share)=\"sharePreview()\"\n (retry)=\"retryPreview()\"\n (imageError)=\"onPreviewImageError()\" />\n\n<!-- why: l\u1EC7nh c\u1EE7a m\u1ED9t m\u1EE5c tr\u00EAn layout h\u1EB9p m\u1EDF trong sd-side-drawer th\u1EADt c\u1EE7a Core (g\u1EAFn v\u00E0o <body>: backdrop, Esc, b\u1EABy focus,\n kho\u00E1 scroll trang) thay cho c\u00E1c n\u00FAt tr\u00EAn h\u00E0ng / th\u1EBB / n\u00FAt c\u00E2y. -->\n<sd-file-explorer-command-sheet\n [sheet]=\"commandSheet()\"\n [touch]=\"_touch\"\n [autoId]=\"_autoId ? _autoId + '-commands' : undefined\"\n (activate)=\"runCommand($event)\"\n (close)=\"onCommandsClosed()\" />\n\n@if (dragActive()) {\n <div class=\"drop-overlay\" aria-hidden=\"true\">\n <div class=\"drop-card\">\n <sd-icon name=\"file_upload\" size=\"40px\" />\n <p class=\"drop-title\">{{ dropTitle() }}</p>\n </div>\n </div>\n}\n\n@if (_dialogOpen) {\n @let _folderName = folderName();\n @let _folderError = folderError();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeFolderDialog()\"></div>\n <form\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n novalidate\n [attr.aria-labelledby]=\"instanceId + '-folder-title'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-dialog' : null\"\n (submit)=\"submitFolder($event)\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-folder-title'\">{{ folderDialogTitle() }}</h3>\n <label class=\"field-label\" [for]=\"instanceId + '-folder-name'\">{{\n 'core.component.file-explorer.new-folder-name' | sdTranslate\n }}</label>\n <input\n #folderInput\n class=\"field-input\"\n autocomplete=\"off\"\n maxlength=\"255\"\n [id]=\"instanceId + '-folder-name'\"\n [value]=\"_folderName\"\n [attr.aria-invalid]=\"_folderError ? true : null\"\n [attr.aria-describedby]=\"_folderError ? instanceId + '-folder-error' : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-name' : null\"\n (input)=\"folderName.set(folderInput.value)\" />\n @if (_folderError) {\n <sd-inform class=\"field-error\" color=\"error\" [hideIcon]=\"true\" [id]=\"instanceId + '-folder-error'\" [title]=\"_folderError\" />\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"cancel-button\"\n type=\"text\"\n color=\"secondary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n [title]=\"'core.component.file-explorer.cancel' | sdTranslate\"\n (click)=\"closeFolderDialog()\" />\n <sd-button\n class=\"submit-button\"\n type=\"fill\"\n color=\"primary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n htmlType=\"submit\"\n [title]=\"'core.component.file-explorer.create' | sdTranslate\"\n [disabled]=\"!_folderName.trim()\"\n [loading]=\"folderSubmitting()\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-submit' : null\" />\n </div>\n </form>\n}\n\n@if (movePickerItems()) {\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeMovePicker()\"></div>\n <section\n class=\"dialog move-picker\"\n role=\"dialog\"\n aria-modal=\"true\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown.tab)=\"$event.stopPropagation()\"\n (keydown.shift.tab)=\"$event.stopPropagation()\"\n [attr.aria-labelledby]=\"instanceId + '-move-title'\">\n <h3 cdkFocusInitial tabindex=\"-1\" [id]=\"instanceId + '-move-title'\">{{ 'core.component.file-explorer.move.to' | sdTranslate }}</h3>\n <sd-file-explorer-folder-tree\n [nodes]=\"movePickerNodes()\"\n [label]=\"'core.component.file-explorer.folders' | sdTranslate\"\n [touch]=\"_touch\"\n [compact]=\"false\"\n (select)=\"moveTarget.set($event.item)\"\n (toggle)=\"onTreeToggle($event)\"\n (retry)=\"onTreeRetry($event)\" />\n @if (!canSubmitMove() && !movePending()) {\n <sd-inform\n class=\"field-error move-destination-tip\"\n type=\"tip\"\n color=\"secondary\"\n [hideIcon]=\"true\"\n [title]=\"'core.component.file-explorer.move.destination-tip' | sdTranslate\" />\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"move-cancel-button\"\n type=\"text\"\n color=\"secondary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n htmlType=\"button\"\n [title]=\"'core.component.file-explorer.cancel' | sdTranslate\"\n (click)=\"closeMovePicker()\" />\n <sd-button\n class=\"move-submit-button\"\n type=\"fill\"\n color=\"primary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n htmlType=\"button\"\n [title]=\"'core.component.file-explorer.move.confirm' | sdTranslate\"\n [disabled]=\"!canSubmitMove()\"\n (click)=\"submitMoveFromEvent($event)\" />\n </div>\n </section>\n}\n\n@if (_shareItem) {\n @let _shareState = shareState();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeShare()\"></div>\n <div\n #shareDialog\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"instanceId + '-share-title'\"\n [attr.aria-busy]=\"_shareState.status === 'loading' ? true : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-dialog' : null\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-share-title'\" [title]=\"_shareItem.name\">{{ shareTitle() }}</h3>\n @switch (_shareState.status) {\n @case ('loading') {\n <p class=\"share-status\" role=\"status\">\n <span class=\"spinner\" aria-hidden=\"true\"></span>\n {{ 'core.component.file-explorer.share.loading' | sdTranslate }}\n </p>\n }\n @case ('error') {\n <sd-inform class=\"field-error\" color=\"error\" [hideIcon]=\"true\" [title]=\"_shareState.message\" />\n }\n @case ('ready') {\n <label class=\"field-label\" [for]=\"instanceId + '-share-link'\">{{ 'core.component.file-explorer.share.link' | sdTranslate }}</label>\n <input\n #shareInput\n class=\"field-input\"\n readonly\n [id]=\"instanceId + '-share-link'\"\n [value]=\"_shareState.url\"\n [attr.aria-describedby]=\"instanceId + '-share-feedback'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-link' : null\"\n (focus)=\"shareInput.select()\" />\n <p class=\"share-feedback\" role=\"status\" aria-live=\"polite\" [id]=\"instanceId + '-share-feedback'\">{{ shareFeedbackLabel() }}</p>\n }\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"close-button\"\n type=\"text\"\n color=\"secondary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n [title]=\"'core.component.file-explorer.close' | sdTranslate\"\n (click)=\"closeShare()\" />\n @if (_shareState.status === 'error') {\n <sd-button\n class=\"retry-button\"\n type=\"outline\"\n color=\"primary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n prefixIcon=\"refresh\"\n [title]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (click)=\"retryShare()\" />\n } @else {\n <sd-button\n #copyButton\n class=\"copy-button\"\n type=\"fill\"\n color=\"primary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n prefixIcon=\"content_copy\"\n [title]=\"\n (shareFeedback() === 'copied' ? 'core.component.file-explorer.share.copied' : 'core.component.file-explorer.share.copy')\n | sdTranslate\n \"\n [disabled]=\"_shareState.status !== 'ready'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-copy' : null\"\n (click)=\"copyShareLink()\" />\n }\n </div>\n </div>\n}\n", styles: [":host{--sd-fe-accent: var(--sd-file-explorer-accent, var(--sd-primary, #005cbb));--sd-fe-accent-strong: var( --sd-file-explorer-accent-strong, color-mix(in srgb, var(--sd-fe-accent) 84%, var(--sd-file-explorer-mix-shade, #000000)) );--sd-fe-accent-contrast: var(--sd-file-explorer-accent-contrast, var(--sd-primary-contrast, #ffffff));--sd-fe-accent-soft: var( --sd-file-explorer-accent-soft, color-mix(in srgb, var(--sd-fe-accent) 10%, var(--sd-file-explorer-mix-tint, var(--sd-fe-surface))) );--sd-fe-surface: var(--sd-file-explorer-surface, var(--sd-surface, #ffffff));--sd-fe-sidebar-bg: var(--sd-file-explorer-sidebar-bg, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 26%, var(--sd-fe-surface)));--sd-fe-muted-surface: var( --sd-file-explorer-muted-surface, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 50%, var(--sd-fe-surface)) );--sd-fe-preview-bg: var( --sd-file-explorer-preview-bg, color-mix(in srgb, var(--sd-fe-accent) 9%, var(--sd-file-explorer-mix-tint, var(--sd-fe-surface))) );--sd-fe-border: var( --sd-file-explorer-border, color-mix(in srgb, var(--sd-border, #c4c6d0) 55%, var(--sd-file-explorer-mix-tint, var(--sd-fe-surface))) );--sd-fe-border-strong: var(--sd-file-explorer-border-strong, var(--sd-border, #c4c6d0));--sd-fe-text: var(--sd-file-explorer-text, var(--sd-text, #1a1b1f));--sd-fe-text-secondary: var( --sd-file-explorer-text-secondary, color-mix(in srgb, var(--sd-text-secondary, #44474f) 84%, var(--sd-file-explorer-mix-tint, var(--sd-fe-surface))) );--sd-fe-hover: color-mix(in srgb, var(--sd-fe-text) 4%, transparent);--sd-fe-hover-strong: color-mix(in srgb, var(--sd-fe-text) 8%, transparent);--sd-fe-track: color-mix(in srgb, var(--sd-fe-text) 7%, var(--sd-fe-surface));--sd-fe-success: var(--sd-file-explorer-success, var(--sd-success, #2e7d32));--sd-fe-error: var(--sd-file-explorer-error, var(--sd-error, #ba1a1a));--sd-fe-radius: var(--sd-file-explorer-radius, 16px);--sd-fe-scrim: var(--sd-file-explorer-scrim, rgba(0, 0, 0, .4));--sd-side-drawer-contained-z-index: 9;position:relative;display:flex;flex-direction:column;height:100%;min-height:480px;overflow:hidden;border:1px solid var(--sd-fe-border);border-radius:var(--sd-fe-radius);background:var(--sd-fe-surface);color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.header{display:grid;grid-template-columns:fit-content(320px) minmax(0,1fr) auto;align-items:center;gap:12px 20px;padding:16px 20px;border-bottom:1px solid var(--sd-fe-border)}.brand{grid-column:1;display:flex;align-items:center;gap:10px;min-width:0}.brand-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--sd-fe-accent) 14%,var(--sd-file-explorer-mix-tint, var(--sd-fe-surface)));color:var(--sd-fe-accent)}.brand-text{min-width:0}.brand-title{margin:0;overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);text-overflow:ellipsis;white-space:nowrap}.brand-description{margin:0;overflow:hidden;font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);color:var(--sd-fe-text-secondary);text-overflow:ellipsis;white-space:nowrap}.search{grid-column:2;justify-self:center;display:flex;align-items:center;gap:8px;width:100%;max-width:520px;height:36px;padding:0 6px 0 12px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-muted-surface);transition:border-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease}.search:focus-within{border-color:var(--sd-fe-accent);background:var(--sd-fe-surface);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.search-icon{flex:none;color:var(--sd-fe-text-secondary)}.search-input{flex:1;min-width:0;height:100%;padding:0;border:0;outline:none;background:transparent;color:var(--sd-fe-text);font:inherit;font-size:var(--sd-font-size-14, 14px)}.search-input::placeholder{color:var(--sd-fe-text-secondary)}.search-input::-webkit-search-cancel-button{display:none}.search-clear{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.search-clear:hover{background:var(--sd-fe-hover-strong)}.upload-button{grid-column:3;justify-self:end}.file-input{display:none}.body{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:238px minmax(0,1fr)}.sidebar{display:flex;flex-direction:column;min-height:0;padding:22px 14px 32px 12px;border-right:1px solid var(--sd-fe-border);background:var(--sd-fe-sidebar-bg)}.sidebar-label{margin:0 0 6px 10px;font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-16, 16px);letter-spacing:.04em;text-transform:uppercase;color:var(--sd-fe-text-secondary)}.sidebar-tree{flex:1;min-height:0;margin:0 -4px;padding:2px 4px;overflow-y:auto}.sidebar-footer{margin:12px 4px 0;padding-top:18px;border-top:1px solid var(--sd-fe-border)}.new-folder-button{display:block}.main{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;padding-top:14px}.refresh-bar{position:absolute;top:0;left:0;right:0;height:2px;overflow:hidden;background:var(--sd-fe-accent-soft)}.refresh-bar:after{content:\"\";position:absolute;top:0;bottom:0;width:30%;background:var(--sd-fe-accent);animation:sd-file-explorer-refresh 1.2s ease-in-out infinite}.toolbar{display:flex;align-items:center;gap:12px;min-height:40px;padding:0 32px}.breadcrumb{flex:1;min-width:0;margin-left:-4px;font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-semibold, 600)}.view-toggle{flex:none;display:flex;gap:2px;padding:2px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-surface)}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-file-explorer-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.icon-button--toggle{width:40px;height:32px}.icon-button--active,.icon-button--active:hover{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent)}.count{flex:none;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary)}.selection{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin:10px 28px 0;padding:6px 8px 6px 10px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-12, 12px);background:var(--sd-file-explorer-muted-surface, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 50%, var(--sd-file-explorer-mix-tint, var(--sd-fe-surface))))}.selection-summary{display:flex;align-items:center;gap:4px;min-width:0}.selection-status{min-width:0;color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-20, 20px);overflow-wrap:anywhere}.selection-count{font-weight:var(--sd-font-weight-semibold, 600)}.icon-button.selection-clear{width:32px;height:32px}.icon-button.selection-clear:disabled{cursor:default;opacity:.45}.icon-button.selection-clear:disabled:hover{background:transparent}:host(.sd-file-explorer--touch) .icon-button.selection-clear{width:var(--sd-space-48, 48px);height:var(--sd-space-48, 48px)}.selection-actions{flex:0 1 auto;justify-content:flex-end;gap:16px 8px;margin-inline-start:auto}.selection-actions:empty{display:none}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-success.c-light,:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-success.c-text{color:var(--sd-status-success-fg, var(--sd-success-dark))}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-success.c-light .mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic circle,:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-success.c-text .mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic circle{stroke:var(--sd-status-success-fg, var(--sd-success-dark))!important}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-warning.c-light,:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-warning.c-text{color:var(--sd-status-warning-fg, var(--sd-warning-dark))}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-warning.c-light .mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic circle,:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-warning.c-text .mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic circle{stroke:var(--sd-status-warning-fg, var(--sd-warning-dark))!important}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-primary.c-text{--mat-text-button-state-layer-color: var(--sd-file-explorer-mix-tint, var(--sd-fe-surface));--mat-button-text-state-layer-color: var(--mat-text-button-state-layer-color)}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-success.c-text{--mat-text-button-state-layer-color: var(--sd-file-explorer-mix-tint, var(--sd-fe-surface));--mat-button-text-state-layer-color: var(--mat-text-button-state-layer-color)}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-info.c-text{--mat-text-button-state-layer-color: var(--sd-file-explorer-mix-tint, var(--sd-fe-surface));--mat-button-text-state-layer-color: var(--mat-text-button-state-layer-color)}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-warning.c-text{--mat-text-button-state-layer-color: var(--sd-file-explorer-mix-tint, var(--sd-fe-surface));--mat-button-text-state-layer-color: var(--mat-text-button-state-layer-color)}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-error.c-text{--mat-text-button-state-layer-color: var(--sd-file-explorer-mix-tint, var(--sd-fe-surface));--mat-button-text-state-layer-color: var(--mat-text-button-state-layer-color)}.scroller{flex:1;min-height:0;padding:8px 28px 16px;overflow-y:auto}.scrim{position:absolute;inset:0;background:var(--sd-fe-scrim);animation:sd-file-explorer-fade .18s ease}.transfers{flex:none;border-top:1px solid var(--sd-fe-border);background:var(--sd-fe-surface)}.drop-overlay{position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:16px;border:2px dashed var(--sd-fe-accent);border-radius:var(--sd-fe-radius);background:color-mix(in srgb,var(--sd-fe-accent) 8%,color-mix(in srgb,var(--sd-fe-surface) 86%,transparent));pointer-events:none}.drop-card{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--sd-fe-accent);text-align:center}.drop-title{margin:0;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600)}.dialog-backdrop{position:absolute;inset:0;z-index:20;background:var(--sd-fe-scrim)}.dialog{position:absolute;top:50%;left:50%;z-index:21;display:flex;flex-direction:column;gap:8px;width:min(400px,100% - 32px);padding:20px;border-radius:14px;background:var(--sd-fe-surface);box-shadow:0 18px 48px #0f172a2e;transform:translate(-50%,-50%)}.dialog:focus{outline:none}.dialog-title{margin:0 0 8px;font-size:17px;font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-24, 24px)}.field-label{font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary)}.field-input{height:40px;padding:0 12px;border:1px solid var(--sd-file-explorer-border-strong, var(--sd-control-border, var(--sd-fe-border-strong)));border-radius:var(--sd-control-radius, 8px);background:var(--sd-fe-surface);color:var(--sd-fe-text);font:inherit;font-size:var(--sd-font-size-15, 15px);outline:none}.field-input:hover{border-color:var(--sd-control-border-hover, var(--sd-fe-border-strong))}.field-input:focus{border-color:var(--sd-fe-accent);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}@media(forced-colors:active){.field-input:focus{--sd-fe-focus-ring: Highlight;outline:2px solid var(--sd-fe-focus-ring);outline-offset:2px}}.field-input[aria-invalid=true]{border-color:var(--sd-fe-error)}.field-error{margin:0;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-error)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.share-status{display:flex;align-items:center;gap:10px;margin:4px 0;font-size:var(--sd-font-size-14, 14px);color:var(--sd-fe-text-secondary)}.share-feedback{min-height:18px;margin:0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-fe-success)}.spinner{flex:none;width:18px;height:18px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-spin .8s linear infinite}:host(.sd-file-explorer--compact) .header{grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;padding:12px 14px}:host(.sd-file-explorer--compact) .brand{grid-row:1;gap:10px}:host(.sd-file-explorer--compact) .upload-button{grid-column:2;grid-row:1}:host(.sd-file-explorer--compact) .search{grid-column:1/-1;grid-row:2;max-width:none}:host(.sd-file-explorer--compact) .header:not(:has(.brand)) .search{grid-column:1;grid-row:1}:host(.sd-file-explorer--compact) .body{grid-template-columns:minmax(0,1fr)}:host(.sd-file-explorer--compact) .sidebar{position:absolute;top:0;bottom:0;left:0;z-index:5;width:min(300px,86%);border-right:1px solid var(--sd-fe-border);box-shadow:12px 0 32px #0f172a1f;visibility:hidden;transform:translate(-100%);transition:transform var(--sd-duration-base, .2s) ease,visibility var(--sd-duration-base, .2s)}:host(.sd-file-explorer--compact) .sidebar--open{visibility:visible;transform:none}:host(.sd-file-explorer--compact) .scrim--sidebar{z-index:4}:host(.sd-file-explorer--compact) .main{padding-top:8px}:host(.sd-file-explorer--compact) .toolbar{gap:6px;min-height:36px;padding:0 12px 0 10px}:host(.sd-file-explorer--compact) .breadcrumb{margin-left:0}:host(.sd-file-explorer--compact) .icon-button--toggle{width:36px}:host(.sd-file-explorer--compact) .heading-row{margin-top:13px;padding:0 14px}:host(.sd-file-explorer--compact) .count{padding-bottom:8px}:host(.sd-file-explorer--compact) .selection{margin:8px 12px 4px}:host(.sd-file-explorer--compact) .selection-summary{flex:1 1 100%;justify-content:space-between}:host(.sd-file-explorer--compact) .selection-actions{flex-basis:100%;justify-content:flex-start;margin-inline-start:0;padding-top:8px;border-top:1px solid var(--sd-fe-border)}:host(.sd-file-explorer--compact) .scroller{padding:0 12px 12px}@keyframes sd-file-explorer-spin{to{transform:rotate(360deg)}}@keyframes sd-file-explorer-fade{0%{opacity:0}}@keyframes sd-file-explorer-refresh{0%{left:-30%}to{left:100%}}@media(prefers-reduced-motion:reduce){.scrim{animation:none}.search,:host(.sd-file-explorer--compact) .sidebar{transition:none}}.move-status{display:block;margin:8px 16px;color:var(--sd-fe-text-secondary)}.move-picker{box-sizing:border-box;max-height:min(80vh,100% - 32px);overflow-y:auto}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdBreadcrumb, selector: "sd-breadcrumb", inputs: ["items", "maxItems", "ariaLabel", "separator"], outputs: ["sdItemActivate"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdInform, selector: "sd-inform", inputs: ["type", "color", "primary", "secondary", "info", "success", "warning", "error", "title", "description", "icon", "hideIcon", "iconShape", "fontSet", "closable", "actionLabel", "lineClamp", "autoId"], outputs: ["sdClosed", "sdAction"] }, { kind: "directive", type: SdInformActionDirective, selector: "[sdInformAction]" }, { kind: "component", type: SdDataState, selector: "sd-data-state", inputs: ["state", "title", "message", "icon", "fontSet", "iconShape", "retryable", "retryLabel", "actionLabel", "compact", "fullPage"], outputs: ["sdRetry", "sdAction"] }, { kind: "component", type: SdFileExplorerActions, selector: "sd-file-explorer-actions", inputs: ["actions", "context", "defaultLeafType", "defaultGroupType", "defaultColor", "size", "source", "autoId"] }, { kind: "component", type: SdFileExplorerCommandSheet, selector: "sd-file-explorer-command-sheet", inputs: ["sheet", "touch", "autoId"], outputs: ["activate", "close"] }, { kind: "component", type: SdFileExplorerFolderTree, selector: "sd-file-explorer-folder-tree", inputs: ["moveDropTarget", "nodes", "label", "commands", "touch", "compact", "menuOpenId"], outputs: ["select", "toggle", "retry", "openCommands"] }, { kind: "component", type: SdFileExplorerItemList, selector: "sd-file-explorer-item-list", inputs: ["canMove", "moveDropTarget", "movePending", "columns", "items", "view", "canDownload", "canShare", "compact", "touch", "activeId", "label", "selection", "fileCommands", "folderCommands", "menuOpenId"], outputs: ["move", "activate", "openCommands", "download", "share", "toggleSelect", "toggleSelectAll"] }, { kind: "component", type: SdFileExplorerPreviewPanel, selector: "sd-file-explorer-preview-panel", inputs: ["view", "state", "meta", "canDownload", "canShare", "compact", "container", "autoId"], outputs: ["close", "download", "share", "retry", "imageError"] }, { kind: "component", type: SdFileExplorerTransferPanel, selector: "sd-file-explorer-transfer-panel", inputs: ["transfers", "title", "collapsed", "canClear", "compact", "autoId"], outputs: ["toggleCollapsed", "clear", "cancel", "retry", "dismiss"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2606
4700
  }
2607
4701
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdFileExplorer, decorators: [{
2608
4702
  type: Component,
2609
4703
  args: [{ selector: 'sd-file-explorer', standalone: true, imports: [
4704
+ A11yModule,
4705
+ MatTooltip,
2610
4706
  SdIcon,
2611
4707
  SdTranslatePipe,
2612
4708
  SdBreadcrumb,
2613
4709
  SdButton,
4710
+ SdInform,
4711
+ SdInformActionDirective,
2614
4712
  SdDataState,
4713
+ SdFileExplorerActions,
4714
+ SdFileExplorerCommandSheet,
2615
4715
  SdFileExplorerFolderTree,
2616
4716
  SdFileExplorerItemList,
2617
4717
  SdFileExplorerPreviewPanel,
@@ -2619,19 +4719,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
2619
4719
  ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
2620
4720
  class: 'sd-file-explorer',
2621
4721
  '[class.sd-file-explorer--compact]': 'compact()',
4722
+ '[class.sd-file-explorer--touch]': 'touch()',
2622
4723
  '[class.sd-file-explorer--dragging]': 'dragActive()',
2623
4724
  '[attr.data-autoid]': 'autoId()',
2624
4725
  '(dragenter)': 'onDragEnter($event)',
2625
4726
  '(dragover)': 'onDragOver($event)',
2626
4727
  '(dragleave)': 'onDragLeave()',
2627
4728
  '(drop)': 'onDrop($event)',
4729
+ '(dragstart)': 'onMoveDragStart($event)',
4730
+ '(dragend)': 'onMoveDragEnd()',
2628
4731
  '(keydown.escape)': 'onEscape($event)',
2629
- }, template: "@let _option = option();\n@let _compact = compact();\n@let _autoId = autoId();\n@let _canUpload = canUpload();\n@let _canDownload = canDownload();\n@let _view = view();\n@let _state = contentState();\n@let _keyword = keyword();\n@let _sidebarOpen = sidebarOpen();\n@let _preview = previewView();\n@let _transfers = transferViews();\n@let _heading = heading();\n@let _searching = searching();\n@let _collapsed = transfersCollapsed();\n@let _dialogOpen = folderDialogOpen();\n@let _shareItem = shareItem();\n@let _canShare = canShare();\n@let _modalOpen = _dialogOpen || !!_shareItem;\n\n<header class=\"header\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_option.title) {\n <div class=\"brand\">\n <span class=\"brand-icon\" aria-hidden=\"true\">\n <sd-icon name=\"folder\" size=\"20px\" />\n </span>\n <div class=\"brand-text\">\n <h2 class=\"brand-title\" [title]=\"_option.title\">{{ _option.title }}</h2>\n @if (_option.description) {\n <p class=\"brand-description\">{{ _option.description }}</p>\n }\n </div>\n </div>\n }\n\n <div class=\"search\" role=\"search\">\n <sd-icon class=\"search-icon\" name=\"search\" size=\"20px\" />\n <input\n #searchInput\n type=\"search\"\n class=\"search-input\"\n autocomplete=\"off\"\n [value]=\"_keyword\"\n [placeholder]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.aria-label]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-search' : null\"\n (input)=\"onKeywordInput(searchInput.value)\" />\n @if (_keyword) {\n <button\n type=\"button\"\n class=\"search-clear\"\n [attr.aria-label]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n [title]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\" />\n </button>\n }\n </div>\n\n @if (_canUpload) {\n <sd-button\n class=\"upload-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"file_upload\"\n [title]=\"_compact ? undefined : ('core.component.file-explorer.upload' | sdTranslate)\"\n [tooltip]=\"_compact ? ('core.component.file-explorer.upload' | sdTranslate) : undefined\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-upload' : null\"\n (click)=\"fileInput.click()\" />\n <input\n #fileInput\n type=\"file\"\n class=\"file-input\"\n multiple\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-file-input' : null\"\n (change)=\"onFilesPicked(fileInput)\" />\n }\n</header>\n\n<!-- why: dialog ph\u1EE7 c\u1EA3 explorer n\u00EAn l\u00E0m inert c\u1EA3 v\u00F9ng n\u00E0y, k\u1EC3 c\u1EA3 drawer chi ti\u1EBFt \u0111ang n\u1EB1m trong .main. -->\n<div class=\"body\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_compact && _sidebarOpen) {\n <div class=\"scrim scrim--sidebar\" aria-hidden=\"true\" (click)=\"sidebarOpen.set(false)\"></div>\n }\n <aside\n #sidebar\n class=\"sidebar\"\n [class.sidebar--open]=\"_sidebarOpen\"\n [id]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"'core.component.file-explorer.folders' | sdTranslate\"\n [attr.inert]=\"_compact && !_sidebarOpen ? '' : null\">\n <p class=\"sidebar-label\">{{ 'core.component.file-explorer.folders' | sdTranslate }}</p>\n <div class=\"sidebar-tree\">\n <sd-file-explorer-folder-tree\n [nodes]=\"treeNodes()\"\n [label]=\"'core.component.file-explorer.tree-label' | sdTranslate\"\n (select)=\"onTreeSelect($event)\"\n (toggle)=\"onTreeToggle($event)\"\n (retry)=\"onTreeRetry($event)\" />\n </div>\n @if (canCreateFolder()) {\n <div class=\"sidebar-footer\">\n <sd-button\n #newFolderButton\n class=\"new-folder-button\"\n type=\"outline\"\n color=\"secondary\"\n size=\"md\"\n prefixIcon=\"add\"\n block\n [title]=\"'core.component.file-explorer.new-folder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-new-folder' : null\"\n (click)=\"openFolderDialog()\" />\n </div>\n }\n </aside>\n\n <!-- why: .main l\u00E0 [container] c\u1EE7a drawer chi ti\u1EBFt \u2014 backdrop ch\u1EC9 ph\u1EE7 v\u00F9ng b\u00EAn ph\u1EA3i, c\u00E2y th\u01B0 m\u1EE5c v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c.\n Drawer n\u1EB1m TRONG ph\u1EA7n t\u1EED n\u00E0y n\u00EAn inert \u0111\u1EB7t tr\u00EAn t\u1EEBng kh\u1ED1i con, kh\u00F4ng \u0111\u1EB7t tr\u00EAn .main. -->\n <section #mainRegion class=\"main\" [attr.aria-label]=\"_heading\">\n @if (refreshing()) {\n <div class=\"refresh-bar\" aria-hidden=\"true\"></div>\n }\n <div class=\"toolbar\" [attr.inert]=\"_preview ? '' : null\">\n @if (_compact) {\n <button\n type=\"button\"\n class=\"icon-button\"\n [attr.aria-expanded]=\"_sidebarOpen\"\n [attr.aria-controls]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"\n (_sidebarOpen ? 'core.component.file-explorer.close-folders' : 'core.component.file-explorer.open-folders') | sdTranslate\n \"\n [attr.data-autoid]=\"_autoId ? _autoId + '-menu' : null\"\n (click)=\"toggleSidebar()\">\n <sd-icon name=\"menu\" size=\"24px\" />\n </button>\n }\n <sd-breadcrumb\n class=\"breadcrumb\"\n [items]=\"breadcrumb().items\"\n [maxItems]=\"_compact ? 3 : 5\"\n [ariaLabel]=\"'core.component.file-explorer.breadcrumb' | sdTranslate\"\n (sdItemActivate)=\"onBreadcrumb($event)\" />\n <div class=\"view-toggle\" role=\"group\" [attr.aria-label]=\"'core.component.file-explorer.view' | sdTranslate\">\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'list'\"\n [attr.aria-pressed]=\"_view === 'list'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-list' : null\"\n (click)=\"setView('list')\">\n <sd-icon name=\"format_list_bulleted\" size=\"24px\" />\n </button>\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'grid'\"\n [attr.aria-pressed]=\"_view === 'grid'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-grid' : null\"\n (click)=\"setView('grid')\">\n <sd-icon name=\"grid_view\" size=\"24px\" />\n </button>\n </div>\n </div>\n\n <div class=\"heading-row\" [attr.inert]=\"_preview ? '' : null\">\n <h3 class=\"heading\" [title]=\"_heading\">{{ _heading }}</h3>\n @if (_state === 'items') {\n <span class=\"count\">{{ itemCountLabel() }}</span>\n }\n </div>\n\n <div class=\"scroller\" [attr.inert]=\"_preview ? '' : null\">\n @switch (_state) {\n @case ('loading') {\n <sd-data-state\n state=\"loading\"\n compact\n [title]=\"(_searching ? 'core.component.file-explorer.search-loading' : 'core.component.file-explorer.loading') | sdTranslate\" />\n }\n @case ('error') {\n <sd-data-state\n state=\"error\"\n retryable\n [title]=\"(_searching ? 'core.component.file-explorer.search-error' : 'core.component.file-explorer.load-error') | sdTranslate\"\n [message]=\"errorMessage()\"\n [retryLabel]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (sdRetry)=\"retryContent()\" />\n }\n @case ('empty') {\n <sd-data-state\n state=\"empty\"\n [icon]=\"_searching ? 'search_off' : 'folder_open'\"\n [title]=\"emptyTitle()\"\n [message]=\"emptyMessage()\" />\n }\n @default {\n <sd-file-explorer-item-list\n [items]=\"itemViews()\"\n [view]=\"_view\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [compact]=\"_compact\"\n [activeId]=\"_preview ? _preview.item.id : null\"\n [label]=\"_heading\"\n (activate)=\"onActivate($event)\"\n (download)=\"downloadItem($event.item)\"\n (share)=\"openShare($event.item)\" />\n }\n }\n </div>\n </section>\n</div>\n\n@if (_transfers.length) {\n <sd-file-explorer-transfer-panel\n class=\"transfers\"\n [attr.inert]=\"_modalOpen ? '' : null\"\n [transfers]=\"_transfers\"\n [title]=\"transfersTitle()\"\n [collapsed]=\"_collapsed\"\n [canClear]=\"canClearTransfers()\"\n [compact]=\"_compact\"\n [autoId]=\"_autoId ? _autoId + '-transfers' : undefined\"\n (toggleCollapsed)=\"transfersCollapsed.set(!_collapsed)\"\n (clear)=\"clearFinishedTransfers()\"\n (cancel)=\"cancelTransfer($event)\"\n (retry)=\"retryTransfer($event)\"\n (dismiss)=\"dismissTransfer($event)\" />\n}\n\n<!-- why: chi ti\u1EBFt file l\u00E0 sd-side-drawer th\u1EADt, m\u1EDF g\u1ECDn trong v\u00F9ng danh s\u00E1ch b\u00EAn ph\u1EA3i nh\u1EDD [container]:\n header (t\u00ECm ki\u1EBFm, t\u1EA3i l\u00EAn), c\u00E2y th\u01B0 m\u1EE5c v\u00E0 h\u00E0ng ch\u1EDD truy\u1EC1n t\u1EA3i v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c khi drawer m\u1EDF. -->\n<sd-file-explorer-preview-panel\n [view]=\"_preview\"\n [state]=\"previewState()\"\n [meta]=\"previewMeta()\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [container]=\"mainRegion\"\n [autoId]=\"_autoId ? _autoId + '-preview' : undefined\"\n (close)=\"closePreview()\"\n (download)=\"downloadPreview()\"\n (share)=\"sharePreview()\"\n (retry)=\"retryPreview()\"\n (imageError)=\"onPreviewImageError()\" />\n\n@if (dragActive()) {\n <div class=\"drop-overlay\" aria-hidden=\"true\">\n <div class=\"drop-card\">\n <sd-icon name=\"file_upload\" size=\"40px\" />\n <p class=\"drop-title\">{{ dropTitle() }}</p>\n </div>\n </div>\n}\n\n@if (_dialogOpen) {\n @let _folderName = folderName();\n @let _folderError = folderError();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeFolderDialog()\"></div>\n <form\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n novalidate\n [attr.aria-labelledby]=\"instanceId + '-folder-title'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-dialog' : null\"\n (submit)=\"submitFolder($event)\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-folder-title'\">{{ folderDialogTitle() }}</h3>\n <label class=\"field-label\" [for]=\"instanceId + '-folder-name'\">{{\n 'core.component.file-explorer.new-folder-name' | sdTranslate\n }}</label>\n <input\n #folderInput\n class=\"field-input\"\n autocomplete=\"off\"\n maxlength=\"255\"\n [id]=\"instanceId + '-folder-name'\"\n [value]=\"_folderName\"\n [attr.aria-invalid]=\"_folderError ? true : null\"\n [attr.aria-describedby]=\"_folderError ? instanceId + '-folder-error' : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-name' : null\"\n (input)=\"folderName.set(folderInput.value)\" />\n @if (_folderError) {\n <p class=\"field-error\" role=\"alert\" [id]=\"instanceId + '-folder-error'\">{{ _folderError }}</p>\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"cancel-button\"\n type=\"text\"\n color=\"secondary\"\n size=\"md\"\n [title]=\"'core.component.file-explorer.cancel' | sdTranslate\"\n (click)=\"closeFolderDialog()\" />\n <sd-button\n class=\"submit-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n htmlType=\"submit\"\n [title]=\"'core.component.file-explorer.create' | sdTranslate\"\n [disabled]=\"!_folderName.trim()\"\n [loading]=\"folderSubmitting()\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-submit' : null\" />\n </div>\n </form>\n}\n\n@if (_shareItem) {\n @let _shareState = shareState();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeShare()\"></div>\n <div\n #shareDialog\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"instanceId + '-share-title'\"\n [attr.aria-busy]=\"_shareState.status === 'loading' ? true : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-dialog' : null\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-share-title'\" [title]=\"_shareItem.name\">{{ shareTitle() }}</h3>\n @switch (_shareState.status) {\n @case ('loading') {\n <p class=\"share-status\" role=\"status\">\n <span class=\"spinner\" aria-hidden=\"true\"></span>\n {{ 'core.component.file-explorer.share.loading' | sdTranslate }}\n </p>\n }\n @case ('error') {\n <p class=\"field-error\" role=\"alert\">{{ _shareState.message }}</p>\n }\n @case ('ready') {\n <label class=\"field-label\" [for]=\"instanceId + '-share-link'\">{{ 'core.component.file-explorer.share.link' | sdTranslate }}</label>\n <input\n #shareInput\n class=\"field-input\"\n readonly\n [id]=\"instanceId + '-share-link'\"\n [value]=\"_shareState.url\"\n [attr.aria-describedby]=\"instanceId + '-share-feedback'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-link' : null\"\n (focus)=\"shareInput.select()\" />\n <p class=\"share-feedback\" role=\"status\" aria-live=\"polite\" [id]=\"instanceId + '-share-feedback'\">{{ shareFeedbackLabel() }}</p>\n }\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"close-button\"\n type=\"text\"\n color=\"secondary\"\n size=\"md\"\n [title]=\"'core.component.file-explorer.close' | sdTranslate\"\n (click)=\"closeShare()\" />\n @if (_shareState.status === 'error') {\n <sd-button\n class=\"retry-button\"\n type=\"outline\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"refresh\"\n [title]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (click)=\"retryShare()\" />\n } @else {\n <sd-button\n #copyButton\n class=\"copy-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"content_copy\"\n [title]=\"\n (shareFeedback() === 'copied' ? 'core.component.file-explorer.share.copied' : 'core.component.file-explorer.share.copy')\n | sdTranslate\n \"\n [disabled]=\"_shareState.status !== 'ready'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-copy' : null\"\n (click)=\"copyShareLink()\" />\n }\n </div>\n </div>\n}\n", styles: [":host{--sd-fe-accent: var(--sd-file-explorer-accent, var(--sd-primary, #005cbb));--sd-fe-accent-strong: var(--sd-file-explorer-accent-strong, color-mix(in srgb, var(--sd-fe-accent) 84%, var(--sd-file-explorer-mix-shade, #000000)));--sd-fe-accent-contrast: var(--sd-file-explorer-accent-contrast, var(--sd-primary-contrast, #ffffff));--sd-fe-accent-soft: var(--sd-file-explorer-accent-soft, color-mix(in srgb, var(--sd-fe-accent) 10%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-surface: var(--sd-file-explorer-surface, #ffffff);--sd-fe-sidebar-bg: var(--sd-file-explorer-sidebar-bg, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 26%, var(--sd-fe-surface)));--sd-fe-muted-surface: var( --sd-file-explorer-muted-surface, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 50%, var(--sd-fe-surface)) );--sd-fe-preview-bg: var(--sd-file-explorer-preview-bg, color-mix(in srgb, var(--sd-fe-accent) 9%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-border: var(--sd-file-explorer-border, color-mix(in srgb, var(--sd-border, #c4c6d0) 55%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-border-strong: var(--sd-file-explorer-border-strong, var(--sd-border, #c4c6d0));--sd-fe-text: var(--sd-file-explorer-text, var(--sd-text, #1a1b1f));--sd-fe-text-secondary: var(--sd-file-explorer-text-secondary, color-mix(in srgb, var(--sd-text-secondary, #44474f) 84%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-hover: color-mix(in srgb, var(--sd-fe-text) 4%, transparent);--sd-fe-hover-strong: color-mix(in srgb, var(--sd-fe-text) 8%, transparent);--sd-fe-track: color-mix(in srgb, var(--sd-fe-text) 7%, var(--sd-fe-surface));--sd-fe-success: var(--sd-file-explorer-success, var(--sd-success, #2e7d32));--sd-fe-error: var(--sd-file-explorer-error, var(--sd-error, #ba1a1a));--sd-fe-radius: var(--sd-file-explorer-radius, 16px);--sd-fe-scrim: var(--sd-file-explorer-scrim, rgba(0, 0, 0, .4));--sd-side-drawer-contained-z-index: 9;position:relative;display:flex;flex-direction:column;height:100%;min-height:480px;overflow:hidden;border:1px solid var(--sd-fe-border);border-radius:var(--sd-fe-radius);background:var(--sd-fe-surface);color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.header{display:grid;grid-template-columns:fit-content(320px) minmax(0,1fr) auto;align-items:center;gap:12px 20px;padding:16px 20px;border-bottom:1px solid var(--sd-fe-border)}.brand{grid-column:1;display:flex;align-items:center;gap:10px;min-width:0}.brand-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--sd-fe-accent) 14%,var(--sd-file-explorer-mix-tint, #ffffff));color:var(--sd-fe-accent)}.brand-text{min-width:0}.brand-title{margin:0;overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);text-overflow:ellipsis;white-space:nowrap}.brand-description{margin:0;overflow:hidden;font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);color:var(--sd-fe-text-secondary);text-overflow:ellipsis;white-space:nowrap}.search{grid-column:2;justify-self:center;display:flex;align-items:center;gap:8px;width:100%;max-width:520px;height:36px;padding:0 6px 0 12px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-muted-surface);transition:border-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease}.search:focus-within{border-color:var(--sd-fe-accent);background:var(--sd-fe-surface);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.search-icon{flex:none;color:var(--sd-fe-text-secondary)}.search-input{flex:1;min-width:0;height:100%;padding:0;border:0;outline:none;background:transparent;color:var(--sd-fe-text);font:inherit;font-size:var(--sd-font-size-14, 14px)}.search-input::placeholder{color:var(--sd-fe-text-secondary)}.search-input::-webkit-search-cancel-button{display:none}.search-clear{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.search-clear:hover{background:var(--sd-fe-hover-strong)}.upload-button{grid-column:3;justify-self:end}.file-input{display:none}.body{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:238px minmax(0,1fr)}.sidebar{display:flex;flex-direction:column;min-height:0;padding:22px 14px 32px 12px;border-right:1px solid var(--sd-fe-border);background:var(--sd-fe-sidebar-bg)}.sidebar-label{margin:0 0 6px 10px;font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-16, 16px);letter-spacing:.04em;text-transform:uppercase;color:var(--sd-fe-text-secondary)}.sidebar-tree{flex:1;min-height:0;margin:0 -4px;padding:2px 4px;overflow-y:auto}.sidebar-footer{margin:12px 4px 0;padding-top:18px;border-top:1px solid var(--sd-fe-border)}.new-folder-button{display:block}.main{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;padding-top:14px}.refresh-bar{position:absolute;top:0;left:0;right:0;height:2px;overflow:hidden;background:var(--sd-fe-accent-soft)}.refresh-bar:after{content:\"\";position:absolute;top:0;bottom:0;width:30%;background:var(--sd-fe-accent);animation:sd-file-explorer-refresh 1.2s ease-in-out infinite}.toolbar{display:flex;align-items:center;gap:12px;min-height:40px;padding:0 32px}.breadcrumb{flex:1;min-width:0;margin-left:-4px;font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-semibold, 600)}.view-toggle{flex:none;display:flex;gap:2px;padding:2px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-surface)}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-file-explorer-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.icon-button--toggle{width:40px;height:32px}.icon-button--active,.icon-button--active:hover{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent)}.heading-row{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-top:10px;padding:0 32px}.heading{min-width:0;margin:0;overflow:hidden;font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-bold, 700);line-height:26px;text-overflow:ellipsis;white-space:nowrap}.count{flex:none;padding-bottom:12px;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary)}.scroller{flex:1;min-height:0;padding:8px 28px 16px;overflow-y:auto}.scrim{position:absolute;inset:0;background:var(--sd-fe-scrim);animation:sd-file-explorer-fade .18s ease}.transfers{flex:none;border-top:1px solid var(--sd-fe-border);background:var(--sd-fe-surface)}.drop-overlay{position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:16px;border:2px dashed var(--sd-fe-accent);border-radius:var(--sd-fe-radius);background:color-mix(in srgb,var(--sd-fe-accent) 8%,rgba(255,255,255,.86));pointer-events:none}.drop-card{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--sd-fe-accent);text-align:center}.drop-title{margin:0;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600)}.dialog-backdrop{position:absolute;inset:0;z-index:20;background:var(--sd-fe-scrim)}.dialog{position:absolute;top:50%;left:50%;z-index:21;display:flex;flex-direction:column;gap:8px;width:min(400px,100% - 32px);padding:20px;border-radius:14px;background:var(--sd-fe-surface);box-shadow:0 18px 48px #0f172a2e;transform:translate(-50%,-50%)}.dialog:focus{outline:none}.dialog-title{margin:0 0 8px;font-size:17px;font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-24, 24px)}.field-label{font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary)}.field-input{height:40px;padding:0 12px;border:1px solid var(--sd-fe-border-strong);border-radius:var(--sd-radius-8, 8px);background:var(--sd-fe-surface);color:var(--sd-fe-text);font:inherit;font-size:var(--sd-font-size-15, 15px);outline:none}.field-input:focus{border-color:var(--sd-fe-accent);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.field-input[aria-invalid=true]{border-color:var(--sd-fe-error)}.field-error{margin:0;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-error)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.share-status{display:flex;align-items:center;gap:10px;margin:4px 0;font-size:var(--sd-font-size-14, 14px);color:var(--sd-fe-text-secondary)}.share-feedback{min-height:18px;margin:0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-fe-success)}.spinner{flex:none;width:18px;height:18px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-spin .8s linear infinite}:host(.sd-file-explorer--compact) .header{grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;padding:12px 14px}:host(.sd-file-explorer--compact) .brand{grid-row:1;gap:10px}:host(.sd-file-explorer--compact) .upload-button{grid-column:2;grid-row:1}:host(.sd-file-explorer--compact) .search{grid-column:1/-1;grid-row:2;max-width:none}:host(.sd-file-explorer--compact) .header:not(:has(.brand)) .search{grid-column:1;grid-row:1}:host(.sd-file-explorer--compact) .body{grid-template-columns:minmax(0,1fr)}:host(.sd-file-explorer--compact) .sidebar{position:absolute;top:0;bottom:0;left:0;z-index:5;width:min(300px,86%);border-right:1px solid var(--sd-fe-border);box-shadow:12px 0 32px #0f172a1f;visibility:hidden;transform:translate(-100%);transition:transform var(--sd-duration-base, .2s) ease,visibility var(--sd-duration-base, .2s)}:host(.sd-file-explorer--compact) .sidebar--open{visibility:visible;transform:none}:host(.sd-file-explorer--compact) .scrim--sidebar{z-index:4}:host(.sd-file-explorer--compact) .main{padding-top:8px}:host(.sd-file-explorer--compact) .toolbar{gap:6px;min-height:36px;padding:0 12px 0 10px}:host(.sd-file-explorer--compact) .breadcrumb{margin-left:0}:host(.sd-file-explorer--compact) .icon-button--toggle{width:36px}:host(.sd-file-explorer--compact) .heading-row{margin-top:13px;padding:0 14px}:host(.sd-file-explorer--compact) .count{padding-bottom:8px}:host(.sd-file-explorer--compact) .scroller{padding:0 12px 12px}@keyframes sd-file-explorer-spin{to{transform:rotate(360deg)}}@keyframes sd-file-explorer-fade{0%{opacity:0}}@keyframes sd-file-explorer-refresh{0%{left:-30%}to{left:100%}}@media(prefers-reduced-motion:reduce){.scrim{animation:none}.search,:host(.sd-file-explorer--compact) .sidebar{transition:none}}\n"] }]
2630
- }], ctorParameters: () => [], propDecorators: { option: [{ type: i0.Input, args: [{ isSignal: true, alias: "option", required: true }] }], open: [{ type: i0.Output, args: ["open"] }], searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], folderInput: [{ type: i0.ViewChild, args: ['folderInput', { isSignal: true }] }], newFolderButton: [{ type: i0.ViewChild, args: ['newFolderButton', { ...{ read: ElementRef }, isSignal: true }] }], copyButton: [{ type: i0.ViewChild, args: ['copyButton', { ...{ read: ElementRef }, isSignal: true }] }], shareInput: [{ type: i0.ViewChild, args: ['shareInput', { isSignal: true }] }], shareDialog: [{ type: i0.ViewChild, args: ['shareDialog', { isSignal: true }] }], sidebar: [{ type: i0.ViewChild, args: ['sidebar', { isSignal: true }] }] } });
4732
+ }, template: "@let _option = option();\n@let _compact = compact();\n@let _autoId = autoId();\n@let _canUpload = canUpload();\n@let _canDownload = canDownload();\n@let _view = view();\n@let _state = contentState();\n@let _keyword = keyword();\n@let _sidebarOpen = sidebarOpen();\n@let _preview = previewView();\n@let _transfers = transferViews();\n@let _heading = heading();\n@let _searching = searching();\n@let _collapsed = transfersCollapsed();\n@let _dialogOpen = folderDialogOpen();\n@let _shareItem = shareItem();\n@let _canShare = canShare();\n@let _modalOpen = _dialogOpen || !!_shareItem || !!movePickerItems();\n@let _touch = touch();\n@let _rowShortcuts = rowShortcuts();\n\n<header class=\"header\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_option.title) {\n <div class=\"brand\">\n <span class=\"brand-icon\" aria-hidden=\"true\">\n <sd-icon name=\"folder\" size=\"20px\" />\n </span>\n <div class=\"brand-text\">\n <h2 class=\"brand-title\" [title]=\"_option.title\">{{ _option.title }}</h2>\n @if (_option.description) {\n <p class=\"brand-description\">{{ _option.description }}</p>\n }\n </div>\n </div>\n }\n\n <div class=\"search\" role=\"search\">\n <sd-icon class=\"search-icon\" name=\"search\" size=\"20px\" />\n <input\n #searchInput\n type=\"search\"\n class=\"search-input\"\n autocomplete=\"off\"\n [value]=\"_keyword\"\n [placeholder]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.aria-label]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-search' : null\"\n (input)=\"onKeywordInput(searchInput.value)\" />\n @if (_keyword) {\n <button\n type=\"button\"\n class=\"search-clear\"\n [attr.aria-label]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n [title]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\" />\n </button>\n }\n </div>\n\n @if (_canUpload) {\n <sd-button\n class=\"upload-button\"\n [disabled]=\"uploadDisabled()\"\n [attr.aria-description]=\"uploadDisabled() ? ('core.component.file-explorer.action-unavailable' | sdTranslate) : null\"\n type=\"fill\"\n color=\"primary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n prefixIcon=\"file_upload\"\n [title]=\"_compact ? undefined : ('core.component.file-explorer.upload' | sdTranslate)\"\n [tooltip]=\"_compact ? ('core.component.file-explorer.upload' | sdTranslate) : undefined\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-upload' : null\"\n (click)=\"fileInput.click()\" />\n <input\n #fileInput\n type=\"file\"\n class=\"file-input\"\n multiple\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-file-input' : null\"\n (change)=\"onFilesPicked(fileInput)\" />\n }\n</header>\n\n@if (moveStatus()) {\n <sd-inform class=\"move-status\" color=\"secondary\" [hideIcon]=\"true\" [title]=\"moveStatus()!\">\n @if (moveRefreshError()) {\n <sd-button\n sdInformAction\n class=\"move-retry-button\"\n type=\"light\"\n color=\"primary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n htmlType=\"button\"\n [title]=\"'core.component.file-explorer.move.retry-refresh' | sdTranslate\"\n [disabled]=\"movePending()\"\n (click)=\"retryMoveRefresh()\" />\n }\n </sd-inform>\n}\n\n<!-- why: dialog ph\u1EE7 c\u1EA3 explorer n\u00EAn l\u00E0m inert c\u1EA3 v\u00F9ng n\u00E0y, k\u1EC3 c\u1EA3 drawer chi ti\u1EBFt \u0111ang n\u1EB1m trong .main. -->\n<div class=\"body\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_compact && _sidebarOpen) {\n <div class=\"scrim scrim--sidebar\" aria-hidden=\"true\" (click)=\"sidebarOpen.set(false)\"></div>\n }\n <aside\n #sidebar\n class=\"sidebar\"\n [class.sidebar--open]=\"_sidebarOpen\"\n [id]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"'core.component.file-explorer.folders' | sdTranslate\"\n [attr.inert]=\"_compact && !_sidebarOpen ? '' : null\">\n <p class=\"sidebar-label\">{{ 'core.component.file-explorer.folders' | sdTranslate }}</p>\n <div class=\"sidebar-tree\">\n <sd-file-explorer-folder-tree\n [nodes]=\"treeNodes()\"\n [moveDropTarget]=\"moveDropTarget()\"\n [label]=\"'core.component.file-explorer.tree-label' | sdTranslate\"\n [commands]=\"_option.folderCommands\"\n [touch]=\"_touch\"\n [compact]=\"_compact\"\n [menuOpenId]=\"treeMenuOpenId()\"\n (select)=\"onTreeSelect($event)\"\n (toggle)=\"onTreeToggle($event)\"\n (retry)=\"onTreeRetry($event)\"\n (openCommands)=\"openCommands($event.item, 'tree', $event.trigger)\" />\n </div>\n @if (canCreateFolder()) {\n <div class=\"sidebar-footer\">\n <sd-button\n #newFolderButton\n class=\"new-folder-button\"\n [disabled]=\"createDisabled()\"\n [attr.aria-description]=\"createDisabled() ? ('core.component.file-explorer.action-unavailable' | sdTranslate) : null\"\n type=\"outline\"\n color=\"secondary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n prefixIcon=\"add\"\n block\n [title]=\"'core.component.file-explorer.new-folder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-new-folder' : null\"\n (click)=\"openFolderDialog()\" />\n </div>\n }\n </aside>\n\n <!-- why: .main l\u00E0 [container] c\u1EE7a drawer chi ti\u1EBFt \u2014 backdrop ch\u1EC9 ph\u1EE7 v\u00F9ng b\u00EAn ph\u1EA3i, c\u00E2y th\u01B0 m\u1EE5c v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c.\n Drawer n\u1EB1m TRONG ph\u1EA7n t\u1EED n\u00E0y n\u00EAn inert \u0111\u1EB7t tr\u00EAn t\u1EEBng kh\u1ED1i con, kh\u00F4ng \u0111\u1EB7t tr\u00EAn .main. -->\n <section #mainRegion class=\"main\" [attr.aria-label]=\"_heading\">\n @if (refreshing()) {\n <div class=\"refresh-bar\" aria-hidden=\"true\"></div>\n }\n <div class=\"toolbar\" [attr.inert]=\"_preview ? '' : null\">\n @if (_compact) {\n <button\n type=\"button\"\n class=\"icon-button\"\n [attr.aria-expanded]=\"_sidebarOpen\"\n [attr.aria-controls]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"\n (_sidebarOpen ? 'core.component.file-explorer.close-folders' : 'core.component.file-explorer.open-folders') | sdTranslate\n \"\n [attr.data-autoid]=\"_autoId ? _autoId + '-menu' : null\"\n (click)=\"toggleSidebar()\">\n <sd-icon name=\"menu\" size=\"24px\" />\n </button>\n }\n <sd-breadcrumb\n class=\"breadcrumb\"\n [items]=\"breadcrumb().items\"\n [maxItems]=\"_compact ? 3 : 5\"\n [ariaLabel]=\"'core.component.file-explorer.breadcrumb' | sdTranslate\"\n (sdItemActivate)=\"onBreadcrumb($event)\" />\n @if (_state === 'items') {\n <span class=\"count\">{{ itemCountLabel() }}</span>\n }\n <div class=\"view-toggle\" role=\"group\" [attr.aria-label]=\"'core.component.file-explorer.view' | sdTranslate\">\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'list'\"\n [attr.aria-pressed]=\"_view === 'list'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-list' : null\"\n (click)=\"setView('list')\">\n <sd-icon name=\"format_list_bulleted\" size=\"24px\" />\n </button>\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'grid'\"\n [attr.aria-pressed]=\"_view === 'grid'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-grid' : null\"\n (click)=\"setView('grid')\">\n <sd-icon name=\"grid_view\" size=\"24px\" />\n </button>\n </div>\n </div>\n\n @let _selection = selectionView();\n @if (_selection && selectedItems().length) {\n @let _selected = selectedItems();\n @let _selectedCount = _selected.length;\n @let _summary = selectionSummary();\n @let _clearLabel = 'core.component.file-explorer.selection.clear' | sdTranslate;\n <!-- why: one band for list and grid. The select-all checkbox lives in the list header / above the grid, not here. -->\n <div\n class=\"selection\"\n role=\"group\"\n [class.selection--active]=\"_selectedCount > 0\"\n [attr.aria-label]=\"'core.component.file-explorer.selection.label' | sdTranslate\"\n [attr.inert]=\"_preview ? '' : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-selection' : null\">\n <div class=\"selection-summary\">\n <!-- why: one plain sentence in the translated word order (\"2 t\u1EC7p \u0111\u00E3 ch\u1ECDn\", \"\u5DF2\u9009\u62E9 2 \u4E2A\u6587\u4EF6\"); only the number is\n heavier. Each part sits in its own span: the markup whitespace between spans is dropped, so the sentence\n keeps exactly the spaces of its translation (\"2\u4EF6\u2026\" stays joined). -->\n <span class=\"selection-status\" role=\"status\">\n <span>{{ _summary.before }}</span>\n @if (_summary.count) {\n <span class=\"selection-count\">{{ _summary.count }}</span>\n }\n <span>{{ _summary.after }}</span>\n </span>\n <button\n type=\"button\"\n class=\"icon-button selection-clear\"\n [disabled]=\"!_selectedCount\"\n [attr.aria-label]=\"_clearLabel\"\n [matTooltip]=\"_clearLabel\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-selection-clear' : null\"\n (click)=\"clearSelection()\">\n <sd-icon name=\"close\" size=\"20px\" />\n </button>\n </div>\n @if (_selectedCount && selectionActions().length) {\n <!-- why: unset types follow the kind (light flat action, text group trigger). sd-button's own sizes: 32 px like the\n row commands, 48 px only on a wide touch layout; a narrow layout keeps 32 px and spaces the lines instead. -->\n <sd-file-explorer-actions\n class=\"selection-actions\"\n source=\"selector.actions\"\n defaultLeafType=\"light\"\n defaultGroupType=\"text\"\n defaultColor=\"primary\"\n [actions]=\"selectionActions()\"\n [context]=\"_selected\"\n [size]=\"_touch && !_compact ? 'lg' : 'sm'\"\n [autoId]=\"_autoId ? _autoId + '-selection-action' : undefined\" />\n }\n </div>\n }\n\n <div class=\"scroller\" [attr.inert]=\"_preview ? '' : null\">\n @switch (_state) {\n @case ('loading') {\n <sd-data-state\n state=\"loading\"\n compact\n [title]=\"(_searching ? 'core.component.file-explorer.search-loading' : 'core.component.file-explorer.loading') | sdTranslate\" />\n }\n @case ('error') {\n <sd-data-state\n state=\"error\"\n retryable\n [title]=\"(_searching ? 'core.component.file-explorer.search-error' : 'core.component.file-explorer.load-error') | sdTranslate\"\n [message]=\"errorMessage()\"\n [retryLabel]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (sdRetry)=\"retryContent()\" />\n }\n @case ('empty') {\n <sd-data-state\n state=\"empty\"\n [icon]=\"_searching ? 'search_off' : 'folder_open'\"\n [title]=\"emptyTitle()\"\n [message]=\"emptyMessage()\" />\n }\n @default {\n <sd-file-explorer-item-list\n [columns]=\"columns()\"\n [moveDropTarget]=\"moveDropTarget()\"\n [canMove]=\"canMove()\"\n [movePending]=\"movePending()\"\n (move)=\"openMovePicker([$event])\"\n [items]=\"itemViews()\"\n [view]=\"_view\"\n [canDownload]=\"_canDownload && _rowShortcuts\"\n [canShare]=\"_canShare && _rowShortcuts\"\n [compact]=\"_compact\"\n [touch]=\"_touch\"\n [activeId]=\"_preview ? _preview.item.id : null\"\n [label]=\"_heading\"\n [selection]=\"_selection\"\n [fileCommands]=\"_option.fileCommands\"\n [folderCommands]=\"_option.folderCommands\"\n [menuOpenId]=\"itemsMenuOpenId()\"\n (activate)=\"onActivate($event)\"\n (download)=\"downloadItem($event.item)\"\n (share)=\"openShare($event.item)\"\n (toggleSelect)=\"toggleSelection($event)\"\n (toggleSelectAll)=\"toggleSelectAll()\"\n (openCommands)=\"openCommands($event.item, _view, $event.trigger)\" />\n }\n }\n </div>\n </section>\n</div>\n\n@if (_transfers.length) {\n <sd-file-explorer-transfer-panel\n class=\"transfers\"\n [attr.inert]=\"_modalOpen ? '' : null\"\n [transfers]=\"_transfers\"\n [title]=\"transfersTitle()\"\n [collapsed]=\"_collapsed\"\n [canClear]=\"canClearTransfers()\"\n [compact]=\"_compact\"\n [autoId]=\"_autoId ? _autoId + '-transfers' : undefined\"\n (toggleCollapsed)=\"transfersCollapsed.set(!_collapsed)\"\n (clear)=\"clearFinishedTransfers()\"\n (cancel)=\"cancelTransfer($event)\"\n (retry)=\"retryTransfer($event)\"\n (dismiss)=\"dismissTransfer($event)\" />\n}\n\n<!-- why: chi ti\u1EBFt file l\u00E0 sd-side-drawer th\u1EADt, m\u1EDF g\u1ECDn trong v\u00F9ng danh s\u00E1ch b\u00EAn ph\u1EA3i nh\u1EDD [container]:\n header (t\u00ECm ki\u1EBFm, t\u1EA3i l\u00EAn), c\u00E2y th\u01B0 m\u1EE5c v\u00E0 h\u00E0ng ch\u1EDD truy\u1EC1n t\u1EA3i v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c khi drawer m\u1EDF. -->\n<sd-file-explorer-preview-panel\n [view]=\"_preview\"\n [compact]=\"_compact\"\n [state]=\"previewState()\"\n [meta]=\"previewMeta()\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [container]=\"mainRegion\"\n [autoId]=\"_autoId ? _autoId + '-preview' : undefined\"\n (close)=\"closePreview()\"\n (download)=\"downloadPreview()\"\n (share)=\"sharePreview()\"\n (retry)=\"retryPreview()\"\n (imageError)=\"onPreviewImageError()\" />\n\n<!-- why: l\u1EC7nh c\u1EE7a m\u1ED9t m\u1EE5c tr\u00EAn layout h\u1EB9p m\u1EDF trong sd-side-drawer th\u1EADt c\u1EE7a Core (g\u1EAFn v\u00E0o <body>: backdrop, Esc, b\u1EABy focus,\n kho\u00E1 scroll trang) thay cho c\u00E1c n\u00FAt tr\u00EAn h\u00E0ng / th\u1EBB / n\u00FAt c\u00E2y. -->\n<sd-file-explorer-command-sheet\n [sheet]=\"commandSheet()\"\n [touch]=\"_touch\"\n [autoId]=\"_autoId ? _autoId + '-commands' : undefined\"\n (activate)=\"runCommand($event)\"\n (close)=\"onCommandsClosed()\" />\n\n@if (dragActive()) {\n <div class=\"drop-overlay\" aria-hidden=\"true\">\n <div class=\"drop-card\">\n <sd-icon name=\"file_upload\" size=\"40px\" />\n <p class=\"drop-title\">{{ dropTitle() }}</p>\n </div>\n </div>\n}\n\n@if (_dialogOpen) {\n @let _folderName = folderName();\n @let _folderError = folderError();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeFolderDialog()\"></div>\n <form\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n novalidate\n [attr.aria-labelledby]=\"instanceId + '-folder-title'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-dialog' : null\"\n (submit)=\"submitFolder($event)\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-folder-title'\">{{ folderDialogTitle() }}</h3>\n <label class=\"field-label\" [for]=\"instanceId + '-folder-name'\">{{\n 'core.component.file-explorer.new-folder-name' | sdTranslate\n }}</label>\n <input\n #folderInput\n class=\"field-input\"\n autocomplete=\"off\"\n maxlength=\"255\"\n [id]=\"instanceId + '-folder-name'\"\n [value]=\"_folderName\"\n [attr.aria-invalid]=\"_folderError ? true : null\"\n [attr.aria-describedby]=\"_folderError ? instanceId + '-folder-error' : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-name' : null\"\n (input)=\"folderName.set(folderInput.value)\" />\n @if (_folderError) {\n <sd-inform class=\"field-error\" color=\"error\" [hideIcon]=\"true\" [id]=\"instanceId + '-folder-error'\" [title]=\"_folderError\" />\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"cancel-button\"\n type=\"text\"\n color=\"secondary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n [title]=\"'core.component.file-explorer.cancel' | sdTranslate\"\n (click)=\"closeFolderDialog()\" />\n <sd-button\n class=\"submit-button\"\n type=\"fill\"\n color=\"primary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n htmlType=\"submit\"\n [title]=\"'core.component.file-explorer.create' | sdTranslate\"\n [disabled]=\"!_folderName.trim()\"\n [loading]=\"folderSubmitting()\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-submit' : null\" />\n </div>\n </form>\n}\n\n@if (movePickerItems()) {\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeMovePicker()\"></div>\n <section\n class=\"dialog move-picker\"\n role=\"dialog\"\n aria-modal=\"true\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown.tab)=\"$event.stopPropagation()\"\n (keydown.shift.tab)=\"$event.stopPropagation()\"\n [attr.aria-labelledby]=\"instanceId + '-move-title'\">\n <h3 cdkFocusInitial tabindex=\"-1\" [id]=\"instanceId + '-move-title'\">{{ 'core.component.file-explorer.move.to' | sdTranslate }}</h3>\n <sd-file-explorer-folder-tree\n [nodes]=\"movePickerNodes()\"\n [label]=\"'core.component.file-explorer.folders' | sdTranslate\"\n [touch]=\"_touch\"\n [compact]=\"false\"\n (select)=\"moveTarget.set($event.item)\"\n (toggle)=\"onTreeToggle($event)\"\n (retry)=\"onTreeRetry($event)\" />\n @if (!canSubmitMove() && !movePending()) {\n <sd-inform\n class=\"field-error move-destination-tip\"\n type=\"tip\"\n color=\"secondary\"\n [hideIcon]=\"true\"\n [title]=\"'core.component.file-explorer.move.destination-tip' | sdTranslate\" />\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"move-cancel-button\"\n type=\"text\"\n color=\"secondary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n htmlType=\"button\"\n [title]=\"'core.component.file-explorer.cancel' | sdTranslate\"\n (click)=\"closeMovePicker()\" />\n <sd-button\n class=\"move-submit-button\"\n type=\"fill\"\n color=\"primary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n htmlType=\"button\"\n [title]=\"'core.component.file-explorer.move.confirm' | sdTranslate\"\n [disabled]=\"!canSubmitMove()\"\n (click)=\"submitMoveFromEvent($event)\" />\n </div>\n </section>\n}\n\n@if (_shareItem) {\n @let _shareState = shareState();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeShare()\"></div>\n <div\n #shareDialog\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"instanceId + '-share-title'\"\n [attr.aria-busy]=\"_shareState.status === 'loading' ? true : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-dialog' : null\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-share-title'\" [title]=\"_shareItem.name\">{{ shareTitle() }}</h3>\n @switch (_shareState.status) {\n @case ('loading') {\n <p class=\"share-status\" role=\"status\">\n <span class=\"spinner\" aria-hidden=\"true\"></span>\n {{ 'core.component.file-explorer.share.loading' | sdTranslate }}\n </p>\n }\n @case ('error') {\n <sd-inform class=\"field-error\" color=\"error\" [hideIcon]=\"true\" [title]=\"_shareState.message\" />\n }\n @case ('ready') {\n <label class=\"field-label\" [for]=\"instanceId + '-share-link'\">{{ 'core.component.file-explorer.share.link' | sdTranslate }}</label>\n <input\n #shareInput\n class=\"field-input\"\n readonly\n [id]=\"instanceId + '-share-link'\"\n [value]=\"_shareState.url\"\n [attr.aria-describedby]=\"instanceId + '-share-feedback'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-link' : null\"\n (focus)=\"shareInput.select()\" />\n <p class=\"share-feedback\" role=\"status\" aria-live=\"polite\" [id]=\"instanceId + '-share-feedback'\">{{ shareFeedbackLabel() }}</p>\n }\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"close-button\"\n type=\"text\"\n color=\"secondary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n [title]=\"'core.component.file-explorer.close' | sdTranslate\"\n (click)=\"closeShare()\" />\n @if (_shareState.status === 'error') {\n <sd-button\n class=\"retry-button\"\n type=\"outline\"\n color=\"primary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n prefixIcon=\"refresh\"\n [title]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (click)=\"retryShare()\" />\n } @else {\n <sd-button\n #copyButton\n class=\"copy-button\"\n type=\"fill\"\n color=\"primary\"\n [size]=\"_compact ? 'sm' : 'md'\"\n prefixIcon=\"content_copy\"\n [title]=\"\n (shareFeedback() === 'copied' ? 'core.component.file-explorer.share.copied' : 'core.component.file-explorer.share.copy')\n | sdTranslate\n \"\n [disabled]=\"_shareState.status !== 'ready'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-copy' : null\"\n (click)=\"copyShareLink()\" />\n }\n </div>\n </div>\n}\n", styles: [":host{--sd-fe-accent: var(--sd-file-explorer-accent, var(--sd-primary, #005cbb));--sd-fe-accent-strong: var( --sd-file-explorer-accent-strong, color-mix(in srgb, var(--sd-fe-accent) 84%, var(--sd-file-explorer-mix-shade, #000000)) );--sd-fe-accent-contrast: var(--sd-file-explorer-accent-contrast, var(--sd-primary-contrast, #ffffff));--sd-fe-accent-soft: var( --sd-file-explorer-accent-soft, color-mix(in srgb, var(--sd-fe-accent) 10%, var(--sd-file-explorer-mix-tint, var(--sd-fe-surface))) );--sd-fe-surface: var(--sd-file-explorer-surface, var(--sd-surface, #ffffff));--sd-fe-sidebar-bg: var(--sd-file-explorer-sidebar-bg, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 26%, var(--sd-fe-surface)));--sd-fe-muted-surface: var( --sd-file-explorer-muted-surface, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 50%, var(--sd-fe-surface)) );--sd-fe-preview-bg: var( --sd-file-explorer-preview-bg, color-mix(in srgb, var(--sd-fe-accent) 9%, var(--sd-file-explorer-mix-tint, var(--sd-fe-surface))) );--sd-fe-border: var( --sd-file-explorer-border, color-mix(in srgb, var(--sd-border, #c4c6d0) 55%, var(--sd-file-explorer-mix-tint, var(--sd-fe-surface))) );--sd-fe-border-strong: var(--sd-file-explorer-border-strong, var(--sd-border, #c4c6d0));--sd-fe-text: var(--sd-file-explorer-text, var(--sd-text, #1a1b1f));--sd-fe-text-secondary: var( --sd-file-explorer-text-secondary, color-mix(in srgb, var(--sd-text-secondary, #44474f) 84%, var(--sd-file-explorer-mix-tint, var(--sd-fe-surface))) );--sd-fe-hover: color-mix(in srgb, var(--sd-fe-text) 4%, transparent);--sd-fe-hover-strong: color-mix(in srgb, var(--sd-fe-text) 8%, transparent);--sd-fe-track: color-mix(in srgb, var(--sd-fe-text) 7%, var(--sd-fe-surface));--sd-fe-success: var(--sd-file-explorer-success, var(--sd-success, #2e7d32));--sd-fe-error: var(--sd-file-explorer-error, var(--sd-error, #ba1a1a));--sd-fe-radius: var(--sd-file-explorer-radius, 16px);--sd-fe-scrim: var(--sd-file-explorer-scrim, rgba(0, 0, 0, .4));--sd-side-drawer-contained-z-index: 9;position:relative;display:flex;flex-direction:column;height:100%;min-height:480px;overflow:hidden;border:1px solid var(--sd-fe-border);border-radius:var(--sd-fe-radius);background:var(--sd-fe-surface);color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.header{display:grid;grid-template-columns:fit-content(320px) minmax(0,1fr) auto;align-items:center;gap:12px 20px;padding:16px 20px;border-bottom:1px solid var(--sd-fe-border)}.brand{grid-column:1;display:flex;align-items:center;gap:10px;min-width:0}.brand-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--sd-fe-accent) 14%,var(--sd-file-explorer-mix-tint, var(--sd-fe-surface)));color:var(--sd-fe-accent)}.brand-text{min-width:0}.brand-title{margin:0;overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);text-overflow:ellipsis;white-space:nowrap}.brand-description{margin:0;overflow:hidden;font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);color:var(--sd-fe-text-secondary);text-overflow:ellipsis;white-space:nowrap}.search{grid-column:2;justify-self:center;display:flex;align-items:center;gap:8px;width:100%;max-width:520px;height:36px;padding:0 6px 0 12px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-muted-surface);transition:border-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease}.search:focus-within{border-color:var(--sd-fe-accent);background:var(--sd-fe-surface);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.search-icon{flex:none;color:var(--sd-fe-text-secondary)}.search-input{flex:1;min-width:0;height:100%;padding:0;border:0;outline:none;background:transparent;color:var(--sd-fe-text);font:inherit;font-size:var(--sd-font-size-14, 14px)}.search-input::placeholder{color:var(--sd-fe-text-secondary)}.search-input::-webkit-search-cancel-button{display:none}.search-clear{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.search-clear:hover{background:var(--sd-fe-hover-strong)}.upload-button{grid-column:3;justify-self:end}.file-input{display:none}.body{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:238px minmax(0,1fr)}.sidebar{display:flex;flex-direction:column;min-height:0;padding:22px 14px 32px 12px;border-right:1px solid var(--sd-fe-border);background:var(--sd-fe-sidebar-bg)}.sidebar-label{margin:0 0 6px 10px;font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-16, 16px);letter-spacing:.04em;text-transform:uppercase;color:var(--sd-fe-text-secondary)}.sidebar-tree{flex:1;min-height:0;margin:0 -4px;padding:2px 4px;overflow-y:auto}.sidebar-footer{margin:12px 4px 0;padding-top:18px;border-top:1px solid var(--sd-fe-border)}.new-folder-button{display:block}.main{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;padding-top:14px}.refresh-bar{position:absolute;top:0;left:0;right:0;height:2px;overflow:hidden;background:var(--sd-fe-accent-soft)}.refresh-bar:after{content:\"\";position:absolute;top:0;bottom:0;width:30%;background:var(--sd-fe-accent);animation:sd-file-explorer-refresh 1.2s ease-in-out infinite}.toolbar{display:flex;align-items:center;gap:12px;min-height:40px;padding:0 32px}.breadcrumb{flex:1;min-width:0;margin-left:-4px;font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-semibold, 600)}.view-toggle{flex:none;display:flex;gap:2px;padding:2px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-surface)}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-file-explorer-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.icon-button--toggle{width:40px;height:32px}.icon-button--active,.icon-button--active:hover{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent)}.count{flex:none;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary)}.selection{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin:10px 28px 0;padding:6px 8px 6px 10px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-12, 12px);background:var(--sd-file-explorer-muted-surface, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 50%, var(--sd-file-explorer-mix-tint, var(--sd-fe-surface))))}.selection-summary{display:flex;align-items:center;gap:4px;min-width:0}.selection-status{min-width:0;color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-20, 20px);overflow-wrap:anywhere}.selection-count{font-weight:var(--sd-font-weight-semibold, 600)}.icon-button.selection-clear{width:32px;height:32px}.icon-button.selection-clear:disabled{cursor:default;opacity:.45}.icon-button.selection-clear:disabled:hover{background:transparent}:host(.sd-file-explorer--touch) .icon-button.selection-clear{width:var(--sd-space-48, 48px);height:var(--sd-space-48, 48px)}.selection-actions{flex:0 1 auto;justify-content:flex-end;gap:16px 8px;margin-inline-start:auto}.selection-actions:empty{display:none}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-success.c-light,:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-success.c-text{color:var(--sd-status-success-fg, var(--sd-success-dark))}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-success.c-light .mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic circle,:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-success.c-text .mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic circle{stroke:var(--sd-status-success-fg, var(--sd-success-dark))!important}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-warning.c-light,:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-warning.c-text{color:var(--sd-status-warning-fg, var(--sd-warning-dark))}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-warning.c-light .mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic circle,:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-warning.c-text .mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic circle{stroke:var(--sd-status-warning-fg, var(--sd-warning-dark))!important}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-primary.c-text{--mat-text-button-state-layer-color: var(--sd-file-explorer-mix-tint, var(--sd-fe-surface));--mat-button-text-state-layer-color: var(--mat-text-button-state-layer-color)}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-success.c-text{--mat-text-button-state-layer-color: var(--sd-file-explorer-mix-tint, var(--sd-fe-surface));--mat-button-text-state-layer-color: var(--mat-text-button-state-layer-color)}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-info.c-text{--mat-text-button-state-layer-color: var(--sd-file-explorer-mix-tint, var(--sd-fe-surface));--mat-button-text-state-layer-color: var(--mat-text-button-state-layer-color)}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-warning.c-text{--mat-text-button-state-layer-color: var(--sd-file-explorer-mix-tint, var(--sd-fe-surface));--mat-button-text-state-layer-color: var(--mat-text-button-state-layer-color)}:host .selection-actions ::ng-deep sd-button>button.c-button:not([disabled]).mat-error.c-text{--mat-text-button-state-layer-color: var(--sd-file-explorer-mix-tint, var(--sd-fe-surface));--mat-button-text-state-layer-color: var(--mat-text-button-state-layer-color)}.scroller{flex:1;min-height:0;padding:8px 28px 16px;overflow-y:auto}.scrim{position:absolute;inset:0;background:var(--sd-fe-scrim);animation:sd-file-explorer-fade .18s ease}.transfers{flex:none;border-top:1px solid var(--sd-fe-border);background:var(--sd-fe-surface)}.drop-overlay{position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:16px;border:2px dashed var(--sd-fe-accent);border-radius:var(--sd-fe-radius);background:color-mix(in srgb,var(--sd-fe-accent) 8%,color-mix(in srgb,var(--sd-fe-surface) 86%,transparent));pointer-events:none}.drop-card{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--sd-fe-accent);text-align:center}.drop-title{margin:0;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600)}.dialog-backdrop{position:absolute;inset:0;z-index:20;background:var(--sd-fe-scrim)}.dialog{position:absolute;top:50%;left:50%;z-index:21;display:flex;flex-direction:column;gap:8px;width:min(400px,100% - 32px);padding:20px;border-radius:14px;background:var(--sd-fe-surface);box-shadow:0 18px 48px #0f172a2e;transform:translate(-50%,-50%)}.dialog:focus{outline:none}.dialog-title{margin:0 0 8px;font-size:17px;font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-24, 24px)}.field-label{font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary)}.field-input{height:40px;padding:0 12px;border:1px solid var(--sd-file-explorer-border-strong, var(--sd-control-border, var(--sd-fe-border-strong)));border-radius:var(--sd-control-radius, 8px);background:var(--sd-fe-surface);color:var(--sd-fe-text);font:inherit;font-size:var(--sd-font-size-15, 15px);outline:none}.field-input:hover{border-color:var(--sd-control-border-hover, var(--sd-fe-border-strong))}.field-input:focus{border-color:var(--sd-fe-accent);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}@media(forced-colors:active){.field-input:focus{--sd-fe-focus-ring: Highlight;outline:2px solid var(--sd-fe-focus-ring);outline-offset:2px}}.field-input[aria-invalid=true]{border-color:var(--sd-fe-error)}.field-error{margin:0;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-error)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.share-status{display:flex;align-items:center;gap:10px;margin:4px 0;font-size:var(--sd-font-size-14, 14px);color:var(--sd-fe-text-secondary)}.share-feedback{min-height:18px;margin:0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-fe-success)}.spinner{flex:none;width:18px;height:18px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-spin .8s linear infinite}:host(.sd-file-explorer--compact) .header{grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;padding:12px 14px}:host(.sd-file-explorer--compact) .brand{grid-row:1;gap:10px}:host(.sd-file-explorer--compact) .upload-button{grid-column:2;grid-row:1}:host(.sd-file-explorer--compact) .search{grid-column:1/-1;grid-row:2;max-width:none}:host(.sd-file-explorer--compact) .header:not(:has(.brand)) .search{grid-column:1;grid-row:1}:host(.sd-file-explorer--compact) .body{grid-template-columns:minmax(0,1fr)}:host(.sd-file-explorer--compact) .sidebar{position:absolute;top:0;bottom:0;left:0;z-index:5;width:min(300px,86%);border-right:1px solid var(--sd-fe-border);box-shadow:12px 0 32px #0f172a1f;visibility:hidden;transform:translate(-100%);transition:transform var(--sd-duration-base, .2s) ease,visibility var(--sd-duration-base, .2s)}:host(.sd-file-explorer--compact) .sidebar--open{visibility:visible;transform:none}:host(.sd-file-explorer--compact) .scrim--sidebar{z-index:4}:host(.sd-file-explorer--compact) .main{padding-top:8px}:host(.sd-file-explorer--compact) .toolbar{gap:6px;min-height:36px;padding:0 12px 0 10px}:host(.sd-file-explorer--compact) .breadcrumb{margin-left:0}:host(.sd-file-explorer--compact) .icon-button--toggle{width:36px}:host(.sd-file-explorer--compact) .heading-row{margin-top:13px;padding:0 14px}:host(.sd-file-explorer--compact) .count{padding-bottom:8px}:host(.sd-file-explorer--compact) .selection{margin:8px 12px 4px}:host(.sd-file-explorer--compact) .selection-summary{flex:1 1 100%;justify-content:space-between}:host(.sd-file-explorer--compact) .selection-actions{flex-basis:100%;justify-content:flex-start;margin-inline-start:0;padding-top:8px;border-top:1px solid var(--sd-fe-border)}:host(.sd-file-explorer--compact) .scroller{padding:0 12px 12px}@keyframes sd-file-explorer-spin{to{transform:rotate(360deg)}}@keyframes sd-file-explorer-fade{0%{opacity:0}}@keyframes sd-file-explorer-refresh{0%{left:-30%}to{left:100%}}@media(prefers-reduced-motion:reduce){.scrim{animation:none}.search,:host(.sd-file-explorer--compact) .sidebar{transition:none}}.move-status{display:block;margin:8px 16px;color:var(--sd-fe-text-secondary)}.move-picker{box-sizing:border-box;max-height:min(80vh,100% - 32px);overflow-y:auto}\n"] }]
4733
+ }], ctorParameters: () => [], propDecorators: { columnDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdFileExplorerColumnDef), { isSignal: true }] }], option: [{ type: i0.Input, args: [{ isSignal: true, alias: "option", required: true }] }], open: [{ type: i0.Output, args: ["open"] }], searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], folderInput: [{ type: i0.ViewChild, args: ['folderInput', { isSignal: true }] }], newFolderButton: [{ type: i0.ViewChild, args: ['newFolderButton', { ...{ read: ElementRef }, isSignal: true }] }], copyButton: [{ type: i0.ViewChild, args: ['copyButton', { ...{ read: ElementRef }, isSignal: true }] }], shareInput: [{ type: i0.ViewChild, args: ['shareInput', { isSignal: true }] }], shareDialog: [{ type: i0.ViewChild, args: ['shareDialog', { isSignal: true }] }], sidebar: [{ type: i0.ViewChild, args: ['sidebar', { isSignal: true }] }], commandDrawer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdFileExplorerCommandSheet), { isSignal: true }] }] } });
2631
4734
 
2632
4735
  /**
2633
4736
  * Generated bundle index. Do not edit.
2634
4737
  */
2635
4738
 
2636
- export { SdFileExplorer };
4739
+ export { SdFileExplorer, SdFileExplorerColumnDef };
2637
4740
  //# sourceMappingURL=sdcorejs-angular-components-file-explorer.mjs.map