mrxy-yk 1.3.3 → 1.3.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.
@@ -5,13 +5,22 @@ import { ElTableColumnGlobal } from "./index.js";
5
5
  var _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "TableColumn",
7
7
  props: {
8
- emptyStr: {}
8
+ emptyStr: {},
9
+ formatter: {}
9
10
  },
10
11
  setup(__props) {
11
12
  const props = __props;
12
13
  const emptyStr = props.emptyStr || ElTableColumnGlobal.props.emptyStr.default || "—";
13
14
  function defaultFormatter(row, column, cellValue, index) {
14
- return ObjectUtil.isEmptyToVal(cellValue, emptyStr);
15
+ let result = cellValue;
16
+ if (props.formatter) {
17
+ if (typeof props.formatter === "function") {
18
+ result = props.formatter(row, column, cellValue, index);
19
+ } else {
20
+ return props.formatter;
21
+ }
22
+ }
23
+ return result || ObjectUtil.isEmptyToVal(result, emptyStr);
15
24
  }
16
25
  return (_ctx, _cache) => {
17
26
  const _component_el_table_column = ElTableColumn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mrxy-yk",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "A collection of Vue 3 components and utilities",
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "mrxy-yk",
4
- "version": "1.3.3",
4
+ "version": "1.3.4",
5
5
  "js-types-syntax": "typescript",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,24 +0,0 @@
1
- import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
- type __VLS_Props = {
3
- emptyStr?: string;
4
- };
5
- declare function __VLS_template(): {
6
- attrs: Partial<{}>;
7
- slots: {
8
- 'filter-icon'?(_: any): any;
9
- expand?(_: any): any;
10
- header?(_: any): any;
11
- default?(_: any): any;
12
- };
13
- refs: {};
14
- rootEl: any;
15
- };
16
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
18
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
19
- export default _default;
20
- type __VLS_WithTemplateSlots<T, S> = T & {
21
- new (): {
22
- $slots: S;
23
- };
24
- };