ropav 0.1.8 → 0.1.9
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/README.md +4 -3
- package/dist/calendar.css +44 -33
- package/dist/calendar.js +108 -83
- package/dist/components/calendar/index.d.ts +1 -1
- package/dist/components/calendar/types.d.ts +3 -0
- package/dist/components/date-picker/index.d.ts +1 -1
- package/dist/components/date-picker/types.d.ts +3 -1
- package/dist/components/slider/useSlider.d.ts +1 -1
- package/dist/components/slider/useSliderPointer.d.ts +15 -0
- package/dist/components/slider/useSliderValueState.d.ts +1 -0
- package/dist/components/toolbar/index.d.ts +3 -0
- package/dist/components/toolbar/index.js +2 -0
- package/dist/components/toolbar/toolbar.d.ts +24 -0
- package/dist/components/toolbar/types.d.ts +12 -0
- package/dist/components/toolbar/useToolbar.d.ts +7 -0
- package/dist/date-picker.css +8 -8
- package/dist/date-picker.js +4 -2
- package/dist/focusNavigation.js +12 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/slider.css +78 -69
- package/dist/slider.js +91 -16
- package/dist/toolbar.css +15 -0
- package/dist/toolbar.js +143 -0
- package/dist/utils/dom/focusNavigation.d.ts +4 -1
- package/docs/public-styles-api.md +4 -1
- package/package.json +31 -39
- package/docs/code-architecture.md +0 -118
package/README.md
CHANGED
|
@@ -147,6 +147,7 @@ For headless floating content and custom overlay markup, see the
|
|
|
147
147
|
|
|
148
148
|
## Development
|
|
149
149
|
|
|
150
|
-
Contributors should follow the
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
Contributors should follow the
|
|
151
|
+
[code architecture guide](https://github.com/daopk/ropav/blob/main/docs/code-architecture.md) for
|
|
152
|
+
module seams, dependency direction, and testing conventions. Run `pnpm --workspace-root verify`
|
|
153
|
+
before submitting a change.
|
package/dist/calendar.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@layer ropav.components {
|
|
2
|
-
.rp-calendar[data-v-
|
|
2
|
+
.rp-calendar[data-v-9df33d1a] {
|
|
3
3
|
--_rp-calendar-day-size: var(--rp-size-control-sm);
|
|
4
4
|
--_rp-calendar-font-size: var(--rp-font-size-sm);
|
|
5
5
|
--_rp-calendar-gap: var(--rp-spacing-1);
|
|
@@ -15,59 +15,59 @@
|
|
|
15
15
|
line-height: 1;
|
|
16
16
|
vertical-align: middle;
|
|
17
17
|
}
|
|
18
|
-
.rp-calendar--size-xs[data-v-
|
|
18
|
+
.rp-calendar--size-xs[data-v-9df33d1a] {
|
|
19
19
|
--_rp-calendar-day-size: var(--rp-size-control-xs);
|
|
20
20
|
--_rp-calendar-font-size: var(--rp-font-size-xs);
|
|
21
21
|
--_rp-calendar-gap: calc(var(--rp-spacing-1) / 2);
|
|
22
22
|
}
|
|
23
|
-
.rp-calendar--size-sm[data-v-
|
|
23
|
+
.rp-calendar--size-sm[data-v-9df33d1a] {
|
|
24
24
|
--_rp-calendar-day-size: var(--rp-size-control-sm);
|
|
25
25
|
--_rp-calendar-font-size: var(--rp-font-size-sm);
|
|
26
26
|
--_rp-calendar-gap: var(--rp-spacing-1);
|
|
27
27
|
}
|
|
28
|
-
.rp-calendar--size-md[data-v-
|
|
28
|
+
.rp-calendar--size-md[data-v-9df33d1a] {
|
|
29
29
|
--_rp-calendar-day-size: var(--rp-size-control-sm);
|
|
30
30
|
--_rp-calendar-font-size: var(--rp-font-size-sm);
|
|
31
31
|
--_rp-calendar-gap: var(--rp-spacing-1);
|
|
32
32
|
}
|
|
33
|
-
.rp-calendar--size-lg[data-v-
|
|
33
|
+
.rp-calendar--size-lg[data-v-9df33d1a] {
|
|
34
34
|
--_rp-calendar-day-size: var(--rp-size-control-md);
|
|
35
35
|
--_rp-calendar-font-size: var(--rp-font-size-md);
|
|
36
36
|
--_rp-calendar-gap: var(--rp-spacing-1);
|
|
37
37
|
}
|
|
38
|
-
.rp-calendar--size-xl[data-v-
|
|
38
|
+
.rp-calendar--size-xl[data-v-9df33d1a] {
|
|
39
39
|
--_rp-calendar-day-size: var(--rp-size-control-lg);
|
|
40
40
|
--_rp-calendar-font-size: var(--rp-font-size-lg);
|
|
41
41
|
--_rp-calendar-gap: var(--rp-spacing-2);
|
|
42
42
|
}
|
|
43
|
-
.rp-calendar--radius-none[data-v-
|
|
43
|
+
.rp-calendar--radius-none[data-v-9df33d1a] {
|
|
44
44
|
--_rp-calendar-radius: 0;
|
|
45
45
|
}
|
|
46
|
-
.rp-calendar--radius-xs[data-v-
|
|
46
|
+
.rp-calendar--radius-xs[data-v-9df33d1a] {
|
|
47
47
|
--_rp-calendar-radius: var(--rp-radius-xs);
|
|
48
48
|
}
|
|
49
|
-
.rp-calendar--radius-sm[data-v-
|
|
49
|
+
.rp-calendar--radius-sm[data-v-9df33d1a] {
|
|
50
50
|
--_rp-calendar-radius: var(--rp-radius-sm);
|
|
51
51
|
}
|
|
52
|
-
.rp-calendar--radius-md[data-v-
|
|
52
|
+
.rp-calendar--radius-md[data-v-9df33d1a] {
|
|
53
53
|
--_rp-calendar-radius: var(--rp-radius-md);
|
|
54
54
|
}
|
|
55
|
-
.rp-calendar--radius-lg[data-v-
|
|
55
|
+
.rp-calendar--radius-lg[data-v-9df33d1a] {
|
|
56
56
|
--_rp-calendar-radius: var(--rp-radius-lg);
|
|
57
57
|
}
|
|
58
|
-
.rp-calendar--radius-xl[data-v-
|
|
58
|
+
.rp-calendar--radius-xl[data-v-9df33d1a] {
|
|
59
59
|
--_rp-calendar-radius: var(--rp-radius-xl);
|
|
60
60
|
}
|
|
61
|
-
.rp-calendar--radius-full[data-v-
|
|
61
|
+
.rp-calendar--radius-full[data-v-9df33d1a] {
|
|
62
62
|
--_rp-calendar-radius: var(--rp-radius-full);
|
|
63
63
|
}
|
|
64
|
-
.rp-calendar__header[data-v-
|
|
64
|
+
.rp-calendar__header[data-v-9df33d1a] {
|
|
65
65
|
display: grid;
|
|
66
66
|
grid-template-columns: var(--_rp-calendar-day-size) 1fr var(--_rp-calendar-day-size);
|
|
67
67
|
align-items: center;
|
|
68
68
|
gap: var(--_rp-calendar-gap);
|
|
69
69
|
}
|
|
70
|
-
.rp-calendar__month-label[data-v-
|
|
70
|
+
.rp-calendar__month-label[data-v-9df33d1a] {
|
|
71
71
|
overflow: hidden;
|
|
72
72
|
font-weight: var(--rp-font-weight-semibold);
|
|
73
73
|
line-height: var(--_rp-calendar-day-size);
|
|
@@ -75,7 +75,18 @@
|
|
|
75
75
|
text-overflow: ellipsis;
|
|
76
76
|
white-space: nowrap;
|
|
77
77
|
}
|
|
78
|
-
.rp-
|
|
78
|
+
.rp-calendar__month-label--visually-hidden[data-v-9df33d1a] {
|
|
79
|
+
position: absolute;
|
|
80
|
+
width: 1px;
|
|
81
|
+
height: 1px;
|
|
82
|
+
padding: 0;
|
|
83
|
+
margin: -1px;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
clip: rect(0, 0, 0, 0);
|
|
86
|
+
white-space: nowrap;
|
|
87
|
+
border-width: 0;
|
|
88
|
+
}
|
|
89
|
+
.rp-calendar__control[data-v-9df33d1a], .rp-calendar__day[data-v-9df33d1a] {
|
|
79
90
|
padding: 0;
|
|
80
91
|
font: inherit;
|
|
81
92
|
background: none;
|
|
@@ -91,60 +102,60 @@
|
|
|
91
102
|
color: inherit;
|
|
92
103
|
transition: color var(--rp-transition-fast), background-color var(--rp-transition-fast), box-shadow var(--rp-transition-fast);
|
|
93
104
|
}
|
|
94
|
-
.rp-calendar__control[data-v-
|
|
105
|
+
.rp-calendar__control[data-v-9df33d1a]:focus-visible, .rp-calendar__day[data-v-9df33d1a]:focus-visible {
|
|
95
106
|
outline: none;
|
|
96
107
|
box-shadow: 0 0 0 var(--rp-border-width-medium) var(--rp-color-focus-ring);
|
|
97
108
|
}
|
|
98
109
|
@media (forced-colors: active) {
|
|
99
|
-
.rp-calendar__control[data-v-
|
|
110
|
+
.rp-calendar__control[data-v-9df33d1a]:focus-visible, .rp-calendar__day[data-v-9df33d1a]:focus-visible {
|
|
100
111
|
outline: var(--rp-border-width-medium) solid Highlight;
|
|
101
112
|
outline-offset: 2px;
|
|
102
113
|
box-shadow: none;
|
|
103
114
|
}
|
|
104
115
|
}
|
|
105
|
-
.rp-calendar__control[data-v-
|
|
116
|
+
.rp-calendar__control[data-v-9df33d1a] {
|
|
106
117
|
color: var(--rp-color-control-icon);
|
|
107
118
|
}
|
|
108
|
-
.rp-calendar__control[data-v-
|
|
119
|
+
.rp-calendar__control[data-v-9df33d1a]:hover:not(:disabled) {
|
|
109
120
|
color: var(--rp-color-control-fg);
|
|
110
121
|
background-color: var(--rp-color-default-hover);
|
|
111
122
|
}
|
|
112
|
-
.rp-calendar__control[data-v-
|
|
123
|
+
.rp-calendar__control[data-v-9df33d1a]:disabled {
|
|
113
124
|
cursor: not-allowed;
|
|
114
125
|
opacity: var(--rp-opacity-disabled);
|
|
115
126
|
}
|
|
116
|
-
.rp-calendar__control[data-v-
|
|
127
|
+
.rp-calendar__control[data-v-9df33d1a] > svg {
|
|
117
128
|
width: 1em;
|
|
118
129
|
height: 1em;
|
|
119
130
|
}
|
|
120
|
-
.rp-calendar__grid[data-v-
|
|
131
|
+
.rp-calendar__grid[data-v-9df33d1a] {
|
|
121
132
|
border-spacing: var(--_rp-calendar-gap);
|
|
122
133
|
margin: calc(-1 * var(--_rp-calendar-gap));
|
|
123
134
|
table-layout: fixed;
|
|
124
135
|
}
|
|
125
|
-
.rp-calendar__weekday[data-v-
|
|
136
|
+
.rp-calendar__weekday[data-v-9df33d1a], .rp-calendar__day-cell[data-v-9df33d1a] {
|
|
126
137
|
box-sizing: border-box;
|
|
127
138
|
width: var(--_rp-calendar-day-size);
|
|
128
139
|
height: var(--_rp-calendar-day-size);
|
|
129
140
|
padding: 0;
|
|
130
141
|
text-align: center;
|
|
131
142
|
}
|
|
132
|
-
.rp-calendar__weekday[data-v-
|
|
143
|
+
.rp-calendar__weekday[data-v-9df33d1a] {
|
|
133
144
|
color: var(--rp-color-dimmed);
|
|
134
145
|
font-size: 0.85em;
|
|
135
146
|
font-weight: var(--rp-font-weight-medium);
|
|
136
147
|
}
|
|
137
|
-
.rp-calendar__day[data-v-
|
|
148
|
+
.rp-calendar__day[data-v-9df33d1a] {
|
|
138
149
|
position: relative;
|
|
139
150
|
font: inherit;
|
|
140
151
|
}
|
|
141
|
-
.rp-calendar__day[data-v-
|
|
152
|
+
.rp-calendar__day[data-v-9df33d1a]:hover:not(:disabled):not(.rp-calendar__day--selected) {
|
|
142
153
|
background-color: var(--rp-color-default-hover);
|
|
143
154
|
}
|
|
144
|
-
.rp-calendar__day--outside[data-v-
|
|
155
|
+
.rp-calendar__day--outside[data-v-9df33d1a] {
|
|
145
156
|
color: var(--rp-color-dimmed);
|
|
146
157
|
}
|
|
147
|
-
.rp-calendar__day--today[data-v-
|
|
158
|
+
.rp-calendar__day--today[data-v-9df33d1a]::after {
|
|
148
159
|
position: absolute;
|
|
149
160
|
inset-inline-start: 50%;
|
|
150
161
|
bottom: max(2px, var(--_rp-calendar-day-size) * 0.1);
|
|
@@ -155,18 +166,18 @@
|
|
|
155
166
|
content: "";
|
|
156
167
|
transform: translateX(-50%);
|
|
157
168
|
}
|
|
158
|
-
.rp-calendar__day--selected[data-v-
|
|
169
|
+
.rp-calendar__day--selected[data-v-9df33d1a] {
|
|
159
170
|
color: var(--rp-color-control-selected-fg);
|
|
160
171
|
background-color: var(--rp-color-control-selected-bg);
|
|
161
172
|
}
|
|
162
|
-
.rp-calendar__day--selected[data-v-
|
|
173
|
+
.rp-calendar__day--selected[data-v-9df33d1a]:hover:not(:disabled) {
|
|
163
174
|
background-color: var(--rp-primary-color-filled-hover);
|
|
164
175
|
}
|
|
165
|
-
.rp-calendar__day[data-v-
|
|
176
|
+
.rp-calendar__day[data-v-9df33d1a]:disabled {
|
|
166
177
|
cursor: not-allowed;
|
|
167
178
|
opacity: var(--rp-opacity-disabled);
|
|
168
179
|
}
|
|
169
|
-
.rp-calendar--disabled[data-v-
|
|
180
|
+
.rp-calendar--disabled[data-v-9df33d1a] {
|
|
170
181
|
opacity: var(--rp-opacity-disabled);
|
|
171
182
|
cursor: not-allowed;
|
|
172
183
|
}
|
package/dist/calendar.js
CHANGED
|
@@ -6,7 +6,7 @@ import { t as bem } from "./bem.js";
|
|
|
6
6
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
7
7
|
import { t as chevron_left_default } from "./chevron-left.js";
|
|
8
8
|
import { t as chevron_right_default } from "./chevron-right.js";
|
|
9
|
-
import { child, computed, createComponent, createFor, createIf, createSlot,
|
|
9
|
+
import { child, computed, createComponent, createFor, createIf, createSlot, defineVaporComponent, next, nextTick, on, onBeforeUnmount, onMounted, ref, renderEffect, setDynamicProps, setInsertionState, setStaticTemplateRef, setText, shallowRef, template, toDisplayString, txt, unref, useId, watch } from "vue";
|
|
10
10
|
//#region src/utils/date.ts
|
|
11
11
|
function isValidDate(value) {
|
|
12
12
|
return value instanceof Date && Number.isFinite(value.getTime());
|
|
@@ -499,12 +499,14 @@ function useCalendar(props, emit) {
|
|
|
499
499
|
}
|
|
500
500
|
//#endregion
|
|
501
501
|
//#region src/components/calendar/calendar.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
502
|
-
var t0 = template("<
|
|
503
|
-
var t1 = template(" ");
|
|
504
|
-
var t2 = template("<
|
|
505
|
-
var t3 = template("
|
|
506
|
-
var t4 = template("<
|
|
507
|
-
var t5 = template("<
|
|
502
|
+
var t0 = template("<div data-v-9df33d1a><button data-v-9df33d1a></button><span data-v-9df33d1a> </span><button data-v-9df33d1a></button>");
|
|
503
|
+
var t1 = template("<span data-v-9df33d1a> ");
|
|
504
|
+
var t2 = template("<th data-v-9df33d1a> ");
|
|
505
|
+
var t3 = template(" ");
|
|
506
|
+
var t4 = template("<button data-v-9df33d1a>");
|
|
507
|
+
var t5 = template("<td data-v-9df33d1a>");
|
|
508
|
+
var t6 = template("<tr data-v-9df33d1a>");
|
|
509
|
+
var t7 = template("<div data-v-9df33d1a><table data-v-9df33d1a><thead data-v-9df33d1a><tr data-v-9df33d1a></thead><tbody data-v-9df33d1a>", 1);
|
|
508
510
|
//#endregion
|
|
509
511
|
//#region src/components/calendar/calendar.vue
|
|
510
512
|
var calendar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
|
|
@@ -532,6 +534,10 @@ var calendar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
532
534
|
type: Boolean,
|
|
533
535
|
default: false
|
|
534
536
|
},
|
|
537
|
+
showHeader: {
|
|
538
|
+
type: Boolean,
|
|
539
|
+
default: true
|
|
540
|
+
},
|
|
535
541
|
disabled: {
|
|
536
542
|
type: Boolean,
|
|
537
543
|
default: false
|
|
@@ -543,6 +549,7 @@ var calendar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
543
549
|
size: { default: "md" },
|
|
544
550
|
radius: { default: "sm" },
|
|
545
551
|
ariaLabel: { default: void 0 },
|
|
552
|
+
getDayAriaLabel: {},
|
|
546
553
|
previousLabel: { default: "Previous month" },
|
|
547
554
|
nextLabel: { default: "Next month" },
|
|
548
555
|
classNames: {},
|
|
@@ -584,6 +591,9 @@ var calendar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
584
591
|
"data-disabled": toPresenceAttribute(props.disabled || day.disabled)
|
|
585
592
|
};
|
|
586
593
|
}
|
|
594
|
+
function getDayLabel(day) {
|
|
595
|
+
return props.getDayAriaLabel?.(day) ?? day.ariaLabel;
|
|
596
|
+
}
|
|
587
597
|
function isFocusable(day) {
|
|
588
598
|
return !props.disabled && !day.disabled && isSameDate(day.date, focusableDate.value);
|
|
589
599
|
}
|
|
@@ -593,122 +603,137 @@ var calendar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
593
603
|
(rootRef.value?.querySelector(".rp-calendar__day[tabindex=\"0\"]") ?? rootRef.value?.querySelector(".rp-calendar__control:not(:disabled)"))?.focus({ preventScroll: true });
|
|
594
604
|
}
|
|
595
605
|
});
|
|
596
|
-
const
|
|
597
|
-
const
|
|
598
|
-
const
|
|
599
|
-
const
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
606
|
+
const n33 = t7();
|
|
607
|
+
const n32 = child(n33, 1);
|
|
608
|
+
const n18 = child(n32);
|
|
609
|
+
const n17 = child(n18);
|
|
610
|
+
const n31 = next(n18, 1);
|
|
611
|
+
renderEffect(() => setDynamicProps(n33, [rootAttrs.value]));
|
|
612
|
+
setInsertionState(n33, 0);
|
|
613
|
+
createIf(() => __props.showHeader, () => {
|
|
614
|
+
const n11 = t0();
|
|
615
|
+
const n5 = child(n11);
|
|
616
|
+
const n6 = next(n5, 1);
|
|
617
|
+
const n10 = next(n6, 2);
|
|
618
|
+
renderEffect(() => {
|
|
619
|
+
const _getPartAttrs = unref(getPartAttrs);
|
|
620
|
+
setDynamicProps(n11, [_getPartAttrs("header", { class: "rp-calendar__header" })]);
|
|
621
|
+
setDynamicProps(n5, [_getPartAttrs("previousControl", { class: "rp-calendar__control rp-calendar__control--previous" }), {
|
|
622
|
+
type: "button",
|
|
623
|
+
"aria-label": __props.previousLabel,
|
|
624
|
+
disabled: unref(previousDisabled)
|
|
625
|
+
}]);
|
|
626
|
+
});
|
|
627
|
+
setInsertionState(n5, null, 0);
|
|
628
|
+
createSlot("previous-icon", null, () => {
|
|
629
|
+
return createComponent(unref(chevron_left_default), { "aria-hidden": "true" });
|
|
630
|
+
}, 1);
|
|
631
|
+
on(n5, "click", () => unref(navigateMonth)(-1));
|
|
632
|
+
const x6 = txt(n6);
|
|
633
|
+
renderEffect(() => {
|
|
634
|
+
const _getPartAttrs = unref(getPartAttrs);
|
|
635
|
+
setDynamicProps(n6, [
|
|
636
|
+
{ id: monthLabelId },
|
|
637
|
+
_getPartAttrs("monthLabel", { class: "rp-calendar__month-label" }),
|
|
638
|
+
{ "aria-live": "polite" }
|
|
639
|
+
]);
|
|
640
|
+
setText(x6, toDisplayString(unref(monthLabel)));
|
|
641
|
+
setDynamicProps(n10, [_getPartAttrs("nextControl", { class: "rp-calendar__control rp-calendar__control--next" }), {
|
|
642
|
+
type: "button",
|
|
643
|
+
"aria-label": __props.nextLabel,
|
|
644
|
+
disabled: unref(nextDisabled)
|
|
645
|
+
}]);
|
|
646
|
+
});
|
|
647
|
+
setInsertionState(n10, null, 0);
|
|
648
|
+
createSlot("next-icon", null, () => {
|
|
649
|
+
return createComponent(unref(chevron_right_default), { "aria-hidden": "true" });
|
|
650
|
+
}, 1);
|
|
651
|
+
on(n10, "click", () => unref(navigateMonth)(1));
|
|
652
|
+
return n11;
|
|
653
|
+
}, () => {
|
|
654
|
+
const n13 = t1();
|
|
655
|
+
const x13 = txt(n13);
|
|
656
|
+
renderEffect(() => {
|
|
657
|
+
setDynamicProps(n13, [
|
|
658
|
+
{ id: monthLabelId },
|
|
659
|
+
unref(getPartAttrs)("monthLabel", { class: ["rp-calendar__month-label", "rp-calendar__month-label--visually-hidden"] }),
|
|
660
|
+
{ "aria-live": "polite" }
|
|
661
|
+
]);
|
|
662
|
+
setText(x13, toDisplayString(unref(monthLabel)));
|
|
663
|
+
});
|
|
664
|
+
return n13;
|
|
665
|
+
}, 261);
|
|
641
666
|
renderEffect(() => {
|
|
642
667
|
const _getPartAttrs = unref(getPartAttrs);
|
|
643
668
|
const _ariaLabel = __props.ariaLabel;
|
|
644
|
-
setDynamicProps(
|
|
669
|
+
setDynamicProps(n32, [_getPartAttrs("grid", { class: "rp-calendar__grid" }), {
|
|
645
670
|
role: "grid",
|
|
646
671
|
"aria-label": _ariaLabel,
|
|
647
672
|
"aria-labelledby": _ariaLabel ? void 0 : monthLabelId,
|
|
648
673
|
"aria-readonly": __props.readonly || void 0,
|
|
649
674
|
"aria-disabled": __props.disabled || void 0
|
|
650
675
|
}]);
|
|
651
|
-
setDynamicProps(
|
|
676
|
+
setDynamicProps(n18, [_getPartAttrs("weekdays", { class: "rp-calendar__weekdays" })]);
|
|
652
677
|
});
|
|
653
|
-
setInsertionState(
|
|
678
|
+
setInsertionState(n17, null, 0);
|
|
654
679
|
createFor(() => unref(weekdays), (_for_item0) => {
|
|
655
|
-
const
|
|
656
|
-
const
|
|
680
|
+
const n16 = t2();
|
|
681
|
+
const x16 = txt(n16);
|
|
657
682
|
renderEffect(() => {
|
|
658
683
|
const _weekday = _for_item0.value;
|
|
659
|
-
setDynamicProps(
|
|
684
|
+
setDynamicProps(n16, [unref(getPartAttrs)("weekday", { class: "rp-calendar__weekday" }), {
|
|
660
685
|
scope: "col",
|
|
661
686
|
"aria-label": _weekday.ariaLabel
|
|
662
687
|
}]);
|
|
663
|
-
setText(
|
|
688
|
+
setText(x16, toDisplayString(_weekday.label));
|
|
664
689
|
});
|
|
665
|
-
return
|
|
690
|
+
return n16;
|
|
666
691
|
}, (weekday) => weekday.key, 9);
|
|
667
|
-
setInsertionState(
|
|
692
|
+
setInsertionState(n31, null, 0);
|
|
668
693
|
createFor(() => unref(weeks), (_for_item0, _for_key0) => {
|
|
669
|
-
const
|
|
670
|
-
renderEffect(() => setDynamicProps(
|
|
671
|
-
setInsertionState(
|
|
694
|
+
const n30 = t6();
|
|
695
|
+
renderEffect(() => setDynamicProps(n30, [unref(getPartAttrs)("week", { class: "rp-calendar__week" })]));
|
|
696
|
+
setInsertionState(n30, null, 0);
|
|
672
697
|
createFor(() => _for_item0.value, (_for_item1) => {
|
|
673
|
-
const
|
|
698
|
+
const n29 = t5();
|
|
674
699
|
renderEffect(() => {
|
|
675
700
|
const _day = _for_item1.value;
|
|
676
|
-
setDynamicProps(
|
|
701
|
+
setDynamicProps(n29, [unref(getPartAttrs)("dayCell", { class: "rp-calendar__day-cell" }), {
|
|
677
702
|
role: "gridcell",
|
|
678
703
|
"aria-selected": _day.hidden ? void 0 : _day.selected
|
|
679
704
|
}]);
|
|
680
705
|
});
|
|
681
|
-
setInsertionState(
|
|
706
|
+
setInsertionState(n29, null, 0);
|
|
682
707
|
createIf(() => !_for_item1.value.hidden, () => {
|
|
683
|
-
const
|
|
708
|
+
const n28 = t4();
|
|
684
709
|
renderEffect(() => {
|
|
685
710
|
const _day = _for_item1.value;
|
|
686
|
-
setDynamicProps(
|
|
711
|
+
setDynamicProps(n28, [getDayAttrs(_day), {
|
|
687
712
|
type: "button",
|
|
688
713
|
disabled: __props.disabled || _day.disabled,
|
|
689
|
-
"aria-label": _day
|
|
714
|
+
"aria-label": getDayLabel(_day),
|
|
690
715
|
"aria-current": _day.today ? "date" : void 0,
|
|
691
716
|
tabindex: isFocusable(_day) ? 0 : -1
|
|
692
717
|
}]);
|
|
693
718
|
});
|
|
694
|
-
setInsertionState(
|
|
719
|
+
setInsertionState(n28, null, 0);
|
|
695
720
|
createSlot("day", { $: [() => _for_item1.value, { select: () => (() => unref(selectDate)(_for_item1.value)) }] }, () => {
|
|
696
|
-
const
|
|
697
|
-
renderEffect(() => setText(
|
|
698
|
-
return
|
|
721
|
+
const n27 = t3();
|
|
722
|
+
renderEffect(() => setText(n27, toDisplayString(_for_item1.value.label)));
|
|
723
|
+
return n27;
|
|
699
724
|
}, 1);
|
|
700
|
-
on(
|
|
701
|
-
on(
|
|
702
|
-
on(
|
|
703
|
-
return
|
|
725
|
+
on(n28, "click", () => unref(selectDate)(_for_item1.value));
|
|
726
|
+
on(n28, "focus", () => unref(onDayFocus)(_for_item1.value));
|
|
727
|
+
on(n28, "keydown", ($event) => unref(onDayKeydown)($event, _for_item1.value));
|
|
728
|
+
return n28;
|
|
704
729
|
});
|
|
705
|
-
return
|
|
730
|
+
return n29;
|
|
706
731
|
}, (day) => day.key, 9);
|
|
707
|
-
return
|
|
732
|
+
return n30;
|
|
708
733
|
}, (week, weekIndex) => weekIndex, 9);
|
|
709
|
-
|
|
710
|
-
return
|
|
734
|
+
setStaticTemplateRef(n33, rootRef, null, "rootRef");
|
|
735
|
+
return n33;
|
|
711
736
|
}
|
|
712
|
-
}), [["__scopeId", "data-v-
|
|
737
|
+
}), [["__scopeId", "data-v-9df33d1a"]]);
|
|
713
738
|
//#endregion
|
|
714
739
|
export { parseDateKey as a, normalizeDate as i, isDateUnavailable as n, toLocalDate as o, isValidDate as r, calendar_default as t };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as Calendar } from './calendar.js';
|
|
2
2
|
export { calendarParts, calendarRadiuses, calendarSizes, calendarWeekdayFormats } from './types.js';
|
|
3
|
-
export type { CalendarDay, CalendarDaySlotProps, CalendarDisabledDates, CalendarPart, CalendarProps, CalendarRadius, CalendarSize, CalendarWeekday, CalendarWeekdayFormat, } from './types.js';
|
|
3
|
+
export type { CalendarDay, CalendarDaySlotProps, CalendarDisabledDates, CalendarGetDayAriaLabel, CalendarPart, CalendarProps, CalendarRadius, CalendarSize, CalendarWeekday, CalendarWeekdayFormat, } from './types.js';
|
|
@@ -9,6 +9,7 @@ export type CalendarSize = (typeof calendarSizes)[number];
|
|
|
9
9
|
export type CalendarRadius = (typeof calendarRadiuses)[number];
|
|
10
10
|
export type CalendarWeekdayFormat = (typeof calendarWeekdayFormats)[number];
|
|
11
11
|
export type CalendarDisabledDates = DisabledDateRule;
|
|
12
|
+
export type CalendarGetDayAriaLabel = (day: Readonly<CalendarDay>) => string;
|
|
12
13
|
export interface CalendarDay {
|
|
13
14
|
date: Date;
|
|
14
15
|
key: string;
|
|
@@ -43,11 +44,13 @@ export interface CalendarProps extends StylesApiProps<CalendarPart> {
|
|
|
43
44
|
disabledDates?: CalendarDisabledDates;
|
|
44
45
|
fixedWeeks?: boolean;
|
|
45
46
|
hideOutsideDates?: boolean;
|
|
47
|
+
showHeader?: boolean;
|
|
46
48
|
disabled?: boolean;
|
|
47
49
|
readonly?: boolean;
|
|
48
50
|
size?: CalendarSize;
|
|
49
51
|
radius?: CalendarRadius;
|
|
50
52
|
ariaLabel?: string;
|
|
53
|
+
getDayAriaLabel?: CalendarGetDayAriaLabel;
|
|
51
54
|
previousLabel?: string;
|
|
52
55
|
nextLabel?: string;
|
|
53
56
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as DatePicker } from './date-picker.js';
|
|
2
2
|
export { datePickerParts } from './types.js';
|
|
3
|
-
export type { DatePickerDaySlotProps, DatePickerFormat, DatePickerParse, DatePickerPart, DatePickerProps, } from './types.js';
|
|
3
|
+
export type { DatePickerDaySlotProps, DatePickerFormat, DatePickerGetDayAriaLabel, DatePickerParse, DatePickerPart, DatePickerProps, } from './types.js';
|
|
4
4
|
export { defaultDatePickerFormat, formatDatePickerValue, normalizeDatePickerValue, parseDatePickerValue, } from './datePickerModel.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'vue';
|
|
2
2
|
import { StylesApiProps } from '../../styles-api.js';
|
|
3
|
-
import { CalendarDaySlotProps, CalendarDisabledDates, CalendarRadius, CalendarSize, CalendarWeekdayFormat } from '../calendar/types.js';
|
|
3
|
+
import { CalendarDaySlotProps, CalendarDisabledDates, CalendarGetDayAriaLabel, CalendarRadius, CalendarSize, CalendarWeekdayFormat } from '../calendar/types.js';
|
|
4
4
|
import { InputRadius, InputSize } from '../input/types.js';
|
|
5
5
|
import { PopoverPlacement } from '../popover/types.js';
|
|
6
6
|
export declare const datePickerParts: readonly ["root", "control", "input", "clear", "indicator", "content", "calendar", "calendarHeader", "calendarControl", "calendarMonthLabel", "calendarWeekdays", "calendarWeekday", "calendarGrid", "calendarWeek", "calendarDayCell", "calendarDay"];
|
|
@@ -8,6 +8,7 @@ export type DatePickerPart = (typeof datePickerParts)[number];
|
|
|
8
8
|
export type DatePickerFormat = (date: Date) => string;
|
|
9
9
|
export type DatePickerParse = (value: string) => Date | null;
|
|
10
10
|
export type DatePickerDaySlotProps = CalendarDaySlotProps;
|
|
11
|
+
export type DatePickerGetDayAriaLabel = CalendarGetDayAriaLabel;
|
|
11
12
|
export interface DatePickerProps extends StylesApiProps<DatePickerPart> {
|
|
12
13
|
id?: string;
|
|
13
14
|
name?: string;
|
|
@@ -27,6 +28,7 @@ export interface DatePickerProps extends StylesApiProps<DatePickerPart> {
|
|
|
27
28
|
disabledDates?: CalendarDisabledDates;
|
|
28
29
|
fixedWeeks?: boolean;
|
|
29
30
|
hideOutsideDates?: boolean;
|
|
31
|
+
getDayAriaLabel?: DatePickerGetDayAriaLabel;
|
|
30
32
|
allowInput?: boolean;
|
|
31
33
|
clearable?: boolean;
|
|
32
34
|
closeOnSelect?: boolean;
|
|
@@ -42,7 +42,7 @@ export declare function useSlider(props: SliderStateProps, onChange: (value: num
|
|
|
42
42
|
tooltipFormattedValue: import('vue').ComputedRef<string | number>;
|
|
43
43
|
tooltipContent: import('vue').ComputedRef<string>;
|
|
44
44
|
onInput: (event: Event) => void;
|
|
45
|
-
|
|
45
|
+
onTrackPointerDown: (event: PointerEvent) => boolean;
|
|
46
46
|
onTooltipPointerMove: (event: PointerEvent) => void;
|
|
47
47
|
onTooltipTrackEnter: (event: PointerEvent) => void;
|
|
48
48
|
onTooltipTrackLeave: () => void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { SliderBounds } from './sliderModel.js';
|
|
3
|
+
import { SliderOrientation } from './types.js';
|
|
4
|
+
interface UseSliderPointerOptions {
|
|
5
|
+
bounds: ComputedRef<SliderBounds>;
|
|
6
|
+
disabled: () => boolean;
|
|
7
|
+
inputRef: Ref<HTMLInputElement | null>;
|
|
8
|
+
orientation: () => SliderOrientation;
|
|
9
|
+
step: ComputedRef<number | 'any'>;
|
|
10
|
+
updateValue: (value: number) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function useSliderPointer(options: UseSliderPointerOptions): {
|
|
13
|
+
onPointerDown: (event: PointerEvent) => boolean;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -30,4 +30,5 @@ export declare function useSliderValueState(props: SliderStateProps, onChange: (
|
|
|
30
30
|
hasMarkLabels: import('vue').ComputedRef<boolean>;
|
|
31
31
|
trackSlotProps: import('vue').ComputedRef<SliderTrackSlotProps>;
|
|
32
32
|
onInput: (event: Event) => void;
|
|
33
|
+
updateValue: (value: number) => void;
|
|
33
34
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ToolbarProps } from './types.js';
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<ToolbarProps> & (typeof globalThis extends {
|
|
4
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
+
} ? P : {});
|
|
6
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
7
|
+
nativeElement: import('vue').ShallowRef<HTMLElement | null, HTMLElement | null>;
|
|
8
|
+
focus: () => void;
|
|
9
|
+
}>) => void;
|
|
10
|
+
attrs: any;
|
|
11
|
+
slots: {
|
|
12
|
+
default?: (props: {}) => any;
|
|
13
|
+
};
|
|
14
|
+
emit: {};
|
|
15
|
+
}>) => import('vue').VNode & {
|
|
16
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
21
|
+
[K in keyof T]: T[K];
|
|
22
|
+
} : {
|
|
23
|
+
[K in keyof T as K]: T[K];
|
|
24
|
+
}) & {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StylesApiProps } from '../../styles-api.js';
|
|
2
|
+
export declare const toolbarParts: readonly ["root"];
|
|
3
|
+
export declare const toolbarOrientations: readonly ["horizontal", "vertical"];
|
|
4
|
+
export type ToolbarPart = (typeof toolbarParts)[number];
|
|
5
|
+
export type ToolbarOrientation = (typeof toolbarOrientations)[number];
|
|
6
|
+
export interface ToolbarProps extends StylesApiProps<ToolbarPart> {
|
|
7
|
+
id?: string;
|
|
8
|
+
orientation?: ToolbarOrientation;
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
describedby?: string;
|
|
11
|
+
labelledby?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ShallowRef } from 'vue';
|
|
2
|
+
import { ToolbarOrientation } from './types.js';
|
|
3
|
+
export declare function useToolbar(root: ShallowRef<HTMLElement | null>, getOrientation: () => ToolbarOrientation): {
|
|
4
|
+
focus: () => void;
|
|
5
|
+
onFocusin: (event: FocusEvent) => void;
|
|
6
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
7
|
+
};
|