@zat-design/sisyphus-react 4.6.3 → 4.6.4

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.
@@ -24,18 +24,6 @@
24
24
  }
25
25
 
26
26
  .pro-container {
27
- .pro-collapse {
28
- .pro-collapse-panel {
29
- .@{ant-prefix}-collapse-header {
30
- border-radius: var(--zaui-border-radius, 8px) !important;
31
- }
32
- &.@{ant-prefix}-collapse-item-active {
33
- .@{ant-prefix}-collapse-header {
34
- border-radius: var(--zaui-border-radius, 8px) var(--zaui-border-radius, 8px) 0 0 !important;
35
- }
36
- }
37
- }
38
- }
39
27
  .pro-collapse-content {
40
28
  margin: 0;
41
29
  border-radius: 0 0 var(--zaui-border-radius, 8px) var(--zaui-border-radius, 8px);
@@ -88,6 +76,10 @@
88
76
  }
89
77
 
90
78
  &.pro-form-view {
79
+ .pro-container {
80
+ width: 100%;
81
+ }
82
+
91
83
  .pro-group {
92
84
  .@{ant-prefix}-space-item,
93
85
  .pro-form-view-container {
@@ -75,6 +75,7 @@
75
75
  }
76
76
 
77
77
  &.pro-collapse-level2 {
78
+ border-radius: 0;
78
79
  background: var(--zaui-base-bg, #ffffff);
79
80
  .pro-collapse-panel {
80
81
  margin-bottom: 0;
@@ -114,6 +115,7 @@
114
115
  }
115
116
 
116
117
  .pro-collapse-level2-collapse {
118
+ border-radius: 0;
117
119
  margin-bottom: var(--zaui-space-size-md, 16px);
118
120
  &.@{ant-prefix}-collapse-item-active {
119
121
  margin-bottom: 0;
@@ -296,8 +296,18 @@
296
296
  .pro-layout-tab-icon {
297
297
  display: none !important;
298
298
  }
299
+ .pro-layout-tab-item {
300
+ width: 100%;
301
+ }
299
302
  .pro-layout-tab-content {
300
303
  width: 100%;
304
+
305
+ .pro-layout-tab-title {
306
+ min-width: 0;
307
+ }
308
+ .pro-layout-tab-close {
309
+ margin-left: auto;
310
+ }
301
311
  }
302
312
  }
303
313
 
@@ -146,19 +146,20 @@ const ProLayout = (props) => {
146
146
  return {
147
147
  ...tabs,
148
148
  onTabChange: (activeKey, activeTab, allTabs) => {
149
- var _a2, _b, _c, _d, _e;
149
+ var _a2, _b, _c, _d, _e, _f;
150
150
  if (!allTabs || allTabs.length === 0) {
151
151
  setState({ selectedPath: "##EMPTY##" });
152
+ (_a2 = tabs.onTabChange) == null ? void 0 : _a2.call(tabs, activeKey, activeTab, allTabs ?? []);
152
153
  return;
153
154
  }
154
- const menuCodeSource = (_a2 = activeTab == null ? void 0 : activeTab.menuCodeSource) == null ? void 0 : _a2.trim();
155
+ const menuCodeSource = (_b = activeTab == null ? void 0 : activeTab.menuCodeSource) == null ? void 0 : _b.trim();
155
156
  const sourceMenu = menuCodeSource ? flattenMenuData(menuDataSource.menus).find((menu) => menu.code === menuCodeSource) : void 0;
156
157
  const sourcePath = (sourceMenu == null ? void 0 : sourceMenu.redirectUrl) || (sourceMenu == null ? void 0 : sourceMenu.url) || (sourceMenu == null ? void 0 : sourceMenu.router);
157
- const targetPath = sourcePath || (activeTab == null ? void 0 : activeTab.url) || ((_b = activeTab == null ? void 0 : activeTab.menuItem) == null ? void 0 : _b.router) || ((_c = activeTab == null ? void 0 : activeTab.menuItem) == null ? void 0 : _c.redirectUrl) || ((_d = activeTab == null ? void 0 : activeTab.menuItem) == null ? void 0 : _d.url);
158
+ const targetPath = sourcePath || (activeTab == null ? void 0 : activeTab.url) || ((_c = activeTab == null ? void 0 : activeTab.menuItem) == null ? void 0 : _c.router) || ((_d = activeTab == null ? void 0 : activeTab.menuItem) == null ? void 0 : _d.redirectUrl) || ((_e = activeTab == null ? void 0 : activeTab.menuItem) == null ? void 0 : _e.url);
158
159
  if (targetPath && targetPath !== selectedPath) {
159
160
  setState({ selectedPath: targetPath });
160
161
  }
161
- (_e = tabs.onTabChange) == null ? void 0 : _e.call(tabs, activeKey, activeTab, allTabs);
162
+ (_f = tabs.onTabChange) == null ? void 0 : _f.call(tabs, activeKey, activeTab, allTabs);
162
163
  }
163
164
  };
164
165
  }, [isTabsLayout, menuDataSource.menus, tabs, selectedPath]);
@@ -305,6 +305,10 @@ const ProSelect = (props, ref) => {
305
305
  const content = currentRecord && OptionRender ? OptionRender(currentRecord) : optionLabel;
306
306
  return /* @__PURE__ */ jsx(TooltipOption, { children: /* @__PURE__ */ jsx("span", { children: content }) });
307
307
  };
308
+ const selectLabelRender = tooltip ? (selectedOption) => {
309
+ const content = selectProps.labelRender ? selectProps.labelRender(selectedOption) : selectedOption.label ?? selectedOption.value;
310
+ return /* @__PURE__ */ jsx(AdaptiveTooltip, { children: content });
311
+ } : selectProps.labelRender;
308
312
  const mode = selectProps.mode;
309
313
  const handleChange = (value2, rawOption) => {
310
314
  if (mode !== "multiple" && !(labelInValue && !mode)) {
@@ -331,42 +335,50 @@ const ProSelect = (props, ref) => {
331
335
  flatOptions,
332
336
  code
333
337
  });
334
- return /* @__PURE__ */ jsx("div", { style: props.style, className: `pro-select${popupOpen ? " pro-select-popup-open" : ""}`, children: /* @__PURE__ */ jsx(
335
- Select,
338
+ return /* @__PURE__ */ jsx(
339
+ "div",
336
340
  {
337
- placeholder: (_g = (_f = locale) == null ? void 0 : _f.ProSelect) == null ? void 0 : _g.select,
338
- allowClear: true,
339
- loading: fetchFunction == null ? void 0 : fetchFunction.loading,
340
- onChange: handleChange,
341
- showSearch: mergedShowSearch.enabled ? {
342
- filterOption: mergedShowSearch.filterOption,
343
- optionFilterProp: mergedShowSearch.optionFilterProp,
344
- onSearch: mergedShowSearch.onSearch
345
- } : false,
346
- getPopupContainer: (trigger) => {
347
- return scrollFollowParent ? trigger.parentElement : document.body;
348
- },
349
- ...omit({ ...selectProps }, [
350
- "isView",
351
- "showCodeName",
352
- "form",
353
- "name",
354
- "style",
355
- "onFieldChange",
356
- "getChangeValue",
357
- "viewportReady",
358
- "showSearch",
359
- "filterOption",
360
- "optionFilterProp",
361
- "searchValue"
362
- ]),
363
- onOpenChange: handleOpenChange,
364
- maxTagPlaceholder: selectProps.mode === "multiple" && !selectProps.maxTagPlaceholder ? maxTagPlaceholder : selectProps.maxTagPlaceholder,
365
- optionRender: selectOptionRender,
366
- value: transformValue(),
367
- options: selectOptions
341
+ style: props.style,
342
+ className: `pro-select${tooltip ? " pro-select-tooltip" : ""}${popupOpen ? " pro-select-popup-open" : ""}`,
343
+ children: /* @__PURE__ */ jsx(
344
+ Select,
345
+ {
346
+ placeholder: (_g = (_f = locale) == null ? void 0 : _f.ProSelect) == null ? void 0 : _g.select,
347
+ allowClear: true,
348
+ loading: fetchFunction == null ? void 0 : fetchFunction.loading,
349
+ onChange: handleChange,
350
+ showSearch: mergedShowSearch.enabled ? {
351
+ filterOption: mergedShowSearch.filterOption,
352
+ optionFilterProp: mergedShowSearch.optionFilterProp,
353
+ onSearch: mergedShowSearch.onSearch
354
+ } : false,
355
+ getPopupContainer: (trigger) => {
356
+ return scrollFollowParent ? trigger.parentElement : document.body;
357
+ },
358
+ ...omit({ ...selectProps }, [
359
+ "isView",
360
+ "showCodeName",
361
+ "form",
362
+ "name",
363
+ "style",
364
+ "onFieldChange",
365
+ "getChangeValue",
366
+ "viewportReady",
367
+ "showSearch",
368
+ "filterOption",
369
+ "optionFilterProp",
370
+ "searchValue"
371
+ ]),
372
+ onOpenChange: handleOpenChange,
373
+ labelRender: selectLabelRender,
374
+ maxTagPlaceholder: selectProps.mode === "multiple" && !selectProps.maxTagPlaceholder ? maxTagPlaceholder : selectProps.maxTagPlaceholder,
375
+ optionRender: selectOptionRender,
376
+ value: transformValue(),
377
+ options: selectOptions
378
+ }
379
+ )
368
380
  }
369
- ) });
381
+ );
370
382
  };
371
383
  var ProSelect_default = forwardRef(ProSelect);
372
384
  export {
@@ -15,6 +15,13 @@
15
15
  z-index: 4;
16
16
  }
17
17
 
18
+ // antd 6 的搜索输入层会覆盖已选标签,收起时让 hover 落到 Tooltip 触发节点。
19
+ &.pro-select-tooltip:not(.pro-select-popup-open) {
20
+ .ant-select-content-has-value > .ant-select-input {
21
+ pointer-events: none;
22
+ }
23
+ }
24
+
18
25
  > .ant-select {
19
26
  width: 100%;
20
27
  }
@@ -67,8 +67,7 @@ const FileItem = (props) => {
67
67
  return /* @__PURE__ */ jsxs("div", { className: "filelist-item-wrapper", children: [
68
68
  /* @__PURE__ */ jsxs("div", { className: `file-info-box ${file.status === "error" ? "file-box-error" : ""}`, children: [
69
69
  !hideFileIcon && /* @__PURE__ */ jsx("div", { className: "file-type-icon", children: /* @__PURE__ */ jsx("img", { src: _fileIcon }) }),
70
- /* @__PURE__ */ jsx("div", { className: `file-name ${hideFileIcon ? "file-name-pf0" : ""}`, children: file.name.replace(_fileExt, "") }),
71
- /* @__PURE__ */ jsx("div", { className: "file-ext", children: _fileExt }),
70
+ /* @__PURE__ */ jsx("div", { className: `file-name ${hideFileIcon ? "file-name-pf0" : ""}`, children: file.name }),
72
71
  _fileSize && /* @__PURE__ */ jsx("div", { className: "file-size", children: `(${_fileSize || 0}kb)` }),
73
72
  /* @__PURE__ */ jsx("div", { className: "file-actions-wrap", children: /* @__PURE__ */ jsxs("div", { className: "file-actions", children: [
74
73
  _isShowDownloadIcon && /* @__PURE__ */ jsx(Button, { type: "link", className: "file-action-item", onClick: _onDownload, children: /* @__PURE__ */ jsx(ReactSVG, { className: "action-icon", wrapper: "span", src: downloadSvg }) }),
@@ -374,16 +374,17 @@
374
374
  }
375
375
 
376
376
  .file-actions-wrap {
377
- width: 100px;
377
+ flex: none;
378
378
  margin-left: auto;
379
+ padding: 0 var(--zaui-space-size-sm, 8px);
379
380
  .file-actions {
380
381
  display: none;
382
+ gap: var(--zaui-space-size-sm, 8px);
381
383
  justify-content: right;
382
384
 
383
385
  transition: all 1s;
384
386
 
385
387
  .file-action-item {
386
- margin-left: var(--zaui-space-size-sm, 8px);
387
388
  padding: 0;
388
389
  cursor: pointer;
389
390
  color: var(--zaui-brand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "4.6.3",
3
+ "version": "4.6.4",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",