@smilodon/core 1.9.1-debug.0 → 1.9.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/README.md +18 -0
- package/dist/index.cjs +294 -115
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +292 -116
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.js +294 -115
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/components/enhanced-select.d.ts +10 -0
- package/dist/types/src/components/select-option.d.ts +9 -1
- package/dist/types/src/config/global-config.d.ts +24 -19
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/utils/value-equality.d.ts +9 -0
- package/dist/types/src/utils/worker-manager.d.ts +4 -0
- package/dist/types/tests/lifecycle.spec.d.ts +1 -0
- package/package.json +1 -1
|
@@ -79,6 +79,11 @@ export declare class EnhancedSelect extends HTMLElement {
|
|
|
79
79
|
private _createScopedGlobalStyleNode;
|
|
80
80
|
private _buildScopedStyleElement;
|
|
81
81
|
private _scopeMirroredCssText;
|
|
82
|
+
/**
|
|
83
|
+
* Fallback CSS parser for environments where CSSStyleSheet API is unavailable (e.g., JSDOM).
|
|
84
|
+
* Performs simple text-based CSS rule scoping.
|
|
85
|
+
*/
|
|
86
|
+
private _scopeMirroredCssTextFallback;
|
|
82
87
|
private _serializeScopedCssRules;
|
|
83
88
|
private _serializeScopedCssRule;
|
|
84
89
|
private _splitSelectorList;
|
|
@@ -128,6 +133,11 @@ export declare class EnhancedSelect extends HTMLElement {
|
|
|
128
133
|
private _perfMeasure;
|
|
129
134
|
private _markOpenStart;
|
|
130
135
|
private _finalizePerfMarks;
|
|
136
|
+
/**
|
|
137
|
+
* Filter items by search query (optimized hot path)
|
|
138
|
+
* Uses for-loop with hoisted invariants for better performance
|
|
139
|
+
*/
|
|
140
|
+
private _filterItemsByQuery;
|
|
131
141
|
private _handleSearch;
|
|
132
142
|
private _handleKeydown;
|
|
133
143
|
private _moveActive;
|
|
@@ -26,7 +26,7 @@ export interface OptionConfig {
|
|
|
26
26
|
/** Custom renderer */
|
|
27
27
|
render?: (item: unknown, index: number) => HTMLElement | string;
|
|
28
28
|
/** Custom style */
|
|
29
|
-
style?:
|
|
29
|
+
style?: Record<string, string | number | undefined>;
|
|
30
30
|
/** Custom class names */
|
|
31
31
|
className?: string;
|
|
32
32
|
/** Class map for state classes */
|
|
@@ -48,7 +48,15 @@ export declare class SelectOption extends HTMLElement {
|
|
|
48
48
|
private _shadow;
|
|
49
49
|
private _container;
|
|
50
50
|
private _removeButton?;
|
|
51
|
+
private _hasRendered;
|
|
51
52
|
constructor(config: OptionConfig);
|
|
53
|
+
connectedCallback(): void;
|
|
54
|
+
private _ensureRendered;
|
|
55
|
+
/**
|
|
56
|
+
* Ensure option content is rendered. Called by EnhancedSelect after append
|
|
57
|
+
* when connectedCallback timing is unreliable (Vue/Nuxt, jsdom, Teleport).
|
|
58
|
+
*/
|
|
59
|
+
ensureRendered(): void;
|
|
52
60
|
private _initializeStyles;
|
|
53
61
|
private _getDisabledBehavior;
|
|
54
62
|
private _isDisabledSelectionBlocked;
|
|
@@ -104,45 +104,50 @@ export interface MultiSelectDisplayConfig {
|
|
|
104
104
|
/** Enable drag-to-scroll interactions in horizontal mode */
|
|
105
105
|
dragScroll?: boolean;
|
|
106
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Plain CSS style object for component part configuration.
|
|
109
|
+
* Accepts standard CSS properties and custom properties (e.g. `--select-*`).
|
|
110
|
+
*/
|
|
111
|
+
export type StyleObject = Record<string, string | number | undefined>;
|
|
107
112
|
export interface StyleConfig {
|
|
108
113
|
/** Container styles */
|
|
109
|
-
container?:
|
|
114
|
+
container?: StyleObject;
|
|
110
115
|
/** Dropdown styles */
|
|
111
|
-
dropdown?:
|
|
116
|
+
dropdown?: StyleObject;
|
|
112
117
|
/** Option item styles */
|
|
113
|
-
option?:
|
|
118
|
+
option?: StyleObject;
|
|
114
119
|
/** Selected option styles */
|
|
115
|
-
selectedOption?:
|
|
120
|
+
selectedOption?: StyleObject;
|
|
116
121
|
/** Disabled option styles */
|
|
117
|
-
disabledOption?:
|
|
122
|
+
disabledOption?: StyleObject;
|
|
118
123
|
/** Hover option styles */
|
|
119
|
-
hoverOption?:
|
|
124
|
+
hoverOption?: StyleObject;
|
|
120
125
|
/** Active option styles */
|
|
121
|
-
activeOption?:
|
|
126
|
+
activeOption?: StyleObject;
|
|
122
127
|
/** Selected indicator bar styles for lightweight/custom-rendered options */
|
|
123
|
-
selectedIndicator?:
|
|
128
|
+
selectedIndicator?: StyleObject;
|
|
124
129
|
/** Input field styles */
|
|
125
|
-
input?:
|
|
130
|
+
input?: StyleObject;
|
|
126
131
|
/** Multi-select badge styles */
|
|
127
|
-
badge?:
|
|
132
|
+
badge?: StyleObject;
|
|
128
133
|
/** Multi-select badge hover styles */
|
|
129
|
-
badgeHover?:
|
|
134
|
+
badgeHover?: StyleObject;
|
|
130
135
|
/** Multi-select badge active styles */
|
|
131
|
-
badgeActive?:
|
|
136
|
+
badgeActive?: StyleObject;
|
|
132
137
|
/** Multi-select badge label styles */
|
|
133
|
-
badgeLabel?:
|
|
138
|
+
badgeLabel?: StyleObject;
|
|
134
139
|
/** Multi-select badge remove button styles */
|
|
135
|
-
badgeRemove?:
|
|
140
|
+
badgeRemove?: StyleObject;
|
|
136
141
|
/** Multi-select badge remove icon styles */
|
|
137
|
-
badgeRemoveIcon?:
|
|
142
|
+
badgeRemoveIcon?: StyleObject;
|
|
138
143
|
/** Multi-select badge remove button hover styles */
|
|
139
|
-
badgeRemoveHover?:
|
|
144
|
+
badgeRemoveHover?: StyleObject;
|
|
140
145
|
/** Multi-select badge remove button active styles */
|
|
141
|
-
badgeRemoveActive?:
|
|
146
|
+
badgeRemoveActive?: StyleObject;
|
|
142
147
|
/** Group header styles */
|
|
143
|
-
groupHeader?:
|
|
148
|
+
groupHeader?: StyleObject;
|
|
144
149
|
/** Loading indicator styles */
|
|
145
|
-
loader?:
|
|
150
|
+
loader?: StyleObject;
|
|
146
151
|
/** Custom CSS class names */
|
|
147
152
|
classNames?: {
|
|
148
153
|
container?: string;
|
|
@@ -13,6 +13,7 @@ export { PerformanceTelemetry, getTelemetry, measureAsync, measureSync } from '.
|
|
|
13
13
|
export { Virtualizer } from './utils/virtualizer.js';
|
|
14
14
|
export { OptionRenderer } from './utils/option-renderer.js';
|
|
15
15
|
export { CustomOptionPool } from './utils/custom-option-pool.js';
|
|
16
|
+
export { valuesEqual, arrayIncludesValue, arraysEqualByValue } from './utils/value-equality.js';
|
|
16
17
|
export { setHTMLSanitizer, getHTMLSanitizer, sanitizeHTML, createElement, setCSSProperties, CSPFeatures, detectEnvironment, containsSuspiciousPatterns, escapeHTML, escapeAttribute, validateTemplate, createTextNode, setTextContent } from './utils/security.js';
|
|
17
18
|
export { applyClasses, toggleClass, setCustomProperties, getCustomProperty, removeCustomProperty, defaultTheme, applyDefaultTheme, shadowDOMStyles, injectShadowStyles, hasOverflowHiddenAncestor, warnCSPViolation } from './utils/csp-styles.js';
|
|
18
19
|
export type { HTMLSanitizer, EnvironmentCapabilities } from './utils/security.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compare select item values with loose primitive coercion.
|
|
3
|
+
* Treats string/number pairs like `"1"` and `1` as equal.
|
|
4
|
+
*/
|
|
5
|
+
export declare function valuesEqual(a: unknown, b: unknown): boolean;
|
|
6
|
+
/** Returns true when `values` contains a value equal to `target`. */
|
|
7
|
+
export declare function arrayIncludesValue(values: readonly unknown[], target: unknown): boolean;
|
|
8
|
+
/** Returns true when two value arrays match positionally with loose equality. */
|
|
9
|
+
export declare function arraysEqualByValue(a: readonly unknown[], b: readonly unknown[]): boolean;
|
|
@@ -67,6 +67,10 @@ export declare class WorkerManager {
|
|
|
67
67
|
* Execute operation (worker or fallback)
|
|
68
68
|
*/
|
|
69
69
|
execute<T = unknown>(type: WorkerRequest['type'], payload: unknown, timeout?: number): Promise<T>;
|
|
70
|
+
/**
|
|
71
|
+
* Operation handlers for fallback execution
|
|
72
|
+
*/
|
|
73
|
+
private readonly _fallbackOperations;
|
|
70
74
|
/**
|
|
71
75
|
* Fallback to main thread execution
|
|
72
76
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED