@luzmo/lucero 2.6.0 → 2.7.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/components/action-menu/index.cjs +1 -1
- package/components/action-menu/index.js +1 -1
- package/components/{action-menu-LnXQ7reF.js → action-menu-Bv9EA7__.js} +1 -1
- package/components/{action-menu-BW-XpCVO.cjs → action-menu-DphCCjvX.cjs} +1 -1
- package/components/checkbox/index.cjs +1 -1
- package/components/checkbox/index.js +1 -1
- package/components/{checkbox-CVi4GMoo.cjs → checkbox-NSSgVzJg.cjs} +1 -1
- package/components/{checkbox-CvRvgRzh.js → checkbox-fW7WI915.js} +1 -1
- package/components/color-field/index.cjs +1 -1
- package/components/color-field/index.js +1 -1
- package/components/{color-field-CVyDNZ4b.js → color-field-BZljmVHt.js} +1 -1
- package/components/{color-field-CN8shDl_.cjs → color-field-l-aJ6O4a.cjs} +1 -1
- package/components/color-menu/index.cjs +1 -1
- package/components/color-menu/index.js +1 -1
- package/components/{color-menu-COhe5VUB.cjs → color-menu-C56xj5Oe.cjs} +1 -1
- package/components/{color-menu-Ct3f01bI.js → color-menu-CEtmpeN7.js} +1 -1
- package/components/color-picker/index.cjs +1 -1
- package/components/color-picker/index.js +1 -1
- package/components/{color-picker-DWERcNZi.js → color-picker-BDqJodTR.js} +1 -1
- package/components/{color-picker-ELa0yF2F.cjs → color-picker-CLGNQIkK.cjs} +1 -1
- package/components/index.cjs +1 -1
- package/components/index.js +28 -28
- package/components/menu/index.cjs +1 -1
- package/components/menu/index.js +1 -1
- package/components/{menu-BKwt6rnv.cjs → menu-CoJ5oERs.cjs} +1 -1
- package/components/{menu-L5qYivn6.js → menu-f2S0m6h9.js} +1 -1
- package/components/multi-language-field/index.cjs +1 -1
- package/components/multi-language-field/index.js +1 -1
- package/components/{multi-language-field-NY2XwK2M.js → multi-language-field-SZObnneZ.js} +1 -1
- package/components/{multi-language-field-djoM4Okc.cjs → multi-language-field-nJmWDtPL.cjs} +1 -1
- package/components/number-field/index.cjs +1 -1
- package/components/number-field/index.js +1 -1
- package/components/number-field/number-field.d.ts +35 -0
- package/components/{number-field-Crol6vc9.js → number-field-BEt0cfcB.js} +32 -10
- package/components/{number-field-CV7g2Q20.cjs → number-field-DrarDCm4.cjs} +3 -2
- package/components/options/index.cjs +1 -1
- package/components/options/index.d.ts +1 -1
- package/components/options/index.js +1 -1
- package/components/options/options.d.ts +14 -28
- package/components/options/types.d.ts +42 -0
- package/components/options-BH_Y3UB6.cjs +110 -0
- package/components/{options-BHDesKbF.js → options-BiA2h1-i.js} +94 -74
- package/components/picker/index.cjs +1 -1
- package/components/picker/index.js +1 -1
- package/components/{picker-CQCAt4Mx.cjs → picker-Dd25S3rP.cjs} +1 -1
- package/components/{picker-C5eX5WBl.js → picker-JhsRAtSd.js} +1 -1
- package/components/prompt-box/index.cjs +1 -1
- package/components/prompt-box/index.js +1 -1
- package/components/{prompt-box-D7owyhfG.cjs → prompt-box-B1rmo4DX.cjs} +2 -2
- package/components/{prompt-box-CrtFGmjm.js → prompt-box-CL0ld3Na.js} +2 -2
- package/components/question-box/index.cjs +1 -1
- package/components/question-box/index.js +1 -1
- package/components/{question-box-BJYYLghb.js → question-box-BAyRPZ8j.js} +2 -2
- package/components/{question-box-ym1eakXA.cjs → question-box-D7s2xNAD.cjs} +1 -1
- package/components/search/index.cjs +1 -1
- package/components/search/index.js +1 -1
- package/components/{search-DiCwSHFf.cjs → search-1KUNWKWg.cjs} +1 -1
- package/components/{search-C5uFmm6S.js → search-_NUUJLz0.js} +1 -1
- package/components/select/index.cjs +1 -1
- package/components/select/index.d.ts +1 -0
- package/components/select/index.js +1 -1
- package/components/select/select.d.ts +9 -1
- package/components/{select-HqF3tcHz.js → select-8gtm46qA.js} +82 -76
- package/components/select-ChM3Zfxd.cjs +159 -0
- package/components/slider/index.cjs +1 -1
- package/components/slider/index.js +1 -1
- package/components/{slider-Ce6qgPZ4.cjs → slider-B1cCAj1x.cjs} +1 -1
- package/components/{slider-BFTuAXK1.js → slider-CD-aGN9I.js} +1 -1
- package/components/table/index.cjs +1 -1
- package/components/table/index.js +1 -1
- package/components/{table-CLMLGloR.cjs → table-Bf-00FYb.cjs} +1 -1
- package/components/{table-DlOWqm5C.js → table-CfFwBCp1.js} +1 -1
- package/components/text-field/index.cjs +1 -1
- package/components/text-field/index.js +2 -2
- package/components/{text-field-DpvP_tCP.js → text-field-CBsx1CVo.js} +1 -1
- package/components/{text-field-DCcOZSvY.cjs → text-field-CZixBD87.cjs} +1 -1
- package/components/{text-field-BVl-HWzb.cjs → text-field-DwvDSctG.cjs} +1 -1
- package/components/{text-field-D49lAD7L.js → text-field-SNbvQYOj.js} +1 -1
- package/components/utils.cjs +1 -1
- package/components/utils.js +3 -3
- package/custom-elements.json +1 -1
- package/package.json +2 -2
- package/standalone/accordion.js +2 -2
- package/standalone/action-bar.js +1 -1
- package/standalone/action-button.js +1 -1
- package/standalone/action-menu.js +3 -3
- package/standalone/avatar.js +1 -1
- package/standalone/calendar.js +1 -1
- package/standalone/checkbox.js +1 -1
- package/standalone/chunks/action-button-C946JGIA.js +6 -0
- package/standalone/chunks/button-COqfQNJv.js +2 -0
- package/standalone/chunks/calendar-BVrT8uqP.js +122 -0
- package/standalone/chunks/checkbox-4PoS7Uft.js +9 -0
- package/standalone/chunks/clear-button-qIMg8hR4.js +2 -0
- package/standalone/chunks/close-button-DEiL5kEh.js +2 -0
- package/standalone/chunks/{color-field-BaVvupq0.js → color-field-BKDaLJQo.js} +1 -1
- package/standalone/chunks/color-menu-6LhE-qWn.js +73 -0
- package/standalone/chunks/icon-D69mOw1X.js +2 -0
- package/standalone/chunks/luzmo-icon-markup-DaKoHMY8.js +13 -0
- package/standalone/chunks/luzmoAlert-lLzK3UPQ.js +2 -0
- package/standalone/chunks/luzmoAlertOutline-C7rw3G3h.js +2 -0
- package/standalone/chunks/luzmoAngleDown-PNrItYzK.js +2 -0
- package/standalone/chunks/luzmoAngleLeft-ebJO7ROy.js +2 -0
- package/standalone/chunks/luzmoAngleRight-B-rZQuxv.js +2 -0
- package/standalone/chunks/luzmoAngleUp-BQ2D4OjY.js +2 -0
- package/standalone/chunks/luzmoArrowUp-Bz_z0IO5.js +2 -0
- package/standalone/chunks/luzmoCheckCircleOutline-B8qAhKxa.js +2 -0
- package/standalone/chunks/luzmoCheckHeavy-JAzxJeXk.js +2 -0
- package/standalone/chunks/luzmoClose14-CpeGUk1z.js +2 -0
- package/standalone/chunks/luzmoDash-oXMu8wBK.js +2 -0
- package/standalone/chunks/luzmoInfoCircleOutline-EEKa5x7I.js +2 -0
- package/standalone/chunks/luzmoSearch-WSfXYol0.js +2 -0
- package/standalone/chunks/{menu-CefrRBIS.js → menu-DtUgXalL.js} +4 -4
- package/standalone/chunks/number-field-aOOuxxRh.js +42 -0
- package/standalone/chunks/options-CPaX-OWy.js +94 -0
- package/standalone/chunks/picker-5IvNnimu.js +108 -0
- package/standalone/chunks/picker-button-BIqlIkET.js +21 -0
- package/standalone/chunks/segments-factory-DWNY1AUE.js +2 -0
- package/standalone/chunks/{swatch-DivHeYOK.js → swatch-zFOV4NtM.js} +2 -2
- package/standalone/chunks/text-field-C4D5FNRe.js +5 -0
- package/standalone/chunks/{text-field-DXzpM1Qn.js → text-field-DwD97PEo.js} +3 -3
- package/standalone/clear-button.js +1 -1
- package/standalone/close-button.js +1 -1
- package/standalone/color-field.js +1 -1
- package/standalone/color-menu.js +1 -1
- package/standalone/color-picker.js +1 -1
- package/standalone/date-range-picker.js +8 -8
- package/standalone/date-time-picker.js +9 -9
- package/standalone/icon.js +1 -1
- package/standalone/manifest.json +32 -19
- package/standalone/menu.js +1 -1
- package/standalone/multi-language-field.js +1 -1
- package/standalone/notice.js +1 -1
- package/standalone/number-field.js +1 -1
- package/standalone/options.js +1 -1
- package/standalone/picker-button.js +1 -1
- package/standalone/picker.js +1 -1
- package/standalone/progress-steps.js +6 -6
- package/standalone/prompt-box.js +19 -19
- package/standalone/question-box.js +20 -20
- package/standalone/search.js +1 -1
- package/standalone/select.js +17 -16
- package/standalone/slider.js +1 -1
- package/standalone/swatch.js +1 -1
- package/standalone/table.js +25 -25
- package/standalone/tabs.js +3 -3
- package/standalone/tags.js +1 -1
- package/standalone/text-field.js +1 -1
- package/standalone/toast.js +3 -3
- package/standalone/utils.js +1 -1
- package/components/options-Dk1uFeUT.cjs +0 -105
- package/components/select-2Fvb7tpj.cjs +0 -158
- package/standalone/chunks/action-button-0d4u0dWv.js +0 -6
- package/standalone/chunks/button-Bgc3zdEa.js +0 -2
- package/standalone/chunks/calendar-BxARYymw.js +0 -122
- package/standalone/chunks/checkbox-Cl6YBcGA.js +0 -9
- package/standalone/chunks/clear-button-B4r_oxfc.js +0 -2
- package/standalone/chunks/close-button-DVCeu3_f.js +0 -2
- package/standalone/chunks/color-menu-DIX2y9m_.js +0 -73
- package/standalone/chunks/icon-6P1RsbD1.js +0 -2
- package/standalone/chunks/luzmo-icons-vtQE0BSI.js +0 -13
- package/standalone/chunks/number-field-BoIKbmIv.js +0 -41
- package/standalone/chunks/options-rb_zaAJ6.js +0 -89
- package/standalone/chunks/picker-HoERLlkx.js +0 -108
- package/standalone/chunks/picker-button-DbamPU-T.js +0 -21
- package/standalone/chunks/segments-factory-B6oGyosS.js +0 -2
- package/standalone/chunks/text-field-D5ncaa2n.js +0 -5
|
@@ -1,38 +1,13 @@
|
|
|
1
1
|
import { LitVirtualizer } from '@lit-labs/virtualizer/LitVirtualizer.js';
|
|
2
2
|
import { CSSResultArray, PropertyValues, TemplateResult } from 'lit';
|
|
3
3
|
import { LuzmoElement } from '../../utils/base';
|
|
4
|
-
import {
|
|
4
|
+
import type { OptionIconRenderer, OptionRenderer, OptionValue } from './types';
|
|
5
|
+
export type { FlatOptionValue, OptionIconRenderer, OptionRenderContext, OptionRenderer, OptionValue } from './types';
|
|
5
6
|
import './../icon';
|
|
6
7
|
import './../progress-circle';
|
|
7
8
|
import { LuzmoOption } from './option';
|
|
8
9
|
import './options-divider';
|
|
9
|
-
export type OptionValue = {
|
|
10
|
-
divider?: false;
|
|
11
|
-
header?: boolean;
|
|
12
|
-
label?: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
value?: string | number;
|
|
15
|
-
/** Trailing keyboard shortcut text. Ignored on expandable parent options. */
|
|
16
|
-
shortcut?: string;
|
|
17
|
-
icon?: IconDefinition;
|
|
18
|
-
imgSrc?: string;
|
|
19
|
-
shortLabel?: string;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
selected?: boolean;
|
|
22
|
-
children?: OptionValue[];
|
|
23
|
-
};
|
|
24
10
|
export declare function isStructuralOption(option?: OptionValue | string): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* @internal
|
|
27
|
-
* Extended option type used internally for flattened rendering of hierarchical options.
|
|
28
|
-
*/
|
|
29
|
-
export type FlatOptionValue = OptionValue & {
|
|
30
|
-
_isChild?: boolean;
|
|
31
|
-
_parentValue?: string | number;
|
|
32
|
-
};
|
|
33
|
-
export type OptionIconRenderer = (option: OptionValue, ctx: {
|
|
34
|
-
size: string;
|
|
35
|
-
}) => TemplateResult | null;
|
|
36
11
|
export declare const VIRTUALIZE_AS_OF_NUM_ITEMS = 25;
|
|
37
12
|
declare const LuzmoOptions_base: typeof LuzmoElement & {
|
|
38
13
|
new (...args: any[]): import("../..").SizedElementInterface;
|
|
@@ -117,6 +92,16 @@ export declare class LuzmoOptions extends LuzmoOptions_base {
|
|
|
117
92
|
* When it returns null, default icon rendering is used.
|
|
118
93
|
*/
|
|
119
94
|
optionIconRenderer?: OptionIconRenderer;
|
|
95
|
+
/**
|
|
96
|
+
* Render all option content inside the interactive option element.
|
|
97
|
+
* Headers and dividers retain their built-in layout. Return null or undefined
|
|
98
|
+
* for the default icon, label, description and shortcut. Keep labels in the
|
|
99
|
+
* option data for accessible names and search, and avoid nested controls.
|
|
100
|
+
* The second argument provides live selection, focus, disabled, expansion and
|
|
101
|
+
* size state. Data descriptions are exposed through aria-description; other
|
|
102
|
+
* template-only text is not part of the accessible name or description.
|
|
103
|
+
*/
|
|
104
|
+
renderOption?: OptionRenderer;
|
|
120
105
|
/**
|
|
121
106
|
* @internal
|
|
122
107
|
*/
|
|
@@ -130,6 +115,8 @@ export declare class LuzmoOptions extends LuzmoOptions_base {
|
|
|
130
115
|
* @internal
|
|
131
116
|
*/
|
|
132
117
|
focusedOptionIndex: number;
|
|
118
|
+
/** @internal The option displaying the component's keyboard focus. */
|
|
119
|
+
private _focusedOption?;
|
|
133
120
|
/**
|
|
134
121
|
* promise that resolves when the option elements have been updated
|
|
135
122
|
* @internal
|
|
@@ -202,4 +189,3 @@ export declare class LuzmoOptions extends LuzmoOptions_base {
|
|
|
202
189
|
private updateItemFocus;
|
|
203
190
|
private setFocusedAndActiveDescendant;
|
|
204
191
|
}
|
|
205
|
-
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { IconDefinition } from '@luzmo/icons';
|
|
2
|
+
import type { nothing, TemplateResult } from 'lit';
|
|
3
|
+
import type { ElementSize } from '../../utils/sized-mixin';
|
|
4
|
+
export type OptionValue = {
|
|
5
|
+
divider?: false;
|
|
6
|
+
header?: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
value?: string | number;
|
|
10
|
+
/** Trailing keyboard shortcut text. Ignored on expandable parent options. */
|
|
11
|
+
shortcut?: string;
|
|
12
|
+
icon?: IconDefinition;
|
|
13
|
+
imgSrc?: string;
|
|
14
|
+
shortLabel?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
selected?: boolean;
|
|
17
|
+
children?: OptionValue[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
* Extended option type used internally for flattened rendering of hierarchical options.
|
|
22
|
+
*/
|
|
23
|
+
export type FlatOptionValue = OptionValue & {
|
|
24
|
+
_isChild?: boolean;
|
|
25
|
+
_parentValue?: string | number;
|
|
26
|
+
};
|
|
27
|
+
export type OptionIconRenderer = (option: OptionValue, ctx: {
|
|
28
|
+
size: string;
|
|
29
|
+
}) => TemplateResult | null;
|
|
30
|
+
/** Live component state for custom option content, independent of input flags. */
|
|
31
|
+
export type OptionRenderContext = {
|
|
32
|
+
selected: boolean;
|
|
33
|
+
focused: boolean;
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
expanded: boolean;
|
|
36
|
+
size: ElementSize;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Render an option's content. Nullish results use the default layout;
|
|
40
|
+
* `nothing` deliberately leaves the content empty.
|
|
41
|
+
*/
|
|
42
|
+
export type OptionRenderer = (option: OptionValue, ctx: OptionRenderContext) => TemplateResult | typeof nothing | null | undefined;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2026 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./sized-mixin-CSajkMro.cjs"),n=require("./focusable-BIHTrJd6.cjs");require("./icon-BlbMP3mJ.cjs");const r=require("./like-anchor-De9STeWr.cjs"),i=require("./observe-slot-text-BqwCIv2a.cjs"),a=require("./random-id-BcUJAxUZ.cjs"),o=require("./observe-slot-presence-CS8pMePk.cjs");require("./progress-circle-C_9UZs2Y.cjs");const s=require("./divider.module-BV6tmpOY.cjs"),c=require("./template-property-yhcAmPXk.cjs");let l=require("lit"),u=require("lit/decorators.js"),d=require("@luzmo/icons"),f=require("lit/directives/if-defined.js"),p=require("@lit-labs/observers/mutation-controller.js"),m=require("@lit-labs/virtualizer/LitVirtualizer.js"),h=require("lit/directives/repeat.js");var g=`#icon{height:var(--luzmo-option-icon-container-height,var(--option-icon-container-height));min-height:var(--luzmo-option-icon-size,var(--option-icon-height));color:var(--highcontrast-option-color-default,var(--luzmo-option-label-icon-color-default,var(--option-label-icon-color-default)));grid-area:iconArea;justify-content:center;align-self:start;align-items:center;display:flex}::slotted([slot=icon]){fill:var(--highcontrast-option-color-default,var(--luzmo-option-label-icon-color-default,var(--option-label-icon-color-default)));block-size:var(--luzmo-option-icon-size,var(--option-icon-height));inline-size:var(--luzmo-option-icon-width,var(--option-icon-width));font-size:var(--luzmo-option-icon-size,var(--option-icon-height));border-radius:var(--luzmo-option-icon-border-radius,0);border-width:var(--luzmo-option-icon-border-width,0);border-style:var(--luzmo-option-icon-border-style,solid);border-color:var(--luzmo-option-icon-border-color,transparent);text-align:center;--luzmo-icon-vertical-align:0;--luzmo-icon-img-object-fit:var(--luzmo-option-icon-object-fit,var(--option-icon-object-fit,fill));--luzmo-icon-img-object-position:var(--luzmo-option-icon-object-position,var(--option-icon-object-position,50% 50%));justify-content:center;align-items:center;margin-inline-end:max(var(--luzmo-option-label-text-to-visual,var(--option-label-text-to-visual)), var(--luzmo-option-icon-size,var(--option-icon-height)) * .35);display:flex;overflow:hidden}::slotted([slot=icon][data-option-thumbnail]){border-radius:var(--luzmo-option-thumbnail-border-radius,var(--luzmo-option-icon-border-radius,var(--luzmo-border-radius-s,4px)));border-width:var(--luzmo-option-thumbnail-border-width,1px);border-style:var(--luzmo-option-thumbnail-border-style,solid);border-color:var(--luzmo-option-thumbnail-border-color,var(--luzmo-option-icon-border-color,var(--luzmo-border-color-full,var(--luzmo-border-color,#0000001f))))}:host{cursor:pointer;box-sizing:border-box;background-color:var(--highcontrast-option-background-color-default,var(--luzmo-option-background-color-default,var(--option-background-color-default)));line-height:var(--luzmo-option-label-line-height,var(--option-label-line-height));min-block-size:max(var(--luzmo-option-min-height,var(--option-min-height)), var(--luzmo-option-icon-size,var(--option-icon-height)) + var(--luzmo-option-top-edge-to-text,var(--option-top-edge-to-text)) + var(--luzmo-option-bottom-edge-to-text,var(--option-bottom-edge-to-text)));padding-block-start:var(--luzmo-option-top-edge-to-text,var(--option-top-edge-to-text));padding-block-end:var(--luzmo-option-bottom-edge-to-text,var(--option-bottom-edge-to-text));padding-inline:var(--luzmo-option-label-inline-edge-to-content,var(--option-label-inline-edge-to-content));outline:none;flex-shrink:0;grid-template:". .headingIconArea sectionHeadingArea. .""selectedArea checkArea iconArea labelArea valueArea actionsArea"1fr". . .descriptionArea. ."". . . . . ."/auto auto auto 1fr auto auto;justify-content:start;align-items:center;margin:0;-webkit-text-decoration:none;text-decoration:none;display:grid;position:relative}:host:focus-visible{outline:none}#label{grid-area:submenuItemLabelArea}.checkmark,.checkbox{opacity:1;grid-area:checkArea;align-self:start;display:block}.checkmark{font-size:var(--luzmo-option-checkmark-size,var(--option-checkmark-size));fill:var(--highcontrast-options-checkmark-icon-color-default,var(--luzmo-options-checkmark-icon-color-default,var(--options-checkmark-icon-color-default)));color:var(--highcontrast-options-checkmark-icon-color-default,var(--luzmo-options-checkmark-icon-color-default,var(--options-checkmark-icon-color-default)));margin-block-start:calc(var(--luzmo-option-top-to-checkmark,var(--option-top-to-checkmark)) - var(--luzmo-option-top-edge-to-text,var(--option-top-edge-to-text)));margin-inline-end:var(--luzmo-option-text-to-control,var(--option-label-text-to-control))}.checkbox{font-size:var(--luzmo-option-checkbox-size,var(--option-checkbox-size));fill:var(--highcontrast-options-checkbox-icon-color-default,var(--luzmo-options-checkbox-icon-color-default,var(--options-checkbox-icon-color-default)));color:var(--highcontrast-options-checkbox-icon-color-default,var(--luzmo-options-checkbox-icon-color-default,var(--options-checkbox-icon-color-default)));margin-block-start:calc(var(--luzmo-option-top-to-checkbox,var(--option-top-to-checkbox)) - var(--luzmo-option-top-edge-to-text,var(--option-top-edge-to-text)));margin-inline-end:var(--luzmo-option-text-to-control,var(--option-label-text-to-control))}::slotted([slot=value]){grid-area:submenuItemValueArea}:host([focused]){background-color:var(--highcontrast-option-background-color-focus,var(--luzmo-option-background-color-key-focus,var(--option-background-color-key-focus)));outline:none}:host([focused])>#label,:host(:focus)>#label{color:var(--highcontrast-option-color-focus,var(--luzmo-option-label-content-color-focus,var(--option-label-content-color-focus)))}:host([focused])>[name=description]::slotted(*),:host(:focus)>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus,var(--luzmo-option-description-color-focus,var(--option-description-color-focus)))}:host([focused])>::slotted([slot=value]),:host(:focus)>::slotted([slot=value]){color:var(--highcontrast-option-color-focus,var(--luzmo-option-value-color-focus,var(--option-value-color-focus)))}:host([focused])>.icon:not(.checkmark,.checkbox),:host(:focus)>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus,var(--luzmo-option-label-icon-color-focus,var(--option-label-icon-color-focus)));color:var(--highcontrast-option-color-focus,var(--luzmo-option-label-icon-color-focus,var(--option-label-icon-color-focus)))}:host([focused])>.checkmark,:host(:focus)>.checkmark{fill:var(--highcontrast-option-color-focus,var(--luzmo-options-checkmark-icon-color-focus,var(--options-checkmark-icon-color-focus)));color:var(--highcontrast-option-color-focus,var(--luzmo-options-checkmark-icon-color-focus,var(--options-checkmark-icon-color-focus)))}:host([focused])>.checkbox,:host(:focus)>.checkbox{fill:var(--highcontrast-option-color-focus,var(--luzmo-options-checkbox-icon-color-focus,var(--options-checkbox-icon-color-focus)));color:var(--highcontrast-option-color-focus,var(--luzmo-options-checkbox-icon-color-focus,var(--options-checkbox-icon-color-focus)))}:is(:host:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),:host([dir=rtl])){--option-focus-indicator-direction-scalar:-1}:host(:is(:active,[active])){background-color:var(--highcontrast-option-background-color-focus,var(--luzmo-option-background-color-down,var(--option-background-color-down)))}:host(:is(:active,[active]))>#label{color:var(--highcontrast-option-color-focus,var(--luzmo-option-label-content-color-down,var(--option-label-content-color-down)))}:host(:is(:active,[active]))>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus,var(--luzmo-option-description-color-down,var(--option-description-color-down)))}:host(:is(:active,[active]))>::slotted([slot=value]){color:var(--highcontrast-option-color-focus,var(--luzmo-option-value-color-down,var(--option-value-color-down)))}:host(:is(:active,[active]))>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus,var(--luzmo-option-label-icon-color-down,var(--option-label-icon-color-down)));color:var(--highcontrast-option-color-focus,var(--luzmo-option-label-icon-color-down,var(--option-label-icon-color-down)))}:host(:is(:active,[active]))>.checkmark{fill:var(--highcontrast-option-color-focus,var(--luzmo-options-checkmark-icon-color-down,var(--options-checkmark-icon-color-down)));color:var(--highcontrast-option-color-focus,var(--luzmo-options-checkmark-icon-color-down,var(--options-checkmark-icon-color-down)))}:host(:is(:active,[active]))>.checkbox{fill:var(--highcontrast-option-color-focus,var(--luzmo-options-checkbox-icon-color-down,var(--options-checkbox-icon-color-down)));color:var(--highcontrast-option-color-focus,var(--luzmo-options-checkbox-icon-color-down,var(--options-checkbox-icon-color-down)))}:host([disabled]),:host([aria-disabled=true]){background-color:initial}:host([disabled]) #label,:host([disabled]) ::slotted([slot=value]),:host([aria-disabled=true]) #label,:host([aria-disabled=true]) ::slotted([slot=value]){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-label-content-color-disabled,var(--option-label-content-color-disabled)))}:host([disabled]) [name=description]::slotted(*),:host([aria-disabled=true]) [name=description]::slotted(*){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-description-color-disabled,var(--option-description-color-disabled)))}:host([disabled]) ::slotted([slot=icon]),:host([aria-disabled=true]) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-label-icon-color-disabled,var(--option-label-icon-color-disabled)));fill:var(--highcontrast-option-color-disabled,var(--luzmo-option-label-icon-color-disabled,var(--option-label-icon-color-disabled)))}:host([focused]){box-shadow:inset calc(var(--luzmo-option-focus-indicator-width,var(--option-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-option-focus-indicator-color,var(--luzmo-option-focus-indicator-color,var(--option-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-option-focus-indicator-width,var(--option-focus-indicator-width)) * var(--option-focus-indicator-direction-scalar,1)) 0 0 0 var(--highcontrast-option-focus-indicator-color,var(--luzmo-option-focus-indicator-color,var(--option-focus-indicator-color)))}#label{font-size:var(--luzmo-option-label-font-size,var(--option-label-font-size));color:var(--highcontrast-option-color-default,var(--luzmo-option-label-content-color-default,var(--option-label-content-color-default)));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;grid-area:labelArea}:host([variant=highlight][selected]){--option-shortcut-opacity:1;background-color:var(--luzmo-option-highlight-selected-label-background-color,var(--option-highlight-selected-label-background-color))}:host([variant=highlight][selected]) #label{color:var(--luzmo-option-highlight-selected-label-content-color,var(--option-highlight-selected-label-content-color))}:host([variant=highlight][selected]) [name=description]::slotted(*){color:var(--luzmo-option-highlight-selected-description-color,var(--option-highlight-selected-label-content-color))}:host([variant=highlight][selected])>::slotted([slot=value]){color:var(--luzmo-option-highlight-selected-value-color,var(--option-highlight-selected-label-content-color))}:host([variant=highlight][selected]):hover #label{color:var(--luzmo-option-highlight-selected-label-content-color-hover,var(--option-highlight-selected-label-content-color-hover))}:host([variant=highlight][selected]):hover [name=description]::slotted(*){color:var(--luzmo-option-highlight-selected-description-color-hover,var(--option-highlight-selected-label-content-color-hover))}:host([variant=highlight][selected]):hover>::slotted([slot=value]){color:var(--luzmo-option-highlight-selected-value-color-hover,var(--option-highlight-selected-label-content-color-hover))}:host([variant=highlight][selected]):active #label{color:var(--luzmo-option-highlight-selected-label-content-color-down,var(--option-highlight-selected-label-content-color-down))}:host([variant=highlight][selected]):active [name=description]::slotted(*){color:var(--luzmo-option-highlight-selected-description-color-down,var(--option-highlight-selected-label-content-color-down))}:host([variant=highlight][selected]):active>::slotted([slot=value]){color:var(--luzmo-option-highlight-selected-value-color-down,var(--option-highlight-selected-label-content-color-down))}:host([variant=highlight][selected]):focus #label{color:var(--luzmo-option-highlight-selected-label-content-color-focus,var(--option-highlight-selected-label-content-color-focus))}:host([variant=highlight][selected]):focus [name=description]::slotted(*){color:var(--luzmo-option-highlight-selected-description-color-focus,var(--option-highlight-selected-label-content-color-focus))}:host([variant=highlight][selected]):focus>::slotted([slot=value]){color:var(--luzmo-option-highlight-selected-value-color-focus,var(--option-highlight-selected-label-content-color-focus))}:host([variant=highlight][selected]) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-highlight-selected-label-content-color,var(--option-highlight-selected-label-content-color)));fill:var(--highcontrast-option-color-disabled,var(--luzmo-option-highlight-selected-label-content-color,var(--option-highlight-selected-label-content-color)))}::slotted([slot=value]){color:var(--highcontrast-option-color-default,var(--luzmo-option-value-color-default,var(--option-value-color-default)));font-family:inherit;font-size:var(--luzmo-option-label-font-size,var(--option-label-font-size));grid-area:valueArea;justify-self:end}::slotted(kbd[slot=value]){font-size:var(--option-shortcut-font-size);opacity:var(--option-shortcut-opacity)}[name=description]::slotted(*){color:var(--highcontrast-option-color-default,var(--luzmo-option-description-color-default,var(--option-description-color-default)));font-size:var(--luzmo-option-description-font-size,var(--option-description-font-size));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;line-height:var(--luzmo-option-description-line-height,var(--option-description-line-height));grid-area:descriptionArea;margin-block-start:var(--luzmo-option-label-to-description-spacing,var(--option-label-to-description-spacing))}:host([no-wrap]) #label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host([expandable]){cursor:pointer}:host([expandable][has-selected-child][variant=highlight]:not([expanded])){background-color:color-mix(in srgb, var(--luzmo-option-highlight-selected-label-background-color,var(--option-highlight-selected-label-background-color)) 12%, transparent)}:host([expandable])>.checkmark{color:color-mix(in srgb, var(--highcontrast-options-checkmark-icon-color-default,var(--luzmo-options-checkmark-icon-color-default,var(--options-checkmark-icon-color-default))) 50%, transparent);fill:color-mix(in srgb, var(--highcontrast-options-checkmark-icon-color-default,var(--luzmo-options-checkmark-icon-color-default,var(--options-checkmark-icon-color-default))) 50%, transparent)}:host([expandable])>.checkbox{color:color-mix(in srgb, var(--highcontrast-options-checkbox-icon-color-default,var(--luzmo-options-checkbox-icon-color-default,var(--options-checkbox-icon-color-default))) 50%, transparent);fill:color-mix(in srgb, var(--highcontrast-options-checkbox-icon-color-default,var(--luzmo-options-checkbox-icon-color-default,var(--options-checkbox-icon-color-default))) 50%, transparent)}:host([expandable][has-selected-child])>.checkmark{color:color-mix(in srgb, var(--highcontrast-options-checkmark-icon-color-default,var(--luzmo-options-checkmark-icon-color-default,var(--options-checkmark-icon-color-default))) 50%, transparent);fill:color-mix(in srgb, var(--highcontrast-options-checkmark-icon-color-default,var(--luzmo-options-checkmark-icon-color-default,var(--options-checkmark-icon-color-default))) 50%, transparent)}:host([expandable][has-selected-child])>.checkbox{color:color-mix(in srgb, var(--highcontrast-options-checkbox-icon-color-default,var(--luzmo-options-checkbox-icon-color-default,var(--options-checkbox-icon-color-default))) 50%, transparent);fill:color-mix(in srgb, var(--highcontrast-options-checkbox-icon-color-default,var(--luzmo-options-checkbox-icon-color-default,var(--options-checkbox-icon-color-default))) 50%, transparent)}:host([child-option]){padding-inline-start:calc(var(--luzmo-option-label-inline-edge-to-content,var(--option-label-inline-edge-to-content)) + 24px)}@media (hover:hover){:host(:hover){background-color:var(--highcontrast-option-background-color-focus,var(--luzmo-option-background-color-hover,var(--option-background-color-hover)))}:host(:hover)>#label{color:var(--highcontrast-option-color-focus,var(--luzmo-option-label-content-color-hover,var(--option-label-content-color-hover)))}:host([variant=highlight][selected]:hover)>#label{color:var(--luzmo-option-highlight-selected-label-content-color-hover,var(--option-highlight-selected-label-content-color-hover))}:host([variant=highlight][selected]:hover)>[name=description]::slotted(*){color:var(--luzmo-option-highlight-selected-description-color-hover,var(--option-highlight-selected-label-content-color-hover))}:host(:hover)>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus,var(--luzmo-option-description-color-hover,var(--option-description-color-hover)))}:host(:hover)>::slotted([slot=value]){color:var(--highcontrast-option-color-focus,var(--luzmo-option-value-color-hover,var(--option-value-color-hover)))}:host(:hover)>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus,var(--luzmo-option-label-icon-color-hover,var(--option-label-icon-color-hover)));color:var(--highcontrast-option-color-focus,var(--luzmo-option-label-icon-color-hover,var(--option-label-icon-color-hover)))}:host([variant=highlight][selected]:hover)>.icon:not(.checkmark,.checkbox){fill:var(--luzmo-option-highlight-selected-label-icon-color-hover,var(--option-highlight-selected-label-icon-color-hover))}:host(:hover)>.checkmark{fill:var(--highcontrast-option-color-focus,var(--luzmo-options-checkmark-icon-color-hover,var(--options-checkmark-icon-color-hover)));color:var(--highcontrast-option-color-focus,var(--luzmo-options-checkmark-icon-color-hover,var(--options-checkmark-icon-color-hover)))}:host(:hover)>.checkbox{fill:var(--highcontrast-option-color-focus,var(--luzmo-options-checkbox-icon-color-hover,var(--options-checkbox-icon-color-hover)));color:var(--highcontrast-option-color-focus,var(--luzmo-options-checkbox-icon-color-hover,var(--options-checkbox-icon-color-hover)))}:host([disabled]:hover),:host([aria-disabled=true]:hover){cursor:default;background-color:initial}:host([disabled]:hover) #label,:host([disabled]:hover) ::slotted([slot=value]),:host([aria-disabled=true]:hover) #label,:host([aria-disabled=true]:hover) ::slotted([slot=value]){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-label-content-color-disabled,var(--option-label-content-color-disabled)))}:host([disabled]:hover) [name=description]::slotted(*),:host([aria-disabled=true]:hover) [name=description]::slotted(*){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-description-color-disabled,var(--option-description-color-disabled)))}:host([disabled]:hover) ::slotted([slot=icon]),:host([aria-disabled=true]:hover) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-label-icon-color-disabled,var(--option-label-icon-color-disabled)));fill:var(--highcontrast-option-color-disabled,var(--luzmo-option-label-icon-color-disabled,var(--option-label-icon-color-disabled)))}}:host([emphasized]){--options-checkmark-icon-color-default:var(--luzmo-primary);--options-checkmark-icon-color-hover:var(--luzmo-primary-hover);--options-checkmark-icon-color-down:var(--luzmo-primary-down);--options-checkmark-icon-color-focus:var(--luzmo-primary-focus);--options-checkbox-icon-color-default:var(--luzmo-primary);--options-checkbox-icon-color-hover:var(--luzmo-primary-hover);--options-checkbox-icon-color-down:var(--luzmo-primary-down);--options-checkbox-icon-color-focus:var(--luzmo-primary-focus)}:host{text-align:initial;font-family:var(--luzmo-option-font-family,var(--luzmo-font-family))}:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([disabled]) [name=value]::slotted(*){color:var(--luzmo-option-label-icon-color-disabled,var(--luzmo-disabled-color))}#button{position:absolute;inset:0}.icon-container>svg{vertical-align:top}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}@media (forced-colors:active){:host{forced-color-adjust:none}}:host([no-wrap]) #label{display:block}`,_=e=>l.html`
|
|
19
|
+
<span class="icon-container icon checkmark ${e.join(` `)}">
|
|
20
|
+
${(0,d.luzmoIcon)(d.luzmoCheckHeavy)}
|
|
21
|
+
</span>
|
|
22
|
+
`,v=e=>l.html`
|
|
23
|
+
<span class="icon-container icon checkbox ${e.join(` `)}">
|
|
24
|
+
${(0,d.luzmoIcon)(d.luzmoCheckbox)}
|
|
25
|
+
</span>
|
|
26
|
+
`,y=e=>l.html`
|
|
27
|
+
<span class="icon-container icon checkbox ${e.join(` `)}">
|
|
28
|
+
${(0,d.luzmoIcon)(d.luzmoCheckboxChecked)}
|
|
29
|
+
</span>
|
|
30
|
+
`,b=class extends r.t(i.t(o.t(n.t,`[slot="icon"]`))){static get styles(){return[(0,l.unsafeCSS)(g)]}get value(){return this._value||this.itemText}set value(e){e!==this._value&&(this._value=e||``,this._value?this.setAttribute(`value`,this._value):this.removeAttribute(`value`))}get itemText(){return this.itemChildren.content.reduce((e,t)=>e+(t.textContent||``).trim(),``)}get focusElement(){return this}get hasIcon(){return this.slotContentIsPresent}get itemChildren(){if(!this.iconSlot||!this.contentSlot)return{icon:[],content:[]};if(this._itemChildren)return this._itemChildren;let e=this.iconSlot.assignedElements().map(e=>{let t=e.cloneNode(!0);return t.removeAttribute(`slot`),t.classList.toggle(`icon`),t}),t=this.contentSlot.assignedNodes().map(e=>e.cloneNode(!0));return this._itemChildren={icon:e,content:t},this._itemChildren}constructor(){super(),this.active=!1,this.focused=!1,this.selected=!1,this.emphasized=!1,this.expandable=!1,this.expanded=!1,this.childOption=!1,this.hasSelectedChild=!1,this.variant=`checkmarks`,this._value=``,this.noWrap=!1,this.renderCheckIcon=(e,t)=>{let n=t?[`check-icon--with-adjacent-icon`]:[];return this.variant===`checkboxes`?e?y(n):v(n):e&&this.variant!==`highlight`?_(n):l.html``},this.proxyFocus=()=>{this.focus()},this.willDispatchUpdate=!1,this.addEventListener(`click`,this.handleClickCapture,{capture:!0}),new p.MutationController(this,{config:{characterData:!0,childList:!0,subtree:!0},callback:()=>{this.breakItemChildrenCache()}})}click(){this.disabled||this.shouldProxyClick()||super.click()}handleClickCapture(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),!1}shouldProxyClick(){let e=!1;return this.anchorElement&&(this.anchorElement.click(),e=!0),e}breakItemChildrenCache(){this._itemChildren=void 0,this.triggerUpdate()}render(){return l.html`
|
|
31
|
+
${this.renderCheckIcon(this.selected||this.hasSelectedChild,this.hasIcon)}
|
|
32
|
+
<div id="icon">
|
|
33
|
+
<slot name="icon"></slot>
|
|
34
|
+
</div>
|
|
35
|
+
<div id="label">
|
|
36
|
+
<slot id="slot"></slot>
|
|
37
|
+
</div>
|
|
38
|
+
<slot name="description"></slot>
|
|
39
|
+
<slot name="value"></slot>
|
|
40
|
+
${this.href&&this.href.length>0?super.renderAnchor({id:`button`,ariaHidden:!0,className:`button anchor hidden`}):l.nothing}
|
|
41
|
+
`}handlePointerdown(){}firstUpdated(e){super.firstUpdated(e),this.setAttribute(`tabindex`,`-1`),this.addEventListener(`pointerdown`,this.handlePointerdown),this.hasAttribute(`id`)||(this.id=`luzmo-option-${a.t()}`)}updateAriaSelected(){let e=this.getAttribute(`role`);e===`option`?this.setAttribute(`aria-selected`,this.selected?`true`:`false`):e===`optioncheckbox`&&this.setAttribute(`aria-checked`,this.selected?`true`:`false`)}setRole(e){this.setAttribute(`role`,e),this.updateAriaSelected()}updated(e){super.updated(e),e.has(`label`)&&(this.label||e.get(`label`)!==void 0)&&this.setAttribute(`aria-label`,this.label||``),this.anchorElement&&(this.anchorElement.addEventListener(`focus`,this.proxyFocus),this.anchorElement.tabIndex=-1),e.has(`selected`)&&this.updateAriaSelected()}connectedCallback(){super.connectedCallback(),this.triggerUpdate()}async triggerUpdate(){this.willDispatchUpdate||(this.willDispatchUpdate=!0,await new Promise(e=>requestAnimationFrame(e)),this.dispatchUpdate())}dispatchUpdate(){this.isConnected&&(this.willDispatchUpdate=!1)}};e.t([(0,u.property)({type:Boolean,reflect:!0})],b.prototype,`active`,void 0),e.t([(0,u.property)({type:Boolean,reflect:!0})],b.prototype,`focused`,void 0),e.t([(0,u.property)({type:Boolean,reflect:!0})],b.prototype,`selected`,void 0),e.t([(0,u.property)({type:Boolean,reflect:!0})],b.prototype,`emphasized`,void 0),e.t([(0,u.property)({type:Boolean,reflect:!0})],b.prototype,`expandable`,void 0),e.t([(0,u.property)({type:Boolean,reflect:!0})],b.prototype,`expanded`,void 0),e.t([(0,u.property)({type:Boolean,reflect:!0,attribute:`child-option`})],b.prototype,`childOption`,void 0),e.t([(0,u.property)({type:Boolean,reflect:!0,attribute:`has-selected-child`})],b.prototype,`hasSelectedChild`,void 0),e.t([(0,u.property)({type:String,reflect:!0})],b.prototype,`variant`,void 0),e.t([(0,u.property)({type:String})],b.prototype,`value`,null),e.t([(0,u.query)(`slot:not([name])`)],b.prototype,`contentSlot`,void 0),e.t([(0,u.query)(`slot[name="icon"]`)],b.prototype,`iconSlot`,void 0),e.t([(0,u.property)({type:Boolean,reflect:!0,attribute:`no-wrap`,hasChanged(){return!1}})],b.prototype,`noWrap`,void 0),e.t([(0,u.query)(`.anchor`)],b.prototype,`anchorElement`,void 0);var x=`:host{--options-divider-thickness:var(--divider-thickness-medium,var(--luzmo-border-width));inline-size:auto;margin-block:var(--luzmo-options-section-divider-margin-block,max(0px, (var(--option-section-divider-height) - var(--options-divider-thickness)) / 2));margin-inline:var(--luzmo-option-label-inline-edge-to-content,var(--option-label-inline-edge-to-content));flex-shrink:0;display:block;overflow:visible}`,S=class extends t.n(e.n,{validSizes:[`s`,`m`,`l`]}){static get styles(){return[(0,l.unsafeCSS)(s.t),(0,l.unsafeCSS)(x)]}firstUpdated(e){super.firstUpdated(e),this.hasAttribute(`role`)||this.setAttribute(`role`,`separator`)}},C=`:host{--option-top-to-action:var(--luzmo-spacing-1);--option-top-to-checkbox:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--option-label-line-height:var(--luzmo-line-height);--option-label-line-height-cjk:1.5;--option-label-to-description-spacing:1px;--option-focus-indicator-width:var(--luzmo-indicator-width);--option-focus-indicator-color:var(--luzmo-indicator-color);--option-label-to-value-area-min-spacing:var(--luzmo-spacing-3);--option-label-content-color-default:var(--luzmo-font-color);--option-label-content-color-hover:var(--luzmo-font-color-hover);--option-label-content-color-down:var(--luzmo-font-color-down);--option-label-content-color-focus:var(--luzmo-font-color-focus);--option-label-icon-color-default:var(--luzmo-font-color);--option-label-icon-color-hover:var(--luzmo-font-color-hover);--option-label-icon-color-down:var(--luzmo-font-color-down);--option-label-icon-color-focus:var(--luzmo-font-color-focus);--option-highlight-selected-label-background-color:var(--luzmo-primary);--option-highlight-selected-label-content-color:var(--luzmo-primary-inverse-color);--option-highlight-selected-label-content-color-hover:var(--luzmo-primary-inverse-color);--option-highlight-selected-label-content-color-down:var(--luzmo-primary-inverse-color);--option-highlight-selected-label-content-color-focus:var(--luzmo-primary-inverse-color);--option-label-content-color-disabled:var(--luzmo-font-color-disabled);--option-label-icon-color-disabled:var(--luzmo-font-color-disabled);--option-description-line-height:var(--luzmo-line-height);--option-description-line-height-cjk:1.5;--option-description-color-default:var(--luzmo-font-color);--option-description-color-hover:var(--luzmo-font-color-hover);--option-description-color-down:var(--luzmo-font-color-down);--option-description-color-focus:var(--luzmo-font-color-focus);--option-description-color-disabled:var(--luzmo-disabled-color);--options-section-header-line-height:var(--luzmo-line-height);--options-section-header-line-height-cjk:1.5;--options-section-header-font-weight:var(--luzmo-font-weight-semibold);--options-section-header-color:var(--luzmo-font-color-down);--options-collapsible-icon-color:var(--luzmo-font-color-down);--options-checkmark-icon-color-default:var(--luzmo-font-color);--options-checkmark-icon-color-hover:var(--luzmo-font-color-hover);--options-checkmark-icon-color-down:var(--luzmo-font-color-down);--options-checkmark-icon-color-focus:var(--luzmo-font-color-focus);--options-checkbox-icon-color-default:var(--luzmo-font-color);--options-checkbox-icon-color-hover:var(--luzmo-font-color-hover);--options-checkbox-icon-color-down:var(--luzmo-font-color-down);--options-checkbox-icon-color-focus:var(--luzmo-font-color-focus);--options-drillin-icon-color-default:var(--luzmo-font-color);--options-drillin-icon-color-hover:var(--luzmo-font-color-hover);--options-drillin-icon-color-down:var(--luzmo-font-color-down);--options-drillin-icon-color-focus:var(--luzmo-font-color-focus);--option-value-color-default:var(--luzmo-font-color);--option-value-color-hover:var(--luzmo-font-color-hover);--option-value-color-down:var(--luzmo-font-color-down);--option-value-color-focus:var(--luzmo-font-color-focus);--option-shortcut-opacity:.7;--option-collapsible-no-icon-suboption-padding-x-start:28px;--option-background-color-selected:var(--luzmo-background-color);--option-background-color-default:var(--luzmo-background-color);--option-background-color-hover:var(--luzmo-background-color-hover);--option-background-color-down:var(--luzmo-background-color-down);--option-background-color-key-focus:var(--luzmo-background-color-focus);--options-scrollbar-width:var(--luzmo-scrollbar-size);--options-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--options-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--options-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--options-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--options-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background);--luzmo-option-thumbnail-border-radius:var(--luzmo-border-radius-s,4px);--luzmo-option-thumbnail-border-width:1px;--luzmo-option-thumbnail-border-style:solid;--luzmo-option-thumbnail-border-color:var(--luzmo-border-color-full,var(--luzmo-border-color,#0000001f));--option-min-height:var(--luzmo-component-height);--options-max-height:calc(8 * var(--option-min-height));--option-icon-container-height:18px;--options-pending-height:var(--option-min-height);--progress-circle-size:calc(var(--options-pending-height) - var(--option-top-edge-to-text) - var(--option-bottom-edge-to-text));--option-icon-height:var(--luzmo-font-size);--option-icon-width:var(--luzmo-font-size);--option-label-font-size:var(--luzmo-font-size);--option-shortcut-font-size:var(--luzmo-font-size-s);--option-label-text-to-visual:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--option-label-text-to-control:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--option-label-inline-edge-to-content:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--pending-inline-edge-to-content:var(--option-label-inline-edge-to-content);--option-top-edge-to-text:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--option-bottom-edge-to-text:var(--luzmo-spacing-3);--option-description-font-size:var(--luzmo-font-size-xs);--options-section-header-font-size:var(--luzmo-font-size);--options-section-header-min-width:var(--luzmo-component-height);--option-selectable-edge-to-text-not-selected:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--option-checkmark-size:var(--luzmo-font-size-xs);--option-checkbox-size:var(--luzmo-font-size-xs);--option-top-to-checkmark:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1))}:host([size=s]){--option-min-height:var(--luzmo-component-height-s);--option-icon-container-height:17px;--option-icon-height:var(--luzmo-font-size-s);--option-icon-width:var(--luzmo-font-size-s);--option-label-font-size:var(--luzmo-font-size-s);--option-shortcut-font-size:var(--luzmo-font-size-xs);--option-label-text-to-visual:var(--luzmo-spacing-3);--option-label-text-to-control:var(--luzmo-spacing-3);--option-label-inline-edge-to-content:var(--luzmo-spacing-3);--option-top-edge-to-text:calc(var(--luzmo-spacing-1) + var(--luzmo-spacing-2));--option-bottom-edge-to-text:var(--luzmo-spacing-2);--option-description-font-size:var(--luzmo-font-size-xs);--options-section-header-font-size:var(--luzmo-font-size-s);--options-section-header-min-width:var(--luzmo-component-height-s);--option-selectable-edge-to-text-not-selected:var(--luzmo-spacing-3);--option-checkmark-size:var(--luzmo-font-size-xs);--option-checkbox-size:var(--luzmo-font-size-xs);--option-top-to-checkmark:var(--luzmo-spacing-3);--option-top-to-checkbox:var(--luzmo-spacing-3)}:host([size=l]){--option-min-height:var(--luzmo-component-height-l);--option-icon-container-height:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--option-icon-height:var(--luzmo-font-size-l);--option-icon-width:var(--luzmo-font-size-l);--option-label-font-size:var(--luzmo-font-size-l);--option-shortcut-font-size:var(--luzmo-font-size);--option-label-text-to-visual:var(--luzmo-spacing-4);--option-label-text-to-control:var(--luzmo-spacing-4);--option-label-inline-edge-to-content:var(--luzmo-spacing-4);--option-top-edge-to-text:var(--luzmo-spacing-4);--option-bottom-edge-to-text:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--option-description-font-size:var(--luzmo-font-size-s);--options-section-header-font-size:var(--luzmo-font-size-l);--options-section-header-min-width:var(--luzmo-component-height-l);--option-selectable-edge-to-text-not-selected:var(--luzmo-spacing-4);--option-checkmark-size:var(--luzmo-font-size-s);--option-checkbox-size:var(--luzmo-font-size-s);--option-top-to-checkmark:var(--luzmo-spacing-4);--option-top-to-checkbox:var(--luzmo-spacing-4)}:host([size=xl]){--option-min-height:var(--luzmo-component-height-xl);--option-icon-container-height:26px;--option-icon-height:var(--luzmo-font-size-xl);--option-icon-width:var(--luzmo-font-size-xl);--option-label-font-size:var(--luzmo-font-size-xl);--option-shortcut-font-size:var(--luzmo-font-size-l);--option-label-text-to-visual:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--option-label-text-to-control:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--option-label-inline-edge-to-content:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--option-top-edge-to-text:var(--luzmo-spacing-4);--option-bottom-edge-to-text:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--option-description-font-size:var(--luzmo-font-size);--options-section-header-font-size:var(--luzmo-font-size-xl);--options-section-header-min-width:var(--luzmo-component-height-xl);--option-selectable-edge-to-text-not-selected:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--option-checkmark-size:var(--luzmo-font-size);--option-checkbox-size:var(--luzmo-font-size);--option-top-to-checkmark:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--option-top-to-checkbox:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1))}@media (forced-colors:active){:host{--highcontrast-option-background-color-default:ButtonFace;--highcontrast-option-color-default:ButtonText;--highcontrast-option-background-color-focus:Highlight;--highcontrast-option-color-focus:HighlightText;--highcontrast-options-checkmark-icon-color-default:Highlight;--highcontrast-options-checkbox-icon-color-default:Highlight;--highcontrast-option-color-disabled:GrayText;--highcontrast-option-focus-indicator-color:Highlight;--highcontrast-option-selected-background-color:Highlight;--highcontrast-option-selected-color:HighlightText}@supports (color:SelectedItem){:host{--highcontrast-option-selected-background-color:SelectedItem;--highcontrast-option-selected-color:SelectedItemText}}}:host{inline-size:auto;inline-size:var(--luzmo-options-inline-size,auto);box-sizing:border-box;max-height:var(--luzmo-options-max-height,var(--options-max-height));margin:0;padding:0;list-style-type:none;display:inline-block;overflow:auto}:host::-webkit-scrollbar{width:var(--luzmo-options-scrollbar-width,var(--options-scrollbar-width));height:var(--luzmo-options-scrollbar-width,var(--options-scrollbar-width))}:host::-webkit-scrollbar-track{background:var(--luzmo-options-scrollbar-track-background,var(--options-scrollbar-track-background));border-radius:var(--luzmo-options-scrollbar-track-border-radius,var(--options-scrollbar-track-border-radius))}:host::-webkit-scrollbar-thumb{background:var(--luzmo-options-scrollbar-thumb-background,var(--options-scrollbar-thumb-background));border-radius:var(--luzmo-options-scrollbar-thumb-border-radius,var(--options-scrollbar-thumb-border-radius))}:host::-webkit-scrollbar-thumb:hover{background:var(--luzmo-options-scrollbar-thumb-hover-background,var(--options-scrollbar-thumb-hover-background))}:host{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-options-scrollbar-thumb-background,var(--options-scrollbar-thumb-background)) var(--luzmo-options-scrollbar-track-background,var(--options-scrollbar-track-background))}:host:lang(ja),:host:lang(ko),:host:lang(zh){--option-label-line-height:var(--luzmo-option-label-line-height-cjk,var(--option-label-line-height-cjk));--option-description-line-height:var(--luzmo-option-description-line-height-cjk,var(--option-description-line-height-cjk));--options-section-header-line-height:var(--luzmo-options-section-header-line-height-cjk,var(--options-section-header-line-height-cjk))}luzmo-option{width:100%}.section-header{align-items:center;gap:var(--option-label-text-to-visual);box-sizing:border-box;min-inline-size:var(--options-section-header-min-width);padding-block:var(--option-top-edge-to-text) var(--option-bottom-edge-to-text);padding-inline:var(--option-label-inline-edge-to-content);font-family:var(--luzmo-font-family);font-size:var(--luzmo-options-section-header-font-size,var(--options-section-header-font-size));font-weight:var(--luzmo-options-section-header-font-weight,var(--options-section-header-font-weight));line-height:var(--luzmo-options-section-header-line-height,var(--options-section-header-line-height));color:var(--luzmo-options-section-header-color,var(--options-section-header-color));flex-shrink:0;display:flex}.section-header-label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#pending{height:var(--options-pending-height);padding-inline:var(--pending-inline-edge-to-content);flex-shrink:0;align-items:center;display:flex}:host{flex-direction:column;width:100%;display:inline-flex}:host(:focus){outline:none}::slotted(*){flex-shrink:0}`;customElements.get(`lit-virtualizer`)||customElements.define(`lit-virtualizer`,m.LitVirtualizer);var w=e=>l.html`
|
|
42
|
+
<luzmo-icon
|
|
43
|
+
block
|
|
44
|
+
.icon=${d.luzmoAngleRight}
|
|
45
|
+
style="transition: transform var(--luzmo-animation-duration, 130ms) ease; transform: rotate(${e?`90deg`:`0deg`})"
|
|
46
|
+
></luzmo-icon>
|
|
47
|
+
`;function T(e){return typeof e==`object`&&(!!e?.header||!!e?.divider)}var E=25;function D(e,t){return!!t&&(e===t||e.contains(t))}var O=class extends t.n(e.n,{noDefaultSize:!0}){static get styles(){return[(0,l.unsafeCSS)(C)]}get _flattenedOptions(){let e=[];for(let t of this.options)if(e.push(t),t.children?.length&&t.value!==void 0&&this._expandedValues.has(t.value))for(let n of t.children)e.push({...n,_isChild:!0,_parentValue:t.value});return e}get _flatVirtualizeActive(){let e=this.options.length;for(let t of this.options)t.children?.length&&(e+=t.children.length);return e>25}toggleExpand(e){let t=e.value;if(t===void 0)return;let n=new Set(this._expandedValues);n.has(t)?n.delete(t):n.add(t),this._expandedValues=n}constructor(){super(),this.label=``,this.variant=`highlight`,this.selects=`single`,this.emphasized=!1,this.pending=!1,this.options=[],this.value=[],this.focusedOptionIndex=0,this._selectedOptions=[],this._firstVisibleIndex=0,this._expandedValues=new Set,this.addEventListener(`focusin`,this.handleFocusin),this.addEventListener(`blur`,this.handleBlur)}firstUpdated(e){super.firstUpdated(e),this.hasAttribute(`tabindex`)||(this.tabIndex=0);let t=[new Promise(e=>requestAnimationFrame(()=>e(!0)))];[...this.children].forEach(e=>{e.localName===`luzmo-option`&&t.push(e.updateComplete)}),this.optionElementsUpdated=Promise.all(t)}willUpdate(e){e.has(`selects`)&&this.selects===`single`&&this.value?.length>1&&(this.value=this.value.slice(0,1))}updated(e){super.updated(e),e.has(`label`)&&(this.label||e.get(`label`)!==void 0)&&(this.label?this.setAttribute(`aria-label`,this.label):this.removeAttribute(`aria-label`)),e.has(`pending`)&&(this.pending?this.setAttribute(`aria-busy`,`true`):this.removeAttribute(`aria-busy`))}async getUpdateComplete(){let e=await super.getUpdateComplete();return await this.optionElementsUpdated,e}focus({preventScroll:e}={}){super.focus({preventScroll:e}),this.focusOptionByOffset(0)}_removeFocusedPropertyOnOptions(){requestAnimationFrame(()=>{this._focusedOption=void 0,this.visibleOptionElements.forEach(e=>{e.focused=!1})})}scrollToTop(){this.scrollTop=0}handleFocusin(){this.startListeningToKeyboard()}handleBlur(e){D(this,e.relatedTarget)||(this.stopListeningToKeyboard(),this._removeFocusedPropertyOnOptions(),this.removeAttribute(`aria-activedescendant`))}startListeningToKeyboard(){this.addEventListener(`keydown`,this.handleKeydown)}stopListeningToKeyboard(){this.removeEventListener(`keydown`,this.handleKeydown)}handleKeydown(e){if(e.defaultPrevented)return;let t=this._flattenedOptions,n=this.focusedOptionIndex,r=[...this.visibleOptionElements].find(e=>e.value?.toString()===t?.[n]?.value?.toString()),{key:i}=e;if(i===`Tab`)this.prepareToCleanUp();else if(i===` `||i===`Enter`){e.preventDefault();let i=t?.[n];r&&i&&(i.children?.length?this.toggleExpand(i):this.toggleOption(e,i))}else(i===`ArrowDown`||i===`ArrowUp`)&&(e.preventDefault(),this.navigateWithinOptions(e,r))}navigateWithinOptions(e,t){let{key:n}=e,r=n===`ArrowDown`?1:-1;e.preventDefault(),e.stopPropagation();let i=this.focusOptionByOffset(r,t,!0);i!==t&&(this._flatVirtualizeActive||i?.scrollIntoView({block:`nearest`}))}focusOptionByOffset(e,t,n){let r=this._flattenedOptions,i=e||1;t&&(t.focused=!1);let a=this.focusedOptionIndex;this.focusedOptionIndex=r.length>0?(r.length+this.focusedOptionIndex+e)%r.length:0;let o=r[this.focusedOptionIndex],s=r.length;for(;(o?.disabled||o?.divider||o?.header)&&s;)--s,this.focusedOptionIndex=(r.length+this.focusedOptionIndex+i)%r.length,o=r[this.focusedOptionIndex];let c=a<this.focusedOptionIndex&&e===-1,l=a>this.focusedOptionIndex&&e===1;(c||l)&&(this.focusedOptionIndex=a,this.dispatchEvent(new Event(`luzmo-exceeded-${c?`top`:`bottom`}`,{bubbles:!0,composed:!0,cancelable:!0})));let u;return n&&this._flatVirtualizeActive&&(u=[...this.visibleOptionElements].find(e=>e.value?.toString()===r[this.focusedOptionIndex]?.value?.toString()),u||(this.focusedOptionIndex=this._firstVisibleIndex)),this._flatVirtualizeActive&&n&&this.virtualizer.element(this.focusedOptionIndex)?.scrollIntoView({behavior:`smooth`,block:`nearest`}),u??=[...this.visibleOptionElements].find(e=>(e.value===null?null:e.value?.toString())===(r[this.focusedOptionIndex]?.value===null?r[this.focusedOptionIndex]?.value:r[this.focusedOptionIndex]?.value?.toString())),o?.disabled||this.setFocusedAndActiveDescendant(u),u}updateSelectedItemIndex(){this.focusedOptionIndex=this._flatVirtualizeActive?this._firstVisibleIndex:0}setSelectedOptionsFromValue(){this._selectedOptions=this.options.filter(e=>Array.isArray(this.value)&&this.value?.includes(e?.value??null))}visibilityChanged(e){this._firstVisibleIndex=e?.first??0}rangeChange(e){e.stopPropagation(),e.preventDefault(),e?.first!==-1&&e?.last!==-1&&this.dispatchEvent(new CustomEvent(`luzmo-scrolled`,{bubbles:!0,composed:!0,cancelable:!0,detail:{first:e.first,last:e.last}}))}async toggleOption(e,t){let n=e instanceof KeyboardEvent;n||(this._focusedOption=void 0);let r=this._flattenedOptions.findIndex(e=>e?.value===t?.value);this.focusedOptionIndex=r,this.visibleOptionElements.forEach(e=>{if(n){let n=(e?.value===null?null:e.value?.toString())===(t?.value===null?null:t?.value?.toString());e.focused=n,n&&this.setFocusedAndActiveDescendant(e)}else e.focused=!1});let i=Array.isArray(this.value)&&this.value?.includes(t?.value??null);this.selects===`single`?(this.value=[t?.value],this._selectedOptions=[t]):(this.value=i?this.value.filter(e=>e!==t?.value):[...this.value??[],t?.value],this._selectedOptions=i?this._selectedOptions.filter(e=>e.value!==t.value):[...this._selectedOptions,t]),await this.updateComplete,this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}})),this.prepareToCleanUp()}handleOptionClick(e,t){this.toggleOption(t,e)}handleExpandClick(e){this.toggleExpand(e)}render(){let e=e=>l.html`<luzmo-icon
|
|
48
|
+
slot="icon"
|
|
49
|
+
.icon=${e}
|
|
50
|
+
.size=${this.size}
|
|
51
|
+
></luzmo-icon>`,t=e=>l.html`<span slot="description">${e}</span>`,n=e=>l.html`<luzmo-icon
|
|
52
|
+
slot="icon"
|
|
53
|
+
data-option-thumbnail
|
|
54
|
+
.src=${e}
|
|
55
|
+
.size=${this.size}
|
|
56
|
+
></luzmo-icon>`,r=r=>{let i=r?.value,a=r?.label,o=r?.description,s=r?.shortcut,c=r?.icon,u=r?.imgSrc,d=r?.divider,p=typeof r==`string`?void 0:r?.disabled,m=!!(r.children&&r.children.length>0),h=!!r._isChild,g=m&&i!==void 0&&this._expandedValues.has(i),_=!m&&Array.isArray(this.value)&&this.value.includes(i);if(d)return l.html`<luzmo-options-divider
|
|
57
|
+
role="presentation"
|
|
58
|
+
></luzmo-options-divider>`;let v=r.header?void 0:this.renderOption?.(r,{selected:_,focused:this._focusedOption?.value===i&&!!this._focusedOption,disabled:!!p,expanded:g,size:this.size??`m`}),y=(v==null?this.optionIconRenderer?.(r,{size:this.size??`m`}):void 0)??(c?e(c):u?n(u):l.nothing);if(r?.header)return l.html`<div class="section-header" role="presentation">
|
|
59
|
+
${y}
|
|
60
|
+
<span class="section-header-label">${a}</span>
|
|
61
|
+
</div>`;let b=v??l.html`
|
|
62
|
+
${y} ${a}
|
|
63
|
+
${o?t(o):l.nothing}
|
|
64
|
+
${!m&&s?l.html`<kbd slot="value">${s}</kbd>`:l.nothing}
|
|
65
|
+
`;if(m){let e=Array.isArray(this.value)&&r.children.some(e=>this.value.includes(e.value));return l.html`<luzmo-option
|
|
66
|
+
.value=${i}
|
|
67
|
+
.size=${this.size}
|
|
68
|
+
.variant=${this.variant}
|
|
69
|
+
?emphasized=${this.emphasized}
|
|
70
|
+
?no-wrap=${this.noWrap}
|
|
71
|
+
?disabled=${p}
|
|
72
|
+
expandable
|
|
73
|
+
?expanded=${g}
|
|
74
|
+
?has-selected-child=${e}
|
|
75
|
+
.selected=${!1}
|
|
76
|
+
role="option"
|
|
77
|
+
aria-expanded=${g?`true`:`false`}
|
|
78
|
+
aria-label=${(0,f.ifDefined)(v==null?void 0:a)}
|
|
79
|
+
aria-description=${(0,f.ifDefined)(v==null?void 0:o)}
|
|
80
|
+
@click=${e=>{e.stopPropagation(),this.handleExpandClick(r)}}
|
|
81
|
+
>
|
|
82
|
+
${b}
|
|
83
|
+
<span slot="value">${w(g)}</span>
|
|
84
|
+
</luzmo-option>`}return l.html`<luzmo-option
|
|
85
|
+
.value=${i}
|
|
86
|
+
.size=${this.size}
|
|
87
|
+
.variant=${this.variant}
|
|
88
|
+
?emphasized=${this.emphasized}
|
|
89
|
+
?no-wrap=${this.noWrap}
|
|
90
|
+
?disabled=${p}
|
|
91
|
+
?child-option=${h}
|
|
92
|
+
.selected=${_}
|
|
93
|
+
.role=${this.selects===`single`?`option`:`optioncheckbox`}
|
|
94
|
+
aria-label=${(0,f.ifDefined)(v==null?void 0:a)}
|
|
95
|
+
aria-description=${(0,f.ifDefined)(v==null?void 0:o)}
|
|
96
|
+
@click=${this.handleOptionClick.bind(this,r)}
|
|
97
|
+
>
|
|
98
|
+
${b}
|
|
99
|
+
</luzmo-option>`},i=this._flattenedOptions,a=this._flatVirtualizeActive?l.html`<lit-virtualizer
|
|
100
|
+
role="presentation"
|
|
101
|
+
.items=${i}
|
|
102
|
+
.renderItem=${r}
|
|
103
|
+
@rangeChanged=${this.rangeChange}
|
|
104
|
+
@visibilityChanged=${this.visibilityChanged}
|
|
105
|
+
></lit-virtualizer>`:(0,h.repeat)(i,r),o=this.pending?l.html`<div id="pending" aria-hidden="true">
|
|
106
|
+
<luzmo-progress-circle
|
|
107
|
+
indeterminate
|
|
108
|
+
label="Loading"
|
|
109
|
+
></luzmo-progress-circle>
|
|
110
|
+
</div>`:l.nothing;return l.html`${a} ${o}`}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`listbox`),this.updateComplete.then(()=>this.updateItemFocus())}disconnectedCallback(){super.disconnectedCallback()}prepareToCleanUp(){document.addEventListener(`focusout`,()=>{requestAnimationFrame(()=>{this.updateSelectedItemIndex()})},{once:!0})}updateItemFocus(){if(this.visibleOptionElements.length===0)return;let e=this._flattenedOptions,t=this.focusedOptionIndex,n=[...this.visibleOptionElements].find(n=>(n.value===null?null:n.value?.toString())===(e?.[t]?.value===null?null:e?.[t]?.value?.toString()));this.setFocusedAndActiveDescendant(n)}setFocusedAndActiveDescendant(e){if(!e)return;let t=this.hasVisibleFocusInTree()||!!(this.visibleOptionElements?.some&&this.visibleOptionElements?.some(e=>e.hasVisibleFocusInTree()));e.focused=t,this._focusedOption=t?e:void 0,t&&this.setAttribute(`aria-activedescendant`,e.id)}};e.t([(0,u.property)({type:String,reflect:!0})],O.prototype,`label`,void 0),e.t([(0,u.property)({type:String,reflect:!0})],O.prototype,`variant`,void 0),e.t([(0,u.property)({type:String,reflect:!0})],O.prototype,`selects`,void 0),e.t([(0,u.property)({type:Boolean,reflect:!0})],O.prototype,`emphasized`,void 0),e.t([(0,u.property)({type:Boolean,reflect:!0})],O.prototype,`pending`,void 0),e.t([(0,u.property)({type:Array,hasChanged(e,t){return JSON.stringify(e??[])!==JSON.stringify(t??[])}})],O.prototype,`options`,void 0),e.t([(0,u.property)({type:Boolean,reflect:!0,attribute:`no-wrap`})],O.prototype,`noWrap`,void 0),e.t([(0,u.property)({type:Array,hasChanged(e,t){return JSON.stringify(e??[])!==JSON.stringify(t??[])}})],O.prototype,`value`,void 0),e.t([(0,u.property)({attribute:!1})],O.prototype,`optionIconRenderer`,void 0),e.t([c.n({slot:`option`,context:[`option`,`ctx`],implicit:`option`})],O.prototype,`renderOption`,void 0),e.t([(0,u.query)(`lit-virtualizer`)],O.prototype,`virtualizer`,void 0),e.t([(0,u.queryAll)(`luzmo-option`)],O.prototype,`visibleOptionElements`,void 0),e.t([(0,u.state)()],O.prototype,`_focusedOption`,void 0),e.t([(0,u.state)()],O.prototype,`_expandedValues`,void 0),customElements.get(`luzmo-options`)||customElements.define(`luzmo-options`,O),customElements.get(`luzmo-options-divider`)||customElements.define(`luzmo-options-divider`,S),customElements.get(`luzmo-option`)||customElements.define(`luzmo-option`,b),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return O}});
|