first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
@@ -0,0 +1,109 @@
import * as React from 'react';
import type { IRefObject, IRenderFunction } from '../../Utilities';
import type { ICalloutProps } from '../../Callout';
import type { IPanelProps } from '../../Panel';
import type { ISelectableOption } from '../../utilities/selectableOption/SelectableOption.types';
/**
* - `TComponent` - Component used for reference properties, such as `componentRef`.
* - `TListenerElement` - Listener element associated with HTML event callbacks. Optional. If not provided,
* `TComponent` is assumed.
* {@docCategory ISelectableDroppableTextProps}
*/
export interface ISelectableDroppableTextProps<TComponent, TListenerElement> extends React.HTMLAttributes<TListenerElement> {
/**
* Optional callback to access the component interface (usually `IDropdown` or `IComboBox`).
* Use this instead of `ref` for accessing the public methods and properties of the component.
*/
componentRef?: IRefObject<TComponent>;
/**
* Descriptive label for the field
*/
label?: string;
/**
* Aria Label for the field for screen reader users.
*/
ariaLabel?: string;
/**
* ID of the field
*/
id?: string;
/**
* Additional class name for the root element.
*/
className?: string;
/**
* The key(s) that will be initially used to set a selected item.
*
* Mutually exclusive with `selectedKey`.
* For Dropdown (but not ComboBox) in multi-select mode, use `defaultSelectedKeys` instead.
*/
defaultSelectedKey?: string | number | string[] | number[] | null;
/**
* The key(s) of the selected item. If you provide this, you must maintain selection
* state by observing onChange events and passing a new value in when changed.
* Note that passing in `null` will cause selection to be reset.
*
* Mutually exclusive with `defaultSelectedKey`.
* For Dropdown (but not ComboBox) in multi-select mode, use `selectedKeys` instead.
*/
selectedKey?: string | number | string[] | number[] | null;
/**
* Whether multi-choice selections are allowed or not.
* @defaultvalue false
*/
multiSelect?: boolean;
/**
* Collection of options for this field
*/
options?: any;
/**
* Optional custom renderer for the option list container
*/
onRenderContainer?: IRenderFunction<ISelectableDroppableTextProps<TComponent, TListenerElement>>;
/**
* Optional custom renderer for the option list
*/
onRenderList?: IRenderFunction<ISelectableDroppableTextProps<TComponent, TListenerElement>>;
/**
* Optional custom renderer for all items, including headers and dividers as well as normal options.
*/
onRenderItem?: IRenderFunction<ISelectableOption>;
/**
* Optional custom renderer for normal and header options only.
* Use `onRenderItem` to control rendering for separators as well.
*/
onRenderOption?: IRenderFunction<ISelectableOption>;
/**
* Callback for when the options list callout is dismissed
*/
onDismiss?: () => void;
/**
* Whether or not the field is disabled.
*/
disabled?: boolean;
/**
* Whether or not the field is required.
*/
required?: boolean;
/**
* Custom properties for the Callout used to render the option list.
*/
calloutProps?: ICalloutProps;
/**
* Custom properties for the Panel used to render the option list on small devices.
*/
panelProps?: IPanelProps;
/**
* Error message for the field.
*/
errorMessage?: string;
/**
* Input placeholder text. Displayed until option is selected.
*/
placeholder?: string;
/**
* Whether or not the ComboBox/Dropdown should expand on keyboard focus.
* @defaultvalue false
*/
openOnKeyboardFocus?: boolean;
}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=SelectableDroppableText.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"SelectableDroppableText.types.js","sourceRoot":"../src/","sources":["utilities/selectableOption/SelectableDroppableText.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { IRefObject, IRenderFunction } from '../../Utilities';\nimport type { ICalloutProps } from '../../Callout';\nimport type { IPanelProps } from '../../Panel';\nimport type { ISelectableOption } from '../../utilities/selectableOption/SelectableOption.types';\n\n/**\n * - `TComponent` - Component used for reference properties, such as `componentRef`.\n * - `TListenerElement` - Listener element associated with HTML event callbacks. Optional. If not provided,\n * `TComponent` is assumed.\n * {@docCategory ISelectableDroppableTextProps}\n */\nexport interface ISelectableDroppableTextProps<TComponent, TListenerElement>\n extends React.HTMLAttributes<TListenerElement> {\n /**\n * Optional callback to access the component interface (usually `IDropdown` or `IComboBox`).\n * Use this instead of `ref` for accessing the public methods and properties of the component.\n */\n componentRef?: IRefObject<TComponent>;\n\n /**\n * Descriptive label for the field\n */\n label?: string;\n\n /**\n * Aria Label for the field for screen reader users.\n */\n ariaLabel?: string;\n\n /**\n * ID of the field\n */\n id?: string;\n\n /**\n * Additional class name for the root element.\n */\n className?: string;\n\n /**\n * The key(s) that will be initially used to set a selected item.\n *\n * Mutually exclusive with `selectedKey`.\n * For Dropdown (but not ComboBox) in multi-select mode, use `defaultSelectedKeys` instead.\n */\n defaultSelectedKey?: string | number | string[] | number[] | null;\n\n /**\n * The key(s) of the selected item. If you provide this, you must maintain selection\n * state by observing onChange events and passing a new value in when changed.\n * Note that passing in `null` will cause selection to be reset.\n *\n * Mutually exclusive with `defaultSelectedKey`.\n * For Dropdown (but not ComboBox) in multi-select mode, use `selectedKeys` instead.\n */\n selectedKey?: string | number | string[] | number[] | null;\n\n /**\n * Whether multi-choice selections are allowed or not.\n * @defaultvalue false\n */\n multiSelect?: boolean;\n\n /**\n * Collection of options for this field\n */\n options?: any;\n\n /**\n * Optional custom renderer for the option list container\n */\n onRenderContainer?: IRenderFunction<ISelectableDroppableTextProps<TComponent, TListenerElement>>;\n\n /**\n * Optional custom renderer for the option list\n */\n onRenderList?: IRenderFunction<ISelectableDroppableTextProps<TComponent, TListenerElement>>;\n\n /**\n * Optional custom renderer for all items, including headers and dividers as well as normal options.\n */\n onRenderItem?: IRenderFunction<ISelectableOption>;\n\n /**\n * Optional custom renderer for normal and header options only.\n * Use `onRenderItem` to control rendering for separators as well.\n */\n onRenderOption?: IRenderFunction<ISelectableOption>;\n\n /**\n * Callback for when the options list callout is dismissed\n */\n onDismiss?: () => void;\n\n /**\n * Whether or not the field is disabled.\n */\n disabled?: boolean;\n\n /**\n * Whether or not the field is required.\n */\n required?: boolean;\n\n /**\n * Custom properties for the Callout used to render the option list.\n */\n calloutProps?: ICalloutProps;\n\n /**\n * Custom properties for the Panel used to render the option list on small devices.\n */\n panelProps?: IPanelProps;\n\n /**\n * Error message for the field.\n */\n errorMessage?: string;\n\n /**\n * Input placeholder text. Displayed until option is selected.\n */\n placeholder?: string;\n\n /**\n * Whether or not the ComboBox/Dropdown should expand on keyboard focus.\n * @defaultvalue false\n */\n openOnKeyboardFocus?: boolean;\n}\n"]}
@@ -0,0 +1,2 @@
import type { ISelectableOption } from '../../utilities/selectableOption/SelectableOption.types';
export declare function getAllSelectedOptions(options: ISelectableOption[], selectedIndices: number[]): ISelectableOption[];
@@ -0,0 +1,12 @@
export function getAllSelectedOptions(options, selectedIndices) {
var selectedOptions = [];
for (var _i = 0, selectedIndices_1 = selectedIndices; _i < selectedIndices_1.length; _i++) {
var index = selectedIndices_1[_i];
var option = options[index];
if (option) {
selectedOptions.push(option);
}
}
return selectedOptions;
}
//# sourceMappingURL=SelectableOption.js.map
@@ -0,0 +1 @@
{"version":3,"file":"SelectableOption.js","sourceRoot":"../src/","sources":["utilities/selectableOption/SelectableOption.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CAAC,OAA4B,EAAE,eAAyB;IAC3F,IAAM,eAAe,GAAwB,EAAE,CAAC;IAChD,KAAoB,UAAe,EAAf,mCAAe,EAAf,6BAAe,EAAf,IAAe,EAAE,CAAC;QAAjC,IAAM,KAAK,wBAAA;QACd,IAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAE9B,IAAI,MAAM,EAAE,CAAC;YACX,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import type { ISelectableOption } from '../../utilities/selectableOption/SelectableOption.types';\n\nexport function getAllSelectedOptions(options: ISelectableOption[], selectedIndices: number[]): ISelectableOption[] {\n const selectedOptions: ISelectableOption[] = [];\n for (const index of selectedIndices) {\n const option = options[index];\n\n if (option) {\n selectedOptions.push(option);\n }\n }\n\n return selectedOptions;\n}\n"]}
@@ -0,0 +1,53 @@
export interface ISelectableOption<T = any> {
/**
* Arbitrary string associated with this option.
*/
key: string | number;
/**
* ID attribute associated with this option
*/
id?: string;
/**
* Text to render for this option
*/
text: string;
/**
* Title attribute (built in tooltip) for a given option.
*/
title?: string;
/**
* Text to render for this option
* Note: the SelectAll itemType is only supported on one option in multiselect components
*/
itemType?: SelectableOptionMenuItemType;
/**
* Index for this option
*/
index?: number;
/**
* The aria label for the dropdown option. If not present, the `text` will be used.
*/
ariaLabel?: string;
/** If option is selected. */
selected?: boolean;
/**
* Whether the option is disabled
* @defaultvalue false
*/
disabled?: boolean;
/**
* Defines whether the option is hidden or not.
* @defaultvalue false
*/
hidden?: boolean;
/**
* Data available to custom onRender functions.
*/
data?: T;
}
export declare enum SelectableOptionMenuItemType {
Normal = 0,
Divider = 1,
Header = 2,
SelectAll = 3
}
@@ -0,0 +1,8 @@
export var SelectableOptionMenuItemType;
(function (SelectableOptionMenuItemType) {
SelectableOptionMenuItemType[SelectableOptionMenuItemType["Normal"] = 0] = "Normal";
SelectableOptionMenuItemType[SelectableOptionMenuItemType["Divider"] = 1] = "Divider";
SelectableOptionMenuItemType[SelectableOptionMenuItemType["Header"] = 2] = "Header";
SelectableOptionMenuItemType[SelectableOptionMenuItemType["SelectAll"] = 3] = "SelectAll";
})(SelectableOptionMenuItemType || (SelectableOptionMenuItemType = {}));
//# sourceMappingURL=SelectableOption.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"SelectableOption.types.js","sourceRoot":"../src/","sources":["utilities/selectableOption/SelectableOption.types.ts"],"names":[],"mappings":"AA0DA,MAAM,CAAN,IAAY,4BAKX;AALD,WAAY,4BAA4B;IACtC,mFAAU,CAAA;IACV,qFAAW,CAAA;IACX,mFAAU,CAAA;IACV,yFAAa,CAAA;AACf,CAAC,EALW,4BAA4B,KAA5B,4BAA4B,QAKvC","sourcesContent":["export interface ISelectableOption<T = any> {\n /**\n * Arbitrary string associated with this option.\n */\n key: string | number;\n\n /**\n * ID attribute associated with this option\n */\n id?: string;\n\n /**\n * Text to render for this option\n */\n text: string;\n\n /**\n * Title attribute (built in tooltip) for a given option.\n */\n title?: string;\n\n /**\n * Text to render for this option\n * Note: the SelectAll itemType is only supported on one option in multiselect components\n */\n itemType?: SelectableOptionMenuItemType;\n\n /**\n * Index for this option\n */\n index?: number;\n\n /**\n * The aria label for the dropdown option. If not present, the `text` will be used.\n */\n ariaLabel?: string;\n\n /** If option is selected. */\n selected?: boolean;\n\n /**\n * Whether the option is disabled\n * @defaultvalue false\n */\n disabled?: boolean;\n\n /**\n * Defines whether the option is hidden or not.\n * @defaultvalue false\n */\n hidden?: boolean;\n\n /**\n * Data available to custom onRender functions.\n */\n data?: T;\n}\n\nexport enum SelectableOptionMenuItemType {\n Normal = 0,\n Divider = 1,\n Header = 2,\n SelectAll = 3,\n}\n"]}
@@ -0,0 +1,3 @@
export * from './SelectableOption';
export * from './SelectableOption.types';
export * from './SelectableDroppableText.types';
+4
View File
@@ -0,0 +1,4 @@
export * from './SelectableOption';
export * from './SelectableOption.types';
export * from './SelectableDroppableText.types';
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["utilities/selectableOption/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './SelectableOption';\nexport * from './SelectableOption.types';\nexport * from './SelectableDroppableText.types';\n"]}