@jetlinks-web/components 2.6.9 → 2.6.10

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.
@@ -29,6 +29,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
29
29
  "onBeforeUnmount": "setup-const",
30
30
  "nextTick": "setup-const",
31
31
  "Empty": "setup-const",
32
+ "CellRender": "setup-const",
32
33
  "props": "setup-reactive-const",
33
34
  "emit": "setup-const",
34
35
  "viewScrollRef": "setup-ref",
@@ -47,7 +48,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
47
48
  "rowClick": "setup-const",
48
49
  "updateSelectedKeys": "setup-const"
49
50
  } */
50
- import { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createCommentVNode as _createCommentVNode, withModifiers as _withModifiers, normalizeClass as _normalizeClass, createVNode as _createVNode } from "vue";
51
+ import { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createCommentVNode as _createCommentVNode, createBlock as _createBlock, withModifiers as _withModifiers, normalizeClass as _normalizeClass, createVNode as _createVNode } from "vue";
51
52
  const _hoisted_1 = { style: { position: 'relative' } };
52
53
  const _hoisted_2 = ["data-row-key", "onContextmenu", "onClick"];
53
54
  const _hoisted_3 = {
@@ -69,6 +70,7 @@ import { randomString } from "@jetlinks-web/utils";
69
70
  import { bodyProps } from "./props";
70
71
  import { ref, reactive, computed, watch, onMounted, onBeforeUnmount, nextTick } from 'vue';
71
72
  import Empty from '../Empty/Empty.js';
73
+ import CellRender from './CellRender.js';
72
74
  const __sfc_main__ = Object.assign({
73
75
  name: 'JEditTableBody'
74
76
  }, {
@@ -254,7 +256,17 @@ const __sfc_main__ = Object.assign({
254
256
  index: item.__dataIndex,
255
257
  column: column
256
258
  }, () => [
257
- _createTextVNode(_toDisplayString(item[column.dataIndex]), 1 /* TEXT */)
259
+ (column.customRender)
260
+ ? (_openBlock(), _createBlock(CellRender, {
261
+ key: 0,
262
+ record: item,
263
+ value: item[column.dataIndex],
264
+ index: item.__dataIndex,
265
+ "render-fn": column.customRender
266
+ }, null, 8 /* PROPS */, ["record", "value", "index", "render-fn"]))
267
+ : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
268
+ _createTextVNode(_toDisplayString(item[column.dataIndex]), 1 /* TEXT */)
269
+ ], 64 /* STABLE_FRAGMENT */))
258
270
  ])
259
271
  ]))
260
272
  ], 4 /* STYLE */));
@@ -0,0 +1,12 @@
1
+ /* Analyzed bindings: {} */
2
+ import { defineComponent } from 'vue';
3
+ const __sfc_main__ = defineComponent({
4
+ name: "CellRender",
5
+ props: ['renderFn', 'value', 'record', 'index'],
6
+ setup(props) {
7
+ return () => {
8
+ return props.renderFn(props.value, props.record, props.index);
9
+ };
10
+ }
11
+ });
12
+ export default __sfc_main__;
@@ -85,6 +85,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
85
85
  "removeFieldError": "setup-const",
86
86
  "addFieldError": "setup-const",
87
87
  "scrollWidth": "setup-ref",
88
+ "handleColumns": "setup-const",
88
89
  "onResize": "setup-const",
89
90
  "onScrollDown": "setup-const",
90
91
  "rightMenu": "setup-const",
@@ -309,13 +310,7 @@ const __sfc_main__ = Object.assign({
309
310
  const scrollWidth = computed(() => {
310
311
  return (props.dataSource.length * props.cellHeight) > props.height ? scrollDefaultWidth.value : 0;
311
312
  });
312
- function onResize({ width = 0 }) {
313
- const _width = width - scrollWidth.value;
314
- tableStyle.width = width || '100%';
315
- // const viewportDom = document.querySelector('.jetlinks-edit-table-body-viewport')
316
- // const viewportDivDom = viewportDom.querySelector('div')
317
- //
318
- // scrollDefaultWidth.value = viewportDom.offsetWidth - viewportDivDom.offsetWidth
313
+ const handleColumns = () => {
319
314
  let newColumns = [...props.columns];
320
315
  if (props.serial) {
321
316
  const serial = {
@@ -331,7 +326,16 @@ const __sfc_main__ = Object.assign({
331
326
  };
332
327
  newColumns = [serial, ...props.columns];
333
328
  }
334
- myColumns.value = handleColumnsWidth(newColumns, _width);
329
+ myColumns.value = handleColumnsWidth(newColumns, tableStyle.width - scrollWidth.value);
330
+ };
331
+ function onResize({ width = 0 }) {
332
+ const _width = width - scrollWidth.value;
333
+ tableStyle.width = width || '100%';
334
+ // const viewportDom = document.querySelector('.jetlinks-edit-table-body-viewport')
335
+ // const viewportDivDom = viewportDom.querySelector('div')
336
+ //
337
+ // scrollDefaultWidth.value = viewportDom.offsetWidth - viewportDivDom.offsetWidth
338
+ handleColumns();
335
339
  }
336
340
  const onScrollDown = (len) => {
337
341
  emit('scrollDown', len);
@@ -398,6 +402,9 @@ const __sfc_main__ = Object.assign({
398
402
  watch(() => scrollWidth.value, () => {
399
403
  onResize({ width: tableStyle.width });
400
404
  });
405
+ watch(() => [JSON.stringify(props.columns), tableStyle.width], () => {
406
+ handleColumns();
407
+ });
401
408
  useFormContext({
402
409
  dataSource: computed(() => {
403
410
  return props.dataSource;
@@ -24,26 +24,30 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
24
24
  "reactive": "setup-const",
25
25
  "defineOptions": "setup-const",
26
26
  "useTableTool": "setup-maybe-ref",
27
+ "HeaderItemRender": "setup-const",
27
28
  "props": "setup-reactive-const",
28
29
  "tableTool": "setup-maybe-ref",
29
30
  "searchData": "setup-reactive-const",
30
31
  "showFilter": "setup-const",
31
32
  "sortClick": "setup-const"
32
33
  } */
33
- import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, unref as _unref, mergeProps as _mergeProps, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle } from "vue";
34
+ import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, unref as _unref, mergeProps as _mergeProps, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle } from "vue";
34
35
  const _hoisted_1 = ["id"];
35
36
  const _hoisted_2 = { class: "table-header-cell-title" };
36
- const _hoisted_3 = {
37
+ const _hoisted_3 = { class: "cell-title-box" };
38
+ const _hoisted_4 = { key: 1 };
39
+ const _hoisted_5 = {
37
40
  key: 0,
38
41
  class: "header-cell-required"
39
42
  };
40
- const _hoisted_4 = {
43
+ const _hoisted_6 = {
41
44
  key: 0,
42
45
  class: "table-header-cell-trigger"
43
46
  };
44
47
  import { SearchModal, Sort } from './components/Search';
45
48
  import { reactive, } from 'vue';
46
49
  import { useTableTool } from "./hooks";
50
+ import HeaderItemRender from './HeaderRender.js';
47
51
  const __sfc_main__ = Object.assign({
48
52
  name: 'JEditTableHeader'
49
53
  }, {
@@ -95,13 +99,21 @@ const __sfc_main__ = Object.assign({
95
99
  class: _normalizeClass({ 'jetlinks-edit-table-header-cell-box': true, 'header-cell-box-tool': !!(item.sort || item.filter) })
96
100
  }, [
97
101
  _createElementVNode("div", _hoisted_2, [
98
- _createElementVNode("span", null, _toDisplayString(item.title), 1 /* TEXT */),
102
+ _createElementVNode("div", _hoisted_3, [
103
+ (item.render)
104
+ ? (_openBlock(), _createBlock(HeaderItemRender, {
105
+ key: 0,
106
+ "render-fn": item.render,
107
+ value: item.title
108
+ }, null, 8 /* PROPS */, ["render-fn", "value"]))
109
+ : (_openBlock(), _createElementBlock("span", _hoisted_4, _toDisplayString(item.title), 1 /* TEXT */))
110
+ ]),
99
111
  (_optionalChain([item, 'access', _ => _.form, 'optionalAccess', _2 => _2.required]))
100
- ? (_openBlock(), _createElementBlock("span", _hoisted_3, "*"))
112
+ ? (_openBlock(), _createElementBlock("span", _hoisted_5, "*"))
101
113
  : _createCommentVNode("v-if", true)
102
114
  ]),
103
115
  (!!(item.sort || item.filter))
104
- ? (_openBlock(), _createElementBlock("div", _hoisted_4, [
116
+ ? (_openBlock(), _createElementBlock("div", _hoisted_6, [
105
117
  (item.filter)
106
118
  ? (_openBlock(), _createBlock(_component_AIcon, {
107
119
  key: 0,
@@ -0,0 +1,12 @@
1
+ /* Analyzed bindings: {} */
2
+ import { defineComponent } from 'vue';
3
+ const __sfc_main__ = defineComponent({
4
+ name: "HeaderItemRender",
5
+ props: ['renderFn', 'value'],
6
+ setup(props) {
7
+ return () => {
8
+ return props.renderFn(props.value);
9
+ };
10
+ }
11
+ });
12
+ export default __sfc_main__;
@@ -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-1744361871270"), n = n(), _popScopeId(), n);
45
+ const _withScopeId = n => (_pushScopeId("data-v-1744627839929"), 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" };
@@ -26,6 +26,11 @@
26
26
  display: flex;
27
27
  align-items: center;
28
28
  font-weight: 600;
29
+ gap: 4px;
30
+
31
+ .cell-title-box {
32
+ flex: 1 1 auto;
33
+ }
29
34
  }
30
35
 
31
36
  .header-cell-required {
@@ -116,6 +116,10 @@
116
116
  display: flex;
117
117
  align-items: center;
118
118
  font-weight: 600;
119
+ gap: 4px;
120
+ }
121
+ .jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box .table-header-cell-title .cell-title-box {
122
+ flex: 1 1 auto;
119
123
  }
120
124
  .jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box .header-cell-required {
121
125
  color: #ff4d4f;
@@ -1,5 +1,4 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
- import { omit } from "lodash-es";
1
+ import { cloneDeep, omit } from "lodash-es";
3
2
  /**
4
3
  * 规则收集器,收集columns中的rules和watch
5
4
  * @param columns
@@ -23,7 +22,8 @@ export var handlePureRecord = function handlePureRecord(record) {
23
22
  return omit(record, ['__serial', '__index', '__top', '__selected', '__key', '__dataIndex']);
24
23
  };
25
24
  export var handleColumnsWidth = function handleColumnsWidth(columns, warpWidth) {
26
- var newColumns = _toConsumableArray(columns);
25
+ // let newColumns = [...columns]
26
+ var newColumns = cloneDeep(columns);
27
27
  var noWidthLen = 0; // 没有width属性的长度
28
28
  var hasWidthCount = 0; // 有width属性的合计
29
29
  var average = 0; // 每个column宽度
@@ -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-1744361869037"), n = n(), _popScopeId(), n);
12
+ const _withScopeId = n => (_pushScopeId("data-v-1744627832838"), 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';
@@ -55,8 +55,7 @@ var PermissionButton = defineComponent({
55
55
  components: undefined
56
56
  });
57
57
  var permission = computed(function () {
58
- var hasOwnPrototype = Object.prototype.hasOwnProperty.call(instance.props, 'hasPermission');
59
- if (props.hasPermission === true || !hasOwnPrototype) {
58
+ if (props.hasPermission === true || props.hasPermission === undefined) {
60
59
  return true;
61
60
  }
62
61
  return hasPerm.value;
@@ -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-1744361871107"), n = n(), _popScopeId(), n);
26
+ const _withScopeId = n => (_pushScopeId("data-v-1744627839108"), 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-1744361870452"), n = n(), _popScopeId(), n);
83
+ const _withScopeId = n => (_pushScopeId("data-v-1744627835608"), n = n(), _popScopeId(), n);
84
84
  const _hoisted_1 = { class: "JSearch-item" };
85
85
  const _hoisted_2 = {
86
86
  key: 0,
@@ -4940,6 +4940,10 @@ span.ant-radio + * {
4940
4940
  display: flex;
4941
4941
  align-items: center;
4942
4942
  font-weight: 600;
4943
+ gap: 4px;
4944
+ }
4945
+ .jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box .table-header-cell-title .cell-title-box {
4946
+ flex: 1 1 auto;
4943
4947
  }
4944
4948
  .jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box .header-cell-required {
4945
4949
  color: #ff4d4f;
@@ -29,6 +29,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
29
29
  "onBeforeUnmount": "setup-const",
30
30
  "nextTick": "setup-const",
31
31
  "Empty": "setup-const",
32
+ "CellRender": "setup-const",
32
33
  "props": "setup-reactive-const",
33
34
  "emit": "setup-const",
34
35
  "viewScrollRef": "setup-ref",
@@ -47,7 +48,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
47
48
  "rowClick": "setup-const",
48
49
  "updateSelectedKeys": "setup-const"
49
50
  } */
50
- import { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createCommentVNode as _createCommentVNode, withModifiers as _withModifiers, normalizeClass as _normalizeClass, createVNode as _createVNode } from "vue";
51
+ import { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createCommentVNode as _createCommentVNode, createBlock as _createBlock, withModifiers as _withModifiers, normalizeClass as _normalizeClass, createVNode as _createVNode } from "vue";
51
52
  const _hoisted_1 = { style: { position: 'relative' } };
52
53
  const _hoisted_2 = ["data-row-key", "onContextmenu", "onClick"];
53
54
  const _hoisted_3 = {
@@ -69,6 +70,7 @@ import { randomString } from "@jetlinks-web/utils";
69
70
  import { bodyProps } from "./props";
70
71
  import { ref, reactive, computed, watch, onMounted, onBeforeUnmount, nextTick } from 'vue';
71
72
  import Empty from '../Empty/Empty.js';
73
+ import CellRender from './CellRender.js';
72
74
  const __sfc_main__ = Object.assign({
73
75
  name: 'JEditTableBody'
74
76
  }, {
@@ -254,7 +256,17 @@ const __sfc_main__ = Object.assign({
254
256
  index: item.__dataIndex,
255
257
  column: column
256
258
  }, () => [
257
- _createTextVNode(_toDisplayString(item[column.dataIndex]), 1 /* TEXT */)
259
+ (column.customRender)
260
+ ? (_openBlock(), _createBlock(CellRender, {
261
+ key: 0,
262
+ record: item,
263
+ value: item[column.dataIndex],
264
+ index: item.__dataIndex,
265
+ "render-fn": column.customRender
266
+ }, null, 8 /* PROPS */, ["record", "value", "index", "render-fn"]))
267
+ : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
268
+ _createTextVNode(_toDisplayString(item[column.dataIndex]), 1 /* TEXT */)
269
+ ], 64 /* STABLE_FRAGMENT */))
258
270
  ])
259
271
  ]))
260
272
  ], 4 /* STYLE */));
@@ -0,0 +1,12 @@
1
+ /* Analyzed bindings: {} */
2
+ import { defineComponent } from 'vue';
3
+ const __sfc_main__ = defineComponent({
4
+ name: "CellRender",
5
+ props: ['renderFn', 'value', 'record', 'index'],
6
+ setup(props) {
7
+ return () => {
8
+ return props.renderFn(props.value, props.record, props.index);
9
+ };
10
+ }
11
+ });
12
+ export default __sfc_main__;
@@ -85,6 +85,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
85
85
  "removeFieldError": "setup-const",
86
86
  "addFieldError": "setup-const",
87
87
  "scrollWidth": "setup-ref",
88
+ "handleColumns": "setup-const",
88
89
  "onResize": "setup-const",
89
90
  "onScrollDown": "setup-const",
90
91
  "rightMenu": "setup-const",
@@ -309,13 +310,7 @@ const __sfc_main__ = Object.assign({
309
310
  const scrollWidth = computed(() => {
310
311
  return (props.dataSource.length * props.cellHeight) > props.height ? scrollDefaultWidth.value : 0;
311
312
  });
312
- function onResize({ width = 0 }) {
313
- const _width = width - scrollWidth.value;
314
- tableStyle.width = width || '100%';
315
- // const viewportDom = document.querySelector('.jetlinks-edit-table-body-viewport')
316
- // const viewportDivDom = viewportDom.querySelector('div')
317
- //
318
- // scrollDefaultWidth.value = viewportDom.offsetWidth - viewportDivDom.offsetWidth
313
+ const handleColumns = () => {
319
314
  let newColumns = [...props.columns];
320
315
  if (props.serial) {
321
316
  const serial = {
@@ -331,7 +326,16 @@ const __sfc_main__ = Object.assign({
331
326
  };
332
327
  newColumns = [serial, ...props.columns];
333
328
  }
334
- myColumns.value = handleColumnsWidth(newColumns, _width);
329
+ myColumns.value = handleColumnsWidth(newColumns, tableStyle.width - scrollWidth.value);
330
+ };
331
+ function onResize({ width = 0 }) {
332
+ const _width = width - scrollWidth.value;
333
+ tableStyle.width = width || '100%';
334
+ // const viewportDom = document.querySelector('.jetlinks-edit-table-body-viewport')
335
+ // const viewportDivDom = viewportDom.querySelector('div')
336
+ //
337
+ // scrollDefaultWidth.value = viewportDom.offsetWidth - viewportDivDom.offsetWidth
338
+ handleColumns();
335
339
  }
336
340
  const onScrollDown = (len) => {
337
341
  emit('scrollDown', len);
@@ -398,6 +402,9 @@ const __sfc_main__ = Object.assign({
398
402
  watch(() => scrollWidth.value, () => {
399
403
  onResize({ width: tableStyle.width });
400
404
  });
405
+ watch(() => [JSON.stringify(props.columns), tableStyle.width], () => {
406
+ handleColumns();
407
+ });
401
408
  useFormContext({
402
409
  dataSource: computed(() => {
403
410
  return props.dataSource;
@@ -24,26 +24,30 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
24
24
  "reactive": "setup-const",
25
25
  "defineOptions": "setup-const",
26
26
  "useTableTool": "setup-maybe-ref",
27
+ "HeaderItemRender": "setup-const",
27
28
  "props": "setup-reactive-const",
28
29
  "tableTool": "setup-maybe-ref",
29
30
  "searchData": "setup-reactive-const",
30
31
  "showFilter": "setup-const",
31
32
  "sortClick": "setup-const"
32
33
  } */
33
- import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, unref as _unref, mergeProps as _mergeProps, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle } from "vue";
34
+ import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, unref as _unref, mergeProps as _mergeProps, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle } from "vue";
34
35
  const _hoisted_1 = ["id"];
35
36
  const _hoisted_2 = { class: "table-header-cell-title" };
36
- const _hoisted_3 = {
37
+ const _hoisted_3 = { class: "cell-title-box" };
38
+ const _hoisted_4 = { key: 1 };
39
+ const _hoisted_5 = {
37
40
  key: 0,
38
41
  class: "header-cell-required"
39
42
  };
40
- const _hoisted_4 = {
43
+ const _hoisted_6 = {
41
44
  key: 0,
42
45
  class: "table-header-cell-trigger"
43
46
  };
44
47
  import { SearchModal, Sort } from './components/Search';
45
48
  import { reactive, } from 'vue';
46
49
  import { useTableTool } from "./hooks";
50
+ import HeaderItemRender from './HeaderRender.js';
47
51
  const __sfc_main__ = Object.assign({
48
52
  name: 'JEditTableHeader'
49
53
  }, {
@@ -95,13 +99,21 @@ const __sfc_main__ = Object.assign({
95
99
  class: _normalizeClass({ 'jetlinks-edit-table-header-cell-box': true, 'header-cell-box-tool': !!(item.sort || item.filter) })
96
100
  }, [
97
101
  _createElementVNode("div", _hoisted_2, [
98
- _createElementVNode("span", null, _toDisplayString(item.title), 1 /* TEXT */),
102
+ _createElementVNode("div", _hoisted_3, [
103
+ (item.render)
104
+ ? (_openBlock(), _createBlock(HeaderItemRender, {
105
+ key: 0,
106
+ "render-fn": item.render,
107
+ value: item.title
108
+ }, null, 8 /* PROPS */, ["render-fn", "value"]))
109
+ : (_openBlock(), _createElementBlock("span", _hoisted_4, _toDisplayString(item.title), 1 /* TEXT */))
110
+ ]),
99
111
  (_optionalChain([item, 'access', _ => _.form, 'optionalAccess', _2 => _2.required]))
100
- ? (_openBlock(), _createElementBlock("span", _hoisted_3, "*"))
112
+ ? (_openBlock(), _createElementBlock("span", _hoisted_5, "*"))
101
113
  : _createCommentVNode("v-if", true)
102
114
  ]),
103
115
  (!!(item.sort || item.filter))
104
- ? (_openBlock(), _createElementBlock("div", _hoisted_4, [
116
+ ? (_openBlock(), _createElementBlock("div", _hoisted_6, [
105
117
  (item.filter)
106
118
  ? (_openBlock(), _createBlock(_component_AIcon, {
107
119
  key: 0,
@@ -0,0 +1,12 @@
1
+ /* Analyzed bindings: {} */
2
+ import { defineComponent } from 'vue';
3
+ const __sfc_main__ = defineComponent({
4
+ name: "HeaderItemRender",
5
+ props: ['renderFn', 'value'],
6
+ setup(props) {
7
+ return () => {
8
+ return props.renderFn(props.value);
9
+ };
10
+ }
11
+ });
12
+ export default __sfc_main__;
@@ -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-1744361871288"), n = n(), _popScopeId(), n);
45
+ const _withScopeId = n => (_pushScopeId("data-v-1744627839975"), 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" };
@@ -26,6 +26,11 @@
26
26
  display: flex;
27
27
  align-items: center;
28
28
  font-weight: 600;
29
+ gap: 4px;
30
+
31
+ .cell-title-box {
32
+ flex: 1 1 auto;
33
+ }
29
34
  }
30
35
 
31
36
  .header-cell-required {
@@ -116,6 +116,10 @@
116
116
  display: flex;
117
117
  align-items: center;
118
118
  font-weight: 600;
119
+ gap: 4px;
120
+ }
121
+ .jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box .table-header-cell-title .cell-title-box {
122
+ flex: 1 1 auto;
119
123
  }
120
124
  .jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box .header-cell-required {
121
125
  color: #ff4d4f;
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.isFullScreen = exports.handlePureRecord = exports.handleColumnsWidth = exports.collectValidateRules = void 0;
8
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
7
  var _lodashEs = require("lodash");
10
8
  /**
11
9
  * 规则收集器,收集columns中的rules和watch
@@ -30,7 +28,8 @@ var handlePureRecord = exports.handlePureRecord = function handlePureRecord(reco
30
28
  return (0, _lodashEs.omit)(record, ['__serial', '__index', '__top', '__selected', '__key', '__dataIndex']);
31
29
  };
32
30
  var handleColumnsWidth = exports.handleColumnsWidth = function handleColumnsWidth(columns, warpWidth) {
33
- var newColumns = (0, _toConsumableArray2.default)(columns);
31
+ // let newColumns = [...columns]
32
+ var newColumns = (0, _lodashEs.cloneDeep)(columns);
34
33
  var noWidthLen = 0; // 没有width属性的长度
35
34
  var hasWidthCount = 0; // 有width属性的合计
36
35
  var average = 0; // 每个column宽度
@@ -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-1744361869027"), n = n(), _popScopeId(), n);
12
+ const _withScopeId = n => (_pushScopeId("data-v-1744627832852"), 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';
@@ -62,8 +62,7 @@ var PermissionButton = (0, _vue.defineComponent)({
62
62
  components: undefined
63
63
  });
64
64
  var permission = (0, _vue.computed)(function () {
65
- var hasOwnPrototype = Object.prototype.hasOwnProperty.call(instance.props, 'hasPermission');
66
- if (props.hasPermission === true || !hasOwnPrototype) {
65
+ if (props.hasPermission === true || props.hasPermission === undefined) {
67
66
  return true;
68
67
  }
69
68
  return hasPerm.value;
@@ -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-1744361871121"), n = n(), _popScopeId(), n);
26
+ const _withScopeId = n => (_pushScopeId("data-v-1744627839173"), 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-1744361870525"), n = n(), _popScopeId(), n);
83
+ const _withScopeId = n => (_pushScopeId("data-v-1744627835796"), n = n(), _popScopeId(), n);
84
84
  const _hoisted_1 = { class: "JSearch-item" };
85
85
  const _hoisted_2 = {
86
86
  key: 0,
@@ -4940,6 +4940,10 @@ span.ant-radio + * {
4940
4940
  display: flex;
4941
4941
  align-items: center;
4942
4942
  font-weight: 600;
4943
+ gap: 4px;
4944
+ }
4945
+ .jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box .table-header-cell-title .cell-title-box {
4946
+ flex: 1 1 auto;
4943
4947
  }
4944
4948
  .jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box .header-cell-required {
4945
4949
  color: #ff4d4f;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetlinks-web/components",
3
- "version": "2.6.9",
3
+ "version": "2.6.10",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -160,7 +160,7 @@
160
160
  "webpackbar": "^5.0.2",
161
161
  "@jetlinks-web/constants": "^1.0.9",
162
162
  "@jetlinks-web/hooks": "^1.0.25",
163
- "@jetlinks-web/utils": "^1.2.8"
163
+ "@jetlinks-web/utils": "^1.2.9"
164
164
  },
165
165
  "publishConfig": {
166
166
  "registry": "https://registry.npmjs.org/",