@keenmate/web-multiselect 2.1.0 → 2.2.0-rc02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -9
- package/custom-elements.json +335 -26
- package/dist/index.d.ts +192 -14
- package/dist/multiselect.js +1417 -1212
- package/dist/multiselect.umd.js +12 -12
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/css/controls.css +6 -3
- package/src/css/options.css +49 -0
- package/src/css/variables.css +2 -0
- package/vscode.html-custom-data.json +27 -1
- package/web-types.json +68 -10
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@keenmate/web-multiselect",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0-rc02",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -76,6 +76,11 @@
|
|
|
76
76
|
"description": "HTML form field name/id used for the hidden input(s).",
|
|
77
77
|
"value": { "type": "string | null" }
|
|
78
78
|
},
|
|
79
|
+
{
|
|
80
|
+
"name": "custom-styles",
|
|
81
|
+
"description": "Raw CSS injected into the Shadow DOM — the declarative alternative to `customStylesCallback`. The value is a full stylesheet (selectors and all), dropped verbatim into a replaceable style slot at the top of the shadow root. `customStylesCallback` takes precedence when both are set.",
|
|
82
|
+
"value": { "type": "string | null" }
|
|
83
|
+
},
|
|
79
84
|
{
|
|
80
85
|
"name": "dropdown-width",
|
|
81
86
|
"description": "Fixed dropdown width; mirrored to the `--ms-dropdown-width` CSS variable.",
|
|
@@ -158,10 +163,10 @@
|
|
|
158
163
|
},
|
|
159
164
|
{
|
|
160
165
|
"name": "checkbox-mode",
|
|
161
|
-
"description": "Tree checkbox interaction.\n- `
|
|
166
|
+
"description": "Tree checkbox interaction.\n- `cascade` (default) — checks a node's whole subtree and shows a tristate (checked / indeterminate / unchecked) box on branches. This is what most tree-select UIs do, so it's the default.\n- `independent` — toggles only the clicked node, ignoring ancestors/descendants.\n\nTree + multiple only — has no effect on flat lists or single-select (there is no subtree to cascade into).",
|
|
162
167
|
"value": {
|
|
163
168
|
"type": "'independent' | 'cascade'",
|
|
164
|
-
"default": "'
|
|
169
|
+
"default": "'cascade'"
|
|
165
170
|
}
|
|
166
171
|
},
|
|
167
172
|
{
|
|
@@ -172,6 +177,11 @@
|
|
|
172
177
|
"default": "'rolled-up'"
|
|
173
178
|
}
|
|
174
179
|
},
|
|
180
|
+
{
|
|
181
|
+
"name": "group-select-mode",
|
|
182
|
+
"description": "Group-header selection in a FLAT (non-tree) grouped, multi-select list.\n- `none` (default) — group headers are inert labels.\n- `cascade` — each header shows a tristate checkbox that checks/unchecks all of that group's currently-visible members; a partially-selected group reads indeterminate. The group itself is never a selected value (getValue / badges / form carry member values only).\n\nFlat + multiple only — no effect in tree mode (use `checkbox-mode`) or single-select.",
|
|
183
|
+
"value": { "type": "'none' | 'cascade'", "default": "'none'" }
|
|
184
|
+
},
|
|
175
185
|
{
|
|
176
186
|
"name": "badges-display-mode",
|
|
177
187
|
"description": "How the current selection is shown in the control.",
|
|
@@ -193,6 +203,19 @@
|
|
|
193
203
|
"description": "How `badgesThreshold` is interpreted: collapse to a count badge, or keep partial badges + a \"more\" badge.",
|
|
194
204
|
"value": { "type": "'count' | 'partial'", "default": "'count'" }
|
|
195
205
|
},
|
|
206
|
+
{
|
|
207
|
+
"name": "selected-order",
|
|
208
|
+
"description": "Order of the CURRENTLY-SELECTED items where they are displayed — badges, partial mode (which items sit behind the \"+N more\" badge), and the selected-items popover. Display only: `getValue()`, the form output, and `getSelected()` keep as-selected (insertion) order, and the options dropdown is never reordered.\n- `as-selected` (default) — the order items were picked.\n- `label-asc` / `label-desc` — by the badge label, A→Z / Z→A (locale-aware).\n- `member` — by the `selected-order-member` property (or `getSelectedOrderCallback`); numeric keys sort numerically, everything else with a locale string compare.\n- `custom` — delegate to `selectedOrderCompareCallback`.",
|
|
209
|
+
"value": {
|
|
210
|
+
"type": "'as-selected' | 'label-asc' | 'label-desc' | 'member' | 'custom'",
|
|
211
|
+
"default": "'as-selected'"
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "selected-order-member",
|
|
216
|
+
"description": "Property name used as the sort key when `selected-order=\"member\"`. Sorts the SELECTED-items display only (not the dropdown). Overridden by `getSelectedOrderCallback`.",
|
|
217
|
+
"value": { "type": "string | null" }
|
|
218
|
+
},
|
|
196
219
|
{
|
|
197
220
|
"name": "search-input-mode",
|
|
198
221
|
"description": "Search field mode: editable, read-only, or hidden.",
|
|
@@ -610,6 +633,11 @@
|
|
|
610
633
|
"description": "HTML form field name/id used for the hidden input(s).",
|
|
611
634
|
"type": "string | null"
|
|
612
635
|
},
|
|
636
|
+
{
|
|
637
|
+
"name": "customStyles",
|
|
638
|
+
"description": "Raw CSS injected into the Shadow DOM — the declarative alternative to `customStylesCallback`. The value is a full stylesheet (selectors and all), dropped verbatim into a replaceable style slot at the top of the shadow root. `customStylesCallback` takes precedence when both are set.",
|
|
639
|
+
"type": "string | null"
|
|
640
|
+
},
|
|
613
641
|
{
|
|
614
642
|
"name": "dropdownWidth",
|
|
615
643
|
"description": "Fixed dropdown width; mirrored to the `--ms-dropdown-width` CSS variable.",
|
|
@@ -697,7 +725,7 @@
|
|
|
697
725
|
},
|
|
698
726
|
{
|
|
699
727
|
"name": "checkboxMode",
|
|
700
|
-
"description": "Tree checkbox interaction.\n- `
|
|
728
|
+
"description": "Tree checkbox interaction.\n- `cascade` (default) — checks a node's whole subtree and shows a tristate (checked / indeterminate / unchecked) box on branches. This is what most tree-select UIs do, so it's the default.\n- `independent` — toggles only the clicked node, ignoring ancestors/descendants.\n\nTree + multiple only — has no effect on flat lists or single-select (there is no subtree to cascade into).",
|
|
701
729
|
"type": "'independent' | 'cascade'"
|
|
702
730
|
},
|
|
703
731
|
{
|
|
@@ -705,6 +733,11 @@
|
|
|
705
733
|
"description": "In `cascade` mode, which values a selection emits (badges / form / change):\n- `rolled-up` (default) — minimal cover: a fully-selected subtree collapses to its root; partially-selected branches emit their individually-checked descendants.\n- `leaves` — only the checked leaf-level nodes.\n- `all` — every fully-checked node (branches and leaves).",
|
|
706
734
|
"type": "'rolled-up' | 'leaves' | 'all'"
|
|
707
735
|
},
|
|
736
|
+
{
|
|
737
|
+
"name": "groupSelectMode",
|
|
738
|
+
"description": "Group-header selection in a FLAT (non-tree) grouped, multi-select list.\n- `none` (default) — group headers are inert labels.\n- `cascade` — each header shows a tristate checkbox that checks/unchecks all of that group's currently-visible members; a partially-selected group reads indeterminate. The group itself is never a selected value (getValue / badges / form carry member values only).\n\nFlat + multiple only — no effect in tree mode (use `checkbox-mode`) or single-select.",
|
|
739
|
+
"type": "'none' | 'cascade'"
|
|
740
|
+
},
|
|
708
741
|
{
|
|
709
742
|
"name": "badgesDisplayMode",
|
|
710
743
|
"description": "How the current selection is shown in the control.",
|
|
@@ -720,6 +753,16 @@
|
|
|
720
753
|
"description": "How `badgesThreshold` is interpreted: collapse to a count badge, or keep partial badges + a \"more\" badge.",
|
|
721
754
|
"type": "'count' | 'partial'"
|
|
722
755
|
},
|
|
756
|
+
{
|
|
757
|
+
"name": "selectedOrder",
|
|
758
|
+
"description": "Order of the CURRENTLY-SELECTED items where they are displayed — badges, partial mode (which items sit behind the \"+N more\" badge), and the selected-items popover. Display only: `getValue()`, the form output, and `getSelected()` keep as-selected (insertion) order, and the options dropdown is never reordered.\n- `as-selected` (default) — the order items were picked.\n- `label-asc` / `label-desc` — by the badge label, A→Z / Z→A (locale-aware).\n- `member` — by the `selected-order-member` property (or `getSelectedOrderCallback`); numeric keys sort numerically, everything else with a locale string compare.\n- `custom` — delegate to `selectedOrderCompareCallback`.",
|
|
759
|
+
"type": "'as-selected' | 'label-asc' | 'label-desc' | 'member' | 'custom'"
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"name": "selectedOrderMember",
|
|
763
|
+
"description": "Property name used as the sort key when `selected-order=\"member\"`. Sorts the SELECTED-items display only (not the dropdown). Overridden by `getSelectedOrderCallback`.",
|
|
764
|
+
"type": "string | null"
|
|
765
|
+
},
|
|
723
766
|
{
|
|
724
767
|
"name": "searchInputMode",
|
|
725
768
|
"description": "Search field mode: editable, read-only, or hidden.",
|
|
@@ -1035,6 +1078,16 @@
|
|
|
1035
1078
|
"description": "Extra CSS class(es) for an option badge.",
|
|
1036
1079
|
"type": "(item: unknown) => string | string[]"
|
|
1037
1080
|
},
|
|
1081
|
+
{
|
|
1082
|
+
"name": "getSelectedOrderCallback",
|
|
1083
|
+
"description": "Sort key for the selected-items display when `selected-order=\"member\"` (overrides `selected-order-member`).",
|
|
1084
|
+
"type": "(item: unknown) => string | number"
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
"name": "selectedOrderCompareCallback",
|
|
1088
|
+
"description": "Comparator for the selected-items display when `selected-order=\"custom\"`.",
|
|
1089
|
+
"type": "(a: unknown, b: unknown) => number"
|
|
1090
|
+
},
|
|
1038
1091
|
{
|
|
1039
1092
|
"name": "getIconCallback",
|
|
1040
1093
|
"description": "Icon for an option (overrides iconMember).",
|
|
@@ -1055,6 +1108,11 @@
|
|
|
1055
1108
|
"description": "Render the selected-count label.",
|
|
1056
1109
|
"type": "(count: number, moreCount?: number) => string"
|
|
1057
1110
|
},
|
|
1111
|
+
{
|
|
1112
|
+
"name": "getCountLabelCallback",
|
|
1113
|
+
"description": "Format the small count chip shared by the in-input counter and each group header count (default `[selected]`; e.g. `(s,t)=>`${s}/${t}``). One callback drives both.",
|
|
1114
|
+
"type": "(selected: number, total: number) => string"
|
|
1115
|
+
},
|
|
1058
1116
|
{
|
|
1059
1117
|
"name": "getValueFormatCallback",
|
|
1060
1118
|
"description": "Serialize the selected values for form submission.",
|
|
@@ -1097,18 +1155,18 @@
|
|
|
1097
1155
|
},
|
|
1098
1156
|
{
|
|
1099
1157
|
"name": "renderGroupLabelContentCallback",
|
|
1100
|
-
"description": "Customize a group label; may return an HTML string or element.",
|
|
1101
|
-
"type": "(groupName: string) => string | HTMLElement"
|
|
1158
|
+
"description": "Customize a group label; may return an HTML string or element. The second arg carries the group members + selection (e.g. `context.selectedCount`) so a custom header can show a per-group count.",
|
|
1159
|
+
"type": "(groupName: string, context: GroupLabelRenderContext) => string | HTMLElement"
|
|
1102
1160
|
},
|
|
1103
1161
|
{
|
|
1104
1162
|
"name": "renderSelectedContentCallback",
|
|
1105
|
-
"description": "Custom render for the
|
|
1106
|
-
"type": "(item: unknown) => string"
|
|
1163
|
+
"description": "Custom render for the single-select selected value (2nd arg carries the presentation context).",
|
|
1164
|
+
"type": "(item: unknown, context: SelectedContentRenderContext) => string"
|
|
1107
1165
|
},
|
|
1108
1166
|
{
|
|
1109
1167
|
"name": "renderSelectedItemContentCallback",
|
|
1110
|
-
"description": "Custom render for one selected item.",
|
|
1111
|
-
"type": "(item: unknown) => string | HTMLElement"
|
|
1168
|
+
"description": "Custom render for one selected item in the popover (2nd arg is a BadgeContentRenderContext; isInPopover=true).",
|
|
1169
|
+
"type": "(item: unknown, context: BadgeContentRenderContext) => string | HTMLElement"
|
|
1112
1170
|
},
|
|
1113
1171
|
{
|
|
1114
1172
|
"name": "customStylesCallback",
|