@gct-paas/v-ben 0.1.4-dev.11 → 0.1.4-dev.12

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.
Files changed (47) hide show
  1. package/dist/index.esm.min.js +685 -0
  2. package/dist/index.min.css +2 -1
  3. package/es/_virtual/_plugin-vue_export-helper.mjs +7 -8
  4. package/es/components/index.mjs +7 -0
  5. package/es/components/v-ben-button/index.mjs +7 -8
  6. package/es/components/v-ben-button/src/BasicButton.vue.mjs +5 -40
  7. package/es/components/v-ben-button/src/BasicButton.vue_vue_type_script_setup_true_lang.mjs +37 -0
  8. package/es/components/v-ben-button/src/PopConfirmButton.vue.mjs +5 -46
  9. package/es/components/v-ben-button/src/PopConfirmButton.vue_vue_type_script_lang.mjs +36 -0
  10. package/es/components/v-ben-button/src/custom-button.vue.mjs +7 -7
  11. package/es/components/v-ben-button/src/custom-button.vue_vue_type_script_setup_true_name_custom-button_lang.mjs +22 -0
  12. package/es/components/v-ben-button/src/props.mjs +27 -27
  13. package/es/components/v-ben-dropdown/index.mjs +4 -4
  14. package/es/components/v-ben-dropdown/src/Dropdown.vue.mjs +5 -113
  15. package/es/components/v-ben-dropdown/src/Dropdown.vue_vue_type_script_setup_true_lang.mjs +87 -0
  16. package/es/components/v-ben-table/index.mjs +3 -0
  17. package/es/components/v-ben-table/src/BasicTable.vue.d.ts +6 -6
  18. package/es/components/v-ben-table/src/BasicTable.vue.mjs +33 -49
  19. package/es/components/v-ben-table/src/BasicTable.vue_vue_type_script_lang.mjs +41 -0
  20. package/es/components/v-ben-table/src/components/HeaderCell.vue.mjs +8 -8
  21. package/es/components/v-ben-table/src/components/HeaderCell.vue_vue_type_script_lang.mjs +15 -0
  22. package/es/components/v-ben-table/src/components/TableAction.vue.mjs +6 -174
  23. package/es/components/v-ben-table/src/components/TableAction.vue_vue_type_script_setup_true_lang.mjs +145 -0
  24. package/es/components/v-ben-table/src/components/TableAction.vue_vue_type_style_index_0_lang.css +37 -0
  25. package/es/components/v-ben-table/src/components/TableActionAuto.vue.mjs +6 -181
  26. package/es/components/v-ben-table/src/components/TableActionAuto.vue_vue_type_script_setup_true_lang.mjs +159 -0
  27. package/es/components/v-ben-table/src/components/TableActionAuto.vue_vue_type_style_index_0_lang.css +37 -0
  28. package/es/components/v-ben-table/src/props.d.ts +2 -2
  29. package/es/components/v-ben-table/src/props.mjs +155 -134
  30. package/es/hooks/useDesign.mjs +8 -7
  31. package/es/index.mjs +12 -14
  32. package/es/utils/is.mjs +29 -35
  33. package/package.json +5 -5
  34. package/dist/index.esm.min.mjs +0 -796
  35. package/dist/index.min.cjs +0 -1
  36. package/dist/index.system.min.js +0 -1
  37. package/es/components/v-ben-button/src/BasicButton.vue2.mjs +0 -5
  38. package/es/components/v-ben-button/src/PopConfirmButton.vue2.mjs +0 -5
  39. package/es/components/v-ben-button/src/custom-button.vue3.mjs +0 -32
  40. package/es/components/v-ben-dropdown/src/Dropdown.vue2.mjs +0 -5
  41. package/es/components/v-ben-table/src/BasicTable.vue2.mjs +0 -48
  42. package/es/components/v-ben-table/src/components/HeaderCell.vue2.mjs +0 -20
  43. package/es/components/v-ben-table/src/components/TableAction.css +0 -37
  44. package/es/components/v-ben-table/src/components/TableAction.vue3.mjs +0 -6
  45. package/es/components/v-ben-table/src/components/TableActionAuto.css +0 -37
  46. package/es/components/v-ben-table/src/components/TableActionAuto.vue3.mjs +0 -6
  47. /package/es/components/v-ben-button/src/{custom-button.css → custom-button.vue_vue_type_style_index_0_scoped_305f4090_lang.css} +0 -0
@@ -0,0 +1,159 @@
1
+ import { isFunction, isString } from "../../../../utils/is.mjs";
2
+ import { useDesign } from "../../../../hooks/useDesign.mjs";
3
+ import { PopConfirmButton } from "../../../v-ben-button/index.mjs";
4
+ import { Dropdown as Dropdown$1 } from "../../../v-ben-dropdown/index.mjs";
5
+ import "../../../index.mjs";
6
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderList, renderSlot, resolveComponent, toDisplayString, toRaw, unref, withCtx, withModifiers } from "vue";
7
+ import { MoreOutlined } from "@ant-design/icons-vue";
8
+ import { Divider, Tooltip } from "ant-design-vue";
9
+ import { permission } from "@gct-paas/core";
10
+ //#region src/components/v-ben-table/src/components/TableActionAuto.vue?vue&type=script&setup=true&lang.ts
11
+ var _hoisted_1 = {
12
+ key: 0,
13
+ class: "text-14px"
14
+ };
15
+ var _hoisted_2 = {
16
+ key: 0,
17
+ class: "text-14px"
18
+ };
19
+ var TableActionAuto_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
20
+ __name: "TableActionAuto",
21
+ props: {
22
+ actions: {
23
+ type: Array,
24
+ default: null
25
+ },
26
+ divider: {
27
+ type: Boolean,
28
+ default: true
29
+ },
30
+ outside: Boolean,
31
+ stopButtonPropagation: {
32
+ type: Boolean,
33
+ default: false
34
+ },
35
+ maxDispalyCount: {
36
+ type: Number,
37
+ default: 4
38
+ }
39
+ },
40
+ setup(__props) {
41
+ const props = __props;
42
+ const { prefixCls } = useDesign("basic-table-action");
43
+ const hasPermission = permission.has;
44
+ function isIfShow(action) {
45
+ const ifShow = action.ifShow ?? true;
46
+ if (isFunction(ifShow)) return ifShow(action);
47
+ return !!ifShow;
48
+ }
49
+ /**
50
+ * 所有可用按钮
51
+ */
52
+ const validActions = computed(() => {
53
+ return [...toRaw(props.actions) || []].filter((action) => {
54
+ return hasPermission(action.auth) && isIfShow(action);
55
+ });
56
+ });
57
+ /**
58
+ * 展示的按钮
59
+ */
60
+ const getActions = computed(() => {
61
+ let list = [];
62
+ if (props.maxDispalyCount >= validActions.value.length) list = [...validActions.value];
63
+ else list = validActions.value.slice(0, props.maxDispalyCount);
64
+ return list.map((action) => {
65
+ const { popConfirm } = action;
66
+ return {
67
+ getPopupContainer: () => document.body,
68
+ type: "link",
69
+ size: "small",
70
+ ...action,
71
+ ...popConfirm || {},
72
+ onConfirm: popConfirm?.confirm,
73
+ onCancel: popConfirm?.cancel,
74
+ enable: !!popConfirm
75
+ };
76
+ });
77
+ });
78
+ /**
79
+ * 隐藏的按钮
80
+ */
81
+ const getDropdownList = computed(() => {
82
+ let list = [];
83
+ if (props.maxDispalyCount >= validActions.value.length) return [];
84
+ else list = validActions.value.slice(props.maxDispalyCount);
85
+ return list.map((action, index) => {
86
+ const { label, popConfirm } = action;
87
+ return {
88
+ ...action,
89
+ ...popConfirm,
90
+ onConfirm: popConfirm?.confirm,
91
+ onCancel: popConfirm?.cancel,
92
+ text: label,
93
+ divider: index < list.length - 1 ? props.divider : false
94
+ };
95
+ });
96
+ });
97
+ const getAlign = computed(() => {
98
+ return "left";
99
+ });
100
+ function getTooltip(data) {
101
+ return {
102
+ getPopupContainer: () => document.body,
103
+ placement: "bottom",
104
+ ...isString(data) ? { title: data } : data
105
+ };
106
+ }
107
+ function onCellClick(e) {
108
+ if (!props.stopButtonPropagation) return;
109
+ e.composedPath().find((ele) => {
110
+ return ele.tagName?.toUpperCase() === "BUTTON";
111
+ }) && e.stopPropagation();
112
+ }
113
+ return (_ctx, _cache) => {
114
+ const _component_a_button = resolveComponent("a-button");
115
+ return openBlock(), createElementBlock("div", {
116
+ class: normalizeClass([unref(prefixCls), getAlign.value]),
117
+ onClick: withModifiers(onCellClick, ["stop"])
118
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(getActions.value, (action, index) => {
119
+ return openBlock(), createElementBlock(Fragment, { key: `${index}-${action.label}` }, [action.tooltip ? (openBlock(), createBlock(unref(Tooltip), mergeProps({
120
+ key: 0,
121
+ ref_for: true
122
+ }, getTooltip(action.tooltip)), {
123
+ default: withCtx(() => [createVNode(unref(PopConfirmButton), mergeProps({ ref_for: true }, action), {
124
+ default: withCtx(() => [action.label ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(action.label), 1)) : createCommentVNode("", true)]),
125
+ _: 2
126
+ }, 1040)]),
127
+ _: 2
128
+ }, 1040)) : (openBlock(), createBlock(unref(PopConfirmButton), mergeProps({
129
+ key: 1,
130
+ ref_for: true
131
+ }, action), {
132
+ default: withCtx(() => [action.label ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(action.label), 1)) : createCommentVNode("", true)]),
133
+ _: 2
134
+ }, 1040)), __props.divider && index < getActions.value.length - 1 ? (openBlock(), createBlock(unref(Divider), {
135
+ key: 2,
136
+ type: "vertical",
137
+ class: "action-divider"
138
+ })) : createCommentVNode("", true)], 64);
139
+ }), 128)), getDropdownList.value.length > 0 ? (openBlock(), createBlock(unref(Dropdown$1), {
140
+ key: 0,
141
+ trigger: ["hover"],
142
+ "drop-menu-list": getDropdownList.value,
143
+ popconfirm: ""
144
+ }, {
145
+ default: withCtx(() => [renderSlot(_ctx.$slots, "more"), !_ctx.$slots.more ? (openBlock(), createBlock(_component_a_button, {
146
+ key: 0,
147
+ type: "link",
148
+ size: "small"
149
+ }, {
150
+ default: withCtx(() => [createVNode(unref(MoreOutlined), { class: "icon-more" })]),
151
+ _: 1
152
+ })) : createCommentVNode("", true)]),
153
+ _: 3
154
+ }, 8, ["drop-menu-list"])) : createCommentVNode("", true)], 2);
155
+ };
156
+ }
157
+ });
158
+ //#endregion
159
+ export { TableActionAuto_vue_vue_type_script_setup_true_lang_default as default };
@@ -0,0 +1,37 @@
1
+ .vben-basic-table-action {
2
+ display: flex;
3
+ align-items: center;
4
+ }
5
+ .vben-basic-table-action .action-divider {
6
+ display: table;
7
+ }
8
+ .vben-basic-table-action.left {
9
+ justify-content: flex-start;
10
+ }
11
+ .vben-basic-table-action.center {
12
+ justify-content: center;
13
+ }
14
+ .vben-basic-table-action.right {
15
+ justify-content: flex-end;
16
+ }
17
+ .vben-basic-table-action button {
18
+ display: flex;
19
+ align-items: center;
20
+ }
21
+ .vben-basic-table-action button span {
22
+ margin-left: 0 !important;
23
+ }
24
+ .vben-basic-table-action button.ant-btn-circle span {
25
+ margin: auto !important;
26
+ }
27
+ .vben-basic-table-action .ant-divider,
28
+ .vben-basic-table-action .ant-divider-vertical {
29
+ margin: 0 10px;
30
+ }
31
+ .vben-basic-table-action .icon-more {
32
+ transform: rotate(90deg);
33
+ }
34
+ .vben-basic-table-action .icon-more svg {
35
+ font-size: 1.1em;
36
+ font-weight: 700;
37
+ }
@@ -135,8 +135,8 @@ export declare const basicProps: {
135
135
  };
136
136
  scroll: {
137
137
  type: PropType<{
138
- x: number | string | true;
139
- y: number | string;
138
+ x?: number | string | true;
139
+ y?: number | string;
140
140
  }>;
141
141
  default: null;
142
142
  };
@@ -1,136 +1,157 @@
1
- const basicProps = {
2
- clickToRowSelect: { type: Boolean, default: true },
3
- isTreeTable: Boolean,
4
- tableSetting: {
5
- type: Object,
6
- default: {}
7
- },
8
- inset: Boolean,
9
- showTableSetting: Boolean,
10
- autoCreateKey: { type: Boolean, default: true },
11
- striped: { type: Boolean, default: true },
12
- showSummary: Boolean,
13
- summaryFunc: {
14
- type: [Function, Array],
15
- default: null
16
- },
17
- summaryData: {
18
- type: Array,
19
- default: null
20
- },
21
- indentSize: {
22
- type: Number,
23
- default: 24
24
- },
25
- canColDrag: { type: Boolean, default: true },
26
- api: {
27
- type: Function,
28
- default: null
29
- },
30
- beforeFetch: {
31
- type: Function,
32
- default: null
33
- },
34
- afterFetch: {
35
- type: Function,
36
- default: null
37
- },
38
- handleSearchInfoFn: {
39
- type: Function,
40
- default: null
41
- },
42
- // 立即请求接口
43
- immediate: { type: Boolean, default: true },
44
- emptyDataIsShowTable: { type: Boolean, default: true },
45
- // 额外的请求参数
46
- searchInfo: {
47
- type: Object,
48
- default: null
49
- },
50
- // 默认的排序参数
51
- defSort: {
52
- type: Object,
53
- default: null
54
- },
55
- // 使用搜索表单
56
- useSearchForm: Boolean,
57
- columns: {
58
- type: Array,
59
- default: () => []
60
- },
61
- showIndexColumn: { type: Boolean, default: true },
62
- indexColumnProps: {
63
- type: Object,
64
- default: null
65
- },
66
- actionColumn: {
67
- type: Object,
68
- default: null
69
- },
70
- ellipsis: { type: Boolean, default: true },
71
- isCanResizeParent: { type: Boolean, default: false },
72
- canResize: { type: Boolean, default: true },
73
- clearSelectOnPageChange: Boolean,
74
- resizeHeightOffset: {
75
- type: Number,
76
- default: 0
77
- },
78
- rowSelection: {
79
- type: Object,
80
- default: null
81
- },
82
- title: {
83
- type: [String, Function],
84
- default: null
85
- },
86
- titleHelpMessage: {
87
- type: [String, Array]
88
- },
89
- maxHeight: Number,
90
- dataSource: {
91
- type: Array,
92
- default: null
93
- },
94
- rowKey: {
95
- type: [String, Function],
96
- default: ""
97
- },
98
- bordered: Boolean,
99
- pagination: {
100
- type: [Object, Boolean],
101
- default: null
102
- },
103
- loading: Boolean,
104
- rowClassName: {
105
- type: Function
106
- },
107
- scroll: {
108
- type: Object,
109
- default: null
110
- },
111
- beforeEditSubmit: {
112
- type: Function
113
- },
114
- /**
115
- * 行拖拽
116
- */
117
- rowDraggable: { type: Boolean, default: false },
118
- /**
119
- * 仅支持同层级拖拽
120
- */
121
- supportSameLevel: { type: Boolean, default: false },
122
- /**
123
- * 拖拽完成自动请求的api
124
- */
125
- rowDragApi: { type: Function, default: null },
126
- /**
127
- * tree表格展开行
128
- */
129
- expandedRowKeys: { type: Array, default: () => [] },
130
- /**
131
- * 空数据时全屏显示
132
- */
133
- emptyFull: { type: Boolean, default: false }
1
+ //#region src/components/v-ben-table/src/props.ts
2
+ var basicProps = {
3
+ clickToRowSelect: {
4
+ type: Boolean,
5
+ default: true
6
+ },
7
+ isTreeTable: Boolean,
8
+ tableSetting: {
9
+ type: Object,
10
+ default: {}
11
+ },
12
+ inset: Boolean,
13
+ showTableSetting: Boolean,
14
+ autoCreateKey: {
15
+ type: Boolean,
16
+ default: true
17
+ },
18
+ striped: {
19
+ type: Boolean,
20
+ default: true
21
+ },
22
+ showSummary: Boolean,
23
+ summaryFunc: {
24
+ type: [Function, Array],
25
+ default: null
26
+ },
27
+ summaryData: {
28
+ type: Array,
29
+ default: null
30
+ },
31
+ indentSize: {
32
+ type: Number,
33
+ default: 24
34
+ },
35
+ canColDrag: {
36
+ type: Boolean,
37
+ default: true
38
+ },
39
+ api: {
40
+ type: Function,
41
+ default: null
42
+ },
43
+ beforeFetch: {
44
+ type: Function,
45
+ default: null
46
+ },
47
+ afterFetch: {
48
+ type: Function,
49
+ default: null
50
+ },
51
+ handleSearchInfoFn: {
52
+ type: Function,
53
+ default: null
54
+ },
55
+ immediate: {
56
+ type: Boolean,
57
+ default: true
58
+ },
59
+ emptyDataIsShowTable: {
60
+ type: Boolean,
61
+ default: true
62
+ },
63
+ searchInfo: {
64
+ type: Object,
65
+ default: null
66
+ },
67
+ defSort: {
68
+ type: Object,
69
+ default: null
70
+ },
71
+ useSearchForm: Boolean,
72
+ columns: {
73
+ type: Array,
74
+ default: () => []
75
+ },
76
+ showIndexColumn: {
77
+ type: Boolean,
78
+ default: true
79
+ },
80
+ indexColumnProps: {
81
+ type: Object,
82
+ default: null
83
+ },
84
+ actionColumn: {
85
+ type: Object,
86
+ default: null
87
+ },
88
+ ellipsis: {
89
+ type: Boolean,
90
+ default: true
91
+ },
92
+ isCanResizeParent: {
93
+ type: Boolean,
94
+ default: false
95
+ },
96
+ canResize: {
97
+ type: Boolean,
98
+ default: true
99
+ },
100
+ clearSelectOnPageChange: Boolean,
101
+ resizeHeightOffset: {
102
+ type: Number,
103
+ default: 0
104
+ },
105
+ rowSelection: {
106
+ type: Object,
107
+ default: null
108
+ },
109
+ title: {
110
+ type: [String, Function],
111
+ default: null
112
+ },
113
+ titleHelpMessage: { type: [String, Array] },
114
+ maxHeight: Number,
115
+ dataSource: {
116
+ type: Array,
117
+ default: null
118
+ },
119
+ rowKey: {
120
+ type: [String, Function],
121
+ default: ""
122
+ },
123
+ bordered: Boolean,
124
+ pagination: {
125
+ type: [Object, Boolean],
126
+ default: null
127
+ },
128
+ loading: Boolean,
129
+ rowClassName: { type: Function },
130
+ scroll: {
131
+ type: Object,
132
+ default: null
133
+ },
134
+ beforeEditSubmit: { type: Function },
135
+ rowDraggable: {
136
+ type: Boolean,
137
+ default: false
138
+ },
139
+ supportSameLevel: {
140
+ type: Boolean,
141
+ default: false
142
+ },
143
+ rowDragApi: {
144
+ type: Function,
145
+ default: null
146
+ },
147
+ expandedRowKeys: {
148
+ type: Array,
149
+ default: () => []
150
+ },
151
+ emptyFull: {
152
+ type: Boolean,
153
+ default: false
154
+ }
134
155
  };
135
-
156
+ //#endregion
136
157
  export { basicProps };
@@ -1,9 +1,10 @@
1
- const prefixCls = "vben";
1
+ //#region src/hooks/useDesign.ts
2
+ var prefixCls = "vben";
2
3
  function useDesign(scope) {
3
- return {
4
- prefixCls: `${prefixCls}-${scope}`,
5
- prefixVar: prefixCls
6
- };
4
+ return {
5
+ prefixCls: `${prefixCls}-${scope}`,
6
+ prefixVar: prefixCls
7
+ };
7
8
  }
8
-
9
- export { prefixCls, useDesign };
9
+ //#endregion
10
+ export { useDesign };
package/es/index.mjs CHANGED
@@ -1,14 +1,12 @@
1
- import './components/v-ben-table/src/components/TableActionAuto.css';import './components/v-ben-table/src/components/TableAction.css';export { is, isArray, isBoolean, isClient, isDate, isDef, isElement, isEmpty, isEmptyStr, isFunction, isMap, isNull, isNullAndUnDef, isNullOrUnDef, isNumber, isObject, isPromise, isRegExp, isServer, isString, isUnDef, isUrl, isWindow } from './utils/is.mjs';
2
- export { default as BasicTable } from './components/v-ben-table/src/BasicTable.vue.mjs';
3
- export { default as TableAction } from './components/v-ben-table/src/components/TableAction.vue.mjs';
4
- /* empty css */
5
- export { default as TableActionAuto } from './components/v-ben-table/src/components/TableActionAuto.vue.mjs';
6
- /* empty css */
7
- export { Button, PopConfirmButton } from './components/v-ben-button/index.mjs';
8
- export { Dropdown } from './components/v-ben-dropdown/index.mjs';
9
- export { default as CustomButton } from './components/v-ben-button/src/custom-button.vue.mjs';
10
-
11
- function run() {
12
- }
13
-
14
- export { run };
1
+ import { is, isArray, isBoolean, isClient, isDate, isDef, isElement, isEmpty, isEmptyStr, isFunction, isMap, isNull, isNullAndUnDef, isNullOrUnDef, isNumber, isObject, isPromise, isRegExp, isServer, isString, isUnDef, isUrl, isWindow } from "./utils/is.mjs";
2
+ import BasicTable_default from "./components/v-ben-table/src/BasicTable.vue.mjs";
3
+ import TableAction_default from "./components/v-ben-table/src/components/TableAction.vue.mjs";
4
+ import TableActionAuto_default from "./components/v-ben-table/src/components/TableActionAuto.vue.mjs";
5
+ import custom_button_default from "./components/v-ben-button/src/custom-button.vue.mjs";
6
+ import { Button, PopConfirmButton } from "./components/v-ben-button/index.mjs";
7
+ import { Dropdown } from "./components/v-ben-dropdown/index.mjs";
8
+ import "./components/index.mjs";
9
+ //#region src/index.ts
10
+ function run() {}
11
+ //#endregion
12
+ export { BasicTable_default as BasicTable, Button, custom_button_default as CustomButton, Dropdown, PopConfirmButton, TableAction_default as TableAction, TableActionAuto_default as TableActionAuto, is, isArray, isBoolean, isClient, isDate, isDef, isElement, isEmpty, isEmptyStr, isFunction, isMap, isNull, isNullAndUnDef, isNullOrUnDef, isNumber, isObject, isPromise, isRegExp, isServer, isString, isUnDef, isUrl, isWindow, run };
package/es/utils/is.mjs CHANGED
@@ -1,78 +1,72 @@
1
- const toString = Object.prototype.toString;
1
+ //#region src/utils/is.ts
2
+ var toString = Object.prototype.toString;
2
3
  function is(val, type) {
3
- return toString.call(val) === `[object ${type}]`;
4
+ return toString.call(val) === `[object ${type}]`;
4
5
  }
5
6
  function isDef(val) {
6
- return typeof val !== "undefined";
7
+ return typeof val !== "undefined";
7
8
  }
8
9
  function isUnDef(val) {
9
- return !isDef(val);
10
+ return !isDef(val);
10
11
  }
11
12
  function isObject(val) {
12
- return val !== null && is(val, "Object");
13
+ return val !== null && is(val, "Object");
13
14
  }
14
15
  function isEmpty(val) {
15
- if (isArray(val) || isString(val)) {
16
- return val.length === 0;
17
- }
18
- if (val instanceof Map || val instanceof Set) {
19
- return val.size === 0;
20
- }
21
- if (isObject(val)) {
22
- return Object.keys(val).length === 0;
23
- }
24
- return false;
16
+ if (isArray(val) || isString(val)) return val.length === 0;
17
+ if (val instanceof Map || val instanceof Set) return val.size === 0;
18
+ if (isObject(val)) return Object.keys(val).length === 0;
19
+ return false;
25
20
  }
26
21
  function isDate(val) {
27
- return is(val, "Date");
22
+ return is(val, "Date");
28
23
  }
29
24
  function isNull(val) {
30
- return val === null;
25
+ return val === null;
31
26
  }
32
27
  function isNullAndUnDef(val) {
33
- return isUnDef(val) && isNull(val);
28
+ return isUnDef(val) && isNull(val);
34
29
  }
35
30
  function isNullOrUnDef(val) {
36
- return isUnDef(val) || isNull(val);
31
+ return isUnDef(val) || isNull(val);
37
32
  }
38
33
  function isNumber(val) {
39
- return is(val, "Number");
34
+ return is(val, "Number");
40
35
  }
41
36
  function isPromise(val) {
42
- return is(val, "Promise") && isObject(val) && isFunction(val.then) && isFunction(val.then);
37
+ return is(val, "Promise") && isObject(val) && isFunction(val.then) && isFunction(val.then);
43
38
  }
44
39
  function isString(val) {
45
- return is(val, "String");
40
+ return is(val, "String");
46
41
  }
47
42
  function isFunction(val) {
48
- return typeof val === "function";
43
+ return typeof val === "function";
49
44
  }
50
45
  function isBoolean(val) {
51
- return is(val, "Boolean");
46
+ return is(val, "Boolean");
52
47
  }
53
48
  function isRegExp(val) {
54
- return is(val, "RegExp");
49
+ return is(val, "RegExp");
55
50
  }
56
51
  function isArray(val) {
57
- return !!val && Array.isArray(val);
52
+ return !!val && Array.isArray(val);
58
53
  }
59
54
  function isWindow(val) {
60
- return typeof window !== "undefined" && is(val, "Window");
55
+ return typeof window !== "undefined" && is(val, "Window");
61
56
  }
62
57
  function isElement(val) {
63
- return isObject(val) && !!val.tagName;
58
+ return isObject(val) && !!val.tagName;
64
59
  }
65
60
  function isMap(val) {
66
- return is(val, "Map");
61
+ return is(val, "Map");
67
62
  }
68
- const isServer = typeof window === "undefined";
69
- const isClient = !isServer;
63
+ var isServer = typeof window === "undefined";
64
+ var isClient = !isServer;
70
65
  function isUrl(path) {
71
- const reg = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/;
72
- return reg.test(path);
66
+ return /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/.test(path);
73
67
  }
74
68
  function isEmptyStr(str) {
75
- return str === void 0 || !str && str !== 0 && str !== "0" || !/[^\s]/.test(str + "");
69
+ return str === void 0 || !str && str !== 0 && str !== "0" || !/[^\s]/.test(str + "");
76
70
  }
77
-
71
+ //#endregion
78
72
  export { is, isArray, isBoolean, isClient, isDate, isDef, isElement, isEmpty, isEmptyStr, isFunction, isMap, isNull, isNullAndUnDef, isNullOrUnDef, isNumber, isObject, isPromise, isRegExp, isServer, isString, isUnDef, isUrl, isWindow };