vueless 0.0.415 → 0.0.417
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 +1 -1
- package/ui.data-table/UTable.vue +15 -33
- package/ui.data-table/UTableRow.vue +6 -2
- package/ui.data-table/config.js +6 -6
- package/ui.data-table/storybook/Docs.mdx +18 -1
- package/ui.data-table/storybook/stories.js +19 -10
- package/ui.form-calendar/UCalendar.vue +38 -48
- package/ui.form-calendar/UCalendarDayView.vue +4 -4
- package/ui.form-calendar/UCalendarMonthView.vue +1 -1
- package/ui.form-calendar/UCalendarYearView.vue +1 -1
- package/ui.form-calendar/config.js +8 -16
- package/ui.form-date-picker-range/UDatePickerRangePeriodMenu.vue +15 -2
- package/ui.form-date-picker-range/config.js +13 -10
- package/web-types.json +1 -1
package/package.json
CHANGED
package/ui.data-table/UTable.vue
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
<UCheckbox
|
|
12
12
|
v-if="selectable"
|
|
13
13
|
v-model="selectAll"
|
|
14
|
-
size="sm"
|
|
15
14
|
:partial="!isSelectedAllRows"
|
|
16
15
|
:data-test="`${dataTest}-select-all`"
|
|
17
16
|
v-bind="stickyHeaderActionsCheckboxAttrs"
|
|
@@ -36,7 +35,6 @@
|
|
|
36
35
|
<UCheckbox
|
|
37
36
|
v-if="selectable"
|
|
38
37
|
v-model="selectAll"
|
|
39
|
-
size="sm"
|
|
40
38
|
:partial="!isSelectedAllRows"
|
|
41
39
|
:data-test="`${dataTest}-select-all`"
|
|
42
40
|
v-bind="stickyHeaderCheckboxAttrs"
|
|
@@ -107,7 +105,6 @@
|
|
|
107
105
|
<th v-if="selectable" v-bind="headerCellCheckboxAttrs">
|
|
108
106
|
<UCheckbox
|
|
109
107
|
v-model="selectAll"
|
|
110
|
-
size="sm"
|
|
111
108
|
:partial="!isSelectedAllRows"
|
|
112
109
|
:data-test="`${dataTest}-select-all`"
|
|
113
110
|
v-bind="headerCheckboxAttrs"
|
|
@@ -165,19 +162,12 @@
|
|
|
165
162
|
</td>
|
|
166
163
|
</tr>
|
|
167
164
|
|
|
168
|
-
<tr
|
|
169
|
-
v-
|
|
170
|
-
v-bind="
|
|
171
|
-
shouldDisplayDateSeparator(rowIndex)
|
|
172
|
-
? bodyRowDateSeparatorCheckedAttrs
|
|
173
|
-
: bodyRowDateSeparatorAttrs
|
|
174
|
-
"
|
|
175
|
-
>
|
|
176
|
-
<td v-bind="bodyCellDateSeparatorAttrs(rowIndex)" :colspan="colsCount">
|
|
165
|
+
<tr v-if="isShownDateDivider(rowIndex) && row.rowDate" v-bind="bodyRowDateDividerAttrs">
|
|
166
|
+
<td v-bind="bodyCellDateDividerAttrs" :colspan="colsCount">
|
|
177
167
|
<UDivider
|
|
178
168
|
size="xs"
|
|
179
|
-
:label="
|
|
180
|
-
v-bind="
|
|
169
|
+
:label="getDateDividerLabel(row.rowDate)"
|
|
170
|
+
v-bind="bodyDateDividerAttrs"
|
|
181
171
|
/>
|
|
182
172
|
</td>
|
|
183
173
|
</tr>
|
|
@@ -235,7 +225,7 @@
|
|
|
235
225
|
<!-- @slot Use it to add custom empty state. -->
|
|
236
226
|
<slot name="empty-state">
|
|
237
227
|
<UEmpty
|
|
238
|
-
size="
|
|
228
|
+
size="md"
|
|
239
229
|
:description="currentLocale.noData"
|
|
240
230
|
:data-test="`${dataTest}-empty`"
|
|
241
231
|
v-bind="bodyEmptyStateAttrs"
|
|
@@ -525,8 +515,7 @@ const {
|
|
|
525
515
|
bodyRowAttrs,
|
|
526
516
|
bodyRowCheckedAttrs,
|
|
527
517
|
footerAttrs,
|
|
528
|
-
|
|
529
|
-
bodyRowDateSeparatorCheckedAttrs,
|
|
518
|
+
bodyRowDateDividerAttrs,
|
|
530
519
|
headerCellBaseAttrs,
|
|
531
520
|
headerCellCheckboxAttrs,
|
|
532
521
|
stickyHeaderActionsCheckboxAttrs,
|
|
@@ -534,8 +523,8 @@ const {
|
|
|
534
523
|
headerCheckboxAttrs,
|
|
535
524
|
headerCounterAttrs,
|
|
536
525
|
bodyEmptyStateAttrs,
|
|
537
|
-
|
|
538
|
-
|
|
526
|
+
bodyDateDividerAttrs,
|
|
527
|
+
bodyCellDateDividerAttrs,
|
|
539
528
|
stickyHeaderActionsCounterAttrs,
|
|
540
529
|
stickyHeaderCounterAttrs,
|
|
541
530
|
stickyHeaderLoaderAttrs,
|
|
@@ -595,18 +584,10 @@ function onWindowResize() {
|
|
|
595
584
|
setFooterCellWidth();
|
|
596
585
|
}
|
|
597
586
|
|
|
598
|
-
function
|
|
587
|
+
function getDateDividerLabel(rowDate) {
|
|
599
588
|
return Array.isArray(props.dateDivider)
|
|
600
|
-
? props.dateDivider.find((dateItem) => dateItem.date ===
|
|
601
|
-
:
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
function shouldDisplayDateSeparator(rowIndex) {
|
|
605
|
-
const isPreviousRowChecked = tableRows.value[rowIndex - 1]?.isChecked;
|
|
606
|
-
const isCheckedRowAfter = tableRows.value[rowIndex]?.isChecked;
|
|
607
|
-
const isFirstRowAndNextChecked = rowIndex === 0 && isCheckedRowAfter;
|
|
608
|
-
|
|
609
|
-
return (isPreviousRowChecked && isCheckedRowAfter) || isFirstRowAndNextChecked;
|
|
589
|
+
? props.dateDivider.find((dateItem) => dateItem.date === rowDate)?.label || rowDate
|
|
590
|
+
: rowDate;
|
|
610
591
|
}
|
|
611
592
|
|
|
612
593
|
function getRowAttrs(rowId) {
|
|
@@ -668,7 +649,7 @@ function onKeyupEsc(event) {
|
|
|
668
649
|
}
|
|
669
650
|
}
|
|
670
651
|
|
|
671
|
-
function
|
|
652
|
+
function isShownDateDivider(rowIndex) {
|
|
672
653
|
const prevIndex = rowIndex ? rowIndex - 1 : rowIndex;
|
|
673
654
|
const nextIndex = rowIndex ? rowIndex + 1 : rowIndex;
|
|
674
655
|
const prevItem = tableRows.value[prevIndex];
|
|
@@ -679,8 +660,8 @@ function isShownDateSeparator(rowIndex) {
|
|
|
679
660
|
return hasSlotContentBeforeFirstRow.value;
|
|
680
661
|
}
|
|
681
662
|
|
|
682
|
-
const isPrevSameDate = prevItem?.
|
|
683
|
-
const isNextSameDate = nextItem?.
|
|
663
|
+
const isPrevSameDate = prevItem?.rowDate === currentItem?.rowDate;
|
|
664
|
+
const isNextSameDate = nextItem?.rowDate === currentItem?.rowDate;
|
|
684
665
|
|
|
685
666
|
return isPrevSameDate && !isNextSameDate && props.dateDivider;
|
|
686
667
|
}
|
|
@@ -720,6 +701,7 @@ function clearSelectedItems() {
|
|
|
720
701
|
}
|
|
721
702
|
|
|
722
703
|
function onToggleRowVisibility(rowId) {
|
|
704
|
+
// TODO: Use map instead of forEach to get rid of implicit array mutation.
|
|
723
705
|
tableRows.value.forEach((row) => toggleRowVisibility(row, rowId));
|
|
724
706
|
}
|
|
725
707
|
</script>
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<tr v-bind="$attrs" @click="onClick(props.row)">
|
|
3
|
-
<td
|
|
3
|
+
<td
|
|
4
|
+
v-if="selectable"
|
|
5
|
+
:style="getNestedCheckboxShift()"
|
|
6
|
+
v-bind="bodyCellCheckboxAttrs"
|
|
7
|
+
@click.stop
|
|
8
|
+
>
|
|
4
9
|
<UCheckbox
|
|
5
10
|
v-model="selectedRows"
|
|
6
11
|
:data-id="row.id"
|
|
7
12
|
:value="row.id"
|
|
8
|
-
size="sm"
|
|
9
13
|
:data-test="`${dataTest}-body-checkbox`"
|
|
10
14
|
v-bind="bodyCheckboxAttrs"
|
|
11
15
|
/>
|
package/ui.data-table/config.js
CHANGED
|
@@ -22,7 +22,7 @@ export default /*tw*/ {
|
|
|
22
22
|
header: "border-b border-gray-200",
|
|
23
23
|
headerRow: "",
|
|
24
24
|
headerCellBase: {
|
|
25
|
-
base: "p-4
|
|
25
|
+
base: "p-4 text-sm font-normal text-gray-500 text-left text-nowrap",
|
|
26
26
|
variants: {
|
|
27
27
|
compact: {
|
|
28
28
|
true: "px-4 py-3 last:px-4 last:py-3 first:px-4 first:py-3",
|
|
@@ -32,7 +32,7 @@ export default /*tw*/ {
|
|
|
32
32
|
headerCellCheckbox: "w-10",
|
|
33
33
|
headerCheckbox: "{UCheckbox}",
|
|
34
34
|
headerCounter: {
|
|
35
|
-
base: "absolute top-
|
|
35
|
+
base: "absolute top-4 mt-px left-11 bg-gradient-to-r from-white from-80% ml-px",
|
|
36
36
|
variants: {
|
|
37
37
|
compact: {
|
|
38
38
|
true: "top-3",
|
|
@@ -47,9 +47,9 @@ export default /*tw*/ {
|
|
|
47
47
|
bodyRowBeforeCell: "py-1",
|
|
48
48
|
bodyRowAfter: "!p-0",
|
|
49
49
|
bodyRowAfterCell: "py-1",
|
|
50
|
-
|
|
50
|
+
bodyRowDateDivider: "",
|
|
51
51
|
bodyCellBase: {
|
|
52
|
-
base: "p-[1.125rem] py-5
|
|
52
|
+
base: "p-[1.125rem] py-5 truncate align-top",
|
|
53
53
|
variants: {
|
|
54
54
|
compact: {
|
|
55
55
|
true: "px-4 py-3 last:px-4 last:py-3 first:!px-3.5 first:py-3",
|
|
@@ -61,7 +61,7 @@ export default /*tw*/ {
|
|
|
61
61
|
bodyCellSecondary: "mt-1 text-xs text-gray-500 overflow-hidden text-ellipsis",
|
|
62
62
|
bodyCellSecondaryEmpty: "inline-block",
|
|
63
63
|
bodyCellCheckbox: "first:px-4", // try to remove first
|
|
64
|
-
|
|
64
|
+
bodyCellDateDivider: "",
|
|
65
65
|
bodyCellNested: "mr-2 mt-0.5",
|
|
66
66
|
bodyCellNestedExpandIcon: {
|
|
67
67
|
component: "{UIcon}",
|
|
@@ -74,7 +74,7 @@ export default /*tw*/ {
|
|
|
74
74
|
container: "bg-gray-200",
|
|
75
75
|
},
|
|
76
76
|
bodyCheckbox: "{UCheckbox}",
|
|
77
|
-
|
|
77
|
+
bodyDateDivider: "{UDivider}",
|
|
78
78
|
bodyEmptyState: "{UEmpty} my-8",
|
|
79
79
|
footer: "group/footer border-t border-solid border-gray-200",
|
|
80
80
|
footerRow: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
1
|
+
import { Markdown, Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
2
|
import { getSource } from "../../utils/utilStorybook.js";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
@@ -12,5 +12,22 @@ import defaultConfig from "../config.js?raw"
|
|
|
12
12
|
<Controls of={stories.Default} />
|
|
13
13
|
<Stories of={stories} />
|
|
14
14
|
|
|
15
|
+
## Formatting tokens
|
|
16
|
+
Each character in the table below can be used in `dateFormat` and `userDateFormat` / `userDateTimeFormat` options to achieve the format you need.
|
|
17
|
+
|
|
18
|
+
## Row meta keys
|
|
19
|
+
Keys you have/may to provide to component in row object.
|
|
20
|
+
|
|
21
|
+
<Markdown>
|
|
22
|
+
{`
|
|
23
|
+
| Key name | Description | Type | Required |
|
|
24
|
+
| ------------------| ------------------------------ | ---------------| ------------ |
|
|
25
|
+
| id | A unique identifier for row | String, Number | true |
|
|
26
|
+
| isChecked | Indicates if row checked | Boolean | false |
|
|
27
|
+
| isHidden | Indicated if nested row hidden | Boolean | false |
|
|
28
|
+
| rowDate | Row date for date divider | String, Date | false |
|
|
29
|
+
`}
|
|
30
|
+
</Markdown>
|
|
31
|
+
|
|
15
32
|
## Default config
|
|
16
33
|
<Source code={getSource(defaultConfig)} language="jsx" dark />
|
|
@@ -8,7 +8,7 @@ import UMoney from "../../ui.text-money/UMoney.vue";
|
|
|
8
8
|
import UBadge from "../../ui.text-badge/UBadge.vue";
|
|
9
9
|
import URow from "../../ui.container-row/URow.vue";
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const SHORT_STORY_PARAMETERS = {
|
|
12
12
|
docs: {
|
|
13
13
|
story: {
|
|
14
14
|
inline: false,
|
|
@@ -47,6 +47,18 @@ export default {
|
|
|
47
47
|
},
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
+
function getDateDividerRow() {
|
|
51
|
+
return {
|
|
52
|
+
id: getRandomId(),
|
|
53
|
+
isChecked: false,
|
|
54
|
+
rowDate: new Date().toString(),
|
|
55
|
+
key_1: "Info",
|
|
56
|
+
key_2: "Statistics",
|
|
57
|
+
key_3: "Reports",
|
|
58
|
+
key_4: "Discounts",
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
50
62
|
function getNestedRow() {
|
|
51
63
|
return {
|
|
52
64
|
id: getRandomId(),
|
|
@@ -321,11 +333,11 @@ export const Selectable = DefaultTemplate.bind({});
|
|
|
321
333
|
Selectable.args = { selectable: true };
|
|
322
334
|
|
|
323
335
|
export const StickyHeader = DefaultTemplate.bind({});
|
|
324
|
-
StickyHeader.parameters =
|
|
336
|
+
StickyHeader.parameters = SHORT_STORY_PARAMETERS;
|
|
325
337
|
StickyHeader.args = { numberOfRows: 50, selectable: true, stickyHeader: true };
|
|
326
338
|
|
|
327
339
|
export const StickyFooter = DefaultTemplate.bind({});
|
|
328
|
-
StickyFooter.parameters =
|
|
340
|
+
StickyFooter.parameters = SHORT_STORY_PARAMETERS;
|
|
329
341
|
StickyFooter.args = {
|
|
330
342
|
numberOfRows: 50,
|
|
331
343
|
selectable: true,
|
|
@@ -346,16 +358,12 @@ export const Compact = DefaultTemplate.bind({});
|
|
|
346
358
|
Compact.args = { compact: true };
|
|
347
359
|
|
|
348
360
|
export const DateDivider = DefaultTemplate.bind({});
|
|
349
|
-
DateDivider.args = { dateDivider: true };
|
|
361
|
+
DateDivider.args = { dateDivider: true, row: getDateDividerRow };
|
|
350
362
|
|
|
351
363
|
export const DateDividerCustomLabel = DefaultTemplate.bind({});
|
|
352
364
|
DateDividerCustomLabel.args = {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
date: new Date(1709046013 * 1000).toString(),
|
|
356
|
-
label: "Label for this date",
|
|
357
|
-
},
|
|
358
|
-
],
|
|
365
|
+
row: getDateDividerRow,
|
|
366
|
+
dateDivider: [{ date: new Date().toString(), label: "Custom label for specific date" }],
|
|
359
367
|
};
|
|
360
368
|
|
|
361
369
|
export const SlotDefault = DefaultTemplate.bind({});
|
|
@@ -368,6 +376,7 @@ SlotDefault.args = {
|
|
|
368
376
|
};
|
|
369
377
|
|
|
370
378
|
export const SlotHeaderActions = DefaultTemplate.bind({});
|
|
379
|
+
SlotHeaderActions.parameters = SHORT_STORY_PARAMETERS;
|
|
371
380
|
SlotHeaderActions.args = {
|
|
372
381
|
numberOfRows: 50,
|
|
373
382
|
stickyHeader: true,
|
|
@@ -1,54 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div ref="wrapperRef" tabindex="1" v-bind="wrapperAttrs" @keydown="onKeydown">
|
|
3
3
|
<div v-bind="navigationAttrs">
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
<UButton
|
|
5
|
+
square
|
|
6
|
+
no-ring
|
|
7
|
+
size="sm"
|
|
8
|
+
color="grayscale"
|
|
9
|
+
variant="thirdary"
|
|
10
|
+
:left-icon="config.defaults.prevIcon"
|
|
11
|
+
v-bind="nextPrevButtonAttrs"
|
|
12
|
+
@mousedown.prevent.capture
|
|
13
|
+
@click="onClickPrevButton"
|
|
14
|
+
/>
|
|
15
|
+
|
|
16
|
+
<UButton
|
|
17
|
+
no-ring
|
|
18
|
+
size="sm"
|
|
19
|
+
color="grayscale"
|
|
20
|
+
variant="thirdary"
|
|
21
|
+
v-bind="viewSwitchButtonAttrs"
|
|
22
|
+
@mousedown.prevent.capture
|
|
23
|
+
@click="onClickViewSwitch"
|
|
8
24
|
>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
v-bind="viewSwitchButtonAttrs"
|
|
16
|
-
@mousedown.prevent.capture
|
|
17
|
-
@click="onClickViewSwitch"
|
|
18
|
-
>
|
|
19
|
-
<template v-if="isCurrentView.day">
|
|
20
|
-
{{ viewSwitchLabel.month }} {{ viewSwitchLabel.year }}
|
|
21
|
-
</template>
|
|
22
|
-
<template v-if="isCurrentView.month">{{ viewSwitchLabel.year }}</template>
|
|
23
|
-
<template v-if="isCurrentView.year">{{ viewSwitchLabel.yearsRange }}</template>
|
|
24
|
-
</UButton>
|
|
25
|
-
</Teleport>
|
|
26
|
-
|
|
27
|
-
<div v-bind="nextPrevWrapperAttrs">
|
|
28
|
-
<UButton
|
|
29
|
-
square
|
|
30
|
-
no-ring
|
|
31
|
-
size="sm"
|
|
32
|
-
variant="thirdary"
|
|
33
|
-
:left-icon="config.defaults.prevIcon"
|
|
34
|
-
v-bind="nextPrevButtonAttrs"
|
|
35
|
-
@mousedown.prevent.capture
|
|
36
|
-
@click="onClickPrevButton"
|
|
37
|
-
/>
|
|
25
|
+
<template v-if="isCurrentView.day">
|
|
26
|
+
{{ viewSwitchLabel.month }} {{ viewSwitchLabel.year }}
|
|
27
|
+
</template>
|
|
28
|
+
<template v-if="isCurrentView.month">{{ viewSwitchLabel.year }}</template>
|
|
29
|
+
<template v-if="isCurrentView.year">{{ viewSwitchLabel.yearsRange }}</template>
|
|
30
|
+
</UButton>
|
|
38
31
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/>
|
|
51
|
-
</div>
|
|
32
|
+
<UButton
|
|
33
|
+
square
|
|
34
|
+
no-ring
|
|
35
|
+
size="sm"
|
|
36
|
+
color="grayscale"
|
|
37
|
+
variant="thirdary"
|
|
38
|
+
:left-icon="config.defaults.nextIcon"
|
|
39
|
+
v-bind="nextPrevButtonAttrs"
|
|
40
|
+
@mousedown.prevent.capture
|
|
41
|
+
@click="onClickNextButton"
|
|
42
|
+
/>
|
|
52
43
|
</div>
|
|
53
44
|
|
|
54
45
|
<DayView
|
|
@@ -134,6 +125,7 @@
|
|
|
134
125
|
square
|
|
135
126
|
filled
|
|
136
127
|
no-ring
|
|
128
|
+
color="grayscale"
|
|
137
129
|
v-bind="timepickerSubmitButtonAttrs"
|
|
138
130
|
@click="onClickSubmit"
|
|
139
131
|
>
|
|
@@ -343,14 +335,12 @@ const {
|
|
|
343
335
|
timepickerInputMinutesAttrs,
|
|
344
336
|
timepickerInputSecondsAttrs,
|
|
345
337
|
timepickerSubmitButtonAttrs,
|
|
346
|
-
nextPrevWrapperAttrs,
|
|
347
338
|
} = useAttrs(props);
|
|
348
339
|
|
|
349
340
|
const wrapperRef = ref(null);
|
|
350
341
|
const hoursRef = ref(null);
|
|
351
342
|
const minutesRef = ref(null);
|
|
352
343
|
const secondsRef = ref(null);
|
|
353
|
-
const rangeSwitchViewContainerRef = ref(null);
|
|
354
344
|
|
|
355
345
|
const activeDate = ref(null);
|
|
356
346
|
const activeMonth = ref(null);
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<UButton
|
|
67
67
|
v-else-if="getDayState(day).isFirstDayInRange"
|
|
68
68
|
tabindex="-1"
|
|
69
|
-
variant="
|
|
69
|
+
variant="primary"
|
|
70
70
|
color="brand"
|
|
71
71
|
no-ring
|
|
72
72
|
square
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
<UButton
|
|
82
82
|
v-else-if="getDayState(day).isLastDayInRange"
|
|
83
83
|
tabindex="-1"
|
|
84
|
-
variant="
|
|
84
|
+
variant="primary"
|
|
85
85
|
color="brand"
|
|
86
86
|
no-ring
|
|
87
87
|
square
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
v-else-if="getDayState(day).isAnotherMonthDay"
|
|
170
170
|
tabindex="-1"
|
|
171
171
|
variant="thirdary"
|
|
172
|
-
color="
|
|
172
|
+
color="grayscale"
|
|
173
173
|
no-ring
|
|
174
174
|
square
|
|
175
175
|
v-bind="anotherMonthDayAttrs"
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
v-else-if="!getDayState(day).isSelectedDay"
|
|
184
184
|
tabindex="-1"
|
|
185
185
|
variant="thirdary"
|
|
186
|
-
color="
|
|
186
|
+
color="grayscale"
|
|
187
187
|
no-ring
|
|
188
188
|
square
|
|
189
189
|
v-bind="dayAttrs"
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
-
wrapper: "p-
|
|
2
|
+
wrapper: "p-2 w-80 border border-gray-300 rounded-dynamic bg-white shadow overflow-hidden focus:outline-none",
|
|
3
3
|
navigation: "mb-2 pb-2 border-b flex items-center justify-between",
|
|
4
|
-
viewSwitchButton: "{UButton}
|
|
5
|
-
nextPrevWrapper: {
|
|
6
|
-
base: "flex",
|
|
7
|
-
variants: {
|
|
8
|
-
range: {
|
|
9
|
-
true: "justify-between items-center w-full",
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
},
|
|
4
|
+
viewSwitchButton: "{UButton}",
|
|
13
5
|
nextPrevButton: "{UButton}",
|
|
14
6
|
dayView: "",
|
|
15
|
-
weekDays: "grid grid-cols-7",
|
|
7
|
+
weekDays: "grid grid-cols-7 justify-items-center gap-1",
|
|
16
8
|
weekDay: "flex size-8 items-center justify-center text-xs uppercase text-gray-500",
|
|
17
|
-
days: "grid grid-cols-7",
|
|
18
|
-
dateInRange: "bg-brand
|
|
9
|
+
days: "grid grid-cols-7 justify-items-center gap-1",
|
|
10
|
+
dateInRange: "bg-brand/15 !text-brand-900 hover:bg-brand/30 rounded-none",
|
|
19
11
|
edgeDateInRange: "",
|
|
20
12
|
firstDateInRange: "rounded-r-none",
|
|
21
13
|
lastDateInRange: "rounded-l-none",
|
|
@@ -23,7 +15,7 @@ export default /*tw*/ {
|
|
|
23
15
|
activeDate: "bg-brand-100",
|
|
24
16
|
selectedDate: "",
|
|
25
17
|
currentDate: "border-2 border-brand-600",
|
|
26
|
-
day:
|
|
18
|
+
day: "{UButton} size-9 w-full font-normal",
|
|
27
19
|
currentDay: "",
|
|
28
20
|
dayInRange: "",
|
|
29
21
|
currentDayInRange: "",
|
|
@@ -36,7 +28,7 @@ export default /*tw*/ {
|
|
|
36
28
|
anotherMonthLastDayInRange: "",
|
|
37
29
|
selectedDay: "",
|
|
38
30
|
activeDay: "",
|
|
39
|
-
monthView: "grid grid-cols-4 items-center
|
|
31
|
+
monthView: "grid grid-cols-4 justify-items-center gap-1",
|
|
40
32
|
month: "{UButton} mx-auto flex h-12 w-full",
|
|
41
33
|
currentMonth: "",
|
|
42
34
|
currentMonthInRange: "",
|
|
@@ -49,7 +41,7 @@ export default /*tw*/ {
|
|
|
49
41
|
monthInRange: "",
|
|
50
42
|
selectedMonth: "",
|
|
51
43
|
activeMonth: "",
|
|
52
|
-
yearView: "grid grid-cols-4 items-center
|
|
44
|
+
yearView: "grid grid-cols-4 justify-items-center gap-1",
|
|
53
45
|
year: "{UButton} mx-auto flex h-12 w-full",
|
|
54
46
|
currentYear: "",
|
|
55
47
|
currentYearInRange: "",
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
filled
|
|
8
8
|
no-ring
|
|
9
9
|
size="xs"
|
|
10
|
+
color="grayscale"
|
|
10
11
|
variant="thirdary"
|
|
11
12
|
:label="periodButton.title"
|
|
12
13
|
v-bind="periodButtonAttrs"
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
filled
|
|
20
21
|
no-ring
|
|
21
22
|
size="xs"
|
|
23
|
+
color="grayscale"
|
|
22
24
|
variant="thirdary"
|
|
23
25
|
:label="periodButton.title"
|
|
24
26
|
v-bind="periodButtonActiveAttrs"
|
|
@@ -34,6 +36,7 @@
|
|
|
34
36
|
filled
|
|
35
37
|
no-ring
|
|
36
38
|
size="xs"
|
|
39
|
+
color="grayscale"
|
|
37
40
|
variant="thirdary"
|
|
38
41
|
v-bind="periodButtonAttrs"
|
|
39
42
|
@click="onClickCustomRangeButton"
|
|
@@ -52,6 +55,7 @@
|
|
|
52
55
|
filled
|
|
53
56
|
no-ring
|
|
54
57
|
size="xs"
|
|
58
|
+
color="grayscale"
|
|
55
59
|
variant="thirdary"
|
|
56
60
|
v-bind="periodButtonActiveAttrs"
|
|
57
61
|
@click="onClickCustomRangeButton"
|
|
@@ -70,6 +74,7 @@
|
|
|
70
74
|
filled
|
|
71
75
|
no-ring
|
|
72
76
|
size="xs"
|
|
77
|
+
color="grayscale"
|
|
73
78
|
variant="thirdary"
|
|
74
79
|
:label="locale.ownRange"
|
|
75
80
|
:left-icon="config.defaults.ownRangeIcon"
|
|
@@ -83,6 +88,7 @@
|
|
|
83
88
|
filled
|
|
84
89
|
no-ring
|
|
85
90
|
size="xs"
|
|
91
|
+
color="grayscale"
|
|
86
92
|
variant="thirdary"
|
|
87
93
|
:label="locale.ownRange"
|
|
88
94
|
:left-icon="config.defaults.ownRangeIcon"
|
|
@@ -97,7 +103,7 @@
|
|
|
97
103
|
square
|
|
98
104
|
no-ring
|
|
99
105
|
size="xs"
|
|
100
|
-
color="
|
|
106
|
+
color="grayscale"
|
|
101
107
|
variant="thirdary"
|
|
102
108
|
:left-icon="config.defaults.prevIcon"
|
|
103
109
|
v-bind="rangeSwitchButtonAttrs"
|
|
@@ -112,7 +118,7 @@
|
|
|
112
118
|
square
|
|
113
119
|
no-ring
|
|
114
120
|
size="xs"
|
|
115
|
-
color="
|
|
121
|
+
color="grayscale"
|
|
116
122
|
variant="thirdary"
|
|
117
123
|
:left-icon="config.defaults.nextIcon"
|
|
118
124
|
v-bind="rangeSwitchButtonAttrs"
|
|
@@ -126,6 +132,7 @@
|
|
|
126
132
|
v-if="getDatePeriodState(date, index).isActive"
|
|
127
133
|
no-ring
|
|
128
134
|
size="sm"
|
|
135
|
+
color="grayscale"
|
|
129
136
|
variant="thirdary"
|
|
130
137
|
:disabled="isDatePeriodOutOfRange(date)"
|
|
131
138
|
v-bind="periodDateActiveAttrs"
|
|
@@ -138,6 +145,7 @@
|
|
|
138
145
|
v-else-if="getDatePeriodState(date, index).isFirstInRange && !isListType"
|
|
139
146
|
no-ring
|
|
140
147
|
size="sm"
|
|
148
|
+
color="grayscale"
|
|
141
149
|
variant="thirdary"
|
|
142
150
|
:disabled="isDatePeriodOutOfRange(date)"
|
|
143
151
|
v-bind="firstPeriodGridDateAttrs"
|
|
@@ -150,6 +158,7 @@
|
|
|
150
158
|
v-else-if="getDatePeriodState(date, index).isFirstInRange && isListType"
|
|
151
159
|
no-ring
|
|
152
160
|
size="sm"
|
|
161
|
+
color="grayscale"
|
|
153
162
|
variant="thirdary"
|
|
154
163
|
:disabled="isDatePeriodOutOfRange(date)"
|
|
155
164
|
v-bind="firstPeriodListDateAttrs"
|
|
@@ -162,6 +171,7 @@
|
|
|
162
171
|
v-else-if="getDatePeriodState(date, index).isLastInRange && !isListType"
|
|
163
172
|
no-ring
|
|
164
173
|
size="sm"
|
|
174
|
+
color="grayscale"
|
|
165
175
|
variant="thirdary"
|
|
166
176
|
:disabled="isDatePeriodOutOfRange(date)"
|
|
167
177
|
v-bind="lastPeriodGridDateAttrs"
|
|
@@ -174,6 +184,7 @@
|
|
|
174
184
|
v-else-if="getDatePeriodState(date, index).isLastInRange && isListType"
|
|
175
185
|
no-ring
|
|
176
186
|
size="sm"
|
|
187
|
+
color="grayscale"
|
|
177
188
|
variant="thirdary"
|
|
178
189
|
:disabled="isDatePeriodOutOfRange(date)"
|
|
179
190
|
v-bind="lastPeriodListDateAttrs"
|
|
@@ -186,6 +197,7 @@
|
|
|
186
197
|
v-else-if="getDatePeriodState(date, index).isInRange"
|
|
187
198
|
no-ring
|
|
188
199
|
size="sm"
|
|
200
|
+
color="grayscale"
|
|
189
201
|
variant="thirdary"
|
|
190
202
|
:disabled="isDatePeriodOutOfRange(date)"
|
|
191
203
|
v-bind="periodDateInRangeAttrs"
|
|
@@ -198,6 +210,7 @@
|
|
|
198
210
|
v-else
|
|
199
211
|
no-ring
|
|
200
212
|
size="sm"
|
|
213
|
+
color="grayscale"
|
|
201
214
|
variant="thirdary"
|
|
202
215
|
:disabled="isDatePeriodOutOfRange(date)"
|
|
203
216
|
v-bind="periodDateAttrs"
|
|
@@ -19,7 +19,7 @@ export default /*tw*/ {
|
|
|
19
19
|
menu: {
|
|
20
20
|
base: `
|
|
21
21
|
absolute z-40 mb-3 w-80 overflow-hidden rounded-dynamic
|
|
22
|
-
border border-
|
|
22
|
+
border border-gray-300 bg-white p-2 shadow focus:outline-none
|
|
23
23
|
`,
|
|
24
24
|
variants: {
|
|
25
25
|
openDirectionX: {
|
|
@@ -76,8 +76,11 @@ export default /*tw*/ {
|
|
|
76
76
|
wrapper: "w-full hover:z-10 focus:z-10 !rounded-none",
|
|
77
77
|
description: "hidden",
|
|
78
78
|
},
|
|
79
|
-
wrapper: "focus-within:z-10 focus-within:ring-0 rounded-r-none",
|
|
80
79
|
input: "rounded-r-none",
|
|
80
|
+
wrapper: `
|
|
81
|
+
rounded-r-none
|
|
82
|
+
focus-within:z-10 focus-within:ring-0 focus-within:border-gray-500 hover:focus-within:border-gray-500
|
|
83
|
+
`,
|
|
81
84
|
},
|
|
82
85
|
rangeInputLast: {
|
|
83
86
|
component: "{UInput}",
|
|
@@ -86,19 +89,19 @@ export default /*tw*/ {
|
|
|
86
89
|
wrapper: "w-full hover:z-10 focus:z-10",
|
|
87
90
|
description: "hidden",
|
|
88
91
|
},
|
|
89
|
-
wrapper: "focus-within:z-10 focus-within:ring-0 rounded-l-none",
|
|
90
92
|
input: "rounded-l-none",
|
|
93
|
+
wrapper: `
|
|
94
|
+
rounded-l-none
|
|
95
|
+
focus-within:z-10 focus-within:ring-0 focus-within:border-gray-500 hover:focus-within:border-gray-500
|
|
96
|
+
`,
|
|
91
97
|
},
|
|
92
98
|
rangeInputError: "text-xs font-normal leading-none mt-2 text-center text-red-500",
|
|
93
99
|
calendar: {
|
|
94
100
|
component: "{UCalendar}",
|
|
95
|
-
wrapper: "p-0 w-full border-none shadow-none rounded-none",
|
|
96
|
-
navigation: "mb-0 border-none",
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
rightIcon: "hidden",
|
|
100
|
-
},
|
|
101
|
-
day: "w-full h-10 mb-0.5",
|
|
101
|
+
wrapper: "p-0 pt-2 w-full border-none shadow-none rounded-none",
|
|
102
|
+
navigation: "pb-0 mb-0 border-none",
|
|
103
|
+
days: "gap-0 gap-y-0.5",
|
|
104
|
+
day: "w-full",
|
|
102
105
|
},
|
|
103
106
|
i18n: {
|
|
104
107
|
ownRange: "Own range",
|