evui 3.3.6 → 3.3.9

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 (32) hide show
  1. package/dist/evui.common.js +1676 -1041
  2. package/dist/evui.common.js.map +1 -1
  3. package/dist/evui.umd.js +1676 -1041
  4. package/dist/evui.umd.js.map +1 -1
  5. package/dist/evui.umd.min.js +1 -1
  6. package/dist/evui.umd.min.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/chart/Chart.vue +5 -2
  9. package/src/components/chart/chart.core.js +14 -5
  10. package/src/components/chart/element/element.bar.js +3 -3
  11. package/src/components/chart/element/element.pie.js +136 -39
  12. package/src/components/chart/helpers/helpers.constant.js +7 -0
  13. package/src/components/chart/helpers/helpers.util.js +8 -0
  14. package/src/components/chart/model/model.store.js +66 -50
  15. package/src/components/chart/plugins/plugins.interaction.js +19 -4
  16. package/src/components/chart/plugins/plugins.pie.js +73 -64
  17. package/src/components/chart/plugins/plugins.tooltip.js +23 -9
  18. package/src/components/chart/uses.js +9 -0
  19. package/src/components/datePicker/DatePicker.vue +108 -97
  20. package/src/components/datePicker/uses.js +3 -1
  21. package/src/components/grid/Grid.vue +20 -16
  22. package/src/components/grid/uses.js +13 -1
  23. package/src/components/inputNumber/InputNumber.vue +27 -22
  24. package/src/components/pagination/Pagination.vue +268 -0
  25. package/src/components/pagination/index.js +7 -0
  26. package/src/components/pagination/pageButton.vue +31 -0
  27. package/src/components/select/Select.vue +89 -86
  28. package/src/components/select/uses.js +4 -2
  29. package/src/components/treeGrid/TreeGrid.vue +33 -25
  30. package/src/components/treeGrid/TreeGridNode.vue +1 -0
  31. package/src/components/treeGrid/uses.js +60 -51
  32. package/src/main.js +3 -0
@@ -3,13 +3,17 @@ const modules = {
3
3
  /**
4
4
  * Draw series data
5
5
  *
6
+ * @params hitInfo
7
+ *
6
8
  * @returns {undefined}
7
9
  */
8
- drawPie() {
10
+ drawPie(hitInfo) {
9
11
  const ctx = this.bufferCtx;
10
12
  const chartRect = this.chartRect;
11
13
  const pieDataSet = this.pieDataSet;
12
14
  const pieOption = this.options;
15
+ const padding = this.options.padding;
16
+ const isDoughnut = !!pieOption.doughnutHoleSize;
13
17
 
14
18
  let slice;
15
19
  let value;
@@ -21,8 +25,10 @@ const modules = {
21
25
  const centerX = chartRect.width / 2;
22
26
  const centerY = chartRect.height / 2;
23
27
 
24
- const innerRadius = Math.min(centerX, centerY) * pieOption.doughnutHoleSize;
25
- const outerRadius = Math.min(centerX, centerY);
28
+ const chartWidth = centerX - (padding.left + padding.right);
29
+ const chartHeight = centerY - (padding.bottom + padding.top);
30
+ const innerRadius = Math.min(chartWidth, chartHeight) * pieOption.doughnutHoleSize;
31
+ const outerRadius = Math.min(chartWidth, chartHeight);
26
32
 
27
33
  for (let ix = 0; ix < pieDataSet.length; ix++) {
28
34
  const pie = pieDataSet[ix];
@@ -54,54 +60,59 @@ const modules = {
54
60
  series = this.seriesList[slice.id];
55
61
 
56
62
  if (value) {
57
- series.draw({
58
- ctx,
59
- centerX,
60
- centerY,
61
- radius,
62
- startAngle,
63
- endAngle,
64
- });
63
+ const strokeOptions = { ...pieOption.pieStroke };
64
+ if (pie.data.length === 1 && pieOption.pieStroke.use) {
65
+ strokeOptions.use = false;
66
+
67
+ ctx.lineWidth = pieOption.pieStroke.lineWidth;
68
+ ctx.strokeStyle = pieOption.pieStroke.color;
69
+ ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI);
70
+ ctx.stroke();
71
+ }
72
+
73
+ series.isSelect = hitInfo?.sId === slice.id;
74
+ series.type = isDoughnut ? 'doughnut' : 'pie';
75
+ series.centerX = centerX;
76
+ series.centerY = centerY;
77
+ series.radius = radius;
78
+ series.doughnutHoleSize = radius * (pieOption.doughnutHoleSize ?? 0);
79
+ series.startAngle = startAngle;
80
+ series.endAngle = endAngle;
81
+ series.data = { o: value };
82
+
83
+ series.draw(ctx, strokeOptions);
65
84
  startAngle += sliceAngle;
66
85
  }
67
86
  }
68
87
  }
69
-
70
- ctx.beginPath();
71
- if (pieOption?.pieStroke?.use) {
72
- ctx.lineWidth = pieOption.pieStroke.lineWidth;
73
- ctx.strokeStyle = pieOption.pieStroke.color;
74
- ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI);
75
- ctx.stroke();
76
- } else {
77
- ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI);
78
- }
79
-
80
- ctx.closePath();
81
88
  }
82
89
  },
83
90
 
84
91
  /**
85
92
  * Draw series data
86
93
  *
94
+ * @params hitInfo
95
+ *
87
96
  * @returns {undefined}
88
97
  */
89
- drawSunburst() {
98
+ drawSunburst(hitInfo) {
90
99
  const ctx = this.bufferCtx;
91
- const chartRect = this.chartRect;
100
+ const { width, height } = this.chartRect;
92
101
  const pieDataSet = this.pieDataSet;
93
102
  const pieOption = this.options;
103
+ const padding = this.options.padding;
94
104
 
95
105
  this.calculateAngle();
96
106
 
97
107
  let slice;
98
108
  let series;
99
109
 
100
- const centerX = chartRect.width / 2;
101
- const centerY = chartRect.height / 2;
102
-
103
- const innerRadius = Math.min(centerX, centerY) * pieOption.doughnutHoleSize;
104
- const outerRadius = Math.min(centerX, centerY);
110
+ const centerX = width / 2;
111
+ const centerY = height / 2;
112
+ const chartWidth = centerX - (padding.left + padding.right);
113
+ const chartHeight = centerY - (padding.bottom + padding.top);
114
+ const innerRadius = Math.min(chartWidth, chartHeight) * pieOption.doughnutHoleSize;
115
+ const outerRadius = Math.min(chartWidth, chartHeight);
105
116
 
106
117
  for (let ix = 0; ix < pieDataSet.length; ix++) {
107
118
  const pie = pieDataSet[ix];
@@ -141,46 +152,48 @@ const modules = {
141
152
  series = this.seriesList[slice.id];
142
153
 
143
154
  if (slice.value) {
144
- series.draw({
145
- ctx,
146
- centerX,
147
- centerY,
148
- radius,
149
- startAngle: slice.sa,
150
- endAngle: slice.ea,
151
- });
155
+ const strokeOptions = { ...pieOption.pieStroke };
156
+ if (pie.data.length === 1 && pieOption.pieStroke.use) {
157
+ strokeOptions.use = false;
158
+
159
+ ctx.lineWidth = pieOption.pieStroke.lineWidth;
160
+ ctx.strokeStyle = pieOption.pieStroke.color;
161
+ ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI);
162
+ ctx.stroke();
163
+ }
164
+
165
+ series.isSelect = hitInfo?.sId === slice.id;
166
+ series.type = 'sunburst';
167
+ series.centerX = centerX;
168
+ series.centerY = centerY;
169
+ series.radius = radius;
170
+ series.doughnutHoleSize = radius * (pieOption.doughnutHoleSize ?? 0);
171
+ series.startAngle = slice.sa;
172
+ series.endAngle = slice.ea;
173
+ series.data = { o: slice.value };
174
+
175
+ series.draw(ctx, strokeOptions);
152
176
  }
153
177
  }
154
178
  }
155
-
156
- ctx.beginPath();
157
-
158
- if (pieOption?.pieStroke?.use) {
159
- ctx.lineWidth = pieOption.pieStroke.lineWidth;
160
- ctx.strokeStyle = pieOption.pieStroke.color;
161
- ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI);
162
- ctx.stroke();
163
- } else {
164
- ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI);
165
- }
166
-
167
- ctx.closePath();
168
179
  }
169
180
  },
170
181
 
171
182
  /**
172
183
  * Draw doughnut hole
173
- *
174
- * @returns {undefined}
184
+ * @param ctx
175
185
  */
176
- drawDoughnutHole() {
177
- const ctx = this.bufferCtx;
186
+ drawDoughnutHole(ctx = this.bufferCtx) {
178
187
  const pieOption = this.options;
188
+ const { width, height } = this.chartRect;
189
+ const padding = this.options.padding;
179
190
 
180
- const centerX = this.chartRect.width / 2;
181
- const centerY = this.chartRect.height / 2;
191
+ const centerX = width / 2;
192
+ const centerY = height / 2;
193
+ const chartWidth = centerX - (padding.left + padding.right);
194
+ const chartHeight = centerY - (padding.bottom + padding.top);
195
+ const radius = Math.min(chartWidth, chartHeight) * pieOption.doughnutHoleSize;
182
196
 
183
- const radius = Math.min(centerX, centerY) * pieOption.doughnutHoleSize;
184
197
  ctx.save();
185
198
  ctx.globalCompositeOperation = 'destination-out';
186
199
  ctx.beginPath();
@@ -194,19 +207,15 @@ const modules = {
194
207
  ctx.restore();
195
208
 
196
209
  // inner stroke
197
- ctx.beginPath();
198
-
199
210
  if (pieOption?.pieStroke?.use) {
211
+ ctx.beginPath();
200
212
  ctx.strokeStyle = pieOption.pieStroke.color;
201
213
  ctx.lineWidth = pieOption.pieStroke.lineWidth;
202
214
  ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);
203
215
  ctx.stroke();
204
- } else {
205
- ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);
216
+ ctx.closePath();
206
217
  }
207
218
 
208
- ctx.closePath();
209
-
210
219
  this.pieDataSet[this.pieDataSet.length - 1].ir = radius;
211
220
  },
212
221
  };
@@ -177,9 +177,11 @@ const modules = {
177
177
  const opt = this.options.tooltip;
178
178
 
179
179
  // draw tooltip Title(axis label) and add style class for wrap line about too much long label.
180
- this.tooltipHeaderDOM.textContent = this.options.horizontal
181
- ? this.axesY[hitAxis.y].getLabelFormat(hitItem.y)
182
- : this.axesX[hitAxis.x].getLabelFormat(hitItem.x);
180
+ if (this.axesX.length && this.axesY.length) {
181
+ this.tooltipHeaderDOM.textContent = this.options.horizontal
182
+ ? this.axesY[hitAxis.y].getLabelFormat(hitItem.y)
183
+ : this.axesX[hitAxis.x].getLabelFormat(hitItem.x);
184
+ }
183
185
 
184
186
  if (opt.textOverflow) {
185
187
  this.tooltipHeaderDOM.classList.add(`ev-chart-tooltip-header--${opt.textOverflow}`);
@@ -303,11 +305,18 @@ const modules = {
303
305
  // 3. Draw value
304
306
  let formattedTxt;
305
307
  if (opt.formatter) {
306
- formattedTxt = opt.formatter({
307
- x: this.options.horizontal ? value : hitItem.x,
308
- y: this.options.horizontal ? hitItem.y : value,
309
- name,
310
- });
308
+ if (this.options.type === 'pie') {
309
+ formattedTxt = opt.formatter({
310
+ value,
311
+ name,
312
+ });
313
+ } else {
314
+ formattedTxt = opt.formatter({
315
+ x: this.options.horizontal ? value : hitItem.x,
316
+ y: this.options.horizontal ? hitItem.y : value,
317
+ name,
318
+ });
319
+ }
311
320
  }
312
321
 
313
322
  if (!opt.formatter || typeof formattedTxt !== 'string') {
@@ -349,7 +358,12 @@ const modules = {
349
358
  */
350
359
  drawItemsHighlight(hitInfo, ctx) {
351
360
  Object.keys(hitInfo.items).forEach((sId) => {
352
- this.seriesList[sId].itemHighlight(hitInfo.items[sId], ctx);
361
+ const series = this.seriesList[sId];
362
+ series.itemHighlight(hitInfo.items[sId], ctx);
363
+
364
+ if (Util.isDoughnutHole(series.type)) {
365
+ this.drawDoughnutHole(ctx);
366
+ }
353
367
  });
354
368
  },
355
369
 
@@ -107,6 +107,15 @@ export const useModel = () => {
107
107
  normalizedOptions.tooltip.use = false;
108
108
  }
109
109
 
110
+ if (options.type === 'pie' && !options?.padding) {
111
+ normalizedOptions.padding = {
112
+ top: 2,
113
+ right: 2,
114
+ left: 2,
115
+ bottom: 4,
116
+ };
117
+ }
118
+
110
119
  return normalizedOptions;
111
120
  };
112
121
  const getNormalizedData = data => defaultsDeep(data, DEFAULT_DATA);
@@ -7,114 +7,121 @@
7
7
  disabled : $props.disabled,
8
8
  }"
9
9
  >
10
- <template v-if="$props.mode === 'date' || $props.mode === 'dateTime'">
11
- <span class="ev-date-picker-prefix-icon">
12
- <i class="ev-icon-calendar" />
13
- </span>
14
- <input
15
- v-model.trim="currentValue"
16
- type="text"
17
- class="ev-input"
18
- :placeholder="$props.placeholder"
19
- :disabled="$props.disabled"
20
- @click="clickSelectInput"
21
- @keydown.enter.prevent="validateValue(currentValue)"
22
- @change="validateValue(currentValue)"
23
- />
24
- </template>
25
- <template v-else>
26
- <div
27
- class="ev-date-picker-tag-wrapper"
28
- @click="clickSelectInput"
29
- >
10
+ <div
11
+ ref="datePickerWrapper"
12
+ class="ev-date-picker__wrapper"
13
+ >
14
+ <template v-if="$props.mode === 'date' || $props.mode === 'dateTime'">
30
15
  <span class="ev-date-picker-prefix-icon">
31
16
  <i class="ev-icon-calendar" />
32
17
  </span>
33
18
  <input
19
+ v-model.trim="currentValue"
34
20
  type="text"
35
- class="ev-input readonly"
36
- readonly
21
+ class="ev-input"
37
22
  :placeholder="$props.placeholder"
38
23
  :disabled="$props.disabled"
24
+ @click="clickSelectInput"
25
+ @keydown.enter.prevent="validateValue(currentValue)"
26
+ @change="validateValue(currentValue)"
39
27
  />
40
- <template
41
- v-if="$props.mode === 'dateMulti'
42
- && ($props.options.multiType === 'date' || !$props.options.tagShorten)"
28
+ </template>
29
+ <template v-else>
30
+ <div
31
+ class="ev-date-picker-tag-wrapper"
32
+ @click="clickSelectInput"
43
33
  >
44
- <div
45
- v-for="(item, idx) in mv"
46
- :key="`${item}_${idx}`"
47
- class="ev-select-tag"
48
- :class="{ num: $props.options.multiType !== 'date' }"
49
- >
50
- <span class="ev-tag-name"> {{ item }} </span>
51
- <span
52
- v-if="$props.options.multiType === 'date'"
53
- class="ev-tag-suffix"
54
- @click.stop="[removeMv(item), changeDropboxPosition()]"
55
- >
56
- <i class="ev-tag-suffix-close ev-icon-error" />
34
+ <span class="ev-date-picker-prefix-icon">
35
+ <i class="ev-icon-calendar" />
57
36
  </span>
58
- </div>
59
- </template>
60
- <template v-else-if="mv[0] && mv[mv.length - 1]">
61
- <div class="ev-select-tag num">
62
- <span class="ev-tag-name"> {{ mv[0] }} </span>
63
- </div>
64
- <div class="ev-select-tag num">
65
- <span class="ev-tag-name"> ~ </span>
66
- </div>
67
- <div class="ev-select-tag num">
68
- <span class="ev-tag-name"> {{ mv[mv.length - 1] }} </span>
69
- </div>
70
- </template>
71
- </div>
72
- </template>
73
- <template v-if="$props.clearable">
74
- <span
75
- v-show="isClearableIcon"
76
- class="ev-input-suffix"
77
- @click.stop="[removeAllMv(), clickOutsideDropbox()]"
78
- >
79
- <i class="ev-icon-error" />
80
- </span>
81
- </template>
82
- <div class="ev-date-picker-dropbox-wrapper">
83
- <div
84
- v-if="isDropbox"
85
- ref="dropbox"
86
- class="ev-date-picker-dropdown"
87
- :class="$props.mode"
88
- :style="dropboxPosition"
89
- >
90
- <div
91
- v-if="usedShortcuts.length"
92
- class="ev-date-picker-dropbox__button-layout">
93
- <ev-button-group>
94
- <ev-button
95
- v-for="button in usedShortcuts"
96
- :key="button.key"
97
- :type="button.isActive ? 'primary' : 'default'"
98
- @click="clickShortcut(button.key)"
37
+ <input
38
+ type="text"
39
+ class="ev-input readonly"
40
+ readonly
41
+ :placeholder="$props.placeholder"
42
+ :disabled="$props.disabled"
43
+ />
44
+ <template
45
+ v-if="$props.mode === 'dateMulti'
46
+ && ($props.options.multiType === 'date' || !$props.options.tagShorten)"
47
+ >
48
+ <div
49
+ v-for="(item, idx) in mv"
50
+ :key="`${item}_${idx}`"
51
+ class="ev-select-tag"
52
+ :class="{ num: $props.options.multiType !== 'date' }"
99
53
  >
100
- {{ button.label }}
101
- </ev-button>
102
- </ev-button-group>
54
+ <span class="ev-tag-name"> {{ item }} </span>
55
+ <span
56
+ v-if="$props.options.multiType === 'date'"
57
+ class="ev-tag-suffix"
58
+ @click.stop="[removeMv(item), changeDropboxPosition()]"
59
+ >
60
+ <i class="ev-tag-suffix-close ev-icon-error" />
61
+ </span>
62
+ </div>
63
+ </template>
64
+ <template v-else-if="mv[0] && mv[mv.length - 1]">
65
+ <div class="ev-select-tag num">
66
+ <span class="ev-tag-name"> {{ mv[0] }} </span>
67
+ </div>
68
+ <div class="ev-select-tag num">
69
+ <span class="ev-tag-name"> ~ </span>
70
+ </div>
71
+ <div class="ev-select-tag num">
72
+ <span class="ev-tag-name"> {{ mv[mv.length - 1] }} </span>
73
+ </div>
74
+ </template>
103
75
  </div>
76
+ </template>
77
+ <template v-if="$props.clearable">
78
+ <span
79
+ v-show="isClearableIcon"
80
+ class="ev-input-suffix"
81
+ @click.stop="[removeAllMv(), clickOutsideDropbox()]"
82
+ >
83
+ <i class="ev-icon-error" />
84
+ </span>
85
+ </template>
86
+ <div class="ev-date-picker-dropbox-wrapper">
104
87
  <div
88
+ v-if="isDropbox"
89
+ ref="dropbox"
90
+ class="ev-date-picker-dropdown"
91
+ :class="$props.mode"
92
+ :style="dropboxPosition"
93
+ >
94
+ <div
95
+ v-if="usedShortcuts.length"
96
+ class="ev-date-picker-dropbox__button-layout"
97
+ >
98
+ <ev-button-group>
99
+ <ev-button
100
+ v-for="button in usedShortcuts"
101
+ :key="button.key"
102
+ :type="button.isActive ? 'primary' : 'default'"
103
+ @click="clickShortcut(button.key)"
104
+ >
105
+ {{ button.label }}
106
+ </ev-button>
107
+ </ev-button-group>
108
+ </div>
109
+ <div
105
110
  v-if="usedShortcuts.length"
106
111
  class="ev-date-picker-dropbox__divider"
107
- />
108
- <div
109
- :class="{ 'ev-date-picker-dropbox__calendar':usedShortcuts.length }">
110
- <ev-calendar
111
- key="fromCalendar"
112
- v-model="mv"
113
- :mode="$props.mode"
114
- :month-notation="$props.monthNotation"
115
- :day-of-the-week-notation="$props.dayOfTheWeekNotation"
116
- :options="$props.options"
117
112
  />
113
+ <div
114
+ :class="{ 'ev-date-picker-dropbox__calendar':usedShortcuts.length }"
115
+ >
116
+ <ev-calendar
117
+ key="fromCalendar"
118
+ v-model="mv"
119
+ :mode="$props.mode"
120
+ :month-notation="$props.monthNotation"
121
+ :day-of-the-week-notation="$props.dayOfTheWeekNotation"
122
+ :options="$props.options"
123
+ />
124
+ </div>
118
125
  </div>
119
126
  </div>
120
127
  </div>
@@ -230,6 +237,7 @@ export default {
230
237
  const {
231
238
  isDropbox,
232
239
  datePicker,
240
+ datePickerWrapper,
233
241
  dropbox,
234
242
  itemWrapper,
235
243
  dropboxPosition,
@@ -261,6 +269,7 @@ export default {
261
269
 
262
270
  isDropbox,
263
271
  datePicker,
272
+ datePickerWrapper,
264
273
  dropbox,
265
274
  itemWrapper,
266
275
  dropboxPosition,
@@ -279,13 +288,18 @@ export default {
279
288
  @import '../../style/index.scss';
280
289
 
281
290
  .ev-date-picker {
282
- $select-height: 35px;
291
+ $select-height: $input-default-height;
283
292
  display: block;
284
293
  position: relative;
285
294
  width: 100%;
286
- min-height: $select-height;
287
295
 
288
296
  @import '../../style/components/input.scss';
297
+
298
+ &__wrapper {
299
+ position: relative;
300
+ min-height: $select-height;
301
+ }
302
+
289
303
  .ev-input {
290
304
  $calendar-icon-width: 30px;
291
305
  position: absolute;
@@ -312,15 +326,12 @@ export default {
312
326
  height: 100%;
313
327
  align-items: center;
314
328
  cursor: pointer;
315
-
316
-
317
329
  &:hover {
318
330
  color: #409EFF;
319
331
  }
320
332
  }
321
333
 
322
334
  .ev-date-picker-tag-wrapper {
323
- $select-height: 35px;
324
335
  display: flex;
325
336
  width: 100%;
326
337
  height: 100%;
@@ -125,6 +125,7 @@ export const useDropdown = () => {
125
125
 
126
126
  const isDropbox = ref(false);
127
127
  const datePicker = ref(null);
128
+ const datePickerWrapper = ref(null);
128
129
  const dropbox = ref(null);
129
130
  const itemWrapper = ref(null);
130
131
  const dropboxPosition = reactive({
@@ -138,7 +139,7 @@ export const useDropdown = () => {
138
139
  */
139
140
  const changeDropboxPosition = async () => {
140
141
  await nextTick();
141
- const datePickerRect = datePicker.value?.getBoundingClientRect();
142
+ const datePickerRect = datePickerWrapper.value?.getBoundingClientRect();
142
143
  const dropboxRect = dropbox.value?.getBoundingClientRect();
143
144
  const datePickerHeight = datePickerRect.height;
144
145
  const datePickerY = datePickerRect.y;
@@ -195,6 +196,7 @@ export const useDropdown = () => {
195
196
  return {
196
197
  isDropbox,
197
198
  datePicker,
199
+ datePickerWrapper,
198
200
  dropbox,
199
201
  itemWrapper,
200
202
  dropboxPosition,
@@ -149,7 +149,7 @@
149
149
  <tr
150
150
  v-for="(row, rowIndex) in viewStore"
151
151
  :key="rowIndex"
152
- :data-index="rowIndex"
152
+ :data-index="row[0]"
153
153
  :class="{
154
154
  row: true,
155
155
  selected: row[2] === selectedRow,
@@ -309,6 +309,7 @@ export default {
309
309
  'update:checked': null,
310
310
  'check-row': null,
311
311
  'check-all': null,
312
+ 'scroll-end': null,
312
313
  },
313
314
  setup(props) {
314
315
  const {
@@ -341,19 +342,14 @@ export default {
341
342
  items: [],
342
343
  },
343
344
  isSearch: false,
344
- searchValue: computed(() => (props.option.searchValue || '')),
345
+ searchWord: '',
345
346
  });
346
347
  const stores = reactive({
347
348
  viewStore: [],
348
349
  originStore: [],
349
350
  filterStore: [],
350
351
  store: computed(() => {
351
- let store;
352
- if (filterInfo.isFiltering) {
353
- store = stores.filterStore;
354
- } else {
355
- store = stores.originStore;
356
- }
352
+ const store = filterInfo.isFiltering ? stores.filterStore : stores.originStore;
357
353
  return filterInfo.isSearch ? stores.searchStore : store;
358
354
  }),
359
355
  orderedColumns: computed(() =>
@@ -402,12 +398,20 @@ export default {
402
398
  gridWidth: computed(() => (props.width ? setPixelUnit(props.width) : '100%')),
403
399
  gridHeight: computed(() => (props.height ? setPixelUnit(props.height) : '100%')),
404
400
  });
401
+ const pageInfo = reactive({
402
+ currentPage: 1,
403
+ prevPage: 0,
404
+ startIndex: 0,
405
+ use: computed(() => (props.option.page?.use || false)),
406
+ dataCount: computed(() => (props.option.page?.dataCount || 50)),
407
+ isInfinite: computed(() => (props.option.page?.isInfinite || false)),
408
+ });
405
409
 
406
410
  const {
407
411
  updateVScroll,
408
412
  updateHScroll,
409
413
  onScroll,
410
- } = scrollEvent({ scrollInfo, stores, elementInfo, resizeInfo });
414
+ } = scrollEvent({ scrollInfo, stores, elementInfo, resizeInfo, pageInfo });
411
415
 
412
416
  const {
413
417
  onRowClick,
@@ -512,9 +516,9 @@ export default {
512
516
  (value) => {
513
517
  setStore(value);
514
518
  if (filterInfo.isSearch) {
515
- onSearch(filterInfo.searchValue);
519
+ onSearch(filterInfo.searchWord);
516
520
  }
517
- },
521
+ }, { deep: true },
518
522
  );
519
523
  watch(
520
524
  () => props.checked,
@@ -582,13 +586,12 @@ export default {
582
586
  },
583
587
  );
584
588
  watch(
585
- () => filterInfo.searchValue,
589
+ () => props.option.searchValue,
586
590
  (value) => {
587
- const searchValue = value?.value ?? value;
588
- if (searchValue) {
589
- onSearch(searchValue);
591
+ if (value !== undefined) {
592
+ onSearch(value?.value ?? value);
590
593
  }
591
- }, { immediate: true },
594
+ }, { immediate: true, deep: true },
592
595
  );
593
596
  const isFilterButton = field => filterInfo.isFiltering && field !== 'db-icon' && field !== 'user-icon';
594
597
  return {
@@ -600,6 +603,7 @@ export default {
600
603
  ...toRefs(stores),
601
604
  ...toRefs(filterInfo),
602
605
  ...toRefs(scrollInfo),
606
+ ...toRefs(pageInfo),
603
607
  ...toRefs(resizeInfo),
604
608
  ...toRefs(selectInfo),
605
609
  ...toRefs(checkInfo),