@jetlinks-web/components 2.3.10 → 2.4.0

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.
@@ -1,5 +1,6 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import { configProviderProps } from 'ant-design-vue/es/config-provider/context';
3
+ import "@jetlinks-web/constants";
3
4
  export var configProps = function configProps() {
4
5
  return _objectSpread(_objectSpread({}, configProviderProps()), {}, {
5
6
  IconConfig: {
@@ -10,6 +11,9 @@ export var configProps = function configProps() {
10
11
  },
11
12
  SearchConfig: {
12
13
  type: Object
14
+ },
15
+ PermissionButtonConfig: {
16
+ type: Object
13
17
  }
14
18
  });
15
19
  };
@@ -2,7 +2,7 @@ import { createVNode as _createVNode } from "vue";
2
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
3
  import { defineComponent, provide, reactive, h } from 'vue';
4
4
  import { configProps } from './context';
5
- import { ComponentsEnum, MAPConfig, SearchConfig } from '@jetlinks-web/constants';
5
+ import { ComponentsEnum, MAPConfig, PermissionButtonConfig, SearchConfig } from '@jetlinks-web/constants';
6
6
  import { ConfigProvider } from 'ant-design-vue';
7
7
  import { omit } from 'lodash-es';
8
8
  import Empty from '../Empty';
@@ -15,10 +15,12 @@ var JConfigProvider = defineComponent({
15
15
  var _iconConfig = reactive(props.IconConfig || {});
16
16
  var _mapConfig = reactive(props.MapConfig || {});
17
17
  var _searchConfig = reactive(props.SearchConfig || {});
18
- console.log('_searchConfig', _searchConfig);
18
+ var _PermissionButtonConfig = reactive(props.PermissionButtonConfig || {});
19
19
  provide(ComponentsEnum.Icon, _iconConfig); // 全局Icon 配置
20
20
  provide(MAPConfig, _mapConfig); // 全局地图配置
21
21
  provide(SearchConfig, _searchConfig); // 全局搜索配置
22
+ provide(PermissionButtonConfig, _PermissionButtonConfig); // 权限组件
23
+ console.log('_PermissionButtonConfig', _PermissionButtonConfig, props.PermissionButtonConfig);
22
24
  return function () {
23
25
  return h(ConfigProvider, _objectSpread({}, omit(props, ['IconConfig', 'MapConfig', 'SearchConfig'])), {
24
26
  default: slots.default,
@@ -48,7 +48,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
48
48
  "onFieldChange": "setup-const"
49
49
  } */
50
50
  import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
51
- const _withScopeId = n => (_pushScopeId("data-v-1726045323521"), n = n(), _popScopeId(), n);
51
+ const _withScopeId = n => (_pushScopeId("data-v-1726059568155"), n = n(), _popScopeId(), n);
52
52
  const _hoisted_1 = { style: { "color": "#1d2129" } };
53
53
  const _hoisted_2 = {
54
54
  key: 0,
@@ -6,7 +6,7 @@
6
6
  } */
7
7
  import { defineComponent as _defineComponent } from 'vue';
8
8
  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";
9
- const _withScopeId = n => (_pushScopeId("data-v-1726045323657"), n = n(), _popScopeId(), n);
9
+ const _withScopeId = n => (_pushScopeId("data-v-1726059568705"), n = n(), _popScopeId(), n);
10
10
  const _hoisted_1 = { class: "full-page-warp-content" };
11
11
  import { ref } from 'vue';
12
12
  import { useElementBounding } from '@vueuse/core';
@@ -0,0 +1,79 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import { createVNode, render as vueRender, h } from 'vue';
4
+ import { destroyFns } from './index';
5
+ import 'lodash-es';
6
+ var confirm = function confirm(config, components) {
7
+ var container = document.createDocumentFragment();
8
+ var confirmDialogInstance = null;
9
+ var currentConfig = _objectSpread(_objectSpread({}, config), {}, {
10
+ visible: true
11
+ });
12
+ function destroy() {
13
+ if (confirmDialogInstance) {
14
+ // destroy
15
+ vueRender(null, container);
16
+ confirmDialogInstance.component.update();
17
+ confirmDialogInstance = null;
18
+ }
19
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
20
+ args[_key] = arguments[_key];
21
+ }
22
+ var triggerCancel = args.some(function (param) {
23
+ return param && param.triggerCancel;
24
+ });
25
+ if (config.onCancel && triggerCancel) {
26
+ config.onCancel.apply(config, args);
27
+ }
28
+ for (var i = 0; i < destroyFns.length; i++) {
29
+ var fn = destroyFns[i];
30
+ if (fn === close) {
31
+ destroyFns.splice(i, 1);
32
+ break;
33
+ }
34
+ }
35
+ }
36
+ function close() {
37
+ var _this = this;
38
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
39
+ args[_key2] = arguments[_key2];
40
+ }
41
+ currentConfig = _objectSpread(_objectSpread({}, currentConfig), {}, {
42
+ visible: false,
43
+ afterClose: function afterClose() {
44
+ if (typeof config.afterClose === 'function') {
45
+ config.afterClose();
46
+ }
47
+ destroy.apply(_this, args);
48
+ }
49
+ });
50
+ update(currentConfig);
51
+ }
52
+ function update(configUpdate) {
53
+ if (typeof configUpdate === 'function') {
54
+ currentConfig = configUpdate(currentConfig);
55
+ } else {
56
+ currentConfig = _objectSpread(_objectSpread({}, currentConfig), configUpdate);
57
+ }
58
+ if (confirmDialogInstance) {
59
+ _extends(confirmDialogInstance.component.props, currentConfig);
60
+ confirmDialogInstance.component.update();
61
+ }
62
+ }
63
+ var Wrapper = function Wrapper(p) {
64
+ return h(components, _objectSpread({}, p));
65
+ };
66
+ function render(props) {
67
+ var vm = createVNode(Wrapper, _objectSpread({}, props));
68
+ vm.appContext = config.parentContext || config.appContext || vm.appContext;
69
+ vueRender(vm, container);
70
+ return vm;
71
+ }
72
+ confirmDialogInstance = render(currentConfig);
73
+ destroyFns.push(close);
74
+ return {
75
+ destroy: close,
76
+ update: update
77
+ };
78
+ };
79
+ export default confirm;
@@ -2,12 +2,14 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  var _excluded = ["popConfirm", "tooltip", "hasPermission", "noPermissionTitle"];
5
- import { h, defineComponent, computed } from "vue";
5
+ import { h, defineComponent, computed, inject } from "vue";
6
6
  import { Button, Tooltip, Modal } from 'ant-design-vue';
7
7
  import "ant-design-vue/es";
8
8
  import { omit } from "lodash-es";
9
9
  import { buttonProps } from "ant-design-vue/es/button/button";
10
10
  import { usePermission } from '@jetlinks-web/hooks';
11
+ import confirm from './confirm';
12
+ import { PermissionButtonConfig } from "@jetlinks-web/constants";
11
13
  var definedProps = _objectSpread({
12
14
  tooltip: {
13
15
  type: Object
@@ -26,6 +28,7 @@ var definedProps = _objectSpread({
26
28
  type: String
27
29
  }
28
30
  }, omit(buttonProps(), 'icon'));
31
+ export var destroyFns = [];
29
32
  var PermissionButton = defineComponent({
30
33
  name: 'JPermissionButton',
31
34
  // @ts-ignore
@@ -35,6 +38,9 @@ var PermissionButton = defineComponent({
35
38
  var slots = _ref.slots;
36
39
  var _usePermission = usePermission(props.hasPermission),
37
40
  hasPerm = _usePermission.hasPerm;
41
+ var context = inject(PermissionButtonConfig, {
42
+ components: undefined
43
+ });
38
44
  var permission = computed(function () {
39
45
  if (!props.hasPermission || props.hasPermission === true) {
40
46
  return true;
@@ -58,19 +64,24 @@ var PermissionButton = defineComponent({
58
64
  noPermissionTitle = props.noPermissionTitle,
59
65
  buttonProps = _objectWithoutProperties(props, _excluded);
60
66
  if (popConfirm) {
67
+ console.log('context', context);
61
68
  buttonProps.onClick = function () {
62
- Modal.confirm({
63
- title: popConfirm.title,
64
- content: popConfirm.content,
65
- onOk: function onOk() {
66
- var _popConfirm$onConfirm;
67
- return (_popConfirm$onConfirm = popConfirm.onConfirm) === null || _popConfirm$onConfirm === void 0 ? void 0 : _popConfirm$onConfirm.call(popConfirm);
68
- },
69
- onCancel: function onCancel() {
70
- var _popConfirm$onCancel;
71
- (_popConfirm$onCancel = popConfirm.onCancel) === null || _popConfirm$onCancel === void 0 ? void 0 : _popConfirm$onCancel.call(popConfirm);
72
- }
73
- });
69
+ if (context.components) {
70
+ confirm(popConfirm, context.components);
71
+ } else {
72
+ Modal.confirm({
73
+ title: popConfirm.title,
74
+ content: popConfirm.content,
75
+ onOk: function onOk() {
76
+ var _popConfirm$onConfirm;
77
+ return (_popConfirm$onConfirm = popConfirm.onConfirm) === null || _popConfirm$onConfirm === void 0 ? void 0 : _popConfirm$onConfirm.call(popConfirm);
78
+ },
79
+ onCancel: function onCancel() {
80
+ var _popConfirm$onCancel;
81
+ (_popConfirm$onCancel = popConfirm.onCancel) === null || _popConfirm$onCancel === void 0 ? void 0 : _popConfirm$onCancel.call(popConfirm);
82
+ }
83
+ });
84
+ }
74
85
  };
75
86
  }
76
87
  var button = !slots.button ? h(Button, _objectSpread(_objectSpread({}, buttonProps), {}, {
@@ -10,7 +10,7 @@
10
10
  "onClick": "setup-const"
11
11
  } */
12
12
  import { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
13
- const _withScopeId = n => (_pushScopeId("data-v-1726045324183"), n = n(), _popScopeId(), n);
13
+ const _withScopeId = n => (_pushScopeId("data-v-1726059570162"), n = n(), _popScopeId(), n);
14
14
  const _hoisted_1 = ["onClick"];
15
15
  const __sfc_main__ = Object.assign({
16
16
  name: 'JRadioButton',
@@ -21,7 +21,7 @@
21
21
  } */
22
22
  import { defineComponent as _defineComponent } from 'vue';
23
23
  import { unref as _unref, createVNode as _createVNode, withCtx as _withCtx, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
24
- const _withScopeId = n => (_pushScopeId("data-v-1726045325366"), n = n(), _popScopeId(), n);
24
+ const _withScopeId = n => (_pushScopeId("data-v-1726059570482"), n = n(), _popScopeId(), n);
25
25
  const _hoisted_1 = {
26
26
  key: 0,
27
27
  style: { "width": "240px" }
package/es/Search/Item.js CHANGED
@@ -78,7 +78,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
78
78
  } */
79
79
  import { defineComponent as _defineComponent } from 'vue';
80
80
  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";
81
- const _withScopeId = n => (_pushScopeId("data-v-1726045324800"), n = n(), _popScopeId(), n);
81
+ const _withScopeId = n => (_pushScopeId("data-v-1726059569799"), n = n(), _popScopeId(), n);
82
82
  const _hoisted_1 = { class: "JSearch-item" };
83
83
  const _hoisted_2 = {
84
84
  key: 0,
@@ -43,7 +43,7 @@
43
43
  } */
44
44
  import { defineComponent as _defineComponent } from 'vue';
45
45
  import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, unref as _unref, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
46
- const _withScopeId = n => (_pushScopeId("data-v-1726045324908"), n = n(), _popScopeId(), n);
46
+ const _withScopeId = n => (_pushScopeId("data-v-1726059569957"), n = n(), _popScopeId(), n);
47
47
  const _hoisted_1 = { class: "JSearch-content simple" };
48
48
  const _hoisted_2 = { class: "JSearch-items" };
49
49
  import { Button, Row, Col, Form, FormItemRest, } from 'ant-design-vue';
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.configProps = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
9
  var _context = require("ant-design-vue/es/config-provider/context");
10
+ require("@jetlinks-web/constants");
10
11
  var configProps = exports.configProps = function configProps() {
11
12
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _context.configProviderProps)()), {}, {
12
13
  IconConfig: {
@@ -17,6 +18,9 @@ var configProps = exports.configProps = function configProps() {
17
18
  },
18
19
  SearchConfig: {
19
20
  type: Object
21
+ },
22
+ PermissionButtonConfig: {
23
+ type: Object
20
24
  }
21
25
  });
22
26
  };
@@ -21,10 +21,12 @@ var JConfigProvider = (0, _vue.defineComponent)({
21
21
  var _iconConfig = (0, _vue.reactive)(props.IconConfig || {});
22
22
  var _mapConfig = (0, _vue.reactive)(props.MapConfig || {});
23
23
  var _searchConfig = (0, _vue.reactive)(props.SearchConfig || {});
24
- console.log('_searchConfig', _searchConfig);
24
+ var _PermissionButtonConfig = (0, _vue.reactive)(props.PermissionButtonConfig || {});
25
25
  (0, _vue.provide)(_constants.ComponentsEnum.Icon, _iconConfig); // 全局Icon 配置
26
26
  (0, _vue.provide)(_constants.MAPConfig, _mapConfig); // 全局地图配置
27
27
  (0, _vue.provide)(_constants.SearchConfig, _searchConfig); // 全局搜索配置
28
+ (0, _vue.provide)(_constants.PermissionButtonConfig, _PermissionButtonConfig); // 权限组件
29
+ console.log('_PermissionButtonConfig', _PermissionButtonConfig, props.PermissionButtonConfig);
28
30
  return function () {
29
31
  return (0, _vue.h)(_antDesignVue.ConfigProvider, (0, _objectSpread2.default)({}, (0, _lodashEs.omit)(props, ['IconConfig', 'MapConfig', 'SearchConfig'])), {
30
32
  default: slots.default,
@@ -48,7 +48,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
48
48
  "onFieldChange": "setup-const"
49
49
  } */
50
50
  import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
51
- const _withScopeId = n => (_pushScopeId("data-v-1726045323499"), n = n(), _popScopeId(), n);
51
+ const _withScopeId = n => (_pushScopeId("data-v-1726059568128"), n = n(), _popScopeId(), n);
52
52
  const _hoisted_1 = { style: { "color": "#1d2129" } };
53
53
  const _hoisted_2 = {
54
54
  key: 0,
@@ -6,7 +6,7 @@
6
6
  } */
7
7
  import { defineComponent as _defineComponent } from 'vue';
8
8
  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";
9
- const _withScopeId = n => (_pushScopeId("data-v-1726045323646"), n = n(), _popScopeId(), n);
9
+ const _withScopeId = n => (_pushScopeId("data-v-1726059568700"), n = n(), _popScopeId(), n);
10
10
  const _hoisted_1 = { class: "full-page-warp-content" };
11
11
  import { ref } from 'vue';
12
12
  import { useElementBounding } from '@vueuse/core';
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
+ var _vue = require("vue");
11
+ var _index = require("./index");
12
+ require("lodash");
13
+ var confirm = function confirm(config, components) {
14
+ var container = document.createDocumentFragment();
15
+ var confirmDialogInstance = null;
16
+ var currentConfig = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
17
+ visible: true
18
+ });
19
+ function destroy() {
20
+ if (confirmDialogInstance) {
21
+ // destroy
22
+ (0, _vue.render)(null, container);
23
+ confirmDialogInstance.component.update();
24
+ confirmDialogInstance = null;
25
+ }
26
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
27
+ args[_key] = arguments[_key];
28
+ }
29
+ var triggerCancel = args.some(function (param) {
30
+ return param && param.triggerCancel;
31
+ });
32
+ if (config.onCancel && triggerCancel) {
33
+ config.onCancel.apply(config, args);
34
+ }
35
+ for (var i = 0; i < _index.destroyFns.length; i++) {
36
+ var fn = _index.destroyFns[i];
37
+ if (fn === close) {
38
+ _index.destroyFns.splice(i, 1);
39
+ break;
40
+ }
41
+ }
42
+ }
43
+ function close() {
44
+ var _this = this;
45
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
46
+ args[_key2] = arguments[_key2];
47
+ }
48
+ currentConfig = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, currentConfig), {}, {
49
+ visible: false,
50
+ afterClose: function afterClose() {
51
+ if (typeof config.afterClose === 'function') {
52
+ config.afterClose();
53
+ }
54
+ destroy.apply(_this, args);
55
+ }
56
+ });
57
+ update(currentConfig);
58
+ }
59
+ function update(configUpdate) {
60
+ if (typeof configUpdate === 'function') {
61
+ currentConfig = configUpdate(currentConfig);
62
+ } else {
63
+ currentConfig = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, currentConfig), configUpdate);
64
+ }
65
+ if (confirmDialogInstance) {
66
+ (0, _extends2.default)(confirmDialogInstance.component.props, currentConfig);
67
+ confirmDialogInstance.component.update();
68
+ }
69
+ }
70
+ var Wrapper = function Wrapper(p) {
71
+ return (0, _vue.h)(components, (0, _objectSpread2.default)({}, p));
72
+ };
73
+ function render(props) {
74
+ var vm = (0, _vue.createVNode)(Wrapper, (0, _objectSpread2.default)({}, props));
75
+ vm.appContext = config.parentContext || config.appContext || vm.appContext;
76
+ (0, _vue.render)(vm, container);
77
+ return vm;
78
+ }
79
+ confirmDialogInstance = render(currentConfig);
80
+ _index.destroyFns.push(close);
81
+ return {
82
+ destroy: close,
83
+ update: update
84
+ };
85
+ };
86
+ var _default = exports.default = confirm;
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
7
+ exports.destroyFns = exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
@@ -14,6 +14,8 @@ require("ant-design-vue/es");
14
14
  var _lodashEs = require("lodash");
15
15
  var _button = require("ant-design-vue/es/button/button");
16
16
  var _hooks = require("@jetlinks-web/hooks");
17
+ var _confirm = _interopRequireDefault(require("./confirm"));
18
+ var _constants = require("@jetlinks-web/constants");
17
19
  var _excluded = ["popConfirm", "tooltip", "hasPermission", "noPermissionTitle"];
18
20
  var definedProps = (0, _objectSpread2.default)({
19
21
  tooltip: {
@@ -33,6 +35,7 @@ var definedProps = (0, _objectSpread2.default)({
33
35
  type: String
34
36
  }
35
37
  }, (0, _lodashEs.omit)((0, _button.buttonProps)(), 'icon'));
38
+ var destroyFns = exports.destroyFns = [];
36
39
  var PermissionButton = (0, _vue.defineComponent)({
37
40
  name: 'JPermissionButton',
38
41
  // @ts-ignore
@@ -42,6 +45,9 @@ var PermissionButton = (0, _vue.defineComponent)({
42
45
  var slots = _ref.slots;
43
46
  var _usePermission = (0, _hooks.usePermission)(props.hasPermission),
44
47
  hasPerm = _usePermission.hasPerm;
48
+ var context = (0, _vue.inject)(_constants.PermissionButtonConfig, {
49
+ components: undefined
50
+ });
45
51
  var permission = (0, _vue.computed)(function () {
46
52
  if (!props.hasPermission || props.hasPermission === true) {
47
53
  return true;
@@ -65,19 +71,24 @@ var PermissionButton = (0, _vue.defineComponent)({
65
71
  noPermissionTitle = props.noPermissionTitle,
66
72
  buttonProps = (0, _objectWithoutProperties2.default)(props, _excluded);
67
73
  if (popConfirm) {
74
+ console.log('context', context);
68
75
  buttonProps.onClick = function () {
69
- _antDesignVue.Modal.confirm({
70
- title: popConfirm.title,
71
- content: popConfirm.content,
72
- onOk: function onOk() {
73
- var _popConfirm$onConfirm;
74
- return (_popConfirm$onConfirm = popConfirm.onConfirm) === null || _popConfirm$onConfirm === void 0 ? void 0 : _popConfirm$onConfirm.call(popConfirm);
75
- },
76
- onCancel: function onCancel() {
77
- var _popConfirm$onCancel;
78
- (_popConfirm$onCancel = popConfirm.onCancel) === null || _popConfirm$onCancel === void 0 ? void 0 : _popConfirm$onCancel.call(popConfirm);
79
- }
80
- });
76
+ if (context.components) {
77
+ (0, _confirm.default)(popConfirm, context.components);
78
+ } else {
79
+ _antDesignVue.Modal.confirm({
80
+ title: popConfirm.title,
81
+ content: popConfirm.content,
82
+ onOk: function onOk() {
83
+ var _popConfirm$onConfirm;
84
+ return (_popConfirm$onConfirm = popConfirm.onConfirm) === null || _popConfirm$onConfirm === void 0 ? void 0 : _popConfirm$onConfirm.call(popConfirm);
85
+ },
86
+ onCancel: function onCancel() {
87
+ var _popConfirm$onCancel;
88
+ (_popConfirm$onCancel = popConfirm.onCancel) === null || _popConfirm$onCancel === void 0 ? void 0 : _popConfirm$onCancel.call(popConfirm);
89
+ }
90
+ });
91
+ }
81
92
  };
82
93
  }
83
94
  var button = !slots.button ? (0, _vue.h)(_antDesignVue.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, buttonProps), {}, {
@@ -10,7 +10,7 @@
10
10
  "onClick": "setup-const"
11
11
  } */
12
12
  import { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
13
- const _withScopeId = n => (_pushScopeId("data-v-1726045324194"), n = n(), _popScopeId(), n);
13
+ const _withScopeId = n => (_pushScopeId("data-v-1726059570170"), n = n(), _popScopeId(), n);
14
14
  const _hoisted_1 = ["onClick"];
15
15
  const __sfc_main__ = Object.assign({
16
16
  name: 'JRadioButton',
@@ -21,7 +21,7 @@
21
21
  } */
22
22
  import { defineComponent as _defineComponent } from 'vue';
23
23
  import { unref as _unref, createVNode as _createVNode, withCtx as _withCtx, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
24
- const _withScopeId = n => (_pushScopeId("data-v-1726045325353"), n = n(), _popScopeId(), n);
24
+ const _withScopeId = n => (_pushScopeId("data-v-1726059570504"), n = n(), _popScopeId(), n);
25
25
  const _hoisted_1 = {
26
26
  key: 0,
27
27
  style: { "width": "240px" }
@@ -78,7 +78,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
78
78
  } */
79
79
  import { defineComponent as _defineComponent } from 'vue';
80
80
  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";
81
- const _withScopeId = n => (_pushScopeId("data-v-1726045324741"), n = n(), _popScopeId(), n);
81
+ const _withScopeId = n => (_pushScopeId("data-v-1726059569871"), n = n(), _popScopeId(), n);
82
82
  const _hoisted_1 = { class: "JSearch-item" };
83
83
  const _hoisted_2 = {
84
84
  key: 0,
@@ -43,7 +43,7 @@
43
43
  } */
44
44
  import { defineComponent as _defineComponent } from 'vue';
45
45
  import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, unref as _unref, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
46
- const _withScopeId = n => (_pushScopeId("data-v-1726045324883"), n = n(), _popScopeId(), n);
46
+ const _withScopeId = n => (_pushScopeId("data-v-1726059569983"), n = n(), _popScopeId(), n);
47
47
  const _hoisted_1 = { class: "JSearch-content simple" };
48
48
  const _hoisted_2 = { class: "JSearch-items" };
49
49
  import { Button, Row, Col, Form, FormItemRest, } from 'ant-design-vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetlinks-web/components",
3
- "version": "2.3.10",
3
+ "version": "2.4.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -152,9 +152,9 @@
152
152
  "webpack-dev-server": "^4.0.0",
153
153
  "webpack-merge": "^5.0.0",
154
154
  "webpackbar": "^5.0.2",
155
- "@jetlinks-web/constants": "^1.0.4",
156
- "@jetlinks-web/utils": "^1.2.1",
157
- "@jetlinks-web/hooks": "^1.0.16"
155
+ "@jetlinks-web/hooks": "^1.0.16",
156
+ "@jetlinks-web/constants": "^1.0.5",
157
+ "@jetlinks-web/utils": "^1.2.1"
158
158
  },
159
159
  "publishConfig": {
160
160
  "registry": "https://registry.npmjs.org/",