quasar-ui-sellmate-ui-kit 3.14.29 → 3.14.31

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quasar-ui-sellmate-ui-kit",
3
- "version": "3.14.29",
3
+ "version": "3.14.31",
4
4
  "author": "Sellmate Dev Team <dev@sellmate.co.kr>",
5
5
  "description": "Sellmate UI Kit",
6
6
  "license": "MIT",
@@ -27,21 +27,19 @@
27
27
  >
28
28
  <!-- TODO: 아무것도 선택되지 않았을 때 props 값으로 표기 해줘야함 기본 값은 "전체" -->
29
29
  <template #before-options>
30
- <div class="search-input-form-container">
31
- <form class="select-search-input-form">
32
- <q-icon :name="searchIcon" size="20px" />
33
- <input
34
- v-model="search"
35
- autofocus
36
- class="select-search-input"
37
- :placeholder="searchPlaceholder"
38
- @input="
39
- data => {
40
- onSearch(data.target.value);
41
- }
42
- "
43
- />
44
- </form>
30
+ <div class="search-input-container">
31
+ <q-icon :name="searchIcon" size="20px" />
32
+ <input
33
+ v-model="search"
34
+ autofocus
35
+ class="select-search-input"
36
+ :placeholder="searchPlaceholder"
37
+ @input="
38
+ data => {
39
+ onSearch(data.target.value);
40
+ }
41
+ "
42
+ />
45
43
  </div>
46
44
  </template>
47
45
  <template #option="{ itemProps, opt, selected, toggleOption }">
@@ -73,21 +71,19 @@
73
71
  </div>
74
72
  </template>
75
73
  <template #no-option>
76
- <div class="search-input-form-container">
77
- <form class="select-search-input-form">
78
- <q-icon :name="searchIcon" size="20px" />
79
- <input
80
- v-model="search"
81
- autofocus
82
- class="select-search-input"
83
- :placeholder="searchPlaceholder"
84
- @input="
85
- data => {
86
- onSearch(data.target.value);
87
- }
88
- "
89
- />
90
- </form>
74
+ <div class="search-input-container">
75
+ <q-icon :name="searchIcon" size="20px" />
76
+ <input
77
+ v-model="search"
78
+ autofocus
79
+ class="select-search-input"
80
+ :placeholder="searchPlaceholder"
81
+ @input="
82
+ data => {
83
+ onSearch(data.target.value);
84
+ }
85
+ "
86
+ />
91
87
  </div>
92
88
  <q-item class="s-select-no-option">
93
89
  <q-item-section class="text-grey">{{ noData }}</q-item-section>
@@ -314,7 +310,7 @@
314
310
  color: $grey_65 !important;
315
311
  }
316
312
 
317
- .select-search-input-form {
313
+ .search-input-container {
318
314
  height: 28px;
319
315
  display: flex;
320
316
  align-items: center;
@@ -76,13 +76,25 @@
76
76
  <slot :name="slotName" :key="`slot-${index}`" v-bind="data"> </slot>
77
77
  </template>
78
78
  </q-table>
79
- <s-pagination
79
+ <div
80
80
  v-if="paginationModel.rowsPerPage !== 0 && ((!hideBottom && pagesNumber > 1) || showBottom)"
81
- v-model="paginationModel.page"
82
- :lastPage="pagesNumber"
83
- class="bg-grey_05 s-border-radius-sm s-border-top-none s-border-grey_30"
84
- @update:modelValue="updatePagination"
85
- />
81
+ class="bg-grey_05 s-border-radius-sm s-border-top-none s-border-grey_30 s-pagination-wrapper relative-position"
82
+ >
83
+ <s-pagination
84
+ v-model="paginationModel.page"
85
+ :lastPage="pagesNumber"
86
+ @update:model-value="updatePagination"
87
+ />
88
+ <s-select
89
+ v-if="usePerPageSelect"
90
+ :options="perPageOptions"
91
+ v-model="paginationModel.rowsPerPage"
92
+ emit-value
93
+ map-options
94
+ class="absolute s-width-120 rows-per-page"
95
+ @update:model-value="updateRowsPerPage"
96
+ />
97
+ </div>
86
98
  </template>
87
99
 
88
100
  <script>
@@ -93,7 +105,7 @@
93
105
 
94
106
  export default defineComponent({
95
107
  name: 'STable',
96
- emits: ['update:page', 'update:focused', 'field-updated', 'request'],
108
+ emits: ['update:page', 'update:rowsPerPage', 'update:focused', 'field-updated', 'request'],
97
109
  components: {
98
110
  QTable,
99
111
  QInnerLoading,
@@ -166,6 +178,19 @@
166
178
  type: Boolean,
167
179
  default: false,
168
180
  },
181
+ usePerPageSelect: {
182
+ type: Boolean,
183
+ default: false,
184
+ },
185
+ perPageOptions: {
186
+ type: Array,
187
+ default: () => [
188
+ { label: '50개씩 보기', value: 50 },
189
+ { label: '100개씩 보기', value: 100 },
190
+ { label: '150개씩 보기', value: 150 },
191
+ { label: '200개씩 보기', value: 200 },
192
+ ],
193
+ },
169
194
  },
170
195
  setup(props, { emit, attrs }) {
171
196
  const tablePagination = ref(props.pagination);
@@ -187,6 +212,11 @@
187
212
  }
188
213
  }
189
214
 
215
+ function updateRowsPerPage(value) {
216
+ emit('update:rowsPerPage', value);
217
+ updatePagination(1);
218
+ }
219
+
190
220
  const sTableRef = ref(null);
191
221
  const { focusCell, isFocused, editing, inputRef, inputData, closeInput, editIcon } =
192
222
  useNavigator(props, attrs, emit);
@@ -316,6 +346,7 @@
316
346
  Math.ceil(props.rows.length / paginationModel.value.rowsPerPage),
317
347
  ),
318
348
  updatePagination,
349
+ updateRowsPerPage,
319
350
  };
320
351
  },
321
352
  });
@@ -576,4 +607,9 @@
576
607
  pointer-events: none;
577
608
  }
578
609
  }
610
+ .rows-per-page {
611
+ right: 20px;
612
+ top: 50%;
613
+ transform: translateY(-50%);
614
+ }
579
615
  </style>