quasar-ui-sellmate-ui-kit 1.3.17 → 1.3.18

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/dist/index.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * quasar-ui-sellmate-ui-kit v1.3.16
2
+ * quasar-ui-sellmate-ui-kit v1.3.17
3
3
  * (c) 2023 Sellmate Dev Team <dev@sellmate.co.kr>
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * quasar-ui-sellmate-ui-kit v1.3.16
2
+ * quasar-ui-sellmate-ui-kit v1.3.17
3
3
  * (c) 2023 Sellmate Dev Team <dev@sellmate.co.kr>
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * quasar-ui-sellmate-ui-kit v1.3.16
2
+ * quasar-ui-sellmate-ui-kit v1.3.17
3
3
  * (c) 2023 Sellmate Dev Team <dev@sellmate.co.kr>
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * quasar-ui-sellmate-ui-kit v1.3.16
2
+ * quasar-ui-sellmate-ui-kit v1.3.17
3
3
  * (c) 2023 Sellmate Dev Team <dev@sellmate.co.kr>
4
4
  * Released under the MIT License.
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quasar-ui-sellmate-ui-kit",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "author": "Sellmate Dev Team <dev@sellmate.co.kr>",
5
5
  "description": "Sellmate UI Kit",
6
6
  "license": "MIT",
@@ -0,0 +1,261 @@
1
+ <template>
2
+ <div class="pagination row">
3
+ <div class="icons-container" v-if="paginationInfo.startPage !== 1">
4
+ <q-btn
5
+ flat
6
+ dense
7
+ round
8
+ :ripple="false"
9
+ unelevated
10
+ type="button"
11
+ align="center"
12
+ class="bg-transparent first-btn"
13
+ text-color="grey-4"
14
+ :icon="paginationFirstIcon"
15
+ @click="updateModelValue('goFirst')"
16
+ />
17
+ <q-btn
18
+ flat
19
+ dense
20
+ round
21
+ :ripple="false"
22
+ unelevated
23
+ type="button"
24
+ align="center"
25
+ class="left-btn"
26
+ text-color="grey-4"
27
+ :icon="paginationLeftIcon"
28
+ @click="updateModelValue('goLeft')"
29
+ />
30
+ </div>
31
+ <div class="pagination-container">
32
+ <q-btn
33
+ v-for="(p, i) in 10"
34
+ :key="i"
35
+ v-show="paginationInfo.startPage + i <= paginationInfo.lastPage"
36
+ flat
37
+ dense
38
+ rounded
39
+ no-wrap
40
+ unelevated
41
+ :ripple="false"
42
+ :label="paginationInfo.startPage + i"
43
+ text-color="grey-4"
44
+ type="button"
45
+ align="center"
46
+ @click="updateModelValue(paginationInfo.startPage + i)"
47
+ class="pagination-btn"
48
+ :class="{
49
+ 'pagination-active-btn':
50
+ paginationInfo.startPage + i === paginationInfo.currentPage,
51
+ }"
52
+ />
53
+ </div>
54
+ <div
55
+ class="icons-container"
56
+ v-if="paginationInfo.lastPage - paginationInfo.startPage >= 10"
57
+ >
58
+ <q-btn
59
+ flat
60
+ dense
61
+ round
62
+ :ripple="false"
63
+ unelevated
64
+ type="button"
65
+ align="center"
66
+ class="right-btn"
67
+ text-color="grey-4"
68
+ :icon="paginationRightIcon"
69
+ @click="updateModelValue('goRight')"
70
+ />
71
+ <q-btn
72
+ flat
73
+ dense
74
+ round
75
+ :ripple="false"
76
+ unelevated
77
+ type="button"
78
+ align="center"
79
+ class="last-btn"
80
+ text-color="grey-4"
81
+ :icon="paginationLastIcon"
82
+ @click="updateModelValue('goLast')"
83
+ />
84
+ </div>
85
+ </div>
86
+ </template>
87
+
88
+ <script>
89
+ import { QBtn } from 'quasar';
90
+ import { defineComponent, ref, watch } from 'vue';
91
+ // eslint-disable-next-line
92
+ import { paginationFirstIcon, paginationLastIcon, paginationLeftIcon, paginationRightIcon } from '../assets/icons.js';
93
+
94
+ export default defineComponent({
95
+ name: 'SPagination',
96
+ components: {
97
+ QBtn,
98
+ },
99
+ props: {
100
+ modelValue: {
101
+ type: Number,
102
+ default: 1,
103
+ },
104
+ lastPage: {
105
+ type: Number,
106
+ default: 1,
107
+ required: true,
108
+ },
109
+ },
110
+ setup(props, { emit }) {
111
+ const paginationInfo = ref({
112
+ lastPage: props.lastPage,
113
+ currentPage: props.modelValue,
114
+ startPage: Math.floor((props.modelValue - 1) / 10) * 10 + 1,
115
+ });
116
+
117
+ function updateModelValue(val) {
118
+ if (val === 'goFirst') {
119
+ paginationInfo.value.startPage = 1;
120
+ paginationInfo.value.currentPage = 1;
121
+ } else if (val === 'goLeft' && paginationInfo.value.startPage - 10 > 0) {
122
+ paginationInfo.value.startPage -= 10;
123
+ paginationInfo.value.currentPage = paginationInfo.value.startPage + 9;
124
+ } else if (
125
+ val === 'goRight'
126
+ && paginationInfo.value.startPage + 10 <= paginationInfo.value.lastPage
127
+ ) {
128
+ paginationInfo.value.startPage += 10;
129
+ paginationInfo.value.currentPage = paginationInfo.value.startPage;
130
+ } else if (val === 'goLast') {
131
+ if (paginationInfo.value.lastPage % 10 !== 0) {
132
+ paginationInfo.value.startPage = Math.floor(paginationInfo.value.lastPage / 10) * 10 + 1;
133
+ } else {
134
+ paginationInfo.value.startPage = (Math.floor(paginationInfo.value.lastPage / 10) - 1) * 10 + 1;
135
+ }
136
+ paginationInfo.value.currentPage = paginationInfo.value.lastPage;
137
+ } else {
138
+ paginationInfo.value.currentPage = val;
139
+ }
140
+ emit('update:modelValue', paginationInfo.value.currentPage);
141
+ }
142
+
143
+ watch(
144
+ () => props.modelValue,
145
+ (newVal) => {
146
+ paginationInfo.value.currentPage = newVal;
147
+ paginationInfo.value.startPage = Math.floor((newVal - 1) / 10) * 10 + 1;
148
+ },
149
+ );
150
+
151
+ watch(
152
+ () => props.lastPage,
153
+ (newVal) => {
154
+ paginationInfo.value.lastPage = newVal;
155
+ },
156
+ );
157
+
158
+ return {
159
+ paginationRightIcon,
160
+ paginationLeftIcon,
161
+ paginationLastIcon,
162
+ paginationFirstIcon,
163
+
164
+ paginationInfo,
165
+
166
+ updateModelValue,
167
+ };
168
+ },
169
+ });
170
+ </script>
171
+
172
+ <style lang="scss">
173
+ @import "../css/variable.scss";
174
+
175
+ .pagination {
176
+ display: flex;
177
+ justify-content: center;
178
+ align-items: center;
179
+ .q-btn {
180
+ min-height: $pagination-size;
181
+ height: $pagination-size;
182
+ margin: $pagination-margin;
183
+ justify-content: center;
184
+ &:hover {
185
+ &:before {
186
+ border: 1px solid $indigo-7;
187
+ }
188
+ .q-focus-helper {
189
+ opacity: 0 !important;
190
+ &:before,
191
+ &:after {
192
+ opacity: 0 !important;
193
+ }
194
+ }
195
+ .q-btn__content {
196
+ .q-icon {
197
+ color: $indigo-7;
198
+ }
199
+ > span {
200
+ color: $indigo-7;
201
+ }
202
+ }
203
+ }
204
+ }
205
+ > .icons-container {
206
+ .q-btn {
207
+ padding: 0 !important;
208
+ min-width: $pagination-size;
209
+ width: $pagination-size;
210
+ &__content {
211
+ .q-icon {
212
+ font-size: $default-font;
213
+ width: $icon-size-sm;
214
+ height: $icon-size-sm;
215
+ }
216
+ }
217
+ }
218
+ }
219
+ .pagination-container {
220
+ .q-btn {
221
+ min-width: $pagination-size;
222
+ width: fit-content;
223
+ padding: 0;
224
+ &__content {
225
+ padding: 2px 10px;
226
+ > span {
227
+ height: $default-content-height;
228
+ line-height: $default-line-height;
229
+ font-size: $default-font;
230
+ font-weight: $default-font-weight;
231
+ }
232
+ }
233
+ }
234
+ .pagination-active-btn {
235
+ &:before {
236
+ background: $indigo-7 !important;
237
+ }
238
+ .q-btn__content {
239
+ > span {
240
+ color: white !important;
241
+ }
242
+ }
243
+ }
244
+ }
245
+ .q-btn.disabled {
246
+ &:hover {
247
+ &:before {
248
+ border: none;
249
+ }
250
+ .q-btn__content {
251
+ .q-icon {
252
+ color: $grey-6;
253
+ }
254
+ > span {
255
+ color: $grey-6;
256
+ }
257
+ }
258
+ }
259
+ }
260
+ }
261
+ </style>
@@ -17,11 +17,11 @@
17
17
  's-dropdown-md': size === 'md',
18
18
  }"
19
19
  >
20
- <q-menu class="s-dropdown-menu" :offset="[0,4]">
20
+ <q-menu class="s-dropdown-menu" :offset="[0, 4]">
21
21
  <q-item
22
22
  v-for="(opt, i) in options"
23
23
  :key="i"
24
- clickable
24
+ :clickable="opt.disable === undefined || opt.disable === false"
25
25
  v-close-popup
26
26
  @click="$emit('handleClickOption', opt.value)"
27
27
  >
@@ -153,6 +153,10 @@ export default defineComponent({
153
153
  min-height: 0;
154
154
  height: 20px;
155
155
  }
156
+ &:not(.q-item--clickable) {
157
+ cursor: default;
158
+ color: $Grey_Lighten-1
159
+ }
156
160
  }
157
161
  box-shadow: 0px 2px 6px 0px #00000020;
158
162
  }
@@ -18,8 +18,13 @@
18
18
  :option-group="optionGroup"
19
19
  @add="onAddChecked"
20
20
  @remove="onRemoveChecked"
21
+ @update:modelValue="(val) => $emit('update:modelValue', val)"
21
22
  >
22
- <template v-slot:before-options >
23
+ <!-- TODO: 아무것도 선택되지 않았을 때 props 값으로 표기 해줘야함 기본 값은 "전체" -->
24
+ <!-- TODO: 모델이 업데이트가 되었을 때 value 값만 가지고 옴 모델로 {label: '...', value: '...'} 형식이 들어오고 -->
25
+ <!-- 이 형식으로 업데이트 시켜줘야함 -->
26
+ <!-- 예시 [{label: '판매처A', value: 'A'}, {label: '판매처B', value: 'B'}] -->
27
+ <template v-slot:before-options>
23
28
  <form v-show="searchable">
24
29
  <q-input
25
30
  v-model="search"
@@ -61,23 +66,29 @@
61
66
  </q-item-section>
62
67
  </q-item>
63
68
  </template>
64
- <template v-if="useAll && model.length === options.filter(v => !v.category).length" v-slot:selected>
69
+ <template
70
+ v-if="
71
+ useAll && model.length === options.filter((v) => !v.category).length
72
+ "
73
+ v-slot:selected
74
+ >
65
75
  <div>
66
76
  {{ allPlaceholder }}
67
77
  </div>
68
78
  </template>
69
79
  <template v-slot:no-option>
70
80
  <q-input
71
- v-model="search"
72
- dense
73
- outlined
74
- autofocus
75
- class="select-search-input"
76
- :placeholder="searchPlaceholder"
77
- @update:modelValue="onSearch"
78
- ref="searchRef"
79
- />
81
+ v-model="search"
82
+ dense
83
+ outlined
84
+ autofocus
85
+ class="select-search-input"
86
+ :placeholder="searchPlaceholder"
87
+ @update:modelValue="onSearch"
88
+ ref="searchRef"
89
+ />
80
90
  <q-item class="s-select-no-option">
91
+ <!-- TODO: 옵션 없을 때 따로 값을 받을 수 있고, 기본 값은 '데이터 없음' -->
81
92
  <q-item-section class="text-grey"> No results </q-item-section>
82
93
  </q-item>
83
94
  </template>
@@ -144,17 +155,17 @@ export default defineComponent({
144
155
  default: '',
145
156
  },
146
157
  },
147
- setup(props, { emit }) {
158
+ setup(props) {
148
159
  const model = ref(props.modelValue);
149
160
  const filteredOptions = ref(props.options);
150
161
  const searchInput = ref(null);
151
162
  const placeholder = ref(props.searchPlaceholder);
152
163
  const search = ref('');
153
164
  const searchRef = ref(props.CheckBoxsearchRef);
154
- const isDisable = props.options.find(v => Boolean(v.disable));
165
+ const isDisable = props.options.find((v) => Boolean(v.disable));
155
166
 
156
167
  function onRemoveChecked(detail) {
157
- const idx = model.value.findIndex(v => v[props.optionValue] === '');
168
+ const idx = model.value.findIndex((v) => v[props.optionValue] === '');
158
169
  if (detail.value[props.optionValue] === '') {
159
170
  nextTick(() => {
160
171
  model.value = [];
@@ -168,12 +179,12 @@ export default defineComponent({
168
179
  function onAddChecked(detail) {
169
180
  if (detail.value === '') {
170
181
  nextTick(() => {
171
- model.value = props.options.filter(v => !v.category);
182
+ model.value = props.options.filter((v) => !v.category);
172
183
  });
173
184
  } else {
174
185
  nextTick(() => {
175
186
  if (model.value.length === props.options.length - 1) {
176
- model.value = props.options.filter(v => !v.category);
187
+ model.value = props.options.filter((v) => !v.category);
177
188
  }
178
189
  });
179
190
  }
@@ -189,19 +200,26 @@ export default defineComponent({
189
200
  }
190
201
  }
191
202
 
192
- watch(() => props.modelValue, (val) => {
193
- model.value = val;
194
- });
195
- watch(model, () => {
196
- emit('update:modelValue', model.value);
197
- });
198
- watch(() => props.options, (val) => {
199
- filteredOptions.value = val;
200
- });
203
+ watch(
204
+ () => props.modelValue,
205
+ (val) => {
206
+ model.value = val;
207
+ },
208
+ );
209
+ watch(
210
+ () => props.options,
211
+ (val) => {
212
+ filteredOptions.value = val;
213
+ },
214
+ );
201
215
 
202
216
  onBeforeMount(() => {
203
- if (props.useAll && model.value.length === 1 && !props.modelValue[0].value) {
204
- model.value = props.options.filter(v => !v.category);
217
+ if (
218
+ props.useAll
219
+ && model.value.length === 1
220
+ && !props.modelValue[0].value
221
+ ) {
222
+ model.value = props.options.filter((v) => !v.category);
205
223
  }
206
224
  });
207
225
 
package/src/vue-plugin.js CHANGED
@@ -19,6 +19,8 @@ import SInputCounter from './components/SInputCounter.vue';
19
19
  import SList from './components/SList.vue';
20
20
  import SMarkupTable from './components/SMarkupTable.vue';
21
21
  import SPagination from './components/SPagination.vue';
22
+ // 하위호환성 확보 (Todo: 코드 제거)
23
+ import Pagination from './components/Pagination.vue';
22
24
  import SRadio from './components/SRadio.vue';
23
25
  import SRouteTab from './components/SRouteTab.vue';
24
26
  import SSelect from './components/SSelect.vue';
@@ -56,6 +58,8 @@ function install(app) {
56
58
  app.component('s-list', SList);
57
59
  app.component('s-markup-table', SMarkupTable);
58
60
  app.component('s-pagination', SPagination);
61
+ // 하위호환성 확보 (Todo: 코드 제거)
62
+ app.component('s-pagination2', Pagination);
59
63
  app.component('s-radio', SRadio);
60
64
  app.component('s-select', SSelect);
61
65
  app.component('s-select-custom', SSelectCustom);