@ibiz-template/vue3-components 0.7.13 → 0.7.15

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 (70) hide show
  1. package/dist/{index-WP6TUdg-.js → index-8Lu2Ax-_.js} +1 -1
  2. package/dist/{index-kgWpXafW.js → index-Hg_8xCYx.js} +1 -1
  3. package/dist/index-vUHyK4p8.js +4 -0
  4. package/dist/index.min.css +1 -1
  5. package/dist/index.system.min.js +1 -1
  6. package/dist/{wang-editor-PQvDXaA9.js → wang-editor-XpJH4SXt.js} +1 -1
  7. package/dist/{xlsx-util-8i01yifN.js → xlsx-util-5nNxB32e.js} +1 -1
  8. package/es/common/carousel/carousel.d.ts +9 -1
  9. package/es/common/carousel/carousel.mjs +9 -1
  10. package/es/common/carousel-card/carousel-card.css +1 -0
  11. package/es/common/carousel-card/carousel-card.d.ts +41 -0
  12. package/es/common/carousel-card/carousel-card.mjs +218 -0
  13. package/es/common/index.mjs +2 -0
  14. package/es/control/context-menu/context-menu.mjs +25 -6
  15. package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.d.ts +76 -1
  16. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.d.ts +74 -0
  17. package/es/control/search-bar/filter-tree/filter-tree.mjs +19 -20
  18. package/es/control/toolbar/toolbar.mjs +27 -2
  19. package/es/control/tree/tree.css +1 -1
  20. package/es/control/tree/tree.mjs +2 -1
  21. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
  22. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.mjs +11 -12
  23. package/es/editor/html/wang-editor/wang-editor.css +1 -1
  24. package/es/editor/html/wang-editor/wang-editor.mjs +2 -2
  25. package/es/editor/text-box/input/input.css +1 -1
  26. package/es/locale/en/index.d.ts +1 -0
  27. package/es/locale/en/index.mjs +2 -1
  28. package/es/locale/zh-CN/index.d.ts +1 -0
  29. package/es/locale/zh-CN/index.mjs +2 -1
  30. package/es/panel-component/auth-captcha/auth-captcha.controller.d.ts +13 -0
  31. package/es/panel-component/auth-captcha/auth-captcha.controller.mjs +15 -11
  32. package/es/panel-component/panel-button/panel-button.controller.d.ts +1 -1
  33. package/es/panel-component/panel-button/panel-button.controller.mjs +6 -9
  34. package/es/panel-component/panel-static-carousel/index.d.ts +1 -0
  35. package/es/panel-component/panel-static-carousel/panel-static-carousel.css +1 -0
  36. package/es/panel-component/panel-static-carousel/panel-static-carousel.d.ts +1 -0
  37. package/es/panel-component/panel-static-carousel/panel-static-carousel.mjs +13 -2
  38. package/es/panel-component/short-cut/index.d.ts +2 -2
  39. package/es/panel-component/short-cut/short-cut.css +1 -1
  40. package/es/panel-component/short-cut/short-cut.d.ts +2 -2
  41. package/es/panel-component/short-cut/short-cut.mjs +42 -36
  42. package/es/view-engine/login-view.engine.d.ts +31 -3
  43. package/es/view-engine/login-view.engine.mjs +32 -12
  44. package/es/web-app/components/modal-router-shell/modal-router-shell.mjs +19 -5
  45. package/lib/common/carousel/carousel.cjs +9 -1
  46. package/lib/common/carousel-card/carousel-card.cjs +220 -0
  47. package/lib/common/carousel-card/carousel-card.css +1 -0
  48. package/lib/common/index.cjs +2 -0
  49. package/lib/control/context-menu/context-menu.cjs +25 -6
  50. package/lib/control/search-bar/filter-tree/filter-tree.cjs +19 -20
  51. package/lib/control/toolbar/toolbar.cjs +26 -1
  52. package/lib/control/tree/tree.cjs +2 -1
  53. package/lib/control/tree/tree.css +1 -1
  54. package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.cjs +11 -12
  55. package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
  56. package/lib/editor/html/wang-editor/wang-editor.cjs +2 -2
  57. package/lib/editor/html/wang-editor/wang-editor.css +1 -1
  58. package/lib/editor/text-box/input/input.css +1 -1
  59. package/lib/locale/en/index.cjs +2 -1
  60. package/lib/locale/zh-CN/index.cjs +2 -1
  61. package/lib/panel-component/auth-captcha/auth-captcha.controller.cjs +15 -11
  62. package/lib/panel-component/panel-button/panel-button.controller.cjs +6 -9
  63. package/lib/panel-component/panel-static-carousel/panel-static-carousel.cjs +13 -2
  64. package/lib/panel-component/panel-static-carousel/panel-static-carousel.css +1 -0
  65. package/lib/panel-component/short-cut/short-cut.cjs +42 -36
  66. package/lib/panel-component/short-cut/short-cut.css +1 -1
  67. package/lib/view-engine/login-view.engine.cjs +32 -12
  68. package/lib/web-app/components/modal-router-shell/modal-router-shell.cjs +17 -3
  69. package/package.json +7 -7
  70. package/dist/index-5IjaPupj.js +0 -4
@@ -26,9 +26,10 @@ const ShortCut = /* @__PURE__ */ defineComponent({
26
26
  const ns = useNamespace("short-cut");
27
27
  const vue = getCurrentInstance().proxy;
28
28
  const router = useRouter();
29
- const isShowToolbar = ref(false);
29
+ const shortCutUtil = ibiz.util.shortCut;
30
+ const isShowToolbar = ref(true);
30
31
  const isShowMore = ref(false);
31
- const data = reactive(ibiz.util.shortCut.data);
32
+ const data = reactive(shortCutUtil.data);
32
33
  const dragCache = {
33
34
  newIndex: 0,
34
35
  oldIndex: 0
@@ -41,6 +42,7 @@ const ShortCut = /* @__PURE__ */ defineComponent({
41
42
  vue.$forceUpdate();
42
43
  };
43
44
  onMounted(() => {
45
+ isShowToolbar.value = shortCutUtil.mode !== "vertical";
44
46
  ibiz.util.shortCut.onChange(onShortCutChange);
45
47
  });
46
48
  onUnmounted(() => {
@@ -50,6 +52,9 @@ const ShortCut = /* @__PURE__ */ defineComponent({
50
52
  isShowToolbar.value = !isShowToolbar.value;
51
53
  if (isShowToolbar.value) {
52
54
  isShowMore.value = false;
55
+ shortCutUtil.setShortCutMode("horizontal");
56
+ } else {
57
+ shortCutUtil.setShortCutMode("vertical");
53
58
  }
54
59
  };
55
60
  const onClick = (item) => {
@@ -84,7 +89,7 @@ const ShortCut = /* @__PURE__ */ defineComponent({
84
89
  const renderDraggable = (isVertical) => {
85
90
  return createVNode(draggable, {
86
91
  "itemKey": "key",
87
- "class": [ns.e("draggable"), ns.is("vertical", isVertical), ns.is("horizontal", !isVertical)],
92
+ "class": [ns.e("draggable"), ns.is("horizontal", !isVertical), ns.is("vertical", isVertical)],
88
93
  "modelValue": data,
89
94
  "group": props.controller.model.id,
90
95
  "onChange": (evt) => onChange(evt)
@@ -95,7 +100,7 @@ const ShortCut = /* @__PURE__ */ defineComponent({
95
100
  }) => {
96
101
  if (isVertical && !isShowToolbar.value || isVertical && isShowToolbar.value && index > 5 || !isVertical && index < 6) {
97
102
  return createVNode("div", {
98
- "class": ns.e("item"),
103
+ "class": [ns.e("item"), ns.e("draggable-item")],
99
104
  "title": element.caption,
100
105
  "onClick": () => onClick(element)
101
106
  }, [createVNode("svg", {
@@ -130,23 +135,21 @@ const ShortCut = /* @__PURE__ */ defineComponent({
130
135
  "onClick": (event) => onDelete(event, element.key)
131
136
  }, null)]);
132
137
  }
133
- },
134
- footer: () => {
135
- if (isVertical && !isShowToolbar.value) {
136
- return createVNode("div", {
137
- "class": [ns.e("item"), ns.e("action")],
138
- "onClick": onShowChange
139
- }, [createVNode("ion-icon", {
140
- "class": ["expand-icon", "icon"],
141
- "name": "chevron-back-outline"
142
- }, null), createVNode("div", {
143
- "class": ns.em("item", "caption")
144
- }, [ibiz.i18n.t("panelComponent.shortCut.expandToolbar")])]);
145
- }
146
138
  }
147
139
  });
148
140
  };
149
- const renderMoreToolbar = () => {
141
+ const renderAction = () => {
142
+ return createVNode("div", {
143
+ "class": [ns.e("item"), ns.e("action-item"), ns.is("hidden", isShowToolbar.value)],
144
+ "onClick": onShowChange
145
+ }, [createVNode("ion-icon", {
146
+ "class": ["expand-icon", "icon"],
147
+ "name": "chevron-back-outline"
148
+ }, null), createVNode("div", {
149
+ "class": ns.em("item", "caption")
150
+ }, [ibiz.i18n.t("panelComponent.shortCut.expandToolbar")])]);
151
+ };
152
+ const renderMore = () => {
150
153
  return createVNode(resolveComponent("el-popover"), {
151
154
  "visible": isShowMore.value,
152
155
  "onUpdate:visible": ($event) => isShowMore.value = $event,
@@ -157,7 +160,7 @@ const ShortCut = /* @__PURE__ */ defineComponent({
157
160
  }, {
158
161
  reference: () => {
159
162
  return createVNode("div", {
160
- "class": ns.e("more")
163
+ "class": [ns.e("more"), ns.e("operate")]
161
164
  }, [createVNode(resolveComponent("el-tooltip"), {
162
165
  "content": ibiz.i18n.t("app.more"),
163
166
  "placement": "top"
@@ -165,42 +168,45 @@ const ShortCut = /* @__PURE__ */ defineComponent({
165
168
  default: () => [createVNode("div", null, [createVNode("span", {
166
169
  "class": ns.em("more", "caption")
167
170
  }, [isShowToolbar.value ? "6/".concat(data.length) : data.length]), createVNode("i", {
168
- "class": ["fa", ns.em("more", "icon"), isShowMore.value ? "fa-angle-double-down" : "fa-angle-double-up"],
171
+ "class": ["fa", "icon", "more-icon", isShowMore.value ? "fa-angle-double-down" : "fa-angle-double-up"],
169
172
  "aria-hidden": "true"
170
173
  }, null)])]
171
174
  })]);
172
175
  },
173
176
  default: () => {
174
- return renderDraggable(true);
177
+ return [renderDraggable(true), renderAction()];
175
178
  }
176
179
  });
177
180
  };
181
+ const renderRecover = () => {
182
+ return createVNode("div", {
183
+ "class": [ns.e("recover"), ns.e("operate")],
184
+ "onClick": onShowChange
185
+ }, [createVNode(resolveComponent("el-tooltip"), {
186
+ "effect": "dark",
187
+ "content": ibiz.i18n.t("app.retract"),
188
+ "placement": "top"
189
+ }, {
190
+ default: () => [createVNode("ion-icon", {
191
+ "class": ["recover-icon", "icon"],
192
+ "name": "chevron-forward-outline"
193
+ }, null)]
194
+ })]);
195
+ };
178
196
  return {
179
197
  ns,
180
198
  data,
181
199
  isShowToolbar,
182
200
  onChange,
183
- onShowChange,
184
201
  renderDraggable,
185
- renderMoreToolbar
202
+ renderMore,
203
+ renderRecover
186
204
  };
187
205
  },
188
206
  render() {
189
207
  return createVNode("div", {
190
208
  "class": [this.ns.b(), ...this.controller.containerClass, this.ns.is("conceal", this.data.length === 0)]
191
- }, [this.isShowToolbar && this.renderDraggable(false), (!this.isShowToolbar || this.data.length > 6) && this.renderMoreToolbar(), this.isShowToolbar && createVNode("div", {
192
- "class": this.ns.e("recover"),
193
- "onClick": this.onShowChange
194
- }, [createVNode(resolveComponent("el-tooltip"), {
195
- "effect": "dark",
196
- "content": ibiz.i18n.t("app.retract"),
197
- "placement": "top"
198
- }, {
199
- default: () => [createVNode("ion-icon", {
200
- "class": ["recover-icon", "icon"],
201
- "name": "chevron-forward-outline"
202
- }, null)]
203
- })])]);
209
+ }, [this.isShowToolbar && this.renderDraggable(false), (!this.isShowToolbar || this.data.length > 6) && this.renderMore(), this.isShowToolbar && this.renderRecover()]);
204
210
  }
205
211
  });
206
212
 
@@ -1,11 +1,39 @@
1
- import { ViewController, ViewEngineBase, AppLoginViewController, IViewState, IViewEvent } from '@ibiz-template/runtime';
1
+ import { ViewController, ViewEngineBase, IAppLoginViewState, IAppLoginViewEvent } from '@ibiz-template/runtime';
2
2
  import { RouteLocationNormalizedLoaded } from 'vue-router';
3
3
  import { IAppView } from '@ibiz/model-core';
4
4
  export declare class LoginViewEngine extends ViewEngineBase {
5
+ /**
6
+ * 路由对象
7
+ *
8
+ * @type {RouteLocationNormalizedLoaded}
9
+ * @memberof LoginViewEngine
10
+ */
5
11
  route: RouteLocationNormalizedLoaded;
6
- protected view: AppLoginViewController<IAppView, IViewState, IViewEvent>;
7
- get AppLoginView(): ViewController;
12
+ /**
13
+ * 应用登录视图控制器
14
+ *
15
+ * @protected
16
+ * @type {ViewController<
17
+ * IAppView,
18
+ * IAppLoginViewState,
19
+ * IAppLoginViewEvent
20
+ * >}
21
+ * @memberof LoginViewEngine
22
+ */
23
+ protected view: ViewController<IAppView, IAppLoginViewState, IAppLoginViewEvent>;
24
+ /**
25
+ * 视图mounted生命周期执行逻辑
26
+ *
27
+ * @return {*} {Promise<void>}
28
+ * @memberof LoginViewEngine
29
+ */
8
30
  onMounted(): Promise<void>;
31
+ /**
32
+ * 视图destroyed生命周期执行逻辑
33
+ *
34
+ * @return {*} {Promise<void>}
35
+ * @memberof LoginViewEngine
36
+ */
9
37
  onDestroyed(): Promise<void>;
10
38
  call(key: string, args?: IData): Promise<IData | null | undefined>;
11
39
  login(args: IData): Promise<void>;
@@ -12,14 +12,21 @@ var __publicField = (obj, key, value) => {
12
12
  class LoginViewEngine extends ViewEngineBase {
13
13
  constructor() {
14
14
  super(...arguments);
15
+ /**
16
+ * 路由对象
17
+ *
18
+ * @type {RouteLocationNormalizedLoaded}
19
+ * @memberof LoginViewEngine
20
+ */
15
21
  __publicField(this, "route", useRoute());
16
22
  __publicField(this, "enterKeyListener", async (event) => {
17
- if (event.key === "Enter" && this.AppLoginView.layoutPanel) {
23
+ if (event.key === "Enter" && this.view.layoutPanel) {
18
24
  const args = {
19
25
  data: [
20
26
  {
21
- username: this.AppLoginView.layoutPanel.data.username,
22
- password: this.AppLoginView.layoutPanel.data.password
27
+ username: this.view.layoutPanel.data.username,
28
+ password: this.view.layoutPanel.data.password,
29
+ captcha: this.view.layoutPanel.data.captcha
23
30
  }
24
31
  ]
25
32
  };
@@ -27,13 +34,22 @@ class LoginViewEngine extends ViewEngineBase {
27
34
  }
28
35
  });
29
36
  }
30
- get AppLoginView() {
31
- return this.view.getController("AppLoginView");
32
- }
37
+ /**
38
+ * 视图mounted生命周期执行逻辑
39
+ *
40
+ * @return {*} {Promise<void>}
41
+ * @memberof LoginViewEngine
42
+ */
33
43
  async onMounted() {
34
44
  super.onMounted();
35
45
  document.addEventListener("keydown", this.enterKeyListener);
36
46
  }
47
+ /**
48
+ * 视图destroyed生命周期执行逻辑
49
+ *
50
+ * @return {*} {Promise<void>}
51
+ * @memberof LoginViewEngine
52
+ */
37
53
  async onDestroyed() {
38
54
  super.onDestroyed();
39
55
  document.removeEventListener("keydown", this.enterKeyListener);
@@ -51,8 +67,12 @@ class LoginViewEngine extends ViewEngineBase {
51
67
  let rememberme;
52
68
  const headers = {};
53
69
  const data = args.data[0] || {};
54
- if (this.AppLoginView.layoutPanel) {
55
- const panelData = this.AppLoginView.layoutPanel.data;
70
+ const panelDataParent = args.params.panelDataParent;
71
+ if (this.view.layoutPanel) {
72
+ if (!await this.view.layoutPanel.validate(panelDataParent)) {
73
+ return;
74
+ }
75
+ const panelData = this.view.layoutPanel.data;
56
76
  if (typeof panelData.isRemember === "boolean") {
57
77
  rememberme = panelData.isRemember;
58
78
  }
@@ -73,16 +93,16 @@ class LoginViewEngine extends ViewEngineBase {
73
93
  rememberme,
74
94
  headers
75
95
  );
76
- this.view.hooks.afterLogin.call({ ok: bol });
96
+ this.view.evt.emit("onAfterLogin", { ok: bol, panelDataParent });
77
97
  if (bol === true) {
78
98
  window.location.hash = this.route.query.ru || "/";
79
99
  window.location.reload();
80
100
  }
81
101
  }
82
102
  async cancelChanges() {
83
- if (this.AppLoginView.layoutPanel) {
84
- Object.keys(this.AppLoginView.layoutPanel.panelItems).forEach((key) => {
85
- const controller = this.AppLoginView.layoutPanel.panelItems[key];
103
+ if (this.view.layoutPanel) {
104
+ Object.keys(this.view.layoutPanel.panelItems).forEach((key) => {
105
+ const controller = this.view.layoutPanel.panelItems[key];
86
106
  const { viewFieldName } = controller.model;
87
107
  if (viewFieldName) {
88
108
  controller.setDataValue("", viewFieldName);
@@ -1,6 +1,6 @@
1
1
  import { ref, toRaw, onUnmounted, createVNode, defineComponent } from 'vue';
2
- import { parseRouteViewData, createOverlayView, routerCallback } from '@ibiz-template/vue3-util';
3
- import { useRoute, useRouter } from 'vue-router';
2
+ import { parseRouteViewData, createOverlayView, routerCallback, route2routePath } from '@ibiz-template/vue3-util';
3
+ import { useRoute, useRouter, onBeforeRouteUpdate } from 'vue-router';
4
4
  import { IBizContext } from '@ibiz-template/core';
5
5
  import { RouteConst } from '@ibiz-template/runtime';
6
6
  import { isEmpty } from 'ramda';
@@ -18,10 +18,11 @@ const ModalRouterShell = /* @__PURE__ */ defineComponent({
18
18
  }
19
19
  },
20
20
  setup(props) {
21
- const route = useRoute();
21
+ const routeObj = useRoute();
22
22
  const router = useRouter();
23
23
  const isDestroyed = ref(false);
24
24
  const viewData = ref({});
25
+ const pathHistory = [];
25
26
  const destroyContext = () => {
26
27
  if (viewData.value.context) {
27
28
  const {
@@ -41,9 +42,12 @@ const ModalRouterShell = /* @__PURE__ */ defineComponent({
41
42
  }
42
43
  destroyContext();
43
44
  });
44
- const openView = async () => {
45
+ const openView = async (route) => {
45
46
  var _a;
46
47
  viewData.value = await parseRouteViewData(route, routeDepth, true);
48
+ if (isDestroyed.value) {
49
+ return;
50
+ }
47
51
  if (!(viewData.value.context instanceof IBizContext)) {
48
52
  viewData.value.context = IBizContext.create(viewData.value.context);
49
53
  }
@@ -97,6 +101,7 @@ const ModalRouterShell = /* @__PURE__ */ defineComponent({
97
101
  };
98
102
  overlay = ibiz.overlay.createModal(component, void 0, opts);
99
103
  overlay.present();
104
+ pathHistory.push(route.fullPath);
100
105
  const result = await overlay.onWillDismiss();
101
106
  overlay = null;
102
107
  if (isDestroyed.value === false) {
@@ -112,7 +117,16 @@ const ModalRouterShell = /* @__PURE__ */ defineComponent({
112
117
  });
113
118
  }
114
119
  };
115
- openView();
120
+ onBeforeRouteUpdate((to, from) => {
121
+ if (!isDestroyed.value && pathHistory.length > 0 && pathHistory.indexOf(from.fullPath) !== -1 && pathHistory.indexOf(to.fullPath) === -1) {
122
+ const pathNodes = route2routePath(to).pathNodes;
123
+ const lastNode = pathNodes[pathNodes.length - 1];
124
+ if (lastNode && lastNode.viewName === RouteConst.ROUTE_MODAL_TAG) {
125
+ openView(to);
126
+ }
127
+ }
128
+ });
129
+ openView(routeObj);
116
130
  return {};
117
131
  },
118
132
  render() {
@@ -22,6 +22,10 @@ const IBizCarouselComponent = /* @__PURE__ */ vue.defineComponent({
22
22
  timeSpan: {
23
23
  type: Number,
24
24
  default: 3e3
25
+ },
26
+ showMode: {
27
+ type: String,
28
+ required: true
25
29
  }
26
30
  },
27
31
  setup(props) {
@@ -59,7 +63,11 @@ const IBizCarouselComponent = /* @__PURE__ */ vue.defineComponent({
59
63
  }, null);
60
64
  }
61
65
  };
62
- return vue.createVNode("div", null, [vue.createVNode(vue.resolveComponent("el-carousel"), {
66
+ return vue.createVNode("div", null, [this.showMode === "CARD" ? vue.createVNode(vue.resolveComponent("IBizCarousel-card"), {
67
+ "swipeData": this.swipeData,
68
+ "isAuto": this.isAuto,
69
+ "timeSpan": this.timeSpan
70
+ }, null) : vue.createVNode(vue.resolveComponent("el-carousel"), {
63
71
  "class": this.ns.b(),
64
72
  "autoplay": this.isAuto,
65
73
  "interval": this.timeSpan
@@ -0,0 +1,220 @@
1
+ 'use strict';
2
+
3
+ var vue = require('vue');
4
+ var vue3Util = require('@ibiz-template/vue3-util');
5
+ require('./carousel-card.css');
6
+
7
+ "use strict";
8
+ const IBizCarouselCard = /* @__PURE__ */ vue.defineComponent({
9
+ name: "IBizCarouselCard",
10
+ props: {
11
+ swipeData: {
12
+ type: Object,
13
+ required: true
14
+ },
15
+ isAuto: {
16
+ type: Boolean,
17
+ default: true
18
+ },
19
+ timeSpan: {
20
+ type: Number,
21
+ default: 3e3
22
+ }
23
+ },
24
+ setup(props) {
25
+ const ns = vue3Util.useNamespace("carousel-card");
26
+ const nowIndex = vue.ref(3);
27
+ const mainDom = vue.ref();
28
+ const listDom = vue.ref();
29
+ const gap = 0;
30
+ const imgWidth = vue.ref(600);
31
+ const containerWidth = vue.ref(0);
32
+ const diffLen = vue.computed(() => {
33
+ return (containerWidth.value - imgWidth.value - gap * 2) / 2;
34
+ });
35
+ let timer = null;
36
+ const imgDoms = document.getElementsByClassName("swiper-slide-card");
37
+ const scale = 0.8;
38
+ const aniTime = 500;
39
+ const resImgArr = vue.computed(() => {
40
+ if (props.swipeData.length > 2) {
41
+ return [...props.swipeData.slice(-2), ...props.swipeData, ...props.swipeData.slice(0, 2)];
42
+ }
43
+ return [...props.swipeData];
44
+ });
45
+ const setScale = () => {
46
+ for (let i = 0; i < imgDoms.length; i++) {
47
+ if (props.swipeData.length === 2) {
48
+ imgDoms[0].style.left = "".concat(containerWidth.value / 4 - imgWidth.value / 2, "px");
49
+ imgDoms[1].style.left = "".concat(containerWidth.value / 4 * 3 - imgWidth.value / 2, "px");
50
+ } else if (props.swipeData.length === 1) {
51
+ imgDoms[i].style.left = "".concat(containerWidth.value / 2 - imgWidth.value / 2, "px");
52
+ } else {
53
+ imgDoms[i].style.left = "".concat((i - 1) * (imgWidth.value + gap), "px");
54
+ }
55
+ if (i === nowIndex.value - 1) {
56
+ imgDoms[i].style.transform = "scale(1)";
57
+ } else {
58
+ imgDoms[i].style.transform = "scale(".concat(scale, ")");
59
+ }
60
+ }
61
+ };
62
+ const nextSlider = (anitime) => {
63
+ if (props.swipeData.length === 2) {
64
+ nowIndex.value = nowIndex.value ? 0 : 1;
65
+ setScale();
66
+ } else if (props.swipeData.length === 1) {
67
+ } else {
68
+ if (nowIndex.value >= 2) {
69
+ mainDom.value.style.transition = "left ".concat(anitime / 1e3, "s");
70
+ mainDom.value.style.left = "".concat(parseInt(mainDom.value.style.left, 10) - (gap + imgWidth.value), "px");
71
+ }
72
+ if (nowIndex.value === props.swipeData.length + 1) {
73
+ nowIndex.value = props.swipeData.length + 2;
74
+ setScale();
75
+ setTimeout(() => {
76
+ nowIndex.value = 2;
77
+ setScale();
78
+ mainDom.value.style.transitionProperty = "none";
79
+ mainDom.value.style.left = "".concat(-(imgWidth.value - diffLen.value), "px");
80
+ }, anitime);
81
+ } else {
82
+ nowIndex.value++;
83
+ setScale();
84
+ }
85
+ }
86
+ };
87
+ const prevSlider = (anitime) => {
88
+ if (props.swipeData.length === 2) {
89
+ nowIndex.value = nowIndex.value ? 0 : 1;
90
+ setScale();
91
+ } else if (props.swipeData.length === 1) {
92
+ } else {
93
+ nowIndex.value--;
94
+ mainDom.value.style.transition = "left ".concat(anitime / 1e3, "s");
95
+ mainDom.value.style.left = "".concat(parseInt(mainDom.value.style.left, 10) + (gap + imgWidth.value), "px");
96
+ if (nowIndex.value === 1) {
97
+ setScale();
98
+ setTimeout(() => {
99
+ nowIndex.value = props.swipeData.length + 1;
100
+ setScale();
101
+ mainDom.value.style.transitionProperty = "none";
102
+ mainDom.value.style.left = "".concat(-(parseInt(imgDoms[nowIndex.value].style.left, 10) - diffLen.value - gap), "px");
103
+ }, anitime);
104
+ } else {
105
+ setScale();
106
+ }
107
+ }
108
+ };
109
+ const startAutoplay = () => {
110
+ timer = window.setInterval(() => nextSlider(aniTime), props.timeSpan);
111
+ };
112
+ const stopAutoplay = () => {
113
+ if (timer) {
114
+ window.clearInterval(timer);
115
+ timer = null;
116
+ }
117
+ };
118
+ setScale();
119
+ vue.onMounted(() => {
120
+ if (props.isAuto) {
121
+ startAutoplay();
122
+ }
123
+ });
124
+ vue.onBeforeUnmount(() => {
125
+ stopAutoplay();
126
+ });
127
+ vue.nextTick(() => {
128
+ containerWidth.value = listDom.value.clientWidth;
129
+ imgWidth.value = imgDoms[0].clientWidth;
130
+ if (mainDom.value) {
131
+ mainDom.value.style.left = "".concat(-(2 * imgWidth.value + gap - diffLen.value), "px");
132
+ mainDom.value.style.width = "".concat((props.swipeData.length + 2) * (imgWidth.value + gap / 2), "px");
133
+ }
134
+ setScale();
135
+ });
136
+ const btnClick = (pos) => {
137
+ if (pos === "left") {
138
+ prevSlider(aniTime);
139
+ } else if (pos === "right") {
140
+ nextSlider(aniTime);
141
+ }
142
+ };
143
+ const dotClick = (targetIndex) => {
144
+ nowIndex.value = targetIndex + 2 + 1;
145
+ if (nowIndex.value === props.swipeData.length + 2) {
146
+ nowIndex.value = 2;
147
+ }
148
+ mainDom.value.style.transition = "left ".concat(aniTime / 1e3, "s");
149
+ mainDom.value.style.left = "".concat(-((nowIndex.value - 1) * imgWidth.value + gap - diffLen.value), "px");
150
+ setScale();
151
+ };
152
+ return {
153
+ ns,
154
+ btnClick,
155
+ mainDom,
156
+ listDom,
157
+ imgWidth,
158
+ resImgArr,
159
+ dotClick,
160
+ nowIndex
161
+ };
162
+ },
163
+ render() {
164
+ const renderPic = (item) => {
165
+ if (item.cssClass) {
166
+ if (item.cssClass.indexOf("fa-") !== -1) {
167
+ return vue.createVNode("i", {
168
+ "class": [item.cssClas, "swiper-slide-card"]
169
+ }, null);
170
+ }
171
+ return vue.createVNode("ion-icon", {
172
+ "class": "swiper-slide-card",
173
+ "name": item.cssClass
174
+ }, null);
175
+ }
176
+ if (item.imgUrl) {
177
+ return vue.createVNode("img", {
178
+ "class": "swiper-slide-card",
179
+ "style": "width: ".concat(this.imgWidth, "px"),
180
+ "alt": item.name,
181
+ "src": item.imgUrl
182
+ }, null);
183
+ }
184
+ };
185
+ let newIndex = this.nowIndex;
186
+ if (this.nowIndex < this.swipeData.length) {
187
+ newIndex = this.nowIndex + this.swipeData.length;
188
+ }
189
+ return vue.createVNode("div", {
190
+ "class": this.ns.b()
191
+ }, [vue.createVNode("div", {
192
+ "class": this.ns.e("swiper-list"),
193
+ "ref": "listDom"
194
+ }, [vue.createVNode("div", {
195
+ "class": this.ns.e("swiper-main"),
196
+ "ref": "mainDom"
197
+ }, [this.resImgArr.map((item) => {
198
+ return renderPic(item);
199
+ })]), vue.createVNode("div", {
200
+ "id": "prev-card",
201
+ "class": this.ns.e("leftBtn"),
202
+ "style": "width:".concat(this.imgWidth, "px"),
203
+ "onClick": () => this.btnClick("left")
204
+ }, null), vue.createVNode("div", {
205
+ "id": "next-card",
206
+ "class": this.ns.e("rightBtn"),
207
+ "style": "width:".concat(this.imgWidth, "px"),
208
+ "onClick": () => this.btnClick("right")
209
+ }, null)]), vue.createVNode("div", {
210
+ "class": this.ns.e("dot")
211
+ }, [this.swipeData.map((_item, index) => {
212
+ return vue.createVNode("div", {
213
+ "class": [this.ns.e("dot-item"), index === newIndex - 3 ? "isActive" : ""],
214
+ "onClick": () => this.dotClick(index)
215
+ }, null);
216
+ })])]);
217
+ }
218
+ });
219
+
220
+ exports.IBizCarouselCard = IBizCarouselCard;
@@ -0,0 +1 @@
1
+ .ibiz-carousel-card{position:relative;z-index:1;padding:0;margin-right:auto;margin-left:auto;overflow:hidden;list-style:none}.ibiz-carousel-card__swiper-list{position:relative;z-index:1;padding:0;margin-right:auto;margin-left:auto;overflow:hidden;list-style:none}.ibiz-carousel-card__swiper-main{position:relative;z-index:1;box-sizing:content-box;display:flex;width:100%;height:100%;transition:transform .5s ease-in-out;transition-property:transform}.ibiz-carousel-card__swiper-main img{display:block;display:inline-block;flex-shrink:0;border-radius:4px;box-shadow:0 4px 8px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19)}.ibiz-carousel-card__leftBtn{position:absolute;top:0;left:0;z-index:2;height:100%;background-image:linear-gradient(90deg,#fff 0,rgba(255,255,255,0));transition:.4s}.ibiz-carousel-card__rightBtn{position:absolute;top:0;right:0;z-index:2;height:100%;background-image:linear-gradient(270deg,#fff 0,rgba(255,255,255,0));transition:.4s}.ibiz-carousel-card__dot{z-index:1;display:flex;justify-content:center;margin-top:20px}.ibiz-carousel-card__dot-item{width:8px;height:8px;margin-right:8px;cursor:pointer;background:#eee;border-radius:4px;transition:all .5s ease}.ibiz-carousel-card__dot-item.isActive{width:16px;background:#6698ff}
@@ -23,6 +23,7 @@ var gridSetting = require('./grid-setting/grid-setting.cjs');
23
23
  var doingNotice = require('./doing-notice/doing-notice.cjs');
24
24
  var carousel = require('./carousel/carousel.cjs');
25
25
  var coopAlert = require('./coop-alert/coop-alert.cjs');
26
+ var carouselCard = require('./carousel-card/carousel-card.cjs');
26
27
 
27
28
  "use strict";
28
29
  const IBizCommonComponents = {
@@ -59,6 +60,7 @@ const IBizCommonComponents = {
59
60
  v.component(vue3Util.IBizBadge.name, vue3Util.IBizBadge);
60
61
  v.component(carousel.IBizCarouselComponent.name, carousel.IBizCarouselComponent);
61
62
  v.component(coopAlert.IBizCoopAlert.name, coopAlert.IBizCoopAlert);
63
+ v.component(carouselCard.IBizCarouselCard.name, carouselCard.IBizCarouselCard);
62
64
  }
63
65
  };
64
66
 
@@ -193,14 +193,24 @@ const ContextMenuControl = /* @__PURE__ */ vue.defineComponent({
193
193
  return null;
194
194
  });
195
195
  };
196
- if (this.mode === "buttons") {
196
+ const renderGroup = () => {
197
197
  let _slot;
198
- return vue.createVNode("div", {
199
- "class": [this.ns.b(), this.ns.m("buttons")],
200
- "onClick": (e) => e.stopPropagation()
201
- }, [renderActions(this.expandDetails), this.groupDetails.length > 0 && [vue.createVNode(vue.resolveComponent("el-button"), {
198
+ if (this.groupDetails.length === 0) {
199
+ return null;
200
+ }
201
+ const pvisible = this.groupDetails.findIndex((item) => {
202
+ return this.c.state.buttonsState[item.id].visible === true;
203
+ }) !== -1;
204
+ if (!pvisible) {
205
+ return null;
206
+ }
207
+ const pdisabled = this.groupDetails.findIndex((item) => {
208
+ return this.c.state.buttonsState[item.id].disabled === false;
209
+ }) === -1;
210
+ return [vue.createVNode(vue.resolveComponent("el-button"), {
202
211
  "size": "small",
203
212
  "text": true,
213
+ "disabled": pdisabled,
204
214
  "ref": "groupButtonRef",
205
215
  "class": [this.ns.e("item"), this.ns.is("expand", this.popoverVisible)]
206
216
  }, {
@@ -219,7 +229,16 @@ const ContextMenuControl = /* @__PURE__ */ vue.defineComponent({
219
229
  "transition": "none"
220
230
  }, _isSlot(_slot = renderActions(this.groupDetails, false)) ? _slot : {
221
231
  default: () => [_slot]
222
- })]]);
232
+ })];
233
+ };
234
+ if (!this.c.state.buttonsState.visible) {
235
+ return;
236
+ }
237
+ if (this.mode === "buttons") {
238
+ return vue.createVNode("div", {
239
+ "class": [this.ns.b(), this.ns.m("buttons")],
240
+ "onClick": (e) => e.stopPropagation()
241
+ }, [renderActions(this.expandDetails), renderGroup()]);
223
242
  }
224
243
  return vue.createVNode(vue.resolveComponent("el-dropdown"), {
225
244
  "ref": "dropdownRef",