@keenmate/web-multiselect 1.0.0-rc10 → 1.0.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/README.md +554 -89
- package/dist/multiselect.js +1407 -1181
- package/dist/multiselect.umd.js +35 -44
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/scss/{_pills-display.scss → _badges-display.scss} +65 -54
- package/src/scss/_base.scss +2 -2
- package/src/scss/_css-variables.scss +58 -45
- package/src/scss/_input-dropdown.scss +23 -11
- package/src/scss/_modifiers.scss +3 -3
- package/src/scss/_options.scss +14 -1
- package/src/scss/_rtl.scss +14 -14
- package/src/scss/_tooltips-popover.scss +28 -16
- package/src/scss/_variables.scss +60 -47
- package/src/scss/main.scss +4 -4
package/src/scss/_options.scss
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
// Individual option
|
|
58
58
|
.ml__option {
|
|
59
59
|
display: flex;
|
|
60
|
-
align-items: flex-start;
|
|
60
|
+
align-items: var(--ml-checkbox-align, flex-start); // Support checkbox alignment
|
|
61
61
|
gap: var(--ml-option-gap, $ml-option-gap);
|
|
62
62
|
padding: var(--ml-option-padding, $ml-option-padding);
|
|
63
63
|
cursor: pointer;
|
|
@@ -94,6 +94,15 @@
|
|
|
94
94
|
background: var(--ml-option-bg, $ml-option-bg);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
+
|
|
98
|
+
// Checkbox alignment variants
|
|
99
|
+
&[data-checkbox-align="center"] {
|
|
100
|
+
--ml-checkbox-align: center;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&[data-checkbox-align="bottom"] {
|
|
104
|
+
--ml-checkbox-align: flex-end;
|
|
105
|
+
}
|
|
97
106
|
}
|
|
98
107
|
|
|
99
108
|
// ==============================================================================
|
|
@@ -104,6 +113,10 @@
|
|
|
104
113
|
.ml__checkbox {
|
|
105
114
|
flex-shrink: 0;
|
|
106
115
|
margin-top: var(--ml-checkbox-margin-top, $ml-checkbox-margin-top); // Align with first line of text
|
|
116
|
+
width: var(--ml-checkbox-size, $ml-checkbox-size);
|
|
117
|
+
height: var(--ml-checkbox-size, $ml-checkbox-size);
|
|
118
|
+
transform: scale(var(--ml-checkbox-scale, $ml-checkbox-scale));
|
|
119
|
+
transform-origin: top left;
|
|
107
120
|
cursor: pointer;
|
|
108
121
|
|
|
109
122
|
.ml__option--disabled & {
|
package/src/scss/_rtl.scss
CHANGED
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// Move count badge to left side
|
|
31
|
-
.
|
|
32
|
-
left: var(--ml-
|
|
31
|
+
.ml__counter {
|
|
32
|
+
left: var(--ml-counter-offset, $ml-counter-offset) !important;
|
|
33
33
|
right: auto !important;
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -62,28 +62,28 @@
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// ==============================================================================
|
|
65
|
-
//
|
|
65
|
+
// BADGES LAYOUT
|
|
66
66
|
// ==============================================================================
|
|
67
67
|
|
|
68
|
-
.
|
|
68
|
+
.ml__badges {
|
|
69
69
|
direction: rtl;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
//
|
|
73
|
-
.
|
|
72
|
+
// Badges flow right-to-left
|
|
73
|
+
.ml__badge {
|
|
74
74
|
flex-direction: row-reverse;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
// Remove button on left side of
|
|
78
|
-
.
|
|
79
|
-
border-radius: var(--ml-
|
|
80
|
-
border-left: var(--ml-
|
|
77
|
+
// Remove button on left side of badge
|
|
78
|
+
.ml__badge-remove {
|
|
79
|
+
border-radius: var(--ml-badge-remove-border-radius-rtl, $ml-badge-border-radius) 0 0 var(--ml-badge-remove-border-radius-rtl, $ml-badge-border-radius);
|
|
80
|
+
border-left: var(--ml-badge-remove-border, $ml-badge-remove-border);
|
|
81
81
|
border-right: none;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
//
|
|
85
|
-
.
|
|
86
|
-
border-radius: 0 var(--ml-
|
|
84
|
+
// Badge text rounded on right
|
|
85
|
+
.ml__badge-text {
|
|
86
|
+
border-radius: 0 var(--ml-badge-text-border-radius-rtl, $ml-badge-border-radius) var(--ml-badge-text-border-radius-rtl, $ml-badge-border-radius) 0;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
// ==============================================================================
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
direction: rtl;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.
|
|
97
|
+
.ml__counter-wrapper {
|
|
98
98
|
flex-direction: row-reverse;
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// ==============================================================================
|
|
2
2
|
// TOOLTIPS & POPOVER
|
|
3
3
|
// ==============================================================================
|
|
4
|
-
//
|
|
4
|
+
// Badge tooltips and selected items popover
|
|
5
5
|
|
|
6
6
|
@use 'variables' as *;
|
|
7
7
|
|
|
8
8
|
// ==============================================================================
|
|
9
|
-
//
|
|
9
|
+
// BADGE TOOLTIPS
|
|
10
10
|
// ==============================================================================
|
|
11
11
|
|
|
12
|
-
.
|
|
12
|
+
.ml__badge-tooltip {
|
|
13
13
|
position: fixed;
|
|
14
14
|
z-index: var(--ml-tooltip-z-index, $ml-tooltip-z-index);
|
|
15
15
|
opacity: 0;
|
|
@@ -106,17 +106,22 @@
|
|
|
106
106
|
overflow-y: auto;
|
|
107
107
|
max-height: var(--ml-selected-popover-body-max-height, $ml-selected-popover-body-max-height);
|
|
108
108
|
|
|
109
|
-
//
|
|
110
|
-
.
|
|
109
|
+
// Badges inside popover (non-virtual mode)
|
|
110
|
+
.ml__badge {
|
|
111
111
|
width: 100%;
|
|
112
|
+
min-height: fit-content; // Allow badges to expand based on content
|
|
113
|
+
line-height: var(--ml-line-height-relaxed, $ml-line-height-relaxed); // Override line-height: 1 to allow multi-line content
|
|
112
114
|
}
|
|
113
115
|
|
|
114
|
-
.
|
|
116
|
+
.ml__badge-text {
|
|
115
117
|
flex: 1;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
min-width: 0; // Allow proper flex sizing
|
|
119
|
+
white-space: normal; // Explicitly allow wrapping
|
|
120
|
+
word-wrap: break-word; // Break long words
|
|
121
|
+
// Remove overflow constraints to allow multi-line content
|
|
122
|
+
// overflow: hidden;
|
|
123
|
+
// text-overflow: ellipsis;
|
|
124
|
+
// white-space: nowrap;
|
|
120
125
|
}
|
|
121
126
|
|
|
122
127
|
// Virtual scroll mode
|
|
@@ -126,14 +131,21 @@
|
|
|
126
131
|
max-height: none; // Remove max-height constraint
|
|
127
132
|
padding: 0; // Remove padding as virtual scroll has its own spacing
|
|
128
133
|
|
|
129
|
-
.
|
|
130
|
-
// Fixed height for virtual scroll (default: 36px, configurable via
|
|
131
|
-
height: var(--ml-
|
|
132
|
-
min-height: var(--ml-
|
|
133
|
-
max-height: var(--ml-
|
|
134
|
-
margin-bottom: var(--ml-selected-popover-body-gap, $ml-selected-popover-body-gap); // Add gap between
|
|
134
|
+
.ml__badge {
|
|
135
|
+
// Fixed height for virtual scroll (default: 36px, configurable via badge-height attribute)
|
|
136
|
+
height: var(--ml-badge-height-virtual, 36px);
|
|
137
|
+
min-height: var(--ml-badge-height-virtual, 36px);
|
|
138
|
+
max-height: var(--ml-badge-height-virtual, 36px);
|
|
139
|
+
margin-bottom: var(--ml-selected-popover-body-gap, $ml-selected-popover-body-gap); // Add gap between badges
|
|
135
140
|
overflow: hidden;
|
|
136
141
|
box-sizing: border-box;
|
|
137
142
|
}
|
|
143
|
+
|
|
144
|
+
.ml__badge-text {
|
|
145
|
+
// Enforce single-line truncation for virtual scroll fixed heights
|
|
146
|
+
white-space: nowrap;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
text-overflow: ellipsis;
|
|
149
|
+
}
|
|
138
150
|
}
|
|
139
151
|
}
|
package/src/scss/_variables.scss
CHANGED
|
@@ -111,14 +111,14 @@ $ml-z-index-popover: 10000 !default;
|
|
|
111
111
|
// 8. LAYOUT & DIMENSIONS
|
|
112
112
|
// ==============================================================================
|
|
113
113
|
$ml-input-icon-spacing: 2.5rem !default;
|
|
114
|
-
$ml-
|
|
114
|
+
$ml-counter-offset: 2rem !default;
|
|
115
115
|
$ml-option-icon-size: 1.25rem !default;
|
|
116
116
|
$ml-count-clear-size: 1rem !default;
|
|
117
|
-
$ml-
|
|
118
|
-
$ml-
|
|
117
|
+
$ml-badge-height: 1.5rem !default;
|
|
118
|
+
$ml-badge-remove-width: 1.5rem !default;
|
|
119
119
|
$ml-popover-close-size: 1.5rem !default;
|
|
120
120
|
|
|
121
|
-
$ml-
|
|
121
|
+
$ml-options-max-height: 20rem !default;
|
|
122
122
|
$ml-selected-popover-width: 20rem !default;
|
|
123
123
|
$ml-selected-popover-max-height: 20rem !default;
|
|
124
124
|
$ml-selected-popover-body-max-height: 18rem !default;
|
|
@@ -203,13 +203,13 @@ $ml-toggle-right: $ml-input-padding-h !default;
|
|
|
203
203
|
|
|
204
204
|
// Count Badge (in input)
|
|
205
205
|
// ==============================================================================
|
|
206
|
-
$ml-
|
|
207
|
-
$ml-
|
|
208
|
-
$ml-
|
|
209
|
-
$ml-
|
|
210
|
-
$ml-
|
|
211
|
-
$ml-
|
|
212
|
-
$ml-
|
|
206
|
+
$ml-counter-padding: 0.125rem 0.25rem !default;
|
|
207
|
+
$ml-counter-bg: $ml-accent-color !default;
|
|
208
|
+
$ml-counter-color: $ml-text-white !default;
|
|
209
|
+
$ml-counter-font-size: $ml-font-size-xs !default;
|
|
210
|
+
$ml-counter-font-weight: $ml-font-weight-semibold !default;
|
|
211
|
+
$ml-counter-border-radius: $ml-border-radius-sm !default;
|
|
212
|
+
$ml-counter-bg-hover: $ml-accent-color-hover !default;
|
|
213
213
|
|
|
214
214
|
// Floating Hint
|
|
215
215
|
// ==============================================================================
|
|
@@ -232,7 +232,7 @@ $ml-dropdown-text: $ml-color-neutral-darkest !default;
|
|
|
232
232
|
$ml-dropdown-border: $ml-border-width-base solid $ml-dropdown-border-color !default;
|
|
233
233
|
$ml-dropdown-border-radius: $ml-border-radius !default;
|
|
234
234
|
$ml-dropdown-box-shadow: $ml-dropdown-shadow !default;
|
|
235
|
-
$ml-
|
|
235
|
+
$ml-option-color: $ml-dropdown-text !default;
|
|
236
236
|
|
|
237
237
|
// Dropdown Actions
|
|
238
238
|
// ==============================================================================
|
|
@@ -326,14 +326,14 @@ $ml-loader-gap: $ml-spacing-sm !default;
|
|
|
326
326
|
$ml-loading-text-font-size: $ml-font-size-sm !default;
|
|
327
327
|
$ml-loading-text-color: $ml-text-secondary !default;
|
|
328
328
|
|
|
329
|
-
//
|
|
329
|
+
// Badges Container
|
|
330
330
|
// ==============================================================================
|
|
331
|
-
$ml-
|
|
332
|
-
$ml-
|
|
333
|
-
$ml-
|
|
334
|
-
$ml-
|
|
335
|
-
$ml-
|
|
336
|
-
$ml-
|
|
331
|
+
$ml-badge-gap: $ml-spacing-sm !default;
|
|
332
|
+
$ml-badges-gap: $ml-badge-gap !default;
|
|
333
|
+
$ml-badges-margin-bottom: $ml-spacing-sm !default;
|
|
334
|
+
$ml-badges-margin-top: $ml-spacing-sm !default;
|
|
335
|
+
$ml-badges-margin-left: $ml-spacing-xs !default;
|
|
336
|
+
$ml-badges-margin-right: $ml-spacing-xs !default;
|
|
337
337
|
|
|
338
338
|
// Count Display
|
|
339
339
|
// ==============================================================================
|
|
@@ -344,13 +344,13 @@ $ml-count-display-margin-right: $ml-spacing-sm !default;
|
|
|
344
344
|
|
|
345
345
|
// Count Badge Wrapper
|
|
346
346
|
// ==============================================================================
|
|
347
|
-
$ml-
|
|
348
|
-
$ml-
|
|
349
|
-
$ml-
|
|
350
|
-
$ml-
|
|
351
|
-
$ml-
|
|
352
|
-
$ml-
|
|
353
|
-
$ml-
|
|
347
|
+
$ml-counter-wrapper-bg: transparent !default;
|
|
348
|
+
$ml-counter-wrapper-border: $ml-border-width-base solid $ml-border-color !default;
|
|
349
|
+
$ml-counter-wrapper-border-radius: $ml-border-radius-sm !default;
|
|
350
|
+
$ml-counter-wrapper-padding: $ml-spacing-xs $ml-spacing-sm !default;
|
|
351
|
+
$ml-counter-wrapper-gap: $ml-spacing-xs !default;
|
|
352
|
+
$ml-counter-wrapper-bg-hover: $ml-option-hover-bg !default;
|
|
353
|
+
$ml-counter-wrapper-border-color-hover: $ml-accent-color !default;
|
|
354
354
|
|
|
355
355
|
// Count Text
|
|
356
356
|
// ==============================================================================
|
|
@@ -368,37 +368,48 @@ $ml-count-clear-border-radius: $ml-border-radius-full !default;
|
|
|
368
368
|
$ml-count-clear-bg-hover: rgba($ml-accent-color, $ml-opacity-highlight-bg) !default;
|
|
369
369
|
$ml-count-clear-color-hover: $ml-accent-color !default;
|
|
370
370
|
|
|
371
|
-
//
|
|
371
|
+
// Badge
|
|
372
372
|
// ==============================================================================
|
|
373
|
-
$ml-
|
|
374
|
-
$ml-
|
|
375
|
-
$ml-
|
|
373
|
+
$ml-badge-bg: $ml-color-accent-lightest !default;
|
|
374
|
+
$ml-badge-bg-hover: $ml-color-white !default;
|
|
375
|
+
$ml-badge-bg-active: $ml-color-accent-lighter !default;
|
|
376
376
|
|
|
377
|
-
$ml-
|
|
378
|
-
$ml-
|
|
379
|
-
$ml-
|
|
377
|
+
$ml-badge-font-size: $ml-font-size-xs !default;
|
|
378
|
+
$ml-badge-font-weight: $ml-font-weight-semibold !default;
|
|
379
|
+
$ml-badge-border-radius: $ml-border-radius !default;
|
|
380
380
|
|
|
381
|
-
//
|
|
381
|
+
// Badge Text
|
|
382
382
|
// ==============================================================================
|
|
383
|
-
$ml-
|
|
384
|
-
$ml-
|
|
385
|
-
$ml-
|
|
383
|
+
$ml-badge-text-padding: 0 $ml-spacing-sm !default;
|
|
384
|
+
$ml-badge-text-bg: $ml-badge-bg !default;
|
|
385
|
+
$ml-badge-text-color: $ml-accent-color !default;
|
|
386
386
|
|
|
387
|
-
//
|
|
387
|
+
// Badge Remove Button
|
|
388
388
|
// ==============================================================================
|
|
389
|
-
$ml-
|
|
390
|
-
$ml-
|
|
391
|
-
$ml-
|
|
392
|
-
$ml-
|
|
393
|
-
$ml-
|
|
394
|
-
$ml-
|
|
389
|
+
$ml-badge-remove-bg: $ml-accent-color !default;
|
|
390
|
+
$ml-badge-remove-color: $ml-text-white !default;
|
|
391
|
+
$ml-badge-remove-border: none !default;
|
|
392
|
+
$ml-badge-remove-font-size: $ml-font-size-xs !default;
|
|
393
|
+
$ml-badge-remove-bg-hover: $ml-accent-color-hover !default;
|
|
394
|
+
$ml-badge-remove-box-shadow-focus: 0 0 0 $ml-focus-outline-width
|
|
395
395
|
rgba($ml-accent-color, $ml-opacity-focus-shadow) !default;
|
|
396
396
|
|
|
397
|
+
// Badge Indicator (for "+ X more", "3 selected", compact mode display)
|
|
398
|
+
// ==============================================================================
|
|
399
|
+
$ml-badge-counter-bg: transparent !default;
|
|
400
|
+
$ml-badge-counter-border: $ml-border-width-base solid $ml-border-color !default;
|
|
401
|
+
$ml-badge-counter-border-radius: $ml-border-radius-sm !default;
|
|
402
|
+
$ml-badge-counter-text-color: $ml-text-secondary !default;
|
|
403
|
+
$ml-badge-counter-text-bg: $ml-color-neutral-base !default;
|
|
404
|
+
$ml-badge-counter-remove-bg: $ml-color-neutral-dark !default;
|
|
405
|
+
$ml-badge-counter-remove-color: $ml-color-white !default;
|
|
406
|
+
$ml-badge-counter-remove-bg-hover: $ml-color-neutral-darkest !default;
|
|
407
|
+
|
|
397
408
|
// "+X more" badge (partial mode)
|
|
398
409
|
// ==============================================================================
|
|
399
|
-
$ml-more-badge-bg: $ml-
|
|
400
|
-
$ml-more-badge-hover-bg: $ml-
|
|
401
|
-
$ml-more-badge-active-bg: $ml-
|
|
410
|
+
$ml-more-badge-bg: $ml-badge-text-bg !default;
|
|
411
|
+
$ml-more-badge-hover-bg: $ml-badge-bg-hover !default;
|
|
412
|
+
$ml-more-badge-active-bg: $ml-badge-bg-active !default;
|
|
402
413
|
|
|
403
414
|
// Tooltip
|
|
404
415
|
// ==============================================================================
|
|
@@ -444,6 +455,8 @@ $ml-selected-popover-body-padding: $ml-spacing-sm !default;
|
|
|
444
455
|
// ==============================================================================
|
|
445
456
|
$ml-checkbox-offset: 0.125rem !default;
|
|
446
457
|
$ml-checkbox-margin-top: $ml-checkbox-offset !default;
|
|
458
|
+
$ml-checkbox-size: 16px !default; // Width and height of checkbox
|
|
459
|
+
$ml-checkbox-scale: 1 !default; // Scale multiplier for checkbox size
|
|
447
460
|
|
|
448
461
|
// Placeholder
|
|
449
462
|
// ==============================================================================
|
package/src/scss/main.scss
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
// - _variables.scss : All variables (base primitives + semantic)
|
|
8
8
|
// - _css-variables.scss : CSS custom properties at :host level (for theming)
|
|
9
9
|
// - _base.scss : FOUC prevention + layout containers
|
|
10
|
-
// - _input-dropdown.scss : Input, toggle,
|
|
10
|
+
// - _input-dropdown.scss : Input, toggle, counter, hint, dropdown, actions
|
|
11
11
|
// - _options.scss : Options list, groups, checkbox, content, states
|
|
12
|
-
// -
|
|
13
|
-
// - _tooltips-popover.scss:
|
|
12
|
+
// - _badges-display.scss : Badges, count display, individual badges
|
|
13
|
+
// - _tooltips-popover.scss: Badge tooltips + selected items popover
|
|
14
14
|
// - _rtl.scss : RTL (Right-to-Left) language support
|
|
15
15
|
// - _modifiers.scss : Size variants + state modifiers
|
|
16
16
|
// - _debug.scss : Debug information panel
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
@use 'base';
|
|
22
22
|
@use 'input-dropdown';
|
|
23
23
|
@use 'options';
|
|
24
|
-
@use '
|
|
24
|
+
@use 'badges-display';
|
|
25
25
|
@use 'tooltips-popover';
|
|
26
26
|
@use 'rtl';
|
|
27
27
|
@use 'modifiers';
|