@doreamonjs/page-detail 1.10.31 → 1.10.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.10.35](https://github.com/doreamonjs/doreamon/compare/v1.10.34...v1.10.35) (2023-12-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * page-creator page detail tab support visible ([8097098](https://github.com/doreamonjs/doreamon/commit/80970983cb1bdd2b0f3c0e0b2ab14612c71d2a3d))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.10.31](https://github.com/doreamonjs/doreamon/compare/v1.10.30...v1.10.31) (2023-11-29)
7
18
 
8
19
  **Note:** Version bump only for package @doreamonjs/page-detail
package/lib/index.d.ts CHANGED
@@ -55,6 +55,7 @@ export interface TabItem {
55
55
  disabled?: boolean;
56
56
  render(values: any, index: number, context: any): JSX.Element;
57
57
  rollout?: string;
58
+ visible?: boolean | ((values: any, tab: TabItem, index: number, context: any) => boolean);
58
59
  }
59
60
  export interface DInformationItem extends InformationItem {
60
61
  rollout?: string;
package/lib/index.js CHANGED
@@ -25,7 +25,13 @@ const DetailPage = (props) => {
25
25
  }
26
26
  const details = (_g = props.attributes.detail.basis) === null || _g === void 0 ? void 0 : _g.items;
27
27
  const defaultTab = (_h = props.attributes.detail.modules) === null || _h === void 0 ? void 0 : _h.default;
28
- const tabs = (_k = (_j = props.attributes.detail.modules) === null || _j === void 0 ? void 0 : _j.items) === null || _k === void 0 ? void 0 : _k.map((tab, index) => {
28
+ const tabs = (_k = (_j = props.attributes.detail.modules) === null || _j === void 0 ? void 0 : _j.items) === null || _k === void 0 ? void 0 : _k.filter((tab, index) => {
29
+ let isVisible = tab.visible;
30
+ if (typeof tab.visible === 'function') {
31
+ isVisible = tab.visible(values, tab, index, props);
32
+ }
33
+ return isVisible !== false;
34
+ }).map((tab, index) => {
29
35
  return {
30
36
  ...tab,
31
37
  render: !tab.render ? undefined : () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doreamonjs/page-detail",
3
- "version": "1.10.31",
3
+ "version": "1.10.35",
4
4
  "description": "detail page",
5
5
  "keywords": [
6
6
  "doreamonjs",
@@ -80,5 +80,5 @@
80
80
  "xterm-addon-attach": "^0.6.0",
81
81
  "xterm-addon-fit": "^0.5.0"
82
82
  },
83
- "gitHead": "c7b703451025ea38e3aefeb77499178ed7d8c2a2"
83
+ "gitHead": "eced03c01cb681354ee19a0d241c302a6ba8b4b7"
84
84
  }