igniteui-webcomponents 7.2.2 → 7.2.3
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/CHANGELOG.md +9 -0
- package/components/chat/types.js.map +1 -1
- package/components/combo/combo.d.ts +0 -4
- package/components/combo/combo.js.map +1 -1
- package/components/combo/types.d.ts +4 -0
- package/components/combo/types.js.map +1 -1
- package/components/common/context.d.ts +2 -0
- package/components/common/context.js.map +1 -1
- package/components/common/controllers/drag.d.ts +10 -0
- package/components/common/controllers/drag.js +11 -0
- package/components/common/controllers/drag.js.map +1 -1
- package/components/date-range-picker/date-range-mask-parser.d.ts +11 -2
- package/components/date-range-picker/date-range-mask-parser.js.map +1 -1
- package/components/date-time-input/date-part.js.map +1 -1
- package/components/popover/popover.d.ts +10 -1
- package/components/popover/popover.js +31 -14
- package/components/popover/popover.js.map +1 -1
- package/components/popover/themes/light/popover.base.css.js +1 -1
- package/components/popover/themes/light/popover.base.css.js.map +1 -1
- package/components/tile-manager/tile-manager.d.ts +11 -0
- package/components/tile-manager/tile-manager.js +15 -0
- package/components/tile-manager/tile-manager.js.map +1 -1
- package/components/tile-manager/tile.js +1 -1
- package/components/tile-manager/tile.js.map +1 -1
- package/custom-elements.json +29 -52
- package/index.d.ts +6 -2
- package/index.js +3 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/themes/dark/indigo.css +1 -1
- package/themes/light/indigo.css +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [7.2.3] - 2026-06-18
|
|
8
|
+
### Fixed
|
|
9
|
+
- #### Popover based components
|
|
10
|
+
- Popover reposition jitter in `position: sticky` ancestors [#2256](https://github.com/IgniteUI/igniteui-webcomponents/pull/2256)
|
|
11
|
+
- #### Tile Manager
|
|
12
|
+
- Text selection in Safari during drag operations [#2257](https://github.com/IgniteUI/igniteui-webcomponents/pull/2257)
|
|
13
|
+
- Tile manager height collapse when a spanning tile is maximized [#2257](https://github.com/IgniteUI/igniteui-webcomponents/pull/2257)
|
|
14
|
+
|
|
7
15
|
## [7.2.2] - 2026-06-15
|
|
8
16
|
### Changed
|
|
9
17
|
- #### AI-Assisted Development
|
|
@@ -1370,6 +1378,7 @@ Initial release of Ignite UI Web Components
|
|
|
1370
1378
|
- Ripple component
|
|
1371
1379
|
- Switch component
|
|
1372
1380
|
|
|
1381
|
+
[7.2.3]: https://github.com/IgniteUI/igniteui-webcomponents/compare/7.2.2...7.2.3
|
|
1373
1382
|
[7.2.2]: https://github.com/IgniteUI/igniteui-webcomponents/compare/7.2.1...7.2.2
|
|
1374
1383
|
[7.2.1]: https://github.com/IgniteUI/igniteui-webcomponents/compare/7.2.0...7.2.1
|
|
1375
1384
|
[7.2.0]: https://github.com/IgniteUI/igniteui-webcomponents/compare/7.1.3...7.2.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/chat/types.ts"],"names":[],"mappings":"","sourcesContent":["import type IgcChatComponent from './chat.js';\n\n/* jsonAPIPlainObject */\n/* marshalByValue */\n/* skipEventDetails */\n/**\n * Represents a single chat message in the conversation.\n */\nexport interface IgcChatMessage {\n /**\n * A unique identifier for the message.\n */\n id: string;\n\n /**\n * The textual content of the message.\n */\n text: string;\n\n /**\n * The identifier or name of the sender of the message.\n */\n sender: string;\n\n /**\n * The timestamp indicating when the message was sent.\n */\n timestamp?: string;\n\n /**\n * Optional list of attachments associated with the message,\n * such as images, files, or links.\n */\n attachments?: IgcChatMessageAttachment[];\n\n /**\n * Optional list of reactions associated with the message.\n */\n reactions?: string[];\n}\n\n/* jsonAPIPlainObject */\n/* skipEventDetails */\n/* marshalByValue */\n/**\n * Represents an attachment associated with a chat message.\n */\nexport interface IgcChatMessageAttachment {\n /**\n * A unique identifier for the attachment.\n */\n id: string;\n\n /**\n * The display name of the attachment (e.g. file name).\n */\n name: string;\n\n /**\n * The URL from which the attachment can be downloaded or viewed.\n * Typically used for attachments stored on a server or CDN.\n */\n url?: string;\n\n /* blazorSuppress */\n /**\n * The actual File object, if the attachment was provided locally (e.g. via upload).\n */\n file?: File;\n\n /* blazorAlternateName: attachmentType */\n /**\n * The MIME type or a custom type identifier for the attachment (e.g. \"image/png\", \"pdf\", \"audio\").\n */\n type?: string;\n\n /**\n * Optional URL to a thumbnail preview of the attachment (e.g. for images or videos).\n */\n thumbnail?: string;\n}\n\n/* jsonAPIPlainObject */\n/**\n * Configuration options for customizing the behavior and appearance of the chat component.\n */\nexport interface IgcChatOptions {\n /**\n * The ID of the current user. Used to differentiate between incoming and outgoing messages.\n */\n currentUserId?: string;\n /**\n * If `true`, prevents the chat from automatically scrolling to the latest message.\n */\n disableAutoScroll?: boolean;\n /**\n * If `true`, disables the ability to upload and send attachments.\n * Defaults to `false`.\n */\n disableInputAttachments?: boolean;\n /**\n * Indicates whether the other user is currently typing a message.\n */\n isTyping?: boolean;\n /**\n * The accepted files that could be attached.\n * Defines the file types as a list of comma-separated values (e.g. \"image/*,.pdf\") that the file input should accept.\n */\n acceptedFiles?: string;\n /**\n * Optional header text to display at the top of the chat component.\n */\n headerText?: string;\n /**\n * Optional placeholder text for the chat input area.\n * Provides a hint to the user about what they can type (e.g. \"Type a message...\").\n */\n inputPlaceholder?: string;\n /**\n * Suggested text snippets or quick replies that can be shown as user-selectable options.\n */\n suggestions?: string[];\n /**\n * Controls the position of the chat suggestions within the component layout.\n *\n * - `\"below-input\"`: Renders suggestions below the chat input area.\n * - `\"below-messages\"`: Renders suggestions below the chat messages area.\n *\n * Default is `\"below-messages\"`.\n */\n suggestionsPosition?: ChatSuggestionsPosition;\n /**\n * Time in milliseconds to wait before dispatching a stop typing event.\n * Default is `3000`.\n */\n stopTypingDelay?: number;\n\n /**\n * A boolean flag that, when `true`, enables a **quick and dirty workaround** for styling\n * components rendered within the Shadow DOM, from custom message renderers, by allowing them\n * to inherit styles from the document's root. This can be useful for developers who prefer not to handle\n * Shadow DOM encapsulation, but it is **not the recommended approach**.\n *\n * It is highly advised to use standard Web Component styling methods first, in this order:\n *\n * 1. **CSS Variables and Parts API**: Use the exposed `::part` API with custom CSS variables to style\n * your content in your custom renderers.\n *\n * 2. **`link` elements**: For larger style sheets, link them directly within the Shadow DOM to maintain\n * encapsulation.\n *\n * 3. **Inline `<style>` tags**: Use these for small, self-contained styles within a template.\n *\n * This property should be used as a **last resort** as it can lead to **style leakage**, where\n * global styles unexpectedly bleed into the component, breaking encapsulation and causing\n * unpredictable visual issues.\n *\n */\n adoptRootStyles?: boolean;\n\n /**\n * An object containing a collection of custom renderers for different parts of the chat UI.\n */\n renderers?: ChatRenderers;\n}\n\n/* jsonAPIPlainObject */\n/* marshalByValue */\n/**\n * Represents a draft message that is being composed by the user, including the text and any attachments.\n */\nexport interface IgcChatDraftMessage {\n /**\n * The textual content of the draft message.\n */\n text: string;\n /**\n * An array of attachments associated with the draft message.\n */\n attachments?: IgcChatMessageAttachment[];\n}\n\n/* jsonAPIPlainObject */\n/* skipEventDetails */\n/* marshalByValue */\n/**\n * Represents a user's reaction to a specific chat message.\n */\nexport interface IgcChatMessageReaction {\n /**\n * The chat message that the reaction is associated with.\n */\n message: IgcChatMessage;\n /**\n * The string representation of the reaction, such as an emoji or a string;\n */\n reaction: string;\n}\n\n/* blazorSuppress */\n/**\n * @ignore\n * A collection of optional rendering functions that allow for custom UI rendering.\n * Each property is a function that takes a context object and returns a template result.\n */\nexport interface ChatRenderers {\n /**\n * Custom renderer for a single chat message attachment.\n */\n attachment?: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n /**\n * Custom renderer for the content of an attachment.\n */\n attachmentContent?: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n /**\n * Custom renderer for the header of an attachment.\n */\n attachmentHeader?: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n /**\n * Custom renderer for the file upload button in the input area.\n */\n fileUploadButton?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the main chat input field.\n */\n input?: ChatTemplateRenderer<ChatInputRenderContext>;\n /**\n * Custom renderer for the actions container within the input area.\n */\n inputActions?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the actions at the end of the input area.\n */\n inputActionsEnd?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the actions at the start of the input area.\n */\n inputActionsStart?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the attachment previews within the input field.\n */\n inputAttachments?: ChatTemplateRenderer<ChatInputRenderContext>;\n /**\n * Custom renderer for an entire chat message bubble.\n */\n message?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for message-specific actions (e.g., reply or delete buttons).\n */\n messageActions?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for the attachments associated with a message.\n */\n messageAttachments?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for the main text and content of a message.\n */\n messageContent?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for the header of a message, including sender and timestamp.\n */\n messageHeader?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for the message send button.\n */\n sendButton?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the prefix text shown before suggestions.\n */\n suggestionPrefix?: ChatTemplateRenderer<ChatRenderContext>;\n}\n\n/* blazorSuppress */\n/**\n * A generic type for a function that serves as a custom renderer.\n * It takes a context object of type T and returns a template result.\n */\nexport type ChatTemplateRenderer<T> = (ctx: T) => unknown;\n\n/**\n * A string literal type defining the two possible positions for chat suggestions.\n */\nexport type ChatSuggestionsPosition = 'below-input' | 'below-messages';\n\n/* jsonAPIPlainObject */\n/**\n * The base context object passed to custom renderer functions, containing the chat component instance.\n */\nexport interface ChatRenderContext {\n /**\n * The instance of the IgcChatComponent.\n */\n instance: IgcChatComponent;\n}\n\n/* jsonAPIPlainObject */\n/**\n * The context object for renderers that deal with the chat input area.\n * It extends the base context with input-specific properties.\n */\nexport interface ChatInputRenderContext extends ChatRenderContext {\n /* blazorSuppress */\n /**\n * The list of attachments currently in the input area.\n */\n attachments: IgcChatMessageAttachment[];\n /**\n * The current value of the input field.\n */\n value: string;\n}\n\n/* jsonAPIPlainObject */\n/**\n * The context object for renderers that deal with a specific chat message.\n * It extends the base context with the message data.\n */\nexport interface ChatMessageRenderContext extends ChatRenderContext {\n /**\n * The specific chat message being rendered.\n */\n message: IgcChatMessage;\n}\n\n/* jsonAPIPlainObject */\n/**\n * The context object for renderers that deal with a specific attachment within a message.\n * It extends the message context with the attachment data.\n */\nexport interface ChatAttachmentRenderContext extends ChatMessageRenderContext {\n /**\n * The specific attachment being rendered.\n */\n attachment: IgcChatMessageAttachment;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/chat/types.ts"],"names":[],"mappings":"","sourcesContent":["import type IgcChatComponent from './chat.js';\n\n/* jsonAPIPlainObject */\n/* marshalByValue */\n/* skipEventDetails */\n/**\n * Represents a single chat message in the conversation.\n */\nexport interface IgcChatMessage {\n /**\n * A unique identifier for the message.\n */\n id: string;\n\n /**\n * The textual content of the message.\n */\n text: string;\n\n /**\n * The identifier or name of the sender of the message.\n */\n sender: string;\n\n /**\n * The timestamp indicating when the message was sent.\n */\n timestamp?: string;\n\n /**\n * Optional list of attachments associated with the message,\n * such as images, files, or links.\n */\n attachments?: IgcChatMessageAttachment[];\n\n /**\n * Optional list of reactions associated with the message.\n */\n reactions?: string[];\n}\n\n/* jsonAPIPlainObject */\n/* skipEventDetails */\n/* marshalByValue */\n/**\n * Represents an attachment associated with a chat message.\n */\nexport interface IgcChatMessageAttachment {\n /**\n * A unique identifier for the attachment.\n */\n id: string;\n\n /**\n * The display name of the attachment (e.g. file name).\n */\n name: string;\n\n /**\n * The URL from which the attachment can be downloaded or viewed.\n * Typically used for attachments stored on a server or CDN.\n */\n url?: string;\n\n /* blazorSuppress */\n /**\n * The actual File object, if the attachment was provided locally (e.g. via upload).\n */\n file?: File;\n\n /* blazorAlternateName: attachmentType */\n /**\n * The MIME type or a custom type identifier for the attachment (e.g. \"image/png\", \"pdf\", \"audio\").\n */\n type?: string;\n\n /**\n * Optional URL to a thumbnail preview of the attachment (e.g. for images or videos).\n */\n thumbnail?: string;\n}\n\n/* jsonAPIPlainObject */\n/**\n * Configuration options for customizing the behavior and appearance of the chat component.\n */\nexport interface IgcChatOptions {\n /**\n * The ID of the current user. Used to differentiate between incoming and outgoing messages.\n */\n currentUserId?: string;\n /**\n * If `true`, prevents the chat from automatically scrolling to the latest message.\n */\n disableAutoScroll?: boolean;\n /**\n * If `true`, disables the ability to upload and send attachments.\n * Defaults to `false`.\n */\n disableInputAttachments?: boolean;\n /**\n * Indicates whether the other user is currently typing a message.\n */\n isTyping?: boolean;\n /* blazorSuppress */\n /**\n * The accepted files that could be attached.\n * Defines the file types as a list of comma-separated values (e.g. \"image/*,.pdf\") that the file input should accept.\n */\n acceptedFiles?: string;\n /**\n * Optional header text to display at the top of the chat component.\n */\n headerText?: string;\n /**\n * Optional placeholder text for the chat input area.\n * Provides a hint to the user about what they can type (e.g. \"Type a message...\").\n */\n inputPlaceholder?: string;\n /**\n * Suggested text snippets or quick replies that can be shown as user-selectable options.\n */\n suggestions?: string[];\n /**\n * Controls the position of the chat suggestions within the component layout.\n *\n * - `\"below-input\"`: Renders suggestions below the chat input area.\n * - `\"below-messages\"`: Renders suggestions below the chat messages area.\n *\n * Default is `\"below-messages\"`.\n */\n suggestionsPosition?: ChatSuggestionsPosition;\n /**\n * Time in milliseconds to wait before dispatching a stop typing event.\n * Default is `3000`.\n */\n stopTypingDelay?: number;\n\n /**\n * A boolean flag that, when `true`, enables a **quick and dirty workaround** for styling\n * components rendered within the Shadow DOM, from custom message renderers, by allowing them\n * to inherit styles from the document's root. This can be useful for developers who prefer not to handle\n * Shadow DOM encapsulation, but it is **not the recommended approach**.\n *\n * It is highly advised to use standard Web Component styling methods first, in this order:\n *\n * 1. **CSS Variables and Parts API**: Use the exposed `::part` API with custom CSS variables to style\n * your content in your custom renderers.\n *\n * 2. **`link` elements**: For larger style sheets, link them directly within the Shadow DOM to maintain\n * encapsulation.\n *\n * 3. **Inline `<style>` tags**: Use these for small, self-contained styles within a template.\n *\n * This property should be used as a **last resort** as it can lead to **style leakage**, where\n * global styles unexpectedly bleed into the component, breaking encapsulation and causing\n * unpredictable visual issues.\n *\n */\n adoptRootStyles?: boolean;\n\n /**\n * An object containing a collection of custom renderers for different parts of the chat UI.\n */\n renderers?: ChatRenderers;\n}\n\n/* jsonAPIPlainObject */\n/* marshalByValue */\n/**\n * Represents a draft message that is being composed by the user, including the text and any attachments.\n */\nexport interface IgcChatDraftMessage {\n /**\n * The textual content of the draft message.\n */\n text: string;\n /**\n * An array of attachments associated with the draft message.\n */\n attachments?: IgcChatMessageAttachment[];\n}\n\n/* jsonAPIPlainObject */\n/* skipEventDetails */\n/* marshalByValue */\n/**\n * Represents a user's reaction to a specific chat message.\n */\nexport interface IgcChatMessageReaction {\n /**\n * The chat message that the reaction is associated with.\n */\n message: IgcChatMessage;\n /**\n * The string representation of the reaction, such as an emoji or a string;\n */\n reaction: string;\n}\n\n/* blazorSuppress */\n/**\n * @ignore\n * A collection of optional rendering functions that allow for custom UI rendering.\n * Each property is a function that takes a context object and returns a template result.\n */\nexport interface ChatRenderers {\n /**\n * Custom renderer for a single chat message attachment.\n */\n attachment?: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n /**\n * Custom renderer for the content of an attachment.\n */\n attachmentContent?: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n /**\n * Custom renderer for the header of an attachment.\n */\n attachmentHeader?: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n /**\n * Custom renderer for the file upload button in the input area.\n */\n fileUploadButton?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the main chat input field.\n */\n input?: ChatTemplateRenderer<ChatInputRenderContext>;\n /**\n * Custom renderer for the actions container within the input area.\n */\n inputActions?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the actions at the end of the input area.\n */\n inputActionsEnd?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the actions at the start of the input area.\n */\n inputActionsStart?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the attachment previews within the input field.\n */\n inputAttachments?: ChatTemplateRenderer<ChatInputRenderContext>;\n /**\n * Custom renderer for an entire chat message bubble.\n */\n message?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for message-specific actions (e.g., reply or delete buttons).\n */\n messageActions?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for the attachments associated with a message.\n */\n messageAttachments?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for the main text and content of a message.\n */\n messageContent?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for the header of a message, including sender and timestamp.\n */\n messageHeader?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for the message send button.\n */\n sendButton?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the prefix text shown before suggestions.\n */\n suggestionPrefix?: ChatTemplateRenderer<ChatRenderContext>;\n}\n\n/* blazorSuppress */\n/**\n * A generic type for a function that serves as a custom renderer.\n * It takes a context object of type T and returns a template result.\n */\nexport type ChatTemplateRenderer<T> = (ctx: T) => unknown;\n\n/**\n * A string literal type defining the two possible positions for chat suggestions.\n */\nexport type ChatSuggestionsPosition = 'below-input' | 'below-messages';\n\n/* jsonAPIPlainObject */\n/**\n * The base context object passed to custom renderer functions, containing the chat component instance.\n */\nexport interface ChatRenderContext {\n /**\n * The instance of the IgcChatComponent.\n */\n instance: IgcChatComponent;\n}\n\n/* jsonAPIPlainObject */\n/**\n * The context object for renderers that deal with the chat input area.\n * It extends the base context with input-specific properties.\n */\nexport interface ChatInputRenderContext extends ChatRenderContext {\n /* blazorSuppress */\n /**\n * The list of attachments currently in the input area.\n */\n attachments: IgcChatMessageAttachment[];\n /**\n * The current value of the input field.\n */\n value: string;\n}\n\n/* jsonAPIPlainObject */\n/**\n * The context object for renderers that deal with a specific chat message.\n * It extends the base context with the message data.\n */\nexport interface ChatMessageRenderContext extends ChatRenderContext {\n /**\n * The specific chat message being rendered.\n */\n message: IgcChatMessage;\n}\n\n/* jsonAPIPlainObject */\n/**\n * The context object for renderers that deal with a specific attachment within a message.\n * It extends the message context with the attachment data.\n */\nexport interface ChatAttachmentRenderContext extends ChatMessageRenderContext {\n /**\n * The specific attachment being rendered.\n */\n attachment: IgcChatMessageAttachment;\n}\n"]}
|
|
@@ -168,10 +168,6 @@ export default class IgcComboComponent<T extends object = any> extends IgcComboC
|
|
|
168
168
|
/**
|
|
169
169
|
* An object that configures the filtering of the combo.
|
|
170
170
|
* @attr filtering-options
|
|
171
|
-
* @type {FilteringOptions<T>}
|
|
172
|
-
* @param filterKey - The key in the data source used when filtering the list of options.
|
|
173
|
-
* @param caseSensitive - Determines whether the filtering operation should be case sensitive.
|
|
174
|
-
* @param matchDiacritics -If true, the filter distinguishes between accented letters and their base letters.
|
|
175
171
|
*/
|
|
176
172
|
set filteringOptions(value: Partial<FilteringOptions<T>>);
|
|
177
173
|
get filteringOptions(): FilteringOptions<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo.js","sourceRoot":"","sources":["../../../src/components/combo/combo.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACL,sBAAsB,GAEvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,OAAO,EAA4C,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8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,SAAS,EAAE,KAAK,EAAE,CAAC;8DAE4B;AAiC3D;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;8CAQzB;AA9ZkB,iBAAiB;IAFrC,4BAA4B,CAAC,qCAAqC,CAAC;IACnE,oBAAoB;GACA,iBAAiB,CAykCrC;eAzkCoB,iBAAiB","sourcesContent":["import {\n ComboResourceStringsEN,\n type IComboResourceStrings,\n} from 'igniteui-i18n-core';\nimport { html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\n\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport { addRootClickController } from '../common/controllers/root-click.js';\nimport { addSlotController, setSlots } from '../common/controllers/slot.js';\nimport { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';\nimport { blazorIndirectRender } from '../common/decorators/blazorIndirectRender.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { addI18nController } from '../common/i18n/i18n-controller.js';\nimport { IgcBaseComboBoxComponent } from '../common/mixins/combo-box.js';\nimport type { AbstractConstructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js';\nimport { createFormValueState } from '../common/mixins/forms/form-value.js';\nimport { partMap } from '../common/part-map.js';\nimport {\n addSafeEventListener,\n asArray,\n bindIf,\n first,\n getElementFromPath,\n isDefined,\n isEmpty,\n stopPropagation,\n} from '../common/util.js';\nimport type { Validator } from '../common/validators.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcInputComponent from '../input/input.js';\nimport IgcPopoverComponent from '../popover/popover.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport IgcComboHeaderComponent from './combo-header.js';\nimport IgcComboItemComponent from './combo-item.js';\nimport IgcComboListComponent from './combo-list.js';\nimport { DataState } from './controllers/data.js';\nimport { ComboNavigationController } from './controllers/navigation.js';\nimport { styles } from './themes/combo.base.css.js';\nimport { styles as shared } from './themes/shared/combo.common.css.js';\nimport { all } from './themes/themes.js';\nimport type {\n ComboItemTemplate,\n ComboRecord,\n ComboRenderFunction,\n ComboValue,\n FilteringOptions,\n GroupingDirection,\n IgcComboChangeEventArgs,\n IgcComboComponentEventMap,\n Item,\n Keys,\n Values,\n} from './types.js';\nimport { comboValidators } from './validators.js';\n\nconst SLOTS = setSlots(\n 'prefix',\n 'suffix',\n 'header',\n 'footer',\n 'empty',\n 'helper-text',\n 'toggle-icon',\n 'clear-icon',\n 'value-missing',\n 'custom-error',\n 'invalid'\n);\n\n/* blazorSupportsVisualChildren */\n/**\n * The Combo component is similar to the Select component in that it provides a list of options from which the user can make a selection.\n * In contrast to the Select component, the Combo component displays all options in a virtualized list of items,\n * meaning the combo box can simultaneously show thousands of options, where one or more options can be selected.\n * Additionally, users can create custom item templates, allowing for robust data visualization.\n * The Combo component features case-sensitive filtering, grouping, complex data binding, dynamic addition of values and more.\n *\n * @element igc-combo\n *\n * @slot prefix - Renders content before the input of the combo.\n * @slot suffix - Renders content after the input of the combo.\n * @slot header - Renders a container before the list of options of the combo.\n * @slot footer - Renders a container after the list of options of the combo.\n * @slot empty - Renders content when the combo dropdown list has no items/data.\n * @slot helper-text - Renders content below the input of the combo.\n * @slot toggle-icon - Renders content inside the suffix container of the combo.\n * @slot clear-icon - Renders content inside the suffix container of the combo.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n *\n * @fires igcChange - Emitted when the control's selection has changed.\n * @fires igcOpening - Emitted just before the list of options is opened.\n * @fires igcOpened - Emitted after the list of options is opened.\n * @fires igcClosing - Emitter just before the list of options is closed.\n * @fires igcClosed - Emitted after the list of options is closed.\n *\n * @csspart label - The encapsulated text label of the combo.\n * @csspart input - The main input field of the combo.\n * @csspart native-input - The native input of the main input field of the combo.\n * @csspart prefix - The prefix wrapper of the combo.\n * @csspart suffix - The suffix wrapper of the combo.\n * @csspart toggle-icon - The toggle icon wrapper of the combo.\n * @csspart clear-icon - The clear icon wrapper of the combo.\n * @csspart case-icon - The case icon wrapper of the combo.\n * @csspart helper-text - The helper text wrapper of the combo.\n * @csspart search-input - The search input field of the combo.\n * @csspart list-wrapper - The list of options wrapper of the combo.\n * @csspart list - The list of options box of the combo.\n * @csspart item - Represents each item in the list of options of the combo.\n * @csspart group-header - Represents each header in the list of options of the combo.\n * @csspart active - Appended to the item parts list when the item is active of the combo.\n * @csspart selected - Appended to the item parts list when the item is selected of the combo.\n * @csspart checkbox - Represents each checkbox of each list item of the combo.\n * @csspart checkbox-indicator - Represents the checkbox indicator of each list item of the combo.\n * @csspart checked - Appended to checkbox parts list when checkbox is checked in the combo.\n * @csspart header - The container holding the header content of the combo.\n * @csspart footer - The container holding the footer content of the combo.\n * @csspart empty - The container holding the empty content of the combo.\n */\n@blazorAdditionalDependencies('IgcIconComponent, IgcInputComponent')\n@blazorIndirectRender\nexport default class IgcComboComponent<\n T extends object = any,\n> extends FormAssociatedRequiredMixin(\n EventEmitterMixin<\n IgcComboComponentEventMap,\n AbstractConstructor<IgcBaseComboBoxComponent>\n >(IgcBaseComboBoxComponent)\n) {\n public static readonly tagName = 'igc-combo';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcComboComponent,\n IgcIconComponent,\n IgcComboListComponent,\n IgcComboItemComponent,\n IgcComboHeaderComponent,\n IgcInputComponent,\n IgcPopoverComponent,\n IgcValidationContainerComponent\n );\n }\n\n // #region Internal state and controllers\n\n protected override get __validators(): Validator<IgcComboComponent<T>>[] {\n return comboValidators;\n }\n\n private readonly _slots = addSlotController(this, { slots: SLOTS });\n\n protected override readonly _rootClickController = addRootClickController(\n this,\n {\n onHide: this._handleClosing,\n }\n );\n\n protected readonly _i18nController = addI18nController<IComboResourceStrings>(\n this,\n {\n defaultEN: ComboResourceStringsEN,\n }\n );\n\n protected override readonly _formValue = createFormValueState<\n ComboValue<T>[]\n >(this, {\n initialValue: [],\n transformers: {\n setValue: asArray,\n setDefaultValue: asArray,\n setFormValue: (value) => {\n if (isEmpty(value) || !this.name) {\n return null;\n }\n\n if (this.singleSelect) {\n return String(first(value));\n }\n\n const formData = new FormData();\n\n for (const item of value) {\n formData.append(this.name, String(item));\n }\n\n return formData;\n },\n },\n });\n\n /** The primary input of the combo component. */\n private readonly _inputRef = createRef<IgcInputComponent>();\n\n /** The search input of the combo component. */\n private readonly _searchRef = createRef<IgcInputComponent>();\n\n /** The combo virtualized dropdown list. */\n private readonly _listRef = createRef<IgcComboListComponent>();\n\n private readonly _state = new DataState<T>(this);\n private readonly _navigation = new ComboNavigationController(\n this,\n this._state,\n {\n input: this._inputRef,\n search: this._searchRef,\n list: this._listRef,\n interactions: {\n show: () => this._show(true),\n hide: () => this._hide(true),\n toggleSelection: (index: number) => this._toggleSelection(index),\n select: (index: number) => this._selectByIndex(index),\n clearSelection: () => this._clearSelection(),\n },\n }\n );\n\n private _data: T[] = [];\n private _valueKey?: Keys<T>;\n private _displayKey?: Keys<T>;\n private _placeholderSearch?: string;\n private _disableFiltering = false;\n private _singleSelect = false;\n private _selected: Set<T> = new Set();\n private _filteringOptions: FilteringOptions<T> = {\n filterKey: this.displayKey,\n caseSensitive: false,\n matchDiacritics: false,\n };\n\n @state()\n private set _activeIndex(index: number) {\n this._navigation.active = index;\n }\n\n private get _activeIndex(): number {\n return this._navigation.active;\n }\n\n @state()\n private set _searchTerm(value: string) {\n this._state.searchTerm = value;\n }\n\n private get _searchTerm(): string {\n return this._state.searchTerm;\n }\n\n @state()\n private _activeDescendant?: string;\n\n @state()\n private _displayValue = '';\n\n private get _mainAriaLabel(): string {\n return isEmpty(this._selected)\n ? this.resourceStrings.combo_aria_label_no_options!\n : this.resourceStrings.combo_aria_label_options!;\n }\n\n // #endregion\n\n //#region Public attributes and properties\n\n /** The data source used to generate the list of options. */\n /* treatAsRef */\n @property({ attribute: false })\n public set data(value: T[]) {\n if (this._data !== value) {\n this._data = asArray(value);\n }\n }\n\n public get data(): T[] {\n return this._data;\n }\n\n /**\n * The outlined attribute of the control.\n * @attr outlined\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public outlined = false;\n\n /**\n * Enables single selection mode and moves item filtering to the main input.\n * @attr single-select\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'single-select' })\n public set singleSelect(value: boolean) {\n this._singleSelect = Boolean(value);\n this._syncSelectionFromValue();\n\n if (this.hasUpdated) {\n const pristine = this._pristine;\n this._activeIndex = -1;\n this._searchTerm = '';\n this._formValue.setValueAndFormState(this.value);\n this._pristine = pristine;\n }\n }\n\n public get singleSelect(): boolean {\n return this._singleSelect;\n }\n\n /**\n * The autofocus attribute of the control.\n * @attr autofocus\n */\n @property({ type: Boolean })\n public override autofocus!: boolean;\n\n /**\n * Focuses the list of options when the menu opens.\n * @attr autofocus-list\n * @default false\n */\n @property({ type: Boolean, attribute: 'autofocus-list' })\n public autofocusList = false;\n\n /**\n * Gets/Sets the locale used for getting language, affecting resource strings.\n * @attr locale\n */\n @property()\n public set locale(value: string) {\n this._i18nController.locale = value;\n this._state.updateLocale(value);\n }\n\n public get locale(): string {\n return this._i18nController.locale;\n }\n\n /**\n * The label attribute of the control.\n * @attr label\n */\n @property()\n public label?: string;\n\n /**\n * The placeholder attribute of the control.\n * @attr placeholder\n */\n @property()\n public placeholder?: string;\n\n /**\n * The placeholder attribute of the search input.\n * @attr placeholder-search\n */\n @property({ attribute: 'placeholder-search' })\n public set placeholderSearch(value: string | undefined) {\n this._placeholderSearch = value;\n }\n\n public get placeholderSearch(): string {\n return (\n this._placeholderSearch ??\n this.resourceStrings.combo_filter_search_placeholder ??\n 'Search'\n );\n }\n\n /**\n * The resource strings for localization.\n */\n @property({ attribute: false })\n public set resourceStrings(value: IComboResourceStrings) {\n this._i18nController.resourceStrings = value;\n }\n\n public get resourceStrings(): IComboResourceStrings {\n return this._i18nController.resourceStrings;\n }\n\n /**\n * The key in the data source used when selecting items.\n * @attr value-key\n */\n @property({ attribute: 'value-key' })\n public set valueKey(value: Keys<T> | undefined) {\n this._valueKey = value;\n this._displayKey = this._displayKey ?? this._valueKey;\n }\n\n public get valueKey() {\n return this._valueKey;\n }\n\n /**\n * The key in the data source used to display items in the list.\n * @attr display-key\n */\n @property({ attribute: 'display-key' })\n public set displayKey(value: Keys<T> | undefined) {\n this._displayKey = value;\n if (!this.filteringOptions.filterKey) {\n this.filteringOptions = { filterKey: this.displayKey };\n }\n }\n\n public get displayKey() {\n return this._displayKey ?? this._valueKey;\n }\n\n /**\n * The key in the data source used to group items in the list.\n * @attr group-key\n */\n @property({ attribute: 'group-key' })\n public groupKey?: Keys<T> | string;\n\n /**\n * Sorts the items in each group by ascending or descending order.\n * @attr group-sorting\n * @default \"asc\"\n * @type {\"asc\" | \"desc\" | \"none\"}\n */\n @property({ attribute: 'group-sorting' })\n public groupSorting: GroupingDirection = 'asc';\n\n /**\n * An object that configures the filtering of the combo.\n * @attr filtering-options\n * @type {FilteringOptions<T>}\n * @param filterKey - The key in the data source used when filtering the list of options.\n * @param caseSensitive - Determines whether the filtering operation should be case sensitive.\n * @param matchDiacritics -If true, the filter distinguishes between accented letters and their base letters.\n */\n @property({ type: Object, attribute: 'filtering-options' })\n public set filteringOptions(value: Partial<FilteringOptions<T>>) {\n this._filteringOptions = { ...this._filteringOptions, ...value };\n }\n\n public get filteringOptions(): FilteringOptions<T> {\n return this._filteringOptions;\n }\n\n /**\n * Enables the case sensitive search icon in the filtering input.\n * @attr case-sensitive-icon\n * @default false\n */\n @property({ type: Boolean, attribute: 'case-sensitive-icon' })\n public caseSensitiveIcon = false;\n\n /**\n * Disables the filtering of the list of options.\n * @attr disable-filtering\n * @default false\n */\n @property({ type: Boolean, attribute: 'disable-filtering' })\n public set disableFiltering(value: boolean) {\n this._disableFiltering = value;\n this._searchTerm = '';\n }\n\n public get disableFiltering(): boolean {\n return this._disableFiltering;\n }\n\n /**\n * Hides the clear button.\n * @attr disable-clear\n * @default false\n */\n @property({ type: Boolean, attribute: 'disable-clear' })\n public disableClear = false;\n\n /* blazorSuppress */\n /**\n * The template used for the content of each combo item.\n * @type {ComboItemTemplate<T>}\n */\n @property({ attribute: false })\n public itemTemplate: ComboItemTemplate<T> = ({ item }) =>\n html`${this.displayKey ? item[this.displayKey] : item}`;\n\n /* blazorSuppress */\n /**\n * The template used for the content of each combo group header.\n * @type {ComboItemTemplate<T>}\n */\n @property({ attribute: false })\n public groupHeaderTemplate: ComboItemTemplate<T> = ({ item }) =>\n html`${this.groupKey && item[this.groupKey as Keys<T>]}`;\n\n /**\n * Sets the value (selected items). The passed value must be a valid JSON array.\n * If the data source is an array of complex objects, the `valueKey` attribute must be set.\n * Note that when `displayKey` is not explicitly set, it will fall back to the value of `valueKey`.\n *\n * @attr value\n *\n * @example\n * ```tsx\n * <igc-combo\n * .data=${[\n * {\n * id: 'BG01',\n * name: 'Sofia'\n * },\n * {\n * id: 'BG02',\n * name: 'Plovdiv'\n * }\n * ]}\n * display-key='name'\n * value-key='id'\n * value='[\"BG01\", \"BG02\"]'>\n * </igc-combo>\n * ```\n */\n /* blazorPrimitiveValue */\n /* blazorByValueArray */\n /* blazorGenericType */\n /* @tsTwoWayProperty (true, \"Change\", \"Detail.NewValue\", false) */\n @property({ type: Array })\n public set value(items: ComboValue<T>[]) {\n this._formValue.setValueAndFormState(items);\n this._syncSelectionFromValue();\n\n if (this.hasUpdated) {\n this._validate();\n }\n }\n\n /**\n * Returns the current selection as a list of comma separated values,\n * represented by the value key, when provided.\n */\n public get value(): ComboValue<T>[] {\n return this._formValue.value;\n }\n\n /**\n * Returns the current selection as an array of objects as provided in the `data` source.\n */\n public get selection(): T[] {\n return Array.from(this._selected);\n }\n\n //#endregion\n\n //#region Life-cycle\n\n constructor() {\n super();\n\n addThemingController(this, all);\n addSafeEventListener(this, 'blur', this._handleBlur);\n addSafeEventListener(this, 'focusin', this._handleFocusIn);\n }\n\n protected override willUpdate(props: PropertyValues<this>): void {\n if (props.has('open')) {\n this._rootClickController.update();\n }\n\n if (\n props.has('groupKey') ||\n props.has('groupSorting') ||\n props.has('filteringOptions') ||\n props.has('data')\n ) {\n this._state.invalidate();\n }\n\n // When data changes, re-sync selection and form\n // This handles the delayed data scenario where value was set before data\n if (props.has('data') && !isEmpty(this.data) && !isEmpty(this.value)) {\n const pristine = this._pristine;\n this._syncSelectionFromValue();\n this._formValue.setValueAndFormState(this.value);\n this._pristine = pristine;\n }\n }\n\n //#endregion\n\n // #region Form Associated overrides\n\n protected override _restoreDefaultValue(): void {\n super._restoreDefaultValue();\n this._syncSelectionFromValue();\n }\n\n protected override _setDefaultValue(current: string | null): void {\n try {\n this.defaultValue = JSON.parse(current || '[]');\n } catch {}\n }\n\n // #endregion\n\n //#region Overrides for combo box behavior\n\n protected override async _show(emitEvent = false): Promise<boolean> {\n const [canOpen, _] = await Promise.all([\n super._show(emitEvent),\n this.updateComplete,\n ]);\n\n if (canOpen) {\n if (!this.singleSelect) {\n this._listRef.value?.focus();\n }\n\n if (!this.autofocusList) {\n this._searchRef.value?.focus();\n }\n }\n\n return canOpen;\n }\n\n protected override async _hide(emitEvent = false): Promise<boolean> {\n const [canClose, _] = await Promise.all([\n super._hide(emitEvent),\n this.updateComplete,\n ]);\n\n if (canClose) {\n this._activeIndex = -1;\n }\n\n return canClose;\n }\n\n private _setSingleSelectionDisplayValue(value: string): void {\n if (this.singleSelect && this._inputRef.value) {\n this._inputRef.value.value = value;\n }\n }\n\n //#endregion\n\n // #region Selection helpers\n\n /**\n * Resolves user-provided items (value keys or object references)\n * to actual objects from the data source in a single pass.\n */\n private _resolveItems(items: Item<T>[]): T[] {\n if (this.valueKey) {\n const keys = new Set(items as Values<T>[]);\n return this.data.filter((item) => keys.has(item[this.valueKey!]));\n }\n\n const dataSet = new Set(this.data);\n return (items as T[]).filter((item) => dataSet.has(item));\n }\n\n /**\n * Gets the value representation of a data record\n * (its value-key property, or the record itself).\n */\n private _resolveItemValue(record: T): Item<T> {\n return this.valueKey ? record[this.valueKey] : record;\n }\n\n /**\n * Maps data items to their value representations using the given key.\n * When key is undefined, returns the items themselves.\n */\n private _getValues(items: Iterable<T>, key?: Keys<T>): ComboValue<T>[] {\n return Iterator.from(items)\n .map((item) => (key ? item[key] : undefined) ?? item)\n .toArray();\n }\n\n private _emitSelectionChange(detail: IgcComboChangeEventArgs): boolean {\n return this.emitEvent('igcChange', { cancelable: true, detail });\n }\n\n private _selectItems(items?: Item<T> | Item<T>[], emit = false): void {\n let collection = asArray(items);\n\n if (this.singleSelect) {\n this._selected.clear();\n this._searchTerm = '';\n }\n\n if (isEmpty(collection)) {\n if (!this.singleSelect) {\n this._selected = new Set(this.data);\n this.requestUpdate();\n }\n return;\n }\n\n if (this.singleSelect) {\n collection = collection.slice(0, 1);\n }\n\n const resolved = this._resolveItems(collection);\n\n if (\n emit &&\n !this._emitSelectionChange({\n newValue: this._getValues(\n [...resolved, ...this._selected],\n this.valueKey\n ),\n items: resolved,\n type: 'selection',\n })\n ) {\n return;\n }\n\n for (const item of resolved) {\n this._selected.add(item);\n }\n\n this.requestUpdate();\n }\n\n private _deselectItems(items?: Item<T> | Item<T>[], emit = false): void {\n let collection = asArray(items);\n\n if (isEmpty(collection)) {\n if (\n emit &&\n !this._emitSelectionChange({\n newValue: [],\n items: Array.from(this._selected),\n type: 'deselection',\n })\n ) {\n return;\n }\n\n this._selected.clear();\n this.requestUpdate();\n return;\n }\n\n if (this.singleSelect) {\n collection = collection.slice(0, 1);\n }\n\n const resolved = this._resolveItems(collection);\n const resolvedSet = new Set(resolved);\n const remaining = Array.from(this._selected).filter(\n (item) => !resolvedSet.has(item)\n );\n\n if (\n emit &&\n !this._emitSelectionChange({\n newValue: this._getValues(remaining, this.valueKey),\n items: resolved,\n type: 'deselection',\n })\n ) {\n return;\n }\n\n for (const item of resolved) {\n this._selected.delete(item);\n }\n\n this.requestUpdate();\n }\n\n /**\n * Syncs the internal `_selected` set from the current `_formValue`.\n * This is a one-way sync: source of truth (_formValue) → view (_selected).\n */\n private _syncSelectionFromValue(): void {\n this._selected.clear();\n\n if (!isEmpty(this._formValue.value)) {\n const values = this.singleSelect\n ? asArray(first(this._formValue.value))\n : this._formValue.value;\n\n if (this.singleSelect && values.length !== this._formValue.value.length) {\n this._formValue.setValueAndFormState(values);\n }\n\n const items = Iterator.from(values)\n .map((val) => this._findItemByValue(val, this.valueKey))\n .filter(isDefined);\n\n for (const item of items) {\n this._selected.add(item);\n }\n }\n\n this._displayValue = this._getValues(this._selected, this.displayKey).join(\n ', '\n );\n }\n\n /**\n * Finds an item in the data array by its value (or value key).\n * Returns undefined if the item is not found.\n */\n private _findItemByValue(value: ComboValue<T>, key?: Keys<T>): T | undefined {\n return this.data.find((item) => (key ? item[key] : item) === value);\n }\n\n protected _syncValueFromSelection(initial = false): void {\n const values = this._getValues(this._selected, this.valueKey);\n this._displayValue = this._getValues(this._selected, this.displayKey).join(\n ', '\n );\n this._formValue.setValueAndFormState(values);\n\n if (!initial) {\n this._setSingleSelectionDisplayValue(this._displayValue);\n this._validate();\n this._listRef.value?.requestUpdate();\n }\n }\n\n private _toggleSelection(index: number): void {\n const record = this.data[this._state.dataState[index].dataIndex];\n\n this._selected.has(record)\n ? this._deselectItems(this._resolveItemValue(record), true)\n : this._selectItems(this._resolveItemValue(record), true);\n\n this._activeIndex = index;\n this._syncValueFromSelection();\n }\n\n private _selectByIndex(index: number): void {\n this._selectItems(\n this._resolveItemValue(this.data[this._state.dataState[index].dataIndex]),\n true\n );\n this._activeIndex = index;\n this._syncValueFromSelection();\n }\n\n private _clearSelection(): void {\n if (this.singleSelect) {\n this._searchTerm = '';\n this._clearSingleSelection();\n } else {\n this._deselectItems([], true);\n }\n this._syncValueFromSelection();\n }\n\n private _clearSingleSelection(): void {\n const [selection] = this._selected;\n\n if (selection) {\n this._deselectItems(this._resolveItemValue(selection), true);\n this._formValue.setValueAndFormState([]);\n }\n }\n\n // #endregion\n\n //#region Event handlers\n\n protected async _handleMainInput({\n detail,\n }: CustomEvent<string>): Promise<void> {\n this._setTouchedState();\n this._show(true);\n this._searchTerm = detail;\n\n // wait for the dataState to update after filtering\n await this.updateComplete;\n\n this._activeIndex = this._state.dataState.findIndex((i) => !i.header);\n // clear the selection upon typing\n this._clearSingleSelection();\n }\n\n protected _handleFocusIn(): void {\n this._setTouchedState();\n }\n\n protected override _handleBlur(): void {\n if (isEmpty(this._selected)) {\n this._searchTerm = '';\n this._setSingleSelectionDisplayValue('');\n }\n super._handleBlur();\n }\n\n protected _handleSearchInput({ detail }: CustomEvent<string>): void {\n this._searchTerm = detail;\n }\n\n private _handleClosing(): void {\n this._hide(true);\n }\n\n private async _itemClickHandler(event: PointerEvent): Promise<void> {\n const target = getElementFromPath(IgcComboItemComponent.tagName, event);\n\n if (!target) {\n return;\n }\n\n this._setTouchedState();\n this._toggleSelection(target.index);\n\n if (this.singleSelect) {\n this._inputRef.value?.focus();\n await this._hide(true);\n } else {\n this._searchRef.value?.focus();\n }\n }\n\n private _handleClearIconClick(event: PointerEvent): void {\n event.stopPropagation();\n this._clearSelection();\n this._activeIndex = -1;\n }\n\n private _handleCaseSensitivity(): void {\n this.filteringOptions = {\n caseSensitive: !this.filteringOptions.caseSensitive,\n };\n }\n\n //#endregion\n\n //#region Public methods\n\n /* alternateName: focusComponent */\n /** Sets focus on the component. */\n public override focus(options?: FocusOptions): void {\n this._inputRef.value?.focus(options);\n }\n\n /* alternateName: blurComponent */\n /** Removes focus from the component. */\n public override blur(): void {\n this._inputRef.value?.blur();\n }\n\n /**\n * Selects option(s) in the list by either reference or valueKey.\n * If not argument is provided all items will be selected.\n * @param { Item<T> | Item<T>[] } items - One or more items to be selected. Multiple items should be passed as an array.\n * When valueKey is specified, the corresponding value should be used in place of the item reference.\n *\n * @example\n * ```typescript\n * const combo<IgcComboComponent<T>> = document.querySelector('igc-combo');\n *\n * // Select one item at a time by reference when valueKey is not specified.\n * combo.select(combo.data[0]);\n *\n * // Select multiple items at a time by reference when valueKey is not specified.\n * combo.select([combo.data[0], combo.data[1]]);\n *\n * // Select one item at a time when valueKey is specified.\n * combo.select('BG01');\n *\n * // Select multiple items at a time when valueKey is specified.\n * combo.select(['BG01', 'BG02']);\n * ```\n */\n public select(items?: Item<T> | Item<T>[]): void {\n this._selectItems(items);\n this._syncValueFromSelection();\n }\n\n /**\n * Deselects option(s) in the list by either reference or valueKey.\n * If not argument is provided all items will be deselected.\n * @param { Item<T> | Item<T>[] } items - One or more items to be deselected. Multiple items should be passed as an array.\n * When valueKey is specified, the corresponding value should be used in place of the item reference.\n *\n * @example\n * ```typescript\n * const combo<IgcComboComponent<T>> = document.querySelector('igc-combo');\n *\n * // Deselect one item at a time by reference when valueKey is not specified.\n * combo.deselect(combo.data[0]);\n *\n * // Deselect multiple items at a time by reference when valueKey is not specified.\n * combo.deselect([combo.data[0], combo.data[1]]);\n *\n * // Deselect one item at a time when valueKey is specified.\n * combo.deselect('BG01');\n *\n * // Deselect multiple items at a time when valueKey is specified.\n * combo.deselect(['BG01', 'BG02']);\n * ```\n */\n public deselect(items?: Item<T> | Item<T>[]): void {\n this._deselectItems(items);\n this._syncValueFromSelection();\n }\n\n //#endregion\n\n protected _itemRenderer: ComboRenderFunction<T> = (\n item: ComboRecord<T>,\n index: number\n ) => {\n if (!item) {\n return nothing as unknown as TemplateResult;\n }\n\n if (this.groupKey && item.header) {\n return html`\n <igc-combo-header part=\"group-header\">\n ${this.groupHeaderTemplate({ item: item.value })}\n </igc-combo-header>\n `;\n }\n\n const position = index + 1;\n const id = this.id ? `${this.id}-item-${position}` : `item-${position}`;\n const active = this._activeIndex === index;\n const selected = this._selected.has(this.data[item.dataIndex]);\n\n if (active) {\n this._activeDescendant = id;\n }\n\n return html`\n <igc-combo-item\n id=${id}\n part=${partMap({ item: true, selected, active })}\n aria-setsize=${this._state.dataState.length}\n aria-posinset=${position}\n exportparts=\"checkbox, checkbox-indicator, checked\"\n .index=${index}\n ?active=${active}\n ?selected=${selected}\n ?hide-checkbox=${this.singleSelect}\n >\n ${this.itemTemplate({ item: item.value })}\n </igc-combo-item>\n `;\n };\n\n private _renderToggleIcon() {\n return html`\n <span\n slot=\"suffix\"\n part=${partMap({\n 'toggle-icon': true,\n filled: !isEmpty(this.value),\n })}\n >\n <slot name=\"toggle-icon\">\n <igc-icon\n name=${this.open ? 'input_collapse' : 'input_expand'}\n collection=\"default\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n `;\n }\n\n private _renderClearIcon() {\n return html`\n <span\n slot=\"suffix\"\n part=\"clear-icon\"\n @click=${this._handleClearIconClick}\n ?hidden=${this.disableClear || isEmpty(this._selected)}\n aria-label=${ifDefined(\n this.resourceStrings.combo_clearItems_placeholder\n )}\n >\n <slot name=\"clear-icon\">\n <igc-icon\n name=\"input_clear\"\n collection=\"default\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n `;\n }\n\n private _renderMainInput() {\n const hasPrefix = this._slots.hasAssignedElements('prefix');\n const hasSuffix = this._slots.hasAssignedElements('suffix');\n\n return html`\n <igc-input\n ${ref(this._inputRef)}\n id=\"target\"\n slot=\"anchor\"\n role=\"combobox\"\n aria-controls=\"dropdown\"\n aria-owns=\"dropdown\"\n aria-expanded=${this.open}\n aria-describedby=\"combo-helper-text\"\n aria-disabled=${this.disabled}\n aria-label=${this._mainAriaLabel}\n exportparts=\"container: input, input: native-input, label, prefix, suffix\"\n @click=${this._handleAnchorClick}\n placeholder=${ifDefined(this.placeholder)}\n label=${ifDefined(this.label)}\n @igcChange=${stopPropagation}\n @igcInput=${this._handleMainInput}\n .value=${this._displayValue}\n .disabled=${this.disabled}\n .required=${this.required}\n .invalid=${this.invalid}\n .outlined=${this.outlined}\n .autofocus=${this.autofocus}\n ?readonly=${!this.singleSelect}\n >\n <span slot=${bindIf(hasPrefix, 'prefix')}>\n <slot name=\"prefix\"></slot>\n </span>\n ${this._renderClearIcon()}\n <span slot=${bindIf(hasSuffix, 'suffix')}>\n <slot name=\"suffix\"></slot>\n </span>\n ${this._renderToggleIcon()}\n </igc-input>\n `;\n }\n\n private _renderSearchInput() {\n return html`\n <div\n part=\"filter-input\"\n ?hidden=${this.disableFiltering || this.singleSelect}\n >\n <igc-input\n ${ref(this._searchRef)}\n .value=${this._searchTerm}\n part=\"search-input\"\n placeholder=${this.placeholderSearch}\n exportparts=\"input: search-input\"\n @igcInput=${this._handleSearchInput}\n >\n <igc-icon\n slot=${bindIf(this.caseSensitiveIcon, 'suffix')}\n name=\"case_sensitive\"\n collection=\"default\"\n part=${partMap({\n 'case-icon': true,\n active: this.filteringOptions.caseSensitive,\n })}\n @click=${this._handleCaseSensitivity}\n ></igc-icon>\n </igc-input>\n </div>\n `;\n }\n\n private _renderEmptyTemplate() {\n return html`\n <div part=\"empty\" ?hidden=${!isEmpty(this._state.dataState)}>\n <slot name=\"empty\">${this.resourceStrings.combo_empty_message}</slot>\n </div>\n `;\n }\n\n private _renderList() {\n return html`\n <div .inert=${!this.open} part=\"list-wrapper\">\n ${this._renderSearchInput()}\n <div part=\"header\">\n <slot name=\"header\"></slot>\n </div>\n <igc-combo-list\n ${ref(this._listRef)}\n aria-multiselectable=${!this.singleSelect}\n id=\"dropdown\"\n part=\"list\"\n role=\"listbox\"\n tabindex=\"0\"\n aria-labelledby=\"target\"\n aria-activedescendant=${ifDefined(this._activeDescendant)}\n .items=${this._state.dataState}\n .renderItem=${this._itemRenderer}\n ?hidden=${isEmpty(this._state.dataState)}\n @click=${this._itemClickHandler}\n >\n </igc-combo-list>\n ${this._renderEmptyTemplate()}\n <div part=\"footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n `;\n }\n\n private _renderHelperText(): TemplateResult {\n return IgcValidationContainerComponent.create(this, {\n id: 'combo-helper-text',\n hasHelperText: true,\n });\n }\n\n protected override render() {\n return html`\n <igc-popover ?open=${this.open} flip shift same-width>\n ${this._renderMainInput()} ${this._renderList()}\n </igc-popover>\n ${this._renderHelperText()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-combo': IgcComboComponent<object>;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"combo.js","sourceRoot":"","sources":["../../../src/components/combo/combo.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACL,sBAAsB,GAEvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,OAAO,EAA4C,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,MAAM,EACN,KAAK,EACL,kBAAkB,EAClB,SA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AS,EAAE,mBAAmB,EAAE,CAAC;yDAG1D;AAYM;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;4DAC7B;AAQjC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;yDAI3D;AAYM;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;uDAC5B;AAQrB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;uDAE2B;AAQnD;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8DAE4B;AAiC3D;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;8CAQzB;AA1ZkB,iBAAiB;IAFrC,4BAA4B,CAAC,qCAAqC,CAAC;IACnE,oBAAoB;GACA,iBAAiB,CAqkCrC;eArkCoB,iBAAiB","sourcesContent":["import {\n ComboResourceStringsEN,\n type IComboResourceStrings,\n} from 'igniteui-i18n-core';\nimport { html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\n\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport { addRootClickController } from '../common/controllers/root-click.js';\nimport { addSlotController, setSlots } from '../common/controllers/slot.js';\nimport { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';\nimport { blazorIndirectRender } from '../common/decorators/blazorIndirectRender.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { addI18nController } from '../common/i18n/i18n-controller.js';\nimport { IgcBaseComboBoxComponent } from '../common/mixins/combo-box.js';\nimport type { AbstractConstructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js';\nimport { createFormValueState } from '../common/mixins/forms/form-value.js';\nimport { partMap } from '../common/part-map.js';\nimport {\n addSafeEventListener,\n asArray,\n bindIf,\n first,\n getElementFromPath,\n isDefined,\n isEmpty,\n stopPropagation,\n} from '../common/util.js';\nimport type { Validator } from '../common/validators.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcInputComponent from '../input/input.js';\nimport IgcPopoverComponent from '../popover/popover.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport IgcComboHeaderComponent from './combo-header.js';\nimport IgcComboItemComponent from './combo-item.js';\nimport IgcComboListComponent from './combo-list.js';\nimport { DataState } from './controllers/data.js';\nimport { ComboNavigationController } from './controllers/navigation.js';\nimport { styles } from './themes/combo.base.css.js';\nimport { styles as shared } from './themes/shared/combo.common.css.js';\nimport { all } from './themes/themes.js';\nimport type {\n ComboItemTemplate,\n ComboRecord,\n ComboRenderFunction,\n ComboValue,\n FilteringOptions,\n GroupingDirection,\n IgcComboChangeEventArgs,\n IgcComboComponentEventMap,\n Item,\n Keys,\n Values,\n} from './types.js';\nimport { comboValidators } from './validators.js';\n\nconst SLOTS = setSlots(\n 'prefix',\n 'suffix',\n 'header',\n 'footer',\n 'empty',\n 'helper-text',\n 'toggle-icon',\n 'clear-icon',\n 'value-missing',\n 'custom-error',\n 'invalid'\n);\n\n/* blazorSupportsVisualChildren */\n/**\n * The Combo component is similar to the Select component in that it provides a list of options from which the user can make a selection.\n * In contrast to the Select component, the Combo component displays all options in a virtualized list of items,\n * meaning the combo box can simultaneously show thousands of options, where one or more options can be selected.\n * Additionally, users can create custom item templates, allowing for robust data visualization.\n * The Combo component features case-sensitive filtering, grouping, complex data binding, dynamic addition of values and more.\n *\n * @element igc-combo\n *\n * @slot prefix - Renders content before the input of the combo.\n * @slot suffix - Renders content after the input of the combo.\n * @slot header - Renders a container before the list of options of the combo.\n * @slot footer - Renders a container after the list of options of the combo.\n * @slot empty - Renders content when the combo dropdown list has no items/data.\n * @slot helper-text - Renders content below the input of the combo.\n * @slot toggle-icon - Renders content inside the suffix container of the combo.\n * @slot clear-icon - Renders content inside the suffix container of the combo.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n *\n * @fires igcChange - Emitted when the control's selection has changed.\n * @fires igcOpening - Emitted just before the list of options is opened.\n * @fires igcOpened - Emitted after the list of options is opened.\n * @fires igcClosing - Emitter just before the list of options is closed.\n * @fires igcClosed - Emitted after the list of options is closed.\n *\n * @csspart label - The encapsulated text label of the combo.\n * @csspart input - The main input field of the combo.\n * @csspart native-input - The native input of the main input field of the combo.\n * @csspart prefix - The prefix wrapper of the combo.\n * @csspart suffix - The suffix wrapper of the combo.\n * @csspart toggle-icon - The toggle icon wrapper of the combo.\n * @csspart clear-icon - The clear icon wrapper of the combo.\n * @csspart case-icon - The case icon wrapper of the combo.\n * @csspart helper-text - The helper text wrapper of the combo.\n * @csspart search-input - The search input field of the combo.\n * @csspart list-wrapper - The list of options wrapper of the combo.\n * @csspart list - The list of options box of the combo.\n * @csspart item - Represents each item in the list of options of the combo.\n * @csspart group-header - Represents each header in the list of options of the combo.\n * @csspart active - Appended to the item parts list when the item is active of the combo.\n * @csspart selected - Appended to the item parts list when the item is selected of the combo.\n * @csspart checkbox - Represents each checkbox of each list item of the combo.\n * @csspart checkbox-indicator - Represents the checkbox indicator of each list item of the combo.\n * @csspart checked - Appended to checkbox parts list when checkbox is checked in the combo.\n * @csspart header - The container holding the header content of the combo.\n * @csspart footer - The container holding the footer content of the combo.\n * @csspart empty - The container holding the empty content of the combo.\n */\n@blazorAdditionalDependencies('IgcIconComponent, IgcInputComponent')\n@blazorIndirectRender\nexport default class IgcComboComponent<\n T extends object = any,\n> extends FormAssociatedRequiredMixin(\n EventEmitterMixin<\n IgcComboComponentEventMap,\n AbstractConstructor<IgcBaseComboBoxComponent>\n >(IgcBaseComboBoxComponent)\n) {\n public static readonly tagName = 'igc-combo';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcComboComponent,\n IgcIconComponent,\n IgcComboListComponent,\n IgcComboItemComponent,\n IgcComboHeaderComponent,\n IgcInputComponent,\n IgcPopoverComponent,\n IgcValidationContainerComponent\n );\n }\n\n // #region Internal state and controllers\n\n protected override get __validators(): Validator<IgcComboComponent<T>>[] {\n return comboValidators;\n }\n\n private readonly _slots = addSlotController(this, { slots: SLOTS });\n\n protected override readonly _rootClickController = addRootClickController(\n this,\n {\n onHide: this._handleClosing,\n }\n );\n\n protected readonly _i18nController = addI18nController<IComboResourceStrings>(\n this,\n {\n defaultEN: ComboResourceStringsEN,\n }\n );\n\n protected override readonly _formValue = createFormValueState<\n ComboValue<T>[]\n >(this, {\n initialValue: [],\n transformers: {\n setValue: asArray,\n setDefaultValue: asArray,\n setFormValue: (value) => {\n if (isEmpty(value) || !this.name) {\n return null;\n }\n\n if (this.singleSelect) {\n return String(first(value));\n }\n\n const formData = new FormData();\n\n for (const item of value) {\n formData.append(this.name, String(item));\n }\n\n return formData;\n },\n },\n });\n\n /** The primary input of the combo component. */\n private readonly _inputRef = createRef<IgcInputComponent>();\n\n /** The search input of the combo component. */\n private readonly _searchRef = createRef<IgcInputComponent>();\n\n /** The combo virtualized dropdown list. */\n private readonly _listRef = createRef<IgcComboListComponent>();\n\n private readonly _state = new DataState<T>(this);\n private readonly _navigation = new ComboNavigationController(\n this,\n this._state,\n {\n input: this._inputRef,\n search: this._searchRef,\n list: this._listRef,\n interactions: {\n show: () => this._show(true),\n hide: () => this._hide(true),\n toggleSelection: (index: number) => this._toggleSelection(index),\n select: (index: number) => this._selectByIndex(index),\n clearSelection: () => this._clearSelection(),\n },\n }\n );\n\n private _data: T[] = [];\n private _valueKey?: Keys<T>;\n private _displayKey?: Keys<T>;\n private _placeholderSearch?: string;\n private _disableFiltering = false;\n private _singleSelect = false;\n private _selected: Set<T> = new Set();\n private _filteringOptions: FilteringOptions<T> = {\n filterKey: this.displayKey,\n caseSensitive: false,\n matchDiacritics: false,\n };\n\n @state()\n private set _activeIndex(index: number) {\n this._navigation.active = index;\n }\n\n private get _activeIndex(): number {\n return this._navigation.active;\n }\n\n @state()\n private set _searchTerm(value: string) {\n this._state.searchTerm = value;\n }\n\n private get _searchTerm(): string {\n return this._state.searchTerm;\n }\n\n @state()\n private _activeDescendant?: string;\n\n @state()\n private _displayValue = '';\n\n private get _mainAriaLabel(): string {\n return isEmpty(this._selected)\n ? this.resourceStrings.combo_aria_label_no_options!\n : this.resourceStrings.combo_aria_label_options!;\n }\n\n // #endregion\n\n //#region Public attributes and properties\n\n /** The data source used to generate the list of options. */\n /* treatAsRef */\n @property({ attribute: false })\n public set data(value: T[]) {\n if (this._data !== value) {\n this._data = asArray(value);\n }\n }\n\n public get data(): T[] {\n return this._data;\n }\n\n /**\n * The outlined attribute of the control.\n * @attr outlined\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public outlined = false;\n\n /**\n * Enables single selection mode and moves item filtering to the main input.\n * @attr single-select\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'single-select' })\n public set singleSelect(value: boolean) {\n this._singleSelect = Boolean(value);\n this._syncSelectionFromValue();\n\n if (this.hasUpdated) {\n const pristine = this._pristine;\n this._activeIndex = -1;\n this._searchTerm = '';\n this._formValue.setValueAndFormState(this.value);\n this._pristine = pristine;\n }\n }\n\n public get singleSelect(): boolean {\n return this._singleSelect;\n }\n\n /**\n * The autofocus attribute of the control.\n * @attr autofocus\n */\n @property({ type: Boolean })\n public override autofocus!: boolean;\n\n /**\n * Focuses the list of options when the menu opens.\n * @attr autofocus-list\n * @default false\n */\n @property({ type: Boolean, attribute: 'autofocus-list' })\n public autofocusList = false;\n\n /**\n * Gets/Sets the locale used for getting language, affecting resource strings.\n * @attr locale\n */\n @property()\n public set locale(value: string) {\n this._i18nController.locale = value;\n this._state.updateLocale(value);\n }\n\n public get locale(): string {\n return this._i18nController.locale;\n }\n\n /**\n * The label attribute of the control.\n * @attr label\n */\n @property()\n public label?: string;\n\n /**\n * The placeholder attribute of the control.\n * @attr placeholder\n */\n @property()\n public placeholder?: string;\n\n /**\n * The placeholder attribute of the search input.\n * @attr placeholder-search\n */\n @property({ attribute: 'placeholder-search' })\n public set placeholderSearch(value: string | undefined) {\n this._placeholderSearch = value;\n }\n\n public get placeholderSearch(): string {\n return (\n this._placeholderSearch ??\n this.resourceStrings.combo_filter_search_placeholder ??\n 'Search'\n );\n }\n\n /**\n * The resource strings for localization.\n */\n @property({ attribute: false })\n public set resourceStrings(value: IComboResourceStrings) {\n this._i18nController.resourceStrings = value;\n }\n\n public get resourceStrings(): IComboResourceStrings {\n return this._i18nController.resourceStrings;\n }\n\n /**\n * The key in the data source used when selecting items.\n * @attr value-key\n */\n @property({ attribute: 'value-key' })\n public set valueKey(value: Keys<T> | undefined) {\n this._valueKey = value;\n this._displayKey = this._displayKey ?? this._valueKey;\n }\n\n public get valueKey() {\n return this._valueKey;\n }\n\n /**\n * The key in the data source used to display items in the list.\n * @attr display-key\n */\n @property({ attribute: 'display-key' })\n public set displayKey(value: Keys<T> | undefined) {\n this._displayKey = value;\n if (!this.filteringOptions.filterKey) {\n this.filteringOptions = { filterKey: this.displayKey };\n }\n }\n\n public get displayKey() {\n return this._displayKey ?? this._valueKey;\n }\n\n /**\n * The key in the data source used to group items in the list.\n * @attr group-key\n */\n @property({ attribute: 'group-key' })\n public groupKey?: Keys<T> | string;\n\n /**\n * Sorts the items in each group by ascending or descending order.\n * @attr group-sorting\n * @default \"asc\"\n * @type {\"asc\" | \"desc\" | \"none\"}\n */\n @property({ attribute: 'group-sorting' })\n public groupSorting: GroupingDirection = 'asc';\n\n /**\n * An object that configures the filtering of the combo.\n * @attr filtering-options\n */\n @property({ type: Object, attribute: 'filtering-options' })\n public set filteringOptions(value: Partial<FilteringOptions<T>>) {\n this._filteringOptions = { ...this._filteringOptions, ...value };\n }\n\n public get filteringOptions(): FilteringOptions<T> {\n return this._filteringOptions;\n }\n\n /**\n * Enables the case sensitive search icon in the filtering input.\n * @attr case-sensitive-icon\n * @default false\n */\n @property({ type: Boolean, attribute: 'case-sensitive-icon' })\n public caseSensitiveIcon = false;\n\n /**\n * Disables the filtering of the list of options.\n * @attr disable-filtering\n * @default false\n */\n @property({ type: Boolean, attribute: 'disable-filtering' })\n public set disableFiltering(value: boolean) {\n this._disableFiltering = value;\n this._searchTerm = '';\n }\n\n public get disableFiltering(): boolean {\n return this._disableFiltering;\n }\n\n /**\n * Hides the clear button.\n * @attr disable-clear\n * @default false\n */\n @property({ type: Boolean, attribute: 'disable-clear' })\n public disableClear = false;\n\n /* blazorSuppress */\n /**\n * The template used for the content of each combo item.\n * @type {ComboItemTemplate<T>}\n */\n @property({ attribute: false })\n public itemTemplate: ComboItemTemplate<T> = ({ item }) =>\n html`${this.displayKey ? item[this.displayKey] : item}`;\n\n /* blazorSuppress */\n /**\n * The template used for the content of each combo group header.\n * @type {ComboItemTemplate<T>}\n */\n @property({ attribute: false })\n public groupHeaderTemplate: ComboItemTemplate<T> = ({ item }) =>\n html`${this.groupKey && item[this.groupKey as Keys<T>]}`;\n\n /**\n * Sets the value (selected items). The passed value must be a valid JSON array.\n * If the data source is an array of complex objects, the `valueKey` attribute must be set.\n * Note that when `displayKey` is not explicitly set, it will fall back to the value of `valueKey`.\n *\n * @attr value\n *\n * @example\n * ```tsx\n * <igc-combo\n * .data=${[\n * {\n * id: 'BG01',\n * name: 'Sofia'\n * },\n * {\n * id: 'BG02',\n * name: 'Plovdiv'\n * }\n * ]}\n * display-key='name'\n * value-key='id'\n * value='[\"BG01\", \"BG02\"]'>\n * </igc-combo>\n * ```\n */\n /* blazorPrimitiveValue */\n /* blazorByValueArray */\n /* blazorGenericType */\n /* @tsTwoWayProperty (true, \"Change\", \"Detail.NewValue\", false) */\n @property({ type: Array })\n public set value(items: ComboValue<T>[]) {\n this._formValue.setValueAndFormState(items);\n this._syncSelectionFromValue();\n\n if (this.hasUpdated) {\n this._validate();\n }\n }\n\n /**\n * Returns the current selection as a list of comma separated values,\n * represented by the value key, when provided.\n */\n public get value(): ComboValue<T>[] {\n return this._formValue.value;\n }\n\n /**\n * Returns the current selection as an array of objects as provided in the `data` source.\n */\n public get selection(): T[] {\n return Array.from(this._selected);\n }\n\n //#endregion\n\n //#region Life-cycle\n\n constructor() {\n super();\n\n addThemingController(this, all);\n addSafeEventListener(this, 'blur', this._handleBlur);\n addSafeEventListener(this, 'focusin', this._handleFocusIn);\n }\n\n protected override willUpdate(props: PropertyValues<this>): void {\n if (props.has('open')) {\n this._rootClickController.update();\n }\n\n if (\n props.has('groupKey') ||\n props.has('groupSorting') ||\n props.has('filteringOptions') ||\n props.has('data')\n ) {\n this._state.invalidate();\n }\n\n // When data changes, re-sync selection and form\n // This handles the delayed data scenario where value was set before data\n if (props.has('data') && !isEmpty(this.data) && !isEmpty(this.value)) {\n const pristine = this._pristine;\n this._syncSelectionFromValue();\n this._formValue.setValueAndFormState(this.value);\n this._pristine = pristine;\n }\n }\n\n //#endregion\n\n // #region Form Associated overrides\n\n protected override _restoreDefaultValue(): void {\n super._restoreDefaultValue();\n this._syncSelectionFromValue();\n }\n\n protected override _setDefaultValue(current: string | null): void {\n try {\n this.defaultValue = JSON.parse(current || '[]');\n } catch {}\n }\n\n // #endregion\n\n //#region Overrides for combo box behavior\n\n protected override async _show(emitEvent = false): Promise<boolean> {\n const [canOpen, _] = await Promise.all([\n super._show(emitEvent),\n this.updateComplete,\n ]);\n\n if (canOpen) {\n if (!this.singleSelect) {\n this._listRef.value?.focus();\n }\n\n if (!this.autofocusList) {\n this._searchRef.value?.focus();\n }\n }\n\n return canOpen;\n }\n\n protected override async _hide(emitEvent = false): Promise<boolean> {\n const [canClose, _] = await Promise.all([\n super._hide(emitEvent),\n this.updateComplete,\n ]);\n\n if (canClose) {\n this._activeIndex = -1;\n }\n\n return canClose;\n }\n\n private _setSingleSelectionDisplayValue(value: string): void {\n if (this.singleSelect && this._inputRef.value) {\n this._inputRef.value.value = value;\n }\n }\n\n //#endregion\n\n // #region Selection helpers\n\n /**\n * Resolves user-provided items (value keys or object references)\n * to actual objects from the data source in a single pass.\n */\n private _resolveItems(items: Item<T>[]): T[] {\n if (this.valueKey) {\n const keys = new Set(items as Values<T>[]);\n return this.data.filter((item) => keys.has(item[this.valueKey!]));\n }\n\n const dataSet = new Set(this.data);\n return (items as T[]).filter((item) => dataSet.has(item));\n }\n\n /**\n * Gets the value representation of a data record\n * (its value-key property, or the record itself).\n */\n private _resolveItemValue(record: T): Item<T> {\n return this.valueKey ? record[this.valueKey] : record;\n }\n\n /**\n * Maps data items to their value representations using the given key.\n * When key is undefined, returns the items themselves.\n */\n private _getValues(items: Iterable<T>, key?: Keys<T>): ComboValue<T>[] {\n return Iterator.from(items)\n .map((item) => (key ? item[key] : undefined) ?? item)\n .toArray();\n }\n\n private _emitSelectionChange(detail: IgcComboChangeEventArgs): boolean {\n return this.emitEvent('igcChange', { cancelable: true, detail });\n }\n\n private _selectItems(items?: Item<T> | Item<T>[], emit = false): void {\n let collection = asArray(items);\n\n if (this.singleSelect) {\n this._selected.clear();\n this._searchTerm = '';\n }\n\n if (isEmpty(collection)) {\n if (!this.singleSelect) {\n this._selected = new Set(this.data);\n this.requestUpdate();\n }\n return;\n }\n\n if (this.singleSelect) {\n collection = collection.slice(0, 1);\n }\n\n const resolved = this._resolveItems(collection);\n\n if (\n emit &&\n !this._emitSelectionChange({\n newValue: this._getValues(\n [...resolved, ...this._selected],\n this.valueKey\n ),\n items: resolved,\n type: 'selection',\n })\n ) {\n return;\n }\n\n for (const item of resolved) {\n this._selected.add(item);\n }\n\n this.requestUpdate();\n }\n\n private _deselectItems(items?: Item<T> | Item<T>[], emit = false): void {\n let collection = asArray(items);\n\n if (isEmpty(collection)) {\n if (\n emit &&\n !this._emitSelectionChange({\n newValue: [],\n items: Array.from(this._selected),\n type: 'deselection',\n })\n ) {\n return;\n }\n\n this._selected.clear();\n this.requestUpdate();\n return;\n }\n\n if (this.singleSelect) {\n collection = collection.slice(0, 1);\n }\n\n const resolved = this._resolveItems(collection);\n const resolvedSet = new Set(resolved);\n const remaining = Array.from(this._selected).filter(\n (item) => !resolvedSet.has(item)\n );\n\n if (\n emit &&\n !this._emitSelectionChange({\n newValue: this._getValues(remaining, this.valueKey),\n items: resolved,\n type: 'deselection',\n })\n ) {\n return;\n }\n\n for (const item of resolved) {\n this._selected.delete(item);\n }\n\n this.requestUpdate();\n }\n\n /**\n * Syncs the internal `_selected` set from the current `_formValue`.\n * This is a one-way sync: source of truth (_formValue) → view (_selected).\n */\n private _syncSelectionFromValue(): void {\n this._selected.clear();\n\n if (!isEmpty(this._formValue.value)) {\n const values = this.singleSelect\n ? asArray(first(this._formValue.value))\n : this._formValue.value;\n\n if (this.singleSelect && values.length !== this._formValue.value.length) {\n this._formValue.setValueAndFormState(values);\n }\n\n const items = Iterator.from(values)\n .map((val) => this._findItemByValue(val, this.valueKey))\n .filter(isDefined);\n\n for (const item of items) {\n this._selected.add(item);\n }\n }\n\n this._displayValue = this._getValues(this._selected, this.displayKey).join(\n ', '\n );\n }\n\n /**\n * Finds an item in the data array by its value (or value key).\n * Returns undefined if the item is not found.\n */\n private _findItemByValue(value: ComboValue<T>, key?: Keys<T>): T | undefined {\n return this.data.find((item) => (key ? item[key] : item) === value);\n }\n\n protected _syncValueFromSelection(initial = false): void {\n const values = this._getValues(this._selected, this.valueKey);\n this._displayValue = this._getValues(this._selected, this.displayKey).join(\n ', '\n );\n this._formValue.setValueAndFormState(values);\n\n if (!initial) {\n this._setSingleSelectionDisplayValue(this._displayValue);\n this._validate();\n this._listRef.value?.requestUpdate();\n }\n }\n\n private _toggleSelection(index: number): void {\n const record = this.data[this._state.dataState[index].dataIndex];\n\n this._selected.has(record)\n ? this._deselectItems(this._resolveItemValue(record), true)\n : this._selectItems(this._resolveItemValue(record), true);\n\n this._activeIndex = index;\n this._syncValueFromSelection();\n }\n\n private _selectByIndex(index: number): void {\n this._selectItems(\n this._resolveItemValue(this.data[this._state.dataState[index].dataIndex]),\n true\n );\n this._activeIndex = index;\n this._syncValueFromSelection();\n }\n\n private _clearSelection(): void {\n if (this.singleSelect) {\n this._searchTerm = '';\n this._clearSingleSelection();\n } else {\n this._deselectItems([], true);\n }\n this._syncValueFromSelection();\n }\n\n private _clearSingleSelection(): void {\n const [selection] = this._selected;\n\n if (selection) {\n this._deselectItems(this._resolveItemValue(selection), true);\n this._formValue.setValueAndFormState([]);\n }\n }\n\n // #endregion\n\n //#region Event handlers\n\n protected async _handleMainInput({\n detail,\n }: CustomEvent<string>): Promise<void> {\n this._setTouchedState();\n this._show(true);\n this._searchTerm = detail;\n\n // wait for the dataState to update after filtering\n await this.updateComplete;\n\n this._activeIndex = this._state.dataState.findIndex((i) => !i.header);\n // clear the selection upon typing\n this._clearSingleSelection();\n }\n\n protected _handleFocusIn(): void {\n this._setTouchedState();\n }\n\n protected override _handleBlur(): void {\n if (isEmpty(this._selected)) {\n this._searchTerm = '';\n this._setSingleSelectionDisplayValue('');\n }\n super._handleBlur();\n }\n\n protected _handleSearchInput({ detail }: CustomEvent<string>): void {\n this._searchTerm = detail;\n }\n\n private _handleClosing(): void {\n this._hide(true);\n }\n\n private async _itemClickHandler(event: PointerEvent): Promise<void> {\n const target = getElementFromPath(IgcComboItemComponent.tagName, event);\n\n if (!target) {\n return;\n }\n\n this._setTouchedState();\n this._toggleSelection(target.index);\n\n if (this.singleSelect) {\n this._inputRef.value?.focus();\n await this._hide(true);\n } else {\n this._searchRef.value?.focus();\n }\n }\n\n private _handleClearIconClick(event: PointerEvent): void {\n event.stopPropagation();\n this._clearSelection();\n this._activeIndex = -1;\n }\n\n private _handleCaseSensitivity(): void {\n this.filteringOptions = {\n caseSensitive: !this.filteringOptions.caseSensitive,\n };\n }\n\n //#endregion\n\n //#region Public methods\n\n /* alternateName: focusComponent */\n /** Sets focus on the component. */\n public override focus(options?: FocusOptions): void {\n this._inputRef.value?.focus(options);\n }\n\n /* alternateName: blurComponent */\n /** Removes focus from the component. */\n public override blur(): void {\n this._inputRef.value?.blur();\n }\n\n /**\n * Selects option(s) in the list by either reference or valueKey.\n * If not argument is provided all items will be selected.\n * @param { Item<T> | Item<T>[] } items - One or more items to be selected. Multiple items should be passed as an array.\n * When valueKey is specified, the corresponding value should be used in place of the item reference.\n *\n * @example\n * ```typescript\n * const combo<IgcComboComponent<T>> = document.querySelector('igc-combo');\n *\n * // Select one item at a time by reference when valueKey is not specified.\n * combo.select(combo.data[0]);\n *\n * // Select multiple items at a time by reference when valueKey is not specified.\n * combo.select([combo.data[0], combo.data[1]]);\n *\n * // Select one item at a time when valueKey is specified.\n * combo.select('BG01');\n *\n * // Select multiple items at a time when valueKey is specified.\n * combo.select(['BG01', 'BG02']);\n * ```\n */\n public select(items?: Item<T> | Item<T>[]): void {\n this._selectItems(items);\n this._syncValueFromSelection();\n }\n\n /**\n * Deselects option(s) in the list by either reference or valueKey.\n * If not argument is provided all items will be deselected.\n * @param { Item<T> | Item<T>[] } items - One or more items to be deselected. Multiple items should be passed as an array.\n * When valueKey is specified, the corresponding value should be used in place of the item reference.\n *\n * @example\n * ```typescript\n * const combo<IgcComboComponent<T>> = document.querySelector('igc-combo');\n *\n * // Deselect one item at a time by reference when valueKey is not specified.\n * combo.deselect(combo.data[0]);\n *\n * // Deselect multiple items at a time by reference when valueKey is not specified.\n * combo.deselect([combo.data[0], combo.data[1]]);\n *\n * // Deselect one item at a time when valueKey is specified.\n * combo.deselect('BG01');\n *\n * // Deselect multiple items at a time when valueKey is specified.\n * combo.deselect(['BG01', 'BG02']);\n * ```\n */\n public deselect(items?: Item<T> | Item<T>[]): void {\n this._deselectItems(items);\n this._syncValueFromSelection();\n }\n\n //#endregion\n\n protected _itemRenderer: ComboRenderFunction<T> = (\n item: ComboRecord<T>,\n index: number\n ) => {\n if (!item) {\n return nothing as unknown as TemplateResult;\n }\n\n if (this.groupKey && item.header) {\n return html`\n <igc-combo-header part=\"group-header\">\n ${this.groupHeaderTemplate({ item: item.value })}\n </igc-combo-header>\n `;\n }\n\n const position = index + 1;\n const id = this.id ? `${this.id}-item-${position}` : `item-${position}`;\n const active = this._activeIndex === index;\n const selected = this._selected.has(this.data[item.dataIndex]);\n\n if (active) {\n this._activeDescendant = id;\n }\n\n return html`\n <igc-combo-item\n id=${id}\n part=${partMap({ item: true, selected, active })}\n aria-setsize=${this._state.dataState.length}\n aria-posinset=${position}\n exportparts=\"checkbox, checkbox-indicator, checked\"\n .index=${index}\n ?active=${active}\n ?selected=${selected}\n ?hide-checkbox=${this.singleSelect}\n >\n ${this.itemTemplate({ item: item.value })}\n </igc-combo-item>\n `;\n };\n\n private _renderToggleIcon() {\n return html`\n <span\n slot=\"suffix\"\n part=${partMap({\n 'toggle-icon': true,\n filled: !isEmpty(this.value),\n })}\n >\n <slot name=\"toggle-icon\">\n <igc-icon\n name=${this.open ? 'input_collapse' : 'input_expand'}\n collection=\"default\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n `;\n }\n\n private _renderClearIcon() {\n return html`\n <span\n slot=\"suffix\"\n part=\"clear-icon\"\n @click=${this._handleClearIconClick}\n ?hidden=${this.disableClear || isEmpty(this._selected)}\n aria-label=${ifDefined(\n this.resourceStrings.combo_clearItems_placeholder\n )}\n >\n <slot name=\"clear-icon\">\n <igc-icon\n name=\"input_clear\"\n collection=\"default\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n `;\n }\n\n private _renderMainInput() {\n const hasPrefix = this._slots.hasAssignedElements('prefix');\n const hasSuffix = this._slots.hasAssignedElements('suffix');\n\n return html`\n <igc-input\n ${ref(this._inputRef)}\n id=\"target\"\n slot=\"anchor\"\n role=\"combobox\"\n aria-controls=\"dropdown\"\n aria-owns=\"dropdown\"\n aria-expanded=${this.open}\n aria-describedby=\"combo-helper-text\"\n aria-disabled=${this.disabled}\n aria-label=${this._mainAriaLabel}\n exportparts=\"container: input, input: native-input, label, prefix, suffix\"\n @click=${this._handleAnchorClick}\n placeholder=${ifDefined(this.placeholder)}\n label=${ifDefined(this.label)}\n @igcChange=${stopPropagation}\n @igcInput=${this._handleMainInput}\n .value=${this._displayValue}\n .disabled=${this.disabled}\n .required=${this.required}\n .invalid=${this.invalid}\n .outlined=${this.outlined}\n .autofocus=${this.autofocus}\n ?readonly=${!this.singleSelect}\n >\n <span slot=${bindIf(hasPrefix, 'prefix')}>\n <slot name=\"prefix\"></slot>\n </span>\n ${this._renderClearIcon()}\n <span slot=${bindIf(hasSuffix, 'suffix')}>\n <slot name=\"suffix\"></slot>\n </span>\n ${this._renderToggleIcon()}\n </igc-input>\n `;\n }\n\n private _renderSearchInput() {\n return html`\n <div\n part=\"filter-input\"\n ?hidden=${this.disableFiltering || this.singleSelect}\n >\n <igc-input\n ${ref(this._searchRef)}\n .value=${this._searchTerm}\n part=\"search-input\"\n placeholder=${this.placeholderSearch}\n exportparts=\"input: search-input\"\n @igcInput=${this._handleSearchInput}\n >\n <igc-icon\n slot=${bindIf(this.caseSensitiveIcon, 'suffix')}\n name=\"case_sensitive\"\n collection=\"default\"\n part=${partMap({\n 'case-icon': true,\n active: this.filteringOptions.caseSensitive,\n })}\n @click=${this._handleCaseSensitivity}\n ></igc-icon>\n </igc-input>\n </div>\n `;\n }\n\n private _renderEmptyTemplate() {\n return html`\n <div part=\"empty\" ?hidden=${!isEmpty(this._state.dataState)}>\n <slot name=\"empty\">${this.resourceStrings.combo_empty_message}</slot>\n </div>\n `;\n }\n\n private _renderList() {\n return html`\n <div .inert=${!this.open} part=\"list-wrapper\">\n ${this._renderSearchInput()}\n <div part=\"header\">\n <slot name=\"header\"></slot>\n </div>\n <igc-combo-list\n ${ref(this._listRef)}\n aria-multiselectable=${!this.singleSelect}\n id=\"dropdown\"\n part=\"list\"\n role=\"listbox\"\n tabindex=\"0\"\n aria-labelledby=\"target\"\n aria-activedescendant=${ifDefined(this._activeDescendant)}\n .items=${this._state.dataState}\n .renderItem=${this._itemRenderer}\n ?hidden=${isEmpty(this._state.dataState)}\n @click=${this._itemClickHandler}\n >\n </igc-combo-list>\n ${this._renderEmptyTemplate()}\n <div part=\"footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n `;\n }\n\n private _renderHelperText(): TemplateResult {\n return IgcValidationContainerComponent.create(this, {\n id: 'combo-helper-text',\n hasHelperText: true,\n });\n }\n\n protected override render() {\n return html`\n <igc-popover ?open=${this.open} flip shift same-width>\n ${this._renderMainInput()} ${this._renderList()}\n </igc-popover>\n ${this._renderHelperText()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-combo': IgcComboComponent<object>;\n }\n}\n"]}
|
|
@@ -14,9 +14,13 @@ export type GroupingDirection = 'asc' | 'desc' | 'none';
|
|
|
14
14
|
export type ComboChangeType = 'selection' | 'deselection' | 'addition';
|
|
15
15
|
export type ComboRenderFunction<T extends object> = RenderItemFunction<ComboRecord<T>>;
|
|
16
16
|
export type ComboValue<T> = T | Values<T>;
|
|
17
|
+
/** Filtering options for the combo component. */
|
|
17
18
|
export interface FilteringOptions<T extends object> {
|
|
19
|
+
/** The key in the data source used when filtering the list of options. */
|
|
18
20
|
filterKey: Keys<T> | undefined;
|
|
21
|
+
/** Determines whether the filtering operation should be case sensitive. */
|
|
19
22
|
caseSensitive?: boolean;
|
|
23
|
+
/** If true, the filter distinguishes between accented letters and their base letters */
|
|
20
24
|
matchDiacritics?: boolean;
|
|
21
25
|
}
|
|
22
26
|
export interface GroupingOptions<T extends object> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/combo/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { RenderItemFunction } from '@lit-labs/virtualizer/virtualize.js';\nimport type { ReactiveControllerHost, TemplateResult } from 'lit';\n\nimport type IgcComboComponent from './combo.js';\n\nexport type Keys<T> = keyof T;\nexport type Values<T> = T[keyof T];\nexport type Item<T extends object> = T | Values<T>;\n\nexport type ComboRecord<T extends object> = {\n value: T;\n header: boolean;\n dataIndex: number;\n};\n\nexport type ComboHost<T extends object> = ReactiveControllerHost &\n IgcComboComponent<T>;\n\nexport type GroupingDirection = 'asc' | 'desc' | 'none';\nexport type ComboChangeType = 'selection' | 'deselection' | 'addition';\nexport type ComboRenderFunction<T extends object> = RenderItemFunction<\n ComboRecord<T>\n>;\nexport type ComboValue<T> = T | Values<T>;\n\n/* jsonAPIPlainObject */\nexport interface FilteringOptions<T extends object> {\n filterKey: Keys<T> | undefined;\n caseSensitive?: boolean;\n matchDiacritics?: boolean;\n}\n\nexport interface GroupingOptions<T extends object> {\n groupKey?: Keys<T>;\n valueKey?: Keys<T>;\n displayKey?: Keys<T>;\n direction: GroupingDirection;\n}\n\n/* marshalByValue */\nexport interface IgcComboChangeEventArgs<T extends object = any> {\n newValue: ComboValue<T>[];\n /* primitiveValue */\n items: T[];\n /* blazorAlternateName: changeType */\n type: ComboChangeType;\n}\n\nexport interface IgcComboComponentEventMap {\n igcChange: CustomEvent<IgcComboChangeEventArgs>;\n // For analyzer meta only:\n /* skipWCPrefix */\n focus: FocusEvent;\n /* skipWCPrefix */\n blur: FocusEvent;\n igcOpening: CustomEvent<void>;\n igcOpened: CustomEvent<void>;\n igcClosing: CustomEvent<void>;\n igcClosed: CustomEvent<void>;\n}\n\nexport type ComboItemTemplate<T extends object> = (\n props: ComboTemplateProps<T>\n) => TemplateResult;\nexport interface ComboTemplateProps<T extends object> {\n item: T;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/combo/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { RenderItemFunction } from '@lit-labs/virtualizer/virtualize.js';\nimport type { ReactiveControllerHost, TemplateResult } from 'lit';\n\nimport type IgcComboComponent from './combo.js';\n\nexport type Keys<T> = keyof T;\nexport type Values<T> = T[keyof T];\nexport type Item<T extends object> = T | Values<T>;\n\nexport type ComboRecord<T extends object> = {\n value: T;\n header: boolean;\n dataIndex: number;\n};\n\nexport type ComboHost<T extends object> = ReactiveControllerHost &\n IgcComboComponent<T>;\n\nexport type GroupingDirection = 'asc' | 'desc' | 'none';\nexport type ComboChangeType = 'selection' | 'deselection' | 'addition';\nexport type ComboRenderFunction<T extends object> = RenderItemFunction<\n ComboRecord<T>\n>;\nexport type ComboValue<T> = T | Values<T>;\n\n/* jsonAPIPlainObject */\n/** Filtering options for the combo component. */\nexport interface FilteringOptions<T extends object> {\n /** The key in the data source used when filtering the list of options. */\n filterKey: Keys<T> | undefined;\n /** Determines whether the filtering operation should be case sensitive. */\n caseSensitive?: boolean;\n /** If true, the filter distinguishes between accented letters and their base letters */\n matchDiacritics?: boolean;\n}\n\nexport interface GroupingOptions<T extends object> {\n groupKey?: Keys<T>;\n valueKey?: Keys<T>;\n displayKey?: Keys<T>;\n direction: GroupingDirection;\n}\n\n/* marshalByValue */\nexport interface IgcComboChangeEventArgs<T extends object = any> {\n newValue: ComboValue<T>[];\n /* primitiveValue */\n items: T[];\n /* blazorAlternateName: changeType */\n type: ComboChangeType;\n}\n\nexport interface IgcComboComponentEventMap {\n igcChange: CustomEvent<IgcComboChangeEventArgs>;\n // For analyzer meta only:\n /* skipWCPrefix */\n focus: FocusEvent;\n /* skipWCPrefix */\n blur: FocusEvent;\n igcOpening: CustomEvent<void>;\n igcOpened: CustomEvent<void>;\n igcClosing: CustomEvent<void>;\n igcClosed: CustomEvent<void>;\n}\n\nexport type ComboItemTemplate<T extends object> = (\n props: ComboTemplateProps<T>\n) => TemplateResult;\nexport interface ComboTemplateProps<T extends object> {\n item: T;\n}\n"]}
|
|
@@ -7,6 +7,8 @@ export type TileManagerContext = {
|
|
|
7
7
|
instance: IgcTileManagerComponent;
|
|
8
8
|
/** The internal CSS grid container of the igc-tile-manager. */
|
|
9
9
|
grid: Ref<HTMLElement>;
|
|
10
|
+
/** Synchronizes the tile manager with the maximized state of its tiles. */
|
|
11
|
+
setMaximizedState: () => void;
|
|
10
12
|
};
|
|
11
13
|
declare const carouselContext: {
|
|
12
14
|
__context__: IgcCarouselComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/common/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/common/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAe7C,MAAM,eAAe,GAAG,aAAa,CACnC,MAAM,CAAC,kBAAkB,CAAC,CAC3B,CAAC;AAEF,MAAM,kBAAkB,GAAG,aAAa,CACtC,MAAM,CAAC,sBAAsB,CAAC,CAC/B,CAAC;AAEF,MAAM,WAAW,GAAG,aAAa,CAAY,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;AACrE,MAAM,oBAAoB,GAAG,aAAa,CACxC,MAAM,CAAC,yBAAyB,CAAC,CAClC,CAAC;AAEF,OAAO,EACL,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,kBAAkB,GACnB,CAAC","sourcesContent":["import { createContext } from '@lit/context';\nimport type { Ref } from 'lit/directives/ref.js';\nimport type IgcCarouselComponent from '../carousel/carousel.js';\nimport type { ChatState } from '../chat/chat-state.js';\nimport type IgcTileManagerComponent from '../tile-manager/tile-manager.js';\n\nexport type TileManagerContext = {\n /** The igc-tile-manager instance. */\n instance: IgcTileManagerComponent;\n /** The internal CSS grid container of the igc-tile-manager. */\n grid: Ref<HTMLElement>;\n /** Synchronizes the tile manager with the maximized state of its tiles. */\n setMaximizedState: () => void;\n};\n\nconst carouselContext = createContext<IgcCarouselComponent>(\n Symbol('carousel-context')\n);\n\nconst tileManagerContext = createContext<TileManagerContext>(\n Symbol('tile-manager-context')\n);\n\nconst chatContext = createContext<ChatState>(Symbol('chat-context'));\nconst chatUserInputContext = createContext<ChatState>(\n Symbol('chat-user-input-context')\n);\n\nexport {\n carouselContext,\n chatContext,\n chatUserInputContext,\n tileManagerContext,\n};\n"]}
|
|
@@ -141,6 +141,16 @@ declare class DragController implements ReactiveController {
|
|
|
141
141
|
private _setDragCancelListener;
|
|
142
142
|
private _setInitialState;
|
|
143
143
|
private _setDragState;
|
|
144
|
+
/**
|
|
145
|
+
* Toggles text selection for the duration of a drag operation.
|
|
146
|
+
*
|
|
147
|
+
* @remarks
|
|
148
|
+
* Disabling `user-select` only on the dragged element is not enough, since browsers
|
|
149
|
+
* (notably Safari) will still create a text selection in whatever elements sit under
|
|
150
|
+
* the pointer while dragging. Applying it to the owner document's body prevents that
|
|
151
|
+
* across the page for the active drag and is reverted once the operation completes.
|
|
152
|
+
*/
|
|
153
|
+
private _toggleTextSelection;
|
|
144
154
|
private _updateMatcher;
|
|
145
155
|
private _updatePosition;
|
|
146
156
|
private _updatePointerState;
|
|
@@ -166,7 +166,9 @@ class DragController {
|
|
|
166
166
|
Object.assign(this._element.style, {
|
|
167
167
|
touchAction: cssValue,
|
|
168
168
|
userSelect: cssValue,
|
|
169
|
+
webkitUserSelect: cssValue,
|
|
169
170
|
});
|
|
171
|
+
this._toggleTextSelection(enabled);
|
|
170
172
|
enabled
|
|
171
173
|
? this._element.setPointerCapture(this._id)
|
|
172
174
|
: this._element.releasePointerCapture(this._id);
|
|
@@ -177,6 +179,15 @@ class DragController {
|
|
|
177
179
|
: this._host.removeEventListener(type, this);
|
|
178
180
|
}
|
|
179
181
|
}
|
|
182
|
+
_toggleTextSelection(disabled) {
|
|
183
|
+
const value = disabled ? 'none' : '';
|
|
184
|
+
const { style } = this._host.ownerDocument.body;
|
|
185
|
+
style.userSelect = value;
|
|
186
|
+
style.webkitUserSelect = value;
|
|
187
|
+
if (disabled) {
|
|
188
|
+
this._host.ownerDocument.getSelection()?.removeAllRanges();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
180
191
|
_updateMatcher(event) {
|
|
181
192
|
if (!this._options.matchTarget) {
|
|
182
193
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
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} from 'lit';\nimport type { Ref } from 'lit/directives/ref.js';\n\nimport { getDefaultLayer } from '../../resize-container/default-ghost.js';\nimport { createAbortHandle } from '../abort-handler.js';\nimport { getElementFromPath, getRoot, isLTR, roundByDPR } from '../util.js';\n\ntype DragCallback = (parameters: DragCallbackParameters) => unknown;\ntype DragCancelCallback = (state: DragState) => unknown;\n\nexport type DragCallbackParameters = {\n event: PointerEvent;\n state: DragState;\n};\n\ntype State = {\n initial: DOMRect;\n current: DOMRect;\n position: { x: number; y: number };\n offset: { x: number; y: number };\n pointerState: {\n previous: { x: number; y: number };\n current: { x: number; y: number };\n direction: Direction;\n };\n};\n\ntype DragState = State & {\n ghost: HTMLElement | null;\n element: Element | null;\n};\n\ntype Direction = 'start' | 'end' | 'bottom' | 'top';\n\ntype DragControllerConfiguration = {\n /** Whether the drag feature is enabled for the current host. */\n enabled?: boolean;\n /**\n * The mode of the drag operation.\n *\n * Deferred will create a ghost element and keep the original element\n * at its place until the operation completes successfully.\n */\n mode?: 'immediate' | 'deferred';\n /**\n * Whether starting a drag operation should snap the dragged item's top left corner\n * to the cursor position.\n */\n snapToCursor?: boolean;\n /**\n * Guard function invoked during the `start` callback.\n * Returning a truthy value will stop the current drag operation.\n */\n skip?: (event: PointerEvent) => boolean;\n\n matchTarget?: (target: Element) => boolean;\n /**\n *\n */\n trigger?: () => HTMLElement;\n /**\n * Contain drag operations to the scope of the passed DOM element.\n */\n container?: Ref<HTMLElement>;\n /**\n * The DOM element that will \"host\" the ghost drag element when the controller\n * is set to **deferred**.\n *\n * @remarks\n * In **immediate** mode, this property is ignored.\n */\n layer?: () => HTMLElement;\n\n ghost?: () => HTMLElement;\n\n /** Callback invoked at the beginning of a drag operation. */\n start?: DragCallback;\n /** Callback invoked while dragging the target element. */\n move?: DragCallback;\n\n enter?: DragCallback;\n\n leave?: DragCallback;\n\n over?: DragCallback;\n\n /** Callback invoked during a drop operation. */\n end?: DragCallback;\n /** Callback invoked when a drag is cancelled */\n cancel?: DragCancelCallback;\n};\n\nconst additionalEvents = [\n 'pointermove',\n 'lostpointercapture',\n 'contextmenu',\n] as const;\n\nclass DragController implements ReactiveController {\n private readonly _host: ReactiveControllerHost & LitElement;\n private readonly _options: DragControllerConfiguration = {\n enabled: true,\n mode: 'deferred',\n snapToCursor: false,\n layer: getDefaultLayer,\n };\n\n private readonly _abortHandle = createAbortHandle();\n\n private _state!: State;\n\n private _matchedElement!: Element | null;\n\n private _id = -1;\n private _hasPointerCapture = false;\n\n private _ghost: HTMLElement | null = null;\n\n /** Whether `snapToCursor` is enabled for the controller. */\n private get _hasSnapping(): boolean {\n return Boolean(this._options.snapToCursor);\n }\n\n /** Whether the current drag mode is deferred. */\n private get _isDeferred(): boolean {\n return this._options.mode === 'deferred';\n }\n\n /**\n * The source element which will capture pointer events and initiate drag mode.\n *\n * @remarks\n * By default that will be the host element itself, unless `trigger` is passed in.\n */\n private get _element(): HTMLElement {\n return this._options.trigger?.() ?? this._host;\n }\n\n /**\n * The element being dragged.\n *\n * @remarks\n * When in **deferred** mode this returns a reference to the drag ghost element,\n * otherwise it is the host element.\n */\n private get _dragItem(): HTMLElement {\n return this._isDeferred ? this._ghost! : this._host;\n }\n\n /**\n * The DOM element that will \"host\" the ghost drag element when the controller\n * is set to **deferred**.\n *\n * @remarks\n * In **immediate** mode, this property is ignored.\n */\n private get _layer(): HTMLElement {\n if (!this._isDeferred) {\n return this._host;\n }\n\n return this._options.layer?.() ?? this._host;\n }\n\n private get _stateParameters(): DragState {\n return {\n ...this._state,\n ghost: this._ghost,\n element: this._matchedElement,\n };\n }\n\n constructor(\n host: ReactiveControllerHost & LitElement,\n options?: DragControllerConfiguration\n ) {\n this._host = host;\n this._host.addController(this);\n this.set(options);\n }\n\n // #region Public API\n\n /** Whether the drag controller is enabled. */\n public get enabled(): boolean {\n return Boolean(this._options.enabled);\n }\n\n /** Updates the drag controller configuration. */\n public set(options?: DragControllerConfiguration): void {\n Object.assign(this._options, options);\n }\n\n /** Stops any drag operation and cleans up state, additional event listeners and elements. */\n public dispose(): void {\n this._matchedElement = null;\n this._removeGhost();\n this._setDragState(false);\n }\n\n /** @internal */\n public hostConnected(): void {\n const { signal } = this._abortHandle;\n\n this._host.addEventListener('dragstart', this, { signal });\n this._host.addEventListener('touchstart', this, { passive: false, signal });\n this._host.addEventListener('pointerdown', this, { signal });\n }\n\n /** @internal */\n public hostDisconnected(): void {\n this._abortHandle.abort();\n this._setDragCancelListener(false);\n this._removeGhost();\n }\n\n /** @internal */\n public handleEvent(event: PointerEvent & KeyboardEvent): void {\n if (!this.enabled) {\n return;\n }\n\n switch (event.type) {\n case 'touchstart':\n case 'dragstart':\n // Prevent contextmenu default behavior during drag\n case 'contextmenu':\n event.preventDefault();\n break;\n case 'keydown':\n this._handleCancel(event);\n break;\n case 'pointerdown':\n this._handlePointerDown(event);\n break;\n case 'pointermove':\n this._handlePointerMove(event);\n break;\n case 'lostpointercapture':\n this._handlePointerEnd(event);\n break;\n }\n }\n\n // #endregion\n\n // #region Event handlers\n\n private _handlePointerDown(event: PointerEvent): void {\n if (this._shouldSkip(event)) {\n return;\n }\n\n this._setInitialState(event);\n this._createDragGhost();\n this._updatePosition(event);\n\n const parameters = {\n event,\n state: this._stateParameters,\n };\n\n if (this._options.start?.call(this._host, parameters) === false) {\n this.dispose();\n return;\n }\n\n this._assignPosition(this._dragItem);\n this._setDragState();\n }\n\n private _handlePointerMove(event: PointerEvent): void {\n if (!this._hasPointerCapture) {\n return;\n }\n\n this._updatePosition(event);\n this._updatePointerState(event);\n this._updateMatcher(event);\n\n const parameters = {\n event,\n state: this._stateParameters,\n };\n\n this._options.move?.call(this._host, parameters);\n\n this._assignPosition(this._dragItem);\n }\n\n private _handlePointerEnd(event: PointerEvent): void {\n this._options.end?.call(this._host, {\n event,\n state: this._stateParameters,\n });\n this.dispose();\n }\n\n private _handleCancel(event: KeyboardEvent): void {\n const key = event.key.toLowerCase();\n\n if (this._hasPointerCapture && key === 'escape') {\n // Reset state\n this._options.cancel?.call(this._host, this._stateParameters);\n }\n }\n\n // #endregion\n\n private _setDragCancelListener(enabled = true): void {\n enabled\n ? globalThis.addEventListener('keydown', this)\n : globalThis.removeEventListener('keydown', this);\n }\n\n private _setInitialState({\n pointerId,\n clientX,\n clientY,\n }: PointerEvent): void {\n const rect = this._host.getBoundingClientRect();\n const position = { x: rect.x, y: rect.y };\n const offset = { x: rect.x - clientX, y: rect.y - clientY };\n\n this._id = pointerId;\n this._state = {\n initial: rect,\n current: structuredClone(rect),\n position,\n offset,\n pointerState: {\n previous: { x: clientX, y: clientY },\n current: { x: clientX, y: clientY },\n direction: 'end',\n },\n };\n }\n\n private _setDragState(enabled = true): void {\n this._hasPointerCapture = enabled;\n const cssValue = enabled ? 'none' : '';\n\n Object.assign(this._element.style, {\n touchAction: cssValue,\n userSelect: cssValue,\n });\n\n enabled\n ? this._element.setPointerCapture(this._id)\n : this._element.releasePointerCapture(this._id);\n\n this._setDragCancelListener(enabled);\n\n // Toggle additional events\n for (const type of additionalEvents) {\n enabled\n ? this._host.addEventListener(type, this)\n : this._host.removeEventListener(type, this);\n }\n }\n\n private _updateMatcher(event: PointerEvent) {\n if (!this._options.matchTarget) {\n return;\n }\n\n const match = getRoot(this._host)\n .elementsFromPoint(event.clientX, event.clientY)\n .find((element) => this._options.matchTarget!.call(this._host, element));\n\n if (match && !this._matchedElement) {\n this._matchedElement = match;\n this._options.enter?.call(this._host, {\n event,\n state: this._stateParameters,\n });\n return;\n }\n\n if (!match && this._matchedElement) {\n this._options.leave?.call(this._host, {\n event,\n state: this._stateParameters,\n });\n this._matchedElement = null;\n return;\n }\n\n if (match && match === this._matchedElement) {\n this._options.over?.call(this._host, {\n event,\n state: this._stateParameters,\n });\n }\n }\n\n private _updatePosition({ clientX, clientY }: PointerEvent): void {\n const { x, y } = this._state.offset;\n const { x: layerX, y: layerY } = this._isDeferred\n ? this._layer.getBoundingClientRect()\n : this._state.initial;\n\n const posX = this._hasSnapping ? clientX - layerX : clientX - layerX + x;\n const posY = this._hasSnapping ? clientY - layerY : clientY - layerY + y;\n\n this._state.position = { x: posX, y: posY };\n }\n\n private _updatePointerState({ clientX, clientY }: PointerEvent): void {\n const state = this._state.pointerState;\n\n state.previous = { ...state.current };\n state.current = { x: clientX, y: clientY };\n\n const dx = state.current.x - state.previous.x;\n const dy = state.current.y - state.previous.y;\n\n if (Math.abs(dx) >= Math.abs(dy)) {\n const swapHorizontal = isLTR(this._host) ? dx >= 0 : dx <= 0;\n state.direction = swapHorizontal ? 'end' : 'start';\n } else {\n state.direction = dy >= 0 ? 'bottom' : 'top';\n }\n }\n\n private _assignPosition(element: HTMLElement): void {\n element.style.transform = `translate3d(${roundByDPR(this._state.position.x)}px,${roundByDPR(this._state.position.y)}px,0)`;\n }\n\n private _createDragGhost(): void {\n if (!this._isDeferred) {\n return;\n }\n\n this._ghost =\n this._options.ghost?.call(this._host) ??\n createDefaultDragGhost(this._host.getBoundingClientRect());\n\n this._layer.append(this._ghost);\n }\n\n private _removeGhost(): void {\n this._ghost?.remove();\n this._ghost = null;\n }\n\n private _shouldSkip(event: PointerEvent): boolean {\n return (\n Boolean(event.button) ||\n this._options.skip?.call(this._host, event) ||\n !getElementFromPath((e) => e === this._element, event)\n );\n }\n}\n\nfunction createDefaultDragGhost({ x, y, width, height }: DOMRect): HTMLElement {\n const element = document.createElement('div');\n\n Object.assign(element.style, {\n position: 'absolute',\n left: `${x}px`,\n top: `${y}px`,\n width: `${width}px`,\n height: `${height}px`,\n zIndex: 1000,\n background: 'gold',\n });\n\n return element;\n}\n\n/**\n * Adds a drag and drop controller to the given host\n */\nexport function addDragController(\n host: ReactiveControllerHost & LitElement,\n options?: DragControllerConfiguration\n): DragController {\n return new DragController(host, options);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"drag.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/drag.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,iBAAiB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b,KAAK,EAAE,GAAG,KAAK,IAAI;QACnB,MAAM,EAAE,GAAG,MAAM,IAAI;QACrB,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,MAAM;KACnB,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAKD,MAAM,UAAU,iBAAiB,CAC/B,IAAyC,EACzC,OAAqC;IAErC,OAAO,IAAI,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["import type {\n LitElement,\n ReactiveController,\n ReactiveControllerHost,\n} from 'lit';\nimport type { Ref } from 'lit/directives/ref.js';\n\nimport { getDefaultLayer } from '../../resize-container/default-ghost.js';\nimport { createAbortHandle } from '../abort-handler.js';\nimport { getElementFromPath, getRoot, isLTR, roundByDPR } from '../util.js';\n\ntype DragCallback = (parameters: DragCallbackParameters) => unknown;\ntype DragCancelCallback = (state: DragState) => unknown;\n\nexport type DragCallbackParameters = {\n event: PointerEvent;\n state: DragState;\n};\n\ntype State = {\n initial: DOMRect;\n current: DOMRect;\n position: { x: number; y: number };\n offset: { x: number; y: number };\n pointerState: {\n previous: { x: number; y: number };\n current: { x: number; y: number };\n direction: Direction;\n };\n};\n\ntype DragState = State & {\n ghost: HTMLElement | null;\n element: Element | null;\n};\n\ntype Direction = 'start' | 'end' | 'bottom' | 'top';\n\ntype DragControllerConfiguration = {\n /** Whether the drag feature is enabled for the current host. */\n enabled?: boolean;\n /**\n * The mode of the drag operation.\n *\n * Deferred will create a ghost element and keep the original element\n * at its place until the operation completes successfully.\n */\n mode?: 'immediate' | 'deferred';\n /**\n * Whether starting a drag operation should snap the dragged item's top left corner\n * to the cursor position.\n */\n snapToCursor?: boolean;\n /**\n * Guard function invoked during the `start` callback.\n * Returning a truthy value will stop the current drag operation.\n */\n skip?: (event: PointerEvent) => boolean;\n\n matchTarget?: (target: Element) => boolean;\n /**\n *\n */\n trigger?: () => HTMLElement;\n /**\n * Contain drag operations to the scope of the passed DOM element.\n */\n container?: Ref<HTMLElement>;\n /**\n * The DOM element that will \"host\" the ghost drag element when the controller\n * is set to **deferred**.\n *\n * @remarks\n * In **immediate** mode, this property is ignored.\n */\n layer?: () => HTMLElement;\n\n ghost?: () => HTMLElement;\n\n /** Callback invoked at the beginning of a drag operation. */\n start?: DragCallback;\n /** Callback invoked while dragging the target element. */\n move?: DragCallback;\n\n enter?: DragCallback;\n\n leave?: DragCallback;\n\n over?: DragCallback;\n\n /** Callback invoked during a drop operation. */\n end?: DragCallback;\n /** Callback invoked when a drag is cancelled */\n cancel?: DragCancelCallback;\n};\n\nconst additionalEvents = [\n 'pointermove',\n 'lostpointercapture',\n 'contextmenu',\n] as const;\n\nclass DragController implements ReactiveController {\n private readonly _host: ReactiveControllerHost & LitElement;\n private readonly _options: DragControllerConfiguration = {\n enabled: true,\n mode: 'deferred',\n snapToCursor: false,\n layer: getDefaultLayer,\n };\n\n private readonly _abortHandle = createAbortHandle();\n\n private _state!: State;\n\n private _matchedElement!: Element | null;\n\n private _id = -1;\n private _hasPointerCapture = false;\n\n private _ghost: HTMLElement | null = null;\n\n /** Whether `snapToCursor` is enabled for the controller. */\n private get _hasSnapping(): boolean {\n return Boolean(this._options.snapToCursor);\n }\n\n /** Whether the current drag mode is deferred. */\n private get _isDeferred(): boolean {\n return this._options.mode === 'deferred';\n }\n\n /**\n * The source element which will capture pointer events and initiate drag mode.\n *\n * @remarks\n * By default that will be the host element itself, unless `trigger` is passed in.\n */\n private get _element(): HTMLElement {\n return this._options.trigger?.() ?? this._host;\n }\n\n /**\n * The element being dragged.\n *\n * @remarks\n * When in **deferred** mode this returns a reference to the drag ghost element,\n * otherwise it is the host element.\n */\n private get _dragItem(): HTMLElement {\n return this._isDeferred ? this._ghost! : this._host;\n }\n\n /**\n * The DOM element that will \"host\" the ghost drag element when the controller\n * is set to **deferred**.\n *\n * @remarks\n * In **immediate** mode, this property is ignored.\n */\n private get _layer(): HTMLElement {\n if (!this._isDeferred) {\n return this._host;\n }\n\n return this._options.layer?.() ?? this._host;\n }\n\n private get _stateParameters(): DragState {\n return {\n ...this._state,\n ghost: this._ghost,\n element: this._matchedElement,\n };\n }\n\n constructor(\n host: ReactiveControllerHost & LitElement,\n options?: DragControllerConfiguration\n ) {\n this._host = host;\n this._host.addController(this);\n this.set(options);\n }\n\n // #region Public API\n\n /** Whether the drag controller is enabled. */\n public get enabled(): boolean {\n return Boolean(this._options.enabled);\n }\n\n /** Updates the drag controller configuration. */\n public set(options?: DragControllerConfiguration): void {\n Object.assign(this._options, options);\n }\n\n /** Stops any drag operation and cleans up state, additional event listeners and elements. */\n public dispose(): void {\n this._matchedElement = null;\n this._removeGhost();\n this._setDragState(false);\n }\n\n /** @internal */\n public hostConnected(): void {\n const { signal } = this._abortHandle;\n\n this._host.addEventListener('dragstart', this, { signal });\n this._host.addEventListener('touchstart', this, { passive: false, signal });\n this._host.addEventListener('pointerdown', this, { signal });\n }\n\n /** @internal */\n public hostDisconnected(): void {\n this._abortHandle.abort();\n this._setDragCancelListener(false);\n this._removeGhost();\n }\n\n /** @internal */\n public handleEvent(event: PointerEvent & KeyboardEvent): void {\n if (!this.enabled) {\n return;\n }\n\n switch (event.type) {\n case 'touchstart':\n case 'dragstart':\n // Prevent contextmenu default behavior during drag\n case 'contextmenu':\n event.preventDefault();\n break;\n case 'keydown':\n this._handleCancel(event);\n break;\n case 'pointerdown':\n this._handlePointerDown(event);\n break;\n case 'pointermove':\n this._handlePointerMove(event);\n break;\n case 'lostpointercapture':\n this._handlePointerEnd(event);\n break;\n }\n }\n\n // #endregion\n\n // #region Event handlers\n\n private _handlePointerDown(event: PointerEvent): void {\n if (this._shouldSkip(event)) {\n return;\n }\n\n this._setInitialState(event);\n this._createDragGhost();\n this._updatePosition(event);\n\n const parameters = {\n event,\n state: this._stateParameters,\n };\n\n if (this._options.start?.call(this._host, parameters) === false) {\n this.dispose();\n return;\n }\n\n this._assignPosition(this._dragItem);\n this._setDragState();\n }\n\n private _handlePointerMove(event: PointerEvent): void {\n if (!this._hasPointerCapture) {\n return;\n }\n\n this._updatePosition(event);\n this._updatePointerState(event);\n this._updateMatcher(event);\n\n const parameters = {\n event,\n state: this._stateParameters,\n };\n\n this._options.move?.call(this._host, parameters);\n\n this._assignPosition(this._dragItem);\n }\n\n private _handlePointerEnd(event: PointerEvent): void {\n this._options.end?.call(this._host, {\n event,\n state: this._stateParameters,\n });\n this.dispose();\n }\n\n private _handleCancel(event: KeyboardEvent): void {\n const key = event.key.toLowerCase();\n\n if (this._hasPointerCapture && key === 'escape') {\n // Reset state\n this._options.cancel?.call(this._host, this._stateParameters);\n }\n }\n\n // #endregion\n\n private _setDragCancelListener(enabled = true): void {\n enabled\n ? globalThis.addEventListener('keydown', this)\n : globalThis.removeEventListener('keydown', this);\n }\n\n private _setInitialState({\n pointerId,\n clientX,\n clientY,\n }: PointerEvent): void {\n const rect = this._host.getBoundingClientRect();\n const position = { x: rect.x, y: rect.y };\n const offset = { x: rect.x - clientX, y: rect.y - clientY };\n\n this._id = pointerId;\n this._state = {\n initial: rect,\n current: structuredClone(rect),\n position,\n offset,\n pointerState: {\n previous: { x: clientX, y: clientY },\n current: { x: clientX, y: clientY },\n direction: 'end',\n },\n };\n }\n\n private _setDragState(enabled = true): void {\n this._hasPointerCapture = enabled;\n const cssValue = enabled ? 'none' : '';\n\n Object.assign(this._element.style, {\n touchAction: cssValue,\n userSelect: cssValue,\n webkitUserSelect: cssValue,\n });\n\n this._toggleTextSelection(enabled);\n\n enabled\n ? this._element.setPointerCapture(this._id)\n : this._element.releasePointerCapture(this._id);\n\n this._setDragCancelListener(enabled);\n\n // Toggle additional events\n for (const type of additionalEvents) {\n enabled\n ? this._host.addEventListener(type, this)\n : this._host.removeEventListener(type, this);\n }\n }\n\n /**\n * Toggles text selection for the duration of a drag operation.\n *\n * @remarks\n * Disabling `user-select` only on the dragged element is not enough, since browsers\n * (notably Safari) will still create a text selection in whatever elements sit under\n * the pointer while dragging. Applying it to the owner document's body prevents that\n * across the page for the active drag and is reverted once the operation completes.\n */\n private _toggleTextSelection(disabled: boolean): void {\n const value = disabled ? 'none' : '';\n const { style } = this._host.ownerDocument.body;\n\n style.userSelect = value;\n style.webkitUserSelect = value;\n\n if (disabled) {\n this._host.ownerDocument.getSelection()?.removeAllRanges();\n }\n }\n\n private _updateMatcher(event: PointerEvent) {\n if (!this._options.matchTarget) {\n return;\n }\n\n const match = getRoot(this._host)\n .elementsFromPoint(event.clientX, event.clientY)\n .find((element) => this._options.matchTarget!.call(this._host, element));\n\n if (match && !this._matchedElement) {\n this._matchedElement = match;\n this._options.enter?.call(this._host, {\n event,\n state: this._stateParameters,\n });\n return;\n }\n\n if (!match && this._matchedElement) {\n this._options.leave?.call(this._host, {\n event,\n state: this._stateParameters,\n });\n this._matchedElement = null;\n return;\n }\n\n if (match && match === this._matchedElement) {\n this._options.over?.call(this._host, {\n event,\n state: this._stateParameters,\n });\n }\n }\n\n private _updatePosition({ clientX, clientY }: PointerEvent): void {\n const { x, y } = this._state.offset;\n const { x: layerX, y: layerY } = this._isDeferred\n ? this._layer.getBoundingClientRect()\n : this._state.initial;\n\n const posX = this._hasSnapping ? clientX - layerX : clientX - layerX + x;\n const posY = this._hasSnapping ? clientY - layerY : clientY - layerY + y;\n\n this._state.position = { x: posX, y: posY };\n }\n\n private _updatePointerState({ clientX, clientY }: PointerEvent): void {\n const state = this._state.pointerState;\n\n state.previous = { ...state.current };\n state.current = { x: clientX, y: clientY };\n\n const dx = state.current.x - state.previous.x;\n const dy = state.current.y - state.previous.y;\n\n if (Math.abs(dx) >= Math.abs(dy)) {\n const swapHorizontal = isLTR(this._host) ? dx >= 0 : dx <= 0;\n state.direction = swapHorizontal ? 'end' : 'start';\n } else {\n state.direction = dy >= 0 ? 'bottom' : 'top';\n }\n }\n\n private _assignPosition(element: HTMLElement): void {\n element.style.transform = `translate3d(${roundByDPR(this._state.position.x)}px,${roundByDPR(this._state.position.y)}px,0)`;\n }\n\n private _createDragGhost(): void {\n if (!this._isDeferred) {\n return;\n }\n\n this._ghost =\n this._options.ghost?.call(this._host) ??\n createDefaultDragGhost(this._host.getBoundingClientRect());\n\n this._layer.append(this._ghost);\n }\n\n private _removeGhost(): void {\n this._ghost?.remove();\n this._ghost = null;\n }\n\n private _shouldSkip(event: PointerEvent): boolean {\n return (\n Boolean(event.button) ||\n this._options.skip?.call(this._host, event) ||\n !getElementFromPath((e) => e === this._element, event)\n );\n }\n}\n\nfunction createDefaultDragGhost({ x, y, width, height }: DOMRect): HTMLElement {\n const element = document.createElement('div');\n\n Object.assign(element.style, {\n position: 'absolute',\n left: `${x}px`,\n top: `${y}px`,\n width: `${width}px`,\n height: `${height}px`,\n zIndex: 1000,\n background: 'gold',\n });\n\n return element;\n}\n\n/**\n * Adds a drag and drop controller to the given host\n */\nexport function addDragController(\n host: ReactiveControllerHost & LitElement,\n options?: DragControllerConfiguration\n): DragController {\n return new DragController(host, options);\n}\n"]}
|