@gx-design-vue/pro-utils 0.0.5-rc.6 → 0.0.6

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/dist/index.es.js CHANGED
@@ -274,6 +274,24 @@ function isFunction(func) {
274
274
  return (typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]');
275
275
  }
276
276
 
277
+ const getPrefixCls = ({ suffixCls, customizePrefixCls, isPor, className }) => {
278
+ const prefixCls = className || (isPor ? 'gx-pro' : 'gx');
279
+ if (customizePrefixCls)
280
+ return customizePrefixCls;
281
+ return suffixCls ? `${prefixCls}-${suffixCls}` : prefixCls;
282
+ };
283
+ function getSlot(slots, props, prop = 'default') {
284
+ if (props[prop] === false) {
285
+ return false;
286
+ }
287
+ return (props[prop] || slots[prop]);
288
+ }
289
+ function getSlotVNode(slots, props, prop = 'default') {
290
+ if (props[prop] === false) {
291
+ return false;
292
+ }
293
+ return (props[prop] || slots[prop]?.());
294
+ }
277
295
  /**
278
296
  * 根据 key 和 dataIndex 生成唯一 id
279
297
  *
@@ -907,4 +925,4 @@ function isBase64(str = '') {
907
925
  return false;
908
926
  }
909
927
 
910
- export { arrayRepeat, blobToDataURL, checkFileType, compareArray, dataURLtoBlob, dataURLtoFile, deepCopy, formatDuraton, genColumnKey, generateVidoePicture, getBase64, getBlobUrl, getFileSuffix, getLevelData, getMaxFloor, getMediaInfos, getRandomNumber, getScroll, getScrollContainer, getSortIndex, getVideoCoverPicture, getVideoFileUrl, handleCurrentPage, handleShowIndex, hanndleField, is, isArray, isBase64, isBoolean, isFunction, isInContainer, isNumber, isObject, isScroll, isServer, isString, runFunction, scrollTo, throttleByAnimationFrame, treeData };
928
+ export { arrayRepeat, blobToDataURL, checkFileType, compareArray, dataURLtoBlob, dataURLtoFile, deepCopy, formatDuraton, genColumnKey, generateVidoePicture, getBase64, getBlobUrl, getFileSuffix, getLevelData, getMaxFloor, getMediaInfos, getPrefixCls, getRandomNumber, getScroll, getScrollContainer, getSlot, getSlotVNode, getSortIndex, getVideoCoverPicture, getVideoFileUrl, handleCurrentPage, handleShowIndex, hanndleField, is, isArray, isBase64, isBoolean, isFunction, isInContainer, isNumber, isObject, isScroll, isServer, isString, runFunction, scrollTo, throttleByAnimationFrame, treeData };
package/dist/index.js CHANGED
@@ -278,6 +278,24 @@ function isFunction(func) {
278
278
  return (typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]');
279
279
  }
280
280
 
281
+ const getPrefixCls = ({ suffixCls, customizePrefixCls, isPor, className }) => {
282
+ const prefixCls = className || (isPor ? 'gx-pro' : 'gx');
283
+ if (customizePrefixCls)
284
+ return customizePrefixCls;
285
+ return suffixCls ? `${prefixCls}-${suffixCls}` : prefixCls;
286
+ };
287
+ function getSlot(slots, props, prop = 'default') {
288
+ if (props[prop] === false) {
289
+ return false;
290
+ }
291
+ return (props[prop] || slots[prop]);
292
+ }
293
+ function getSlotVNode(slots, props, prop = 'default') {
294
+ if (props[prop] === false) {
295
+ return false;
296
+ }
297
+ return (props[prop] || slots[prop]?.());
298
+ }
281
299
  /**
282
300
  * 根据 key 和 dataIndex 生成唯一 id
283
301
  *
@@ -927,9 +945,12 @@ exports.getFileSuffix = getFileSuffix;
927
945
  exports.getLevelData = getLevelData;
928
946
  exports.getMaxFloor = getMaxFloor;
929
947
  exports.getMediaInfos = getMediaInfos;
948
+ exports.getPrefixCls = getPrefixCls;
930
949
  exports.getRandomNumber = getRandomNumber;
931
950
  exports.getScroll = getScroll;
932
951
  exports.getScrollContainer = getScrollContainer;
952
+ exports.getSlot = getSlot;
953
+ exports.getSlotVNode = getSlotVNode;
933
954
  exports.getSortIndex = getSortIndex;
934
955
  exports.getVideoCoverPicture = getVideoCoverPicture;
935
956
  exports.getVideoFileUrl = getVideoFileUrl;
@@ -1,4 +1,14 @@
1
1
  import type { AlignType, ProColumn, BasicTablePageConfig, MaterialInfo } from '../typings';
2
+ import { Slots } from 'vue';
3
+ export interface prefixCls {
4
+ suffixCls?: string;
5
+ customizePrefixCls?: string;
6
+ isPor?: boolean;
7
+ className?: string;
8
+ }
9
+ export declare const getPrefixCls: ({ suffixCls, customizePrefixCls, isPor, className }: prefixCls) => string;
10
+ export declare function getSlot<T>(slots: Slots, props: Record<string, unknown>, prop?: string): T | false;
11
+ export declare function getSlotVNode<T>(slots: Slots, props: Record<string, unknown>, prop?: string): T | false;
2
12
  /**
3
13
  * 根据 key 和 dataIndex 生成唯一 id
4
14
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gx-design-vue/pro-utils",
3
- "version": "0.0.5-rc.6",
3
+ "version": "0.0.6",
4
4
  "description": "@gx-design-vue/pro-utils",
5
5
  "license": "MIT",
6
6
  "types": "dist/index.d.ts",