quasar-ui-sellmate-ui-kit 3.0.3 → 3.0.4
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/.prettierrc +25 -25
- package/README.md +156 -156
- package/dist/index.common.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.min.css +1 -1
- package/dist/index.rtl.css +1 -1
- package/dist/index.rtl.min.css +1 -1
- package/dist/index.umd.js +3826 -3826
- package/dist/index.umd.min.js +2 -2
- package/package.json +83 -83
- 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 -77
- package/src/components/STable.vue +425 -425
- package/src/components/STableTree.vue +210 -210
- 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 -7
- package/src/index.scss +3 -3
- package/src/vue-plugin.js +91 -91
- package/tsconfig.json +35 -35
|
@@ -1,343 +1,343 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-input
|
|
3
|
-
ref="qInputRef"
|
|
4
|
-
class="s-input"
|
|
5
|
-
outlined
|
|
6
|
-
placeholder=" "
|
|
7
|
-
dense
|
|
8
|
-
:type="
|
|
9
|
-
type === 'password' && !isVisible
|
|
10
|
-
? 'password'
|
|
11
|
-
: type === 'password' && isVisible
|
|
12
|
-
? 'text'
|
|
13
|
-
: $props.type
|
|
14
|
-
"
|
|
15
|
-
:class="{
|
|
16
|
-
's-input__right-slot q-pa-none': rightSlot,
|
|
17
|
-
's-input__password': type === 'password',
|
|
18
|
-
's-input__text-area': type === 'textarea',
|
|
19
|
-
's-input__inside-label': label || insideLabel,
|
|
20
|
-
}"
|
|
21
|
-
v-model="model"
|
|
22
|
-
@update:modelValue="
|
|
23
|
-
value => {
|
|
24
|
-
rightSlot ? getValidmodel(value) : $emit('update:modelValue', value);
|
|
25
|
-
}
|
|
26
|
-
"
|
|
27
|
-
no-error-icon
|
|
28
|
-
hide-bottom-space
|
|
29
|
-
>
|
|
30
|
-
<template v-for="(_, slotName, index) in $slots" #[slotName]="data">
|
|
31
|
-
<!-- eslint-disable-next-line -->
|
|
32
|
-
<slot :key="index" :name="slotName" v-bind="data"> </slot>
|
|
33
|
-
</template>
|
|
34
|
-
<template v-slot:before v-if="label || insideLabel">
|
|
35
|
-
<div v-if="!insideLabel" class="input-label">{{ label }}</div>
|
|
36
|
-
<div v-else-if="insideLabel" class="input-addon bg-Grey_Lighten-5">
|
|
37
|
-
{{ insideLabel }}
|
|
38
|
-
</div>
|
|
39
|
-
</template>
|
|
40
|
-
<template v-slot:after v-if="rightSlot">
|
|
41
|
-
<slot name="beforeCounter"></slot>
|
|
42
|
-
<div v-if="maxByte" class="self-center">
|
|
43
|
-
{{ model ? getByte(model) : 0 }} / {{ maxByte }} byte
|
|
44
|
-
</div>
|
|
45
|
-
<div v-else class="self-center">{{ model ? getByte(model) : 0 }} byte</div>
|
|
46
|
-
</template>
|
|
47
|
-
<template v-slot:append v-if="type === 'password'">
|
|
48
|
-
<q-icon
|
|
49
|
-
size="16px"
|
|
50
|
-
:name="isVisible ? 'visibility' : 'visibility_off'"
|
|
51
|
-
@click="isVisible = !isVisible"
|
|
52
|
-
/>
|
|
53
|
-
</template>
|
|
54
|
-
</q-input>
|
|
55
|
-
</template>
|
|
56
|
-
|
|
57
|
-
<script>
|
|
58
|
-
import { ref, watch, defineComponent } from 'vue';
|
|
59
|
-
import { QInput, QIcon } from 'quasar';
|
|
60
|
-
|
|
61
|
-
export default defineComponent({
|
|
62
|
-
name: 'SInput',
|
|
63
|
-
components: {
|
|
64
|
-
QInput,
|
|
65
|
-
QIcon,
|
|
66
|
-
},
|
|
67
|
-
props: {
|
|
68
|
-
modelValue: {
|
|
69
|
-
type: [String, Number],
|
|
70
|
-
},
|
|
71
|
-
label: String,
|
|
72
|
-
insideLabel: { type: String, default: '' },
|
|
73
|
-
type: { type: String, default: 'text' },
|
|
74
|
-
rightSlot: { type: Boolean, default: false },
|
|
75
|
-
maxByte: { type: [String, Number], default: '' || 0 },
|
|
76
|
-
},
|
|
77
|
-
setup(props, { emit }) {
|
|
78
|
-
// TODO: 유효성 검사 기능 추가 필요
|
|
79
|
-
const model = ref(props.modelValue);
|
|
80
|
-
const qInputRef = ref(null);
|
|
81
|
-
watch(
|
|
82
|
-
() => props.modelValue,
|
|
83
|
-
value => {
|
|
84
|
-
model.value = value;
|
|
85
|
-
},
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
function getByteLength(decimal) {
|
|
89
|
-
const lineFeed = 10; // \n
|
|
90
|
-
return decimal >> 7 || lineFeed === decimal ? 2 : 1;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function getByte(str) {
|
|
94
|
-
return str
|
|
95
|
-
.split('')
|
|
96
|
-
.map(v => v.charCodeAt(0))
|
|
97
|
-
.reduce((prev, unicodeDecimalValue) => prev + getByteLength(unicodeDecimalValue), 0);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function getLimitedByteText(val, max) {
|
|
101
|
-
const characters = val.split('');
|
|
102
|
-
let validText = '';
|
|
103
|
-
let totalByte = 0;
|
|
104
|
-
for (let i = 0; i < characters.length; i++) {
|
|
105
|
-
const character = characters[i];
|
|
106
|
-
const decimal = character.charCodeAt(0);
|
|
107
|
-
const byte = getByteLength(decimal);
|
|
108
|
-
if (totalByte + byte <= max) {
|
|
109
|
-
totalByte += byte;
|
|
110
|
-
validText += character;
|
|
111
|
-
} else {
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return validText;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function checkValueByte(val) {
|
|
119
|
-
const value = val || '';
|
|
120
|
-
let validValue = '';
|
|
121
|
-
if (props.maxByte) {
|
|
122
|
-
const isValidByte = getByte(value) <= props.maxByte;
|
|
123
|
-
validValue = isValidByte ? value : getLimitedByteText(value, props.maxByte);
|
|
124
|
-
} else {
|
|
125
|
-
validValue = getByte(value);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return validValue;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function getValidmodel(val) {
|
|
132
|
-
const validValue = checkValueByte(val);
|
|
133
|
-
model.value = validValue;
|
|
134
|
-
emit('update:modelValue', model.value);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return {
|
|
138
|
-
isVisible: ref(false),
|
|
139
|
-
model,
|
|
140
|
-
qInputRef,
|
|
141
|
-
|
|
142
|
-
getByte,
|
|
143
|
-
checkValueByte,
|
|
144
|
-
getLimitedByteText,
|
|
145
|
-
getValidmodel,
|
|
146
|
-
};
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
</script>
|
|
150
|
-
|
|
151
|
-
<style lang="scss">
|
|
152
|
-
@import '../css/quasar.variables.scss';
|
|
153
|
-
|
|
154
|
-
.s-input {
|
|
155
|
-
height: auto;
|
|
156
|
-
width: fit-content;
|
|
157
|
-
.q-field__inner {
|
|
158
|
-
.q-field__control {
|
|
159
|
-
background: white;
|
|
160
|
-
padding: 0;
|
|
161
|
-
height: 28px;
|
|
162
|
-
&:before {
|
|
163
|
-
border: 1px solid $Grey_Lighten-1;
|
|
164
|
-
}
|
|
165
|
-
&-container {
|
|
166
|
-
padding: $button-padding-sm;
|
|
167
|
-
.q-field__native {
|
|
168
|
-
font-size: $default-font;
|
|
169
|
-
font-weight: $default-font-weight;
|
|
170
|
-
color: $Grey_Darken-4;
|
|
171
|
-
padding: 0;
|
|
172
|
-
}
|
|
173
|
-
input::placeholder {
|
|
174
|
-
color: $Grey_Lighten-1;
|
|
175
|
-
}
|
|
176
|
-
.q-field__prefix {
|
|
177
|
-
padding: 0 4px 0 0;
|
|
178
|
-
line-height: 100%;
|
|
179
|
-
}
|
|
180
|
-
.q-field__suffix {
|
|
181
|
-
padding: 0 0 0 4px;
|
|
182
|
-
line-height: 100%;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
.q-field__append {
|
|
186
|
-
padding: 0 8px 0 0;
|
|
187
|
-
height: 100%;
|
|
188
|
-
.q-icon {
|
|
189
|
-
color: $Grey_Default;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
.q-field__prepend {
|
|
193
|
-
padding: 0 0 0 8px;
|
|
194
|
-
height: $default-height;
|
|
195
|
-
.q-icon {
|
|
196
|
-
color: $Grey_Default;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
.q-field__bottom {
|
|
201
|
-
padding: 8px 0px 0px 0px;
|
|
202
|
-
color: $Grey_Darken-1;
|
|
203
|
-
font-size: 12px;
|
|
204
|
-
.q-field__messages {
|
|
205
|
-
div[role='alert'] {
|
|
206
|
-
color: $Red_Lighten-1;
|
|
207
|
-
}
|
|
208
|
-
.error-msg {
|
|
209
|
-
color: $Red_Default;
|
|
210
|
-
flex-wrap: nowrap;
|
|
211
|
-
width: 250px;
|
|
212
|
-
gap: 4px;
|
|
213
|
-
> p {
|
|
214
|
-
line-height: 14px;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
.q-field__before {
|
|
221
|
-
height: $default-height;
|
|
222
|
-
padding: 0;
|
|
223
|
-
.input-label {
|
|
224
|
-
padding: 4px 12px 4px 0;
|
|
225
|
-
color: $Grey_Darken-4;
|
|
226
|
-
font: {
|
|
227
|
-
size: $default-font;
|
|
228
|
-
weight: $default-font-weight;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
.input-addon {
|
|
232
|
-
color: $Grey_Darken-4;
|
|
233
|
-
height: 100%;
|
|
234
|
-
line-height: 150%;
|
|
235
|
-
padding: $button-padding-sm;
|
|
236
|
-
border: 1px solid $Grey_Lighten-1;
|
|
237
|
-
border: {
|
|
238
|
-
right: none;
|
|
239
|
-
radius: 2px 0 0 2px;
|
|
240
|
-
}
|
|
241
|
-
font: {
|
|
242
|
-
size: $default-font;
|
|
243
|
-
weight: $default-font-weight;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
&.q-field--disabled {
|
|
248
|
-
.q-field__inner {
|
|
249
|
-
.q-field__control {
|
|
250
|
-
opacity: 1 !important;
|
|
251
|
-
background: $Grey_Lighten-4;
|
|
252
|
-
&:after {
|
|
253
|
-
border: 1px solid $Grey_Lighten-2;
|
|
254
|
-
}
|
|
255
|
-
&-container {
|
|
256
|
-
.q-field__native {
|
|
257
|
-
color: $Grey_Default;
|
|
258
|
-
}
|
|
259
|
-
& > input::placeholder {
|
|
260
|
-
color: $Grey_Default;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.s-input__password.q-field--focused {
|
|
269
|
-
.q-field__inner {
|
|
270
|
-
.q-field__control {
|
|
271
|
-
.q-field__append {
|
|
272
|
-
.q-icon {
|
|
273
|
-
color: $positive;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.s-input__right-slot {
|
|
281
|
-
position: relative;
|
|
282
|
-
.q-field__inner {
|
|
283
|
-
.q-field__bottom {
|
|
284
|
-
padding: 0;
|
|
285
|
-
min-height: 0;
|
|
286
|
-
.q-field__counter {
|
|
287
|
-
height: 28px;
|
|
288
|
-
position: absolute;
|
|
289
|
-
right: -69px;
|
|
290
|
-
top: -28px;
|
|
291
|
-
display: flex;
|
|
292
|
-
align-items: center;
|
|
293
|
-
color: $Grey_Lighten-1;
|
|
294
|
-
padding: 0;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
.q-field__after {
|
|
299
|
-
height: 28px;
|
|
300
|
-
font-size: 12px;
|
|
301
|
-
color: $Grey_Lighten-1;
|
|
302
|
-
align-items: end;
|
|
303
|
-
padding-left: 8px;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.s-input__text-area {
|
|
308
|
-
height: auto;
|
|
309
|
-
min-width: 320px;
|
|
310
|
-
min-height: 211px;
|
|
311
|
-
.q-field__inner {
|
|
312
|
-
.q-field__control {
|
|
313
|
-
height: 100%;
|
|
314
|
-
&-container {
|
|
315
|
-
padding: 12px 16px !important;
|
|
316
|
-
height: 100%;
|
|
317
|
-
textarea {
|
|
318
|
-
min-height: 211px;
|
|
319
|
-
padding: 4px 12px - 3px 4px - 3px 12px;
|
|
320
|
-
line-height: $default-line-height;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
.q-field__bottom {
|
|
325
|
-
padding: 0;
|
|
326
|
-
padding-top: 4px;
|
|
327
|
-
.q-field__counter {
|
|
328
|
-
padding: 0;
|
|
329
|
-
color: $Grey_Lighten-2;
|
|
330
|
-
font-size: 12px;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.s-input__inside-label {
|
|
337
|
-
.q-field__inner {
|
|
338
|
-
.q-field__control {
|
|
339
|
-
border-radius: 0 2px 2px 0;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<q-input
|
|
3
|
+
ref="qInputRef"
|
|
4
|
+
class="s-input"
|
|
5
|
+
outlined
|
|
6
|
+
placeholder=" "
|
|
7
|
+
dense
|
|
8
|
+
:type="
|
|
9
|
+
type === 'password' && !isVisible
|
|
10
|
+
? 'password'
|
|
11
|
+
: type === 'password' && isVisible
|
|
12
|
+
? 'text'
|
|
13
|
+
: $props.type
|
|
14
|
+
"
|
|
15
|
+
:class="{
|
|
16
|
+
's-input__right-slot q-pa-none': rightSlot,
|
|
17
|
+
's-input__password': type === 'password',
|
|
18
|
+
's-input__text-area': type === 'textarea',
|
|
19
|
+
's-input__inside-label': label || insideLabel,
|
|
20
|
+
}"
|
|
21
|
+
v-model="model"
|
|
22
|
+
@update:modelValue="
|
|
23
|
+
value => {
|
|
24
|
+
rightSlot ? getValidmodel(value) : $emit('update:modelValue', value);
|
|
25
|
+
}
|
|
26
|
+
"
|
|
27
|
+
no-error-icon
|
|
28
|
+
hide-bottom-space
|
|
29
|
+
>
|
|
30
|
+
<template v-for="(_, slotName, index) in $slots" #[slotName]="data">
|
|
31
|
+
<!-- eslint-disable-next-line -->
|
|
32
|
+
<slot :key="index" :name="slotName" v-bind="data"> </slot>
|
|
33
|
+
</template>
|
|
34
|
+
<template v-slot:before v-if="label || insideLabel">
|
|
35
|
+
<div v-if="!insideLabel" class="input-label">{{ label }}</div>
|
|
36
|
+
<div v-else-if="insideLabel" class="input-addon bg-Grey_Lighten-5">
|
|
37
|
+
{{ insideLabel }}
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
<template v-slot:after v-if="rightSlot">
|
|
41
|
+
<slot name="beforeCounter"></slot>
|
|
42
|
+
<div v-if="maxByte" class="self-center">
|
|
43
|
+
{{ model ? getByte(model) : 0 }} / {{ maxByte }} byte
|
|
44
|
+
</div>
|
|
45
|
+
<div v-else class="self-center">{{ model ? getByte(model) : 0 }} byte</div>
|
|
46
|
+
</template>
|
|
47
|
+
<template v-slot:append v-if="type === 'password'">
|
|
48
|
+
<q-icon
|
|
49
|
+
size="16px"
|
|
50
|
+
:name="isVisible ? 'visibility' : 'visibility_off'"
|
|
51
|
+
@click="isVisible = !isVisible"
|
|
52
|
+
/>
|
|
53
|
+
</template>
|
|
54
|
+
</q-input>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script>
|
|
58
|
+
import { ref, watch, defineComponent } from 'vue';
|
|
59
|
+
import { QInput, QIcon } from 'quasar';
|
|
60
|
+
|
|
61
|
+
export default defineComponent({
|
|
62
|
+
name: 'SInput',
|
|
63
|
+
components: {
|
|
64
|
+
QInput,
|
|
65
|
+
QIcon,
|
|
66
|
+
},
|
|
67
|
+
props: {
|
|
68
|
+
modelValue: {
|
|
69
|
+
type: [String, Number],
|
|
70
|
+
},
|
|
71
|
+
label: String,
|
|
72
|
+
insideLabel: { type: String, default: '' },
|
|
73
|
+
type: { type: String, default: 'text' },
|
|
74
|
+
rightSlot: { type: Boolean, default: false },
|
|
75
|
+
maxByte: { type: [String, Number], default: '' || 0 },
|
|
76
|
+
},
|
|
77
|
+
setup(props, { emit }) {
|
|
78
|
+
// TODO: 유효성 검사 기능 추가 필요
|
|
79
|
+
const model = ref(props.modelValue);
|
|
80
|
+
const qInputRef = ref(null);
|
|
81
|
+
watch(
|
|
82
|
+
() => props.modelValue,
|
|
83
|
+
value => {
|
|
84
|
+
model.value = value;
|
|
85
|
+
},
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
function getByteLength(decimal) {
|
|
89
|
+
const lineFeed = 10; // \n
|
|
90
|
+
return decimal >> 7 || lineFeed === decimal ? 2 : 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function getByte(str) {
|
|
94
|
+
return str
|
|
95
|
+
.split('')
|
|
96
|
+
.map(v => v.charCodeAt(0))
|
|
97
|
+
.reduce((prev, unicodeDecimalValue) => prev + getByteLength(unicodeDecimalValue), 0);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function getLimitedByteText(val, max) {
|
|
101
|
+
const characters = val.split('');
|
|
102
|
+
let validText = '';
|
|
103
|
+
let totalByte = 0;
|
|
104
|
+
for (let i = 0; i < characters.length; i++) {
|
|
105
|
+
const character = characters[i];
|
|
106
|
+
const decimal = character.charCodeAt(0);
|
|
107
|
+
const byte = getByteLength(decimal);
|
|
108
|
+
if (totalByte + byte <= max) {
|
|
109
|
+
totalByte += byte;
|
|
110
|
+
validText += character;
|
|
111
|
+
} else {
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return validText;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function checkValueByte(val) {
|
|
119
|
+
const value = val || '';
|
|
120
|
+
let validValue = '';
|
|
121
|
+
if (props.maxByte) {
|
|
122
|
+
const isValidByte = getByte(value) <= props.maxByte;
|
|
123
|
+
validValue = isValidByte ? value : getLimitedByteText(value, props.maxByte);
|
|
124
|
+
} else {
|
|
125
|
+
validValue = getByte(value);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return validValue;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function getValidmodel(val) {
|
|
132
|
+
const validValue = checkValueByte(val);
|
|
133
|
+
model.value = validValue;
|
|
134
|
+
emit('update:modelValue', model.value);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
isVisible: ref(false),
|
|
139
|
+
model,
|
|
140
|
+
qInputRef,
|
|
141
|
+
|
|
142
|
+
getByte,
|
|
143
|
+
checkValueByte,
|
|
144
|
+
getLimitedByteText,
|
|
145
|
+
getValidmodel,
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
</script>
|
|
150
|
+
|
|
151
|
+
<style lang="scss">
|
|
152
|
+
@import '../css/quasar.variables.scss';
|
|
153
|
+
|
|
154
|
+
.s-input {
|
|
155
|
+
height: auto;
|
|
156
|
+
width: fit-content;
|
|
157
|
+
.q-field__inner {
|
|
158
|
+
.q-field__control {
|
|
159
|
+
background: white;
|
|
160
|
+
padding: 0;
|
|
161
|
+
height: 28px;
|
|
162
|
+
&:before {
|
|
163
|
+
border: 1px solid $Grey_Lighten-1;
|
|
164
|
+
}
|
|
165
|
+
&-container {
|
|
166
|
+
padding: $button-padding-sm;
|
|
167
|
+
.q-field__native {
|
|
168
|
+
font-size: $default-font;
|
|
169
|
+
font-weight: $default-font-weight;
|
|
170
|
+
color: $Grey_Darken-4;
|
|
171
|
+
padding: 0;
|
|
172
|
+
}
|
|
173
|
+
input::placeholder {
|
|
174
|
+
color: $Grey_Lighten-1;
|
|
175
|
+
}
|
|
176
|
+
.q-field__prefix {
|
|
177
|
+
padding: 0 4px 0 0;
|
|
178
|
+
line-height: 100%;
|
|
179
|
+
}
|
|
180
|
+
.q-field__suffix {
|
|
181
|
+
padding: 0 0 0 4px;
|
|
182
|
+
line-height: 100%;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
.q-field__append {
|
|
186
|
+
padding: 0 8px 0 0;
|
|
187
|
+
height: 100%;
|
|
188
|
+
.q-icon {
|
|
189
|
+
color: $Grey_Default;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
.q-field__prepend {
|
|
193
|
+
padding: 0 0 0 8px;
|
|
194
|
+
height: $default-height;
|
|
195
|
+
.q-icon {
|
|
196
|
+
color: $Grey_Default;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
.q-field__bottom {
|
|
201
|
+
padding: 8px 0px 0px 0px;
|
|
202
|
+
color: $Grey_Darken-1;
|
|
203
|
+
font-size: 12px;
|
|
204
|
+
.q-field__messages {
|
|
205
|
+
div[role='alert'] {
|
|
206
|
+
color: $Red_Lighten-1;
|
|
207
|
+
}
|
|
208
|
+
.error-msg {
|
|
209
|
+
color: $Red_Default;
|
|
210
|
+
flex-wrap: nowrap;
|
|
211
|
+
width: 250px;
|
|
212
|
+
gap: 4px;
|
|
213
|
+
> p {
|
|
214
|
+
line-height: 14px;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
.q-field__before {
|
|
221
|
+
height: $default-height;
|
|
222
|
+
padding: 0;
|
|
223
|
+
.input-label {
|
|
224
|
+
padding: 4px 12px 4px 0;
|
|
225
|
+
color: $Grey_Darken-4;
|
|
226
|
+
font: {
|
|
227
|
+
size: $default-font;
|
|
228
|
+
weight: $default-font-weight;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
.input-addon {
|
|
232
|
+
color: $Grey_Darken-4;
|
|
233
|
+
height: 100%;
|
|
234
|
+
line-height: 150%;
|
|
235
|
+
padding: $button-padding-sm;
|
|
236
|
+
border: 1px solid $Grey_Lighten-1;
|
|
237
|
+
border: {
|
|
238
|
+
right: none;
|
|
239
|
+
radius: 2px 0 0 2px;
|
|
240
|
+
}
|
|
241
|
+
font: {
|
|
242
|
+
size: $default-font;
|
|
243
|
+
weight: $default-font-weight;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
&.q-field--disabled {
|
|
248
|
+
.q-field__inner {
|
|
249
|
+
.q-field__control {
|
|
250
|
+
opacity: 1 !important;
|
|
251
|
+
background: $Grey_Lighten-4;
|
|
252
|
+
&:after {
|
|
253
|
+
border: 1px solid $Grey_Lighten-2;
|
|
254
|
+
}
|
|
255
|
+
&-container {
|
|
256
|
+
.q-field__native {
|
|
257
|
+
color: $Grey_Default;
|
|
258
|
+
}
|
|
259
|
+
& > input::placeholder {
|
|
260
|
+
color: $Grey_Default;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.s-input__password.q-field--focused {
|
|
269
|
+
.q-field__inner {
|
|
270
|
+
.q-field__control {
|
|
271
|
+
.q-field__append {
|
|
272
|
+
.q-icon {
|
|
273
|
+
color: $positive;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.s-input__right-slot {
|
|
281
|
+
position: relative;
|
|
282
|
+
.q-field__inner {
|
|
283
|
+
.q-field__bottom {
|
|
284
|
+
padding: 0;
|
|
285
|
+
min-height: 0;
|
|
286
|
+
.q-field__counter {
|
|
287
|
+
height: 28px;
|
|
288
|
+
position: absolute;
|
|
289
|
+
right: -69px;
|
|
290
|
+
top: -28px;
|
|
291
|
+
display: flex;
|
|
292
|
+
align-items: center;
|
|
293
|
+
color: $Grey_Lighten-1;
|
|
294
|
+
padding: 0;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
.q-field__after {
|
|
299
|
+
height: 28px;
|
|
300
|
+
font-size: 12px;
|
|
301
|
+
color: $Grey_Lighten-1;
|
|
302
|
+
align-items: end;
|
|
303
|
+
padding-left: 8px;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.s-input__text-area {
|
|
308
|
+
height: auto;
|
|
309
|
+
min-width: 320px;
|
|
310
|
+
min-height: 211px;
|
|
311
|
+
.q-field__inner {
|
|
312
|
+
.q-field__control {
|
|
313
|
+
height: 100%;
|
|
314
|
+
&-container {
|
|
315
|
+
padding: 12px 16px !important;
|
|
316
|
+
height: 100%;
|
|
317
|
+
textarea {
|
|
318
|
+
min-height: 211px;
|
|
319
|
+
padding: 4px 12px - 3px 4px - 3px 12px;
|
|
320
|
+
line-height: $default-line-height;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
.q-field__bottom {
|
|
325
|
+
padding: 0;
|
|
326
|
+
padding-top: 4px;
|
|
327
|
+
.q-field__counter {
|
|
328
|
+
padding: 0;
|
|
329
|
+
color: $Grey_Lighten-2;
|
|
330
|
+
font-size: 12px;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.s-input__inside-label {
|
|
337
|
+
.q-field__inner {
|
|
338
|
+
.q-field__control {
|
|
339
|
+
border-radius: 0 2px 2px 0;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
</style>
|