its_ui_vite 1.1.0 → 1.1.2
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
package/src/assets/js/helpers.js
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
<div
|
|
38
|
+
v-if="showTime"
|
|
38
39
|
ref="time"
|
|
39
40
|
:class="['c-datepicker__time_wrap', { open: isOpenTime }]"
|
|
40
41
|
>
|
|
@@ -60,7 +61,10 @@
|
|
|
60
61
|
@blur="setIsOpenTime(false)"
|
|
61
62
|
/>
|
|
62
63
|
</div>
|
|
63
|
-
<Teleport
|
|
64
|
+
<Teleport
|
|
65
|
+
v-if="showTime"
|
|
66
|
+
:to="teleportTo"
|
|
67
|
+
>
|
|
64
68
|
<div
|
|
65
69
|
class="c-datepicker__time_list-wrap"
|
|
66
70
|
ref="timeContent"
|
|
@@ -206,6 +210,7 @@ import { computed, ref, watch, onMounted, onUnmounted, Teleport } from 'vue';
|
|
|
206
210
|
|
|
207
211
|
type TProps = {
|
|
208
212
|
date?: string,
|
|
213
|
+
showTime: boolean,
|
|
209
214
|
locale?: 'rus' | 'usa' | 'tur' | 'spa',
|
|
210
215
|
max?: string,
|
|
211
216
|
min?: string,
|
|
@@ -217,6 +222,7 @@ type TProps = {
|
|
|
217
222
|
|
|
218
223
|
const props = withDefaults(defineProps<TProps>(), {
|
|
219
224
|
locale: 'rus',
|
|
225
|
+
showTime: true,
|
|
220
226
|
isOpen: false,
|
|
221
227
|
width: '100%',
|
|
222
228
|
modelValue: () => [],
|
|
@@ -754,6 +760,8 @@ $timeWidth: 54px;
|
|
|
754
760
|
&_wrap {
|
|
755
761
|
position: relative;
|
|
756
762
|
|
|
763
|
+
flex-grow: 1;
|
|
764
|
+
|
|
757
765
|
cursor: pointer;
|
|
758
766
|
|
|
759
767
|
&.open,
|
|
@@ -263,12 +263,12 @@ watch(() => props.modelValue, (options: any[]) => {
|
|
|
263
263
|
|
|
264
264
|
props.options.forEach((group) => {
|
|
265
265
|
group.options?.forEach((item) => {
|
|
266
|
-
const option = options.find((modelValueItem) => [modelValueItem, modelValueItem
|
|
266
|
+
const option = options.find((modelValueItem) => [modelValueItem, modelValueItem?.value].includes(item.value));
|
|
267
267
|
|
|
268
268
|
if (undefined === option) return;
|
|
269
269
|
|
|
270
|
-
activeOptions.value.add(
|
|
271
|
-
oldActiveOptions.value.add(
|
|
270
|
+
activeOptions.value.add(item);
|
|
271
|
+
oldActiveOptions.value.add(item);
|
|
272
272
|
});
|
|
273
273
|
});
|
|
274
274
|
|
|
@@ -339,11 +339,7 @@ const setOption: TDebounceEvent = function(option, evt) {
|
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
function getCheckboxProp(option: UnpackArray<TOption['options']>) {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
[...props.modelValue].forEach((item) => {
|
|
345
|
-
isChecked = [item?.value, item].includes(option?.value);
|
|
346
|
-
});
|
|
342
|
+
const isChecked = !!([...activeOptions.value, ...props.modelValue].find((item) => [item.value, item].includes(option?.value)));
|
|
347
343
|
|
|
348
344
|
if (!isMultiple.value) return {}
|
|
349
345
|
return {
|
|
@@ -364,6 +360,7 @@ function isActive(option?: UnpackArray<TOption['options']>) {
|
|
|
364
360
|
|
|
365
361
|
function clear() {
|
|
366
362
|
activeOptions.value.clear();
|
|
363
|
+
dispatchEmit();
|
|
367
364
|
oldActiveOptions.value.clear();
|
|
368
365
|
|
|
369
366
|
const checkedInputs = list.value.$el.querySelectorAll('.c-checkbox__inp:checked');
|
|
@@ -384,14 +381,14 @@ function setActivePlaceholder() {
|
|
|
384
381
|
}
|
|
385
382
|
|
|
386
383
|
function isChange() {
|
|
387
|
-
let biggerSet = activeOptions.value;
|
|
388
|
-
let smallerSet = oldActiveOptions.value;
|
|
389
384
|
let isChange = false;
|
|
390
385
|
|
|
391
|
-
|
|
386
|
+
activeOptions.value.forEach((item) => {
|
|
387
|
+
if (!isChange) isChange = !oldActiveOptions.value.has(item);
|
|
388
|
+
});
|
|
392
389
|
|
|
393
|
-
|
|
394
|
-
if (!isChange) isChange = !
|
|
390
|
+
oldActiveOptions.value.forEach((item) => {
|
|
391
|
+
if (!isChange) isChange = !activeOptions.value.has(item);
|
|
395
392
|
});
|
|
396
393
|
|
|
397
394
|
return isChange;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script setup lang="ts">
|
|
28
|
-
import {
|
|
28
|
+
import { onMounted, ref } from 'vue';
|
|
29
29
|
|
|
30
30
|
import CTooltip from '../CTooltip.vue';
|
|
31
31
|
|
|
@@ -48,10 +48,10 @@ const maxLine = ref(props.maxTextLine);
|
|
|
48
48
|
onMounted(() => {
|
|
49
49
|
setTimeout(() => {
|
|
50
50
|
const textEl = (root.value?.querySelector('.c-text-tooltip__content') as HTMLElement);
|
|
51
|
-
const widthContent = root.value
|
|
52
|
-
const heightContent = root.value
|
|
53
|
-
const widthText = textEl
|
|
54
|
-
const heightText = textEl
|
|
51
|
+
const widthContent = root.value?.clientWidth || 0;
|
|
52
|
+
const heightContent = root.value?.offsetHeight || 0;
|
|
53
|
+
const widthText = textEl?.offsetWidth || 0;
|
|
54
|
+
const heightText = textEl?.offsetHeight || 0;
|
|
55
55
|
|
|
56
56
|
if (widthContent < widthText) {
|
|
57
57
|
maxLine.value = 1;
|
package/src/pages/index.vue
CHANGED
|
@@ -830,7 +830,10 @@
|
|
|
830
830
|
<!-- col -->
|
|
831
831
|
<div class="table__col checkboxes">
|
|
832
832
|
<div class="table__item">
|
|
833
|
-
<CDatepicker date="
|
|
833
|
+
<CDatepicker date="2026-02-06T00:00:00.000+03:00" @change_cdatepicker="(e) => console.log(e)" />
|
|
834
|
+
</div>
|
|
835
|
+
<div class="table__item">
|
|
836
|
+
<CDatepicker date="2026-02-06T23:59:59.999+03:00" @change_cdatepicker="(e) => console.log(e)" />
|
|
834
837
|
</div>
|
|
835
838
|
</div>
|
|
836
839
|
<!-- ./col -->
|
|
@@ -1142,7 +1145,7 @@
|
|
|
1142
1145
|
:options="optionGroup"
|
|
1143
1146
|
v-model="VModelOption3"
|
|
1144
1147
|
:autocomplete="true"
|
|
1145
|
-
@
|
|
1148
|
+
@change_cinput2select="(evt) => log(['CInput2Select default', evt])"
|
|
1146
1149
|
/>
|
|
1147
1150
|
</div>
|
|
1148
1151
|
</div>
|
|
@@ -1150,9 +1153,9 @@
|
|
|
1150
1153
|
|
|
1151
1154
|
<!-- col -->
|
|
1152
1155
|
<div class="table__col">
|
|
1153
|
-
|
|
1156
|
+
v-model(value): {{ VModelOption4 }}
|
|
1154
1157
|
<div class="table__item">
|
|
1155
|
-
<CInput2Select variant="multiple" @
|
|
1158
|
+
<CInput2Select variant="multiple" @change_cinput2select="(evt) => log(['CInput2Select multiple', evt])" :transform-val="true" v-model="VModelOption4" :options="optionGroup" />
|
|
1156
1159
|
</div>
|
|
1157
1160
|
</div>
|
|
1158
1161
|
<!-- ./col -->
|
|
@@ -1160,7 +1163,7 @@
|
|
|
1160
1163
|
<!-- col -->
|
|
1161
1164
|
<div class="table__col">
|
|
1162
1165
|
<div class="table__item">
|
|
1163
|
-
<CInput2Select @
|
|
1166
|
+
<CInput2Select @change_cinput2select="(evt) => log(['CInput2Select default', evt])" :autocomplete="true" size="md" :options="[{
|
|
1164
1167
|
name: 'Коммерческие',
|
|
1165
1168
|
options: [
|
|
1166
1169
|
{
|
|
@@ -1202,7 +1205,7 @@
|
|
|
1202
1205
|
<!-- col -->
|
|
1203
1206
|
<div class="table__col scroll-sm scroll-container">
|
|
1204
1207
|
<div class="table__item">
|
|
1205
|
-
<CInput2Select @
|
|
1208
|
+
<CInput2Select @change_cinput2select="(evt) => log(['CInput2Select default', evt])" :autocomplete="true" size="md" :options="[{
|
|
1206
1209
|
name: 'Коммерческие',
|
|
1207
1210
|
options: [
|
|
1208
1211
|
{
|
|
@@ -1258,15 +1261,15 @@
|
|
|
1258
1261
|
</div>
|
|
1259
1262
|
<h4>isOpen: {{ selectIsOpen }}</h4>
|
|
1260
1263
|
<div class="table__item">
|
|
1261
|
-
<CInput2Select variant="multiple" @
|
|
1264
|
+
<CInput2Select variant="multiple" @change_cinput2select="(evt) => log(['CInput2Select multiple', evt])" size="sm" :select-all="true" :options="optionGroup" iconName="Cart" v-model:is-open="selectIsOpen" :model-value="VModelOption3" />
|
|
1262
1265
|
</div>
|
|
1263
1266
|
|
|
1264
1267
|
<div class="table__item">
|
|
1265
|
-
<CInput2Select variant="multiple" @
|
|
1268
|
+
<CInput2Select variant="multiple" @change_cinput2select="(evt) => log(['CInput2Select multiple', evt])" size="sm" :select-all="true" :options="optionGroup" v-model="VModelOption3" />
|
|
1266
1269
|
</div>
|
|
1267
1270
|
|
|
1268
1271
|
<div class="table__item">
|
|
1269
|
-
<CInput2Select @
|
|
1272
|
+
<CInput2Select @change_cinput2select="(evt) => log(['CInput2Select default', evt])" size="sm" :select-all="true" :disabled="true" :options="optionGroup" v-model="VModelOption3" />
|
|
1270
1273
|
</div>
|
|
1271
1274
|
</div>
|
|
1272
1275
|
<!-- ./col -->
|
|
@@ -1656,6 +1659,8 @@ export default {
|
|
|
1656
1659
|
value: 2,
|
|
1657
1660
|
}],
|
|
1658
1661
|
|
|
1662
|
+
VModelOption4: [2],
|
|
1663
|
+
|
|
1659
1664
|
showBlock: {
|
|
1660
1665
|
btn: true,
|
|
1661
1666
|
tabs: true,
|