quasar-ui-sellmate-ui-kit 2.3.1 → 3.0.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/.eslintrc.cjs +73 -0
- package/.prettierrc +25 -0
- package/README.md +156 -142
- package/dist/index.common.js +2 -2
- package/dist/index.css +3 -8
- package/dist/index.esm.js +2 -2
- package/dist/index.min.css +2 -2
- package/dist/index.rtl.css +3 -8
- package/dist/index.rtl.min.css +2 -2
- package/dist/index.umd.js +3821 -3823
- package/dist/index.umd.min.js +2 -2
- package/package.json +83 -75
- package/src/assets/icons.js +28 -28
- package/src/components/SBreadcrumbs.vue +55 -55
- package/src/components/SButton.vue +206 -206
- package/src/components/SButtonGroup.vue +41 -41
- package/src/components/SButtonToggle.vue +200 -200
- package/src/components/SCaution.vue +102 -102
- package/src/components/SCheckbox.vue +123 -123
- package/src/components/SChip.vue +99 -99
- package/src/components/SDate.vue +717 -717
- package/src/components/SDateAutoRangePicker.vue +341 -341
- package/src/components/SDatePicker.vue +472 -472
- package/src/components/SDateRange.vue +470 -470
- package/src/components/SDateRangePicker.vue +660 -660
- package/src/components/SDateTimePicker.vue +349 -349
- package/src/components/SDialog.vue +250 -250
- package/src/components/SDropdown.vue +216 -216
- package/src/components/SEditor.vue +490 -490
- package/src/components/SFilePicker.vue +207 -207
- package/src/components/SHelp.vue +146 -146
- package/src/components/SInput.vue +343 -343
- package/src/components/SInputCounter.vue +46 -46
- package/src/components/SInputNumber.vue +179 -179
- package/src/components/SList.vue +29 -29
- package/src/components/SMarkupTable.vue +141 -141
- package/src/components/SPagination.vue +266 -266
- package/src/components/SRadio.vue +78 -78
- package/src/components/SRouteTab.vue +67 -67
- package/src/components/SSelect.vue +294 -294
- package/src/components/SSelectCheckbox.vue +222 -222
- package/src/components/SSelectCustom.vue +189 -189
- package/src/components/SSelectGroupCheckbox.vue +235 -235
- package/src/components/SSelectSearch.vue +261 -261
- package/src/components/SSelectSearchAutoComplete.vue +172 -172
- package/src/components/SSelectSearchCheckbox.vue +356 -356
- package/src/components/SStringToInput.vue +66 -66
- package/src/components/STab.vue +77 -80
- package/src/components/STable.vue +425 -425
- package/src/components/STableTree.vue +210 -208
- package/src/components/STabs.vue +32 -32
- package/src/components/STimePicker.vue +159 -159
- package/src/components/SToggle.vue +68 -68
- package/src/components/STooltip.vue +209 -209
- package/src/components/SelelctItem.vue +21 -21
- package/src/components/TimePickerCard.vue +352 -352
- package/src/composables/date.js +11 -11
- package/src/composables/modelBinder.js +13 -13
- package/src/composables/table/use-navigator.js +110 -110
- package/src/composables/table/use-resizable.js +80 -80
- package/src/css/app.scss +90 -90
- package/src/css/default.scss +875 -875
- package/src/css/extends.scss +154 -154
- package/src/css/quasar.variables.scss +189 -189
- package/src/directives/Directive.js +7 -8
- package/src/index.scss +3 -9
- package/src/vue-plugin.js +91 -92
- package/tsconfig.json +35 -0
|
@@ -1,189 +1,189 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-select
|
|
3
|
-
outlined
|
|
4
|
-
dense
|
|
5
|
-
options-dense
|
|
6
|
-
:dropdown-icon="selectDownArrowIcon"
|
|
7
|
-
popup-content-class="s-select-group-opts"
|
|
8
|
-
class="s-select-custom"
|
|
9
|
-
ref="sSelectRef"
|
|
10
|
-
:options="filteredOptions"
|
|
11
|
-
:use-input="searchable && !model"
|
|
12
|
-
:input-debounce="searchable ? 0 : 300"
|
|
13
|
-
@filter="filterFn"
|
|
14
|
-
:optionLabel="optionLabel"
|
|
15
|
-
:optionValue="optionValue"
|
|
16
|
-
v-model="model"
|
|
17
|
-
:rules="rules"
|
|
18
|
-
no-error-icon
|
|
19
|
-
hide-bottom-space
|
|
20
|
-
:menu-offset="[0, 4]"
|
|
21
|
-
menu-self="top left"
|
|
22
|
-
menu-anchor="bottom start"
|
|
23
|
-
>
|
|
24
|
-
<!-- FIXME: $slot for in 을 사용하면 오류 발생,
|
|
25
|
-
default slot으로 현재 custom select 사용 중,
|
|
26
|
-
selected-item에 선택하지 않아도 값이 들어가있고, scope를 읽어올 수 없음.
|
|
27
|
-
모든 슬롯을 for문으로 돌고 있기 때문으로 예상됨 -->
|
|
28
|
-
<!-- <template v-for="(_, slotName, index) in $slots" #[slotName]="data"> -->
|
|
29
|
-
<!-- eslint-disable-next-line -->
|
|
30
|
-
<!-- <slot :key="index" :name="slotName" v-bind="data"> </slot> -->
|
|
31
|
-
<!-- </template> -->
|
|
32
|
-
<template #prepend v-if="icon.name">
|
|
33
|
-
<q-icon :name="icon.name" :size="icon.size || '20px'" />
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<template #option="scope">
|
|
37
|
-
<slot name="option" v-bind="scope"></slot>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<template #selected="scope">
|
|
41
|
-
<slot name="selected" v-bind="scope"></slot>
|
|
42
|
-
</template>
|
|
43
|
-
|
|
44
|
-
<template #selected-item="scope">
|
|
45
|
-
<slot name="selected-item" v-bind="scope"></slot>
|
|
46
|
-
</template>
|
|
47
|
-
|
|
48
|
-
<template #no-option>
|
|
49
|
-
<q-item class="s-select-no-option">
|
|
50
|
-
<q-item-section class="text-grey">{{ noOptionLabel }}</q-item-section>
|
|
51
|
-
</q-item>
|
|
52
|
-
</template>
|
|
53
|
-
|
|
54
|
-
<template v-if="model && clearable" #append>
|
|
55
|
-
<q-icon
|
|
56
|
-
name="cancel"
|
|
57
|
-
@click.stop.prevent="model = null"
|
|
58
|
-
class="cursor-pointer clear-btn font-14-400"
|
|
59
|
-
style="margin-right: -8px"
|
|
60
|
-
/>
|
|
61
|
-
</template>
|
|
62
|
-
|
|
63
|
-
<template #hint v-if="!rules">
|
|
64
|
-
<slot name="hint"></slot>
|
|
65
|
-
</template>
|
|
66
|
-
|
|
67
|
-
<template #error>
|
|
68
|
-
<slot name="error"></slot>
|
|
69
|
-
</template>
|
|
70
|
-
</q-select>
|
|
71
|
-
</template>
|
|
72
|
-
|
|
73
|
-
<script>
|
|
74
|
-
import { defineComponent, ref, watch, computed } from 'vue';
|
|
75
|
-
import {
|
|
76
|
-
QSelect, QItem, QItemSection, QIcon,
|
|
77
|
-
} from 'quasar';
|
|
78
|
-
import { selectDownArrowIcon } from '../assets/icons.js';
|
|
79
|
-
|
|
80
|
-
export default defineComponent({
|
|
81
|
-
name: 'SSelectCustom',
|
|
82
|
-
components: {
|
|
83
|
-
QSelect,
|
|
84
|
-
QItem,
|
|
85
|
-
QItemSection,
|
|
86
|
-
QIcon,
|
|
87
|
-
},
|
|
88
|
-
props: {
|
|
89
|
-
rules: Array,
|
|
90
|
-
searchable: Boolean,
|
|
91
|
-
options: Array,
|
|
92
|
-
clearable: Boolean,
|
|
93
|
-
modelValue: [String, Number, Object, null],
|
|
94
|
-
noOptionLabel: {
|
|
95
|
-
type: String,
|
|
96
|
-
default: 'No results',
|
|
97
|
-
},
|
|
98
|
-
optionLabel: {
|
|
99
|
-
type: String,
|
|
100
|
-
default: 'label',
|
|
101
|
-
},
|
|
102
|
-
optionValue: {
|
|
103
|
-
type: String,
|
|
104
|
-
default: 'value',
|
|
105
|
-
},
|
|
106
|
-
icon: {
|
|
107
|
-
type: Object,
|
|
108
|
-
default: () => ({
|
|
109
|
-
name: '',
|
|
110
|
-
size: '20px;',
|
|
111
|
-
}),
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
setup(props, { emit }) {
|
|
115
|
-
const model = computed({
|
|
116
|
-
get() {
|
|
117
|
-
return props.modelValue;
|
|
118
|
-
},
|
|
119
|
-
set(newValue) {
|
|
120
|
-
emit('update:model-value', newValue);
|
|
121
|
-
},
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
const sSelectRef = ref(null);
|
|
125
|
-
const filteredOptions = ref(props.options);
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* @param {string} val
|
|
129
|
-
* @returns {typeof props.options[]}
|
|
130
|
-
*/
|
|
131
|
-
function filterFn(val, update) {
|
|
132
|
-
if (!val) {
|
|
133
|
-
update(() => {
|
|
134
|
-
sSelectRef.value.refresh();
|
|
135
|
-
filteredOptions.value = props.options;
|
|
136
|
-
});
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
update(() => {
|
|
141
|
-
filteredOptions.value = props.options.filter((v) => {
|
|
142
|
-
const optionValue = String(v[props.optionLabel]).toLowerCase().replace(/\s/g, '');
|
|
143
|
-
const normalizedSearchValue = val.toLowerCase().replace(/\s/g, '');
|
|
144
|
-
return optionValue.includes(normalizedSearchValue);
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
watch(
|
|
150
|
-
() => props.options,
|
|
151
|
-
(newValue) => {
|
|
152
|
-
filteredOptions.value = newValue;
|
|
153
|
-
sSelectRef.value.refresh();
|
|
154
|
-
},
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
return {
|
|
158
|
-
selectDownArrowIcon,
|
|
159
|
-
sSelectRef,
|
|
160
|
-
filteredOptions,
|
|
161
|
-
filterFn,
|
|
162
|
-
model,
|
|
163
|
-
};
|
|
164
|
-
},
|
|
165
|
-
});
|
|
166
|
-
</script>
|
|
167
|
-
|
|
168
|
-
<style lang="scss">
|
|
169
|
-
@import "../css/extends.scss";
|
|
170
|
-
@import "../css/quasar.variables.scss";
|
|
171
|
-
|
|
172
|
-
.s-select-custom {
|
|
173
|
-
@extend %select;
|
|
174
|
-
>.q-field__inner {
|
|
175
|
-
.q-field__prepend {
|
|
176
|
-
padding: 0 0 0 8px;
|
|
177
|
-
}
|
|
178
|
-
.q-field__prepend + .q-field__control-container {
|
|
179
|
-
.q-field__native {
|
|
180
|
-
padding-left: 8px !important;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.s-select-group-opts {
|
|
187
|
-
@extend %select-menu-list;
|
|
188
|
-
}
|
|
189
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<q-select
|
|
3
|
+
outlined
|
|
4
|
+
dense
|
|
5
|
+
options-dense
|
|
6
|
+
:dropdown-icon="selectDownArrowIcon"
|
|
7
|
+
popup-content-class="s-select-group-opts"
|
|
8
|
+
class="s-select-custom"
|
|
9
|
+
ref="sSelectRef"
|
|
10
|
+
:options="filteredOptions"
|
|
11
|
+
:use-input="searchable && !model"
|
|
12
|
+
:input-debounce="searchable ? 0 : 300"
|
|
13
|
+
@filter="filterFn"
|
|
14
|
+
:optionLabel="optionLabel"
|
|
15
|
+
:optionValue="optionValue"
|
|
16
|
+
v-model="model"
|
|
17
|
+
:rules="rules"
|
|
18
|
+
no-error-icon
|
|
19
|
+
hide-bottom-space
|
|
20
|
+
:menu-offset="[0, 4]"
|
|
21
|
+
menu-self="top left"
|
|
22
|
+
menu-anchor="bottom start"
|
|
23
|
+
>
|
|
24
|
+
<!-- FIXME: $slot for in 을 사용하면 오류 발생,
|
|
25
|
+
default slot으로 현재 custom select 사용 중,
|
|
26
|
+
selected-item에 선택하지 않아도 값이 들어가있고, scope를 읽어올 수 없음.
|
|
27
|
+
모든 슬롯을 for문으로 돌고 있기 때문으로 예상됨 -->
|
|
28
|
+
<!-- <template v-for="(_, slotName, index) in $slots" #[slotName]="data"> -->
|
|
29
|
+
<!-- eslint-disable-next-line -->
|
|
30
|
+
<!-- <slot :key="index" :name="slotName" v-bind="data"> </slot> -->
|
|
31
|
+
<!-- </template> -->
|
|
32
|
+
<template #prepend v-if="icon.name">
|
|
33
|
+
<q-icon :name="icon.name" :size="icon.size || '20px'" />
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<template #option="scope">
|
|
37
|
+
<slot name="option" v-bind="scope"></slot>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<template #selected="scope">
|
|
41
|
+
<slot name="selected" v-bind="scope"></slot>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<template #selected-item="scope">
|
|
45
|
+
<slot name="selected-item" v-bind="scope"></slot>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<template #no-option>
|
|
49
|
+
<q-item class="s-select-no-option">
|
|
50
|
+
<q-item-section class="text-grey">{{ noOptionLabel }}</q-item-section>
|
|
51
|
+
</q-item>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<template v-if="model && clearable" #append>
|
|
55
|
+
<q-icon
|
|
56
|
+
name="cancel"
|
|
57
|
+
@click.stop.prevent="model = null"
|
|
58
|
+
class="cursor-pointer clear-btn font-14-400"
|
|
59
|
+
style="margin-right: -8px"
|
|
60
|
+
/>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<template #hint v-if="!rules">
|
|
64
|
+
<slot name="hint"></slot>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<template #error>
|
|
68
|
+
<slot name="error"></slot>
|
|
69
|
+
</template>
|
|
70
|
+
</q-select>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<script>
|
|
74
|
+
import { defineComponent, ref, watch, computed } from 'vue';
|
|
75
|
+
import {
|
|
76
|
+
QSelect, QItem, QItemSection, QIcon,
|
|
77
|
+
} from 'quasar';
|
|
78
|
+
import { selectDownArrowIcon } from '../assets/icons.js';
|
|
79
|
+
|
|
80
|
+
export default defineComponent({
|
|
81
|
+
name: 'SSelectCustom',
|
|
82
|
+
components: {
|
|
83
|
+
QSelect,
|
|
84
|
+
QItem,
|
|
85
|
+
QItemSection,
|
|
86
|
+
QIcon,
|
|
87
|
+
},
|
|
88
|
+
props: {
|
|
89
|
+
rules: Array,
|
|
90
|
+
searchable: Boolean,
|
|
91
|
+
options: Array,
|
|
92
|
+
clearable: Boolean,
|
|
93
|
+
modelValue: [String, Number, Object, null],
|
|
94
|
+
noOptionLabel: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: 'No results',
|
|
97
|
+
},
|
|
98
|
+
optionLabel: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: 'label',
|
|
101
|
+
},
|
|
102
|
+
optionValue: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: 'value',
|
|
105
|
+
},
|
|
106
|
+
icon: {
|
|
107
|
+
type: Object,
|
|
108
|
+
default: () => ({
|
|
109
|
+
name: '',
|
|
110
|
+
size: '20px;',
|
|
111
|
+
}),
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
setup(props, { emit }) {
|
|
115
|
+
const model = computed({
|
|
116
|
+
get() {
|
|
117
|
+
return props.modelValue;
|
|
118
|
+
},
|
|
119
|
+
set(newValue) {
|
|
120
|
+
emit('update:model-value', newValue);
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const sSelectRef = ref(null);
|
|
125
|
+
const filteredOptions = ref(props.options);
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @param {string} val
|
|
129
|
+
* @returns {typeof props.options[]}
|
|
130
|
+
*/
|
|
131
|
+
function filterFn(val, update) {
|
|
132
|
+
if (!val) {
|
|
133
|
+
update(() => {
|
|
134
|
+
sSelectRef.value.refresh();
|
|
135
|
+
filteredOptions.value = props.options;
|
|
136
|
+
});
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
update(() => {
|
|
141
|
+
filteredOptions.value = props.options.filter((v) => {
|
|
142
|
+
const optionValue = String(v[props.optionLabel]).toLowerCase().replace(/\s/g, '');
|
|
143
|
+
const normalizedSearchValue = val.toLowerCase().replace(/\s/g, '');
|
|
144
|
+
return optionValue.includes(normalizedSearchValue);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
watch(
|
|
150
|
+
() => props.options,
|
|
151
|
+
(newValue) => {
|
|
152
|
+
filteredOptions.value = newValue;
|
|
153
|
+
sSelectRef.value.refresh();
|
|
154
|
+
},
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
selectDownArrowIcon,
|
|
159
|
+
sSelectRef,
|
|
160
|
+
filteredOptions,
|
|
161
|
+
filterFn,
|
|
162
|
+
model,
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
</script>
|
|
167
|
+
|
|
168
|
+
<style lang="scss">
|
|
169
|
+
@import "../css/extends.scss";
|
|
170
|
+
@import "../css/quasar.variables.scss";
|
|
171
|
+
|
|
172
|
+
.s-select-custom {
|
|
173
|
+
@extend %select;
|
|
174
|
+
>.q-field__inner {
|
|
175
|
+
.q-field__prepend {
|
|
176
|
+
padding: 0 0 0 8px;
|
|
177
|
+
}
|
|
178
|
+
.q-field__prepend + .q-field__control-container {
|
|
179
|
+
.q-field__native {
|
|
180
|
+
padding-left: 8px !important;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.s-select-group-opts {
|
|
187
|
+
@extend %select-menu-list;
|
|
188
|
+
}
|
|
189
|
+
</style>
|