@jetlinks-web/components 2.6.7 → 2.6.9

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.
@@ -15,6 +15,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
15
15
  }
16
16
  } return value; }
17
17
  /* Analyzed bindings: {
18
+ "searchColumns": "props",
18
19
  "serial": "props",
19
20
  "validateRowKey": "props",
20
21
  "readonly": "props",
@@ -117,6 +118,10 @@ const __sfc_main__ = Object.assign({
117
118
  props: {
118
119
  ...tableProps(),
119
120
  ...bodyProps(),
121
+ searchColumns: {
122
+ type: Array,
123
+ default: undefined
124
+ },
120
125
  serial: {
121
126
  type: [Object, Boolean],
122
127
  default: () => ({
@@ -435,8 +440,9 @@ const __sfc_main__ = Object.assign({
435
440
  }, [
436
441
  _createVNode(Header, {
437
442
  columns: myColumns.value,
443
+ searchColumns: __props.searchColumns,
438
444
  style: _normalizeStyle({ width: tableStyle.width })
439
- }, null, 8 /* PROPS */, ["columns", "style"])
445
+ }, null, 8 /* PROPS */, ["columns", "searchColumns", "style"])
440
446
  ], 4 /* STYLE */),
441
447
  _createElementVNode("div", {
442
448
  class: "jetlinks-edit-table-body",
@@ -128,10 +128,9 @@ const __sfc_main__ = Object.assign({
128
128
  ? (_openBlock(), _createBlock(_unref(SearchModal), {
129
129
  key: 0,
130
130
  searchKey: searchData.key,
131
- rowKey: _ctx.rowKey,
132
131
  columns: __props.searchColumns,
133
132
  onClose: _cache[0] || (_cache[0] = $event => (searchData.visible = false))
134
- }, null, 8 /* PROPS */, ["searchKey", "rowKey", "columns"]))
133
+ }, null, 8 /* PROPS */, ["searchKey", "columns"]))
135
134
  : _createCommentVNode("v-if", true)
136
135
  ], 4 /* STYLE */));
137
136
  };
@@ -23,7 +23,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
23
23
  "useTableTool": "setup-maybe-ref",
24
24
  "useGroupOptions": "setup-maybe-ref",
25
25
  "ref": "setup-const",
26
- "reactive": "setup-const",
26
+ "computed": "setup-const",
27
27
  "defineOptions": "setup-const",
28
28
  "Ellipsis": "setup-const",
29
29
  "DragModal": "setup-const",
@@ -47,7 +47,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
47
47
  "tableHeight": "setup-ref",
48
48
  "selectedRowKeys": "setup-ref",
49
49
  "tableRef": "setup-ref",
50
- "myColumns": "setup-reactive-const",
50
+ "myColumns": "setup-ref",
51
51
  "selectedTableRow": "setup-const",
52
52
  "handleFilterArray": "setup-const",
53
53
  "search": "setup-const",
@@ -68,7 +68,7 @@ const _hoisted_6 = { key: 1 };
68
68
  const _hoisted_7 = { class: "jetlinks-table-search-result-total" };
69
69
  import Table from '../../EditTable.js';
70
70
  import { useTableDataSource, useTableOpenGroup, useTableTool, useGroupOptions } from "../../context";
71
- import { ref, reactive, } from "vue";
71
+ import { ref, computed, } from "vue";
72
72
  import Ellipsis from '../../../Ellipsis/Ellipsis.js';
73
73
  import DragModal from '../../../DragModal/DragModal.js';
74
74
  import { useLocaleReceiver } from "../../../LocaleReciver/index";
@@ -103,16 +103,24 @@ const __sfc_main__ = Object.assign({
103
103
  const tableHeight = ref(230);
104
104
  const selectedRowKeys = ref([]);
105
105
  const tableRef = ref();
106
- const myColumns = reactive([
107
- {
108
- title: contextLocale.value.columns.sign,
109
- dataIndex: 'id',
110
- },
111
- {
112
- title: contextLocale.value.columns.name,
113
- dataIndex: 'name',
106
+ const myColumns = computed(() => {
107
+ if (props.columns) {
108
+ return props.columns.map(item => ({
109
+ title: item.title,
110
+ dataIndex: item.dataIndex
111
+ }));
114
112
  }
115
- ]);
113
+ return [
114
+ {
115
+ title: contextLocale.value.columns.sign,
116
+ dataIndex: 'id',
117
+ },
118
+ {
119
+ title: contextLocale.value.columns.name,
120
+ dataIndex: 'name',
121
+ }
122
+ ];
123
+ });
116
124
  const selectedTableRow = (record) => {
117
125
  tableTool.scrollTo({
118
126
  ...record,
@@ -272,7 +280,7 @@ const __sfc_main__ = Object.assign({
272
280
  ref_key: "tableRef",
273
281
  ref: tableRef,
274
282
  "data-source": filterArray.value,
275
- columns: __props.columns || myColumns,
283
+ columns: myColumns.value,
276
284
  height: tableHeight.value,
277
285
  disableMenu: false,
278
286
  cellHeight: 36,
@@ -42,7 +42,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
42
42
  "onDesc": "setup-const"
43
43
  } */
44
44
  import { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
45
- const _withScopeId = n => (_pushScopeId("data-v-1744355448158"), n = n(), _popScopeId(), n);
45
+ const _withScopeId = n => (_pushScopeId("data-v-1744361871270"), n = n(), _popScopeId(), n);
46
46
  const _hoisted_1 = { class: "jetlinks-table-sort-content" };
47
47
  const _hoisted_2 = { class: "jetlinks-table-sort-title" };
48
48
  const _hoisted_3 = { class: "table-sort-body" };
@@ -38,10 +38,6 @@ export var bodyProps = function bodyProps() {
38
38
  return [];
39
39
  }
40
40
  },
41
- searchColumns: {
42
- type: Array,
43
- default: undefined
44
- },
45
41
  cellHeight: {
46
42
  type: Number,
47
43
  default: 50
@@ -1,12 +1,27 @@
1
+ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
2
+ const op = ops[i];
3
+ const fn = ops[i + 1];
4
+ i += 2;
5
+ if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
6
+ return undefined;
7
+ }
8
+ if (op === 'access' || op === 'optionalAccess') {
9
+ lastAccessLHS = value;
10
+ value = fn(value);
11
+ }
12
+ else if (op === 'call' || op === 'optionalCall') {
13
+ value = fn((...args) => value.call(lastAccessLHS, ...args));
14
+ lastAccessLHS = undefined;
15
+ }
16
+ } return value; }
1
17
  /* Analyzed bindings: {
2
18
  "data": "props",
3
19
  "showSearch": "props",
4
20
  "showInvert": "props",
5
- "fieldNames": "props",
6
21
  "request": "props",
7
22
  "flamegraph": "setup-maybe-ref",
8
23
  "d3": "setup-const",
9
- "onMounted": "setup-const",
24
+ "nextTick": "setup-const",
10
25
  "watch": "setup-const",
11
26
  "ref": "setup-const",
12
27
  "computed": "setup-const",
@@ -20,9 +35,10 @@
20
35
  } */
21
36
  import { resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
22
37
  const _hoisted_1 = { class: "j-flame-graph" };
38
+ const _hoisted_2 = { class: "actions" };
23
39
  import { flamegraph } from 'd3-flame-graph';
24
40
  import * as d3 from 'd3';
25
- import { onMounted, watch, ref, computed } from 'vue';
41
+ import { nextTick, watch, ref, computed } from 'vue';
26
42
  const __sfc_main__ = Object.assign({
27
43
  name: 'JFlameGraph',
28
44
  }, {
@@ -38,14 +54,6 @@ const __sfc_main__ = Object.assign({
38
54
  type: Boolean,
39
55
  default: true
40
56
  },
41
- fieldNames: {
42
- type: Object,
43
- default: () => ({
44
- name: 'className',
45
- value: 'samples',
46
- children: 'children'
47
- })
48
- },
49
57
  request: {
50
58
  type: Function,
51
59
  }
@@ -64,19 +72,15 @@ const __sfc_main__ = Object.assign({
64
72
  const formatData = computed(() => {
65
73
  return (val) => {
66
74
  function formatDataFn(newVal) {
67
- newVal.name = newVal[props.fieldNames.name];
68
- newVal.value = newVal[props.fieldNames.value];
69
- if (newVal[props.fieldNames.children] || newVal.children) {
70
- newVal[props.fieldNames.children || 'children'].forEach(item => {
75
+ _optionalChain([newVal, 'access', _2 => _2.children, 'optionalAccess', _3 => _3.forEach, 'call', _4 => _4(item => {
71
76
  formatDataFn(item);
72
- });
73
- }
77
+ })]);
74
78
  }
75
79
  //格式化数据,增加根节点root
76
80
  const obj = {
77
- [props.fieldNames.name]: 'root',
78
- [props.fieldNames.value]: val.map(item => item[props.fieldNames.value]).reduce((a, b) => a + b, 0),
79
- [props.fieldNames.children || 'children']: val
81
+ name: 'root',
82
+ value: val.map(item => item.value).reduce((a, b) => a + b, 0),
83
+ children: val
80
84
  };
81
85
  formatDataFn(obj);
82
86
  return obj;
@@ -89,36 +93,38 @@ const __sfc_main__ = Object.assign({
89
93
  .datum(formatData.value(props.data))
90
94
  .call(chart);
91
95
  };
92
- onMounted(() => {
93
- watch(() => props.data, (newVal, oldVal) => {
94
- if (newVal) {
96
+ watch(() => props.data, (newVal, oldVal) => {
97
+ if (newVal) {
98
+ nextTick(() => {
95
99
  d3.select(flameGraphRef.value)
96
100
  .datum(formatData.value(newVal))
97
101
  .call(chart);
98
- }
99
- }, { immediate: true });
100
- });
102
+ });
103
+ }
104
+ }, { immediate: true });
101
105
  return (_ctx, _cache) => {
102
106
  const _component_a_input_search = _resolveComponent("a-input-search");
103
107
  const _component_a_button = _resolveComponent("a-button");
104
108
  const _component_a_space = _resolveComponent("a-space");
105
109
  return (_openBlock(), _createElementBlock("div", _hoisted_1, [
106
- _createVNode(_component_a_space, null, {
107
- default: _withCtx(() => [
108
- _createVNode(_component_a_input_search, {
109
- class: "j-flame-graph-search",
110
- placeholder: "请输入",
111
- onSearch: search
112
- }),
113
- _createVNode(_component_a_button, { onClick: invert }, {
114
- default: _withCtx(() => [
115
- _createTextVNode("反转")
116
- ]),
117
- _: 1 /* STABLE */
118
- })
119
- ]),
120
- _: 1 /* STABLE */
121
- }),
110
+ _createElementVNode("div", _hoisted_2, [
111
+ _createVNode(_component_a_space, null, {
112
+ default: _withCtx(() => [
113
+ _createVNode(_component_a_input_search, {
114
+ class: "j-flame-graph-search",
115
+ placeholder: "请输入",
116
+ onSearch: search
117
+ }),
118
+ _createVNode(_component_a_button, { onClick: invert }, {
119
+ default: _withCtx(() => [
120
+ _createTextVNode("反转")
121
+ ]),
122
+ _: 1 /* STABLE */
123
+ })
124
+ ]),
125
+ _: 1 /* STABLE */
126
+ })
127
+ ]),
122
128
  _createElementVNode("div", {
123
129
  ref_key: "flameGraphRef",
124
130
  ref: flameGraphRef
@@ -1,7 +1,17 @@
1
1
  .j-flame-graph {
2
2
  position: relative;
3
+ width: 100%;
4
+ height: 100%;
5
+ overflow: auto;
3
6
  /* 修改矩形块样式 */
4
7
  }
8
+ .j-flame-graph .actions {
9
+ position: sticky;
10
+ top: 0;
11
+ left: 0;
12
+ padding: 10px;
13
+ background: #fff;
14
+ }
5
15
  .j-flame-graph .d3-flame-graph {
6
16
  margin-top: 40px;
7
17
  }
@@ -1,43 +1,52 @@
1
- .j-flame-graph {
2
- position: relative;
3
-
4
- .d3-flame-graph {
5
- margin-top: 40px;
6
- }
7
- /* 修改矩形块样式 */
8
- .d3-flame-graph {
9
- rect {
10
- stroke: #fff;
11
- stroke-width: 1px;
12
- }
13
-
14
- text {
15
- font-size: 18px;
16
- fill: #333;
17
- }
18
- }
19
-
20
- .frame {
21
- cursor: pointer;
22
- }
23
- .frame:hover {
24
- fill: #E600E6;
25
- }
26
- .frame:hover rect {
27
- fill: #ffffe0;
28
- }
29
- .frame div {
30
- color: #000
31
- }
32
-
33
- .j-flame-graph-search {
34
- position: sticky;
35
- top: 0;
36
- left: 0;
37
- width: 200px;
38
- }
39
- }
40
-
41
-
42
-
43
-
1
+ .j-flame-graph {
2
+ position: relative;
3
+ width: 100%;
4
+ height: 100%;
5
+ overflow: auto;
6
+ .actions {
7
+ position: sticky;
8
+ top: 0;
9
+ left: 0;
10
+ padding: 10px;
11
+ background: #fff;
12
+ }
13
+ .d3-flame-graph {
14
+ margin-top: 40px;
15
+ }
16
+ /* 修改矩形块样式 */
17
+ .d3-flame-graph {
18
+ rect {
19
+ stroke: #fff;
20
+ stroke-width: 1px;
21
+ }
22
+
23
+ text {
24
+ font-size: 18px;
25
+ fill: #333;
26
+ }
27
+ }
28
+
29
+ .frame {
30
+ cursor: pointer;
31
+ }
32
+ .frame:hover {
33
+ fill: #E600E6;
34
+ }
35
+ .frame:hover rect {
36
+ fill: #ffffe0;
37
+ }
38
+ .frame div {
39
+ color: #000
40
+ }
41
+
42
+ .j-flame-graph-search {
43
+ position: sticky;
44
+ top: 0;
45
+ left: 0;
46
+ width: 200px;
47
+ }
48
+ }
49
+
50
+
51
+
52
+
@@ -9,7 +9,7 @@
9
9
  } */
10
10
  import { defineComponent as _defineComponent } from 'vue';
11
11
  import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
12
- const _withScopeId = n => (_pushScopeId("data-v-1744355443252"), n = n(), _popScopeId(), n);
12
+ const _withScopeId = n => (_pushScopeId("data-v-1744361869037"), n = n(), _popScopeId(), n);
13
13
  const _hoisted_1 = { class: "full-page-warp-content" };
14
14
  import { ref, inject } from 'vue';
15
15
  import { useElementBounding } from '@vueuse/core';
@@ -23,7 +23,7 @@
23
23
  } */
24
24
  import { defineComponent as _defineComponent } from 'vue';
25
25
  import { unref as _unref, createVNode as _createVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
26
- const _withScopeId = n => (_pushScopeId("data-v-1744355447787"), n = n(), _popScopeId(), n);
26
+ const _withScopeId = n => (_pushScopeId("data-v-1744361871107"), n = n(), _popScopeId(), n);
27
27
  const _hoisted_1 = {
28
28
  key: 0,
29
29
  style: { "width": "240px" }
package/es/Search/Item.js CHANGED
@@ -80,7 +80,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
80
80
  } */
81
81
  import { defineComponent as _defineComponent } from 'vue';
82
82
  import { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, createVNode as _createVNode, Fragment as _Fragment, normalizeStyle as _normalizeStyle, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
83
- const _withScopeId = n => (_pushScopeId("data-v-1744355446214"), n = n(), _popScopeId(), n);
83
+ const _withScopeId = n => (_pushScopeId("data-v-1744361870452"), n = n(), _popScopeId(), n);
84
84
  const _hoisted_1 = { class: "JSearch-item" };
85
85
  const _hoisted_2 = {
86
86
  key: 0,
@@ -5179,8 +5179,18 @@ span.ant-radio + * {
5179
5179
  }
5180
5180
  .j-flame-graph {
5181
5181
  position: relative;
5182
+ width: 100%;
5183
+ height: 100%;
5184
+ overflow: auto;
5182
5185
  /* 修改矩形块样式 */
5183
5186
  }
5187
+ .j-flame-graph .actions {
5188
+ position: sticky;
5189
+ top: 0;
5190
+ left: 0;
5191
+ padding: 10px;
5192
+ background: #fff;
5193
+ }
5184
5194
  .j-flame-graph .d3-flame-graph {
5185
5195
  margin-top: 40px;
5186
5196
  }
@@ -15,6 +15,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
15
15
  }
16
16
  } return value; }
17
17
  /* Analyzed bindings: {
18
+ "searchColumns": "props",
18
19
  "serial": "props",
19
20
  "validateRowKey": "props",
20
21
  "readonly": "props",
@@ -117,6 +118,10 @@ const __sfc_main__ = Object.assign({
117
118
  props: {
118
119
  ...tableProps(),
119
120
  ...bodyProps(),
121
+ searchColumns: {
122
+ type: Array,
123
+ default: undefined
124
+ },
120
125
  serial: {
121
126
  type: [Object, Boolean],
122
127
  default: () => ({
@@ -435,8 +440,9 @@ const __sfc_main__ = Object.assign({
435
440
  }, [
436
441
  _createVNode(Header, {
437
442
  columns: myColumns.value,
443
+ searchColumns: __props.searchColumns,
438
444
  style: _normalizeStyle({ width: tableStyle.width })
439
- }, null, 8 /* PROPS */, ["columns", "style"])
445
+ }, null, 8 /* PROPS */, ["columns", "searchColumns", "style"])
440
446
  ], 4 /* STYLE */),
441
447
  _createElementVNode("div", {
442
448
  class: "jetlinks-edit-table-body",
@@ -128,10 +128,9 @@ const __sfc_main__ = Object.assign({
128
128
  ? (_openBlock(), _createBlock(_unref(SearchModal), {
129
129
  key: 0,
130
130
  searchKey: searchData.key,
131
- rowKey: _ctx.rowKey,
132
131
  columns: __props.searchColumns,
133
132
  onClose: _cache[0] || (_cache[0] = $event => (searchData.visible = false))
134
- }, null, 8 /* PROPS */, ["searchKey", "rowKey", "columns"]))
133
+ }, null, 8 /* PROPS */, ["searchKey", "columns"]))
135
134
  : _createCommentVNode("v-if", true)
136
135
  ], 4 /* STYLE */));
137
136
  };
@@ -23,7 +23,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
23
23
  "useTableTool": "setup-maybe-ref",
24
24
  "useGroupOptions": "setup-maybe-ref",
25
25
  "ref": "setup-const",
26
- "reactive": "setup-const",
26
+ "computed": "setup-const",
27
27
  "defineOptions": "setup-const",
28
28
  "Ellipsis": "setup-const",
29
29
  "DragModal": "setup-const",
@@ -47,7 +47,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
47
47
  "tableHeight": "setup-ref",
48
48
  "selectedRowKeys": "setup-ref",
49
49
  "tableRef": "setup-ref",
50
- "myColumns": "setup-reactive-const",
50
+ "myColumns": "setup-ref",
51
51
  "selectedTableRow": "setup-const",
52
52
  "handleFilterArray": "setup-const",
53
53
  "search": "setup-const",
@@ -68,7 +68,7 @@ const _hoisted_6 = { key: 1 };
68
68
  const _hoisted_7 = { class: "jetlinks-table-search-result-total" };
69
69
  import Table from '../../EditTable.js';
70
70
  import { useTableDataSource, useTableOpenGroup, useTableTool, useGroupOptions } from "../../context";
71
- import { ref, reactive, } from "vue";
71
+ import { ref, computed, } from "vue";
72
72
  import Ellipsis from '../../../Ellipsis/Ellipsis.js';
73
73
  import DragModal from '../../../DragModal/DragModal.js';
74
74
  import { useLocaleReceiver } from "../../../LocaleReciver/index";
@@ -103,16 +103,24 @@ const __sfc_main__ = Object.assign({
103
103
  const tableHeight = ref(230);
104
104
  const selectedRowKeys = ref([]);
105
105
  const tableRef = ref();
106
- const myColumns = reactive([
107
- {
108
- title: contextLocale.value.columns.sign,
109
- dataIndex: 'id',
110
- },
111
- {
112
- title: contextLocale.value.columns.name,
113
- dataIndex: 'name',
106
+ const myColumns = computed(() => {
107
+ if (props.columns) {
108
+ return props.columns.map(item => ({
109
+ title: item.title,
110
+ dataIndex: item.dataIndex
111
+ }));
114
112
  }
115
- ]);
113
+ return [
114
+ {
115
+ title: contextLocale.value.columns.sign,
116
+ dataIndex: 'id',
117
+ },
118
+ {
119
+ title: contextLocale.value.columns.name,
120
+ dataIndex: 'name',
121
+ }
122
+ ];
123
+ });
116
124
  const selectedTableRow = (record) => {
117
125
  tableTool.scrollTo({
118
126
  ...record,
@@ -272,7 +280,7 @@ const __sfc_main__ = Object.assign({
272
280
  ref_key: "tableRef",
273
281
  ref: tableRef,
274
282
  "data-source": filterArray.value,
275
- columns: __props.columns || myColumns,
283
+ columns: myColumns.value,
276
284
  height: tableHeight.value,
277
285
  disableMenu: false,
278
286
  cellHeight: 36,
@@ -42,7 +42,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
42
42
  "onDesc": "setup-const"
43
43
  } */
44
44
  import { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
45
- const _withScopeId = n => (_pushScopeId("data-v-1744355448129"), n = n(), _popScopeId(), n);
45
+ const _withScopeId = n => (_pushScopeId("data-v-1744361871288"), n = n(), _popScopeId(), n);
46
46
  const _hoisted_1 = { class: "jetlinks-table-sort-content" };
47
47
  const _hoisted_2 = { class: "jetlinks-table-sort-title" };
48
48
  const _hoisted_3 = { class: "table-sort-body" };
@@ -44,10 +44,6 @@ var bodyProps = exports.bodyProps = function bodyProps() {
44
44
  return [];
45
45
  }
46
46
  },
47
- searchColumns: {
48
- type: Array,
49
- default: undefined
50
- },
51
47
  cellHeight: {
52
48
  type: Number,
53
49
  default: 50
@@ -1,12 +1,27 @@
1
+ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
2
+ const op = ops[i];
3
+ const fn = ops[i + 1];
4
+ i += 2;
5
+ if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
6
+ return undefined;
7
+ }
8
+ if (op === 'access' || op === 'optionalAccess') {
9
+ lastAccessLHS = value;
10
+ value = fn(value);
11
+ }
12
+ else if (op === 'call' || op === 'optionalCall') {
13
+ value = fn((...args) => value.call(lastAccessLHS, ...args));
14
+ lastAccessLHS = undefined;
15
+ }
16
+ } return value; }
1
17
  /* Analyzed bindings: {
2
18
  "data": "props",
3
19
  "showSearch": "props",
4
20
  "showInvert": "props",
5
- "fieldNames": "props",
6
21
  "request": "props",
7
22
  "flamegraph": "setup-maybe-ref",
8
23
  "d3": "setup-const",
9
- "onMounted": "setup-const",
24
+ "nextTick": "setup-const",
10
25
  "watch": "setup-const",
11
26
  "ref": "setup-const",
12
27
  "computed": "setup-const",
@@ -20,9 +35,10 @@
20
35
  } */
21
36
  import { resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
22
37
  const _hoisted_1 = { class: "j-flame-graph" };
38
+ const _hoisted_2 = { class: "actions" };
23
39
  import { flamegraph } from 'd3-flame-graph';
24
40
  import * as d3 from 'd3';
25
- import { onMounted, watch, ref, computed } from 'vue';
41
+ import { nextTick, watch, ref, computed } from 'vue';
26
42
  const __sfc_main__ = Object.assign({
27
43
  name: 'JFlameGraph',
28
44
  }, {
@@ -38,14 +54,6 @@ const __sfc_main__ = Object.assign({
38
54
  type: Boolean,
39
55
  default: true
40
56
  },
41
- fieldNames: {
42
- type: Object,
43
- default: () => ({
44
- name: 'className',
45
- value: 'samples',
46
- children: 'children'
47
- })
48
- },
49
57
  request: {
50
58
  type: Function,
51
59
  }
@@ -64,19 +72,15 @@ const __sfc_main__ = Object.assign({
64
72
  const formatData = computed(() => {
65
73
  return (val) => {
66
74
  function formatDataFn(newVal) {
67
- newVal.name = newVal[props.fieldNames.name];
68
- newVal.value = newVal[props.fieldNames.value];
69
- if (newVal[props.fieldNames.children] || newVal.children) {
70
- newVal[props.fieldNames.children || 'children'].forEach(item => {
75
+ _optionalChain([newVal, 'access', _2 => _2.children, 'optionalAccess', _3 => _3.forEach, 'call', _4 => _4(item => {
71
76
  formatDataFn(item);
72
- });
73
- }
77
+ })]);
74
78
  }
75
79
  //格式化数据,增加根节点root
76
80
  const obj = {
77
- [props.fieldNames.name]: 'root',
78
- [props.fieldNames.value]: val.map(item => item[props.fieldNames.value]).reduce((a, b) => a + b, 0),
79
- [props.fieldNames.children || 'children']: val
81
+ name: 'root',
82
+ value: val.map(item => item.value).reduce((a, b) => a + b, 0),
83
+ children: val
80
84
  };
81
85
  formatDataFn(obj);
82
86
  return obj;
@@ -89,36 +93,38 @@ const __sfc_main__ = Object.assign({
89
93
  .datum(formatData.value(props.data))
90
94
  .call(chart);
91
95
  };
92
- onMounted(() => {
93
- watch(() => props.data, (newVal, oldVal) => {
94
- if (newVal) {
96
+ watch(() => props.data, (newVal, oldVal) => {
97
+ if (newVal) {
98
+ nextTick(() => {
95
99
  d3.select(flameGraphRef.value)
96
100
  .datum(formatData.value(newVal))
97
101
  .call(chart);
98
- }
99
- }, { immediate: true });
100
- });
102
+ });
103
+ }
104
+ }, { immediate: true });
101
105
  return (_ctx, _cache) => {
102
106
  const _component_a_input_search = _resolveComponent("a-input-search");
103
107
  const _component_a_button = _resolveComponent("a-button");
104
108
  const _component_a_space = _resolveComponent("a-space");
105
109
  return (_openBlock(), _createElementBlock("div", _hoisted_1, [
106
- _createVNode(_component_a_space, null, {
107
- default: _withCtx(() => [
108
- _createVNode(_component_a_input_search, {
109
- class: "j-flame-graph-search",
110
- placeholder: "请输入",
111
- onSearch: search
112
- }),
113
- _createVNode(_component_a_button, { onClick: invert }, {
114
- default: _withCtx(() => [
115
- _createTextVNode("反转")
116
- ]),
117
- _: 1 /* STABLE */
118
- })
119
- ]),
120
- _: 1 /* STABLE */
121
- }),
110
+ _createElementVNode("div", _hoisted_2, [
111
+ _createVNode(_component_a_space, null, {
112
+ default: _withCtx(() => [
113
+ _createVNode(_component_a_input_search, {
114
+ class: "j-flame-graph-search",
115
+ placeholder: "请输入",
116
+ onSearch: search
117
+ }),
118
+ _createVNode(_component_a_button, { onClick: invert }, {
119
+ default: _withCtx(() => [
120
+ _createTextVNode("反转")
121
+ ]),
122
+ _: 1 /* STABLE */
123
+ })
124
+ ]),
125
+ _: 1 /* STABLE */
126
+ })
127
+ ]),
122
128
  _createElementVNode("div", {
123
129
  ref_key: "flameGraphRef",
124
130
  ref: flameGraphRef
@@ -1,7 +1,17 @@
1
1
  .j-flame-graph {
2
2
  position: relative;
3
+ width: 100%;
4
+ height: 100%;
5
+ overflow: auto;
3
6
  /* 修改矩形块样式 */
4
7
  }
8
+ .j-flame-graph .actions {
9
+ position: sticky;
10
+ top: 0;
11
+ left: 0;
12
+ padding: 10px;
13
+ background: #fff;
14
+ }
5
15
  .j-flame-graph .d3-flame-graph {
6
16
  margin-top: 40px;
7
17
  }
@@ -1,43 +1,52 @@
1
- .j-flame-graph {
2
- position: relative;
3
-
4
- .d3-flame-graph {
5
- margin-top: 40px;
6
- }
7
- /* 修改矩形块样式 */
8
- .d3-flame-graph {
9
- rect {
10
- stroke: #fff;
11
- stroke-width: 1px;
12
- }
13
-
14
- text {
15
- font-size: 18px;
16
- fill: #333;
17
- }
18
- }
19
-
20
- .frame {
21
- cursor: pointer;
22
- }
23
- .frame:hover {
24
- fill: #E600E6;
25
- }
26
- .frame:hover rect {
27
- fill: #ffffe0;
28
- }
29
- .frame div {
30
- color: #000
31
- }
32
-
33
- .j-flame-graph-search {
34
- position: sticky;
35
- top: 0;
36
- left: 0;
37
- width: 200px;
38
- }
39
- }
40
-
41
-
42
-
43
-
1
+ .j-flame-graph {
2
+ position: relative;
3
+ width: 100%;
4
+ height: 100%;
5
+ overflow: auto;
6
+ .actions {
7
+ position: sticky;
8
+ top: 0;
9
+ left: 0;
10
+ padding: 10px;
11
+ background: #fff;
12
+ }
13
+ .d3-flame-graph {
14
+ margin-top: 40px;
15
+ }
16
+ /* 修改矩形块样式 */
17
+ .d3-flame-graph {
18
+ rect {
19
+ stroke: #fff;
20
+ stroke-width: 1px;
21
+ }
22
+
23
+ text {
24
+ font-size: 18px;
25
+ fill: #333;
26
+ }
27
+ }
28
+
29
+ .frame {
30
+ cursor: pointer;
31
+ }
32
+ .frame:hover {
33
+ fill: #E600E6;
34
+ }
35
+ .frame:hover rect {
36
+ fill: #ffffe0;
37
+ }
38
+ .frame div {
39
+ color: #000
40
+ }
41
+
42
+ .j-flame-graph-search {
43
+ position: sticky;
44
+ top: 0;
45
+ left: 0;
46
+ width: 200px;
47
+ }
48
+ }
49
+
50
+
51
+
52
+
@@ -9,7 +9,7 @@
9
9
  } */
10
10
  import { defineComponent as _defineComponent } from 'vue';
11
11
  import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
12
- const _withScopeId = n => (_pushScopeId("data-v-1744355443271"), n = n(), _popScopeId(), n);
12
+ const _withScopeId = n => (_pushScopeId("data-v-1744361869027"), n = n(), _popScopeId(), n);
13
13
  const _hoisted_1 = { class: "full-page-warp-content" };
14
14
  import { ref, inject } from 'vue';
15
15
  import { useElementBounding } from '@vueuse/core';
@@ -23,7 +23,7 @@
23
23
  } */
24
24
  import { defineComponent as _defineComponent } from 'vue';
25
25
  import { unref as _unref, createVNode as _createVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
26
- const _withScopeId = n => (_pushScopeId("data-v-1744355447819"), n = n(), _popScopeId(), n);
26
+ const _withScopeId = n => (_pushScopeId("data-v-1744361871121"), n = n(), _popScopeId(), n);
27
27
  const _hoisted_1 = {
28
28
  key: 0,
29
29
  style: { "width": "240px" }
@@ -80,7 +80,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
80
80
  } */
81
81
  import { defineComponent as _defineComponent } from 'vue';
82
82
  import { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, createVNode as _createVNode, Fragment as _Fragment, normalizeStyle as _normalizeStyle, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
83
- const _withScopeId = n => (_pushScopeId("data-v-1744355446011"), n = n(), _popScopeId(), n);
83
+ const _withScopeId = n => (_pushScopeId("data-v-1744361870525"), n = n(), _popScopeId(), n);
84
84
  const _hoisted_1 = { class: "JSearch-item" };
85
85
  const _hoisted_2 = {
86
86
  key: 0,
@@ -5179,8 +5179,18 @@ span.ant-radio + * {
5179
5179
  }
5180
5180
  .j-flame-graph {
5181
5181
  position: relative;
5182
+ width: 100%;
5183
+ height: 100%;
5184
+ overflow: auto;
5182
5185
  /* 修改矩形块样式 */
5183
5186
  }
5187
+ .j-flame-graph .actions {
5188
+ position: sticky;
5189
+ top: 0;
5190
+ left: 0;
5191
+ padding: 10px;
5192
+ background: #fff;
5193
+ }
5184
5194
  .j-flame-graph .d3-flame-graph {
5185
5195
  margin-top: 40px;
5186
5196
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetlinks-web/components",
3
- "version": "2.6.7",
3
+ "version": "2.6.9",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -158,8 +158,8 @@
158
158
  "webpack-dev-server": "^4.0.0",
159
159
  "webpack-merge": "^5.0.0",
160
160
  "webpackbar": "^5.0.2",
161
- "@jetlinks-web/hooks": "^1.0.25",
162
161
  "@jetlinks-web/constants": "^1.0.9",
162
+ "@jetlinks-web/hooks": "^1.0.25",
163
163
  "@jetlinks-web/utils": "^1.2.8"
164
164
  },
165
165
  "publishConfig": {