@astryx-vue/core 0.1.3 → 0.2.1
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/dist/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-BylcA4vV.js → AlertDialog-ovx4cBjM.js} +1 -1
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-b0PWt9Fz.js → AppShell-1wNIEtK_.js} +2 -2
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/Avatar-jmHInHwj.js +244 -0
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-CZcgAMjM.js → AvatarGroup-QyzSrpYA.js} +8 -7
- package/dist/Badge/index.d.ts +1 -1
- package/dist/Badge/index.js +1 -1
- package/dist/Badge-CjDQPF5g.js +30 -0
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +1 -1
- package/dist/{Breadcrumbs-C3YZFQ9w.js → Breadcrumbs-C97HmjkC.js} +45 -11
- 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-DqC3EDN1.js +352 -0
- package/dist/Card/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +2 -0
- package/dist/Carousel/index.js +2 -0
- package/dist/Carousel-BGUnskjo.js +363 -0
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-C1aWl5V3.js → Chat-DCjXRiOF.js} +8 -8
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-C1X0Rde8.js → Citation-DunoAqVH.js} +2 -2
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Code/index.d.ts +3 -2
- package/dist/Code/index.js +4 -2
- package/dist/Code-yb_KOFtJ.js +299 -0
- package/dist/{CodeBlock-BQdooQy2.js → CodeBlock-CAF-VJnh.js} +8 -2
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-BS9ctCQV.js → Collapsible-DvMiYJp7.js} +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-u5h_E05P.js → CommandPalette-xfm9ldUI.js} +1 -1
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-BHmGWml0.js → ComplexSelector-B6lBTRhP.js} +2 -2
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +1 -1
- package/dist/{ContextMenu-dA-ppaRQ.js → ContextMenu-DUkED3Z3.js} +101 -63
- package/dist/DateInput/index.d.ts +2 -2
- package/dist/DateInput/index.js +1 -1
- package/dist/DateInput-Crcg-CCj.js +376 -0
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-fmQlr_A7.js → DateRangeInput-e9KSxBBK.js} +2 -2
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-Bs1JmcIp.js → DateTimeInput-fSOfuLex.js} +5 -3
- package/dist/DropdownMenu/index.d.ts +3 -2
- package/dist/DropdownMenu/index.js +3 -2
- package/dist/{DropdownMenu-B0gogrvG.js → DropdownMenu-8G0B1UND.js} +63 -16
- package/dist/DropdownMenu-XvW4BJob.js +164 -0
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-Bhlqgsg4.js → EmptyState-CUJdTYKV.js} +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-CmAfOpkA.js → FileInput-D-fchyQH.js} +2 -2
- package/dist/Icon/index.d.ts +4 -0
- package/dist/Icon/index.js +3 -0
- package/dist/Icon/plugin.d.ts +45 -0
- package/dist/Icon/plugin.js +177 -0
- package/dist/Icon-Bku25g_K.js +193 -0
- package/dist/Lightbox/index.d.ts +2 -0
- package/dist/Lightbox/index.js +2 -0
- package/dist/Lightbox-uuVGgHxW.js +384 -0
- package/dist/Link/index.d.ts +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/Link-DqdQZ37C.js +141 -0
- package/dist/List/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-CwtLr3f_.js → Markdown-DLICa3db.js} +3 -3
- package/dist/MetadataList/index.d.ts +1 -1
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-DlXQTLog.js → MetadataList-h492rqEN.js} +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-CgQamG6E.js → MobileNavToggle-BMj3Wtuq.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-BXL6Dqsu.js → MoreMenu-DkYi5az5.js} +2 -2
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-DT8ZccMI.js → MultiSelector-C2IS-EaU.js} +2 -2
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavMenu/index.d.ts +1 -1
- package/dist/NavMenu/index.js +1 -1
- package/dist/{NavMenuItem-mzNQESpB.js → NavMenuItem-B-k7olt5.js} +2 -1
- package/dist/NumberInput/index.d.ts +2 -2
- package/dist/NumberInput/index.js +1 -1
- package/dist/NumberInput-CjfAsFwj.js +210 -0
- package/dist/Outline/index.d.ts +2 -0
- package/dist/Outline/index.js +2 -0
- package/dist/Outline-BTmrtvXR.js +325 -0
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-zXg3g6fy.js → OverflowList-CRE8BE7V.js} +2 -2
- package/dist/Overlay/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts +2 -2
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-DXfgMUKJ.js → Pagination-BpGXPmc7.js} +76 -22
- package/dist/Popover/index.d.ts +1 -1
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-ChDp-7oe.js → ProgressBar-DO9Chic6.js} +31 -11
- package/dist/Radio/index.d.ts +1 -1
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{Resizable-BuGKvU9I.js → Resizable-CE8XQDL2.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SegmentedControl/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-DkJOLZSR.js +468 -0
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-Cdrigq2A.js → SideNav-DcDWBnXJ.js} +17 -17
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-DxmLfh8O.js → Stepper-DZKaqEoz.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-C411uNQU.js → TabList-hm06QPiW.js} +10 -3
- package/dist/Table/index.js +1 -1
- package/dist/{Table-7qRmlIQd.js → Table-DwehtMap.js} +4 -4
- package/dist/Text/index.d.ts +3 -2
- package/dist/Text/index.js +1 -1
- package/dist/{Text-CKd7e3gK.js → Text-BHVghsWo.js} +12 -2
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-Cv9UVbzS.js → TextArea-CPwSytdO.js} +12 -6
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Theme/index.d.ts +2 -0
- package/dist/Theme/index.js +2 -0
- package/dist/Theme-BuUiiJNr.js +429 -0
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-BWVzLLyI.js → Thumbnail-CAOYds8t.js} +11 -11
- package/dist/{TimeField-l3QzU6vC.js → TimeField-BGbxCoKU.js} +2 -2
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-OkgX-xbQ.js → TimeInput-DJP3l4ZS.js} +1 -1
- package/dist/Timer/index.d.ts +2 -0
- package/dist/Timer/index.js +2 -0
- package/dist/Timer-B7GV6hqd.js +134 -0
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +2 -1
- package/dist/{Timestamp-DUoP9ari.js → Timestamp-BzRp8uWc.js} +5 -122
- package/dist/Toast/index.d.ts +2 -2
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-BKXPvEMp.js → Toast-C2ML-bmi.js} +37 -7
- 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-C4KD0fZD.js → Token-CjocuhzE.js} +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-BA8sTMPZ.js → Tokenizer-mYES5SPM.js} +2 -2
- 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-CZokS7E_.js → TopNav-C2t6JkZb.js} +4 -4
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-CIbAGOMf.js → TreeList-THJ0KamE.js} +3 -3
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-DIw-K4aa.js → Typeahead-D7VnvRpK.js} +2 -2
- package/dist/{context-D6ECRdc5.js → context-DzcK4T_C.js} +58 -2
- package/dist/context-O2Vb8cJl.js +57 -0
- package/dist/formatInstant-BDWUIxS7.js +119 -0
- package/dist/index-1AZ4KZhg.d.ts +96 -0
- package/dist/index-3p2BDVHq.d.ts +31 -0
- package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
- package/dist/{index-FEy8qFSD.d.ts → index-BHqRH7QW.d.ts} +2 -2
- package/dist/{index-CTolyeii.d.ts → index-BLOEjvaM.d.ts} +16 -2
- package/dist/index-BMrggCw-.d.ts +52 -0
- package/dist/{index-z4p2k9VR.d.ts → index-Bgv4ZmBl.d.ts} +20 -2
- package/dist/{index-BoRIw-bP.d.ts → index-Bt7ewoz2.d.ts} +32 -2
- package/dist/{index-CjtAH60j.d.ts → index-Bu0Zd1uw.d.ts} +1 -1
- package/dist/{index-uQrLBZfF.d.ts → index-Bu3oXIIS.d.ts} +24 -0
- package/dist/{index-CX97hlld.d.ts → index-CBym0hSq.d.ts} +2 -19
- package/dist/index-CJlBAXwj.d.ts +100 -0
- package/dist/{index-DT9S92sh.d.ts → index-CNjbOgty.d.ts} +15 -0
- package/dist/{index-gW0HW02U.d.ts → index-COxy6LEW.d.ts} +1 -1
- package/dist/index-CRizexSC.d.ts +147 -0
- package/dist/{index-DYChvBOM.d.ts → index-Clmz00IK.d.ts} +31 -0
- package/dist/index-Cm_TiLXU.d.ts +22 -0
- package/dist/index-Cn-sSds-.d.ts +68 -0
- package/dist/index-CsVS37na.d.ts +81 -0
- package/dist/{index-DRmb-oUa.d.ts → index-CuFLztiI.d.ts} +6 -1
- package/dist/{index-CT8KEpec.d.ts → index-D0TlUOtG.d.ts} +1 -1
- package/dist/{index-fa72tWIU.d.ts → index-D2bSSSBP.d.ts} +1 -1
- package/dist/{index-2u4l3wq8.d.ts → index-DAiGhkNZ.d.ts} +15 -2
- package/dist/{index-DGNqi2za.d.ts → index-DQAnGHu7.d.ts} +5 -5
- package/dist/{index-BfOtLyNH.d.ts → index-D_nYxnNv.d.ts} +1 -1
- package/dist/{index-Df2YvC8o.d.ts → index-DeOftUMq.d.ts} +191 -75
- package/dist/{index-DXDGk38y.d.ts → index-Dg3ZmwEg.d.ts} +11 -0
- package/dist/{index-BiMGXtD-.d.ts → index-DimuSES0.d.ts} +14 -1
- package/dist/{index-C_2Z65Rp.d.ts → index-DnEh-HA0.d.ts} +1 -1
- package/dist/{index-D-ZuubCK.d.ts → index-DnSrjbjP.d.ts} +1 -1
- package/dist/{index-mQ6EPmaG.d.ts → index-DsyKhauk.d.ts} +78 -9
- package/dist/{index-C6RecznD.d.ts → index-I4J7gwa1.d.ts} +51 -9
- package/dist/{index-utZGF4GR.d.ts → index-NOXYEdOI.d.ts} +1 -1
- package/dist/{index-B4OOtNP8.d.ts → index-Z_onS2lR.d.ts} +1 -1
- package/dist/{index-CVn0GBdB.d.ts → index-cG1E0U2s.d.ts} +1 -1
- package/dist/{index-DEeJowZf.d.ts → index-cGagYM1g.d.ts} +15 -2
- package/dist/{index-Ck8qy6Rf.d.ts → index-c_TaW8mM.d.ts} +24 -2
- package/dist/{index-Bqb_Fyju.d.ts → index-jdjcb3Js.d.ts} +2 -2
- package/dist/index.d.ts +78 -68
- package/dist/index.js +107 -96
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +1 -1
- package/dist/registry-B1ObuP--.d.ts +45 -0
- package/dist/registry-C7OZb0PJ.js +135 -0
- package/dist/syntaxTheme-Bcs1YMF7.d.ts +38 -0
- package/dist/syntaxTheme-ClpWALZX.js +75 -0
- package/dist/types-BKcxXW--.d.ts +114 -0
- package/dist/types-Bt-lSgYX.d.ts +65 -0
- package/dist/{index-B8MbfMwV.d.ts → types-DDAAT1Xd.d.ts} +36 -82
- package/package.json +30 -1
- package/styles/avatar.css +14 -0
- package/styles/badge.css +8 -0
- package/styles/breadcrumbs.css +6 -1
- package/styles/button.css +13 -0
- package/styles/calendar.css +16 -0
- package/styles/card.css +2 -0
- package/styles/carousel.css +120 -0
- package/styles/chat.css +5 -2
- package/styles/dropdown-menu.css +11 -0
- package/styles/heading.css +6 -2
- package/styles/icon.css +38 -8
- package/styles/lightbox.css +144 -0
- package/styles/link.css +5 -0
- package/styles/media-theme.css +51 -0
- package/styles/number-input.css +22 -0
- package/styles/outline.css +124 -0
- package/styles/pagination.css +45 -1
- package/styles/progress-bar.css +4 -0
- package/styles/selector.css +58 -0
- package/styles/tab-list.css +15 -0
- package/styles/text-area.css +17 -0
- package/styles/text-input.css +5 -0
- package/styles/text.css +63 -14
- package/styles/theme.css +29 -0
- package/styles/timer.css +34 -0
- package/styles/toast.css +7 -0
- package/styles/toolbar.css +11 -0
- package/styles.css +6 -0
- package/dist/Avatar-5s3HSrtN.js +0 -136
- package/dist/Badge-Ba0EwsTj.js +0 -19
- package/dist/Calendar-CYhGDT6f.js +0 -277
- package/dist/DateInput-D2ErjXYO.js +0 -250
- package/dist/Icon-5MdZQ18k.js +0 -86
- package/dist/Link-CprjOuTI.js +0 -92
- package/dist/NumberInput-DspJO6z6.js +0 -147
- package/dist/Selector-DlZpQh42.js +0 -325
- package/dist/index-BzqRns96.d.ts +0 -64
- package/dist/index-ZJyk8RtQ.d.ts +0 -68
- package/dist/{CheckboxList-EsIEXjK_.js → CheckboxList-BbCPiend.js} +1 -1
- package/dist/{index-4FM5lQdV.d.ts → index-BUXNRekN.d.ts} +1 -1
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
import { t as useCombobox } from "./useCombobox-CTo5C-gc.js";
|
|
2
|
-
import { t as useDismiss } from "./useDismiss-CAiHU6QD.js";
|
|
3
|
-
import { a as useAstryxMessages } from "./context-D6ECRdc5.js";
|
|
4
|
-
import { t as usePositionedLayer } from "./usePositionedLayer-C1NBOsVT.js";
|
|
5
|
-
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useId, useSlots, useTemplateRef, vShow, watch, withDirectives, withKeys, withModifiers } from "vue";
|
|
6
|
-
import "../styles/visually-hidden-utility.css";
|
|
7
|
-
import "../styles/selector.css";
|
|
8
|
-
//#region src/Selector/Selector.vue
|
|
9
|
-
const _hoisted_1 = [
|
|
10
|
-
"disabled",
|
|
11
|
-
"aria-expanded",
|
|
12
|
-
"aria-label",
|
|
13
|
-
"aria-activedescendant",
|
|
14
|
-
"title"
|
|
15
|
-
];
|
|
16
|
-
const _hoisted_2 = ["aria-label"];
|
|
17
|
-
const _hoisted_3 = ["data-placement"];
|
|
18
|
-
const _hoisted_4 = {
|
|
19
|
-
key: 0,
|
|
20
|
-
class: "astryx-selector-search"
|
|
21
|
-
};
|
|
22
|
-
const _hoisted_5 = [
|
|
23
|
-
"id",
|
|
24
|
-
"aria-label",
|
|
25
|
-
"placeholder",
|
|
26
|
-
"value"
|
|
27
|
-
];
|
|
28
|
-
const _hoisted_6 = {
|
|
29
|
-
key: 1,
|
|
30
|
-
class: "astryx-selector-options"
|
|
31
|
-
};
|
|
32
|
-
const _hoisted_7 = [
|
|
33
|
-
"id",
|
|
34
|
-
"aria-selected",
|
|
35
|
-
"aria-disabled",
|
|
36
|
-
"onClick",
|
|
37
|
-
"onKeydown"
|
|
38
|
-
];
|
|
39
|
-
const _hoisted_8 = { class: "astryx-selector-option-label" };
|
|
40
|
-
const _hoisted_9 = {
|
|
41
|
-
key: 0,
|
|
42
|
-
class: "astryx-selector-option-description"
|
|
43
|
-
};
|
|
44
|
-
const _hoisted_10 = {
|
|
45
|
-
key: 2,
|
|
46
|
-
class: "astryx-selector-empty"
|
|
47
|
-
};
|
|
48
|
-
const _hoisted_11 = [
|
|
49
|
-
"id",
|
|
50
|
-
"name",
|
|
51
|
-
"value",
|
|
52
|
-
"aria-label"
|
|
53
|
-
];
|
|
54
|
-
const _hoisted_12 = ["value"];
|
|
55
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
56
|
-
name: "AstryxSelector",
|
|
57
|
-
inheritAttrs: false,
|
|
58
|
-
__name: "Selector",
|
|
59
|
-
props: {
|
|
60
|
-
modelValue: { default: null },
|
|
61
|
-
options: {},
|
|
62
|
-
placeholder: {},
|
|
63
|
-
disabled: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: false
|
|
66
|
-
},
|
|
67
|
-
disabledReason: {},
|
|
68
|
-
status: { default: "default" },
|
|
69
|
-
statusMessage: {},
|
|
70
|
-
size: { default: "md" },
|
|
71
|
-
searchable: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
default: false
|
|
74
|
-
},
|
|
75
|
-
searchPlaceholder: {},
|
|
76
|
-
clearable: {
|
|
77
|
-
type: Boolean,
|
|
78
|
-
default: false
|
|
79
|
-
},
|
|
80
|
-
clearLabel: {},
|
|
81
|
-
emptyText: {},
|
|
82
|
-
label: {},
|
|
83
|
-
name: {}
|
|
84
|
-
},
|
|
85
|
-
emits: [
|
|
86
|
-
"update:modelValue",
|
|
87
|
-
"change",
|
|
88
|
-
"search"
|
|
89
|
-
],
|
|
90
|
-
setup(__props, { emit: __emit }) {
|
|
91
|
-
const props = __props;
|
|
92
|
-
const emit = __emit;
|
|
93
|
-
const slots = useSlots();
|
|
94
|
-
const selectorId = `astryx-selector-${useId()}`;
|
|
95
|
-
const listboxId = `${selectorId}-listbox`;
|
|
96
|
-
const messages = useAstryxMessages();
|
|
97
|
-
const resolvedPlaceholder = computed(() => props.placeholder ?? messages.value.selector.placeholder);
|
|
98
|
-
const resolvedSearchPlaceholder = computed(() => props.searchPlaceholder ?? messages.value.selector.search);
|
|
99
|
-
const resolvedClearLabel = computed(() => props.clearLabel ?? messages.value.selector.clear);
|
|
100
|
-
const resolvedEmptyText = computed(() => props.emptyText ?? messages.value.selector.empty);
|
|
101
|
-
const fieldRef = useTemplateRef("fieldRef");
|
|
102
|
-
const listboxRef = useTemplateRef("listboxRef");
|
|
103
|
-
const searchInputRef = useTemplateRef("searchInputRef");
|
|
104
|
-
const isEnabled = computed(() => !props.disabled);
|
|
105
|
-
const isSearchable = computed(() => props.searchable);
|
|
106
|
-
const comboboxOptions = computed(() => props.options.map((opt) => ({
|
|
107
|
-
value: opt.value,
|
|
108
|
-
label: opt.label,
|
|
109
|
-
disabled: opt.disabled ?? false
|
|
110
|
-
})));
|
|
111
|
-
const modelValueRef = computed({
|
|
112
|
-
get: () => props.modelValue,
|
|
113
|
-
set: (value) => {
|
|
114
|
-
emit("update:modelValue", value);
|
|
115
|
-
emit("change", value);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
const combobox = useCombobox({
|
|
119
|
-
options: comboboxOptions,
|
|
120
|
-
modelValue: modelValueRef,
|
|
121
|
-
isEnabled,
|
|
122
|
-
isSearchable,
|
|
123
|
-
onChange: (value) => {
|
|
124
|
-
modelValueRef.value = value;
|
|
125
|
-
},
|
|
126
|
-
onOpenChange: (isOpen) => {
|
|
127
|
-
if (isOpen && props.searchable) nextTick(() => {
|
|
128
|
-
searchInputRef.value?.focus();
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
const { position } = usePositionedLayer({
|
|
133
|
-
anchor: fieldRef,
|
|
134
|
-
layer: listboxRef,
|
|
135
|
-
isOpen: combobox.isOpen,
|
|
136
|
-
placement: computed(() => "below"),
|
|
137
|
-
alignment: computed(() => "start"),
|
|
138
|
-
gap: 4
|
|
139
|
-
});
|
|
140
|
-
useDismiss({
|
|
141
|
-
container: listboxRef,
|
|
142
|
-
trigger: fieldRef,
|
|
143
|
-
isEnabled: combobox.isOpen,
|
|
144
|
-
enableEscape: ref(true),
|
|
145
|
-
onDismiss: () => {
|
|
146
|
-
combobox.close();
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
const selectedOption = computed(() => {
|
|
150
|
-
if (props.modelValue == null) return null;
|
|
151
|
-
return props.options.find((opt) => opt.value === props.modelValue) ?? null;
|
|
152
|
-
});
|
|
153
|
-
const displayText = computed(() => {
|
|
154
|
-
return selectedOption.value?.label ?? resolvedPlaceholder.value;
|
|
155
|
-
});
|
|
156
|
-
const isEmpty = computed(() => {
|
|
157
|
-
return combobox.filteredOptions.value.length === 0;
|
|
158
|
-
});
|
|
159
|
-
function onTriggerClick() {
|
|
160
|
-
if (isEnabled.value) combobox.toggle();
|
|
161
|
-
}
|
|
162
|
-
function onTriggerKeyDown(event) {
|
|
163
|
-
combobox.onKeyDown(event);
|
|
164
|
-
}
|
|
165
|
-
function onOptionClick(option) {
|
|
166
|
-
if (!option.disabled) combobox.select(option.value);
|
|
167
|
-
}
|
|
168
|
-
function onClear(event) {
|
|
169
|
-
event.stopPropagation();
|
|
170
|
-
modelValueRef.value = null;
|
|
171
|
-
combobox.close();
|
|
172
|
-
}
|
|
173
|
-
function onSearchInput(event) {
|
|
174
|
-
const target = event.target;
|
|
175
|
-
combobox.setSearchQuery(target.value);
|
|
176
|
-
emit("search", target.value);
|
|
177
|
-
}
|
|
178
|
-
function getOptionId(index) {
|
|
179
|
-
return `${listboxId}-option-${index}`;
|
|
180
|
-
}
|
|
181
|
-
const anchorWidth = ref(0);
|
|
182
|
-
function syncAnchorWidth() {
|
|
183
|
-
anchorWidth.value = fieldRef.value?.getBoundingClientRect().width ?? 0;
|
|
184
|
-
}
|
|
185
|
-
const listboxStyle = computed(() => ({
|
|
186
|
-
top: `${position.value.top}px`,
|
|
187
|
-
left: `${position.value.left}px`,
|
|
188
|
-
minWidth: anchorWidth.value > 0 ? `${anchorWidth.value}px` : void 0
|
|
189
|
-
}));
|
|
190
|
-
watch(combobox.isOpen, (open) => {
|
|
191
|
-
if (open) syncAnchorWidth();
|
|
192
|
-
}, { flush: "pre" });
|
|
193
|
-
onMounted(syncAnchorWidth);
|
|
194
|
-
watch(() => combobox.activeIndex.value, (index) => {
|
|
195
|
-
if (index >= 0 && combobox.isOpen.value) nextTick(() => {
|
|
196
|
-
const listbox = listboxRef.value;
|
|
197
|
-
const optionEl = listbox?.querySelector(`#${getOptionId(index)}`);
|
|
198
|
-
if (!listbox || !optionEl) return;
|
|
199
|
-
const listboxRect = listbox.getBoundingClientRect();
|
|
200
|
-
const optionRect = optionEl.getBoundingClientRect();
|
|
201
|
-
if (optionRect.top < listboxRect.top) listbox.scrollTop -= listboxRect.top - optionRect.top;
|
|
202
|
-
else if (optionRect.bottom > listboxRect.bottom) listbox.scrollTop += optionRect.bottom - listboxRect.bottom;
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
return (_ctx, _cache) => {
|
|
206
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(["astryx-selector", [`size-${props.size}`, `status-${props.status}`]]) }, [
|
|
207
|
-
createElementVNode("div", {
|
|
208
|
-
ref_key: "fieldRef",
|
|
209
|
-
ref: fieldRef,
|
|
210
|
-
class: normalizeClass(["astryx-selector-field", {
|
|
211
|
-
"is-open": unref(combobox).isOpen.value,
|
|
212
|
-
"is-disabled": props.disabled
|
|
213
|
-
}])
|
|
214
|
-
}, [createElementVNode("button", {
|
|
215
|
-
id: selectorId,
|
|
216
|
-
type: "button",
|
|
217
|
-
class: normalizeClass(["astryx-selector-trigger", {
|
|
218
|
-
"is-open": unref(combobox).isOpen.value,
|
|
219
|
-
"is-disabled": props.disabled
|
|
220
|
-
}]),
|
|
221
|
-
disabled: props.disabled,
|
|
222
|
-
"aria-haspopup": "listbox",
|
|
223
|
-
"aria-expanded": unref(combobox).isOpen.value,
|
|
224
|
-
"aria-controls": listboxId,
|
|
225
|
-
"aria-label": props.label,
|
|
226
|
-
"aria-activedescendant": unref(combobox).activeIndex.value >= 0 ? getOptionId(unref(combobox).activeIndex.value) : void 0,
|
|
227
|
-
title: props.disabledReason,
|
|
228
|
-
onClick: onTriggerClick,
|
|
229
|
-
onKeydown: onTriggerKeyDown
|
|
230
|
-
}, [createElementVNode("span", { class: normalizeClass(["astryx-selector-value", { "is-placeholder": !selectedOption.value }]) }, [unref(slots).selected ? renderSlot(_ctx.$slots, "selected", { option: selectedOption.value }, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(displayText.value), 1)], 64))], 2), _cache[0] || (_cache[0] = createElementVNode("span", {
|
|
231
|
-
class: "astryx-selector-icon",
|
|
232
|
-
"aria-hidden": "true"
|
|
233
|
-
}, [createElementVNode("svg", {
|
|
234
|
-
width: "16",
|
|
235
|
-
height: "16",
|
|
236
|
-
viewBox: "0 0 16 16",
|
|
237
|
-
fill: "none"
|
|
238
|
-
}, [createElementVNode("path", {
|
|
239
|
-
d: "M4 6L8 10L12 6",
|
|
240
|
-
stroke: "currentColor",
|
|
241
|
-
"stroke-width": "1.5",
|
|
242
|
-
"stroke-linecap": "round",
|
|
243
|
-
"stroke-linejoin": "round"
|
|
244
|
-
})])], -1))], 42, _hoisted_1), props.clearable && selectedOption.value ? (openBlock(), createElementBlock("button", {
|
|
245
|
-
key: 0,
|
|
246
|
-
type: "button",
|
|
247
|
-
class: "astryx-selector-clear",
|
|
248
|
-
"aria-label": resolvedClearLabel.value,
|
|
249
|
-
onClick: onClear
|
|
250
|
-
}, [..._cache[1] || (_cache[1] = [createElementVNode("svg", {
|
|
251
|
-
width: "16",
|
|
252
|
-
height: "16",
|
|
253
|
-
viewBox: "0 0 16 16",
|
|
254
|
-
fill: "none"
|
|
255
|
-
}, [createElementVNode("path", {
|
|
256
|
-
d: "M12 4L4 12M4 4L12 12",
|
|
257
|
-
stroke: "currentColor",
|
|
258
|
-
"stroke-width": "1.5",
|
|
259
|
-
"stroke-linecap": "round"
|
|
260
|
-
})], -1)])], 8, _hoisted_2)) : createCommentVNode("v-if", true)], 2),
|
|
261
|
-
(openBlock(), createBlock(Teleport, { to: "body" }, [withDirectives(createElementVNode("div", {
|
|
262
|
-
id: listboxId,
|
|
263
|
-
ref_key: "listboxRef",
|
|
264
|
-
ref: listboxRef,
|
|
265
|
-
role: "listbox",
|
|
266
|
-
class: "astryx-selector-listbox",
|
|
267
|
-
"data-placement": unref(position).placement,
|
|
268
|
-
style: normalizeStyle(listboxStyle.value),
|
|
269
|
-
tabindex: "-1"
|
|
270
|
-
}, [props.searchable ? (openBlock(), createElementBlock("div", _hoisted_4, [createElementVNode("input", {
|
|
271
|
-
id: `${selectorId}-search`,
|
|
272
|
-
ref_key: "searchInputRef",
|
|
273
|
-
ref: searchInputRef,
|
|
274
|
-
type: "text",
|
|
275
|
-
class: "astryx-selector-search-input",
|
|
276
|
-
"aria-label": resolvedSearchPlaceholder.value,
|
|
277
|
-
placeholder: resolvedSearchPlaceholder.value,
|
|
278
|
-
value: unref(combobox).searchQuery.value,
|
|
279
|
-
onInput: onSearchInput
|
|
280
|
-
}, null, 40, _hoisted_5)])) : createCommentVNode("v-if", true), !isEmpty.value ? (openBlock(), createElementBlock("div", _hoisted_6, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(combobox).filteredOptions.value, (option, index) => {
|
|
281
|
-
return openBlock(), createElementBlock("div", {
|
|
282
|
-
id: getOptionId(index),
|
|
283
|
-
key: option.value,
|
|
284
|
-
role: "option",
|
|
285
|
-
tabindex: "0",
|
|
286
|
-
class: normalizeClass(["astryx-selector-option", {
|
|
287
|
-
"is-active": index === unref(combobox).activeIndex.value,
|
|
288
|
-
"is-selected": option.value === props.modelValue,
|
|
289
|
-
"is-disabled": option.disabled
|
|
290
|
-
}]),
|
|
291
|
-
"aria-selected": option.value === props.modelValue,
|
|
292
|
-
"aria-disabled": option.disabled,
|
|
293
|
-
onClick: ($event) => onOptionClick(option),
|
|
294
|
-
onKeydown: [withKeys(($event) => onOptionClick(option), ["enter"]), withKeys(withModifiers(($event) => onOptionClick(option), ["prevent"]), ["space"])]
|
|
295
|
-
}, [unref(slots).option ? renderSlot(_ctx.$slots, "option", {
|
|
296
|
-
option,
|
|
297
|
-
isActive: index === unref(combobox).activeIndex.value,
|
|
298
|
-
isSelected: option.value === props.modelValue
|
|
299
|
-
}, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("span", _hoisted_8, toDisplayString(option.label), 1), option.description ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(option.description), 1)) : createCommentVNode("v-if", true)], 64))], 42, _hoisted_7);
|
|
300
|
-
}), 128))])) : (openBlock(), createElementBlock("div", _hoisted_10, [unref(slots).empty ? renderSlot(_ctx.$slots, "empty", {}, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(resolvedEmptyText.value), 1)], 64))]))], 12, _hoisted_3), [[vShow, unref(combobox).isOpen.value]])])),
|
|
301
|
-
props.name ? (openBlock(), createElementBlock("select", {
|
|
302
|
-
key: 0,
|
|
303
|
-
id: `${selectorId}-hidden-select`,
|
|
304
|
-
name: props.name,
|
|
305
|
-
value: props.modelValue ?? "",
|
|
306
|
-
"aria-label": props.label || resolvedPlaceholder.value,
|
|
307
|
-
tabindex: "-1",
|
|
308
|
-
style: {
|
|
309
|
-
"position": "absolute",
|
|
310
|
-
"left": "-9999px",
|
|
311
|
-
"width": "1px",
|
|
312
|
-
"height": "1px"
|
|
313
|
-
}
|
|
314
|
-
}, [_cache[2] || (_cache[2] = createElementVNode("option", { value: "" }, null, -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(props.options, (option) => {
|
|
315
|
-
return openBlock(), createElementBlock("option", {
|
|
316
|
-
key: option.value,
|
|
317
|
-
value: option.value
|
|
318
|
-
}, toDisplayString(option.label), 9, _hoisted_12);
|
|
319
|
-
}), 128))], 8, _hoisted_11)) : createCommentVNode("v-if", true)
|
|
320
|
-
], 2);
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
//#endregion
|
|
325
|
-
export { _sfc_main as t };
|
package/dist/index-BzqRns96.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
//#region src/Text/types.d.ts
|
|
2
|
-
type TextType = 'body' | 'large' | 'label' | 'supporting' | 'code' | 'display-1' | 'display-2' | 'display-3';
|
|
3
|
-
type TextSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
-
type TextColor = 'primary' | 'secondary' | 'accent' | 'inherit';
|
|
5
|
-
type TextWeight = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
6
|
-
type TextDisplay = 'block' | 'inline';
|
|
7
|
-
type TextAs = 'span' | 'p' | 'div' | 'label';
|
|
8
|
-
interface TextProps {
|
|
9
|
-
/**
|
|
10
|
-
* Semantic text type. Determines size, weight, and line-height.
|
|
11
|
-
* @default 'body'
|
|
12
|
-
*/
|
|
13
|
-
type?: TextType;
|
|
14
|
-
/**
|
|
15
|
-
* Explicit font size override.
|
|
16
|
-
*/
|
|
17
|
-
size?: TextSize;
|
|
18
|
-
/**
|
|
19
|
-
* Text color.
|
|
20
|
-
* @default 'primary'
|
|
21
|
-
*/
|
|
22
|
-
color?: TextColor;
|
|
23
|
-
/**
|
|
24
|
-
* Font weight override.
|
|
25
|
-
*/
|
|
26
|
-
weight?: TextWeight;
|
|
27
|
-
/**
|
|
28
|
-
* Display type.
|
|
29
|
-
* @default 'inline'
|
|
30
|
-
*/
|
|
31
|
-
display?: TextDisplay;
|
|
32
|
-
/**
|
|
33
|
-
* HTML element to render.
|
|
34
|
-
* @default 'span'
|
|
35
|
-
*/
|
|
36
|
-
as?: TextAs;
|
|
37
|
-
/**
|
|
38
|
-
* Maximum lines before truncation. 0 means no truncation.
|
|
39
|
-
* @default 0
|
|
40
|
-
*/
|
|
41
|
-
maxLines?: number;
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/Text/Text.vue.d.ts
|
|
45
|
-
declare var __VLS_7: {};
|
|
46
|
-
type __VLS_Slots = {} & {
|
|
47
|
-
default?: (props: typeof __VLS_7) => any;
|
|
48
|
-
};
|
|
49
|
-
declare const __VLS_base: import("vue").DefineComponent<TextProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TextProps> & Readonly<{}>, {
|
|
50
|
-
type: TextType;
|
|
51
|
-
as: TextAs;
|
|
52
|
-
color: TextColor;
|
|
53
|
-
display: TextDisplay;
|
|
54
|
-
maxLines: number;
|
|
55
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
57
|
-
declare const _default: typeof __VLS_export;
|
|
58
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
59
|
-
new (): {
|
|
60
|
-
$slots: S;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
//#endregion
|
|
64
|
-
export { TextProps as a, TextWeight as c, TextDisplay as i, TextAs as n, TextSize as o, TextColor as r, TextType as s, _default as t };
|
package/dist/index-ZJyk8RtQ.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
//#region src/DateInput/types.d.ts
|
|
2
|
-
interface DateInputProps {
|
|
3
|
-
/** 输入框 id。不传时组件自己生成。 */
|
|
4
|
-
id?: string;
|
|
5
|
-
/** 额外的无障碍描述,接在字段说明后面。 */
|
|
6
|
-
describedBy?: string;
|
|
7
|
-
/** 当前选中的日期 */
|
|
8
|
-
modelValue?: Date | null;
|
|
9
|
-
/** 占位符文本 */
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
/** 最小可选日期 */
|
|
12
|
-
min?: Date;
|
|
13
|
-
/** 最大可选日期 */
|
|
14
|
-
max?: Date;
|
|
15
|
-
/** 禁用的日期判断函数 */
|
|
16
|
-
isDateDisabled?: (date: Date) => boolean;
|
|
17
|
-
/** 表单字段名 */
|
|
18
|
-
name?: string;
|
|
19
|
-
/** 输入框标签 */
|
|
20
|
-
label?: string;
|
|
21
|
-
/** 是否禁用 */
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
/** 禁用原因 */
|
|
24
|
-
disabledReason?: string;
|
|
25
|
-
/** 是否可清除 */
|
|
26
|
-
clearable?: boolean;
|
|
27
|
-
/** 清除按钮标签 */
|
|
28
|
-
clearLabel?: string;
|
|
29
|
-
/** 尺寸 */
|
|
30
|
-
size?: 'sm' | 'md' | 'lg';
|
|
31
|
-
/** 状态 */
|
|
32
|
-
status?: 'default' | 'error' | 'warning' | 'success';
|
|
33
|
-
}
|
|
34
|
-
interface DateInputEmits {
|
|
35
|
-
(event: 'update:modelValue', value: Date | null): void;
|
|
36
|
-
(event: 'change', value: Date | null): void;
|
|
37
|
-
}
|
|
38
|
-
interface DateInputSlots {
|
|
39
|
-
/** 自定义前缀图标 */
|
|
40
|
-
prefix?: () => any;
|
|
41
|
-
/** 自定义后缀内容 */
|
|
42
|
-
suffix?: () => any;
|
|
43
|
-
}
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region src/DateInput/DateInput.vue.d.ts
|
|
46
|
-
type __VLS_Slots = DateInputSlots;
|
|
47
|
-
declare const __VLS_base: import("vue").DefineComponent<DateInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
48
|
-
change: (value: Date | null) => any;
|
|
49
|
-
"update:modelValue": (value: Date | null) => any;
|
|
50
|
-
}, string, import("vue").PublicProps, Readonly<DateInputProps> & Readonly<{
|
|
51
|
-
onChange?: ((value: Date | null) => any) | undefined;
|
|
52
|
-
"onUpdate:modelValue"?: ((value: Date | null) => any) | undefined;
|
|
53
|
-
}>, {
|
|
54
|
-
size: "md" | "sm" | "lg";
|
|
55
|
-
status: "default" | "success" | "warning" | "error";
|
|
56
|
-
modelValue: Date | null;
|
|
57
|
-
disabled: boolean;
|
|
58
|
-
clearable: boolean;
|
|
59
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
60
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
61
|
-
declare const _default: typeof __VLS_export;
|
|
62
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
63
|
-
new (): {
|
|
64
|
-
$slots: S;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
//#endregion
|
|
68
|
-
export { DateInputSlots as i, DateInputEmits as n, DateInputProps as r, _default as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { r as useItemDescriptionId } from "./Item-C1z6gXn8.js";
|
|
1
2
|
import { t as _sfc_main$2 } from "./CheckboxInput-CMsEE1_4.js";
|
|
2
3
|
import { t as _sfc_main$3 } from "./Field-8zRxzDHE.js";
|
|
3
|
-
import { r as useItemDescriptionId } from "./Item-C1z6gXn8.js";
|
|
4
4
|
import { n as _sfc_main$4, t as _sfc_main$5 } from "./ListItem-pGxvn6QJ.js";
|
|
5
5
|
import { computed, createBlock, createElementVNode, createSlots, createVNode, defineComponent, inject, mergeModels, openBlock, provide, renderSlot, toDisplayString, unref, useId, useModel, useTemplateRef, withCtx } from "vue";
|
|
6
6
|
import "../styles/checkbox-list.css";
|
|
@@ -40,8 +40,8 @@ declare const __VLS_base: import("vue").DefineComponent<TokenProps, {}, {}, {},
|
|
|
40
40
|
}>, {
|
|
41
41
|
size: TokenSize;
|
|
42
42
|
color: "default" | "blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow";
|
|
43
|
-
labelHidden: boolean;
|
|
44
43
|
disabled: boolean;
|
|
44
|
+
labelHidden: boolean;
|
|
45
45
|
removable: boolean;
|
|
46
46
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
47
47
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|