selectic 3.2.1 → 3.3.0
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/.tool-versions +2 -2
- package/dist/selectic.common.js +2 -2
- package/dist/selectic.esm.js +2 -2
- package/package.json +4 -4
- package/types/Store.d.ts +22 -22
- package/types/index.d.ts +3 -3
package/.tool-versions
CHANGED
package/dist/selectic.common.js
CHANGED
|
@@ -3317,7 +3317,7 @@ let Selectic = class Selectic extends vtyx.Vue {
|
|
|
3317
3317
|
multiple: ((_a = this.multiple) !== null && _a !== void 0 ? _a : false) !== false,
|
|
3318
3318
|
pageSize: this.params.pageSize || 100,
|
|
3319
3319
|
hideFilter: (_b = this.params.hideFilter) !== null && _b !== void 0 ? _b : 'auto',
|
|
3320
|
-
allowRevert: this.params.allowRevert,
|
|
3320
|
+
allowRevert: this.params.allowRevert, /* it can be undefined */
|
|
3321
3321
|
forceSelectAll: this.params.forceSelectAll || 'auto',
|
|
3322
3322
|
allowClearSelection: this.params.allowClearSelection || false,
|
|
3323
3323
|
autoSelect: this.params.autoSelect === undefined
|
|
@@ -3331,7 +3331,7 @@ let Selectic = class Selectic extends vtyx.Vue {
|
|
|
3331
3331
|
formatOption: this.params.formatOption,
|
|
3332
3332
|
formatSelection: this.params.formatSelection,
|
|
3333
3333
|
listPosition: this.params.listPosition || 'auto',
|
|
3334
|
-
optionBehavior: this.params.optionBehavior,
|
|
3334
|
+
optionBehavior: this.params.optionBehavior, /* it can be undefined */
|
|
3335
3335
|
isOpen: ((_c = this.open) !== null && _c !== void 0 ? _c : false) !== false,
|
|
3336
3336
|
disableGroupSelection: this.params.disableGroupSelection,
|
|
3337
3337
|
},
|
package/dist/selectic.esm.js
CHANGED
|
@@ -3313,7 +3313,7 @@ let Selectic = class Selectic extends Vue {
|
|
|
3313
3313
|
multiple: ((_a = this.multiple) !== null && _a !== void 0 ? _a : false) !== false,
|
|
3314
3314
|
pageSize: this.params.pageSize || 100,
|
|
3315
3315
|
hideFilter: (_b = this.params.hideFilter) !== null && _b !== void 0 ? _b : 'auto',
|
|
3316
|
-
allowRevert: this.params.allowRevert,
|
|
3316
|
+
allowRevert: this.params.allowRevert, /* it can be undefined */
|
|
3317
3317
|
forceSelectAll: this.params.forceSelectAll || 'auto',
|
|
3318
3318
|
allowClearSelection: this.params.allowClearSelection || false,
|
|
3319
3319
|
autoSelect: this.params.autoSelect === undefined
|
|
@@ -3327,7 +3327,7 @@ let Selectic = class Selectic extends Vue {
|
|
|
3327
3327
|
formatOption: this.params.formatOption,
|
|
3328
3328
|
formatSelection: this.params.formatSelection,
|
|
3329
3329
|
listPosition: this.params.listPosition || 'auto',
|
|
3330
|
-
optionBehavior: this.params.optionBehavior,
|
|
3330
|
+
optionBehavior: this.params.optionBehavior, /* it can be undefined */
|
|
3331
3331
|
isOpen: ((_c = this.open) !== null && _c !== void 0 ? _c : false) !== false,
|
|
3332
3332
|
disableGroupSelection: this.params.disableGroupSelection,
|
|
3333
3333
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "selectic",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Smart Select for VueJS 3.x",
|
|
5
5
|
"main": "dist/selectic.common.js",
|
|
6
6
|
"module": "dist/selectic.esm.js",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"test": "npm run build && tape test/**/*.spec.js"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"vtyx": "4.2
|
|
42
|
+
"vtyx": "4.4.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@babel/types": "^7.28.
|
|
45
|
+
"@babel/types": "^7.28.2",
|
|
46
46
|
"rollup": "^2.79.2",
|
|
47
47
|
"rollup-plugin-postcss": "^4.0.2",
|
|
48
48
|
"tape": "^4.17.0",
|
|
49
|
-
"typescript": "~
|
|
49
|
+
"typescript": "~5.9"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/types/Store.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
|
-
|
|
2
|
+
type MandateProps<T extends {}> = {
|
|
3
3
|
[TK in keyof T]-?: T[TK];
|
|
4
4
|
};
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
5
|
+
export type StrictOptionId = string | number;
|
|
6
|
+
export type OptionId = StrictOptionId | null;
|
|
7
|
+
export type SelectedValue = OptionId | StrictOptionId[];
|
|
8
8
|
export interface OptionValue {
|
|
9
9
|
id: OptionId;
|
|
10
10
|
text: string;
|
|
@@ -18,19 +18,19 @@ export interface OptionValue {
|
|
|
18
18
|
exclusive?: boolean;
|
|
19
19
|
data?: any;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
type OptionBehaviorOperation = 'sort' | 'force';
|
|
22
|
+
type OptionBehaviorOrder = 'O' | 'D' | 'E';
|
|
23
23
|
export interface OptionItem extends OptionValue {
|
|
24
24
|
selected: boolean;
|
|
25
25
|
disabled: boolean;
|
|
26
26
|
isGroup: boolean;
|
|
27
27
|
}
|
|
28
|
-
export
|
|
28
|
+
export type OptionProp = OptionValue | string;
|
|
29
29
|
export interface GroupValue {
|
|
30
30
|
id: StrictOptionId;
|
|
31
31
|
text: string;
|
|
32
32
|
}
|
|
33
|
-
export
|
|
33
|
+
export type RequestResult = {
|
|
34
34
|
/** The total number of expecting options.
|
|
35
35
|
* Needed to know if there are more items to fetch, and to size the scrollbar.
|
|
36
36
|
*/
|
|
@@ -38,20 +38,20 @@ export declare type RequestResult = {
|
|
|
38
38
|
/** The list of the options. */
|
|
39
39
|
result: OptionValue[];
|
|
40
40
|
};
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
41
|
+
export type FetchCallback = (_search: string, _offsetItem: number, _pageSize: number) => Promise<RequestResult>;
|
|
42
|
+
export type GetCallback = (_ids: OptionId[]) => Promise<OptionValue[]>;
|
|
43
|
+
export type FormatCallback = (_option: OptionItem) => OptionItem;
|
|
44
|
+
export type SelectionOverflow =
|
|
45
45
|
/** Items are reduced in width and an ellipsis is displayed in their name. */
|
|
46
46
|
'collapsed' | 'multiline';
|
|
47
|
-
export
|
|
47
|
+
export type ListPosition =
|
|
48
48
|
/** Display the list at bottom */
|
|
49
49
|
'bottom'
|
|
50
50
|
/** Display the list at bottom */
|
|
51
51
|
| 'top'
|
|
52
52
|
/** Display the list at bottom but if there is not enough space, display it at top */
|
|
53
53
|
| 'auto';
|
|
54
|
-
export
|
|
54
|
+
export type HideFilter =
|
|
55
55
|
/** Display or hide the filter panel */
|
|
56
56
|
boolean
|
|
57
57
|
/** The handler to open the filter panel is hidden only if there is less
|
|
@@ -59,7 +59,7 @@ boolean
|
|
|
59
59
|
| 'auto'
|
|
60
60
|
/** The panel filter is always open */
|
|
61
61
|
| 'open';
|
|
62
|
-
export
|
|
62
|
+
export type SelectAllOption =
|
|
63
63
|
/** Display the "select all" only when data are all fetched or allowRevert */
|
|
64
64
|
'auto'
|
|
65
65
|
/** Always display the "select all" in mulitple mode. */
|
|
@@ -151,7 +151,7 @@ export interface Props {
|
|
|
151
151
|
/** Method to call to get specific item */
|
|
152
152
|
getItemsCallback?: GetCallback | null;
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
type InternalProps = MandateProps<Props>;
|
|
155
155
|
export interface Data {
|
|
156
156
|
/** Number of items displayed in a page (before scrolling) */
|
|
157
157
|
itemsPerPage: number;
|
|
@@ -253,11 +253,11 @@ export interface SelecticStoreState {
|
|
|
253
253
|
automaticClose: boolean;
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
|
-
export
|
|
257
|
-
export
|
|
258
|
-
export
|
|
259
|
-
export
|
|
260
|
-
export
|
|
256
|
+
export type IconFamily = '' | 'selectic' | 'font-awesome-4' | 'font-awesome-5' | 'font-awesome-6' | 'raw' | `prefix:${string}`;
|
|
257
|
+
export type IconKey = 'caret-down' | 'caret-up' | 'check' | 'dot' | 'search' | 'spinner' | 'strikethrough' | 'times' | 'question' | 'spin';
|
|
258
|
+
export type IconValue = `selectic:${IconKey}${'' | ':spin'}` | `raw:${string}` | `current:${IconKey}${'' | ':spin'}` | string;
|
|
259
|
+
export type Icons = Record<IconKey, IconValue>;
|
|
260
|
+
export type PartialIcons = {
|
|
261
261
|
[K in IconKey]?: Icons[K];
|
|
262
262
|
};
|
|
263
263
|
interface Messages {
|
|
@@ -279,7 +279,7 @@ interface Messages {
|
|
|
279
279
|
unknownPropertyValue: string;
|
|
280
280
|
wrongQueryResult: string;
|
|
281
281
|
}
|
|
282
|
-
export
|
|
282
|
+
export type PartialMessages = {
|
|
283
283
|
[K in keyof Messages]?: Messages[K];
|
|
284
284
|
};
|
|
285
285
|
export declare function changeTexts(texts: PartialMessages): void;
|
package/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { OptionProp, OptionId, StrictOptionId, GroupValue, SelectedValue, FetchC
|
|
|
4
4
|
import MainInput from './MainInput';
|
|
5
5
|
import ExtendedList from './ExtendedList';
|
|
6
6
|
export { GroupValue, OptionValue, OptionItem, OptionProp, OptionId, StrictOptionId, SelectedValue, PartialMessages, GetCallback, FetchCallback, FormatCallback, SelectionOverflow, ListPosition, HideFilter, };
|
|
7
|
-
|
|
7
|
+
type EventType = 'input' | 'change' | 'open' | 'close' | 'focus' | 'blur' | 'item:click';
|
|
8
8
|
export interface EventOptions {
|
|
9
9
|
instance: Selectic;
|
|
10
10
|
eventType: EventType;
|
|
@@ -77,8 +77,8 @@ export interface ParamProps {
|
|
|
77
77
|
/** Avoid click on group name to select all items in this group. */
|
|
78
78
|
disableGroupSelection?: boolean;
|
|
79
79
|
}
|
|
80
|
-
export
|
|
81
|
-
export
|
|
80
|
+
export type OnCallback = (event: string, ...args: any[]) => void;
|
|
81
|
+
export type GetMethodsCallback = (methods: {
|
|
82
82
|
clearCache: Selectic['clearCache'];
|
|
83
83
|
changeTexts: Selectic['changeTexts'];
|
|
84
84
|
changeIcons: Selectic['changeIcons'];
|