@astryx-vue/core 0.2.1 → 0.2.3
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/THIRD_PARTY_NOTICES.md +2 -0
- package/dist/AppShell/index.d.ts +1 -1
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-1wNIEtK_.js → AppShell-Dd-D4bA2.js} +2 -2
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Badge/index.d.ts +2 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Breadcrumbs/index.d.ts +3 -2
- package/dist/Breadcrumbs/index.js +3 -2
- package/dist/{Breadcrumbs-C97HmjkC.js → Breadcrumbs-CWGfgLNK.js} +13 -8
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +2 -2
- package/dist/Calendar/index.js +1 -1
- package/dist/Calendar-CnOsSjMY.js +656 -0
- package/dist/Card/index.d.ts +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-BGUnskjo.js → Carousel-JA7ilqI_.js} +2 -2
- package/dist/Chat/index.d.ts +2 -2
- package/dist/Chat/index.js +2 -2
- package/dist/Chat-C7WrCOE4.js +3148 -0
- package/dist/CheckboxIndicator/index.js +1 -1
- package/dist/CheckboxIndicator-D37cm2Rh.js +68 -0
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-CMsEE1_4.js → CheckboxInput-25Q8ItH-.js} +10 -9
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-BbCPiend.js → CheckboxList-CnCGnkZk.js} +77 -24
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-DunoAqVH.js → Citation-CtwrU33I.js} +2 -2
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Code/index.d.ts +1 -1
- package/dist/Code/index.js +2 -2
- package/dist/{Code-yb_KOFtJ.js → Code-BvefYRpx.js} +2 -1
- package/dist/{CodeBlock-CAF-VJnh.js → CodeBlock-BZGzYeoL.js} +1 -1
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-DvMiYJp7.js → Collapsible-3YerR-FO.js} +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-xfm9ldUI.js → CommandPalette-BNbM9T9y.js} +1 -1
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-B6lBTRhP.js → ComplexSelector-LtbLlrcj.js} +3 -3
- package/dist/ContextMenu/index.d.ts +3 -2
- package/dist/ContextMenu/index.js +3 -2
- package/dist/{ContextMenu-DUkED3Z3.js → ContextMenu-DVQl0xL5.js} +204 -56
- package/dist/DateInput/index.d.ts +2 -2
- package/dist/DateInput/index.js +1 -1
- package/dist/DateInput-zm8sNc0t.js +743 -0
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-e9KSxBBK.js → DateRangeInput-DlVFzrf7.js} +54 -19
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-fSOfuLex.js → DateTimeInput-C7Z-p6Yd.js} +54 -15
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Divider/index.d.ts +1 -1
- package/dist/DropdownMenu/index.d.ts +3 -3
- package/dist/DropdownMenu/index.js +4 -3
- package/dist/{DropdownMenu-8G0B1UND.js → DropdownMenu-BoZChdev.js} +308 -63
- package/dist/DropdownMenu-u1psFjis.js +325 -0
- package/dist/DropdownMenuRadioItem.vue-uVM0FD2f.d.ts +564 -0
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-D-fchyQH.js → FileInput-QdlZn7qK.js} +2 -2
- package/dist/Icon/index.d.ts +4 -3
- package/dist/Icon/index.js +2 -2
- package/dist/{Icon-Bku25g_K.js → Icon-bteSId7T.js} +114 -14
- package/dist/Indicator/index.d.ts +3 -0
- package/dist/Indicator/index.js +2 -0
- package/dist/InputGroup/index.d.ts +2 -2
- package/dist/InputGroup/index.js +3 -2
- package/dist/InputGroup-BzR6JRZb.js +129 -0
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-uuVGgHxW.js → Lightbox-BSzfqZ-u.js} +2 -2
- package/dist/List/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-DLICa3db.js → Markdown-B6tSqenv.js} +8 -5
- package/dist/MetadataList/index.d.ts +1 -1
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-h492rqEN.js → MetadataList-aN1tRn6W.js} +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-BMj3Wtuq.js → MobileNavToggle-fqcSafkc.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-DkYi5az5.js → MoreMenu-B3brqdK_.js} +1 -1
- package/dist/MultiSelector/index.d.ts +2 -2
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-C2IS-EaU.js → MultiSelector-BD5PMgez.js} +303 -121
- package/dist/{NavDisclosure-DHrSNRDR.js → NavDisclosure-DbYLDXK0.js} +1 -1
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavMenu/index.js +2 -2
- package/dist/{NavMenuItem-B-k7olt5.js → NavMenuItem-DrwIMHKO.js} +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-CjfAsFwj.js → NumberInput-CBeU4lEl.js} +1 -1
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-BTmrtvXR.js → Outline--HVMSB6i.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-CRE8BE7V.js → OverflowList-FMh7r-r_.js} +3 -3
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-BpGXPmc7.js → Pagination-DlIvESjx.js} +2 -2
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-Crhk9PNP.js → Popover-D7zqpFwU.js} +1 -1
- package/dist/PowerSearch/index.d.ts +2 -0
- package/dist/PowerSearch/index.js +2 -0
- package/dist/PowerSearch-CMG7Rb69.js +2386 -0
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-BqjdSCfJ.js → RadioGroup-CBqUPq_L.js} +16 -8
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioList-DI8ujXcT.js → RadioList-CPOJn9Th.js} +1 -1
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{Resizable-CE8XQDL2.js → Resizable-CXpvj1TZ.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +2 -2
- package/dist/Selector/index.js +1 -1
- package/dist/Selector-BpPnuWH3.js +618 -0
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-DcDWBnXJ.js → SideNav-D4TupqgE.js} +3 -3
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-DZKaqEoz.js → Stepper-H-6-T5Ps.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/TabList/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-hm06QPiW.js → TabList-BlzkrObv.js} +2 -2
- package/dist/Table/index.d.ts +3 -3
- package/dist/Table/index.js +2 -2
- package/dist/Table-nqA_njNz.js +1982 -0
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Theme/index.d.ts +2 -1
- package/dist/Theme/index.js +1 -1
- package/dist/{Theme-BuUiiJNr.js → Theme-CejS9MHm.js} +21 -3
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-CAOYds8t.js → Thumbnail-CXb3m_Hv.js} +2 -2
- package/dist/{TimeField-BGbxCoKU.js → TimeField-B3cndWb0.js} +2 -2
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-DJP3l4ZS.js → TimeInput-BHQ_LKGm.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-BzRp8uWc.js → Timestamp-Cfuxbb3i.js} +3 -3
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-CjocuhzE.js → Token-CdVLH0_H.js} +2 -2
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-mYES5SPM.js → Tokenizer-DlD-S_8-.js} +4 -4
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-C2t6JkZb.js → TopNav-DzV874G7.js} +5 -5
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-THJ0KamE.js → TreeList-DEwvlZRV.js} +2 -2
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-D7VnvRpK.js → Typeahead-DQ3tmqYe.js} +4 -4
- package/dist/{useTypeaheadMenu-Ba7XpcZl.js → TypeaheadMenu-CGvo0Tud.js} +107 -107
- package/dist/{context-O2Vb8cJl.js → colorMode-CBgdgDSn.js} +1 -7
- package/dist/composables/index.d.ts +4 -4
- package/dist/composables/index.js +10 -5
- package/dist/{composables-CVfjp9h4.js → composables-DDI08XFF.js} +98 -1
- package/dist/context-Cws_tXTr.js +7 -0
- package/dist/context-D5-MwxnN.js +4 -0
- package/dist/{context-DzcK4T_C.js → context-DmOLCubj.js} +262 -12
- package/dist/{index-DimuSES0.d.ts → index-B1x05arQ.d.ts} +3 -1
- package/dist/index-B9WzWqzk.d.ts +18 -0
- package/dist/index-B9f1rUEv.d.ts +77 -0
- package/dist/{index-DnSrjbjP.d.ts → index-BB5yVIN-.d.ts} +2 -2
- package/dist/{index-Bu0Zd1uw.d.ts → index-BMn9ghAX.d.ts} +3 -3
- package/dist/{index-CJlBAXwj.d.ts → index-BRfR0lhb.d.ts} +41 -4
- package/dist/{index-DeOftUMq.d.ts → index-BTAgQRP0.d.ts} +762 -114
- package/dist/{index-DA52oIdw.d.ts → index-BcJBLWJ0.d.ts} +2 -2
- package/dist/{index-jdjcb3Js.d.ts → index-Bqb_Fyju.d.ts} +2 -2
- package/dist/{index-CNjbOgty.d.ts → index-C-QpeUlQ.d.ts} +2 -2
- package/dist/{index-I4J7gwa1.d.ts → index-C2sfHfBw.d.ts} +31 -5
- package/dist/{index-By2mSzUA.d.ts → index-CA6RbRWx.d.ts} +1 -1
- package/dist/{index-DnEh-HA0.d.ts → index-C_2Z65Rp.d.ts} +1 -1
- package/dist/{index-cG1E0U2s.d.ts → index-Ca8VIE4l.d.ts} +1 -1
- package/dist/{index-CRizexSC.d.ts → index-Ch6BbxCP.d.ts} +2 -67
- package/dist/{index-CBym0hSq.d.ts → index-ChWlKHjc.d.ts} +1 -1
- package/dist/{index-DXSs3rwa.d.ts → index-CngORuiq.d.ts} +137 -2
- package/dist/index-Ctu32CLv.d.ts +902 -0
- package/dist/{index-DQAnGHu7.d.ts → index-D1Twv_fL.d.ts} +65 -6
- package/dist/{index-D_nYxnNv.d.ts → index-D7-WTV6I.d.ts} +1 -1
- package/dist/{index-c_TaW8mM.d.ts → index-D8o50qOE.d.ts} +1 -1
- package/dist/index-DMQG6kdM.d.ts +416 -0
- package/dist/index-D_UEJIU5.d.ts +83 -0
- package/dist/{index-D2bSSSBP.d.ts → index-DkVEBdWa.d.ts} +2 -2
- package/dist/{index-SMh42NI8.d.ts → index-DxsKyAxq.d.ts} +118 -46
- package/dist/{index-BHqRH7QW.d.ts → index-FEy8qFSD.d.ts} +2 -2
- package/dist/{index-Byar3h1e.d.ts → index-HV6W3xCx.d.ts} +1 -1
- package/dist/{index-Clmz00IK.d.ts → index-LIyvJTW3.d.ts} +63 -0
- package/dist/{index-BKr7yvVv.d.ts → index-MPcg1Pm4.d.ts} +1 -1
- package/dist/{index-cGagYM1g.d.ts → index-ViSV0RBx.d.ts} +1 -1
- package/dist/{index-Z_onS2lR.d.ts → index-f4NGT-e2.d.ts} +3 -3
- package/dist/{index-DsyKhauk.d.ts → index-foQMNKZO.d.ts} +1 -1
- package/dist/{index-1uRMrk63.d.ts → index-nCEmW6wa.d.ts} +1 -1
- package/dist/{index-NOXYEdOI.d.ts → index-utZGF4GR.d.ts} +1 -1
- package/dist/{index-3p2BDVHq.d.ts → index-vP0EtrJJ.d.ts} +13 -3
- package/dist/{index-CZeoAr0a.d.ts → index-xfkEuGLY.d.ts} +2 -2
- package/dist/index.d.ts +81 -78
- package/dist/index.js +122 -106
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +2 -2
- package/dist/{locale-Cpk_nrLA.js → locale-CCwVnyMZ.js} +25 -1
- package/dist/power-search-DrDfcoL1.d.ts +68 -0
- package/dist/searchResultMessage-DN0HeRRB.js +94 -0
- package/dist/semantic-CKH9XVqa.d.ts +54 -0
- package/dist/{types-JktRxujg.d.ts → types-Cp4liug-.d.ts} +66 -3
- package/dist/{types-BKcxXW--.d.ts → types-CwyibrRB.d.ts} +12 -11
- package/dist/types-DIYwbkpe.d.ts +33 -0
- package/dist/types-jmqqnkKA.d.ts +163 -0
- package/dist/{useAnchoredListbox-7W90Ny-9.js → useAnchoredListbox-BN9LQnon.js} +1 -1
- package/dist/useDatePresentation-C07PnOCw.js +21 -0
- package/dist/{useMonthGrid-CmJsZTcB.js → useDateRange-CIXoE_8k.js} +1 -42
- package/dist/useDisclosureHandle-Df3HhAfC.js +24 -0
- package/dist/{useDismiss-CAiHU6QD.js → useDismiss-Cj8x_51F.js} +8 -4
- package/dist/useFieldControlState-voICDrys.js +18 -0
- package/dist/useHandleRef-6cdKugm8.js +17 -0
- package/dist/useIndicator-i1NORM7W.js +147 -0
- package/dist/useMenuDrillIn-OaEwjK44.js +520 -0
- package/dist/useMonthGrid-fGHSSrFc.js +43 -0
- package/dist/usePendingChange-ib-h8FZK.js +25 -0
- package/dist/{useResizable-CeESZS1v.d.ts → useResizable-CUoNPmUw.d.ts} +1 -1
- package/dist/useSubmenuMode-CZN9qrUo.js +37 -0
- package/package.json +9 -1
- package/styles/calendar.css +38 -3
- package/styles/chat.css +469 -1
- package/styles/check-indicator.css +17 -0
- package/styles/checkbox-indicator.css +29 -10
- package/styles/checkbox-input.css +0 -11
- package/styles/date-input.css +48 -0
- package/styles/dropdown-menu.css +163 -0
- package/styles/field.css +48 -0
- package/styles/icon.css +69 -1
- package/styles/input-group.css +32 -3
- package/styles/multi-selector.css +26 -0
- package/styles/power-search.css +303 -0
- package/styles/radio-indicator.css +90 -0
- package/styles/radio.css +9 -42
- package/styles/selector.css +112 -14
- package/styles/table.css +304 -1
- package/styles.css +3 -0
- package/dist/Calendar-DqC3EDN1.js +0 -352
- package/dist/Chat-DCjXRiOF.js +0 -1051
- package/dist/CheckboxIndicator-DdJmksHt.js +0 -52
- package/dist/DateInput-Crcg-CCj.js +0 -376
- package/dist/DropdownMenu-XvW4BJob.js +0 -164
- package/dist/InputGroup-ChrFVxzV.js +0 -42
- package/dist/Selector-DkJOLZSR.js +0 -468
- package/dist/Table-DwehtMap.js +0 -967
- package/dist/index-BLOEjvaM.d.ts +0 -398
- package/dist/index-Bgv4ZmBl.d.ts +0 -72
- package/dist/index-CuFLztiI.d.ts +0 -49
- package/dist/index-DJo-BmXZ.d.ts +0 -431
- package/dist/index-IbUN4M8V.d.ts +0 -40
- package/dist/types-DDAAT1Xd.d.ts +0 -285
- package/dist/useGridRovingFocus-DQQAOYH5.js +0 -99
- /package/dist/{index-BUXNRekN.d.ts → index-BXkNZF3q.d.ts} +0 -0
package/styles/table.css
CHANGED
|
@@ -115,7 +115,8 @@
|
|
|
115
115
|
max-width: 0;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
.astryx-table[data-striped='true'] tbody tr:nth-child(even of :not([data-expansion-panel])) {
|
|
118
|
+
.astryx-table[data-striped='true'] tbody tr:nth-child(even of :not([data-expansion-panel], [data-group-header])) {
|
|
119
|
+
--table-row-overlay: var(--astryx-color-background-muted, light-dark(#f1f1f1, #1b1b1b));
|
|
119
120
|
background-color: var(--astryx-color-background-muted, light-dark(#f1f1f1, #1b1b1b));
|
|
120
121
|
}
|
|
121
122
|
|
|
@@ -125,11 +126,13 @@
|
|
|
125
126
|
|
|
126
127
|
@media (hover: hover) {
|
|
127
128
|
.astryx-table[data-hover='true'] tbody tr:hover {
|
|
129
|
+
--table-row-overlay: var(--astryx-color-overlay-hover, light-dark(#0000000d, #ffffff0d));
|
|
128
130
|
background-color: var(--astryx-color-overlay-hover, light-dark(#0000000d, #ffffff0d));
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
.astryx-table tbody tr[aria-selected='true'] {
|
|
135
|
+
--table-row-overlay: var(--astryx-color-accent-muted, light-dark(#f1f1f1, #262626));
|
|
133
136
|
background-color: var(--astryx-color-accent-muted, light-dark(#f1f1f1, #262626));
|
|
134
137
|
}
|
|
135
138
|
|
|
@@ -191,6 +194,18 @@
|
|
|
191
194
|
min-width: 0;
|
|
192
195
|
}
|
|
193
196
|
|
|
197
|
+
.astryx-table__header-line {
|
|
198
|
+
display: flex;
|
|
199
|
+
align-items: center;
|
|
200
|
+
gap: var(--astryx-spacing-1, 4px);
|
|
201
|
+
min-width: 0;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.astryx-table__header-line > .astryx-table__sort {
|
|
205
|
+
flex: 1;
|
|
206
|
+
min-width: 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
194
209
|
.astryx-table__resize {
|
|
195
210
|
position: absolute;
|
|
196
211
|
top: 0;
|
|
@@ -253,4 +268,292 @@
|
|
|
253
268
|
gap: var(--astryx-spacing-2, 8px);
|
|
254
269
|
margin-bottom: var(--astryx-spacing-2, 8px);
|
|
255
270
|
}
|
|
271
|
+
|
|
272
|
+
.astryx-table__clickable {
|
|
273
|
+
cursor: pointer;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.astryx-table tr[data-group-header] {
|
|
277
|
+
cursor: pointer;
|
|
278
|
+
user-select: none;
|
|
279
|
+
background: var(--astryx-color-background-muted, light-dark(#f1f1f1, #1b1b1b));
|
|
280
|
+
border-bottom: var(--astryx-border-width, 1px) solid var(--astryx-color-border, light-dark(#ebebeb, #ffffff1a));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.astryx-table td.astryx-table__group {
|
|
284
|
+
max-width: none;
|
|
285
|
+
overflow: visible;
|
|
286
|
+
padding-inline-start: 0;
|
|
287
|
+
background: var(--astryx-color-background-muted, light-dark(#f1f1f1, #1b1b1b));
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.astryx-table__group-inner,
|
|
291
|
+
.astryx-table__tree {
|
|
292
|
+
display: flex;
|
|
293
|
+
align-items: center;
|
|
294
|
+
gap: var(--astryx-spacing-1, 4px);
|
|
295
|
+
min-width: 0;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.astryx-table__group-inner {
|
|
299
|
+
padding-inline-start: var(--astryx-spacing-1, 4px);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.astryx-table__group-inner[data-pinned] {
|
|
303
|
+
position: sticky;
|
|
304
|
+
inset-inline-start: 0;
|
|
305
|
+
width: fit-content;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.astryx-table__group-chevron[data-pinned] {
|
|
309
|
+
position: sticky;
|
|
310
|
+
inset-inline-start: var(--astryx-spacing-1, 4px);
|
|
311
|
+
z-index: 1;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.astryx-table__group-chevron,
|
|
315
|
+
.astryx-table__expander {
|
|
316
|
+
display: inline-flex;
|
|
317
|
+
flex: none;
|
|
318
|
+
align-items: center;
|
|
319
|
+
justify-content: center;
|
|
320
|
+
margin: 0;
|
|
321
|
+
padding: 0;
|
|
322
|
+
border: 0;
|
|
323
|
+
background: transparent;
|
|
324
|
+
color: var(--astryx-color-icon-secondary, light-dark(#737373, #a3a3a3));
|
|
325
|
+
cursor: pointer;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.astryx-table__group-chevron {
|
|
329
|
+
color: var(--astryx-color-icon-secondary, light-dark(#737373, #a3a3a3));
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.astryx-table__expander {
|
|
333
|
+
width: 24px;
|
|
334
|
+
height: 24px;
|
|
335
|
+
border-radius: var(--astryx-radius-inner, 0.375rem);
|
|
336
|
+
transition: color var(--astryx-duration-fast, 125ms) var(--astryx-ease-standard, cubic-bezier(0.24, 1, 0.4, 1));
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
@media (hover: hover) {
|
|
340
|
+
.astryx-table__group-chevron:hover,
|
|
341
|
+
.astryx-table__expander:hover {
|
|
342
|
+
color: var(--astryx-color-icon-primary, light-dark(#171717, #fafafa));
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.astryx-table__expander:hover {
|
|
346
|
+
background-image: linear-gradient(var(--astryx-color-overlay-hover, light-dark(#0000000d, #ffffff0d)), var(--astryx-color-overlay-hover, light-dark(#0000000d, #ffffff0d)));
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.astryx-table__chevron-icon {
|
|
351
|
+
display: inline-flex;
|
|
352
|
+
transition: transform var(--astryx-duration-fast, 125ms) var(--astryx-ease-standard, cubic-bezier(0.24, 1, 0.4, 1));
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.astryx-table__chevron-icon.is-expanded {
|
|
356
|
+
transform: rotate(90deg);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
[dir='rtl'] .astryx-table__chevron-icon {
|
|
360
|
+
transform: scaleX(-1);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
[dir='rtl'] .astryx-table__chevron-icon.is-expanded {
|
|
364
|
+
transform: scaleX(-1) rotate(90deg);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.astryx-table__group-label {
|
|
368
|
+
font-weight: var(--astryx-font-weight-semibold, 600);
|
|
369
|
+
color: var(--astryx-color-text-primary, light-dark(#171717, #fafafa));
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.astryx-table__group-count {
|
|
373
|
+
font-weight: var(--astryx-font-weight-normal, 400);
|
|
374
|
+
color: var(--astryx-color-text-secondary, light-dark(#525252, #a3a3a3));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.astryx-table__tree {
|
|
378
|
+
padding-inline-start: calc(var(--astryx-table-tree-level, 0) * var(--astryx-table-tree-step, var(--astryx-spacing-4, 16px)));
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.astryx-table__tree-spacer {
|
|
382
|
+
flex: none;
|
|
383
|
+
width: 24px;
|
|
384
|
+
height: 24px;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.astryx-table__tree-label {
|
|
388
|
+
min-width: 0;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.astryx-table :is(th, td)[data-column='__expansion'] {
|
|
392
|
+
width: 40px;
|
|
393
|
+
min-width: 40px;
|
|
394
|
+
max-width: 40px;
|
|
395
|
+
padding-inline-start: 0;
|
|
396
|
+
padding-inline-end: 0;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.astryx-table[data-density='compact'] .astryx-table__expander--column {
|
|
400
|
+
margin-inline-start: calc((40px - min(var(--astryx-spacing-6, 24px), 40px)) / 2 - var(--astryx-spacing-2, 8px));
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.astryx-table[data-density='balanced'] .astryx-table__expander--column {
|
|
404
|
+
margin-inline-start: calc((40px - min(var(--astryx-spacing-6, 24px), 40px)) / 2 - var(--astryx-spacing-3, 12px));
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.astryx-table[data-density='spacious'] .astryx-table__expander--column {
|
|
408
|
+
margin-inline-start: calc((40px - min(var(--astryx-spacing-6, 24px), 40px)) / 2 - var(--astryx-spacing-4, 16px));
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.astryx-table[data-dividers='rows'] tbody tr[data-expanded] > td,
|
|
412
|
+
.astryx-table[data-dividers='grid'] tbody tr[data-expanded] > td {
|
|
413
|
+
border-bottom-width: 0;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.astryx-table__panel-row[data-variant='muted'] {
|
|
417
|
+
background: var(--astryx-color-background-muted, light-dark(#f1f1f1, #1b1b1b));
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.astryx-table__panel {
|
|
421
|
+
max-width: none;
|
|
422
|
+
padding-inline-end: var(--astryx-spacing-5, 20px);
|
|
423
|
+
padding-block: var(--astryx-spacing-4, 16px);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.astryx-table[data-density='compact'] .astryx-table__panel {
|
|
427
|
+
padding-inline-start: calc(40px + var(--astryx-spacing-2, 8px));
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.astryx-table[data-density='balanced'] .astryx-table__panel {
|
|
431
|
+
padding-inline-start: calc(40px + var(--astryx-spacing-3, 12px));
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.astryx-table[data-density='spacious'] .astryx-table__panel {
|
|
435
|
+
padding-inline-start: calc(40px + var(--astryx-spacing-4, 16px));
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.astryx-table[data-dividers='rows'] .astryx-table__panel,
|
|
439
|
+
.astryx-table[data-dividers='grid'] .astryx-table__panel {
|
|
440
|
+
border-bottom: var(--astryx-border-width, 1px) solid var(--astryx-color-border, light-dark(#ebebeb, #ffffff1a));
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.astryx-table tbody tr:last-child > .astryx-table__panel {
|
|
444
|
+
border-bottom-width: 0;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.astryx-table__row-index {
|
|
448
|
+
font-family: var(--astryx-font-family-code, ui-monospace, monospace);
|
|
449
|
+
font-size: var(--astryx-text-supporting-size, 0.75rem);
|
|
450
|
+
font-variant-numeric: tabular-nums;
|
|
451
|
+
color: var(--astryx-color-text-secondary, light-dark(#525252, #a3a3a3));
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.astryx-table__status {
|
|
455
|
+
display: flex;
|
|
456
|
+
align-items: center;
|
|
457
|
+
justify-content: center;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.astryx-table__status-dot {
|
|
461
|
+
flex: none;
|
|
462
|
+
width: 8px;
|
|
463
|
+
height: 8px;
|
|
464
|
+
border-radius: 50%;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.astryx-table__sticky {
|
|
468
|
+
position: sticky;
|
|
469
|
+
background-color: var(--table-sticky-background, var(--astryx-color-background-card, #fff));
|
|
470
|
+
background-clip: padding-box;
|
|
471
|
+
overflow: visible;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.astryx-table__sticky::before {
|
|
475
|
+
content: '';
|
|
476
|
+
position: absolute;
|
|
477
|
+
inset: 0;
|
|
478
|
+
z-index: -1;
|
|
479
|
+
pointer-events: none;
|
|
480
|
+
background-color: var(--table-row-overlay, transparent);
|
|
481
|
+
transition: background-color var(--astryx-duration-fast, 125ms) var(--astryx-ease-standard, cubic-bezier(0.24, 1, 0.4, 1));
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.astryx-table__sticky--start::after,
|
|
485
|
+
.astryx-table__sticky--end::after {
|
|
486
|
+
content: '';
|
|
487
|
+
position: absolute;
|
|
488
|
+
top: 0;
|
|
489
|
+
bottom: 0;
|
|
490
|
+
width: 6px;
|
|
491
|
+
pointer-events: none;
|
|
492
|
+
transition: opacity 150ms ease;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.astryx-table__sticky--start::after {
|
|
496
|
+
inset-inline-end: 0;
|
|
497
|
+
transform: translateX(100%);
|
|
498
|
+
opacity: var(--table-sticky-shadow-start, 0);
|
|
499
|
+
background-image: linear-gradient(to right, var(--astryx-color-shadow, #0000001a), transparent);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.astryx-table__sticky--end::after {
|
|
503
|
+
inset-inline-start: 0;
|
|
504
|
+
transform: translateX(-100%);
|
|
505
|
+
opacity: var(--table-sticky-shadow-end, 0);
|
|
506
|
+
background-image: linear-gradient(to left, var(--astryx-color-shadow, #0000001a), transparent);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
[dir='rtl'] .astryx-table__sticky--start::after {
|
|
510
|
+
transform: translateX(-100%);
|
|
511
|
+
background-image: linear-gradient(to left, var(--astryx-color-shadow, #0000001a), transparent);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
[dir='rtl'] .astryx-table__sticky--end::after {
|
|
515
|
+
transform: translateX(100%);
|
|
516
|
+
background-image: linear-gradient(to right, var(--astryx-color-shadow, #0000001a), transparent);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.astryx-table-menu {
|
|
520
|
+
position: fixed;
|
|
521
|
+
z-index: var(--astryx-popover-z-index, 1000);
|
|
522
|
+
min-width: 10rem;
|
|
523
|
+
padding: var(--astryx-spacing-1, 4px);
|
|
524
|
+
border: var(--astryx-border-width, 1px) solid var(--astryx-color-border, light-dark(#ebebeb, #ffffff1a));
|
|
525
|
+
border-radius: var(--astryx-radius-element, 0.625rem);
|
|
526
|
+
background: var(--astryx-color-background-card, #fff);
|
|
527
|
+
box-shadow: var(--astryx-popover-shadow, 0 4px 8px #0000001a);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.astryx-table-menu__item {
|
|
531
|
+
display: flex;
|
|
532
|
+
align-items: center;
|
|
533
|
+
gap: var(--astryx-spacing-2, 8px);
|
|
534
|
+
width: 100%;
|
|
535
|
+
margin: 0;
|
|
536
|
+
padding: var(--astryx-spacing-1, 4px) var(--astryx-spacing-2, 8px);
|
|
537
|
+
border: 0;
|
|
538
|
+
border-radius: var(--astryx-radius-inner, 0.375rem);
|
|
539
|
+
background: transparent;
|
|
540
|
+
color: inherit;
|
|
541
|
+
font: inherit;
|
|
542
|
+
text-align: start;
|
|
543
|
+
cursor: pointer;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.astryx-table-menu__item:hover,
|
|
547
|
+
.astryx-table-menu__item:focus-visible {
|
|
548
|
+
background: var(--astryx-color-overlay-hover, light-dark(#0000000d, #ffffff0d));
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
@media (prefers-reduced-motion: reduce) {
|
|
552
|
+
.astryx-table__chevron-icon,
|
|
553
|
+
.astryx-table__sticky::before,
|
|
554
|
+
.astryx-table__sticky--start::after,
|
|
555
|
+
.astryx-table__sticky--end::after {
|
|
556
|
+
transition: none;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
256
559
|
}
|
package/styles.css
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
@import './styles/carousel.css';
|
|
17
17
|
@import './styles/center.css';
|
|
18
18
|
@import './styles/chat.css';
|
|
19
|
+
@import './styles/check-indicator.css';
|
|
19
20
|
@import './styles/checkbox-indicator.css';
|
|
20
21
|
@import './styles/checkbox-input.css';
|
|
21
22
|
@import './styles/checkbox-list.css';
|
|
@@ -58,8 +59,10 @@
|
|
|
58
59
|
@import './styles/overflow-list.css';
|
|
59
60
|
@import './styles/overlay.css';
|
|
60
61
|
@import './styles/popover.css';
|
|
62
|
+
@import './styles/power-search.css';
|
|
61
63
|
@import './styles/progress-bar.css';
|
|
62
64
|
@import './styles/radio.css';
|
|
65
|
+
@import './styles/radio-indicator.css';
|
|
63
66
|
@import './styles/resize-handle.css';
|
|
64
67
|
@import './styles/scrollable-area.css';
|
|
65
68
|
@import './styles/section.css';
|
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import { t as useGridRovingFocus } from "./useGridRovingFocus-DQQAOYH5.js";
|
|
2
|
-
import { a as useAstryxMessages, i as useAstryxLocale } from "./context-DzcK4T_C.js";
|
|
3
|
-
import { n as weekdayNames, t as formatCalendarMonth } from "./locale-Cpk_nrLA.js";
|
|
4
|
-
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useId, withKeys } from "vue";
|
|
5
|
-
import { CalendarDate, getLocalTimeZone, today } from "@internationalized/date";
|
|
6
|
-
import "../styles/calendar.css";
|
|
7
|
-
//#region src/composables/useCalendar.ts
|
|
8
|
-
function calendarDateToJSDate(date) {
|
|
9
|
-
return new Date(date.year, date.month - 1, date.day);
|
|
10
|
-
}
|
|
11
|
-
function jsDateToCalendarDate(date) {
|
|
12
|
-
return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* 日历逻辑:日期计算、月份导航、日期选择。
|
|
16
|
-
*/
|
|
17
|
-
function useCalendar(options) {
|
|
18
|
-
const { value, min, max, isDateDisabled, onChange, initialDate } = options;
|
|
19
|
-
const timeZone = getLocalTimeZone();
|
|
20
|
-
const focusedDate = ref(initialDate ? jsDateToCalendarDate(initialDate) : value.value ? jsDateToCalendarDate(value.value) : today(timeZone));
|
|
21
|
-
function datesFor(month) {
|
|
22
|
-
const firstDay = new CalendarDate(month.year, month.month, 1);
|
|
23
|
-
const firstDayOfWeek = firstDay.toDate(timeZone).getDay();
|
|
24
|
-
const startDate = firstDay.subtract({ days: firstDayOfWeek });
|
|
25
|
-
const weeks = [];
|
|
26
|
-
let currentDate = startDate;
|
|
27
|
-
for (let week = 0; week < 6; week++) {
|
|
28
|
-
const weekDates = [];
|
|
29
|
-
for (let day = 0; day < 7; day++) {
|
|
30
|
-
weekDates.push(currentDate);
|
|
31
|
-
currentDate = currentDate.add({ days: 1 });
|
|
32
|
-
}
|
|
33
|
-
weeks.push(weekDates);
|
|
34
|
-
}
|
|
35
|
-
return weeks;
|
|
36
|
-
}
|
|
37
|
-
const dates = computed(() => datesFor(focusedDate.value));
|
|
38
|
-
function select(date) {
|
|
39
|
-
if (isDisabled(date)) return;
|
|
40
|
-
onChange(calendarDateToJSDate(date));
|
|
41
|
-
}
|
|
42
|
-
function previousMonth() {
|
|
43
|
-
focusedDate.value = focusedDate.value.subtract({ months: 1 });
|
|
44
|
-
}
|
|
45
|
-
function nextMonth() {
|
|
46
|
-
focusedDate.value = focusedDate.value.add({ months: 1 });
|
|
47
|
-
}
|
|
48
|
-
function isSelected(date) {
|
|
49
|
-
if (!value.value) return false;
|
|
50
|
-
const selected = jsDateToCalendarDate(value.value);
|
|
51
|
-
return date.compare(selected) === 0;
|
|
52
|
-
}
|
|
53
|
-
function isDisabled(date) {
|
|
54
|
-
const jsDate = calendarDateToJSDate(date);
|
|
55
|
-
if (min && jsDate < min) return true;
|
|
56
|
-
if (max && jsDate > max) return true;
|
|
57
|
-
if (isDateDisabled?.(jsDate)) return true;
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
function isInMonth(date) {
|
|
61
|
-
return date.month === focusedDate.value.month;
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
focusedDate,
|
|
65
|
-
dates,
|
|
66
|
-
datesFor,
|
|
67
|
-
select,
|
|
68
|
-
previousMonth,
|
|
69
|
-
nextMonth,
|
|
70
|
-
isSelected,
|
|
71
|
-
isDisabled,
|
|
72
|
-
isInMonth
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region src/Calendar/Calendar.vue
|
|
77
|
-
const _hoisted_1 = ["data-months", "aria-label"];
|
|
78
|
-
const _hoisted_2 = { class: "astryx-calendar-header" };
|
|
79
|
-
const _hoisted_3 = ["disabled", "aria-label"];
|
|
80
|
-
const _hoisted_4 = { class: "astryx-calendar-month-year" };
|
|
81
|
-
const _hoisted_5 = ["disabled", "aria-label"];
|
|
82
|
-
const _hoisted_6 = { class: "astryx-calendar-month-year" };
|
|
83
|
-
const _hoisted_7 = ["disabled", "aria-label"];
|
|
84
|
-
const _hoisted_8 = {
|
|
85
|
-
class: "astryx-calendar-weekdays",
|
|
86
|
-
role: "row"
|
|
87
|
-
};
|
|
88
|
-
const _hoisted_9 = ["aria-label"];
|
|
89
|
-
const _hoisted_10 = ["aria-activedescendant", "onKeydown"];
|
|
90
|
-
const _hoisted_11 = [
|
|
91
|
-
"id",
|
|
92
|
-
"aria-selected",
|
|
93
|
-
"aria-disabled",
|
|
94
|
-
"aria-current",
|
|
95
|
-
"onClick",
|
|
96
|
-
"onKeydown"
|
|
97
|
-
];
|
|
98
|
-
const _hoisted_12 = { class: "astryx-calendar-day" };
|
|
99
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
100
|
-
name: "AstryxCalendar",
|
|
101
|
-
__name: "Calendar",
|
|
102
|
-
props: {
|
|
103
|
-
modelValue: { default: null },
|
|
104
|
-
mode: { default: "single" },
|
|
105
|
-
range: { default: null },
|
|
106
|
-
numberOfMonths: { default: 1 },
|
|
107
|
-
focusDate: {},
|
|
108
|
-
min: {},
|
|
109
|
-
max: {},
|
|
110
|
-
isDateDisabled: {},
|
|
111
|
-
label: {},
|
|
112
|
-
disabled: {
|
|
113
|
-
type: Boolean,
|
|
114
|
-
default: false
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
emits: [
|
|
118
|
-
"update:modelValue",
|
|
119
|
-
"update:range",
|
|
120
|
-
"change"
|
|
121
|
-
],
|
|
122
|
-
setup(__props, { emit: __emit }) {
|
|
123
|
-
const props = __props;
|
|
124
|
-
const emit = __emit;
|
|
125
|
-
const calendarId = `astryx-calendar-${useId()}`;
|
|
126
|
-
const locale = useAstryxLocale();
|
|
127
|
-
const messages = useAstryxMessages();
|
|
128
|
-
const resolvedLabel = computed(() => props.label ?? messages.value.calendar.label);
|
|
129
|
-
const weekDays = computed(() => weekdayNames(locale.value, "narrow"));
|
|
130
|
-
const weekDayLabels = computed(() => weekdayNames(locale.value, "long"));
|
|
131
|
-
const modelValueRef = computed({
|
|
132
|
-
get: () => props.modelValue,
|
|
133
|
-
set: (value) => {
|
|
134
|
-
emit("update:modelValue", value);
|
|
135
|
-
emit("change", value);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
const calendar = useCalendar({
|
|
139
|
-
value: modelValueRef,
|
|
140
|
-
initialDate: props.focusDate,
|
|
141
|
-
min: props.min,
|
|
142
|
-
max: props.max,
|
|
143
|
-
isDateDisabled: props.isDateDisabled,
|
|
144
|
-
onChange: (value) => {
|
|
145
|
-
modelValueRef.value = value;
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
const months = computed(() => {
|
|
149
|
-
const first = calendar.focusedDate.value;
|
|
150
|
-
return props.numberOfMonths === 2 ? [first, first.add({ months: 1 })] : [first];
|
|
151
|
-
});
|
|
152
|
-
const timeZone = getLocalTimeZone();
|
|
153
|
-
const todayDate = today(timeZone);
|
|
154
|
-
const activeIndex = ref(0);
|
|
155
|
-
const isEnabled = computed(() => !props.disabled);
|
|
156
|
-
const grid = useGridRovingFocus({
|
|
157
|
-
rows: computed(() => 6),
|
|
158
|
-
columns: computed(() => 7),
|
|
159
|
-
activeIndex,
|
|
160
|
-
isEnabled,
|
|
161
|
-
isDisabled: (row, col) => {
|
|
162
|
-
const dateIndex = row * 7 + col;
|
|
163
|
-
const date = calendar.dates.value.flat()[dateIndex];
|
|
164
|
-
return date ? calendar.isDisabled(date) : true;
|
|
165
|
-
},
|
|
166
|
-
onChange: (index) => {
|
|
167
|
-
activeIndex.value = index;
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
function getCellId(rowIndex, colIndex) {
|
|
171
|
-
return `${calendarId}-cell-${rowIndex}-${colIndex}`;
|
|
172
|
-
}
|
|
173
|
-
function isToday(date) {
|
|
174
|
-
return date.compare(todayDate) === 0;
|
|
175
|
-
}
|
|
176
|
-
function sameDay(date, day) {
|
|
177
|
-
return !!date && date.getFullYear() === day.year && date.getMonth() + 1 === day.month && date.getDate() === day.day;
|
|
178
|
-
}
|
|
179
|
-
function isRangeStart(date) {
|
|
180
|
-
return props.mode === "range" && sameDay(props.range?.start ?? null, date);
|
|
181
|
-
}
|
|
182
|
-
function isRangeEnd(date) {
|
|
183
|
-
return props.mode === "range" && sameDay(props.range?.end ?? null, date);
|
|
184
|
-
}
|
|
185
|
-
function isInRange(date) {
|
|
186
|
-
if (props.mode !== "range") return false;
|
|
187
|
-
const start = props.range?.start;
|
|
188
|
-
const end = props.range?.end;
|
|
189
|
-
if (!start || !end) return false;
|
|
190
|
-
const day = new Date(date.year, date.month - 1, date.day);
|
|
191
|
-
return day > (start < end ? start : end) && day < (start < end ? end : start);
|
|
192
|
-
}
|
|
193
|
-
function selectRange(date) {
|
|
194
|
-
const day = new Date(date.year, date.month - 1, date.day);
|
|
195
|
-
const start = props.range?.start ?? null;
|
|
196
|
-
const end = props.range?.end ?? null;
|
|
197
|
-
emit("update:range", !start || end ? {
|
|
198
|
-
start: day,
|
|
199
|
-
end: null
|
|
200
|
-
} : day < start ? {
|
|
201
|
-
start: day,
|
|
202
|
-
end: start
|
|
203
|
-
} : {
|
|
204
|
-
start,
|
|
205
|
-
end: day
|
|
206
|
-
});
|
|
207
|
-
emit("change", day);
|
|
208
|
-
}
|
|
209
|
-
function onDateClick(date, rowIndex, colIndex) {
|
|
210
|
-
if (props.disabled || calendar.isDisabled(date)) return;
|
|
211
|
-
activeIndex.value = rowIndex * 7 + colIndex;
|
|
212
|
-
if (props.mode === "range") {
|
|
213
|
-
selectRange(date);
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
calendar.select(date);
|
|
217
|
-
}
|
|
218
|
-
function onKeyDown(event) {
|
|
219
|
-
if (props.disabled) return;
|
|
220
|
-
grid.onKeyDown(event);
|
|
221
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
222
|
-
event.preventDefault();
|
|
223
|
-
const date = calendar.dates.value.flat()[activeIndex.value];
|
|
224
|
-
if (date && !calendar.isDisabled(date)) calendar.select(date);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
return (_ctx, _cache) => {
|
|
228
|
-
return openBlock(), createElementBlock("div", {
|
|
229
|
-
id: calendarId,
|
|
230
|
-
class: normalizeClass(["astryx-calendar", { "is-disabled": props.disabled }]),
|
|
231
|
-
"data-months": props.numberOfMonths,
|
|
232
|
-
role: "application",
|
|
233
|
-
"aria-label": resolvedLabel.value
|
|
234
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(months.value, (month, monthIndex) => {
|
|
235
|
-
return openBlock(), createElementBlock("div", {
|
|
236
|
-
key: `${month.year}-${month.month}`,
|
|
237
|
-
class: "astryx-calendar-month"
|
|
238
|
-
}, [
|
|
239
|
-
createElementVNode("div", _hoisted_2, [monthIndex === 0 ? renderSlot(_ctx.$slots, "header", {}, () => [
|
|
240
|
-
createElementVNode("button", {
|
|
241
|
-
type: "button",
|
|
242
|
-
class: "astryx-calendar-nav-button",
|
|
243
|
-
disabled: props.disabled,
|
|
244
|
-
"aria-label": unref(messages).calendar.previousMonth,
|
|
245
|
-
onClick: _cache[0] || (_cache[0] = (...args) => unref(calendar).previousMonth && unref(calendar).previousMonth(...args))
|
|
246
|
-
}, [..._cache[3] || (_cache[3] = [createElementVNode("svg", {
|
|
247
|
-
width: "16",
|
|
248
|
-
height: "16",
|
|
249
|
-
viewBox: "0 0 16 16",
|
|
250
|
-
fill: "none"
|
|
251
|
-
}, [createElementVNode("path", {
|
|
252
|
-
d: "M10 12L6 8L10 4",
|
|
253
|
-
stroke: "currentColor",
|
|
254
|
-
"stroke-width": "1.5",
|
|
255
|
-
"stroke-linecap": "round",
|
|
256
|
-
"stroke-linejoin": "round"
|
|
257
|
-
})], -1)])], 8, _hoisted_3),
|
|
258
|
-
createElementVNode("span", _hoisted_4, toDisplayString(unref(formatCalendarMonth)(month.year, month.month, unref(locale))), 1),
|
|
259
|
-
props.numberOfMonths === 1 ? (openBlock(), createElementBlock("button", {
|
|
260
|
-
key: 0,
|
|
261
|
-
type: "button",
|
|
262
|
-
class: "astryx-calendar-nav-button",
|
|
263
|
-
disabled: props.disabled,
|
|
264
|
-
"aria-label": unref(messages).calendar.nextMonth,
|
|
265
|
-
onClick: _cache[1] || (_cache[1] = (...args) => unref(calendar).nextMonth && unref(calendar).nextMonth(...args))
|
|
266
|
-
}, [..._cache[4] || (_cache[4] = [createElementVNode("svg", {
|
|
267
|
-
width: "16",
|
|
268
|
-
height: "16",
|
|
269
|
-
viewBox: "0 0 16 16",
|
|
270
|
-
fill: "none"
|
|
271
|
-
}, [createElementVNode("path", {
|
|
272
|
-
d: "M6 4L10 8L6 12",
|
|
273
|
-
stroke: "currentColor",
|
|
274
|
-
"stroke-width": "1.5",
|
|
275
|
-
"stroke-linecap": "round",
|
|
276
|
-
"stroke-linejoin": "round"
|
|
277
|
-
})], -1)])], 8, _hoisted_5)) : createCommentVNode("v-if", true)
|
|
278
|
-
], void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("span", _hoisted_6, toDisplayString(unref(formatCalendarMonth)(month.year, month.month, unref(locale))), 1), createElementVNode("button", {
|
|
279
|
-
type: "button",
|
|
280
|
-
class: "astryx-calendar-nav-button",
|
|
281
|
-
disabled: props.disabled,
|
|
282
|
-
"aria-label": unref(messages).calendar.nextMonth,
|
|
283
|
-
onClick: _cache[2] || (_cache[2] = (...args) => unref(calendar).nextMonth && unref(calendar).nextMonth(...args))
|
|
284
|
-
}, [..._cache[5] || (_cache[5] = [createElementVNode("svg", {
|
|
285
|
-
width: "16",
|
|
286
|
-
height: "16",
|
|
287
|
-
viewBox: "0 0 16 16",
|
|
288
|
-
fill: "none"
|
|
289
|
-
}, [createElementVNode("path", {
|
|
290
|
-
d: "M6 4L10 8L6 12",
|
|
291
|
-
stroke: "currentColor",
|
|
292
|
-
"stroke-width": "1.5",
|
|
293
|
-
"stroke-linecap": "round",
|
|
294
|
-
"stroke-linejoin": "round"
|
|
295
|
-
})], -1)])], 8, _hoisted_7)], 64))]),
|
|
296
|
-
createElementVNode("div", _hoisted_8, [(openBlock(true), createElementBlock(Fragment, null, renderList(weekDays.value, (day, index) => {
|
|
297
|
-
return openBlock(), createElementBlock("div", {
|
|
298
|
-
key: index,
|
|
299
|
-
class: "astryx-calendar-weekday",
|
|
300
|
-
role: "columnheader",
|
|
301
|
-
"aria-label": weekDayLabels.value[index]
|
|
302
|
-
}, toDisplayString(day), 9, _hoisted_9);
|
|
303
|
-
}), 128))]),
|
|
304
|
-
createElementVNode("div", {
|
|
305
|
-
class: "astryx-calendar-grid",
|
|
306
|
-
role: "grid",
|
|
307
|
-
"aria-labelledby": calendarId,
|
|
308
|
-
"aria-activedescendant": monthIndex === 0 ? getCellId(unref(grid).row.value, unref(grid).column.value) : void 0,
|
|
309
|
-
tabindex: "0",
|
|
310
|
-
onKeydown: ($event) => monthIndex === 0 ? onKeyDown($event) : void 0
|
|
311
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(calendar).datesFor(month), (week, rowIndex) => {
|
|
312
|
-
return openBlock(), createElementBlock("div", {
|
|
313
|
-
key: rowIndex,
|
|
314
|
-
class: "astryx-calendar-row",
|
|
315
|
-
role: "row"
|
|
316
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(week, (date, colIndex) => {
|
|
317
|
-
return openBlock(), createElementBlock("div", {
|
|
318
|
-
id: monthIndex === 0 ? getCellId(rowIndex, colIndex) : void 0,
|
|
319
|
-
key: colIndex,
|
|
320
|
-
class: normalizeClass(["astryx-calendar-cell", {
|
|
321
|
-
"is-selected": props.mode === "range" ? isRangeStart(date) || isRangeEnd(date) : unref(calendar).isSelected(date),
|
|
322
|
-
"is-range-start": isRangeStart(date),
|
|
323
|
-
"is-range-end": isRangeEnd(date),
|
|
324
|
-
"is-in-range": isInRange(date),
|
|
325
|
-
"is-disabled": unref(calendar).isDisabled(date),
|
|
326
|
-
"is-today": isToday(date),
|
|
327
|
-
"is-other-month": date.month !== month.month || date.year !== month.year,
|
|
328
|
-
"is-active": monthIndex === 0 && activeIndex.value === rowIndex * 7 + colIndex
|
|
329
|
-
}]),
|
|
330
|
-
role: "gridcell",
|
|
331
|
-
"aria-selected": props.mode === "range" ? isRangeStart(date) || isRangeEnd(date) : unref(calendar).isSelected(date),
|
|
332
|
-
"aria-disabled": unref(calendar).isDisabled(date),
|
|
333
|
-
"aria-current": isToday(date) ? "date" : void 0,
|
|
334
|
-
tabindex: "-1",
|
|
335
|
-
onClick: ($event) => onDateClick(date, rowIndex, colIndex),
|
|
336
|
-
onKeydown: withKeys(($event) => onDateClick(date, rowIndex, colIndex), ["enter"])
|
|
337
|
-
}, [renderSlot(_ctx.$slots, "day", {
|
|
338
|
-
date,
|
|
339
|
-
isSelected: props.mode === "range" ? isRangeStart(date) || isRangeEnd(date) : unref(calendar).isSelected(date),
|
|
340
|
-
isDisabled: unref(calendar).isDisabled(date),
|
|
341
|
-
isToday: isToday(date),
|
|
342
|
-
isInMonth: date.month === month.month && date.year === month.year
|
|
343
|
-
}, () => [createElementVNode("span", _hoisted_12, toDisplayString(date.day), 1)])], 42, _hoisted_11);
|
|
344
|
-
}), 128))]);
|
|
345
|
-
}), 128))], 40, _hoisted_10)
|
|
346
|
-
]);
|
|
347
|
-
}), 128))], 10, _hoisted_1);
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
//#endregion
|
|
352
|
-
export { _sfc_main as t };
|