@pathscale/ui 1.1.64 → 1.1.66
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.
|
@@ -20,7 +20,7 @@ const normalizeSelection = (selectionMode, value)=>{
|
|
|
20
20
|
entries = Array.isArray(value) ? value : isIterableValue(value) ? Array.from(value) : [
|
|
21
21
|
value
|
|
22
22
|
];
|
|
23
|
-
const normalized = entries.map((entry)=>String(entry)).filter((entry, index, source)=>
|
|
23
|
+
const normalized = entries.map((entry)=>String(entry)).filter((entry, index, source)=>source.indexOf(entry) === index);
|
|
24
24
|
if ("single" === selectionMode) return normalized.slice(0, 1);
|
|
25
25
|
return normalized;
|
|
26
26
|
};
|
|
@@ -69,6 +69,7 @@ const SelectRoot = (props)=>{
|
|
|
69
69
|
const [internalSelectedKeys, setInternalSelectedKeys] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(initialSelected);
|
|
70
70
|
const [internalOpen, setInternalOpen] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(Boolean(local.defaultOpen));
|
|
71
71
|
const [options, setOptions] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)([]);
|
|
72
|
+
const [optionTextByKey, setOptionTextByKey] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(new Map());
|
|
72
73
|
const [focusedKey, setFocusedKey] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)();
|
|
73
74
|
const [focusRequest, setFocusRequest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(null);
|
|
74
75
|
const [triggerRef, setTriggerRefSignal] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)();
|
|
@@ -85,11 +86,7 @@ const SelectRoot = (props)=>{
|
|
|
85
86
|
const selectedSet = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>new Set(selectedKeys()));
|
|
86
87
|
const selectedText = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
87
88
|
if (!selectedKeys().length) return "";
|
|
88
|
-
|
|
89
|
-
option.key,
|
|
90
|
-
option.textValue
|
|
91
|
-
]));
|
|
92
|
-
return selectedKeys().map((key)=>optionMap.get(key) ?? key).join("multiple" === selectionMode() ? ", " : "");
|
|
89
|
+
return selectedKeys().map((key)=>optionTextByKey().get(key) ?? key).join("multiple" === selectionMode() ? ", " : "");
|
|
93
90
|
});
|
|
94
91
|
const getEnabledOptions = ()=>options().filter((option)=>!option.disabled);
|
|
95
92
|
const focusOption = (option)=>{
|
|
@@ -156,6 +153,12 @@ const SelectRoot = (props)=>{
|
|
|
156
153
|
});
|
|
157
154
|
};
|
|
158
155
|
const registerOption = (option)=>{
|
|
156
|
+
setOptionTextByKey((current)=>{
|
|
157
|
+
if (current.get(option.key) === option.textValue) return current;
|
|
158
|
+
const next = new Map(current);
|
|
159
|
+
next.set(option.key, option.textValue);
|
|
160
|
+
return next;
|
|
161
|
+
});
|
|
159
162
|
setOptions((current)=>sortOptionsByDomOrder([
|
|
160
163
|
...current.filter((entry)=>entry.key !== option.key),
|
|
161
164
|
option
|
|
@@ -434,7 +437,7 @@ const SelectValue = (props)=>{
|
|
|
434
437
|
]);
|
|
435
438
|
const placeholder = ()=>ctx?.placeholder() ?? "";
|
|
436
439
|
const text = ()=>ctx?.selectedText() ?? "";
|
|
437
|
-
const isPlaceholder = ()=>0 ===
|
|
440
|
+
const isPlaceholder = ()=>(ctx?.selectedKeys().length ?? 0) === 0;
|
|
438
441
|
return (()=>{
|
|
439
442
|
var _el$8 = _tmpl$3();
|
|
440
443
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$8, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, ()=>({
|
|
@@ -537,37 +540,30 @@ const SelectPopover = (props)=>{
|
|
|
537
540
|
...overlayStyle
|
|
538
541
|
};
|
|
539
542
|
};
|
|
540
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(
|
|
541
|
-
get when () {
|
|
542
|
-
return ctx?.open();
|
|
543
|
-
},
|
|
543
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.Portal, {
|
|
544
544
|
get children () {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
get style () {
|
|
564
|
-
return popoverStyle();
|
|
565
|
-
}
|
|
566
|
-
}), false, true);
|
|
567
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$10, ()=>local.children);
|
|
568
|
-
return _el$10;
|
|
545
|
+
var _el$10 = _tmpl$();
|
|
546
|
+
var _ref$ = ctx?.setPopoverRef;
|
|
547
|
+
"function" == typeof _ref$ && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$10);
|
|
548
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$10, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, ()=>({
|
|
549
|
+
class: (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)(__WEBPACK_EXTERNAL_MODULE__Select_classes_js_98857364__.CLASSES.slot.popover, local.class, local.className)
|
|
550
|
+
}), {
|
|
551
|
+
get ["data-theme"] () {
|
|
552
|
+
return local.dataTheme;
|
|
553
|
+
},
|
|
554
|
+
"data-slot": "ui-select-popover",
|
|
555
|
+
get ["data-open"] () {
|
|
556
|
+
return ctx?.open() ? "true" : "false";
|
|
557
|
+
},
|
|
558
|
+
get ["data-placement"] () {
|
|
559
|
+
return overlayPosition.placement();
|
|
560
|
+
},
|
|
561
|
+
get style () {
|
|
562
|
+
return popoverStyle();
|
|
569
563
|
}
|
|
570
|
-
});
|
|
564
|
+
}), false, true);
|
|
565
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$10, ()=>local.children);
|
|
566
|
+
return _el$10;
|
|
571
567
|
}
|
|
572
568
|
});
|
|
573
569
|
};
|
|
@@ -149,6 +149,7 @@
|
|
|
149
149
|
-------------------------------------------------------------------------- */
|
|
150
150
|
.table__column {
|
|
151
151
|
position: relative;
|
|
152
|
+
overflow: hidden;
|
|
152
153
|
padding-inline: 1rem;
|
|
153
154
|
padding-block: 0.625rem;
|
|
154
155
|
text-align: left;
|
|
@@ -158,6 +159,11 @@
|
|
|
158
159
|
vertical-align: middle;
|
|
159
160
|
}
|
|
160
161
|
|
|
162
|
+
.table__column > * {
|
|
163
|
+
min-width: 0;
|
|
164
|
+
max-width: 100%;
|
|
165
|
+
}
|
|
166
|
+
|
|
161
167
|
@supports (color: color-mix(in lab, red, red)) {
|
|
162
168
|
.table__column {
|
|
163
169
|
color: color-mix(in oklab, var(--color-base-content) 60%, transparent);
|