quasar-ui-sellmate-ui-kit 1.1.96 → 1.2.0

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.1.95
2
+ * quasar-ui-sellmate-ui-kit v2.0.1
3
3
  * (c) 2022 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.1.95
2
+ * quasar-ui-sellmate-ui-kit v2.0.1
3
3
  * (c) 2022 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.1.95
2
+ * quasar-ui-sellmate-ui-kit v2.0.1
3
3
  * (c) 2022 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.1.95
2
+ * quasar-ui-sellmate-ui-kit v2.0.1
3
3
  * (c) 2022 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.1.96",
3
+ "version": "1.2.0",
4
4
  "author": "Sellmate Dev Team <dev@sellmate.co.kr>",
5
5
  "description": "Sellmate UI Kit",
6
6
  "license": "MIT",
@@ -13,8 +13,8 @@
13
13
  'no-hover': noHover,
14
14
  }"
15
15
  >
16
- <template v-slot>
17
- <slot></slot>
16
+ <template v-for="(_, slotName, index) in $slots" :key="index">
17
+ <slot :name="slotName"></slot>
18
18
  </template>
19
19
  </q-btn>
20
20
  </template>
@@ -1,13 +1,26 @@
1
1
  <template>
2
- <q-banner dense rounded class="text-black col s-caution">
3
- <div class="s-caution-title">{{ title }}</div>
2
+ <q-banner
3
+ dense
4
+ rounded
5
+ class="text-grey-2 col relative-position s-caution"
6
+ :class="{
7
+ 's-caution__title': title,
8
+ 's-caution__page bg-red-14': !useModal,
9
+ 'bg-red-11': useModal,
10
+ }"
11
+ >
12
+ <div v-if="title" class="s-caution-title">{{ title }}</div>
4
13
  <ul>
5
14
  <slot />
6
15
  </ul>
7
- <q-icon class="s-caution-icon" size="240px" :name="cautionOutlineIcon" />
16
+ <q-icon
17
+ v-if="!useModal"
18
+ class="s-caution-icon"
19
+ size="240px"
20
+ :name="cautionOutlineIcon"
21
+ />
8
22
  </q-banner>
9
23
  </template>
10
-
11
24
  <script>
12
25
  import { defineComponent } from 'vue';
13
26
  import { QBanner, QIcon } from 'quasar';
@@ -20,7 +33,8 @@ export default defineComponent({
20
33
  QIcon,
21
34
  },
22
35
  props: {
23
- title: String,
36
+ title: { type: String, default: '' },
37
+ useModal: { type: Boolean, default: false },
24
38
  },
25
39
  setup() {
26
40
  return {
@@ -31,34 +45,14 @@ export default defineComponent({
31
45
  </script>
32
46
 
33
47
  <style lang="scss">
34
- @import "../css/variable.scss";
35
-
36
48
  .s-caution {
37
49
  padding: 20px 0;
38
- background-color: #fef1f1;
39
50
  border-radius: 4px;
40
- border: 1px solid $red-9;
41
- border-left: 8px solid $red-7;
42
- position: relative;
43
51
  overflow: hidden;
44
52
  max: {
45
53
  height: 100%;
46
54
  width: 100%;
47
55
  }
48
- .s-caution-title {
49
- width: 100%;
50
- height: 30px;
51
- line-height: 30px;
52
- color: $red-6;
53
- font: {
54
- size: 18px;
55
- weight: 700;
56
- }
57
- margin: {
58
- left: $caution-margin-left;
59
- bottom: 16px;
60
- }
61
- }
62
56
  ul {
63
57
  margin: 0;
64
58
  padding: 0;
@@ -79,8 +73,28 @@ export default defineComponent({
79
73
  position: absolute;
80
74
  right: -41px;
81
75
  bottom: -34px;
82
- color: #FD9595;
76
+ color: #fd9595;
83
77
  opacity: 0.24;
84
78
  }
85
79
  }
80
+ .s-caution__page {
81
+ border: 1px solid $red-9;
82
+ }
83
+ .s-caution__title {
84
+ border-left: 8px solid $red-7;
85
+ .s-caution-title {
86
+ width: 100%;
87
+ height: 30px;
88
+ line-height: 30px;
89
+ color: $red-6;
90
+ font: {
91
+ size: 18px;
92
+ weight: 700;
93
+ }
94
+ margin: {
95
+ left: $caution-margin-left;
96
+ bottom: 16px;
97
+ }
98
+ }
99
+ }
86
100
  </style>
@@ -1,29 +1,70 @@
1
1
  <template>
2
2
  <q-chip
3
- class="row items-center text-color-grey-2 s-chip"
3
+ class="no-hover row items-center text-color-grey-2 s-chip"
4
4
  square
5
5
  removable
6
6
  outline
7
7
  dense
8
+ :clickable="useInput"
8
9
  color="grey-6"
9
10
  :ripple="false"
10
11
  :icon-remove="chipRemoveIcon"
12
+ v-model="model"
11
13
  >
14
+ <template v-if="useInput">
15
+ <span
16
+ class="s-chip-input"
17
+ role="textbox"
18
+ id="inputSpan"
19
+ v-bind:contenteditable="useInput"
20
+ @keypress="handleInput"
21
+ >{{ inputValue }}</span>
22
+ </template>
12
23
  <slot></slot>
13
24
  </q-chip>
14
25
  </template>
15
26
 
16
27
  <script>
17
- import { defineComponent } from 'vue';
28
+ import { defineComponent, ref, watch } from 'vue';
18
29
  import { QChip } from 'quasar';
19
30
  import { chipRemoveIcon } from '../assets/icons.js';
20
31
 
21
32
  export default defineComponent({
22
33
  name: 'SChip',
23
34
  components: { QChip },
24
- setup() {
35
+ props: {
36
+ useInput: { type: Boolean, default: false },
37
+ modelValue: { type: Boolean, default: false },
38
+ input: { type: String, default: '' },
39
+ },
40
+ setup(props, { emit }) {
41
+ const model = ref(props.modelValue);
42
+ watch(
43
+ () => props.modelValue,
44
+ (val) => {
45
+ model.value = val;
46
+ },
47
+ );
48
+ const inputValue = ref(props.input);
49
+ watch(
50
+ () => props.input,
51
+ (val) => {
52
+ inputValue.value = val;
53
+ },
54
+ );
55
+ function handleInput(event) {
56
+ inputValue.value = event.target.outerText;
57
+ if (event.key === 'Enter') {
58
+ event.preventDefault();
59
+ event.target.blur();
60
+ emit('update:input', inputValue.value);
61
+ }
62
+ }
25
63
  return {
26
64
  chipRemoveIcon,
65
+ model,
66
+ inputValue,
67
+ handleInput,
27
68
  };
28
69
  },
29
70
  });
@@ -49,7 +90,6 @@ export default defineComponent({
49
90
  font-weight: $default-font-weight;
50
91
  height: $default-content-height;
51
92
  min-height: $default-content-height;
52
-
53
93
  }
54
94
  .q-chip__icon--remove {
55
95
  color: $grey-2;
@@ -58,4 +98,11 @@ export default defineComponent({
58
98
  margin-left: $default-icon-margin;
59
99
  }
60
100
  }
101
+ .s-chip-input {
102
+ height: 28px;
103
+ padding: 4px 0 !important;
104
+ &:focus-visible {
105
+ outline: none;
106
+ }
107
+ }
61
108
  </style>
@@ -5,16 +5,26 @@
5
5
  hide-pagination
6
6
  hide-selected-banner
7
7
  class="s-table"
8
- :class="{ 's-select-table': useSelect, 'resizable-table': resizable, 'sticky-resizable-table': stickyResizable, 'sticky-header': stickyHeader, 'before-search': beforeSearch }"
8
+ :class="{
9
+ 's-select-table': useSelect,
10
+ 'resizable-table': resizable,
11
+ 'sticky-resizable-table': stickyResizable,
12
+ 'sticky-header': stickyHeader,
13
+ 'before-search': beforeSearch,
14
+ }"
9
15
  :table-class="{ 'resizable-table': resizable }"
10
16
  :columns="columns"
11
17
  :rows="rows"
18
+ v-model:pagination="paginationModel"
19
+ :no-data-label="noDataLabel"
12
20
  ref="sTableRef"
13
21
  @selection="updateSelected"
14
22
  >
15
- <template #no-data>
16
- <slot name="noData">
17
- <div class="full-width text-center">데이터 조회가 필요합니다.</div>
23
+ <template #no-data="props">
24
+ <slot name="noData" v-bind="props">
25
+ <div class="full-width text-center">
26
+ {{ props.message }}
27
+ </div>
18
28
  </slot>
19
29
  </template>
20
30
  <template #loading>
@@ -67,6 +77,12 @@
67
77
  </slot>
68
78
  </template>
69
79
  </q-table>
80
+ <s-pagination2
81
+ v-if="!hideBottom"
82
+ v-model="paginationModel.page"
83
+ :lastPage="pagesNumber"
84
+ class="q-mt-md"
85
+ />
70
86
  </template>
71
87
 
72
88
  <script>
@@ -74,7 +90,7 @@ import {
74
90
  QTable, QInnerLoading, QTd, QIcon,
75
91
  } from 'quasar';
76
92
  import {
77
- defineComponent, onMounted, ref,
93
+ defineComponent, onMounted, ref, computed,
78
94
  } from 'vue';
79
95
  import { useResizable } from '../composables/table/use-resizable';
80
96
  import { useNavigator } from '../composables/table/use-navigator';
@@ -88,6 +104,21 @@ export default defineComponent({
88
104
  QIcon,
89
105
  },
90
106
  props: {
107
+ pagination: {
108
+ type: Object,
109
+ default: () => ({
110
+ page: 1,
111
+ rowsPerPage: 50,
112
+ }),
113
+ },
114
+ hideBottom: {
115
+ type: Boolean,
116
+ default: false,
117
+ },
118
+ noDataLabel: {
119
+ type: String,
120
+ default: '데이터 조회가 필요합니다',
121
+ },
91
122
  columns: {
92
123
  type: Array,
93
124
  default: () => [],
@@ -126,6 +157,7 @@ export default defineComponent({
126
157
  },
127
158
  },
128
159
  setup(props, { emit, attrs }) {
160
+ const paginationModel = ref(props.pagination);
129
161
  const sTableRef = ref(null);
130
162
  const {
131
163
  focusCell,
@@ -164,6 +196,8 @@ export default defineComponent({
164
196
  closeInput,
165
197
  editIcon,
166
198
  updateSelected,
199
+ paginationModel,
200
+ pagesNumber: computed(() => Math.ceil((paginationModel.value.rowsNumber || props.rows.length) / paginationModel.value.rowsPerPage)),
167
201
  };
168
202
  },
169
203
  });
@@ -233,7 +267,6 @@ export default defineComponent({
233
267
  }
234
268
  }
235
269
  .s-select-table {
236
- margin-bottom: $pagination-size;
237
270
  .q-table__middle {
238
271
  .q-table {
239
272
  thead {