@ibiz-template/vue3-components 0.7.26-alpha.1 → 0.7.26-alpha.2

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 (111) hide show
  1. package/dist/{index-_h-elF6t.js → index-8tGeBxpc.js} +1 -1
  2. package/dist/{index--XeT2CTZ.js → index-CDgQJyai.js} +1 -1
  3. package/dist/index-o58Mv9D4.js +4 -0
  4. package/dist/index.min.css +1 -1
  5. package/dist/index.system.min.js +1 -1
  6. package/dist/{xlsx-util-jKx8FmtR.js → xlsx-util-Ux1_tuw5.js} +1 -1
  7. package/es/_virtual/localeData.mjs +3 -0
  8. package/es/control/calendar/calendar.css +1 -1
  9. package/es/control/calendar/calendar.d.ts +2 -3
  10. package/es/control/calendar/calendar.mjs +104 -173
  11. package/es/control/calendar/components/calendar-daily/calendar-daily.css +1 -0
  12. package/es/control/calendar/components/calendar-daily/calendar-daily.d.ts +18 -0
  13. package/es/control/calendar/components/calendar-daily/calendar-daily.mjs +175 -0
  14. package/es/control/calendar/components/calendar-daily/index.d.ts +18 -0
  15. package/es/control/calendar/components/calendar-daily/index.mjs +9 -0
  16. package/es/control/calendar/components/calendar-daily/use-calendar-daily.d.ts +154 -0
  17. package/es/control/calendar/components/calendar-daily/use-calendar-daily.mjs +196 -0
  18. package/es/control/calendar/components/calendar-month/calendar-month.css +1 -0
  19. package/es/control/calendar/components/calendar-month/calendar-month.d.ts +18 -0
  20. package/es/control/calendar/components/calendar-month/calendar-month.mjs +242 -0
  21. package/es/control/calendar/components/calendar-month/index.d.ts +18 -0
  22. package/es/control/calendar/components/calendar-month/index.mjs +9 -0
  23. package/es/control/calendar/components/calendar-month/use-calendar-month.d.ts +3 -0
  24. package/es/control/calendar/components/calendar-month/use-calendar-month.mjs +384 -0
  25. package/es/control/calendar/components/calendar-week/calendar-week.css +1 -0
  26. package/es/control/calendar/components/calendar-week/calendar-week.d.ts +18 -0
  27. package/es/control/calendar/components/calendar-week/calendar-week.mjs +241 -0
  28. package/es/control/calendar/components/calendar-week/index.d.ts +18 -0
  29. package/es/control/calendar/components/calendar-week/index.mjs +9 -0
  30. package/es/control/calendar/components/calendar-week/use-calendar-week.d.ts +159 -0
  31. package/es/control/calendar/components/calendar-week/use-calendar-week.mjs +399 -0
  32. package/es/control/calendar/components/constant/event.d.ts +5 -0
  33. package/es/control/calendar/components/constant/event.mjs +8 -0
  34. package/es/control/calendar/components/constant/index.d.ts +1 -0
  35. package/es/control/calendar/components/constant/index.mjs +3 -0
  36. package/es/control/calendar/components/custom-calendar/custom-calendar.css +1 -0
  37. package/es/control/calendar/components/custom-calendar/custom-calendar.d.ts +24 -0
  38. package/es/control/calendar/components/custom-calendar/custom-calendar.mjs +283 -0
  39. package/es/control/calendar/components/custom-calendar/index.d.ts +24 -0
  40. package/es/control/calendar/components/custom-calendar/index.mjs +12 -0
  41. package/es/control/calendar/components/custom-calendar/use-custom-calendar.d.ts +3 -0
  42. package/es/control/calendar/components/custom-calendar/use-custom-calendar.mjs +264 -0
  43. package/es/control/calendar/components/interface/calendar-daily.d.ts +12 -0
  44. package/es/control/calendar/components/interface/calendar-daily.mjs +34 -0
  45. package/es/control/calendar/components/interface/calendar-month.d.ts +20 -0
  46. package/es/control/calendar/components/interface/calendar-month.mjs +43 -0
  47. package/es/control/calendar/components/interface/calendar-week.d.ts +12 -0
  48. package/es/control/calendar/components/interface/calendar-week.mjs +34 -0
  49. package/es/control/calendar/components/interface/common.d.ts +116 -0
  50. package/es/control/calendar/components/interface/common.mjs +1 -0
  51. package/es/control/calendar/components/interface/custom-calendar.d.ts +14 -0
  52. package/es/control/calendar/components/interface/custom-calendar.mjs +67 -0
  53. package/es/control/calendar/components/interface/index.d.ts +5 -0
  54. package/es/control/calendar/components/interface/index.mjs +7 -0
  55. package/es/control/calendar/components/util/index.d.ts +1 -0
  56. package/es/control/calendar/components/util/index.mjs +4 -0
  57. package/es/control/calendar/components/util/util.d.ts +89 -0
  58. package/es/control/calendar/components/util/util.mjs +281 -0
  59. package/es/control/calendar/index.d.ts +1 -2
  60. package/es/control/calendar/index.mjs +2 -0
  61. package/es/editor/data-picker/ibiz-picker-link/ibiz-picker-link.mjs +2 -2
  62. package/es/editor/date-picker/date-picker-editor.controller.mjs +3 -0
  63. package/es/editor/date-range/date-range-editor.controller.mjs +3 -0
  64. package/es/editor/slider/ibiz-slider/ibiz-slider.css +1 -1
  65. package/es/editor/slider/ibiz-slider/ibiz-slider.d.ts +2 -0
  66. package/es/editor/slider/ibiz-slider/ibiz-slider.mjs +76 -21
  67. package/es/locale/en/index.d.ts +43 -0
  68. package/es/locale/en/index.mjs +44 -1
  69. package/es/locale/zh-CN/index.d.ts +39 -0
  70. package/es/locale/zh-CN/index.mjs +40 -1
  71. package/es/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/localeData.mjs +13 -0
  72. package/lib/_virtual/localeData.cjs +5 -0
  73. package/lib/control/calendar/calendar.cjs +104 -173
  74. package/lib/control/calendar/calendar.css +1 -1
  75. package/lib/control/calendar/components/calendar-daily/calendar-daily.cjs +177 -0
  76. package/lib/control/calendar/components/calendar-daily/calendar-daily.css +1 -0
  77. package/lib/control/calendar/components/calendar-daily/index.cjs +14 -0
  78. package/lib/control/calendar/components/calendar-daily/use-calendar-daily.cjs +198 -0
  79. package/lib/control/calendar/components/calendar-month/calendar-month.cjs +244 -0
  80. package/lib/control/calendar/components/calendar-month/calendar-month.css +1 -0
  81. package/lib/control/calendar/components/calendar-month/index.cjs +14 -0
  82. package/lib/control/calendar/components/calendar-month/use-calendar-month.cjs +386 -0
  83. package/lib/control/calendar/components/calendar-week/calendar-week.cjs +243 -0
  84. package/lib/control/calendar/components/calendar-week/calendar-week.css +1 -0
  85. package/lib/control/calendar/components/calendar-week/index.cjs +14 -0
  86. package/lib/control/calendar/components/calendar-week/use-calendar-week.cjs +401 -0
  87. package/lib/control/calendar/components/constant/event.cjs +14 -0
  88. package/lib/control/calendar/components/constant/index.cjs +11 -0
  89. package/lib/control/calendar/components/custom-calendar/custom-calendar.cjs +285 -0
  90. package/lib/control/calendar/components/custom-calendar/custom-calendar.css +1 -0
  91. package/lib/control/calendar/components/custom-calendar/index.cjs +17 -0
  92. package/lib/control/calendar/components/custom-calendar/use-custom-calendar.cjs +266 -0
  93. package/lib/control/calendar/components/interface/calendar-daily.cjs +37 -0
  94. package/lib/control/calendar/components/interface/calendar-month.cjs +46 -0
  95. package/lib/control/calendar/components/interface/calendar-week.cjs +37 -0
  96. package/lib/control/calendar/components/interface/common.cjs +3 -0
  97. package/lib/control/calendar/components/interface/custom-calendar.cjs +70 -0
  98. package/lib/control/calendar/components/interface/index.cjs +18 -0
  99. package/lib/control/calendar/components/util/index.cjs +42 -0
  100. package/lib/control/calendar/components/util/util.cjs +316 -0
  101. package/lib/control/calendar/index.cjs +2 -0
  102. package/lib/editor/data-picker/ibiz-picker-link/ibiz-picker-link.cjs +2 -2
  103. package/lib/editor/date-picker/date-picker-editor.controller.cjs +3 -0
  104. package/lib/editor/date-range/date-range-editor.controller.cjs +3 -0
  105. package/lib/editor/slider/ibiz-slider/ibiz-slider.cjs +76 -21
  106. package/lib/editor/slider/ibiz-slider/ibiz-slider.css +1 -1
  107. package/lib/locale/en/index.cjs +44 -1
  108. package/lib/locale/zh-CN/index.cjs +40 -1
  109. package/lib/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/localeData.cjs +17 -0
  110. package/package.json +5 -5
  111. package/dist/index-yupCl1Un.js +0 -4
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ require('../util/index.cjs');
4
+ var util = require('../util/util.cjs');
5
+ var lodashEs = require('lodash-es');
6
+
7
+ "use strict";
8
+ const calendarWeekProps = util.handleProps({
9
+ controller: {
10
+ type: Object
11
+ },
12
+ selectedDay: {
13
+ type: util.definePropType(Object)
14
+ },
15
+ events: {
16
+ type: Array,
17
+ default: []
18
+ },
19
+ legends: {
20
+ type: Array,
21
+ default: []
22
+ },
23
+ multiple: {
24
+ type: Boolean
25
+ },
26
+ selectedData: {
27
+ type: Object
28
+ }
29
+ });
30
+ const calendarWeekEmits = {
31
+ pick: (value) => lodashEs.isObject(value),
32
+ eventClick: (value) => value,
33
+ eventDblClick: (value) => value
34
+ };
35
+
36
+ exports.calendarWeekEmits = calendarWeekEmits;
37
+ exports.calendarWeekProps = calendarWeekProps;
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ "use strict";
@@ -0,0 +1,70 @@
1
+ 'use strict';
2
+
3
+ require('../util/index.cjs');
4
+ require('../constant/index.cjs');
5
+ var lodashEs = require('lodash-es');
6
+ var util = require('../util/util.cjs');
7
+ var event = require('../constant/event.cjs');
8
+
9
+ "use strict";
10
+ const isValidRange = (range) => lodashEs.isArray(range) && range.length === 2 && range.every((item) => lodashEs.isDate(item));
11
+ const customCalendarProps = util.handleProps({
12
+ controller: {
13
+ type: Object,
14
+ required: true
15
+ },
16
+ /**
17
+ * @description 绑定值
18
+ */
19
+ modelValue: {
20
+ type: Date
21
+ },
22
+ /**
23
+ * @description 时间范围,包括开始时间和结束时间。
24
+ * 开始时间必须是星期的开始日,结束时间必须是一周的结束日,时间跨度不能超过两个月。
25
+ */
26
+ range: {
27
+ type: util.definePropType(Array),
28
+ validator: isValidRange
29
+ },
30
+ /**
31
+ * @description 视图类型
32
+ */
33
+ viewType: {
34
+ type: String,
35
+ default: "DAY"
36
+ },
37
+ /**
38
+ * @description 事件集合
39
+ */
40
+ events: {
41
+ type: Array,
42
+ default: []
43
+ },
44
+ legends: {
45
+ type: Array,
46
+ default: []
47
+ },
48
+ /**
49
+ * @description 是否多选
50
+ */
51
+ multiple: {
52
+ type: Boolean
53
+ },
54
+ /**
55
+ * @description 选中事件数据集合
56
+ */
57
+ selectedData: {
58
+ type: Object
59
+ }
60
+ });
61
+ const customCalendarEmits = {
62
+ [event.UPDATE_MODEL_EVENT]: (value) => lodashEs.isDate(value),
63
+ [event.INPUT_EVENT]: (value) => lodashEs.isDate(value),
64
+ [event.CHANGE_EVENT]: (value) => lodashEs.isDate(value),
65
+ [event.EVENT_CLICK_EVENT]: (value) => value,
66
+ [event.EVENT_DBL_CLICK_EVENT]: (value) => value
67
+ };
68
+
69
+ exports.customCalendarEmits = customCalendarEmits;
70
+ exports.customCalendarProps = customCalendarProps;
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ require('./common.cjs');
4
+ var customCalendar = require('./custom-calendar.cjs');
5
+ var calendarDaily = require('./calendar-daily.cjs');
6
+ var calendarMonth = require('./calendar-month.cjs');
7
+ var calendarWeek = require('./calendar-week.cjs');
8
+
9
+ "use strict";
10
+
11
+ exports.customCalendarEmits = customCalendar.customCalendarEmits;
12
+ exports.customCalendarProps = customCalendar.customCalendarProps;
13
+ exports.calendarDailyEmits = calendarDaily.calendarDailyEmits;
14
+ exports.calendarDailyProps = calendarDaily.calendarDailyProps;
15
+ exports.calendarMonthEmits = calendarMonth.calendarMonthEmits;
16
+ exports.calendarMonthProps = calendarMonth.calendarMonthProps;
17
+ exports.calendarWeekEmits = calendarWeek.calendarWeekEmits;
18
+ exports.calendarWeekProps = calendarWeek.calendarWeekProps;
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ var util = require('./util.cjs');
4
+ var lodashEs = require('lodash-es');
5
+
6
+ "use strict";
7
+
8
+ exports.closeIcon = util.closeIcon;
9
+ exports.definePropType = util.definePropType;
10
+ exports.epPropKey = util.epPropKey;
11
+ exports.fade = util.fade;
12
+ exports.getCurWeekDates = util.getCurWeekDates;
13
+ exports.handleBkColor = util.handleBkColor;
14
+ exports.handleEVentClick = util.handleEVentClick;
15
+ exports.handlePopClose = util.handlePopClose;
16
+ exports.handleProps = util.handleProps;
17
+ exports.handleTimeRange = util.handleTimeRange;
18
+ exports.isDateInCurWeek = util.isDateInCurWeek;
19
+ exports.isTimeGreaterThan = util.isTimeGreaterThan;
20
+ exports.isToday = util.isToday;
21
+ exports.isValidRange = util.isValidRange;
22
+ exports.rangeArr = util.rangeArr;
23
+ Object.defineProperty(exports, "get", {
24
+ enumerable: true,
25
+ get: function () { return lodashEs.get; }
26
+ });
27
+ Object.defineProperty(exports, "isArray", {
28
+ enumerable: true,
29
+ get: function () { return lodashEs.isArray; }
30
+ });
31
+ Object.defineProperty(exports, "isDate", {
32
+ enumerable: true,
33
+ get: function () { return lodashEs.isDate; }
34
+ });
35
+ Object.defineProperty(exports, "isObject", {
36
+ enumerable: true,
37
+ get: function () { return lodashEs.isObject; }
38
+ });
39
+ Object.defineProperty(exports, "set", {
40
+ enumerable: true,
41
+ get: function () { return lodashEs.set; }
42
+ });
@@ -0,0 +1,316 @@
1
+ 'use strict';
2
+
3
+ var vue = require('vue');
4
+ var dayjs = require('dayjs');
5
+ var ramda = require('ramda');
6
+ var lodashEs = require('lodash-es');
7
+
8
+ "use strict";
9
+ let clickCount = 0;
10
+ let timer;
11
+ const epPropKey = "__epPropKey";
12
+ const colors = [
13
+ "#2196F3",
14
+ "#4CAF50",
15
+ "#3F51B5",
16
+ "#FF9800",
17
+ "#673AB7",
18
+ "#757575"
19
+ ];
20
+ const closeIcon = "<i class='el-icon' data-v-ea893728=''> <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' data-v-ea893728='' > <path d='M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z'></path> </svg></i>";
21
+ const hexReg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
22
+ const rgbReg = /^(rgb|rgba|RGB|RGBA)/;
23
+ function findLastParent(element) {
24
+ var _a;
25
+ if (!element) {
26
+ return null;
27
+ }
28
+ if (!(element == null ? void 0 : element.parentNode) || ((_a = element == null ? void 0 : element.classList) == null ? void 0 : _a.contains("el-popover"))) {
29
+ return element;
30
+ }
31
+ return findLastParent(element.parentNode);
32
+ }
33
+ const handlePopClose = (el) => {
34
+ const node = findLastParent(el.target);
35
+ if (node) {
36
+ node.style.display = "none";
37
+ }
38
+ };
39
+ const handleTimeRange = (startTime, endTime, format, partition = "-") => {
40
+ var _a, _b;
41
+ let timeRange = "";
42
+ if (startTime && ((_a = dayjs(startTime)) == null ? void 0 : _a.isValid())) {
43
+ timeRange = dayjs(startTime).format(format);
44
+ }
45
+ if (endTime && ((_b = dayjs(endTime)) == null ? void 0 : _b.isValid())) {
46
+ timeRange = "".concat(timeRange, " ").concat(partition, " ").concat(dayjs(endTime).format(format));
47
+ }
48
+ return timeRange;
49
+ };
50
+ const handleBkColor = (tempColors, type) => {
51
+ let tempColor = tempColors.get(type);
52
+ const length = tempColors.size;
53
+ if (type && !tempColor && length < colors.length) {
54
+ tempColor = colors[length];
55
+ tempColors.set(type, tempColor);
56
+ }
57
+ return tempColor || colors[0];
58
+ };
59
+ const validatorF = (color) => {
60
+ const isHex = hexReg.test(color);
61
+ const isRgb = rgbReg.test(color);
62
+ const tempColor = color;
63
+ if (isHex || isRgb)
64
+ return tempColor;
65
+ if (!color) {
66
+ console.error("Color: Invalid color!");
67
+ return "";
68
+ }
69
+ return tempColor;
70
+ };
71
+ const getRgbValueFromHex = (color) => {
72
+ const tempColor = color.replace("#", "");
73
+ const red = parseInt(tempColor.substring(0, 2), 16);
74
+ const green = parseInt(tempColor.substring(2, 4), 16);
75
+ const blue = parseInt(tempColor.substring(4, 6), 16);
76
+ return [red, green, blue];
77
+ };
78
+ const getRgbValueFromRgb = (color) => {
79
+ return color.replace(/rgb\(|rgba\(|\)/g, "").split(",").slice(0, 3).map(function(n) {
80
+ return parseInt(n, 10);
81
+ });
82
+ };
83
+ const getRgbValue = (color) => {
84
+ if (!color) {
85
+ console.error("getRgbValue: Missing parameters!");
86
+ return false;
87
+ }
88
+ const tempColor = validatorF(color);
89
+ if (!tempColor)
90
+ return false;
91
+ const isHex = hexReg.test(tempColor);
92
+ const isRgb = rgbReg.test(tempColor);
93
+ const lowerColor = tempColor.toLowerCase();
94
+ if (isHex)
95
+ return getRgbValueFromHex(lowerColor);
96
+ if (isRgb)
97
+ return getRgbValueFromRgb(lowerColor);
98
+ };
99
+ const getColorFromRgbValue = (value) => {
100
+ if (!value) {
101
+ console.error("getColorFromRgbValue: Missing parameters!");
102
+ return false;
103
+ }
104
+ const valueLength = value.length;
105
+ if (valueLength !== 3 && valueLength !== 4) {
106
+ console.error("getColorFromRgbValue: Value is illegal!");
107
+ return false;
108
+ }
109
+ let color = valueLength === 3 ? "rgb(" : "rgba(";
110
+ color += "".concat(value.join(","), ")");
111
+ return color;
112
+ };
113
+ const fade = (color, Percent) => {
114
+ const percent = Percent || 100;
115
+ if (!color) {
116
+ console.error("fade: Missing parameters!");
117
+ return false;
118
+ }
119
+ const rgbValue = getRgbValue(color);
120
+ if (!rgbValue)
121
+ return false;
122
+ const rgbaValue = [...rgbValue, percent / 100];
123
+ return getColorFromRgbValue(rgbaValue);
124
+ };
125
+ const isToday = (date, curDate) => {
126
+ const dateToCheck = new Date(date);
127
+ const currentDate = curDate ? new Date(curDate) : /* @__PURE__ */ new Date();
128
+ const state = dateToCheck.getDate() === currentDate.getDate() && dateToCheck.getMonth() === currentDate.getMonth() && dateToCheck.getFullYear() === currentDate.getFullYear();
129
+ return state;
130
+ };
131
+ function hasOwn(obj, key) {
132
+ return Object.prototype.hasOwnProperty.call(obj, key);
133
+ }
134
+ const definePropType = (val) => val;
135
+ const isEpProp = (val) => lodashEs.isObject(val) && !!val[epPropKey];
136
+ const isValidRange = (range) => lodashEs.isArray(range) && range.length === 2 && range.every((item) => lodashEs.isDate(item));
137
+ const isDateInCurWeek = (dateToCheck, firstDayOfWeek, lastDayOfWeek) => {
138
+ const tempDate = new Date(dateToCheck);
139
+ const tempFirstDay = new Date(firstDayOfWeek);
140
+ const tempLastDay = new Date(lastDayOfWeek);
141
+ tempDate.setHours(0, 0, 0, 0);
142
+ tempFirstDay.setHours(0, 0, 0, 0);
143
+ tempLastDay.setHours(0, 0, 0, 0);
144
+ return tempDate >= tempFirstDay && tempDate <= tempLastDay;
145
+ };
146
+ const isTimeGreaterThan = (timeA, timeB) => {
147
+ const date1 = new Date(timeA);
148
+ const date2 = new Date(timeB);
149
+ return date1.getTime() > date2.getTime();
150
+ };
151
+ const getCurWeekDates = (curDate) => {
152
+ const currentDate = new Date(curDate);
153
+ const currentDay = currentDate.getDay();
154
+ const firstDayOfWeek = new Date(currentDate);
155
+ firstDayOfWeek.setDate(currentDate.getDate() - currentDay);
156
+ const lastDayOfWeek = new Date(firstDayOfWeek);
157
+ lastDayOfWeek.setDate(firstDayOfWeek.getDate() + 6);
158
+ firstDayOfWeek.setHours(0, 0, 0, 0);
159
+ lastDayOfWeek.setHours(23, 59, 59, 0);
160
+ return {
161
+ firstDay: firstDayOfWeek,
162
+ lastDay: lastDayOfWeek
163
+ };
164
+ };
165
+ const handleEmit = (eventName, item, location, events, multiple, selectedData, emit) => {
166
+ let tempSelectedData = ramda.clone(selectedData);
167
+ let isSelectedEvent = true;
168
+ const targetEvent = events.find((event) => {
169
+ return item.id === event.id;
170
+ });
171
+ const index = tempSelectedData.findIndex(
172
+ (event) => item.id === event.id
173
+ );
174
+ if (multiple) {
175
+ if (index === -1) {
176
+ tempSelectedData.push(targetEvent);
177
+ } else {
178
+ Object.assign(item, { isSelectedEvent: false });
179
+ isSelectedEvent = false;
180
+ tempSelectedData.splice(index, 1);
181
+ }
182
+ } else if (index === -1) {
183
+ tempSelectedData = [targetEvent];
184
+ } else {
185
+ Object.assign(item, { isSelectedEvent: false });
186
+ isSelectedEvent = false;
187
+ tempSelectedData = [];
188
+ }
189
+ switch (eventName) {
190
+ case "eventClick":
191
+ emit("eventClick", { location, data: tempSelectedData });
192
+ break;
193
+ case "eventDblClick":
194
+ emit("eventDblClick", { location, data: tempSelectedData });
195
+ break;
196
+ default:
197
+ break;
198
+ }
199
+ return { eventName, tempSelectedData, isSelectedEvent };
200
+ };
201
+ const handleEVentClick = (item, location, events, multiple, selectedData, emit) => {
202
+ return new Promise((resolve) => {
203
+ clickCount += 1;
204
+ if (clickCount === 1) {
205
+ timer = setTimeout(() => {
206
+ if (clickCount === 1) {
207
+ resolve(
208
+ handleEmit(
209
+ "eventClick",
210
+ item,
211
+ location,
212
+ events,
213
+ multiple,
214
+ selectedData,
215
+ emit
216
+ )
217
+ );
218
+ }
219
+ clickCount = 0;
220
+ }, 300);
221
+ } else if (clickCount === 2) {
222
+ clearTimeout(timer);
223
+ resolve(
224
+ handleEmit(
225
+ "eventDblClick",
226
+ item,
227
+ location,
228
+ events,
229
+ multiple,
230
+ selectedData,
231
+ emit
232
+ )
233
+ );
234
+ clickCount = 0;
235
+ }
236
+ });
237
+ };
238
+ const handleProp = (prop, key) => {
239
+ if (!lodashEs.isObject(prop) || isEpProp(prop))
240
+ return prop;
241
+ const { values, required, default: defaultValue, type, validator } = prop;
242
+ const _validator = values || validator ? (val) => {
243
+ let valid = false;
244
+ let allowedValues = [];
245
+ if (values) {
246
+ allowedValues = Array.from(values);
247
+ if (hasOwn(prop, "default")) {
248
+ allowedValues.push(defaultValue);
249
+ }
250
+ valid || (valid = allowedValues.includes(val));
251
+ }
252
+ if (validator)
253
+ valid || (valid = validator(val));
254
+ if (!valid && allowedValues.length > 0) {
255
+ const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
256
+ vue.warn(
257
+ "Invalid prop: validation failed".concat(key ? ' for prop "'.concat(key, '"') : "", ". Expected one of [").concat(allowValuesText, "], got value ").concat(JSON.stringify(
258
+ val
259
+ ), ".")
260
+ );
261
+ }
262
+ return valid;
263
+ } : void 0;
264
+ const epProp = {
265
+ type,
266
+ required: !!required,
267
+ validator: _validator,
268
+ [epPropKey]: true
269
+ };
270
+ if (hasOwn(prop, "default"))
271
+ epProp.default = defaultValue;
272
+ return epProp;
273
+ };
274
+ const rangeArr = (n) => Array.from(Array.from({ length: n }).keys());
275
+ const handleProps = (props) => lodashEs.fromPairs(
276
+ Object.entries(props).map(([key, option]) => [
277
+ key,
278
+ handleProp(option, key)
279
+ ])
280
+ );
281
+
282
+ Object.defineProperty(exports, "get", {
283
+ enumerable: true,
284
+ get: function () { return lodashEs.get; }
285
+ });
286
+ Object.defineProperty(exports, "isArray", {
287
+ enumerable: true,
288
+ get: function () { return lodashEs.isArray; }
289
+ });
290
+ Object.defineProperty(exports, "isDate", {
291
+ enumerable: true,
292
+ get: function () { return lodashEs.isDate; }
293
+ });
294
+ Object.defineProperty(exports, "isObject", {
295
+ enumerable: true,
296
+ get: function () { return lodashEs.isObject; }
297
+ });
298
+ Object.defineProperty(exports, "set", {
299
+ enumerable: true,
300
+ get: function () { return lodashEs.set; }
301
+ });
302
+ exports.closeIcon = closeIcon;
303
+ exports.definePropType = definePropType;
304
+ exports.epPropKey = epPropKey;
305
+ exports.fade = fade;
306
+ exports.getCurWeekDates = getCurWeekDates;
307
+ exports.handleBkColor = handleBkColor;
308
+ exports.handleEVentClick = handleEVentClick;
309
+ exports.handlePopClose = handlePopClose;
310
+ exports.handleProps = handleProps;
311
+ exports.handleTimeRange = handleTimeRange;
312
+ exports.isDateInCurWeek = isDateInCurWeek;
313
+ exports.isTimeGreaterThan = isTimeGreaterThan;
314
+ exports.isToday = isToday;
315
+ exports.isValidRange = isValidRange;
316
+ exports.rangeArr = rangeArr;
@@ -6,11 +6,13 @@ var runtime = require('@ibiz-template/runtime');
6
6
  var vue3Util = require('@ibiz-template/vue3-util');
7
7
  var calendar = require('./calendar.cjs');
8
8
  var calendar_provider = require('./calendar.provider.cjs');
9
+ var index = require('./components/custom-calendar/index.cjs');
9
10
 
10
11
  "use strict";
11
12
  const IBizCalendarControl = vue3Util.withInstall(
12
13
  calendar.CalendarControl,
13
14
  function(v) {
15
+ v.use(index.IBizCustomCalendar);
14
16
  v.component(calendar.CalendarControl.name, calendar.CalendarControl);
15
17
  runtime.registerControlProvider(runtime.ControlType.CALENDAR, () => new calendar_provider.CalendarProvider());
16
18
  }
@@ -87,8 +87,8 @@ const IBizPickerLink = /* @__PURE__ */ vue.defineComponent({
87
87
  };
88
88
  const openLinkView = async () => {
89
89
  const res = await c.openLinkView(props.data);
90
- if (res) {
91
- handleOpenViewClose(res[0]);
90
+ if (res && res.ok && res.data && res.data.length) {
91
+ handleOpenViewClose(res.data[0]);
92
92
  }
93
93
  };
94
94
  const {
@@ -43,6 +43,9 @@ class DatePickerEditorController extends runtime.EditorController {
43
43
  * @Date: 2022-08-25 14:33:14
44
44
  */
45
45
  get valueFormat() {
46
+ if (this.model.dateTimeFormat) {
47
+ return this.model.dateTimeFormat;
48
+ }
46
49
  if (super.valueFormat) {
47
50
  return super.valueFormat;
48
51
  }
@@ -47,6 +47,9 @@ class DateRangeEditorController extends runtime.EditorController {
47
47
  * @Date: 2022-08-25 14:33:14
48
48
  */
49
49
  get valueFormat() {
50
+ if (this.model.dateTimeFormat) {
51
+ return this.model.dateTimeFormat;
52
+ }
50
53
  if (super.valueFormat) {
51
54
  return super.valueFormat;
52
55
  }
@@ -16,6 +16,9 @@ const IBizSlider = /* @__PURE__ */ vue.defineComponent({
16
16
  const ns = vue3Util.useNamespace("slider");
17
17
  const c = props.controller;
18
18
  const editorModel = c.model;
19
+ const {
20
+ valueFormat
21
+ } = c.parent;
19
22
  const {
20
23
  useInFocusAndBlur,
21
24
  useInValueChange
@@ -27,7 +30,9 @@ const IBizSlider = /* @__PURE__ */ vue.defineComponent({
27
30
  let range = false;
28
31
  let showInput = false;
29
32
  let showText = false;
30
- let format = "0%";
33
+ let format = valueFormat || "0%";
34
+ let type = "line";
35
+ let textItem = "";
31
36
  if (editorModel.editorParams) {
32
37
  if (editorModel.editorParams.stepvalue) {
33
38
  step = lodashEs.toNumber(editorModel.editorParams.stepvalue);
@@ -53,6 +58,12 @@ const IBizSlider = /* @__PURE__ */ vue.defineComponent({
53
58
  if (editorModel.editorParams.format) {
54
59
  format = editorModel.editorParams.format;
55
60
  }
61
+ if (editorModel.editorParams.type) {
62
+ type = editorModel.editorParams.type;
63
+ }
64
+ if (editorModel.editorParams.textItem) {
65
+ textItem = editorModel.editorParams.textItem;
66
+ }
56
67
  }
57
68
  const showFormDefaultContent = vue.computed(() => {
58
69
  if (props.controlParams && props.controlParams.editmode === "hover" && !props.readonly) {
@@ -60,6 +71,25 @@ const IBizSlider = /* @__PURE__ */ vue.defineComponent({
60
71
  }
61
72
  return false;
62
73
  });
74
+ const handleLineVal = (val) => {
75
+ if (range) {
76
+ return JSON.parse(val);
77
+ }
78
+ return Number(val);
79
+ };
80
+ const handleCircleVal = (val) => {
81
+ return Number(val) * 100;
82
+ };
83
+ const handleCurVal = (val) => {
84
+ switch (type) {
85
+ case "line":
86
+ return handleLineVal(val);
87
+ case "circle":
88
+ return handleCircleVal(val);
89
+ default:
90
+ return val;
91
+ }
92
+ };
63
93
  const currentVal = vue.ref();
64
94
  vue.watch(() => props.value, (newVal, oldVal) => {
65
95
  if (newVal !== oldVal) {
@@ -70,17 +100,17 @@ const IBizSlider = /* @__PURE__ */ vue.defineComponent({
70
100
  currentVal.value = 0;
71
101
  }
72
102
  } else {
73
- if (range) {
74
- currentVal.value = JSON.parse(newVal);
75
- } else {
76
- currentVal.value = Number(newVal);
77
- }
103
+ currentVal.value = handleCurVal(newVal);
78
104
  }
79
105
  }
80
106
  }, {
81
107
  immediate: true
82
108
  });
83
109
  const textVal = vue.computed(() => {
110
+ if (textItem) {
111
+ const data = props.data || {};
112
+ return ibiz.util.text.format("".concat(data[textItem]), format);
113
+ }
84
114
  const tempCurVal = Number(currentVal.value);
85
115
  const value = Number(tempCurVal / max);
86
116
  const formatValue = ibiz.util.text.format("".concat(value), format);
@@ -104,6 +134,8 @@ const IBizSlider = /* @__PURE__ */ vue.defineComponent({
104
134
  step,
105
135
  max,
106
136
  min,
137
+ type,
138
+ textItem,
107
139
  showStops,
108
140
  range,
109
141
  showInput,
@@ -114,23 +146,46 @@ const IBizSlider = /* @__PURE__ */ vue.defineComponent({
114
146
  };
115
147
  },
116
148
  render() {
149
+ let content;
150
+ if (this.type === "line") {
151
+ content = [vue.createVNode(vue.resolveComponent("el-slider"), vue.mergeProps({
152
+ "modelValue": this.currentVal,
153
+ "onUpdate:modelValue": ($event) => this.currentVal = $event,
154
+ "disabled": this.disabled || this.readonly,
155
+ "step": this.step,
156
+ "max": this.max,
157
+ "min": this.min,
158
+ "showStops": this.showStops,
159
+ "range": this.range,
160
+ "showInput": this.showInput,
161
+ "onChange": this.handleChange
162
+ }, this.$attrs), null), this.showText ? vue.createVNode("span", {
163
+ "class": [this.ns.em("text", "val")]
164
+ }, [this.textVal]) : null];
165
+ }
166
+ if (this.type === "circle") {
167
+ content = vue.createVNode(vue.resolveComponent("el-progress"), vue.mergeProps({
168
+ "type": this.type,
169
+ "percentage": this.currentVal
170
+ }, this.$attrs), {
171
+ default: (item) => {
172
+ if (!this.showText) {
173
+ return "";
174
+ }
175
+ let text = item.percentage;
176
+ if (this.textItem) {
177
+ text = this.textVal;
178
+ }
179
+ return vue.createVNode("span", {
180
+ "class": this.ns.em("circle", "text")
181
+ }, [text]);
182
+ }
183
+ });
184
+ }
117
185
  return vue.createVNode("div", {
118
- "class": [this.ns.b(), this.readonly ? this.ns.m("readonly") : "", this.showText ? this.ns.e("text") : "", this.ns.is("show-default", this.showFormDefaultContent)],
186
+ "class": [this.ns.b(), this.readonly ? this.ns.m("readonly") : "", this.showText ? this.ns.e("text") : "", this.ns.is("show-default", this.showFormDefaultContent), this.ns.e(this.type)],
119
187
  "ref": "editorRef"
120
- }, [vue.createVNode(vue.resolveComponent("el-slider"), vue.mergeProps({
121
- "modelValue": this.currentVal,
122
- "onUpdate:modelValue": ($event) => this.currentVal = $event,
123
- "disabled": this.disabled || this.readonly,
124
- "step": this.step,
125
- "max": this.max,
126
- "min": this.min,
127
- "showStops": this.showStops,
128
- "range": this.range,
129
- "showInput": this.showInput,
130
- "onChange": this.handleChange
131
- }, this.$attrs), null), this.showText ? vue.createVNode("span", {
132
- "class": [this.ns.em("text", "val")]
133
- }, [this.textVal]) : null]);
188
+ }, [content]);
134
189
  }
135
190
  });
136
191
 
@@ -1 +1 @@
1
- .ibiz-slider{display:flex;align-items:center;width:100%}.ibiz-slider__text .el-slider__button,.ibiz-slider__text .el-slider__button-wrapper{width:1px;height:var(--ibiz-height-control-default);border:none}.ibiz-slider__text .el-slider__bar{border-radius:var(--ibiz-border-radius-small)}.ibiz-slider__text .el-slider__runway.is-disabled .el-slider__bar{background-color:var(--ibiz-color-primary)}.ibiz-slider__text--val{margin-left:var(--ibiz-spacing-tight)}.ibiz-form-item .ibiz-slider.is-show-default{padding:var(--ibiz-form-item-hover-edit-padding)}
1
+ .ibiz-slider{--ibiz-editor-slider-trigger-width:0.375rem;--ibiz-editor-slider-text-width:2.375rem;display:flex;align-items:center;width:100%}.ibiz-slider__text .el-slider__button,.ibiz-slider__text .el-slider__button-wrapper{width:var(--ibiz-editor-slider-trigger-width);height:var(--ibiz-height-control-default);border:none;opacity:0}.ibiz-slider__text .el-slider__bar{border-radius:var(--ibiz-border-radius-small)}.ibiz-slider__text .el-slider__runway.is-disabled .el-slider__bar{background-color:var(--ibiz-color-primary)}.ibiz-slider__text--val{min-width:var(--ibiz-editor-slider-text-width);margin-left:var(--ibiz-spacing-tight)}.ibiz-slider__circle--text{font-size:var(--ibiz-font-size-regular)}.ibiz-slider__circle .el-progress{--el-fill-color-light:var(--ibiz-color-fill-0);width:100%}.ibiz-slider__circle .el-progress .el-progress-circle svg>path:nth-child(2){stroke:var(--ibiz-color-primary)}.ibiz-form-item .ibiz-slider.is-show-default{padding:var(--ibiz-form-item-hover-edit-padding)}