@sdata/web-vue 1.14.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/dist/sd.css +364 -1
  2. package/dist/sd.min.css +1 -1
  3. package/es/_components/picker/input-range.vue.d.ts +2 -2
  4. package/es/_components/picker/input.vue.d.ts +1 -1
  5. package/es/_components/resize-trigger.vue_vue_type_script_lang.js +1 -1
  6. package/es/_components/select-view/select-view.d.ts +2 -2
  7. package/es/_components/virtual-list/virtual-list.vue.d.ts +3 -3
  8. package/es/_hooks/use-popup-manager.js +2 -4
  9. package/es/_utils/dom.d.ts +5 -2
  10. package/es/_utils/dom.js +1 -1
  11. package/es/anchor/anchor.vue.d.ts +2 -2
  12. package/es/anchor/index.d.ts +9 -9
  13. package/es/auto-complete/auto-complete.d.ts +3 -3
  14. package/es/auto-complete/index.d.ts +9 -9
  15. package/es/button/button.vue.d.ts +2 -2
  16. package/es/button/index.d.ts +6 -6
  17. package/es/calendar/calendar.d.ts +1 -1
  18. package/es/calendar/index.d.ts +3 -3
  19. package/es/card/card.d.ts +4 -4
  20. package/es/card/index.d.ts +9 -9
  21. package/es/carousel/carousel-arrow.vue.d.ts +1 -1
  22. package/es/carousel/carousel-indicator.vue.d.ts +1 -1
  23. package/es/carousel/carousel.d.ts +3 -3
  24. package/es/carousel/index.d.ts +9 -9
  25. package/es/cascader/base-cascader-panel.d.ts +1 -1
  26. package/es/cascader/cascader-search-panel.d.ts +1 -1
  27. package/es/cascader/cascader.vue.d.ts +14 -14
  28. package/es/checkbox/checkbox-group.d.ts +1 -1
  29. package/es/checkbox/index.d.ts +1 -1
  30. package/es/color-picker/color-picker.d.ts +5 -5
  31. package/es/color-picker/index.d.ts +15 -15
  32. package/es/color-picker/panel.d.ts +2 -2
  33. package/es/components.d.ts +1 -0
  34. package/es/config-provider/config-provider.vue.d.ts +8 -2
  35. package/es/config-provider/config-provider.vue_vue_type_script_lang.js +6 -0
  36. package/es/config-provider/context.d.ts +3 -0
  37. package/es/config-provider/index.d.ts +13 -3
  38. package/es/cropper/cropper.vue.d.ts +1 -1
  39. package/es/cropper/index.d.ts +3 -3
  40. package/es/date-picker/index.d.ts +94 -94
  41. package/es/date-picker/panels/date/index.vue.d.ts +15 -15
  42. package/es/date-picker/panels/footer.vue.d.ts +15 -15
  43. package/es/date-picker/panels/shortcuts.vue.d.ts +6 -6
  44. package/es/date-picker/panels/week/index.vue.d.ts +16 -16
  45. package/es/date-picker/picker-panel.vue.d.ts +54 -54
  46. package/es/date-picker/picker.vue.d.ts +87 -87
  47. package/es/date-picker/pickers/date-picker.d.ts +1 -1
  48. package/es/date-picker/pickers/week-picker.d.ts +1 -1
  49. package/es/date-picker/range-picker-panel.vue.d.ts +55 -55
  50. package/es/date-picker/range-picker.vue.d.ts +90 -90
  51. package/es/descriptions/descriptions.d.ts +1 -1
  52. package/es/descriptions/index.d.ts +3 -3
  53. package/es/drawer/drawer.vue.d.ts +11 -11
  54. package/es/drawer/index.d.ts +27 -27
  55. package/es/dropdown/dropdown-button.vue.d.ts +24 -24
  56. package/es/dropdown/dropdown-submenu.vue.d.ts +17 -17
  57. package/es/dropdown/dropdown.vue.d.ts +16 -16
  58. package/es/dropdown/index.d.ts +74 -74
  59. package/es/ellipsis/ellipsis.vue.d.ts +43 -43
  60. package/es/ellipsis/index.d.ts +182 -182
  61. package/es/ellipsis/performant-ellipsis.vue.d.ts +44 -44
  62. package/es/form/form-item-label.vue.d.ts +36 -36
  63. package/es/form/form-item.vue.d.ts +40 -40
  64. package/es/form/index.d.ts +40 -40
  65. package/es/grid/grid-row.vue.d.ts +3 -3
  66. package/es/grid/index.d.ts +3 -3
  67. package/es/image/image.vue.d.ts +38 -38
  68. package/es/image/preview-action.d.ts +36 -36
  69. package/es/image/preview-group.vue.d.ts +41 -41
  70. package/es/image/preview-toolbar.vue.d.ts +36 -36
  71. package/es/image/preview.vue.d.ts +38 -38
  72. package/es/index.css +364 -1
  73. package/es/index.d.ts +5 -1
  74. package/es/index.js +17 -15
  75. package/es/index.scss +1 -0
  76. package/es/input/index.d.ts +9 -9
  77. package/es/input/input-password.vue.d.ts +2 -2
  78. package/es/input/input-search.d.ts +1 -1
  79. package/es/input/input.d.ts +2 -2
  80. package/es/input-number/index.d.ts +9 -9
  81. package/es/input-number/input-number.d.ts +3 -3
  82. package/es/input-tag/index.d.ts +6 -6
  83. package/es/input-tag/input-tag.d.ts +2 -2
  84. package/es/json-form/index.d.ts +112 -0
  85. package/es/json-form/index.js +11 -0
  86. package/es/json-form/json-form-component.js +5 -0
  87. package/es/json-form/json-form-component.vue.d.ts +24 -0
  88. package/es/json-form/json-form-component.vue_vue_type_script_setup_true_lang.js +89 -0
  89. package/es/json-form/json-form-item.js +5 -0
  90. package/es/json-form/json-form-item.vue.d.ts +32 -0
  91. package/es/json-form/json-form-item.vue_vue_type_script_setup_true_lang.js +213 -0
  92. package/es/json-form/json-form.js +5 -0
  93. package/es/json-form/json-form.vue.d.ts +42 -0
  94. package/es/json-form/json-form.vue_vue_type_script_setup_true_lang.js +142 -0
  95. package/es/json-form/style/css.js +2 -0
  96. package/es/json-form/style/index.css +31 -0
  97. package/es/json-form/style/index.d.ts +2 -0
  98. package/es/json-form/style/index.js +2 -0
  99. package/es/json-form/style/index.scss +25 -0
  100. package/es/json-form/style/token.scss +8 -0
  101. package/es/json-form/types.d.ts +291 -0
  102. package/es/json-form/types.js +43 -0
  103. package/es/json-form/utils.d.ts +11 -0
  104. package/es/json-form/utils.js +336 -0
  105. package/es/layout/header.js +2 -18
  106. package/es/layout/header.vue.d.ts +38 -3
  107. package/es/layout/header.vue_vue_type_script_setup_true_lang.js +350 -0
  108. package/es/layout/index.d.ts +1029 -49
  109. package/es/layout/interface.d.ts +40 -0
  110. package/es/layout/sider.js +38 -9
  111. package/es/layout/sider.vue.d.ts +950 -39
  112. package/es/layout/sider.vue_vue_type_script_lang.js +304 -31
  113. package/es/layout/style/index.css +155 -1
  114. package/es/layout/style/index.scss +198 -16
  115. package/es/layout/style/token.scss +13 -0
  116. package/es/link/index.d.ts +9 -9
  117. package/es/link/link.vue.d.ts +3 -3
  118. package/es/list/index.d.ts +3 -3
  119. package/es/list/list.d.ts +1 -1
  120. package/es/mention/index.d.ts +12 -12
  121. package/es/mention/mention.d.ts +4 -4
  122. package/es/menu/base-menu.vue.d.ts +24 -5
  123. package/es/menu/base-menu.vue_vue_type_script_lang.js +19 -1
  124. package/es/menu/context.d.ts +1 -1
  125. package/es/menu/index.d.ts +1 -1
  126. package/es/menu/interface.d.ts +8 -0
  127. package/es/menu/item-group.js +9 -2
  128. package/es/menu/item-group.vue.d.ts +2894 -0
  129. package/es/menu/item-group.vue_vue_type_script_lang.js +7 -2
  130. package/es/menu/item.d.ts +1 -1
  131. package/es/menu/item.js +10 -3
  132. package/es/menu/menu.d.ts +54 -5
  133. package/es/menu/menu.js +8 -0
  134. package/es/menu/style/css.js +1 -0
  135. package/es/menu/style/index.css +194 -0
  136. package/es/menu/style/index.d.ts +1 -0
  137. package/es/menu/style/index.js +1 -0
  138. package/es/menu/style/index.scss +48 -1
  139. package/es/menu/sub-menu-inline.js +24 -3
  140. package/es/menu/sub-menu-inline.vue.d.ts +2894 -0
  141. package/es/menu/sub-menu-inline.vue_vue_type_script_lang.js +4 -1
  142. package/es/menu/sub-menu-pop.js +29 -2
  143. package/es/menu/sub-menu-pop.vue.d.ts +2924 -22
  144. package/es/menu/sub-menu-pop.vue_vue_type_script_lang.js +3 -1
  145. package/es/menu/sub-menu.d.ts +1 -1
  146. package/es/message/message-list.d.ts +1 -1
  147. package/es/message/message.vue.d.ts +1 -1
  148. package/es/modal/index.d.ts +27 -27
  149. package/es/modal/modal.vue.d.ts +11 -11
  150. package/es/notification/notification.vue.d.ts +1 -1
  151. package/es/overflow-list/index.d.ts +3 -3
  152. package/es/overflow-list/overflow-list.d.ts +1 -1
  153. package/es/pagination/page-jumper.vue.d.ts +9 -9
  154. package/es/pagination/page-options.vue.d.ts +66 -66
  155. package/es/popconfirm/index.d.ts +51 -51
  156. package/es/popconfirm/popconfirm.vue.d.ts +24 -24
  157. package/es/popover/index.d.ts +33 -33
  158. package/es/popover/popover.vue.d.ts +16 -16
  159. package/es/progress/circle.vue.d.ts +2 -2
  160. package/es/progress/index.d.ts +13 -13
  161. package/es/progress/line.vue.d.ts +1 -1
  162. package/es/progress/progress.vue.d.ts +6 -6
  163. package/es/progress/steps.vue.d.ts +2 -2
  164. package/es/radio/index.d.ts +4 -4
  165. package/es/radio/radio-group.d.ts +1 -1
  166. package/es/radio/radio.d.ts +1 -1
  167. package/es/sd-vue.js +17 -14
  168. package/es/select/index.d.ts +66 -66
  169. package/es/select/option.vue.d.ts +2 -2
  170. package/es/select/select-dropdown.vue.d.ts +4 -4
  171. package/es/select/select.d.ts +27 -27
  172. package/es/skeleton/index.d.ts +1 -1
  173. package/es/skeleton/shape.vue.d.ts +1 -1
  174. package/es/slider/index.d.ts +97 -97
  175. package/es/slider/slider-button.vue.d.ts +38 -38
  176. package/es/slider/slider-input.vue.d.ts +9 -9
  177. package/es/slider/slider.vue.d.ts +48 -48
  178. package/es/spin/index.d.ts +3 -3
  179. package/es/spin/spin.d.ts +1 -1
  180. package/es/statistic/index.d.ts +6 -6
  181. package/es/statistic/statistic.vue.d.ts +2 -2
  182. package/es/steps/index.d.ts +6 -6
  183. package/es/steps/steps.vue.d.ts +2 -2
  184. package/es/style/theme/z-index.d.ts +8 -0
  185. package/es/style/theme/z-index.js +7 -0
  186. package/es/switch/index.d.ts +21 -6
  187. package/es/switch/switch.vue.d.ts +11 -2
  188. package/es/switch/switch.vue_vue_type_script_lang.js +30 -5
  189. package/es/table/index.d.ts +15 -15
  190. package/es/table/table-operation-td.d.ts +5 -5
  191. package/es/table/table-th.js +1 -1
  192. package/es/table/table.d.ts +5 -5
  193. package/es/tabs/index.d.ts +9 -9
  194. package/es/tabs/tabs.d.ts +3 -3
  195. package/es/tag/index.d.ts +922 -922
  196. package/es/tag/tag.vue.d.ts +367 -367
  197. package/es/textarea/index.d.ts +6 -6
  198. package/es/textarea/textarea.vue.d.ts +2 -2
  199. package/es/time-picker/index.d.ts +104 -104
  200. package/es/time-picker/panel.vue.d.ts +14 -14
  201. package/es/time-picker/range-panel.d.ts +14 -14
  202. package/es/time-picker/time-picker.vue.d.ts +50 -50
  203. package/es/timeline/index.d.ts +9 -9
  204. package/es/timeline/timeline.d.ts +4 -4
  205. package/es/tooltip/index.d.ts +36 -36
  206. package/es/tooltip/tooltip.vue.d.ts +17 -17
  207. package/es/transfer/index.d.ts +37 -37
  208. package/es/transfer/transfer-list-item.d.ts +2 -2
  209. package/es/transfer/transfer-view.vue.d.ts +8 -8
  210. package/es/transfer/transfer-view.vue_vue_type_script_lang.js +1 -1
  211. package/es/transfer/transfer.vue.d.ts +17 -17
  212. package/es/tree/base-node.vue.d.ts +2 -2
  213. package/es/tree/base-node.vue_vue_type_script_lang.js +1 -1
  214. package/es/tree/node-switcher.vue_vue_type_script_lang.js +1 -1
  215. package/es/tree/transition-node-list.vue.d.ts +2 -2
  216. package/es/tree/tree.vue.d.ts +27 -27
  217. package/es/tree/tree.vue_vue_type_script_lang.js +3 -3
  218. package/es/tree-select/tree-select.vue.d.ts +30 -30
  219. package/es/tree-select/tree-select.vue_vue_type_script_lang.js +2 -2
  220. package/es/trigger/index.d.ts +15 -15
  221. package/es/trigger/trigger.d.ts +5 -5
  222. package/es/typography/base.d.ts +1 -1
  223. package/es/typography/edit-content.vue.d.ts +27 -27
  224. package/es/typography/operations.vue.d.ts +36 -36
  225. package/es/upload/index.d.ts +6 -6
  226. package/es/upload/upload-button.d.ts +1 -1
  227. package/es/upload/upload.d.ts +2 -2
  228. package/es/watermark/index.d.ts +3 -3
  229. package/es/watermark/watermark.d.ts +1 -1
  230. package/json/vetur-attributes.json +150 -7
  231. package/json/vetur-tags.json +45 -4
  232. package/json/web-types.json +316 -19
  233. package/package.json +2 -1
@@ -1,13 +1,25 @@
1
+ import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/objectSpread2.js";
1
2
  import { getPrefixCls } from "../_utils/global-config.js";
2
3
  import { isNumber } from "../_utils/is.js";
4
+ import { off, on } from "../_utils/dom.js";
3
5
  import useMergeState from "../_hooks/use-merge-state.js";
6
+ import { KEYBOARD_KEY } from "../_utils/keyboard.js";
7
+ import usePopupManager from "../_hooks/use-popup-manager.js";
4
8
  import IconRight from "../icon/icon-right/index.js";
5
9
  import IconLeft from "../icon/icon-left/index.js";
6
10
  import { LayoutSiderInjectionKey, SiderInjectionKey } from "./context.js";
7
11
  import { useResponsive } from "../_hooks/use-responsive.js";
8
12
  import ResizeBox from "../resize-box/index.js";
9
- import { computed, defineComponent, inject, onMounted, onUnmounted, provide, reactive, toRefs } from "vue";
10
- //#region components/layout/sider.vue?vue&type=script&lang.tsx
13
+ import { computed, defineComponent, inject, onMounted, onUnmounted, provide, reactive, toRefs, watch } from "vue";
14
+ //#region components/layout/sider.vue?vue&type=script&lang.ts
15
+ var SIDER_LOCATIONS = [
16
+ "start",
17
+ "end",
18
+ "left",
19
+ "right",
20
+ "top",
21
+ "bottom"
22
+ ];
11
23
  var generateId = (() => {
12
24
  let i = 0;
13
25
  return (prefix = "") => {
@@ -15,7 +27,7 @@ var generateId = (() => {
15
27
  return `${prefix}${i}`;
16
28
  };
17
29
  })();
18
- var sider_vue_vue_type_script_lang_default = /* @__PURE__ */ defineComponent({
30
+ var sider_vue_vue_type_script_lang_default = defineComponent({
19
31
  name: "LayoutSider",
20
32
  components: {
21
33
  IconLeft,
@@ -32,6 +44,22 @@ var sider_vue_vue_type_script_lang_default = /* @__PURE__ */ defineComponent({
32
44
  default: "light"
33
45
  },
34
46
  /**
47
+ * @zh 抽屉是否可见
48
+ * @en Whether navigation drawer is visible
49
+ */
50
+ modelValue: {
51
+ type: Boolean,
52
+ default: void 0
53
+ },
54
+ /**
55
+ * @zh 默认是否显示抽屉
56
+ * @en Whether navigation drawer is visible by default
57
+ */
58
+ defaultVisible: {
59
+ type: Boolean,
60
+ default: false
61
+ },
62
+ /**
35
63
  * @zh 当前收起状态
36
64
  * @en Current collapsed state
37
65
  */
@@ -43,21 +71,71 @@ var sider_vue_vue_type_script_lang_default = /* @__PURE__ */ defineComponent({
43
71
  * @zh 默认的收起状态
44
72
  * @en The default collapsed state
45
73
  */
46
- defaultCollapsed: { type: Boolean },
74
+ defaultCollapsed: {
75
+ type: Boolean,
76
+ default: false
77
+ },
47
78
  /**
48
79
  * @zh 是否可收起
49
80
  * @en Whether is collapsible
50
81
  */
51
82
  collapsible: { type: Boolean },
52
83
  /**
84
+ * @zh 是否启用 rail 模式
85
+ * @en Whether to enable rail mode
86
+ */
87
+ rail: {
88
+ type: Boolean,
89
+ default: void 0
90
+ },
91
+ /**
92
+ * @zh 默认是否启用 rail 模式
93
+ * @en Whether to enable rail mode by default
94
+ */
95
+ defaultRail: {
96
+ type: Boolean,
97
+ default: false
98
+ },
99
+ /**
100
+ * @zh rail 模式下的宽度
101
+ * @en Width in rail mode
102
+ */
103
+ railWidth: {
104
+ type: [Number, String],
105
+ default: 56
106
+ },
107
+ /**
108
+ * @zh 是否在 hover 时临时展开 rail
109
+ * @en Whether to expand rail on hover
110
+ */
111
+ expandOnHover: { type: Boolean },
112
+ /**
113
+ * @zh 是否禁用响应式宽度监听
114
+ * @en Whether to disable resize watcher
115
+ */
116
+ disableResizeWatcher: { type: Boolean },
117
+ /**
118
+ * @zh 是否禁用路由切换时自动关闭临时抽屉
119
+ * @en Whether to disable route watcher
120
+ */
121
+ disableRouteWatcher: { type: Boolean },
122
+ /**
53
123
  * @zh 宽度
54
124
  * @en Width
55
125
  */
56
126
  width: {
57
- type: Number,
127
+ type: [Number, String],
58
128
  default: 200
59
129
  },
60
130
  /**
131
+ * @zh 顶部或底部抽屉的高度
132
+ * @en Height of top or bottom drawer
133
+ */
134
+ height: {
135
+ type: [Number, String],
136
+ default: void 0
137
+ },
138
+ /**
61
139
  * @zh 收缩宽度
62
140
  * @en Collapsed width
63
141
  */
@@ -66,6 +144,64 @@ var sider_vue_vue_type_script_lang_default = /* @__PURE__ */ defineComponent({
66
144
  default: 48
67
145
  },
68
146
  /**
147
+ * @zh 是否为临时抽屉模式
148
+ * @en Whether to use temporary drawer mode
149
+ */
150
+ temporary: { type: Boolean },
151
+ /**
152
+ * @zh 是否始终显示抽屉
153
+ * @en Whether to always keep the drawer active
154
+ */
155
+ permanent: { type: Boolean },
156
+ /**
157
+ * @zh 临时抽屉模式下点击遮罩后是否保持显示
158
+ * @en Whether temporary drawer should stay open after scrim click
159
+ */
160
+ persistent: { type: Boolean },
161
+ /**
162
+ * @zh 是否显示遮罩层
163
+ * @en Whether to show the temporary drawer mask
164
+ */
165
+ mask: {
166
+ type: Boolean,
167
+ default: true
168
+ },
169
+ /**
170
+ * @zh 点击遮罩层是否可以关闭抽屉
171
+ * @en Whether the drawer can be closed by clicking the mask
172
+ */
173
+ maskClosable: {
174
+ type: Boolean,
175
+ default: true
176
+ },
177
+ /**
178
+ * @zh 是否支持通过 ESC 键关闭临时抽屉
179
+ * @en Whether temporary drawer can be closed with ESC
180
+ */
181
+ escToClose: {
182
+ type: Boolean,
183
+ default: true
184
+ },
185
+ /**
186
+ * @zh 抽屉停靠位置
187
+ * @en Navigation drawer location
188
+ */
189
+ location: {
190
+ type: String,
191
+ default: "start",
192
+ validator: (value) => SIDER_LOCATIONS.includes(value)
193
+ },
194
+ /**
195
+ * @zh 是否启用浮动模式
196
+ * @en Whether to enable floating mode
197
+ */
198
+ floating: { type: Boolean },
199
+ /**
200
+ * @zh 是否启用粘性定位
201
+ * @en Whether to enable sticky mode
202
+ */
203
+ sticky: { type: Boolean },
204
+ /**
69
205
  * @zh 翻转折叠提示箭头的方向,当 Sider 在右边时可以使用
70
206
  * @en Flip and fold the direction of the hint arrow, which can be used when Sider is on the right
71
207
  */
@@ -90,6 +226,8 @@ var sider_vue_vue_type_script_lang_default = /* @__PURE__ */ defineComponent({
90
226
  hideTrigger: { type: Boolean }
91
227
  },
92
228
  emits: [
229
+ "update:modelValue",
230
+ "update:rail",
93
231
  "collapse",
94
232
  "update:collapsed",
95
233
  "breakpoint"
@@ -101,37 +239,162 @@ var sider_vue_vue_type_script_lang_default = /* @__PURE__ */ defineComponent({
101
239
  * @binding {boolean} collapsed
102
240
  */
103
241
  setup(props, { emit }) {
104
- const { theme, collapsed, defaultCollapsed, collapsible, hideTrigger, breakpoint, collapsedWidth, resizeDirections } = toRefs(props);
105
- const [localCollapsed, setLocalCollapsed] = useMergeState(defaultCollapsed.value, reactive({ value: collapsed }));
106
- const componentTag = computed(() => resizeDirections.value ? "ResizeBox" : "div");
107
- const showTrigger = computed(() => collapsible.value && !hideTrigger.value);
242
+ const { theme, modelValue, defaultVisible, collapsed, defaultCollapsed, collapsible, rail, defaultRail, expandOnHover, disableResizeWatcher, disableRouteWatcher, hideTrigger, breakpoint, height, collapsedWidth, mask, maskClosable, escToClose, location, floating, permanent, persistent, sticky, temporary, resizeDirections } = toRefs(props);
108
243
  const prefixCls = getPrefixCls("layout-sider");
244
+ const [localCollapsed, setLocalCollapsed] = useMergeState(defaultCollapsed.value, reactive({ value: collapsed }));
245
+ const [drawerVisible, setDrawerVisible] = useMergeState(defaultVisible.value, reactive({ value: modelValue }));
246
+ const [railCollapsed, setRailCollapsed] = useMergeState(defaultRail.value, reactive({ value: rail }));
247
+ const physicalLocation = computed(() => {
248
+ if (location.value === "start") return "left";
249
+ if (location.value === "end") return "right";
250
+ return location.value;
251
+ });
252
+ const isHorizontal = computed(() => ["left", "right"].includes(physicalLocation.value));
253
+ const isTemporary = computed(() => !permanent.value && !!temporary.value);
254
+ const isDrawerActive = computed(() => !!permanent.value || drawerVisible.value);
255
+ const temporaryVisible = computed(() => isTemporary.value && isDrawerActive.value);
256
+ const railModeEnabled = computed(() => {
257
+ var _rail$value;
258
+ return ((_rail$value = rail.value) !== null && _rail$value !== void 0 ? _rail$value : defaultRail.value) || railCollapsed.value;
259
+ });
260
+ const { zIndex } = usePopupManager("dialog", { visible: temporaryVisible });
261
+ const componentTag = computed(() => resizeDirections.value && !isTemporary.value && isHorizontal.value ? ResizeBox : "div");
262
+ const resizeDirectionsProps = computed(() => componentTag.value === ResizeBox && resizeDirections.value ? { directions: resizeDirections.value } : {});
263
+ const showTrigger = computed(() => collapsible.value && !hideTrigger.value && !isTemporary.value && isHorizontal.value);
264
+ const siderSize = computed(() => {
265
+ let rawSize = props.width;
266
+ if (localCollapsed.value) rawSize = props.collapsedWidth;
267
+ else if (railCollapsed.value) rawSize = props.railWidth;
268
+ return isNumber(rawSize) ? `${rawSize}px` : String(rawSize);
269
+ });
270
+ const crossAxisSize = computed(() => {
271
+ var _height$value;
272
+ const rawSize = (_height$value = height.value) !== null && _height$value !== void 0 ? _height$value : props.width;
273
+ return isNumber(rawSize) ? `${rawSize}px` : String(rawSize);
274
+ });
275
+ const siderStyles = computed(() => {
276
+ const style = isHorizontal.value ? { width: siderSize.value } : { height: crossAxisSize.value };
277
+ if (!isTemporary.value) {
278
+ if (sticky.value && isHorizontal.value) return _objectSpread2(_objectSpread2({}, style), {}, {
279
+ position: "sticky",
280
+ top: "0",
281
+ alignSelf: "flex-start",
282
+ maxHeight: "100vh"
283
+ });
284
+ return style;
285
+ }
286
+ return _objectSpread2(_objectSpread2({}, style), {}, {
287
+ [physicalLocation.value]: 0,
288
+ zIndex: zIndex.value || void 0
289
+ });
290
+ });
291
+ const triggerStyles = computed(() => ({ width: siderSize.value }));
292
+ const showMask = computed(() => isTemporary.value && isDrawerActive.value && mask.value);
293
+ const maskStyles = computed(() => {
294
+ const baseStyle = { zIndex: zIndex.value ? zIndex.value - 1 : void 0 };
295
+ if (!showMask.value) return baseStyle;
296
+ if (physicalLocation.value === "left") return _objectSpread2(_objectSpread2({}, baseStyle), {}, {
297
+ top: 0,
298
+ right: 0,
299
+ bottom: 0,
300
+ left: siderSize.value
301
+ });
302
+ if (physicalLocation.value === "right") return _objectSpread2(_objectSpread2({}, baseStyle), {}, {
303
+ top: 0,
304
+ right: siderSize.value,
305
+ bottom: 0,
306
+ left: 0
307
+ });
308
+ if (physicalLocation.value === "top") return _objectSpread2(_objectSpread2({}, baseStyle), {}, {
309
+ top: crossAxisSize.value,
310
+ right: 0,
311
+ bottom: 0,
312
+ left: 0
313
+ });
314
+ return _objectSpread2(_objectSpread2({}, baseStyle), {}, {
315
+ top: 0,
316
+ right: 0,
317
+ bottom: crossAxisSize.value,
318
+ left: 0
319
+ });
320
+ });
109
321
  const classNames = computed(() => [prefixCls, {
110
322
  [`${prefixCls}-light`]: theme.value === "light",
111
323
  [`${prefixCls}-has-trigger`]: showTrigger.value,
112
- [`${prefixCls}-collapsed`]: collapsed.value
324
+ [`${prefixCls}-collapsed`]: localCollapsed.value,
325
+ [`${prefixCls}-temporary`]: isTemporary.value,
326
+ [`${prefixCls}-persistent`]: persistent.value,
327
+ [`${prefixCls}-active`]: isDrawerActive.value,
328
+ [`${prefixCls}-rail`]: railCollapsed.value,
329
+ [`${prefixCls}-expand-on-hover`]: expandOnHover.value,
330
+ [`${prefixCls}-floating`]: floating.value,
331
+ [`${prefixCls}-sticky`]: sticky.value,
332
+ [`${prefixCls}-${physicalLocation.value}`]: true
113
333
  }]);
114
- const siderWidth = computed(() => {
115
- const { width, collapsedWidth } = props;
116
- const rawWidth = localCollapsed.value ? collapsedWidth : width;
117
- return isNumber(rawWidth) ? `${rawWidth}px` : String(rawWidth);
118
- });
119
334
  const triggerClassNames = computed(() => [`${prefixCls}-trigger`, { [`${prefixCls}-trigger-light`]: theme.value === "light" }]);
335
+ const setVisibleState = (nextVisible) => {
336
+ setDrawerVisible(nextVisible);
337
+ emit("update:modelValue", nextVisible);
338
+ };
339
+ const setRailState = (nextRail) => {
340
+ setRailCollapsed(nextRail);
341
+ emit("update:rail", nextRail);
342
+ };
120
343
  const toggleTrigger = () => {
121
- const newCollapsed = !localCollapsed.value;
122
- setLocalCollapsed(newCollapsed);
123
- emit("update:collapsed", newCollapsed);
124
- emit("collapse", newCollapsed, "clickTrigger");
344
+ const nextCollapsed = !localCollapsed.value;
345
+ setLocalCollapsed(nextCollapsed);
346
+ emit("update:collapsed", nextCollapsed);
347
+ emit("collapse", nextCollapsed, "clickTrigger");
348
+ };
349
+ const handleMaskClick = () => {
350
+ if (!maskClosable.value || persistent.value) return;
351
+ setVisibleState(false);
352
+ };
353
+ const handleGlobalKeyDown = (event) => {
354
+ if (event.key === KEYBOARD_KEY.ESC && escToClose.value && isTemporary.value && !persistent.value) setVisibleState(false);
355
+ };
356
+ const handleRouteChange = () => {
357
+ if (isTemporary.value && isDrawerActive.value && !disableRouteWatcher.value) setVisibleState(false);
358
+ };
359
+ const handleMouseEnter = () => {
360
+ if (expandOnHover.value && railModeEnabled.value && railCollapsed.value) setRailState(false);
361
+ };
362
+ const handleMouseLeave = () => {
363
+ if (expandOnHover.value && railModeEnabled.value && !railCollapsed.value) setRailState(true);
125
364
  };
126
365
  useResponsive(breakpoint, (checked) => {
127
- const newCollapsed = !checked;
128
- if (newCollapsed !== localCollapsed.value) {
129
- setLocalCollapsed(newCollapsed);
130
- emit("update:collapsed", newCollapsed);
131
- emit("collapse", newCollapsed, "responsive");
132
- emit("breakpoint", newCollapsed);
366
+ if (disableResizeWatcher.value) return;
367
+ const nextCollapsed = !checked;
368
+ if (nextCollapsed !== localCollapsed.value) {
369
+ setLocalCollapsed(nextCollapsed);
370
+ emit("update:collapsed", nextCollapsed);
371
+ emit("collapse", nextCollapsed, "responsive");
372
+ emit("breakpoint", nextCollapsed);
133
373
  }
134
374
  });
375
+ watch(() => props.permanent, (nextPermanent) => {
376
+ if (nextPermanent) setVisibleState(true);
377
+ });
378
+ watch([
379
+ isTemporary,
380
+ isDrawerActive,
381
+ escToClose
382
+ ], ([nextTemporary, nextActive, nextEsc]) => {
383
+ off(document.documentElement, "keydown", handleGlobalKeyDown);
384
+ if (nextTemporary && nextActive && nextEsc) on(document.documentElement, "keydown", handleGlobalKeyDown);
385
+ }, { immediate: true });
386
+ watch([
387
+ isTemporary,
388
+ isDrawerActive,
389
+ disableRouteWatcher
390
+ ], ([nextTemporary, nextActive, nextDisableRouteWatcher]) => {
391
+ off(window, "popstate", handleRouteChange);
392
+ off(window, "hashchange", handleRouteChange);
393
+ if (nextTemporary && nextActive && !nextDisableRouteWatcher) {
394
+ on(window, "popstate", handleRouteChange);
395
+ on(window, "hashchange", handleRouteChange);
396
+ }
397
+ }, { immediate: true });
135
398
  const uniqueId = generateId("__arco_layout_sider");
136
399
  const siderHook = inject(LayoutSiderInjectionKey, void 0);
137
400
  onMounted(() => {
@@ -140,22 +403,32 @@ var sider_vue_vue_type_script_lang_default = /* @__PURE__ */ defineComponent({
140
403
  });
141
404
  onUnmounted(() => {
142
405
  var _siderHook$onSiderUnM;
406
+ off(document.documentElement, "keydown", handleGlobalKeyDown);
407
+ off(window, "popstate", handleRouteChange);
408
+ off(window, "hashchange", handleRouteChange);
143
409
  siderHook === null || siderHook === void 0 || (_siderHook$onSiderUnM = siderHook.onSiderUnMount) === null || _siderHook$onSiderUnM === void 0 || _siderHook$onSiderUnM.call(siderHook, uniqueId);
144
410
  });
145
411
  provide(SiderInjectionKey, reactive({
146
412
  theme,
147
- collapsed: localCollapsed,
413
+ collapsed: computed(() => localCollapsed.value || railCollapsed.value),
148
414
  collapsedWidth
149
415
  }));
150
416
  return {
151
- componentTag,
152
- prefixCls,
153
417
  classNames,
154
- triggerClassNames,
418
+ componentTag,
419
+ handleMaskClick,
420
+ handleMouseEnter,
421
+ handleMouseLeave,
155
422
  localCollapsed,
156
- siderWidth,
423
+ prefixCls,
424
+ resizeDirectionsProps,
425
+ showMask,
426
+ maskStyles,
157
427
  showTrigger,
158
- toggleTrigger
428
+ siderStyles,
429
+ toggleTrigger,
430
+ triggerClassNames,
431
+ triggerStyles
159
432
  };
160
433
  }
161
434
  });
@@ -26,15 +26,26 @@
26
26
  position: relative;
27
27
  flex: none;
28
28
  width: auto;
29
+ max-width: 100%;
29
30
  margin: 0;
30
31
  padding: 0;
32
+ overflow: hidden;
31
33
  background: var(--color-menu-dark-bg);
32
- transition: width 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
34
+ transition: width 0.2s cubic-bezier(0.34, 0.69, 0.1, 1), height 0.2s cubic-bezier(0.34, 0.69, 0.1, 1), transform 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
35
+ }
36
+ .sd-layout-sider-image, .sd-layout-sider-prepend, .sd-layout-sider-append {
37
+ flex: none;
33
38
  }
34
39
  .sd-layout-sider-children {
40
+ flex: 1;
35
41
  height: 100%;
36
42
  overflow: auto;
37
43
  }
44
+ .sd-layout-sider-mask {
45
+ position: fixed;
46
+ inset: 0;
47
+ background: rgba(0, 0, 0, 0.45);
48
+ }
38
49
  .sd-layout-sider-collapsed .sd-layout-sider-children {
39
50
  /* width */
40
51
  }
@@ -42,10 +53,19 @@
42
53
  width: 0;
43
54
  }
44
55
  .sd-layout-sider-has-trigger {
56
+ display: flex;
57
+ flex-direction: column;
45
58
  box-sizing: border-box;
46
59
  padding-bottom: 48px;
47
60
  }
61
+ .sd-layout-sider-rail {
62
+ width: 56px;
63
+ }
48
64
  .sd-layout-sider-trigger {
65
+ position: absolute;
66
+ right: 0;
67
+ bottom: 0;
68
+ left: 0;
49
69
  z-index: 1;
50
70
  display: flex;
51
71
  align-items: center;
@@ -63,14 +83,148 @@
63
83
  background: var(--color-menu-light-bg);
64
84
  border-top: 1px solid var(--color-bg-5);
65
85
  }
86
+ .sd-layout-sider-floating {
87
+ box-shadow: none;
88
+ }
89
+ .sd-layout-sider-sticky {
90
+ z-index: 1;
91
+ }
92
+ .sd-layout-sider-temporary {
93
+ position: fixed;
94
+ box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
95
+ }
96
+ .sd-layout-sider-temporary.sd-layout-sider-left {
97
+ top: 0;
98
+ bottom: 0;
99
+ left: 0;
100
+ transform: translateX(-100%);
101
+ }
102
+ .sd-layout-sider-temporary.sd-layout-sider-right {
103
+ top: 0;
104
+ right: 0;
105
+ bottom: 0;
106
+ transform: translateX(100%);
107
+ }
108
+ .sd-layout-sider-temporary.sd-layout-sider-top {
109
+ top: 0;
110
+ right: 0;
111
+ left: 0;
112
+ width: 100%;
113
+ transform: translateY(-100%);
114
+ }
115
+ .sd-layout-sider-temporary.sd-layout-sider-bottom {
116
+ right: 0;
117
+ bottom: 0;
118
+ left: 0;
119
+ width: 100%;
120
+ transform: translateY(100%);
121
+ }
122
+ .sd-layout-sider-temporary.sd-layout-sider-active {
123
+ transform: translate(0, 0);
124
+ }
66
125
  .sd-layout-sider-light {
67
126
  background: var(--color-menu-light-bg);
68
127
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08);
69
128
  }
70
129
  .sd-layout-header {
130
+ position: relative;
71
131
  flex: 0 0 auto;
72
132
  box-sizing: border-box;
73
133
  margin: 0;
134
+ overflow: hidden;
135
+ color: var(--color-text-1);
136
+ background: var(--color-bg-2);
137
+ border-bottom: 1px solid var(--color-border-2);
138
+ transition: height 0.2s cubic-bezier(0.34, 0.69, 0.1, 1), transform 0.2s cubic-bezier(0.34, 0.69, 0.1, 1), box-shadow 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
139
+ }
140
+ .sd-layout-header-wrapper {
141
+ width: 100%;
142
+ }
143
+ .sd-layout-header-bar, .sd-layout-header-extension, .sd-layout-header-prepend, .sd-layout-header-append, .sd-layout-header-content {
144
+ display: flex;
145
+ align-items: center;
146
+ }
147
+ .sd-layout-header-bar {
148
+ position: relative;
149
+ z-index: 1;
150
+ gap: 16px;
151
+ min-height: var(--sd-layout-header-content-height, 64px);
152
+ padding: 0 20px;
153
+ }
154
+ .sd-layout-header-prepend, .sd-layout-header-append {
155
+ flex: none;
156
+ gap: 8px;
157
+ }
158
+ .sd-layout-header-title {
159
+ position: relative;
160
+ z-index: 1;
161
+ flex: none;
162
+ max-width: min(40%, 480px);
163
+ overflow: hidden;
164
+ color: inherit;
165
+ font-weight: 600;
166
+ font-size: 18px;
167
+ white-space: nowrap;
168
+ text-overflow: ellipsis;
169
+ }
170
+ .sd-layout-header-content {
171
+ position: relative;
172
+ z-index: 1;
173
+ flex: 1;
174
+ gap: 8px;
175
+ min-width: 0;
176
+ }
177
+ .sd-layout-header-extension {
178
+ position: relative;
179
+ z-index: 1;
180
+ gap: 8px;
181
+ min-height: var(--sd-layout-header-extension-height, 48px);
182
+ padding: 0 20px;
183
+ border-top: 1px solid var(--color-border-2);
184
+ }
185
+ .sd-layout-header-image {
186
+ position: absolute;
187
+ inset: 0;
188
+ overflow: hidden;
189
+ }
190
+ .sd-layout-header-image::after {
191
+ position: absolute;
192
+ inset: 0;
193
+ background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.36));
194
+ content: "";
195
+ }
196
+ .sd-layout-header-image-inner, .sd-layout-header-image :is(img, picture, video) {
197
+ width: 100%;
198
+ height: 100%;
199
+ object-fit: cover;
200
+ opacity: var(--sd-layout-header-image-opacity, 1);
201
+ transition: opacity 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
202
+ }
203
+ .sd-layout-header-flat {
204
+ box-shadow: none;
205
+ }
206
+ .sd-layout-header:not(.sd-layout-header-flat) {
207
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
208
+ }
209
+ .sd-layout-header-floating {
210
+ box-shadow: 0 16px 32px rgba(0, 0, 0, 0.14);
211
+ }
212
+ .sd-layout-header-hidden {
213
+ pointer-events: none;
214
+ }
215
+ .sd-layout-header-collapsed .sd-layout-header-extension {
216
+ display: none;
217
+ }
218
+ .sd-layout-header-with-image {
219
+ color: var(--color-white);
220
+ border-bottom-color: transparent;
221
+ }
222
+ .sd-layout-header-with-image .sd-layout-header-extension {
223
+ border-top-color: rgba(255, 255, 255, 0.16);
224
+ }
225
+ .sd-layout-header-bottom {
226
+ border-top: 1px solid var(--color-border-2);
227
+ border-bottom: 0;
74
228
  }
75
229
  .sd-layout-content {
76
230
  flex: 1;