@astryx-vue/core 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-1wNIEtK_.js → AppShell-Cb41gIAj.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.js +1 -1
- package/dist/{Breadcrumbs-C97HmjkC.js → Breadcrumbs-CTQ7fjDn.js} +2 -2
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/{Calendar-DqC3EDN1.js → Calendar-BFaI5AMv.js} +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-BGUnskjo.js → Carousel-X0cuQkvg.js} +2 -2
- package/dist/Chat/index.d.ts +2 -2
- package/dist/Chat/index.js +2 -2
- package/dist/Chat-M0tiGrNT.js +3148 -0
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-DunoAqVH.js → Citation-C1veUk5p.js} +2 -2
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Code/index.js +1 -1
- package/dist/{CodeBlock-CAF-VJnh.js → CodeBlock-DesTJAkm.js} +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-DvMiYJp7.js → Collapsible-BestK35V.js} +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-xfm9ldUI.js → CommandPalette-BArt97V8.js} +1 -1
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-B6lBTRhP.js → ComplexSelector-CAoig1RK.js} +2 -2
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +1 -1
- package/dist/{ContextMenu-DUkED3Z3.js → ContextMenu-9Im6i43E.js} +1 -1
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-Crcg-CCj.js → DateInput-BLocxqC3.js} +2 -2
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-e9KSxBBK.js → DateRangeInput-DwDy3eRo.js} +2 -2
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-fSOfuLex.js → DateTimeInput-BYiaC9bn.js} +3 -3
- package/dist/Divider/index.d.ts +1 -1
- package/dist/DropdownMenu/index.js +2 -2
- package/dist/{DropdownMenu-XvW4BJob.js → DropdownMenu-Ddfr-aEC.js} +2 -2
- package/dist/{DropdownMenu-8G0B1UND.js → DropdownMenu-Dh-WAHKb.js} +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-D-fchyQH.js → FileInput-DLO6V12n.js} +2 -2
- package/dist/Icon/index.d.ts +2 -2
- package/dist/Icon/index.js +1 -1
- package/dist/{Icon-Bku25g_K.js → Icon-CJKjdJy-.js} +6 -1
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-uuVGgHxW.js → Lightbox-CdFCS_EA.js} +2 -2
- package/dist/List/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-DLICa3db.js → Markdown-BqKloI3w.js} +2 -2
- package/dist/MetadataList/index.d.ts +1 -1
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-h492rqEN.js → MetadataList-CvZkmisf.js} +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-BMj3Wtuq.js → MobileNavToggle-Bwi0qXXM.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-DkYi5az5.js → MoreMenu-BwJaJrkB.js} +1 -1
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-C2IS-EaU.js → MultiSelector-C-ETfFy_.js} +2 -2
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-CjfAsFwj.js → NumberInput-DjetVB8O.js} +1 -1
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-BTmrtvXR.js → Outline-Bz9c-u5y.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-CRE8BE7V.js → OverflowList-ED-KN9Y5.js} +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-BpGXPmc7.js → Pagination-Cb66HMEf.js} +2 -2
- package/dist/PowerSearch/index.d.ts +2 -0
- package/dist/PowerSearch/index.js +2 -0
- package/dist/PowerSearch-CjU8y4mi.js +2386 -0
- package/dist/Radio/index.d.ts +1 -1
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{Resizable-CE8XQDL2.js → Resizable-D-TBCg0Y.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 +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-DkJOLZSR.js → Selector-DE2IEFML.js} +1 -1
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-DcDWBnXJ.js → SideNav-DonEfiAx.js} +2 -2
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-DZKaqEoz.js → Stepper-D2ZIcUNx.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-hm06QPiW.js → TabList-D3F-stq-.js} +1 -1
- package/dist/Table/index.d.ts +3 -3
- package/dist/Table/index.js +2 -2
- package/dist/Table-CrP2Uffq.js +1982 -0
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-CAOYds8t.js → Thumbnail-BC5JGPGZ.js} +2 -2
- package/dist/{TimeField-BGbxCoKU.js → TimeField-DpHFrNv0.js} +2 -2
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-DJP3l4ZS.js → TimeInput-DJLV0_4z.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-BzRp8uWc.js → Timestamp-GKNjjt5g.js} +3 -3
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-CjocuhzE.js → Token-Chu_eCVs.js} +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-mYES5SPM.js → Tokenizer-DRDpvQ_l.js} +3 -3
- 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-CEyWddtA.js} +3 -3
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-THJ0KamE.js → TreeList-COS8US8e.js} +2 -2
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-D7VnvRpK.js → Typeahead-P7cCqtaQ.js} +3 -3
- package/dist/{useTypeaheadMenu-Ba7XpcZl.js → TypeaheadMenu-CGvo0Tud.js} +107 -107
- package/dist/composables/index.d.ts +3 -3
- package/dist/{context-DzcK4T_C.js → context-CiKncNSH.js} +180 -4
- package/dist/{index-SMh42NI8.d.ts → index-B1TG2GPS.d.ts} +2 -2
- package/dist/index-B9WzWqzk.d.ts +18 -0
- package/dist/{index-Z_onS2lR.d.ts → index-C7mxUcDR.d.ts} +2 -2
- package/dist/{index-cG1E0U2s.d.ts → index-CVn0GBdB.d.ts} +1 -1
- package/dist/{index-DnEh-HA0.d.ts → index-C_2Z65Rp.d.ts} +1 -1
- package/dist/{index-DXSs3rwa.d.ts → index-CngORuiq.d.ts} +137 -2
- package/dist/index-Cs5pcwY3.d.ts +416 -0
- package/dist/{index-DnSrjbjP.d.ts → index-D-ZuubCK.d.ts} +1 -1
- package/dist/{index-DAiGhkNZ.d.ts → index-D4I_obqR.d.ts} +1 -1
- package/dist/{index-I4J7gwa1.d.ts → index-DGXviOlp.d.ts} +1 -1
- package/dist/{index-BLOEjvaM.d.ts → index-DN7MXPHM.d.ts} +1 -1
- package/dist/{index-DeOftUMq.d.ts → index-DNRBbwp_.d.ts} +37 -36
- package/dist/{index-DQAnGHu7.d.ts → index-DOUEn7V0.d.ts} +2 -2
- package/dist/{index-CBym0hSq.d.ts → index-DWH_HzXi.d.ts} +1 -1
- package/dist/{index-Byar3h1e.d.ts → index-HV6W3xCx.d.ts} +1 -1
- package/dist/{index-D2bSSSBP.d.ts → index-fa72tWIU.d.ts} +1 -1
- package/dist/{index-COxy6LEW.d.ts → index-gW0HW02U.d.ts} +1 -1
- package/dist/index-kVhSuA9t.d.ts +902 -0
- package/dist/{index-1uRMrk63.d.ts → index-nCEmW6wa.d.ts} +1 -1
- package/dist/{index-Clmz00IK.d.ts → index-qiZtHnGK.d.ts} +24 -0
- package/dist/{index-3p2BDVHq.d.ts → index-u5ozu0G7.d.ts} +2 -2
- package/dist/{index-NOXYEdOI.d.ts → index-utZGF4GR.d.ts} +1 -1
- package/dist/index.d.ts +73 -71
- package/dist/index.js +106 -98
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +1 -1
- package/dist/power-search-DrDfcoL1.d.ts +68 -0
- package/dist/{types-JktRxujg.d.ts → types-Cp4liug-.d.ts} +66 -3
- package/dist/types-DIYwbkpe.d.ts +33 -0
- package/dist/{types-BKcxXW--.d.ts → types-pnljWjEE.d.ts} +1 -1
- package/dist/{useResizable-CeESZS1v.d.ts → useResizable-CUoNPmUw.d.ts} +1 -1
- package/package.json +5 -1
- package/styles/chat.css +469 -1
- package/styles/icon.css +20 -0
- package/styles/power-search.css +303 -0
- package/styles/table.css +304 -1
- package/styles.css +1 -0
- package/dist/Chat-DCjXRiOF.js +0 -1051
- package/dist/Table-DwehtMap.js +0 -967
- package/dist/index-CuFLztiI.d.ts +0 -49
- package/dist/index-DJo-BmXZ.d.ts +0 -431
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import { a as SearchableItem, i as SearchSource } from "./useAsyncSource-xpQovjV_.js";
|
|
2
|
+
import { t as PowerSearchMessages } from "./power-search-DrDfcoL1.js";
|
|
3
|
+
import { Component, VNodeChild } from "vue";
|
|
4
|
+
//#region src/PowerSearch/types.d.ts
|
|
5
|
+
interface EmptyOperatorValue {
|
|
6
|
+
readonly type: 'empty';
|
|
7
|
+
}
|
|
8
|
+
interface StringOperatorValue {
|
|
9
|
+
readonly type: 'string';
|
|
10
|
+
readonly searchSource?: SearchSource;
|
|
11
|
+
readonly isArbitraryStringAllowed?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface OperatorTokenizationConfig {
|
|
14
|
+
readonly regex?: string;
|
|
15
|
+
readonly sort?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface StringListOperatorValue {
|
|
18
|
+
readonly type: 'string_list';
|
|
19
|
+
readonly searchSource?: SearchSource;
|
|
20
|
+
readonly isArbitraryStringAllowed?: boolean;
|
|
21
|
+
readonly tokenization?: OperatorTokenizationConfig;
|
|
22
|
+
}
|
|
23
|
+
interface IntegerOperatorValue {
|
|
24
|
+
readonly type: 'integer';
|
|
25
|
+
readonly minValue?: number;
|
|
26
|
+
readonly maxValue?: number;
|
|
27
|
+
readonly units?: string;
|
|
28
|
+
}
|
|
29
|
+
interface FloatOperatorValue {
|
|
30
|
+
readonly type: 'float';
|
|
31
|
+
readonly minValue?: number;
|
|
32
|
+
readonly maxValue?: number;
|
|
33
|
+
readonly units?: string;
|
|
34
|
+
}
|
|
35
|
+
interface TimeOperatorValue {
|
|
36
|
+
readonly type: 'time';
|
|
37
|
+
readonly minValue?: string;
|
|
38
|
+
readonly maxValue?: string;
|
|
39
|
+
}
|
|
40
|
+
interface DateAbsoluteOperatorValue {
|
|
41
|
+
readonly type: 'date_absolute';
|
|
42
|
+
readonly isDateOnly?: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface DateRelativeOperatorValue {
|
|
45
|
+
readonly type: 'date_relative';
|
|
46
|
+
readonly isPastAllowed?: boolean;
|
|
47
|
+
readonly isFutureAllowed?: boolean;
|
|
48
|
+
}
|
|
49
|
+
type DateTimeRangePart = {
|
|
50
|
+
readonly type: 'NOW';
|
|
51
|
+
} | {
|
|
52
|
+
readonly type: 'ABSOLUTE';
|
|
53
|
+
readonly unixSeconds: number;
|
|
54
|
+
} | {
|
|
55
|
+
readonly type: 'RELATIVE';
|
|
56
|
+
readonly backValue: number;
|
|
57
|
+
readonly unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
58
|
+
readonly anchorKey?: string;
|
|
59
|
+
};
|
|
60
|
+
interface DateTimeRange {
|
|
61
|
+
readonly start: DateTimeRangePart;
|
|
62
|
+
readonly end: DateTimeRangePart;
|
|
63
|
+
}
|
|
64
|
+
interface DateRangeFilterPreset {
|
|
65
|
+
readonly label: string;
|
|
66
|
+
readonly value: DateTimeRange;
|
|
67
|
+
}
|
|
68
|
+
interface RelativeDateFilterPreset {
|
|
69
|
+
readonly label: string;
|
|
70
|
+
readonly value: string;
|
|
71
|
+
}
|
|
72
|
+
interface DateRangeOperatorValue {
|
|
73
|
+
readonly type: 'date_range';
|
|
74
|
+
readonly intervalDatePresets?: readonly DateRangeFilterPreset[];
|
|
75
|
+
readonly relativeDatePresets?: readonly RelativeDateFilterPreset[];
|
|
76
|
+
}
|
|
77
|
+
interface EnumItem {
|
|
78
|
+
readonly value: string;
|
|
79
|
+
readonly label: string;
|
|
80
|
+
/** 内置图形名,或 `collection:icon`。 */
|
|
81
|
+
readonly icon?: string;
|
|
82
|
+
}
|
|
83
|
+
interface EnumOperatorValue {
|
|
84
|
+
readonly type: 'enum';
|
|
85
|
+
readonly values: readonly EnumItem[];
|
|
86
|
+
}
|
|
87
|
+
interface EnumListOperatorValue {
|
|
88
|
+
readonly type: 'enum_list';
|
|
89
|
+
readonly values: readonly EnumItem[];
|
|
90
|
+
}
|
|
91
|
+
interface EntityListOperatorValue {
|
|
92
|
+
readonly type: 'entity_list';
|
|
93
|
+
readonly searchSource?: SearchSource;
|
|
94
|
+
readonly isArbitraryStringAllowed?: boolean;
|
|
95
|
+
readonly tokenization?: OperatorTokenizationConfig;
|
|
96
|
+
}
|
|
97
|
+
interface CustomOperatorValue {
|
|
98
|
+
readonly type: 'custom';
|
|
99
|
+
readonly Editor: Component;
|
|
100
|
+
readonly getString: (value: string) => string;
|
|
101
|
+
}
|
|
102
|
+
interface NestedOperatorValue {
|
|
103
|
+
readonly type: 'nested';
|
|
104
|
+
}
|
|
105
|
+
type OperatorValue = EmptyOperatorValue | StringOperatorValue | StringListOperatorValue | IntegerOperatorValue | FloatOperatorValue | TimeOperatorValue | DateAbsoluteOperatorValue | DateRelativeOperatorValue | DateRangeOperatorValue | EnumOperatorValue | EnumListOperatorValue | EntityListOperatorValue | CustomOperatorValue | NestedOperatorValue;
|
|
106
|
+
interface FilterValueEmpty {
|
|
107
|
+
readonly type: 'empty';
|
|
108
|
+
}
|
|
109
|
+
interface FilterValueString {
|
|
110
|
+
readonly type: 'string';
|
|
111
|
+
readonly value: string;
|
|
112
|
+
}
|
|
113
|
+
interface FilterValueStringList {
|
|
114
|
+
readonly type: 'string_list';
|
|
115
|
+
readonly value: readonly string[];
|
|
116
|
+
}
|
|
117
|
+
interface FilterValueInteger {
|
|
118
|
+
readonly type: 'integer';
|
|
119
|
+
readonly value: number;
|
|
120
|
+
}
|
|
121
|
+
interface FilterValueFloat {
|
|
122
|
+
readonly type: 'float';
|
|
123
|
+
readonly value: number;
|
|
124
|
+
}
|
|
125
|
+
interface FilterValueTime {
|
|
126
|
+
readonly type: 'time';
|
|
127
|
+
readonly value: string;
|
|
128
|
+
}
|
|
129
|
+
interface FilterValueDateAbsolute {
|
|
130
|
+
readonly type: 'date_absolute';
|
|
131
|
+
readonly unixSeconds: number;
|
|
132
|
+
}
|
|
133
|
+
interface FilterValueDateRelative {
|
|
134
|
+
readonly type: 'date_relative';
|
|
135
|
+
readonly value: string;
|
|
136
|
+
}
|
|
137
|
+
interface FilterValueDateRange {
|
|
138
|
+
readonly type: 'date_range';
|
|
139
|
+
readonly value: DateTimeRange;
|
|
140
|
+
}
|
|
141
|
+
interface FilterValueEnum {
|
|
142
|
+
readonly type: 'enum';
|
|
143
|
+
readonly value: string;
|
|
144
|
+
}
|
|
145
|
+
interface FilterValueEnumList {
|
|
146
|
+
readonly type: 'enum_list';
|
|
147
|
+
readonly value: readonly string[];
|
|
148
|
+
}
|
|
149
|
+
interface PowerSearchEntity {
|
|
150
|
+
readonly id: string;
|
|
151
|
+
readonly label: string;
|
|
152
|
+
readonly photo?: string;
|
|
153
|
+
}
|
|
154
|
+
interface FilterValueEntityList {
|
|
155
|
+
readonly type: 'entity_list';
|
|
156
|
+
readonly value: readonly PowerSearchEntity[];
|
|
157
|
+
}
|
|
158
|
+
interface FilterValueCustom {
|
|
159
|
+
readonly type: 'custom';
|
|
160
|
+
readonly value: string;
|
|
161
|
+
}
|
|
162
|
+
interface FilterValueNested {
|
|
163
|
+
readonly type: 'nested';
|
|
164
|
+
readonly value: readonly PowerSearchFilter[];
|
|
165
|
+
}
|
|
166
|
+
type FilterValue = FilterValueEmpty | FilterValueString | FilterValueStringList | FilterValueInteger | FilterValueFloat | FilterValueTime | FilterValueDateAbsolute | FilterValueDateRelative | FilterValueDateRange | FilterValueEnum | FilterValueEnumList | FilterValueEntityList | FilterValueCustom | FilterValueNested;
|
|
167
|
+
interface PowerSearchOperatorBase {
|
|
168
|
+
readonly key: string;
|
|
169
|
+
readonly value: OperatorValue;
|
|
170
|
+
}
|
|
171
|
+
interface PowerSearchOperatorWithLabel extends PowerSearchOperatorBase {
|
|
172
|
+
readonly label: string;
|
|
173
|
+
readonly i18nKey?: never;
|
|
174
|
+
}
|
|
175
|
+
interface PowerSearchOperatorWithI18nKey extends PowerSearchOperatorBase {
|
|
176
|
+
readonly i18nKey: string;
|
|
177
|
+
readonly label?: never;
|
|
178
|
+
}
|
|
179
|
+
type PowerSearchOperator = PowerSearchOperatorWithLabel | PowerSearchOperatorWithI18nKey;
|
|
180
|
+
interface PowerSearchField {
|
|
181
|
+
readonly key: string;
|
|
182
|
+
readonly label: string;
|
|
183
|
+
readonly operators: readonly PowerSearchOperator[];
|
|
184
|
+
readonly icon?: string;
|
|
185
|
+
readonly defaultOperator?: string;
|
|
186
|
+
readonly group?: string;
|
|
187
|
+
readonly description?: string;
|
|
188
|
+
readonly typeaheadAliases?: readonly string[];
|
|
189
|
+
readonly typeaheadMinQueryLength?: number;
|
|
190
|
+
readonly isValueMatchAllowed?: boolean;
|
|
191
|
+
}
|
|
192
|
+
interface PowerSearchConfig {
|
|
193
|
+
readonly name: string;
|
|
194
|
+
readonly fields: readonly PowerSearchField[];
|
|
195
|
+
readonly contentSearchFieldKey?: string;
|
|
196
|
+
}
|
|
197
|
+
interface PowerSearchFilter {
|
|
198
|
+
readonly field: string;
|
|
199
|
+
readonly operator: string;
|
|
200
|
+
readonly value: FilterValue;
|
|
201
|
+
readonly isReadOnly?: boolean;
|
|
202
|
+
}
|
|
203
|
+
interface PartialFilter {
|
|
204
|
+
readonly field: string;
|
|
205
|
+
readonly operator?: string;
|
|
206
|
+
readonly value?: FilterValue;
|
|
207
|
+
readonly isReadOnly?: boolean;
|
|
208
|
+
}
|
|
209
|
+
type PowerSearchChangeType = 'add' | 'edit' | 'remove';
|
|
210
|
+
interface PowerSearchHandle {
|
|
211
|
+
focusTypeahead: () => void;
|
|
212
|
+
blurTypeahead: () => void;
|
|
213
|
+
}
|
|
214
|
+
interface PowerSearchAuxData {
|
|
215
|
+
readonly fieldKey: string;
|
|
216
|
+
readonly operatorKey?: string;
|
|
217
|
+
readonly filterValue?: FilterValue;
|
|
218
|
+
readonly filterIndex?: number;
|
|
219
|
+
readonly group?: string;
|
|
220
|
+
}
|
|
221
|
+
type PowerSearchItem = SearchableItem<PowerSearchAuxData>;
|
|
222
|
+
type PowerSearchSize = 'sm' | 'md' | 'lg';
|
|
223
|
+
type PowerSearchStatus = 'default' | 'success' | 'warning' | 'error';
|
|
224
|
+
type PowerSearchStatusVariant = 'attached' | 'detached';
|
|
225
|
+
type PowerSearchOverflow = 'none' | 'unfocused-inline' | 'unfocused-layer';
|
|
226
|
+
interface PowerSearchTokenProps {
|
|
227
|
+
config: PowerSearchConfig;
|
|
228
|
+
filter: PowerSearchFilter;
|
|
229
|
+
field: PowerSearchField;
|
|
230
|
+
operator: PowerSearchOperator;
|
|
231
|
+
maxLength: number;
|
|
232
|
+
disabled?: boolean;
|
|
233
|
+
onClick?: () => void;
|
|
234
|
+
onRemove?: () => void;
|
|
235
|
+
}
|
|
236
|
+
interface PowerSearchEditorProps {
|
|
237
|
+
config: PowerSearchConfig;
|
|
238
|
+
filter: PartialFilter;
|
|
239
|
+
mode: 'create' | 'edit';
|
|
240
|
+
saveLabel?: string;
|
|
241
|
+
readOnly?: boolean;
|
|
242
|
+
timeZone?: string;
|
|
243
|
+
maxMenuItems?: number;
|
|
244
|
+
onSave: (filter: PowerSearchFilter | null) => void;
|
|
245
|
+
onCancel: () => void;
|
|
246
|
+
}
|
|
247
|
+
interface PowerSearchComponentOverride {
|
|
248
|
+
token?: Component;
|
|
249
|
+
editor?: Component;
|
|
250
|
+
}
|
|
251
|
+
type PowerSearchComponents = Partial<Record<OperatorValue['type'], PowerSearchComponentOverride>>;
|
|
252
|
+
interface PowerSearchProps {
|
|
253
|
+
config: PowerSearchConfig;
|
|
254
|
+
filters?: readonly PowerSearchFilter[];
|
|
255
|
+
label?: string;
|
|
256
|
+
labelHidden?: boolean;
|
|
257
|
+
placeholder?: string;
|
|
258
|
+
autofocus?: boolean;
|
|
259
|
+
clearable?: boolean;
|
|
260
|
+
readOnly?: boolean;
|
|
261
|
+
disabled?: boolean;
|
|
262
|
+
disabledReason?: string;
|
|
263
|
+
status?: PowerSearchStatus;
|
|
264
|
+
statusMessage?: string;
|
|
265
|
+
statusVariant?: PowerSearchStatusVariant;
|
|
266
|
+
maxTokenLength?: number;
|
|
267
|
+
maxOperatorMenuItems?: number;
|
|
268
|
+
maxSearchResults?: number;
|
|
269
|
+
menuWidth?: number;
|
|
270
|
+
saveLabel?: string;
|
|
271
|
+
timeZone?: string;
|
|
272
|
+
overflow?: PowerSearchOverflow;
|
|
273
|
+
resultCount?: number | string;
|
|
274
|
+
size?: PowerSearchSize;
|
|
275
|
+
components?: PowerSearchComponents;
|
|
276
|
+
}
|
|
277
|
+
interface PowerSearchEmits {
|
|
278
|
+
'update:filters': [filters: PowerSearchFilter[]];
|
|
279
|
+
'change': [filters: PowerSearchFilter[], changeType: PowerSearchChangeType, index: number];
|
|
280
|
+
'focus': [event: FocusEvent];
|
|
281
|
+
'blur': [event: FocusEvent];
|
|
282
|
+
}
|
|
283
|
+
interface PowerSearchSlots {
|
|
284
|
+
icon?: () => VNodeChild;
|
|
285
|
+
end?: () => VNodeChild;
|
|
286
|
+
token?: (props: PowerSearchTokenProps) => VNodeChild;
|
|
287
|
+
editor?: (props: PowerSearchEditorProps) => VNodeChild;
|
|
288
|
+
}
|
|
289
|
+
type PowerSearchFieldType = 'string' | 'number' | 'boolean' | 'date' | 'enum' | 'enum_list' | 'string_list';
|
|
290
|
+
interface PowerSearchFieldDefinition<K extends string = string, T extends PowerSearchFieldType = PowerSearchFieldType> {
|
|
291
|
+
readonly key: K;
|
|
292
|
+
readonly type: T;
|
|
293
|
+
readonly label?: string;
|
|
294
|
+
readonly enumValues?: readonly EnumItem[];
|
|
295
|
+
}
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region src/PowerSearch/config.d.ts
|
|
298
|
+
interface PowerSearchLookup {
|
|
299
|
+
readonly config: PowerSearchConfig;
|
|
300
|
+
getField: (key: string) => PowerSearchField | undefined;
|
|
301
|
+
getOperator: (fieldKey: string, operatorKey: string) => PowerSearchOperator | undefined;
|
|
302
|
+
getDefaultOperator: (fieldKey: string) => PowerSearchOperator | undefined;
|
|
303
|
+
getVisibleFields: () => readonly PowerSearchField[];
|
|
304
|
+
getVisibleOperators: (fieldKey: string) => readonly PowerSearchOperator[];
|
|
305
|
+
}
|
|
306
|
+
declare function createPowerSearchLookup(config: PowerSearchConfig): PowerSearchLookup;
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region src/PowerSearch/complete.d.ts
|
|
309
|
+
/** 编辑器里的半成品条件。嵌套子条件放在 children,填完才写进 value。 */
|
|
310
|
+
interface EditableFilter {
|
|
311
|
+
readonly field: string;
|
|
312
|
+
readonly operator?: string;
|
|
313
|
+
readonly value?: FilterValue;
|
|
314
|
+
readonly children?: readonly EditableFilter[];
|
|
315
|
+
readonly isReadOnly?: boolean;
|
|
316
|
+
}
|
|
317
|
+
/** 条件齐全才返回可保存的筛选。嵌套里有没填完的子条件时返回空。 */
|
|
318
|
+
declare function completePowerSearchFilter(partial: EditableFilter | PartialFilter, lookup: PowerSearchLookup): PowerSearchFilter | null;
|
|
319
|
+
//#endregion
|
|
320
|
+
//#region src/PowerSearch/format.d.ts
|
|
321
|
+
declare function formatDateAbsolute(unixSeconds: number, locale: string, timeZone?: string): string;
|
|
322
|
+
declare function formatDateAbsoluteCompact(unixSeconds: number, locale: string, timeZone?: string): string;
|
|
323
|
+
declare function formatFilterValue(operatorValue: OperatorValue, filterValue: FilterValue, maxLength: number, messages: PowerSearchMessages, locale: string, timeZone?: string): string;
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region src/PowerSearch/operators.d.ts
|
|
326
|
+
declare function resolveOperatorLabel(operator: PowerSearchOperator, messages: PowerSearchMessages): string;
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region src/PowerSearch/placement.d.ts
|
|
329
|
+
interface EditorBox {
|
|
330
|
+
left: number;
|
|
331
|
+
right: number;
|
|
332
|
+
width: number;
|
|
333
|
+
}
|
|
334
|
+
interface EditorPlacementInput {
|
|
335
|
+
outer: EditorBox;
|
|
336
|
+
control: EditorBox;
|
|
337
|
+
viewportWidth: number;
|
|
338
|
+
direction: 'ltr' | 'rtl';
|
|
339
|
+
/** 视口左右各留出的安全距离。 */
|
|
340
|
+
viewportInset?: number;
|
|
341
|
+
}
|
|
342
|
+
interface EditorPlacement {
|
|
343
|
+
width: number;
|
|
344
|
+
/** 编辑器比外层窄,需要对齐到打开它的控件靠近的那一侧。 */
|
|
345
|
+
capped: boolean;
|
|
346
|
+
edge: 'left' | 'right';
|
|
347
|
+
top: number;
|
|
348
|
+
left: number;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* 编辑器宽度取外层宽度,再夹在 400 到 720 之间。
|
|
352
|
+
* 视口放不下 400 时,下限让给视口。只有被 720 压窄时,才改贴打开控件更近的外缘。
|
|
353
|
+
*/
|
|
354
|
+
declare function resolveEditorPlacement(input: EditorPlacementInput & {
|
|
355
|
+
anchorTop: number;
|
|
356
|
+
anchorBottom: number;
|
|
357
|
+
viewportHeight: number;
|
|
358
|
+
}): EditorPlacement;
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region src/PowerSearch/PowerSearch.vue.d.ts
|
|
361
|
+
type __VLS_Slots = PowerSearchSlots;
|
|
362
|
+
declare const __VLS_base: import("vue").DefineComponent<PowerSearchProps, {
|
|
363
|
+
focusTypeahead: () => void | undefined;
|
|
364
|
+
blurTypeahead: () => void | undefined;
|
|
365
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
366
|
+
blur: (event: FocusEvent) => any;
|
|
367
|
+
focus: (event: FocusEvent) => any;
|
|
368
|
+
change: (filters: PowerSearchFilter[], changeType: PowerSearchChangeType, index: number) => any;
|
|
369
|
+
"update:filters": (filters: PowerSearchFilter[]) => any;
|
|
370
|
+
}, string, import("vue").PublicProps, Readonly<PowerSearchProps> & Readonly<{
|
|
371
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
372
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
373
|
+
onChange?: ((filters: PowerSearchFilter[], changeType: PowerSearchChangeType, index: number) => any) | undefined;
|
|
374
|
+
"onUpdate:filters"?: ((filters: PowerSearchFilter[]) => any) | undefined;
|
|
375
|
+
}>, {
|
|
376
|
+
size: PowerSearchSize;
|
|
377
|
+
status: PowerSearchStatus;
|
|
378
|
+
statusVariant: PowerSearchStatusVariant;
|
|
379
|
+
disabled: boolean;
|
|
380
|
+
labelHidden: boolean;
|
|
381
|
+
clearable: boolean;
|
|
382
|
+
overflow: PowerSearchOverflow;
|
|
383
|
+
readOnly: boolean;
|
|
384
|
+
maxTokenLength: number;
|
|
385
|
+
maxSearchResults: number;
|
|
386
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
387
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
388
|
+
declare const _default: typeof __VLS_export;
|
|
389
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
390
|
+
new (): {
|
|
391
|
+
$slots: S;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region src/PowerSearch/query.d.ts
|
|
396
|
+
interface FieldTypeToValue {
|
|
397
|
+
string: string;
|
|
398
|
+
number: number;
|
|
399
|
+
boolean: boolean;
|
|
400
|
+
date: Date | number;
|
|
401
|
+
enum: string;
|
|
402
|
+
enum_list: readonly string[];
|
|
403
|
+
string_list: readonly string[];
|
|
404
|
+
}
|
|
405
|
+
type InferPowerSearchData<D extends readonly PowerSearchFieldDefinition[]> = { [F in D[number] as F['key']]: FieldTypeToValue[F['type']]; };
|
|
406
|
+
declare function applyPowerSearchFilters<T extends Record<string, unknown>>(filters: readonly PowerSearchFilter[], data: readonly T[]): T[];
|
|
407
|
+
declare function createPowerSearchConfig<const D extends readonly PowerSearchFieldDefinition[]>(definitions: D, configName?: string): {
|
|
408
|
+
config: PowerSearchConfig;
|
|
409
|
+
applyFilters: <T extends InferPowerSearchData<D>>(filters: readonly PowerSearchFilter[], data: readonly T[]) => T[];
|
|
410
|
+
};
|
|
411
|
+
declare function usePowerSearchConfig<const D extends readonly PowerSearchFieldDefinition[]>(definitions: D, configName?: string): ReturnType<typeof createPowerSearchConfig<D>>;
|
|
412
|
+
//#endregion
|
|
413
|
+
//#region src/PowerSearch/source.d.ts
|
|
414
|
+
declare function searchPowerSearchFields(lookup: PowerSearchLookup, query: string, messages: PowerSearchMessages, maxTypedResults: number): PowerSearchItem[];
|
|
415
|
+
//#endregion
|
|
416
|
+
export { PowerSearchItem as A, PowerSearchEmits as C, PowerSearchFieldType as D, PowerSearchFieldDefinition as E, PowerSearchSlots as F, PowerSearchStatus as I, PowerSearchOverflow as M, PowerSearchProps as N, PowerSearchFilter as O, PowerSearchSize as P, PowerSearchConfig as S, PowerSearchField as T, FilterValue as _, usePowerSearchConfig as a, PowerSearchChangeType as b, resolveOperatorLabel as c, formatFilterValue as d, completePowerSearchFilter as f, DateTimeRangePart as g, DateTimeRange as h, createPowerSearchConfig as i, PowerSearchOperator as j, PowerSearchHandle as k, formatDateAbsolute as l, createPowerSearchLookup as m, InferPowerSearchData as n, _default as o, PowerSearchLookup as p, applyPowerSearchFilters as r, resolveEditorPlacement as s, searchPowerSearchFields as t, formatDateAbsoluteCompact as u, OperatorValue as v, PowerSearchEntity as w, PowerSearchComponents as x, PartialFilter as y };
|
|
@@ -32,9 +32,9 @@ declare const __VLS_base$2: import("vue").DefineComponent<ItemProps, {
|
|
|
32
32
|
focus: typeof focus;
|
|
33
33
|
blur: typeof blur;
|
|
34
34
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ItemProps> & Readonly<{}>, {
|
|
35
|
-
density: ListDensity;
|
|
36
35
|
isDisabled: boolean;
|
|
37
36
|
as: ItemElement;
|
|
37
|
+
density: ListDensity;
|
|
38
38
|
isSelected: boolean;
|
|
39
39
|
align: ItemAlign;
|
|
40
40
|
layout: ItemLayout;
|
|
@@ -47,8 +47,8 @@ declare const __VLS_export: import("vue").DefineComponent<NumberInputProps, {},
|
|
|
47
47
|
onChange?: ((value: number | null) => any) | undefined;
|
|
48
48
|
"onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
|
|
49
49
|
}>, {
|
|
50
|
-
step: number;
|
|
51
50
|
size: "sm" | "md" | "lg";
|
|
51
|
+
step: number;
|
|
52
52
|
modelValue: number | null;
|
|
53
53
|
placeholder: string;
|
|
54
54
|
disabled: boolean;
|
|
@@ -108,9 +108,9 @@ declare const __VLS_base: import("vue").DefineComponent<SelectorProps, {}, {}, {
|
|
|
108
108
|
onChange?: ((value: string | number | null) => any) | undefined;
|
|
109
109
|
"onUpdate:modelValue"?: ((value: string | number | null) => any) | undefined;
|
|
110
110
|
}>, {
|
|
111
|
-
status: SelectorStatusInput;
|
|
112
111
|
size: SelectorSize;
|
|
113
112
|
variant: SelectorVariant;
|
|
113
|
+
status: SelectorStatusInput;
|
|
114
114
|
modelValue: string | number | null;
|
|
115
115
|
isLabelHidden: boolean;
|
|
116
116
|
statusVariant: SelectorStatusVariant;
|
|
@@ -327,8 +327,8 @@ declare const __VLS_base$3: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
327
327
|
"onUpdate:isOpen"?: ((...args: unknown[]) => any) | undefined;
|
|
328
328
|
}>, {
|
|
329
329
|
label: string;
|
|
330
|
-
isDisabled: boolean;
|
|
331
330
|
size: ContextMenuSize;
|
|
331
|
+
isDisabled: boolean;
|
|
332
332
|
presentation: ContextMenuPresentation;
|
|
333
333
|
triggerAs: ContextMenuTriggerElement;
|
|
334
334
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|