type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
t => { const element = ( <span contentEditable> <a contentEditable={false}>Download</a> </span>
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const element = ( // @ts-expect-error <a href={undefined} title={null}> Download </a>
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const element = <a id={'"test"'}>Download</a>; t.is(element.outerHTML, '<a id="&quot;test&quot;">Download</a>'); }
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const element = <div>{'<script>alert();</script>'}</div>; t.is(element.outerHTML, '<div>&lt;script&gt;alert();&lt;/script&gt;</div>'); }
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const element = ( <div dangerouslySetInnerHTML={{__html: '<script>alert();</script>'}}
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const addEventListener = spy(EventTarget.prototype, 'addEventListener'); const handleClick = function () {}; const element = ( <a href="#" onClick={handleClick}> Download </a>
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const addEventListener = spy(EventTarget.prototype, 'addEventListener'); const handler = function () {}; const element = ( <a href="#" onremote-input={handler} on-remote-input={handler}> Download </a>
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const createDocumentFragment = spy(document, 'createDocumentFragment'); const fragment = <>test</>; const fragmentHTML = getFragmentHTML(fragment); t.is(fragmentHTML, 'test'); t.true(createDocumentFragment.calledOnce); t.deepEqual(createDocumentFragment.firstCall.args, []); }
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const fragment = ( <> <h1>test</h1> </> ); const fragmentHTML = getFragmentHTML(fragment); t.is(fragmentHTML, '<h1>test</h1>'); }
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const fragment = ( <> <h1>heading</h1> text </> ); const fragmentHTML = getFragmentHTML(fragment); t.is(fragmentHTML, '<h1>heading</h1> text'); }
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const element = ( <div> <> <h1>heading</h1> text </> <span>outside fragment</span> </div>
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const Icon = () => <i/>; const element = <Icon />; t.is(element.outerHTML, '<i></i>'); }
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
() => <i/>;
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const Icon = () => <i className="sweet">Gummy <span>bears</span></i>; const element = <Icon />; t.is(element.outerHTML, '<i class="sweet">Gummy <span>bears</span></i>'); }
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
() => <i className
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
t => { const Icon = () => <i className="sweet">Gummy <span>bears</span></i>; // @ts-expect-error const element = <Icon className="yellow"> and <b>lollipops</b></Icon>; t.is( element.outerHTML, '<i class="sweet yellow">Gummy <span>bears</span> and <b>lollipops</b></i>' ); }
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ArrowFunction
n => n.outerHTML || n.textContent
TheRealSyler/dom-chef
tests/index.tsx
TypeScript
ClassDeclaration
export class pairEntityData{ toCurrency: any; pairedCurrency: any; }
templeandaegeandas/bolenum_adminapp
src/app/pages/addNewPair/entity/addNewPair.details.ts
TypeScript
ArrowFunction
(a, b) => a.performanceImpact - b.performanceImpact
iGod42/svl-reservation-rules
src/evaluation/RuleEvaluator.ts
TypeScript
ArrowFunction
(options: RuleEvaluationOptions) => { for (let rule of this.rules) { const message = rule.evaluate(options) if (message) return message } }
iGod42/svl-reservation-rules
src/evaluation/RuleEvaluator.ts
TypeScript
ArrowFunction
(options: BulkRuleEvaluationOptions) => { this.rules.forEach(rule => rule.evaluateBulk(options)) }
iGod42/svl-reservation-rules
src/evaluation/RuleEvaluator.ts
TypeScript
ArrowFunction
rule => rule.evaluateBulk(options)
iGod42/svl-reservation-rules
src/evaluation/RuleEvaluator.ts
TypeScript
ClassDeclaration
export class RuleEvaluator { private readonly rules: Rule[] constructor(rules: RuleDefinition[]) { this.rules = parseRules(rules).sort( (a, b) => a.performanceImpact - b.performanceImpact ) } evaluate = (options: RuleEvaluationOptions) => { for (let rule of this.rules) { const message = rule.evaluate(...
iGod42/svl-reservation-rules
src/evaluation/RuleEvaluator.ts
TypeScript
ArrowFunction
() => { it('should render correctly', () => { const props: Props = { game: testGame }; const component = shallow(<GameInfo {...props} />); expect(component).toMatchSnapshot(); }); }
Archinowsk/konsti-client
src/views/all-games/components/test/GameInfo.test.tsx
TypeScript
ArrowFunction
() => { const props: Props = { game: testGame }; const component = shallow(<GameInfo {...props} />); expect(component).toMatchSnapshot(); }
Archinowsk/konsti-client
src/views/all-games/components/test/GameInfo.test.tsx
TypeScript
FunctionDeclaration
function Sender() { const [emittedPhoton, setEmittedPhoton] = useState<React.ReactNode>(null); const [passingPhoton, setPassingPhoton] = useState<React.ReactNode>(null); const [polarizedPhoton, setPolarizedPhoton] = useState<React.ReactNode>(null); function handlePhotonEmission(photon: React.ReactNode...
picturestone/qkd-game
qkd-game-client/src/components/game/Sender.tsx
TypeScript
FunctionDeclaration
function handlePhotonEmission(photon: React.ReactNode) { setEmittedPhoton(photon); }
picturestone/qkd-game
qkd-game-client/src/components/game/Sender.tsx
TypeScript
FunctionDeclaration
function handleEmittedPhotonTransported(photon: React.ReactNode) { setEmittedPhoton(null); setPassingPhoton(photon); }
picturestone/qkd-game
qkd-game-client/src/components/game/Sender.tsx
TypeScript
FunctionDeclaration
function handlePhotonPassed(photon: React.ReactNode) { setPassingPhoton(null); setPolarizedPhoton(photon) }
picturestone/qkd-game
qkd-game-client/src/components/game/Sender.tsx
TypeScript
FunctionDeclaration
function handlePolarizedPhotonTransported(photon: React.ReactNode) { console.log((photon as any).props.qbit.polarization); setPolarizedPhoton(null); }
picturestone/qkd-game
qkd-game-client/src/components/game/Sender.tsx
TypeScript
ArrowFunction
(last, current) => last + current.length
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
ArrowFunction
job => { switch (job.type) { case 'string': this.#offset += this.encodeString(dataView, job); break; case 'float32': this.#offset += this.encodeValue(dataView, dataView.setFloat32, job); break; case 'float64': this.#offse...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
InterfaceDeclaration
/** @internal */ interface BufferJob { type: BufferContentType, value: number | string, length: number, encoding?: BufferStringEncoding, littleEndian?: boolean }
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
InterfaceDeclaration
export interface BufferCodecConstructorOptions { buffer?: ArrayBuffer, encoding?: BufferStringEncoding }
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Creates a new BufferCodec instance from given buffer * @param {Buffer | ArrayBuffer} buffer Either ArrayBuffer or Buffer * @returns {BufferCodec} A new instance of BufferCodec */ static from(buffer: Buffer | ArrayBuffer): BufferCodec { if (buffer && buffer.byteLength > 0) { if (buffer instan...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Sets string encoding * @param encoding {BufferStringEncoding} String encoding (either 'utf8' or 'utf16') * @returns {BufferCodec} Current instance of BufferCodec */ setEncoding(encoding: BufferStringEncoding): BufferCodec { if (encoding !== 'utf16' && encoding !== 'utf8') { throw new Error(`...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Encode all queued values and return resulting buffer * @returns {ArrayBuffer} Encoded buffer */ result(): ArrayBuffer { this.#offset = 0; const bufferLength = this.#jobs.reduce((last, current) => last + current.length, 0); const buffer = new ArrayBuffer(bufferLength); const dataView = ...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Decode a single value from current offset * @param options {BufferTypeOptions} Value decoding options * @returns Decoded value */ decode(options: BufferTypeOptions): any { const dataView = this.#dataView!; let itemValue; switch (options.type) { case 'int8': itemValue = data...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Decode the whole buffer using provided template * @param template {BufferTemplate | BufferTemplate[]} Template to use for buffer decoding * @returns {any} Decoded object */ parse(template: BufferTemplate | BufferTemplate[]): any { return BufferStrategy.decode(template, this); }
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Encodes a string value * @param value {string} String to encode * @param encoding {BufferStringEncoding} String encoding (either 'utf8' or 'utf16'). This parameter takes precedence over the general encoding property set on BufferCodec instance * @returns {BufferCodec} Current instance of BufferCodec ...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Encode a signed 8-bit number * @param value 8-bit numeric value * @returns {BufferCodec} Current instance of BufferCodec */ int8(value: number): BufferCodec { this.#jobs.push({ value, type: 'int8', length: 1 }); return this; }
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Encode an unsigned 8-bit number * @param value 8-bit numeric value * @returns {BufferCodec} Current instance of BufferCodec */ uint8(value: number): BufferCodec { this.#jobs.push({ value, type: 'uint8', length: 1 }); return this; }
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Encode a signed 16-bit number * @param value 16-bit numeric value * @returns {BufferCodec} Current instance of BufferCodec */ int16(value: number, littleEndian: boolean = false): BufferCodec { this.#jobs.push({ value, type: 'int16', length: 2, littleEndian }); retu...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Encode an unsigned 16-bit number * @param value 16-bit numeric value * @returns {BufferCodec} Current instance of BufferCodec */ uint16(value: number, littleEndian: boolean = false): BufferCodec { this.#jobs.push({ value, type: 'uint16', length: 2, littleEndian }); ...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Encode a signed 32-bit number * @param value 32-bit numeric value * @returns {BufferCodec} Current instance of BufferCodec */ int32(value: number, littleEndian: boolean = false): BufferCodec { this.#jobs.push({ value, type: 'int32', length: 4, littleEndian }); retu...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Encode an unsigned 32-bit number * @param value 32-bit numeric value * @returns {BufferCodec} Current instance of BufferCodec */ uint32(value: number, littleEndian: boolean = false): BufferCodec { this.#jobs.push({ value, type: 'uint32', length: 4, littleEndian }); ...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Encode a 32-bit float * @param value 32-bit numeric value * @returns {BufferCodec} Current instance of BufferCodec */ float32(value: number, littleEndian: boolean = false): BufferCodec { this.#jobs.push({ value, type: 'float32', length: 4, littleEndian }); return t...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
/** * Encode a 64-bit float * @param value 64-bit numeric value * @returns {BufferCodec} Current instance of BufferCodec */ float64(value: number, littleEndian: boolean = false): BufferCodec { this.#jobs.push({ value, type: 'float64', length: 8, littleEndian }); return t...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
private decodeString(dataView: DataView, encoding: BufferStringEncoding): [string, number] { let currentOffset = this.#offset; let result = ''; const contentLength = dataView.getUint8(currentOffset++); if (encoding === 'utf16') { const utf16 = new ArrayBuffer(contentLength * 2); const...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
private encodeString(dataView: DataView, job: BufferJob): number { const value = job.value as string; const valueLength = value.length; let currentOffset = this.#offset; dataView.setUint8(currentOffset++, valueLength); switch (job.encoding) { case 'utf16': for (let i = 0; i < (...
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
MethodDeclaration
private encodeValue(dataView: DataView, fn: (...args: any[]) => void, job: BufferJob): number { fn.call(dataView, this.#offset, job.value as number, job.littleEndian); return job.length; }
emmorts/buffercodec
lib/BufferCodec.ts
TypeScript
ArrowFunction
({ onClickOutside }) => { const ref = useRef(null); useOnClickOutside({ ref, handler: onClickOutside }); return ( <> <div ref={ref} data-testid="div-test-id"> test-div </div> <button type="button" data-testid="button-test-id"> test-button </button> </>
ttteam-org/ttteam-vega-ui
packages/hooks/src/use-on-click-outside/use-on-click-outside.test.tsx
TypeScript
ArrowFunction
() => { document.addEventListener = defaultEventListener; }
ttteam-org/ttteam-vega-ui
packages/hooks/src/use-on-click-outside/use-on-click-outside.test.tsx
TypeScript
ArrowFunction
() => { handleClickOutside.mockReset(); }
ttteam-org/ttteam-vega-ui
packages/hooks/src/use-on-click-outside/use-on-click-outside.test.tsx
TypeScript
ArrowFunction
() => { test('коллбек не вызывается, если кликнули на элемент, который обернут в хук', () => { const eventsMap: Record<string, EventListener> = {}; document.addEventListener = jest.fn((event, cb: EventListener) => { eventsMap[event] = cb; }); render(<HookedComponent onClickOutside={handleClick...
ttteam-org/ttteam-vega-ui
packages/hooks/src/use-on-click-outside/use-on-click-outside.test.tsx
TypeScript
ArrowFunction
() => { const eventsMap: Record<string, EventListener> = {}; document.addEventListener = jest.fn((event, cb: EventListener) => { eventsMap[event] = cb; }); render(<HookedComponent onClickOutside={handleClickOutside} />); const div = screen.getByTestId('div-test-id'); const event: Mouse...
ttteam-org/ttteam-vega-ui
packages/hooks/src/use-on-click-outside/use-on-click-outside.test.tsx
TypeScript
ArrowFunction
(event, cb: EventListener) => { eventsMap[event] = cb; }
ttteam-org/ttteam-vega-ui
packages/hooks/src/use-on-click-outside/use-on-click-outside.test.tsx
TypeScript
ArrowFunction
() => { const eventsMap: Record<string, EventListener> = {}; document.addEventListener = jest.fn((event, cb: EventListener) => { eventsMap[event] = cb; }); render(<HookedComponent onClickOutside={handleClickOutside} />); const button = screen.getByTestId('button-test-id'); const event...
ttteam-org/ttteam-vega-ui
packages/hooks/src/use-on-click-outside/use-on-click-outside.test.tsx
TypeScript
TypeAliasDeclaration
type Props = { onClickOutside: (e: MouseEvent | TouchEvent) => void; };
ttteam-org/ttteam-vega-ui
packages/hooks/src/use-on-click-outside/use-on-click-outside.test.tsx
TypeScript
ClassDeclaration
@NgModule({ imports: [ CommonModule, FormsModule, IonicModule, ClientsPageRoutingModule, SharedModule ], declarations: [ClientsPage] }) export class ClientsPageModule {}
Hamza-IT/Ionic-App
src/app/front_end/doctor_coach/clients/clients.module.ts
TypeScript
ArrowFunction
(unix: string | number): string => { return dayjs.unix(Number(unix) / 1000 / 1000).toISOString() }
10088/supabase
studio/components/interfaces/Settings/Logs/Logs.utils.ts
TypeScript
ArrowFunction
(unix: string | number): boolean => { const digitLength = String(unix).length === 16 const isNum = !Number.isNaN(Number(unix)) return isNum && digitLength }
10088/supabase
studio/components/interfaces/Settings/Logs/Logs.utils.ts
TypeScript
ArrowFunction
(log: LogData) => log && log.timestamp && log.metadata && log.event_message && log.id && Object.keys(log).length === 4
10088/supabase
studio/components/interfaces/Settings/Logs/Logs.utils.ts
TypeScript
ArrowFunction
(obj: { [k: string]: unknown }, parent?: string): string[] => { const keys = Object.keys(obj).filter((k) => obj[k]) return keys.flatMap((k) => { const currKey = parent ? `${parent}.${k}` : k if (typeof obj[k] === 'object') { return getDotKeys(obj[k] as any, currKey) } else { return [currKey...
10088/supabase
studio/components/interfaces/Settings/Logs/Logs.utils.ts
TypeScript
ArrowFunction
(k) => obj[k]
10088/supabase
studio/components/interfaces/Settings/Logs/Logs.utils.ts
TypeScript
ArrowFunction
(k) => { const currKey = parent ? `${parent}.${k}` : k if (typeof obj[k] === 'object') { return getDotKeys(obj[k] as any, currKey) } else { return [currKey] } }
10088/supabase
studio/components/interfaces/Settings/Logs/Logs.utils.ts
TypeScript
ArrowFunction
(table: LogsTableName, filters: Filters) => { const keys = Object.keys(filters) const filterTemplates = SQL_FILTER_TEMPLATES[table] const _resolveTemplateToStatement = (dotKey: string): string | null => { const template = filterTemplates[dotKey] const value = get(filters, dotKey) if (value !== undefi...
10088/supabase
studio/components/interfaces/Settings/Logs/Logs.utils.ts
TypeScript
ArrowFunction
(dotKey: string): string | null => { const template = filterTemplates[dotKey] const value = get(filters, dotKey) if (value !== undefined && typeof template === 'function') { return template(value) } else if (template === undefined) { // resolve unknwon filters (possibly from filter override...
10088/supabase
studio/components/interfaces/Settings/Logs/Logs.utils.ts
TypeScript
ArrowFunction
(rootKey) => { if (typeof filters[rootKey] === 'object') { // join all statements with an OR const nestedStatements = getDotKeys(filters[rootKey] as Filters, rootKey) .map(_resolveTemplateToStatement) .filter(Boolean) if (nestedStatements.length > 0) { retur...
10088/supabase
studio/components/interfaces/Settings/Logs/Logs.utils.ts
TypeScript
ArrowFunction
(table: LogsTableName, filters: Filters) => { const where = _genWhereStatement(table, filters) switch (table) { case 'edge_logs': return `select id, timestamp, event_message, metadata, request, response, request.method, request.path, response.status_code from ${table} cross join unnest(metadata) as ...
10088/supabase
studio/components/interfaces/Settings/Logs/Logs.utils.ts
TypeScript
ArrowFunction
(resolve, reject) => { let id = route.paramMap.get('id'); this.firebaseService.getRoutineDetails(id).then(routine => { routine.subscribe( data => { data.id = id; resolve(data); }) }) }
m3yevn/beabuddhist
src/app/pages/view/view-routine/view-routine.resolver.ts
TypeScript
ArrowFunction
routine => { routine.subscribe( data => { data.id = id; resolve(data); }) }
m3yevn/beabuddhist
src/app/pages/view/view-routine/view-routine.resolver.ts
TypeScript
ArrowFunction
data => { data.id = id; resolve(data); }
m3yevn/beabuddhist
src/app/pages/view/view-routine/view-routine.resolver.ts
TypeScript
ArrowFunction
(resolve, reject) => { let id = route.paramMap.get('id'); this.firebaseService.getRoutineTasks(id).then(routine => { routine.subscribe( data => { resolve(data); }) }) }
m3yevn/beabuddhist
src/app/pages/view/view-routine/view-routine.resolver.ts
TypeScript
ArrowFunction
routine => { routine.subscribe( data => { resolve(data); }) }
m3yevn/beabuddhist
src/app/pages/view/view-routine/view-routine.resolver.ts
TypeScript
ArrowFunction
data => { resolve(data); }
m3yevn/beabuddhist
src/app/pages/view/view-routine/view-routine.resolver.ts
TypeScript
ClassDeclaration
@Injectable() export class ViewRoutineResolver implements Resolve<any> { constructor(public firebaseService: FirebaseService,) { } resolve(route: ActivatedRouteSnapshot) { return new Promise((resolve, reject) => { let id = route.paramMap.get('id'); this.firebaseService.getRoutineDetails(id).then...
m3yevn/beabuddhist
src/app/pages/view/view-routine/view-routine.resolver.ts
TypeScript
ClassDeclaration
@Injectable() export class TasksResolver implements Resolve<any> { constructor(public firebaseService: FirebaseService,) { } resolve(route: ActivatedRouteSnapshot) { return new Promise((resolve, reject) => { let id = route.paramMap.get('id'); this.firebaseService.getRoutineTasks(id).then(routine...
m3yevn/beabuddhist
src/app/pages/view/view-routine/view-routine.resolver.ts
TypeScript
MethodDeclaration
resolve(route: ActivatedRouteSnapshot) { return new Promise((resolve, reject) => { let id = route.paramMap.get('id'); this.firebaseService.getRoutineDetails(id).then(routine => { routine.subscribe( data => { data.id = id; resolve(data); }) }) }) }
m3yevn/beabuddhist
src/app/pages/view/view-routine/view-routine.resolver.ts
TypeScript
MethodDeclaration
resolve(route: ActivatedRouteSnapshot) { return new Promise((resolve, reject) => { let id = route.paramMap.get('id'); this.firebaseService.getRoutineTasks(id).then(routine => { routine.subscribe( data => { resolve(data); }) }) }) }
m3yevn/beabuddhist
src/app/pages/view/view-routine/view-routine.resolver.ts
TypeScript
FunctionDeclaration
export function MultiSelect<T>(props: MultiSelectProps<T>) { const { ariaDescribedBy, components: customComponents, errorMessage, hasError, helperMessage, inputStyle, isLabelVisuallyHidden, innerRef, itemToString, items, labelPosition, labelStyle, labelText, di...
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
FunctionDeclaration
function checkSelectedItemValidity(itemToCheck: T) { return ( items.findIndex(i => itemToString(i) === itemToString(itemToCheck)) !== -1 ); }
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
FunctionDeclaration
function getFilteredItems(unfilteredItems) { return unfilteredItems.filter( item => selectedItems.findIndex( selectedItem => itemToString(selectedItem) === itemToString(item) ) < 0 ); }
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
FunctionDeclaration
function stateReducer(state, actionAndChanges) { const { type, changes } = actionAndChanges; switch (type) { case useSelect.stateChangeTypes.ToggleButtonKeyDownCharacter: return { ...changes, selectedItem: state.selectedItem, }; default: return changes; ...
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
FunctionDeclaration
function defaultOnSelectedItemChange(changes) { const { selectedItem: newSelectedItem } = changes; if (newSelectedItem) { addSelectedItem(newSelectedItem); selectItem(null); } }
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
FunctionDeclaration
function handleRemoveSelectedItem(event: React.SyntheticEvent, selectedItem) { event.stopPropagation(); onRemoveSelectedItem && typeof onRemoveSelectedItem === 'function' ? onRemoveSelectedItem(selectedItem) : removeSelectedItem(selectedItem); }
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
ArrowFunction
i => itemToString(i) === itemToString(itemToCheck)
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
ArrowFunction
item => selectedItems.findIndex( selectedItem => itemToString(selectedItem) === itemToString(item) ) < 0
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
ArrowFunction
selectedItem => itemToString(selectedItem) === itemToString(item)
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
ArrowFunction
event => { if ( document.activeElement.tagName.toLowerCase() === 'button' && (event.key === 'Backspace' || event.key === 'Delete' || event.key === 'ArrowLeft') ) { event.nativeEvent.preventDownshiftDefault = true; } if (event.key ==...
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
ArrowFunction
(multiSelectedItem, index) => { const multiSelectedItemString = itemToString(multiSelectedItem); return ( <SelectedItemButton aria-label={i18n.multiSelect.selectedItemButtonAriaLabel.replace( /\{selectedItem\}/g, mult...
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
MethodDeclaration
handleRemoveSelectedItem(event, multiSelectedItem)
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
MethodDeclaration
getFilteredItems(items)
Malgalad/react-magma
packages/react-magma-dom/src/components/Select/MultiSelect.tsx
TypeScript
ArrowFunction
(format: StyleResourcesFileFormat): StyleResourcesLoaderOptions => ({ patterns: `./${format}/resources.${format}`, })
VisonM/style-resources-loader
test/options/string-pattern.ts
TypeScript
InterfaceDeclaration
export interface Props { block?: boolean; children?: ReactNode; className?: string; disabled?: boolean; size?: 'large' | 'regular' | 'small' | 'x-small' | 'custom'; theme?: 'default' | 'primary'; variant?: 'contained' | 'outlined' | 'link' | 'text'; }
MilanBariya/OpenMetadata
openmetadata-ui/src/main/resources/ui/src/components/buttons/Button/Button.interface.ts
TypeScript
InterfaceDeclaration
export interface ButtonAsButtonProps extends Props, React.ButtonHTMLAttributes<HTMLButtonElement> { /** * The element that should be rendered as a button */ tag?: 'button'; /** * The native HTML button type */ type?: 'button' | 'submit' | 'reset'; }
MilanBariya/OpenMetadata
openmetadata-ui/src/main/resources/ui/src/components/buttons/Button/Button.interface.ts
TypeScript
InterfaceDeclaration
export interface ButtonAsAnchorProps extends Props, React.AnchorHTMLAttributes<HTMLAnchorElement> { tag?: 'a'; }
MilanBariya/OpenMetadata
openmetadata-ui/src/main/resources/ui/src/components/buttons/Button/Button.interface.ts
TypeScript
InterfaceDeclaration
export interface ButtonAsOtherProps extends Props, React.AnchorHTMLAttributes<HTMLAnchorElement> { tag?: string; }
MilanBariya/OpenMetadata
openmetadata-ui/src/main/resources/ui/src/components/buttons/Button/Button.interface.ts
TypeScript
TypeAliasDeclaration
export type ButtonProps = | ButtonAsButtonProps | ButtonAsAnchorProps | ButtonAsOtherProps;
MilanBariya/OpenMetadata
openmetadata-ui/src/main/resources/ui/src/components/buttons/Button/Button.interface.ts
TypeScript
TypeAliasDeclaration
export type Ref = ReactNode | HTMLElement | string;
MilanBariya/OpenMetadata
openmetadata-ui/src/main/resources/ui/src/components/buttons/Button/Button.interface.ts
TypeScript