cnhis-design-vue 3.3.3-beta.45 → 3.3.3-beta.46

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.
@@ -52,6 +52,7 @@ declare const _default: import("vue").DefineComponent<{
52
52
  titleRender?: ((column: AnyObject) => import("vue").VNodeChild) | undefined;
53
53
  hide?: boolean | undefined;
54
54
  positionField?: string | undefined;
55
+ showPrevFn?: ((column: FieldSetColumnItem, row: AnyObject) => boolean) | undefined;
55
56
  }[]>;
56
57
  rowProps: {
57
58
  columns: {
@@ -67,6 +68,7 @@ declare const _default: import("vue").DefineComponent<{
67
68
  titleRender?: ((column: AnyObject) => import("vue").VNodeChild) | undefined;
68
69
  hide?: boolean | undefined;
69
70
  positionField?: string | undefined;
71
+ showPrevFn?: ((column: FieldSetColumnItem, row: AnyObject) => boolean) | undefined;
70
72
  }[];
71
73
  data: AnyObject[];
72
74
  onEdit: ({ row, readonly: _readonly, add }: AnyObject) => void;
@@ -358,12 +360,13 @@ declare const _default: import("vue").DefineComponent<{
358
360
  emit: (event: "edit" | "updateChecked", ...args: any[]) => void;
359
361
  onRemove: () => void;
360
362
  onEdit: (param?: AnyObject) => void;
363
+ prevFunc: (column: AnyObject) => any;
361
364
  isRenderTooltip: (field: string) => any;
362
365
  getTooltipContent: () => any;
363
366
  getTextValue: (field: string) => any;
364
367
  isMultiple: (field: string) => boolean;
365
368
  isRender: (field: string) => boolean;
366
- isShow: (field: string) => any;
369
+ isShow: (column: AnyObject) => any;
367
370
  showRelation: (field: string) => boolean;
368
371
  getSortPriorityOptions: () => {
369
372
  label: string;
@@ -48,6 +48,7 @@ declare const _default: import("vue").DefineComponent<{
48
48
  titleRender?: ((column: AnyObject) => import("vue").VNodeChild) | undefined;
49
49
  hide?: boolean | undefined;
50
50
  positionField?: string | undefined;
51
+ showPrevFn?: ((column: FieldSetColumnItem, row: AnyObject) => boolean) | undefined;
51
52
  }[]>;
52
53
  data: import("vue").Ref<{
53
54
  [x: string]: any;
@@ -76,6 +77,7 @@ declare const _default: import("vue").DefineComponent<{
76
77
  titleRender?: ((column: AnyObject) => import("vue").VNodeChild) | undefined;
77
78
  hide?: boolean | undefined;
78
79
  positionField?: string | undefined;
80
+ showPrevFn?: ((column: FieldSetColumnItem, row: AnyObject) => boolean) | undefined;
79
81
  }[];
80
82
  data: {
81
83
  [x: string]: any;
@@ -387,12 +389,13 @@ declare const _default: import("vue").DefineComponent<{
387
389
  emit: (event: "edit" | "updateChecked", ...args: any[]) => void;
388
390
  onRemove: () => void;
389
391
  onEdit: (param?: AnyObject) => void;
392
+ prevFunc: (column: AnyObject) => any;
390
393
  isRenderTooltip: (field: string) => any;
391
394
  getTooltipContent: () => any;
392
395
  getTextValue: (field: string) => any;
393
396
  isMultiple: (field: string) => boolean;
394
397
  isRender: (field: string) => boolean;
395
- isShow: (field: string) => any;
398
+ isShow: (column: AnyObject) => any;
396
399
  showRelation: (field: string) => boolean;
397
400
  getSortPriorityOptions: () => {
398
401
  label: string;
@@ -232,6 +232,7 @@ declare const _default: import("vue").DefineComponent<{
232
232
  titleRender?: ((column: AnyObject) => VNodeChild) | undefined;
233
233
  hide?: boolean | undefined;
234
234
  positionField?: string | undefined;
235
+ showPrevFn?: ((column: FieldSetColumnItem, row: AnyObject) => boolean) | undefined;
235
236
  }[]>;
236
237
  itemWidth: import("vue").ComputedRef<string>;
237
238
  fieldList: import("vue").ComputedRef<AnyObject[]>;
@@ -251,6 +252,7 @@ declare const _default: import("vue").DefineComponent<{
251
252
  titleRender?: ((column: AnyObject) => VNodeChild) | undefined;
252
253
  hide?: boolean | undefined;
253
254
  positionField?: string | undefined;
255
+ showPrevFn?: ((column: FieldSetColumnItem, row: AnyObject) => boolean) | undefined;
254
256
  }[];
255
257
  data: AnyObject[];
256
258
  onUpdateChecked: ({ checked, column }: {
@@ -578,12 +580,13 @@ declare const _default: import("vue").DefineComponent<{
578
580
  emit: (event: "edit" | "updateChecked", ...args: any[]) => void;
579
581
  onRemove: () => void;
580
582
  onEdit: (param?: AnyObject) => void;
583
+ prevFunc: (column: AnyObject) => any;
581
584
  isRenderTooltip: (field: string) => any;
582
585
  getTooltipContent: () => any;
583
586
  getTextValue: (field: string) => any;
584
587
  isMultiple: (field: string) => boolean;
585
588
  isRender: (field: string) => boolean;
586
- isShow: (field: string) => any;
589
+ isShow: (column: AnyObject) => any;
587
590
  showRelation: (field: string) => boolean;
588
591
  getSortPriorityOptions: () => {
589
592
  label: string;
@@ -205,12 +205,13 @@ declare const _default: import("vue").DefineComponent<{
205
205
  emit: (event: "edit" | "updateChecked", ...args: any[]) => void;
206
206
  onRemove: () => void;
207
207
  onEdit: (param?: AnyObject) => void;
208
+ prevFunc: (column: AnyObject) => any;
208
209
  isRenderTooltip: (field: string) => any;
209
210
  getTooltipContent: () => any;
210
211
  getTextValue: (field: string) => any;
211
212
  isMultiple: (field: string) => boolean;
212
213
  isRender: (field: string) => boolean;
213
- isShow: (field: string) => any;
214
+ isShow: (column: AnyObject) => any;
214
215
  showRelation: (field: string) => boolean;
215
216
  getSortPriorityOptions: () => {
216
217
  label: string;
@@ -1,4 +1,4 @@
1
- import { createElementVNode, defineComponent, openBlock, createElementBlock, Fragment, renderList, normalizeStyle, unref, createBlock, withCtx, createVNode, createCommentVNode, toDisplayString, resolveDynamicComponent, normalizeClass, withDirectives, vShow, mergeProps, createTextVNode } from 'vue';
1
+ import { createElementVNode, defineComponent, openBlock, createElementBlock, Fragment, renderList, normalizeStyle, unref, createBlock, withCtx, createVNode, createCommentVNode, toDisplayString, resolveDynamicComponent, normalizeClass, withDirectives, vShow, mergeProps, createTextVNode, toRaw } from 'vue';
2
2
  import { NTooltip, NIcon, NCheckbox, NPopover, NSpace, NSelect, NColorPicker, NInput, NInputNumber, NButton, NPopconfirm } from 'naive-ui';
3
3
  import { setStyle, setColorInfo, isShowExplicitRequired, isDisable } from '../utils/index.js';
4
4
  import { ReorderTwoOutline, HelpCircleOutline, CaretDownOutline, EyeOutline, CopyOutline, CreateOutline, TrashOutline } from '@vicons/ionicons5';
@@ -179,6 +179,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
179
179
  ...param
180
180
  });
181
181
  }
182
+ function prevFunc(column) {
183
+ const {
184
+ showPrevFn
185
+ } = column;
186
+ if (isFunction(showPrevFn))
187
+ return showPrevFn(toRaw(column), toRaw(props.element));
188
+ return true;
189
+ }
182
190
  function isRenderTooltip(field) {
183
191
  var _a;
184
192
  return field === "title" && (props.fieldDescribeMode === "tooltip" && props.element.feildDescribe || props.developMode && ((_a = props.element.settingObj) == null ? void 0 : _a.fieldDescDev));
@@ -215,7 +223,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
215
223
  return false;
216
224
  return true;
217
225
  }
218
- function isShow(field) {
226
+ function isShow(column) {
227
+ const {
228
+ field
229
+ } = column;
219
230
  if (["explicitRequired", "defaultValue"].includes(field))
220
231
  return isShowExplicitRequired(props.element);
221
232
  if (["isSum", "isAvg"].includes(field))
@@ -394,6 +405,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
394
405
  class: "table-cell",
395
406
  title: __props.element[column.field],
396
407
  style: normalizeStyle(unref(setStyle)(column, index, __props.columnWidthProps))
408
+ }, [prevFunc(column) ? (openBlock(), createElementBlock(Fragment, {
409
+ key: 0
397
410
  }, [column.type === "text" ? (openBlock(), createElementBlock(Fragment, {
398
411
  key: 0
399
412
  }, [index === 0 ? (openBlock(), createElementBlock(Fragment, {
@@ -436,7 +449,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
436
449
  disabled: setDisabled(column),
437
450
  checked: __props.element[column.field],
438
451
  "onUpdate:checked": [($event) => __props.element[column.field] = $event, (checked) => onUpdateChecked(checked, column)]
439
- }, null, 8, ["disabled", "checked", "onUpdate:checked"]), [[vShow, isShow(column.field)]]), showRelation(column.field) ? (openBlock(), createBlock(unref(NPopover), {
452
+ }, null, 8, ["disabled", "checked", "onUpdate:checked"]), [[vShow, isShow(column)]]), showRelation(column.field) ? (openBlock(), createBlock(unref(NPopover), {
440
453
  key: 0,
441
454
  placement: "right-start",
442
455
  "show-arrow": false
@@ -476,7 +489,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
476
489
  value: __props.element._defaultValue,
477
490
  "onUpdate:value": [_cache[0] || (_cache[0] = ($event) => __props.element._defaultValue = $event), (value) => handleUpdateSelect(value, column)],
478
491
  options: getOptions(column)
479
- }), null, 16, ["multiple", "disabled", "value", "options", "onUpdate:value"])), [[vShow, isShow(column.field)]]) : withDirectives((openBlock(), createBlock(unref(NSelect), mergeProps({
492
+ }), null, 16, ["multiple", "disabled", "value", "options", "onUpdate:value"])), [[vShow, isShow(column)]]) : withDirectives((openBlock(), createBlock(unref(NSelect), mergeProps({
480
493
  key: 1
481
494
  }, selectProps(column.field), {
482
495
  clearable: "",
@@ -485,7 +498,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
485
498
  value: __props.element[column.field],
486
499
  "onUpdate:value": [($event) => __props.element[column.field] = $event, (value) => handleUpdateSelect(value, column)],
487
500
  options: getOptions(column)
488
- }), null, 16, ["multiple", "disabled", "value", "onUpdate:value", "options"])), [[vShow, isShow(column.field)]])], 64))], 64)) : createCommentVNode("v-if", true), column.type === "color" ? (openBlock(), createBlock(unref(NColorPicker), {
501
+ }), null, 16, ["multiple", "disabled", "value", "onUpdate:value", "options"])), [[vShow, isShow(column)]])], 64))], 64)) : createCommentVNode("v-if", true), column.type === "color" ? (openBlock(), createBlock(unref(NColorPicker), {
489
502
  key: 3,
490
503
  class: "c-field-set__color-picker",
491
504
  clearable: "",
@@ -606,7 +619,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
606
619
  }
607
620
  }())]),
608
621
  _: 1
609
- })], 64))], 64)) : createCommentVNode("v-if", true)], 12, _hoisted_2)) : createCommentVNode("v-if", true)], 64);
622
+ })], 64))], 64)) : createCommentVNode("v-if", true)], 64)) : createCommentVNode("v-if", true)], 12, _hoisted_2)) : createCommentVNode("v-if", true)], 64);
610
623
  }), 128))]);
611
624
  };
612
625
  }
@@ -31,6 +31,7 @@ export type FieldSetColumnItem = {
31
31
  titleRender?: (column: AnyObject) => VNodeChild;
32
32
  hide?: boolean;
33
33
  positionField?: string;
34
+ showPrevFn?: (column: FieldSetColumnItem, row: AnyObject) => boolean;
34
35
  [key: string]: any;
35
36
  };
36
37
  export type FieldSetTab = 'field' | 'fieldColor' | 'highlightRow' | 'tableStyle' | 'fieldFilter';
@@ -1,5 +1,5 @@
1
1
  var name = "@cnhis-design-vue/shared";
2
- var version = "3.3.3-beta.45";
2
+ var version = "3.3.3-beta.46";
3
3
  var main = "index.ts";
4
4
  var peerDependencies = {
5
5
  "naive-ui": "^2.30.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.3.3-beta.45",
3
+ "version": "3.3.3-beta.46",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -74,5 +74,5 @@
74
74
  "iOS 7",
75
75
  "last 3 iOS versions"
76
76
  ],
77
- "gitHead": "0e34bd7613d179f6970d9ededc7d08273ea24162"
77
+ "gitHead": "13907d5357da84c258e475b68566bf0ac2053d9f"
78
78
  }