text
stringlengths
9
39.2M
dir
stringlengths
26
295
lang
stringclasses
185 values
created_date
timestamp[us]
updated_date
timestamp[us]
repo_name
stringlengths
1
97
repo_full_name
stringlengths
7
106
star
int64
1k
183k
len_tokens
int64
1
13.8M
```xml import * as request from 'supertest' import * as express from 'express' import { resolve } from 'path' import { Liquid } from '../..' describe('express()', function () { const root = resolve(__dirname, '../stub/root') const views = resolve(__dirname, '../stub/views') const partials = resolve(__dirname, '../stub/partials') let app: express.Application, engine: Liquid beforeEach(function () { app = express() engine = new Liquid({ root, extname: '.html' }) app.set('view engine', 'html') app.engine('html', engine.express()) app.get('/name', (req, res) => res.render('name', { name: 'harttle' })) app.get('/include/:file', (req, res) => res.render('include', { file: req.params.file })) }) it('should respect express views(array)', function (done) { app.set('views', [views]) request(app).get('/name') .expect('My name is harttle.') .expect(200, done) }) it('should respect express views(string)', function (done) { app.set('views', views) request(app).get('/include/bar') .expect('bar') .expect(200, done) }) it('should pass error when file not found', function (done) { const view = { root: [] } const file = '/not-exist.html' const ctx = {} engine.express().call(view, file, ctx, function (err: any) { try { expect(err.code).toBe('ENOENT') expect(err.message).toMatch(/Failed to lookup/) done() } catch (e) { done(e) } }) }) it('should respect root option when lookup', function (done) { app.set('views', [views]) request(app).get('/include/foo') .expect('foo') .expect(200, done) }) it('should respect express views (Array) when lookup', function (done) { app.set('views', [views, partials]) request(app).get('/include/bar') .expect('bar') .expect(200, done) }) }) ```
/content/code_sandbox/test/e2e/express.spec.ts
xml
2016-06-13T07:39:30
2024-08-16T16:56:50
liquidjs
harttle/liquidjs
1,485
504
```xml import { $ } from '../$.js'; import './eq.js'; import type { JQ } from '../shared/core.js'; declare module '../shared/core.js' { // eslint-disable-next-line @typescript-eslint/no-unused-vars interface JQ<T = HTMLElement> { /** * * @example ```js $('div').last() ``` */ last(): this; } } $.fn.last = function (this: JQ): JQ { return this.eq(-1); }; ```
/content/code_sandbox/packages/jq/src/methods/last.ts
xml
2016-07-11T17:39:02
2024-08-16T07:12:34
mdui
zdhxiong/mdui
4,077
109
```xml /// /// /// /// path_to_url /// /// Unless required by applicable law or agreed to in writing, software /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild, ViewEncapsulation } from '@angular/core'; import { PageComponent } from '@shared/components/page.component'; import { TbPopoverComponent } from '@shared/components/popover.component'; import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { defaultBackgroundColorDisabled, defaultMainColorDisabled, WidgetButtonAppearance, WidgetButtonCustomStyle, WidgetButtonState, widgetButtonStates, widgetButtonStatesTranslations, WidgetButtonType } from '@shared/components/button/widget-button.models'; import { merge } from 'rxjs'; import { deepClone } from '@core/utils'; import { WidgetButtonComponent } from '@shared/components/button/widget-button.component'; @Component({ selector: 'tb-widget-button-custom-style-panel', templateUrl: './widget-button-custom-style-panel.component.html', providers: [], styleUrls: ['./widget-button-custom-style-panel.component.scss'], encapsulation: ViewEncapsulation.None }) export class WidgetButtonCustomStylePanelComponent extends PageComponent implements OnInit { @ViewChild('widgetButtonPreview') widgetButtonPreview: WidgetButtonComponent; @Input() appearance: WidgetButtonAppearance; @Input() borderRadius: string; @Input() autoScale: boolean; @Input() state: WidgetButtonState; @Input() customStyle: WidgetButtonCustomStyle; private popoverValue: TbPopoverComponent<WidgetButtonCustomStylePanelComponent>; @Input() set popover(popover: TbPopoverComponent<WidgetButtonCustomStylePanelComponent>) { this.popoverValue = popover; popover.tbAnimationDone.subscribe(() => { this.widgetButtonPreview?.validateSize(); }); } get popover(): TbPopoverComponent<WidgetButtonCustomStylePanelComponent> { return this.popoverValue; } @Output() customStyleApplied = new EventEmitter<WidgetButtonCustomStyle>(); widgetButtonStateTranslationMap = widgetButtonStatesTranslations; widgetButtonState = WidgetButtonState; previewAppearance: WidgetButtonAppearance; copyFromStates: WidgetButtonState[]; customStyleFormGroup: UntypedFormGroup; constructor(private fb: UntypedFormBuilder, protected store: Store<AppState>, private cd: ChangeDetectorRef) { super(store); } ngOnInit(): void { this.copyFromStates = widgetButtonStates.filter(state => state !== this.state && !!this.appearance.customStyle[state]); this.customStyleFormGroup = this.fb.group( { overrideMainColor: [false, []], mainColor: [null, []], overrideBackgroundColor: [false, []], backgroundColor: [null, []], overrideDropShadow: [false, []], dropShadow: [false, []] } ); merge(this.customStyleFormGroup.get('overrideMainColor').valueChanges, this.customStyleFormGroup.get('overrideBackgroundColor').valueChanges, this.customStyleFormGroup.get('overrideDropShadow').valueChanges) .subscribe(() => { this.updateValidators(); }); this.customStyleFormGroup.valueChanges.subscribe(() => { this.updatePreviewAppearance(); }); this.setStyle(this.customStyle); } copyStyle(state: WidgetButtonState) { this.customStyle = deepClone(this.appearance.customStyle[state]); this.setStyle(this.customStyle); this.customStyleFormGroup.markAsDirty(); } cancel() { this.popover?.hide(); } applyCustomStyle() { const customStyle: WidgetButtonCustomStyle = this.customStyleFormGroup.value; this.customStyleApplied.emit(customStyle); } private setStyle(customStyle?: WidgetButtonCustomStyle): void { let mainColor = this.state === WidgetButtonState.disabled ? defaultMainColorDisabled : this.appearance.mainColor; if (customStyle?.overrideMainColor) { mainColor = customStyle?.mainColor; } let backgroundColor = this.state === WidgetButtonState.disabled ? defaultBackgroundColorDisabled : this.appearance.backgroundColor; if (customStyle?.overrideBackgroundColor) { backgroundColor = customStyle?.backgroundColor; } let dropShadow = this.appearance.type !== WidgetButtonType.basic; if (customStyle?.overrideDropShadow) { dropShadow = customStyle?.dropShadow; } this.customStyleFormGroup.patchValue({ overrideMainColor: customStyle?.overrideMainColor, mainColor, overrideBackgroundColor: customStyle?.overrideBackgroundColor, backgroundColor, overrideDropShadow: customStyle?.overrideDropShadow, dropShadow }, {emitEvent: false}); this.updateValidators(); this.updatePreviewAppearance(); } private updateValidators() { const overrideMainColor: boolean = this.customStyleFormGroup.get('overrideMainColor').value; const overrideBackgroundColor: boolean = this.customStyleFormGroup.get('overrideBackgroundColor').value; const overrideDropShadow: boolean = this.customStyleFormGroup.get('overrideDropShadow').value; if (overrideMainColor) { this.customStyleFormGroup.get('mainColor').enable({emitEvent: false}); } else { this.customStyleFormGroup.get('mainColor').disable({emitEvent: false}); } if (overrideBackgroundColor) { this.customStyleFormGroup.get('backgroundColor').enable({emitEvent: false}); } else { this.customStyleFormGroup.get('backgroundColor').disable({emitEvent: false}); } if (overrideDropShadow) { this.customStyleFormGroup.get('dropShadow').enable({emitEvent: false}); } else { this.customStyleFormGroup.get('dropShadow').disable({emitEvent: false}); } } private updatePreviewAppearance() { this.previewAppearance = deepClone(this.appearance); this.previewAppearance.customStyle[this.state] = this.customStyleFormGroup.value; this.cd.markForCheck(); } } ```
/content/code_sandbox/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/button/widget-button-custom-style-panel.component.ts
xml
2016-12-01T09:33:30
2024-08-16T19:58:25
thingsboard
thingsboard/thingsboard
16,820
1,287
```xml import { FilterMetadata } from './filtermetadata'; import { SortMeta } from './sortmeta'; /** * Meta data for lazy load event. * @group Interface */ export interface LazyLoadMeta { first?: number | undefined | null; rows?: number | undefined | null; sortField?: string | string[] | null | undefined; sortOrder?: number | undefined | null; filters?: { [s: string]: FilterMetadata | FilterMetadata[] | undefined }; globalFilter?: string | string[] | undefined | null; multiSortMeta?: SortMeta[] | undefined | null; forceUpdate?: Function; last?: number | undefined | null; } ```
/content/code_sandbox/src/app/components/api/lazyloadmeta.ts
xml
2016-01-16T09:23:28
2024-08-16T19:58:20
primeng
primefaces/primeng
9,969
142
```xml /// /// /// /// path_to_url /// /// Unless required by applicable law or agreed to in writing, software /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// import { environment as env } from '@env/environment'; import { TranslateService } from '@ngx-translate/core'; import * as _moment from 'moment'; import { Observable } from 'rxjs'; export function updateUserLang(translate: TranslateService, userLang: string, translations = env.supportedLangs): Observable<any> { let targetLang = userLang; if (!env.production) { console.log(`User lang: ${targetLang}`); } if (!targetLang) { targetLang = translate.getBrowserCultureLang(); if (!env.production) { console.log(`Fallback to browser lang: ${targetLang}`); } } const detectedSupportedLang = detectSupportedLang(targetLang, translations); if (!env.production) { console.log(`Detected supported lang: ${detectedSupportedLang}`); } _moment.locale([detectedSupportedLang]); return translate.use(detectedSupportedLang); } function detectSupportedLang(targetLang: string, translations: string[]): string { const langTag = (targetLang || '').split('-').join('_'); if (langTag.length) { if (translations.indexOf(langTag) > -1) { return langTag; } else { const parts = langTag.split('_'); let lang; if (parts.length === 2) { lang = parts[0]; } else { lang = langTag; } const foundLangs = translations.filter( (supportedLang: string) => { const supportedLangParts = supportedLang.split('_'); return supportedLangParts[0] === lang; } ); if (foundLangs.length) { return foundLangs[0]; } } } return env.defaultLang; } ```
/content/code_sandbox/ui-ngx/src/app/core/settings/settings.utils.ts
xml
2016-12-01T09:33:30
2024-08-16T19:58:25
thingsboard
thingsboard/thingsboard
16,820
410
```xml <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="path_to_url"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="debug|Win32"> <Configuration>debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="checked|Win32"> <Configuration>checked</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="profile|Win32"> <Configuration>profile</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="release|Win32"> <Configuration>release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{D2B2C97A-CB7A-CF86-8AFE-AD5E9F3BFE58}</ProjectGuid> <RootNamespace>SnippetArticulation</RootNamespace> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v141</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v141</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v141</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v141</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='checked|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='profile|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> <OutDir>./../../../bin/vc15win32\</OutDir> <IntDir>./Win32/SnippetArticulation/debug\</IntDir> <TargetExt>.exe</TargetExt> <TargetName>$(ProjectName)DEBUG</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks> <AdditionalOptions>/GR- /GF /arch:SSE2 /MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4623 /wd4626 /wd5027 /wd4987 /wd5038 /wd5045 /wd4548 /wd4350 /wd4668 /wd4365 /wd4548 /wd4625 /wd5026 /Zi /d2Zi+</AdditionalOptions> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;_DEBUG;PX_DEBUG=1;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/LIBPATH:../../../Lib/vc15win32 PhysX3CommonDEBUG_x86.lib PhysX3DEBUG_x86.lib PhysX3CookingDEBUG_x86.lib PhysX3CharacterKinematicDEBUG_x86.lib PhysX3ExtensionsDEBUG.lib PhysX3VehicleDEBUG.lib PxPvdSDKDEBUG_x86.lib PxTaskDEBUG_x86.lib PxFoundationDEBUG_x86.lib PsFastXmlDEBUG_x86.lib /LIBPATH:../../lib/vc15win32 SnippetUtilsDEBUG.lib /DEBUG</AdditionalOptions> <AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName)DEBUG.exe</OutputFile> <AdditionalLibraryDirectories>./../../../Common/lib/vc15win32;./../../lib/vc15win32;./../../../../PxShared/lib/vc15win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX86</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> <PostBuildEvent> <Command>XCOPY "../../../../PxShared/bin\vc15win32\PxFoundationDEBUG_x86.dll" "$(OutDir)" /D /Y&#x0D;&#x0A; XCOPY "../../../../PxShared/bin\vc15win32\PxPvdSDKDEBUG_x86.dll" "$(OutDir)" /D /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'"> <OutDir>./../../../bin/vc15win32\</OutDir> <IntDir>./Win32/SnippetArticulation/checked\</IntDir> <TargetExt>.exe</TargetExt> <TargetName>$(ProjectName)CHECKED</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <AdditionalOptions>/GR- /GF /arch:SSE2 /MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4623 /wd4626 /wd5027 /wd4987 /wd5038 /wd5045 /wd4548 /wd4350 /wd4668 /wd4365 /wd4548 /wd4625 /wd5026 /d2Zi+</AdditionalOptions> <Optimization>Full</Optimization> <AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/LIBPATH:../../../Lib/vc15win32 PhysX3CommonCHECKED_x86.lib PhysX3CHECKED_x86.lib PhysX3CookingCHECKED_x86.lib PhysX3CharacterKinematicCHECKED_x86.lib PhysX3ExtensionsCHECKED.lib PhysX3VehicleCHECKED.lib PxPvdSDKCHECKED_x86.lib PxTaskCHECKED_x86.lib PxFoundationCHECKED_x86.lib PsFastXmlCHECKED_x86.lib /LIBPATH:../../lib/vc15win32 SnippetUtilsCHECKED.lib</AdditionalOptions> <AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName)CHECKED.exe</OutputFile> <AdditionalLibraryDirectories>./../../../Common/lib/vc15win32;./../../lib/vc15win32;./../../../../PxShared/lib/vc15win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX86</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> <PostBuildEvent> <Command>XCOPY "../../../../PxShared/bin\vc15win32\PxFoundationCHECKED_x86.dll" "$(OutDir)" /D /Y&#x0D;&#x0A; XCOPY "../../../../PxShared/bin\vc15win32\PxPvdSDKCHECKED_x86.dll" "$(OutDir)" /D /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'"> <OutDir>./../../../bin/vc15win32\</OutDir> <IntDir>./Win32/SnippetArticulation/profile\</IntDir> <TargetExt>.exe</TargetExt> <TargetName>$(ProjectName)PROFILE</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <AdditionalOptions>/GR- /GF /arch:SSE2 /MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4623 /wd4626 /wd5027 /wd4987 /wd5038 /wd5045 /wd4548 /wd4350 /wd4668 /wd4365 /wd4548 /wd4625 /wd5026 /d2Zi+</AdditionalOptions> <Optimization>Full</Optimization> <AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_PROFILE=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/INCREMENTAL:NO /LIBPATH:../../../Lib/vc15win32 PhysX3CommonPROFILE_x86.lib PhysX3PROFILE_x86.lib PhysX3CookingPROFILE_x86.lib PhysX3CharacterKinematicPROFILE_x86.lib PhysX3ExtensionsPROFILE.lib PhysX3VehiclePROFILE.lib PxPvdSDKPROFILE_x86.lib PxTaskPROFILE_x86.lib PxFoundationPROFILE_x86.lib PsFastXmlPROFILE_x86.lib /LIBPATH:../../lib/vc15win32 SnippetUtilsPROFILE.lib /DEBUG</AdditionalOptions> <AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName)PROFILE.exe</OutputFile> <AdditionalLibraryDirectories>./../../../Common/lib/vc15win32;./../../lib/vc15win32;./../../../../PxShared/lib/vc15win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX86</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> <PostBuildEvent> <Command>XCOPY "../../../../PxShared/bin\vc15win32\PxFoundationPROFILE_x86.dll" "$(OutDir)" /D /Y&#x0D;&#x0A; XCOPY "../../../../PxShared/bin\vc15win32\PxPvdSDKPROFILE_x86.dll" "$(OutDir)" /D /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> <OutDir>./../../../bin/vc15win32\</OutDir> <IntDir>./Win32/SnippetArticulation/release\</IntDir> <TargetExt>.exe</TargetExt> <TargetName>$(ProjectName)</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <AdditionalOptions>/GR- /GF /arch:SSE2 /MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4623 /wd4626 /wd5027 /wd4987 /wd5038 /wd5045 /wd4548 /wd4350 /wd4668 /wd4365 /wd4548 /wd4625 /wd5026 /d2Zi+</AdditionalOptions> <Optimization>Full</Optimization> <AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_SUPPORT_PVD=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/INCREMENTAL:NO /LIBPATH:../../../Lib/vc15win32 PhysX3Common_x86.lib PhysX3_x86.lib PhysX3Cooking_x86.lib PhysX3CharacterKinematic_x86.lib PhysX3Extensions.lib PhysX3Vehicle.lib PxPvdSDK_x86.lib PxTask_x86.lib PxFoundation_x86.lib PsFastXml_x86.lib /LIBPATH:../../lib/vc15win32 SnippetUtils.lib</AdditionalOptions> <AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile> <AdditionalLibraryDirectories>./../../../Common/lib/vc15win32;./../../lib/vc15win32;./../../../../PxShared/lib/vc15win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX86</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> <PostBuildEvent> <Command>XCOPY "../../../../PxShared/bin\vc15win32\PxFoundation_x86.dll" "$(OutDir)" /D /Y&#x0D;&#x0A; XCOPY "../../../../PxShared/bin\vc15win32\PxPvdSDK_x86.dll" "$(OutDir)" /D /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\..\SnippetCommon\ClassicMain.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\SnippetArticulation\SnippetArticulation.cpp"> </ClCompile> <ClCompile Include="..\..\SnippetArticulation\SnippetArticulationRender.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ProjectReference Include="./SnippetUtils.vcxproj"> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> </ItemGroup> <ItemGroup> <ProjectReference Include="./SnippetRender.vcxproj"> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"></ImportGroup> </Project> ```
/content/code_sandbox/PhysX_3.4/Snippets/compiler/vc15win32/SnippetArticulation.vcxproj
xml
2016-10-12T16:34:31
2024-08-16T09:40:38
PhysX-3.4
NVIDIAGameWorks/PhysX-3.4
2,343
4,887
```xml import { Image, Text, Card } from '@fluentui/react-northstar'; import * as React from 'react'; const CardExampleSelected = () => ( <Card selected aria-roledescription="selected card"> <Card.Header> <Text content="Selected card" weight="bold" /> </Card.Header> <Card.Body> <Image src="path_to_url" /> </Card.Body> </Card> ); export default CardExampleSelected; ```
/content/code_sandbox/packages/fluentui/docs/src/examples/components/Card/States/CardExampleSelected.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
101
```xml import { positionFromAngle, degreesToRadians } from '@nivo/core' /** * Computes the bounding box for a circle arc. * * Assumptions: * - Anywhere the arc intersects an axis will be a max or a min. * - If the arc doesn't intersect an axis, then the center * will be one corner of the bounding rectangle, * and this is the only case when it will be. * - The only other possible extreme points of the sector to consider * are the endpoints of the radii. * * This script was built within the help of this answer on stackoverflow: * path_to_url */ export const computeArcBoundingBox = ( centerX: number, centerY: number, radius: number, // in degrees startAngle: number, // in degrees endAngle: number, includeCenter = true ) => { let points: [number, number][] = [] const p0 = positionFromAngle(degreesToRadians(startAngle), radius) points.push([p0.x, p0.y]) const p1 = positionFromAngle(degreesToRadians(endAngle), radius) points.push([p1.x, p1.y]) for ( let angle = Math.round(Math.min(startAngle, endAngle)); angle <= Math.round(Math.max(startAngle, endAngle)); angle++ ) { if (angle % 90 === 0) { const p = positionFromAngle(degreesToRadians(angle), radius) points.push([p.x, p.y]) } } points = points.map(([x, y]) => [centerX + x, centerY + y]) if (includeCenter) { points.push([centerX, centerY]) } const xs = points.map(([x]) => x) const ys = points.map(([, y]) => y) const x0 = Math.min(...xs) const x1 = Math.max(...xs) const y0 = Math.min(...ys) const y1 = Math.max(...ys) return { points, x: x0, y: y0, width: x1 - x0, height: y1 - y0, } } ```
/content/code_sandbox/packages/arcs/src/boundingBox.ts
xml
2016-04-16T03:27:56
2024-08-16T03:38:37
nivo
plouc/nivo
13,010
482
```xml <fxlayout help_command="iexplore" help_file="BokehIwa.html"> <page name="Glare Iwa"> <control>renderMode</control> <control>irisMode</control> <vbox modeSensitive="irisMode" mode="1,2,3,4"> <separator/> <control>irisScale</control> <control>irisSymmetry</control> <control>irisAppearance</control> </vbox> <vbox modeSensitive="irisMode" mode="4"> <control>irisGearEdgeCount</control> <control>irisRandomSeed</control> </vbox> <vbox modeSensitive="irisMode" mode="1,2,3,4"> <separator/> </vbox> <control>intensity</control> <control>size</control> <control>rotation</control> <control>aberration</control> <control>noise_factor</control> <control>noise_size</control> <control>noise_octave</control> <control>noise_evolution</control> <control>noise_offset</control> </page> </fxlayout> ```
/content/code_sandbox/stuff/profiles/layouts/fxs/STD_iwa_GlareFx.xml
xml
2016-03-18T17:55:48
2024-08-15T18:11:38
opentoonz
opentoonz/opentoonz
4,445
285
```xml import { c } from 'ttag'; import type { WasmApiExchangeRate, WasmApiWalletAccount } from '@proton/andromeda'; import { CircleLoader } from '@proton/atoms/CircleLoader'; import { Icon, Tooltip, useModalState, useModalStateWithData } from '@proton/components/components'; import useLoading from '@proton/hooks/useLoading'; import type { IWasmApiWalletData } from '@proton/wallet'; import { useUserWalletSettings } from '@proton/wallet'; import { Button, CoreButton } from '../../../atoms'; import { BitcoinAmountInput } from '../../../atoms/BitcoinAmountInput'; import { NoteOrMessage } from '../../../atoms/NoteOrMessage'; import { Price } from '../../../atoms/Price'; import { TEXT_AREA_MAX_LENGTH } from '../../../constants'; import type { TxBuilderHelper } from '../../../hooks/useTxBuilder'; import { useExchangeRate } from '../../../store/hooks'; import { EmailListItem } from '../../EmailListItem'; import type { BtcAddressMap } from '../../EmailOrBitcoinAddressInput/useEmailAndBtcAddressesMaps'; import { EmailSelect } from '../../EmailSelect'; import type { RecipientDetailsModalOwnProps } from '../../RecipientDetailsModal'; import { RecipientDetailsModal } from '../../RecipientDetailsModal'; import { TextAreaModal } from '../../TextAreaModal'; import { secondaryAmount } from '../AmountInput/BitcoinAmountInputWithBalanceAndCurrencySelect'; import { FeesModal } from './FeesModal'; import { getAnonymousSenderAddress, useTransactionReview } from './useTransactionReview'; import './TransactionReview.scss'; interface Props { isUsingBitcoinViaEmail: boolean; wallet: IWasmApiWalletData; account: WasmApiWalletAccount; exchangeRate: WasmApiExchangeRate; txBuilderHelpers: TxBuilderHelper; btcAddressMap: BtcAddressMap; onBack: () => void; onSent: () => void; onBackToEditRecipients: () => void; getFeesByBlockTarget: (blockTarget: number) => number | undefined; } export const TransactionReview = ({ isUsingBitcoinViaEmail, wallet, account, exchangeRate, txBuilderHelpers, btcAddressMap, onBackToEditRecipients, onSent, getFeesByBlockTarget, }: Props) => { const [accountExchangeRate] = useExchangeRate(account.FiatCurrency); const [settings] = useUserWalletSettings(); const [feesModal, setFeesModal] = useModalState(); const [loadingSend, withLoadingSend] = useLoading(); const [textAreaModal, setTextAreaModal] = useModalStateWithData<{ kind: 'message' | 'note' }>(); const [recipientDetailsModal, setRecipientDetailsModal] = useModalStateWithData<RecipientDetailsModalOwnProps>(); const { txBuilder } = txBuilderHelpers; const recipients = txBuilder.getRecipients(); const { message, noteToSelf, setMessage, setNoteToSelf, senderAddress, onSelectAddress, totalSentAmount, totalFees, totalAmount, psbtExpectedSize, handleSendTransaction, } = useTransactionReview({ isUsingBitcoinViaEmail, wallet, account, exchangeRate, txBuilderHelpers, btcAddressMap, onSent, }); return ( <> {loadingSend && ( <div className="fixed top-0 left-0 w-full h-full flex flex-column items-center justify-center" style={{ background: 'var(--bg-overlay)', zIndex: 100 }} > <CircleLoader size="medium" className="color-primary" /> </div> )} <div className="max-w-full"> <h2 className="text-center mb-8 text-semibold">{c('Wallet send').t`Confirm and send`}</h2> {/* Total sent */} <div className="my-8"> <div className="flex flex-row items-center"> <span className="block color-hint">{c('Wallet send').t`You are sending`}</span> </div> <div> <BitcoinAmountInput unit={exchangeRate} unstyled className="h1 invisible-number-input-arrow" inputClassName="p-0" style={{ fontSize: '3.75rem' }} value={totalSentAmount} prefix={typeof exchangeRate === 'object' ? exchangeRate.FiatCurrency : exchangeRate} /> </div> <span className="block color-weak"> {secondaryAmount({ key: 'hint-secondary-amount', settingsBitcoinUnit: settings.BitcoinUnit, secondaryExchangeRate: accountExchangeRate, primaryExchangeRate: exchangeRate, value: totalSentAmount, })} </span> </div> <div className="w-full mt-4 flex flex-row justify-space-between items-center"> <span className="block color-weak text-semibold">{c('Wallet send').t`Recipient`}</span> <div> <CoreButton size="small" shape="ghost" color="norm" onClick={() => onBackToEditRecipients()}> {c('Wallet send').t`Edit`} </CoreButton> </div> </div> <div className="flex flex-column w-full mt-2"> {recipients.map((txBuilderRecipient, index) => { const recipientUid = txBuilderRecipient[0]; const btcAddress = txBuilderRecipient[1]; const amount = txBuilderRecipient[2]; const recipient = btcAddressMap[btcAddress]; // Typeguard, no recipient should be undefined here if (!recipient) { return null; } return ( <> <EmailListItem key={recipientUid} index={index} name={recipient.recipient.Name ?? recipient.recipient.Address} address={recipient.recipient.Address} rightNode={ recipients.length > 1 ? ( <> <div className="w-custom flex flex-column items-end mr-1 shrink-0" style={{ '--w-custom': '7.5rem' }} > <div className="mb-1"> {exchangeRate && ( <Price satsAmount={Number(amount)} unit={exchangeRate} /> )} </div> <span className="block color-hint"> {secondaryAmount({ key: 'hint-total-amount', settingsBitcoinUnit: settings.BitcoinUnit, secondaryExchangeRate: accountExchangeRate, primaryExchangeRate: exchangeRate, value: Number(amount), })} </span> </div> <CoreButton className="ml-4 rounded-full bg-weak" icon shape="solid" color="weak" onClick={() => { setRecipientDetailsModal({ recipient: { Address: recipient.recipient.Address, Name: recipient.recipient.Name, }, btcAddress, index, }); }} > <Icon name="chevron-right" alt={c('Action').t`Open recipient`} /> </CoreButton> </> ) : ( <CoreButton className="ml-4 rounded-full bg-weak" icon shape="solid" color="weak" onClick={() => { setRecipientDetailsModal({ recipient: { Address: recipient.recipient.Address, Name: recipient.recipient.Name, }, btcAddress, index: 0, }); }} > <Icon name="chevron-right" alt={c('Action').t`Open recipient`} /> </CoreButton> ) } /> <hr className="mb-0" /> </> ); })} </div> {isUsingBitcoinViaEmail && ( <div className="flex flex-column w-full"> <div className="flex flex-row w-full items-center justify-space-between"> <div className="color-weak mb-4 mt-3 text-semibold">{c('Wallet transaction') .t`Bitcoin via Email`}</div> </div> <EmailSelect value={senderAddress?.ID} onChange={onSelectAddress} extraOptions={[getAnonymousSenderAddress()]} /> <div className="mt-2"> <Tooltip title={(() => { if (!senderAddress) { return c('Wallet send') .t`You cannot send a message to the recipient because you don't have any address setup on your account`; } return null; })()} > <div className="rounded-lg w-full"> <NoteOrMessage handleClick={() => setTextAreaModal({ kind: 'message' })} value={message} type="message" /> </div> </Tooltip> </div> <hr className="my-3" /> </div> )} <div className="flex flex-column w-full"> <div className="flex flex-row w-full items-center justify-space-between"> <div className="flex flex-column items-start"> <div className="color-weak mb-4 mt-3 text-semibold">{c('Wallet transaction') .t`Network fee`}</div> <div className="mb-1"> {exchangeRate && <Price satsAmount={totalFees} unit={exchangeRate} />} </div> <span className="block color-hint"> {secondaryAmount({ key: 'hint-fiat-amount', settingsBitcoinUnit: settings.BitcoinUnit, secondaryExchangeRate: accountExchangeRate, primaryExchangeRate: exchangeRate, value: totalFees, })} </span> </div> <CoreButton className="ml-4 rounded-full bg-weak" icon shape="solid" color="weak" onClick={() => { setFeesModal(true); }} > <Tooltip title={c('Action').t`Edit`}> <Icon name="chevron-right" alt={c('Action').t`Edit`} /> </Tooltip> </CoreButton> <FeesModal accountExchangeRate={accountExchangeRate} exchangeRate={exchangeRate} txBuilderHelpers={txBuilderHelpers} getFeesByBlockTarget={getFeesByBlockTarget} psbtExpectedSize={psbtExpectedSize} {...feesModal} /> </div> <hr className="my-3" /> <div className="flex flex-column items-start"> <div className="flex flex-row w-full items-center justify-space-between"> <div className="color-weak mb-4 text-semibold">{c('Wallet transaction') .t`Total (Amount + fee)`}</div> </div> <div className="mb-1"> {exchangeRate && <Price satsAmount={totalAmount} unit={exchangeRate} />} </div> <span className="block color-hint"> {secondaryAmount({ key: 'hint-total-amount', settingsBitcoinUnit: settings.BitcoinUnit, secondaryExchangeRate: accountExchangeRate, primaryExchangeRate: exchangeRate, value: totalAmount, })} </span> </div> </div> <hr className="my-3" /> {/* Note to self */} <div className="mt-2"> <NoteOrMessage handleClick={() => setTextAreaModal({ kind: 'note' })} value={noteToSelf} type="note" /> </div> <Button color="norm" shape="solid" size="large" shadow className="mt-6" fullWidth onClick={() => { void withLoadingSend(handleSendTransaction()); }} >{c('Wallet send').t`Confirm and send`}</Button> </div> {textAreaModal.data && ( <TextAreaModal {...(textAreaModal.data.kind === 'note' ? { title: 'Write a private note to yourself', inputLabel: 'Note to self', buttonText: 'Confirm', value: noteToSelf, onSubmit: (value) => { setNoteToSelf(value); textAreaModal.onClose(); }, } : { title: 'Write a message to your recipient(s)', inputLabel: 'Message to recipient(s)', buttonText: 'Confirm', value: message, onSubmit: (value) => { setMessage(value); textAreaModal.onClose(); }, })} {...textAreaModal} maxLength={TEXT_AREA_MAX_LENGTH} /> )} {recipientDetailsModal.data && ( <RecipientDetailsModal {...recipientDetailsModal.data} {...recipientDetailsModal} /> )} </> ); }; ```
/content/code_sandbox/applications/wallet/src/app/components/BitcoinSendModal/TransactionReview/index.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
2,745
```xml export {}; //# sourceMappingURL=test-providers-avatar.d.ts.map ```
/content/code_sandbox/lib.commonjs/_tests/test-providers-avatar.d.ts
xml
2016-07-16T04:35:37
2024-08-16T13:37:46
ethers.js
ethers-io/ethers.js
7,843
12
```xml const HMRClient = require('react-native/Libraries/Utilities/HMRClient'); export default HMRClient; ```
/content/code_sandbox/packages/@expo/metro-runtime/src/HMRClient.native.ts
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
24
```xml import type { FormEvent } from 'react'; import { c } from 'ttag'; import { Button } from '@proton/atoms/Button'; import { Input } from '@proton/atoms/Input'; import { Block, DateInput, Icon, Option, SelectTwo } from '@proton/components/components'; import useLoading from '@proton/hooks/useLoading'; import type { FilterModel } from './Pass/PassEvents'; interface Props { filter: FilterModel; keyword: string; setKeyword: (keyword: string) => void; handleStartDateChange: (date: Date | undefined) => void; handleEndDateChange: (date: Date | undefined) => void; eventTypesList: string[] | []; handleSetEventType: (eventType: string) => void; handleSearchSubmit: () => void; getEventTypeText: (eventType: string) => string; } const FilterAndSortEventsBlock = ({ filter, keyword, setKeyword, handleStartDateChange, handleEndDateChange, eventTypesList, handleSetEventType, handleSearchSubmit, getEventTypeText, }: Props) => { const [submitting] = useLoading(); const today = new Date(); const handleSubmit = (event: FormEvent) => { event.preventDefault(); handleSearchSubmit(); }; return ( <Block> <form onSubmit={handleSubmit} className="flex flex-column md:flex-row gap-2 items-start items-center justify-space-between *:min-size-auto" > <Input value={keyword} placeholder={c('Placeholder').t`Email or IP`} prefix={<Icon name="magnifier" />} onValue={setKeyword} className="w-full md:max-h-auto" data-protonpass-ignore="true" /> <SelectTwo id="eventType" value={filter.eventType} onValue={handleSetEventType} className="flex-1"> {eventTypesList.map((type) => { return ( <Option key={type} value={type} title={type}> {getEventTypeText(type)} </Option> ); })} </SelectTwo> <DateInput id="start" placeholder={c('Placeholder').t`Start date`} value={filter.start} onChange={handleStartDateChange} className="flex-1" max={today} /> <DateInput id="end" placeholder={c('Placeholder').t`End date`} value={filter.end} onChange={handleEndDateChange} className="flex-1" max={today} /> <Button color="norm" type="submit" loading={submitting}> {c('Action').t`Search`} </Button> </form> </Block> ); }; export default FilterAndSortEventsBlock; ```
/content/code_sandbox/packages/components/containers/b2bDashboard/FilterAndSortEventBlock.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
610
```xml <test> <query>SELECT length(URL) > 1000 ? 'LONG' : 'SHORT' as x FROM hits_100m_single GROUP BY x FORMAT Null</query> <query>SELECT transform(number, [2, 4, 6], ['google', 'yandex', 'yahoo'], 'other') as x FROM numbers(100000000) GROUP BY x FORMAT Null</query> <query>SELECT length(URL) > 1000 ? 'LONG' : 'SHORT' as x FROM hits_100m_single GROUP BY x FORMAT Null SETTINGS optimize_if_transform_strings_to_enum = 1</query> <query>SELECT transform(number, [2, 4, 6], ['google', 'yandex', 'yahoo'], 'other') as x FROM numbers(100000000) GROUP BY x FORMAT Null SETTINGS optimize_if_transform_strings_to_enum = 1</query> </test> ```
/content/code_sandbox/tests/performance/if_transform_strings_to_enum.xml
xml
2016-06-02T08:28:18
2024-08-16T18:39:33
ClickHouse
ClickHouse/ClickHouse
36,234
194
```xml import * as React from 'react'; import { createSvgIcon } from '@fluentui/react-icons-mdl2'; const CortanaLogoReadyOuterIcon = createSvgIcon({ svg: ({ classes }) => ( <svg xmlns="path_to_url" viewBox="0 0 2048 2048" className={classes.svg}> <path d="M1024 0q141 0 272 36t244 104 207 160 161 207 103 245 37 272q0 141-36 272t-104 244-160 207-207 161-245 103-272 37q-141 0-272-36t-244-104-207-160-161-207-103-245-37-272q0-141 36-272t104-244 160-207 207-161T752 37t272-37zm0 1536q106 0 199-40t163-109 110-163 40-200q0-106-40-199t-109-163-163-110-200-40q-106 0-199 40T662 661 552 824t-40 200q0 106 40 199t109 163 163 110 200 40z" /> </svg> ), displayName: 'CortanaLogoReadyOuterIcon', }); export default CortanaLogoReadyOuterIcon; ```
/content/code_sandbox/packages/react-icons-mdl2-branded/src/components/CortanaLogoReadyOuterIcon.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
316
```xml <?xml version="1.0" encoding="utf-8"?> <Behavior Version="5" NoError="true"> <Node Class="Behaviac.Design.Nodes.Behavior" AgentType="AgentNodeTest" Domains="" Enable="true" HasOwnPrefabData="false" Id="-1" PrefabName="" PrefabNodeId="-1"> <Comment Background="NoColor" Text="" /> <Parameters> <Parameter Name="par_int_type_0" Type="System.Int32" DefaultValue="0" DisplayName="par_int_type_0" Desc="AgentNodeTest::par_int_type_0" Display="true" /> <Parameter Name="par_int_type_1" Type="System.Int32" DefaultValue="0" DisplayName="par_int_type_1" Desc="AgentNodeTest::par_int_type_1" Display="true" /> <Parameter Name="par_int_type_2" Type="System.Int32" DefaultValue="300" DisplayName="par_int_type_2" Desc="AgentNodeTest::par_int_type_2" Display="true" /> <Parameter Name="par_go" Type="XMLPluginBehaviac.UnityEngine_GameObject" DefaultValue="null" DisplayName="par_go" Desc="par_go" Display="true" /> </Parameters> <DescriptorRefs value="0:" /> <Connector Identifier="GenericChildren"> <Node Class="PluginBehaviac.Nodes.Sequence" Enable="true" HasOwnPrefabData="false" Id="0" PrefabName="" PrefabNodeId="-1"> <Comment Background="NoColor" Text="" /> <Attachment Class="PluginBehaviac.Events.Precondition" BinaryOperator="And" Enable="true" Id="15" Operator="Equal" Opl="Self.AgentNodeTest::Move()" Opr1="&quot;&quot;" Opr2="const behaviac::EBTStatus BT_RUNNING" Phase="Enter" PrefabAttachmentId="-1" /> <Connector Identifier="GenericChildren"> <Node Class="PluginBehaviac.Nodes.Action" Enable="true" HasOwnPrefabData="false" Id="14" Method="Self.AgentNodeTest::initChildAgentTest()" PrefabName="" PrefabNodeId="-1" ResultFunctor="&quot;&quot;" ResultOption="BT_SUCCESS"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Assignment" CastRight="false" Enable="true" HasOwnPrefabData="false" Id="12" Opl="int Self.AgentNodeTest::testVar_0" Opr="int par_child.AgentNodeTest::testVar_1" PrefabName="" PrefabNodeId="-1"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Condition" Enable="true" HasOwnPrefabData="false" Id="13" Operator="Equal" Opl="int Self.AgentNodeTest::testVar_0" Opr="int par_child.AgentNodeTest::testVar_1" PrefabName="" PrefabNodeId="-1"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Assignment" CastRight="false" Enable="true" HasOwnPrefabData="false" Id="10" Opl="int Self.AgentNodeTest::testVar_0" Opr="par_child.AgentNodeTest::getConstOne()" PrefabName="" PrefabNodeId="-1"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Condition" Enable="true" HasOwnPrefabData="false" Id="11" Operator="Equal" Opl="int Self.AgentNodeTest::testVar_0" Opr="const int 1" PrefabName="" PrefabNodeId="-1"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Condition" Enable="true" HasOwnPrefabData="false" Id="8" Operator="Greater" Opl="float par_child.AgentNodeTest::testVar_2" Opr="float Self.AgentNodeTest::testVar_3" PrefabName="" PrefabNodeId="-1"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Action" Enable="true" HasOwnPrefabData="false" Id="9" Method="par_child.AgentNodeTest::SelectTarget()" PrefabName="" PrefabNodeId="-1" ResultFunctor="&quot;&quot;" ResultOption="BT_SUCCESS"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Compute" Enable="true" HasOwnPrefabData="false" Id="1" Operator="Add" Opl="int Self.AgentNodeTest::par_int_type_0" Opr1="Self.AgentNodeTest::getConstThousand(600,400)" Opr2="const int 500" PrefabName="" PrefabNodeId="-1"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Action" Enable="true" HasOwnPrefabData="false" Id="2" Method="Self.AgentNodeTest::setTestVar_0(int Self.AgentNodeTest::par_int_type_0)" PrefabName="" PrefabNodeId="-1" ResultFunctor="&quot;&quot;" ResultOption="BT_SUCCESS"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Assignment" CastRight="false" Enable="true" HasOwnPrefabData="false" Id="3" Opl="int Self.AgentNodeTest::par_int_type_1" Opr="int Self.AgentNodeTest::testVar_0" PrefabName="" PrefabNodeId="-1"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Compute" Enable="true" HasOwnPrefabData="false" Id="4" Operator="Add" Opl="int Self.AgentNodeTest::par_int_type_0" Opr1="int Self.AgentNodeTest::par_int_type_1" Opr2="int Self.AgentNodeTest::par_int_type_2" PrefabName="" PrefabNodeId="-1"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Action" Enable="true" HasOwnPrefabData="false" Id="5" Method="Self.AgentNodeTest::setTestVar_1(int Self.AgentNodeTest::par_int_type_0)" PrefabName="" PrefabNodeId="-1" ResultFunctor="&quot;&quot;" ResultOption="BT_SUCCESS"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Action" Enable="true" HasOwnPrefabData="false" Id="7" Method="Self.AgentNodeTest::testGameObject(null)" PrefabName="" PrefabNodeId="-1" ResultFunctor="&quot;&quot;" ResultOption="BT_SUCCESS"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Action" Enable="true" HasOwnPrefabData="false" Id="6" Method="StaticAgent.StaticAgent::sAction()" PrefabName="" PrefabNodeId="-1" ResultFunctor="&quot;&quot;" ResultOption="BT_SUCCESS"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Action" Enable="true" HasOwnPrefabData="false" Id="16" Method="Self.AgentNodeTest::testVectorStruct(1:{x=0.01;y=-0.01;})" PrefabName="" PrefabNodeId="-1" ResultFunctor="&quot;&quot;" ResultOption="BT_SUCCESS"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Assignment" CastRight="false" Enable="true" HasOwnPrefabData="false" Id="18" Opl="string Self.AgentNodeTest::testVar_str_0" Opr="const string &quot;abcd&quot;" PrefabName="" PrefabNodeId="-1"> <Comment Background="NoColor" Text="" /> </Node> <Node Class="PluginBehaviac.Nodes.Action" Enable="true" HasOwnPrefabData="false" Id="17" Method="Self.AgentNodeTest::transitPlanTactics({plan_ID=string Self.AgentNodeTest::testVar_str_0;plan_selection_precedence=0;transit_points=3:{coordX=0;coordY=0;}|{coordX=0;coordY=0;}|{coordX=0;coordY=0;};},EnumTest_OneAfterOne,&quot;&quot;)" PrefabName="" PrefabNodeId="-1" ResultFunctor="&quot;&quot;" ResultOption="BT_SUCCESS"> <Comment Background="NoColor" Text="" /> </Node> </Connector> </Node> </Connector> </Node> </Behavior> ```
/content/code_sandbox/integration/unity/Assets/behaviac/workspace/behaviors/node_test/action_ut_0.xml
xml
2016-11-21T05:08:08
2024-08-16T07:18:30
behaviac
Tencent/behaviac
2,831
1,961
```xml import { Component } from '@angular/core'; @Component({ selector: 'message-demo-toggle-visibility', styleUrls: ['./message-demo-toggle-visibility.component.scss'], templateUrl: './message-demo-toggle-visibility.component.html', }) export class MessageDemoToggleVisibilityComponent {} ```
/content/code_sandbox/apps/docs-app/src/app/content/components/component-demos/message/demos/message-demo-toggle-visibility/message-demo-toggle-visibility.component.ts
xml
2016-07-11T23:30:52
2024-08-15T15:20:45
covalent
Teradata/covalent
2,228
55
```xml import { required as createRequiredValidator, number as createNumberValidator, } from 'react-admin'; export const required = createRequiredValidator(); export const number = createNumberValidator(); ```
/content/code_sandbox/examples/simple/src/validators.tsx
xml
2016-07-13T07:58:54
2024-08-16T18:32:27
react-admin
marmelab/react-admin
24,624
39
```xml /** * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import { fetch } from 'react-fetch'; import SidebarNote from './SidebarNote'; export default function NoteList({ searchText }) { const notes = fetch('path_to_url // Now let's see how the Suspense boundary above lets us not block on this. // fetch('/sleep/3000'); return notes.length > 0 ? ( <ul className="notes-list"> {notes.map((note) => ( <li key={note.id}> <SidebarNote note={note} /> </li> ))} </ul> ) : ( <div className="notes-empty"> {searchText ? `Couldn't find any notes titled "${searchText}".` : 'No notes created yet!'}{' '} </div> ); } ```
/content/code_sandbox/examples/with-react-server-components/src/NoteList.server.tsx
xml
2016-02-10T18:34:27
2024-08-16T15:51:55
razzle
jaredpalmer/razzle
11,097
197
```xml <?xml version="1.0" encoding="UTF-8"?> <phpunit xmlns:xsi="path_to_url" xsi:noNamespaceSchemaLocation="path_to_url" bootstrap="vendor/autoload.php" cacheResultFile=".phpunit.cache/test-results" executionOrder="depends,defects" forceCoversAnnotation="true" beStrictAboutCoversAnnotation="true" beStrictAboutTodoAnnotatedTests="true" convertDeprecationsToExceptions="true" failOnRisky="true" failOnWarning="true"> <testsuites> <testsuite name="S3"> <directory>tests</directory> </testsuite> </testsuites> <coverage cacheDirectory=".phpunit.cache/code-coverage"> <include> <directory suffix=".php">.</directory> </include> <exclude> <directory suffix=".php">*vendor*</directory> <directory suffix=".php">tests</directory> <file>Runner.php</file> </exclude> </coverage> </phpunit> ```
/content/code_sandbox/php/example_code/s3/phpunit.xml
xml
2016-08-18T19:06:57
2024-08-16T18:59:44
aws-doc-sdk-examples
awsdocs/aws-doc-sdk-examples
9,298
231
```xml /** * * Todo web part props. */ export interface ITodoWebPartProps { description: string; todos: string[]; } ```
/content/code_sandbox/samples/angular2-prototype/src/webparts/todo/ITodoWebPartProps.ts
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
29
```xml import * as Typegram from '@telegraf/types' // internal type provisions export * from '@telegraf/types/api' export * from '@telegraf/types/inline' export * from '@telegraf/types/manage' export * from '@telegraf/types/markup' export * from '@telegraf/types/message' export * from '@telegraf/types/methods' export * from '@telegraf/types/passport' export * from '@telegraf/types/payment' export * from '@telegraf/types/settings' export * from '@telegraf/types/update' // telegraf input file definition interface InputFileByPath { source: string filename?: string } interface InputFileByReadableStream { source: NodeJS.ReadableStream filename?: string } interface InputFileByBuffer { source: Buffer filename?: string } interface InputFileByURL { url: string filename?: string } export type InputFile = | InputFileByPath | InputFileByReadableStream | InputFileByBuffer | InputFileByURL export type Telegram = Typegram.ApiMethods<InputFile> export type Opts<M extends keyof Telegram> = Typegram.Opts<InputFile>[M] export type InputMedia = Typegram.InputMedia<InputFile> export type InputMediaPhoto = Typegram.InputMediaPhoto<InputFile> export type InputMediaVideo = Typegram.InputMediaVideo<InputFile> export type InputMediaAnimation = Typegram.InputMediaAnimation<InputFile> export type InputMediaAudio = Typegram.InputMediaAudio<InputFile> export type InputMediaDocument = Typegram.InputMediaDocument<InputFile> // tiny helper types export type ChatAction = Opts<'sendChatAction'>['action'] /** * Sending video notes by a URL is currently unsupported */ export type InputFileVideoNote = Exclude<InputFile, InputFileByURL> ```
/content/code_sandbox/src/core/types/typegram.ts
xml
2016-04-16T18:05:48
2024-08-16T19:27:23
telegraf
telegraf/telegraf
8,072
386
```xml export default function Page() { return <div>/app/@auth/default.tsx</div> } ```
/content/code_sandbox/test/e2e/app-dir/parallel-routes-use-selected-layout-segment/app/@auth/default.tsx
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
22
```xml // See LICENSE.txt for license information. // ******************************************************************* // - [#] indicates a test step (e.g. # Go to a screen) // - [*] indicates an assertion (e.g. * Check the title) // - Use element testID when selecting an element. Create one if none. // ******************************************************************* import { Post, Setup, } from '@support/server_api'; import { serverOneUrl, siteOneUrl, } from '@support/test_config'; import { ChannelInfoScreen, ChannelListScreen, ChannelScreen, EditPostScreen, HomeScreen, LoginScreen, PermalinkScreen, PinnedMessagesScreen, PostOptionsScreen, RecentMentionsScreen, SavedMessagesScreen, ServerScreen, ThreadScreen, } from '@support/ui/screen'; import {expect} from 'detox'; describe('Search - Recent Mentions', () => { const serverOneDisplayName = 'Server 1'; const channelsCategory = 'channels'; let testChannel: any; let testTeam: any; let testUser: any; beforeAll(async () => { const {channel, team, user} = await Setup.apiInit(siteOneUrl); testChannel = channel; testTeam = team; testUser = user; // # Log in to server await ServerScreen.connectToServer(serverOneUrl, serverOneDisplayName); await LoginScreen.login(testUser); }); beforeEach(async () => { // * Verify on channel list screen await ChannelListScreen.toBeVisible(); }); afterAll(async () => { // # Log out await HomeScreen.logout(); }); it('MM-T4909_1 - should match elements on recent mentions screen', async () => { // # Open recent mentions screen await RecentMentionsScreen.open(); // * Verify basic elements on recent mentions screen await expect(RecentMentionsScreen.largeHeaderTitle).toHaveText('Recent Mentions'); await expect(RecentMentionsScreen.largeHeaderSubtitle).toHaveText('Messages you\'ve been mentioned in'); await expect(RecentMentionsScreen.emptyTitle).toHaveText('No Mentions yet'); await expect(RecentMentionsScreen.emptyParagraph).toHaveText('You\'ll see messages here when someone mentions you or uses terms you\'re monitoring.'); // # Go back to channel list screen await ChannelListScreen.open(); }); it('MM-T4909_2 - should be able to display a recent mention in recent mentions screen and navigate to message channel', async () => { // # Open a channel screen and post a message with at-mention to current user const message = `@${testUser.username}`; await ChannelScreen.open(channelsCategory, testChannel.name); await ChannelScreen.postMessage(message); // * Verify message with at-mention to current user is posted const {post} = await Post.apiGetLastPostInChannel(siteOneUrl, testChannel.id); const {postListPostItem} = ChannelScreen.getPostListPostItem(post.id, message); await expect(postListPostItem).toBeVisible(); // # Go back to channel list screen and open recent mentions screen await ChannelScreen.back(); await RecentMentionsScreen.open(); // * Verify on recent mentions screen and recent mention is displayed with channel info await RecentMentionsScreen.toBeVisible(); const {postListPostItem: recentMentionsPostListPostItem, postListPostItemChannelInfoChannelDisplayName, postListPostItemChannelInfoTeamDisplayName} = RecentMentionsScreen.getPostListPostItem(post.id, message); await expect(recentMentionsPostListPostItem).toBeVisible(); await expect(postListPostItemChannelInfoChannelDisplayName).toHaveText(testChannel.display_name); await expect(postListPostItemChannelInfoTeamDisplayName).toHaveText(testTeam.display_name); // # Tap on post and jump to recent messages await recentMentionsPostListPostItem.tap(); await PermalinkScreen.jumpToRecentMessages(); // * Verify on channel screen and recent mention is displayed await ChannelScreen.toBeVisible(); const {postListPostItem: channelPostListPostItem} = ChannelScreen.getPostListPostItem(post.id, message); await expect(channelPostListPostItem).toBeVisible(); // # Go back to channel list screen await ChannelScreen.back(); await ChannelListScreen.open(); }); it('MM-T4909_3 - should be able to edit, reply to, and delete a recent mention from recent mentions screen', async () => { // # Open a channel screen, post a message with at-mention to current user, go back to channel list screen, and open recent mentions screen const message = `@${testUser.username}`; await ChannelScreen.open(channelsCategory, testChannel.name); await ChannelScreen.postMessage(message); await ChannelScreen.back(); await RecentMentionsScreen.open(); // * Verify on recent mentions screen await RecentMentionsScreen.toBeVisible(); // # Open post options for recent mention and tap on edit option const {post: mentionPost} = await Post.apiGetLastPostInChannel(siteOneUrl, testChannel.id); await RecentMentionsScreen.openPostOptionsFor(mentionPost.id, message); await PostOptionsScreen.editPostOption.tap(); // * Verify on edit post screen await EditPostScreen.toBeVisible(); // # Edit post message and tap save button const updatedMessage = `${message} edit`; await EditPostScreen.messageInput.replaceText(updatedMessage); await EditPostScreen.saveButton.tap(); // * Verify post message is updated and displays edited indicator '(edited)' const {postListPostItem: updatedPostListPostItem, postListPostItemEditedIndicator} = RecentMentionsScreen.getPostListPostItem(mentionPost.id, updatedMessage); await expect(updatedPostListPostItem).toBeVisible(); await expect(postListPostItemEditedIndicator).toHaveText('(edited)'); // # Open post options for recent mention and tap on reply option await RecentMentionsScreen.openPostOptionsFor(mentionPost.id, updatedMessage); await PostOptionsScreen.replyPostOption.tap(); // * Verify on thread screen await ThreadScreen.toBeVisible(); // # Post a reply const replyMessage = `${message} reply`; await ThreadScreen.postMessage(replyMessage); // * Verify reply is posted const {post: replyPost} = await Post.apiGetLastPostInChannel(siteOneUrl, testChannel.id); const {postListPostItem} = ThreadScreen.getPostListPostItem(replyPost.id, replyMessage); await expect(postListPostItem).toBeVisible(); // # Go back to recent mentions screen await ThreadScreen.back(); // * Verify reply count and following button const {postListPostItemFooterReplyCount, postListPostItemFooterFollowingButton} = RecentMentionsScreen.getPostListPostItem(mentionPost.id, updatedMessage); await expect(postListPostItemFooterReplyCount).toHaveText('1 reply'); await expect(postListPostItemFooterFollowingButton).toBeVisible(); // # Open post options for updated recent mention and delete post await RecentMentionsScreen.openPostOptionsFor(mentionPost.id, updatedMessage); await PostOptionsScreen.deletePost({confirm: true}); // * Verify updated recent mention is deleted await expect(postListPostItem).not.toExist(); // # Go back to channel list screen await ChannelListScreen.open(); }); it('MM-T4909_4 - should be able to save/unsave a recent mention from recent mentions screen', async () => { // # Open a channel screen, post a message with at-mention to current user, go back to channel list screen, and open recent mentions screen const message = `@${testUser.username}`; await ChannelScreen.open(channelsCategory, testChannel.name); await ChannelScreen.postMessage(message); await ChannelScreen.back(); await RecentMentionsScreen.open(); // * Verify on recent mentions screen await RecentMentionsScreen.toBeVisible(); // # Open post options for recent mention, tap on save option, and open saved messages screen const {post: mentionPost} = await Post.apiGetLastPostInChannel(siteOneUrl, testChannel.id); await RecentMentionsScreen.openPostOptionsFor(mentionPost.id, message); await PostOptionsScreen.savePostOption.tap(); await SavedMessagesScreen.open(); // * Verify recent mention is displayed on saved messages screen const {postListPostItem} = SavedMessagesScreen.getPostListPostItem(mentionPost.id, message); await expect(postListPostItem).toBeVisible(); // # Go back to recent mentions screen, open post options for recent mention, tap on usave option, and open saved messages screen await RecentMentionsScreen.open(); await RecentMentionsScreen.openPostOptionsFor(mentionPost.id, message); await PostOptionsScreen.unsavePostOption.tap(); await SavedMessagesScreen.open(); // * Verify recent mention is not displayed anymore on saved messages screen await expect(postListPostItem).not.toExist(); // # Go back to channel list screen await ChannelListScreen.open(); }); it('MM-T4909_5 - should be able to pin/unpin a recent mention from recent mentions screen', async () => { // # Open a channel screen, post a message with at-mention to current user, go back to channel list screen, and open recent mentions screen const message = `@${testUser.username}`; await ChannelScreen.open(channelsCategory, testChannel.name); await ChannelScreen.postMessage(message); await ChannelScreen.back(); await RecentMentionsScreen.open(); // * Verify on recent mentions screen await RecentMentionsScreen.toBeVisible(); // # Open post options for recent mention, tap on pin to channel option, go back to channel list screen, open the channel screen where recent mention is posted, open channel info screen, and open pinned messages screen const {post: mentionPost} = await Post.apiGetLastPostInChannel(siteOneUrl, testChannel.id); await RecentMentionsScreen.openPostOptionsFor(mentionPost.id, message); await PostOptionsScreen.pinPostOption.tap(); await ChannelListScreen.open(); await ChannelScreen.open(channelsCategory, testChannel.name); await ChannelInfoScreen.open(); await PinnedMessagesScreen.open(); // * Verify recent mention is displayed on pinned messages screen const {postListPostItem} = PinnedMessagesScreen.getPostListPostItem(mentionPost.id, message); await expect(postListPostItem).toBeVisible(); // # Go back to recent mentions screen, open post options for recent mention, tap on unpin from channel option, go back to channel list screen, open the channel screen where recent mention is posted, open channel info screen, and open pinned messages screen await PinnedMessagesScreen.back(); await ChannelInfoScreen.close(); await ChannelScreen.back(); await RecentMentionsScreen.open(); await RecentMentionsScreen.openPostOptionsFor(mentionPost.id, message); await PostOptionsScreen.unpinPostOption.tap(); await ChannelListScreen.open(); await ChannelScreen.open(channelsCategory, testChannel.name); await ChannelInfoScreen.open(); await PinnedMessagesScreen.open(); // * Verify recent mention is not displayed anymore on pinned messages screen await expect(postListPostItem).not.toExist(); // # Go back to channel list screen await PinnedMessagesScreen.back(); await ChannelInfoScreen.close(); await ChannelScreen.back(); }); }); ```
/content/code_sandbox/detox/e2e/test/search/recent_mentions.e2e.ts
xml
2016-10-07T16:52:32
2024-08-16T12:08:38
mattermost-mobile
mattermost/mattermost-mobile
2,155
2,484
```xml import { getPythonInstallerPath } from '../../src/utils/get-python-installer-path'; jest.mock('../../src/utils/get-work-dir', () => ({ getWorkDirectory: jest.fn(() => 'C:\\workDir') })); jest.mock('../../src/utils/get-is-python-installed', () => ({ getIsPythonInstalled: jest.fn(() => null) })); describe('getPythonInstallerPath', () => { it('gets the correct information', () => { const amd64 = process.arch === 'x64' ? 'amd64.' : ''; expect(getPythonInstallerPath()).toEqual({ directory: 'C:\\workDir', fileName: `python-3.8.1.${amd64}msi`, logPath: 'C:\\workDir\\python-log.txt', path: `C:\\workDir\\python-3.8.1.${amd64}msi`, targetPath: 'C:\\workDir\\python38', url: `path_to_url{amd64}msi`, }); }); }); ```
/content/code_sandbox/__tests__/utils/get-python-installer-path-test.ts
xml
2016-06-12T00:10:22
2024-08-15T12:11:21
windows-build-tools
felixrieseberg/windows-build-tools
3,397
218
```xml /* * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ import { registerElementSafely } from '@cds/core/internal'; import { CdsInternalVisualCheckbox } from './visual-checkbox.element.js'; registerElementSafely('cds-internal-visual-checkbox', CdsInternalVisualCheckbox); declare global { interface HTMLElementTagNameMap { 'cds-internal-visual-checkbox': CdsInternalVisualCheckbox; } } ```
/content/code_sandbox/packages/core/src/internal-components/visual-checkbox/register.ts
xml
2016-09-29T17:24:17
2024-08-11T17:06:15
clarity
vmware-archive/clarity
6,431
108
```xml /* * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ import iterConcat = require( './index' ); /** * Returns an iterator protocol-compliant object. * * @returns iterator protocol-compliant object */ function iterator() { return { 'next': next }; /** * Implements the iterator protocol `next` method. * * @returns iterator protocol-compliant object */ function next() { return { 'value': true, 'done': false }; } } // TESTS // // The function returns an iterator... { iterConcat( iterator(), iterator() ); // $ExpectType Iterator iterConcat( iterator(), iterator(), iterator() ); // $ExpectType Iterator iterConcat( iterator(), iterator(), iterator(), iterator() ); // $ExpectType Iterator iterConcat( iterator(), iterator(), iterator(), iterator(), iterator() ); // $ExpectType Iterator } // The compiler throws an error if the function is provided a first argument which is not an iterator protocol-compliant object... { iterConcat( '5', iterator() ); // $ExpectError iterConcat( '5', iterator(), iterator() ); // $ExpectError iterConcat( 5, iterator() ); // $ExpectError iterConcat( 5, iterator(), iterator() ); // $ExpectError iterConcat( true, iterator() ); // $ExpectError iterConcat( true, iterator(), iterator() ); // $ExpectError iterConcat( false, iterator() ); // $ExpectError iterConcat( false, iterator(), iterator() ); // $ExpectError iterConcat( null, iterator() ); // $ExpectError iterConcat( null, iterator(), iterator() ); // $ExpectError iterConcat( undefined, iterator() ); // $ExpectError iterConcat( undefined, iterator(), iterator() ); // $ExpectError iterConcat( [], iterator() ); // $ExpectError iterConcat( [], iterator(), iterator() ); // $ExpectError iterConcat( {}, iterator() ); // $ExpectError iterConcat( {}, iterator(), iterator() ); // $ExpectError iterConcat( ( x: number ): number => x, iterator() ); // $ExpectError iterConcat( ( x: number ): number => x, iterator(), iterator() ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not an iterator protocol-compliant object... { iterConcat( iterator(), '5' ); // $ExpectError iterConcat( iterator(), '5', iterator() ); // $ExpectError iterConcat( iterator(), 5 ); // $ExpectError iterConcat( iterator(), 5, iterator() ); // $ExpectError iterConcat( iterator(), true ); // $ExpectError iterConcat( iterator(), true, iterator() ); // $ExpectError iterConcat( iterator(), false ); // $ExpectError iterConcat( iterator(), false, iterator() ); // $ExpectError iterConcat( iterator(), null ); // $ExpectError iterConcat( iterator(), null, iterator() ); // $ExpectError iterConcat( iterator(), undefined ); // $ExpectError iterConcat( iterator(), undefined, iterator() ); // $ExpectError iterConcat( iterator(), [] ); // $ExpectError iterConcat( iterator(), [], iterator() ); // $ExpectError iterConcat( iterator(), {} ); // $ExpectError iterConcat( iterator(), {}, iterator() ); // $ExpectError iterConcat( iterator(), ( x: number ): number => x ); // $ExpectError iterConcat( iterator(), ( x: number ): number => x, iterator() ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not an iterator protocol-compliant object... { iterConcat( iterator(), iterator(), '5' ); // $ExpectError iterConcat( iterator(), iterator(), '5', iterator() ); // $ExpectError iterConcat( iterator(), iterator(), 5 ); // $ExpectError iterConcat( iterator(), iterator(), 5, iterator() ); // $ExpectError iterConcat( iterator(), iterator(), true ); // $ExpectError iterConcat( iterator(), iterator(), true, iterator() ); // $ExpectError iterConcat( iterator(), iterator(), false ); // $ExpectError iterConcat( iterator(), iterator(), false, iterator() ); // $ExpectError iterConcat( iterator(), iterator(), null ); // $ExpectError iterConcat( iterator(), iterator(), null, iterator() ); // $ExpectError iterConcat( iterator(), iterator(), undefined ); // $ExpectError iterConcat( iterator(), iterator(), undefined, iterator() ); // $ExpectError iterConcat( iterator(), iterator(), [] ); // $ExpectError iterConcat( iterator(), iterator(), [], iterator() ); // $ExpectError iterConcat( iterator(), iterator(), {} ); // $ExpectError iterConcat( iterator(), iterator(), {}, iterator() ); // $ExpectError iterConcat( iterator(), iterator(), ( x: number ): number => x ); // $ExpectError iterConcat( iterator(), iterator(), ( x: null ): null => x, iterator() ); // $ExpectError } // The compiler throws an error if the function is provided insufficient arguments... { iterConcat(); // $ExpectError iterConcat( iterator() ); // $ExpectError } ```
/content/code_sandbox/lib/node_modules/@stdlib/iter/concat/docs/types/test.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
1,165
```xml <?xml version="1.0" encoding="UTF-8"?> <definitions id="definition" xmlns="path_to_url" xmlns:xsi="path_to_url" xmlns:flowable="path_to_url" targetNamespace="Examples"> <process id="myProcess"> <startEvent id="theStart" /> <sequenceFlow id="flow1" sourceRef="theStart" targetRef="miTasks" /> <userTask id="miTasks" name="My Task" flowable:taskIdVariableName="taskId" flowable:priority="${loopCounter}"> <multiInstanceLoopCharacteristics isSequential="false"> <extensionElements> <flowable:variableAggregation target="results"> <variable source="description" /> <variable source="score" /> <variable source="passed" /> <variable source="location" /> <variable source="startTime" /> </flowable:variableAggregation> </extensionElements> <loopCardinality>${nrOfLoops}</loopCardinality> </multiInstanceLoopCharacteristics> </userTask> <sequenceFlow id="flow4" sourceRef="miTasks" targetRef="afterMiTasks" /> <userTask id="afterMiTasks" /> <sequenceFlow id="flow5" sourceRef="afterMiTasks" targetRef="theEnd" /> <endEvent id="theEnd" /> </process> </definitions> ```
/content/code_sandbox/modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/multiinstance/MultiInstanceVariableAggregationTest.testParallelMultiInstanceUserTaskVariableTypes.bpmn20.xml
xml
2016-10-13T07:21:43
2024-08-16T15:23:14
flowable-engine
flowable/flowable-engine
7,715
311
```xml import { position, sameLineLocation } from '../../../util'; import { getDocUri } from '../../path'; import { testDefinition } from '../../../definitionHelper'; describe('Should find definition in pug template', () => { const docUri = getDocUri('definition/BasicPug.vue'); it('finds definition for child tag', async () => { const tagUri = getDocUri('definition/Child.vue'); await testDefinition(docUri, position(2, 5), sameLineLocation(tagUri, 0, 0, 0)); }); it('finds definition for test-bar tag', async () => { const tagUri = getDocUri('definition/TestBar.vue'); await testDefinition(docUri, position(3, 5), sameLineLocation(tagUri, 0, 0, 0)); }); it('finds definition for TestBar tag', async () => { const tagUri = getDocUri('definition/TestBar.vue'); await testDefinition(docUri, position(4, 5), sameLineLocation(tagUri, 0, 0, 0)); }); }); ```
/content/code_sandbox/test/interpolation/features/definition/pug.test.ts
xml
2016-10-29T23:20:43
2024-08-16T03:59:58
vetur
vuejs/vetur
5,739
242
```xml /* * one or more contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright ownership. */ import {Page, Locator} from '@playwright/test'; class ProcessesPage { private page: Page; readonly continueButton: Locator; readonly cancelButton: Locator; readonly modaLStartProcessButton: Locator; readonly startProcessButton: Locator; readonly docsLink: Locator; readonly searchProcessesInput: Locator; readonly processTile: Locator; readonly tasksTab: Locator; constructor(page: Page) { this.page = page; this.continueButton = page.getByRole('button', {name: 'Continue'}); this.cancelButton = page.getByRole('button', {name: 'Cancel'}); this.startProcessButton = page.getByRole('button', {name: 'Start process'}); this.modaLStartProcessButton = this.page .getByLabel('Start process processWithStartNodeFormDeployed') .getByRole('button', {name: 'Start process'}); this.docsLink = page.getByRole('link', {name: 'here'}); this.searchProcessesInput = page.getByPlaceholder('Search processes'); this.processTile = page.getByTestId('process-tile'); this.tasksTab = page.getByRole('link', {name: 'Tasks'}); } async goto() { await this.page.goto('/processes', { waitUntil: 'networkidle', }); } public async searchForProcess(process: string) { await this.searchProcessesInput.click(); await this.searchProcessesInput.fill(process); await this.searchProcessesInput.press('Enter'); } } export {ProcessesPage}; ```
/content/code_sandbox/tasklist/client/e2e/pageElements/ProcessesPage.ts
xml
2016-03-20T03:38:04
2024-08-16T19:59:58
camunda
camunda/camunda
3,172
355
```xml /* * one or more contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright ownership. */ import {shallow} from 'enzyme'; import {MenuItem} from '@carbon/react'; import CreateNewButton from './CreateNewButton'; const props = { create: jest.fn(), importEntity: jest.fn(), }; it('should not show the collection option if it is in a collection', () => { const node = shallow(<CreateNewButton {...props} />); expect(node.find({label: 'Collection'})).toExist(); node.setProps({collection: '123'}); expect(node.find({label: 'Collection'})).not.toExist(); }); it('should call the createCollection prop', () => { const spy = jest.fn(); const node = shallow(<CreateNewButton {...props} create={spy} />); node.find(MenuItem).at(0).simulate('click'); expect(spy).toHaveBeenCalledWith('collection'); }); it('should call the createProcessReport prop', () => { const spy = jest.fn(); const node = shallow(<CreateNewButton {...props} create={spy} />); node.find({label: 'Report'}).simulate('click'); expect(spy).toHaveBeenCalledWith('report'); }); it('should call the createDashboard prop', () => { const spy = jest.fn(); const node = shallow(<CreateNewButton {...props} create={spy} />); node.find(MenuItem).at(1).simulate('click'); expect(spy).toHaveBeenCalledWith('dashboard'); }); it('should call the createKpi prop', () => { const spy = jest.fn(); const node = shallow(<CreateNewButton {...props} create={spy} />); node.find({label: 'Process KPI'}).simulate('click'); expect(spy).toHaveBeenCalledWith('kpi'); }); ```
/content/code_sandbox/optimize/client/src/components/Home/CreateNewButton.test.tsx
xml
2016-03-20T03:38:04
2024-08-16T19:59:58
camunda
camunda/camunda
3,172
391
```xml import type { Domain } from '@vercel-internals/types'; export type DomainRegistrar = 'Vercel' | 'Purchase in Process' | 'Third Party'; export function getDomainRegistrar(domain: Domain): DomainRegistrar { if (domain.boughtAt) { return 'Vercel'; } if (typeof domain.orderedAt === 'number' && !domain.boughtAt) { return 'Purchase in Process'; } return 'Third Party'; } ```
/content/code_sandbox/packages/cli/src/util/domains/get-domain-registrar.ts
xml
2016-09-09T01:12:08
2024-08-16T17:39:45
vercel
vercel/vercel
12,545
101
```xml import {devtools} from '@floating-ui/devtools'; import {useClick, useFloating, useInteractions} from '@floating-ui/react'; import type {Meta} from '@storybook/react'; import * as React from 'react'; export default { title: 'Examples/Floating UI', parameters: { layout: 'centered', }, } satisfies Meta; export const UseFloating = () => { const [isOpen, setIsOpen] = React.useState(true); const {refs, floatingStyles, context} = useFloating({ open: isOpen, onOpenChange: setIsOpen, middleware: [devtools()], }); const click = useClick(context); const {getReferenceProps, getFloatingProps} = useInteractions([click]); return ( <> <button ref={refs.setReference} {...getReferenceProps()}> Reference element </button> {isOpen && ( <div ref={refs.setFloating} style={floatingStyles} {...getFloatingProps()} > Floating element </div> )} </> ); }; UseFloating.displayName = 'useFloating'; UseFloating.title = 'useFloating'; ```
/content/code_sandbox/extension/src/views/floating-ui/FloatingUIExamples.stories.tsx
xml
2016-03-29T17:00:47
2024-08-16T16:29:40
floating-ui
floating-ui/floating-ui
29,450
247
```xml import { $ } from '../$.js'; import { isFunction, isString } from '../shared/helper.js'; import './before.js'; import './clone.js'; import './each.js'; import './remove.js'; import type { JQ } from '../shared/core.js'; import type { HTMLString, TypeOrArray } from '../shared/helper.js'; declare module '../shared/core.js' { interface JQ<T = HTMLElement> { /** * * @param newContent * HTML DOM DOM JQ * * HTML`this` * @returns * @example ```js $('.box').replaceWith('<p>Hello</p>') ``` * @example ```js $('.box').replaceWith(function (index, html) { return html + index; }) ``` */ replaceWith( newContent: | HTMLString | TypeOrArray<Element> | JQ | (( this: T, index: number, oldHtml: string, ) => HTMLString | TypeOrArray<Element> | JQ), ): this; } } // eslint-disable-next-line $.fn.replaceWith = function (this: JQ, newContent: any): JQ { this.each((index, element) => { let content = newContent; if (isFunction(content)) { content = content.call(element, index, element.innerHTML); } else if (index && !isString(content)) { content = $(content).clone(); } $(element).before(content); }); return this.remove(); }; ```
/content/code_sandbox/packages/jq/src/methods/replaceWith.ts
xml
2016-07-11T17:39:02
2024-08-16T07:12:34
mdui
zdhxiong/mdui
4,077
344
```xml import { useRouter, useCurrentStateAndParams } from '@uirouter/react'; import { useQueryClient } from '@tanstack/react-query'; import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import { AccessControlPanel } from '@/react/portainer/access-control/AccessControlPanel/AccessControlPanel'; import { ResourceControlType } from '@/react/portainer/access-control/types'; import { ContainerListViewModel } from '@/react/docker/containers/types'; import { ResourceControlViewModel } from '@/react/portainer/access-control/models/ResourceControlViewModel'; import { useContainers } from '@/react/docker/containers/queries/useContainers'; import { notifySuccess } from '@/portainer/services/notifications'; import { PageHeader } from '@@/PageHeader'; import { useDeleteNetwork } from '../queries/useDeleteNetworkMutation'; import { isSystemNetwork } from '../network.helper'; import { NetworkResponseContainers } from '../types'; import { queryKeys } from '../queries/queryKeys'; import { useNetwork } from '../queries/useNetwork'; import { NetworkDetailsTable } from './NetworkDetailsTable'; import { NetworkOptionsTable } from './NetworkOptionsTable'; import { NetworkContainersTable } from './NetworkContainersTable'; export function ItemView() { const router = useRouter(); const queryClient = useQueryClient(); const { params: { id: networkId, nodeName }, } = useCurrentStateAndParams(); const environmentId = useEnvironmentId(); const networkQuery = useNetwork(environmentId, networkId, { nodeName }); const deleteNetworkMutation = useDeleteNetwork(environmentId); const containersQuery = useContainers(environmentId, { filters: { network: [networkId], }, nodeName, }); if (!networkQuery.data) { return null; } const network = networkQuery.data; const networkContainers = filterContainersInNetwork( network.Containers, containersQuery.data ); const resourceControl = network.Portainer?.ResourceControl ? new ResourceControlViewModel(network.Portainer.ResourceControl) : undefined; return ( <> <PageHeader title="Network details" breadcrumbs={[ { link: 'docker.networks', label: 'Networks' }, { link: 'docker.networks.network', label: networkQuery.data.Name, }, ]} reload /> <NetworkDetailsTable network={networkQuery.data} onRemoveNetworkClicked={onRemoveNetworkClicked} /> <AccessControlPanel onUpdateSuccess={() => queryClient.invalidateQueries( queryKeys.item(environmentId, networkId) ) } resourceControl={resourceControl} resourceType={ResourceControlType.Network} disableOwnershipChange={isSystemNetwork(networkQuery.data.Name)} resourceId={networkId} environmentId={environmentId} /> <NetworkOptionsTable options={networkQuery.data.Options} /> <NetworkContainersTable networkContainers={networkContainers} nodeName={nodeName} environmentId={environmentId} networkId={networkId} /> </> ); async function onRemoveNetworkClicked() { deleteNetworkMutation.mutate( { networkId, nodeName }, { onSuccess: () => { notifySuccess('Network successfully removed', networkId); router.stateService.go('docker.networks'); }, } ); } } function filterContainersInNetwork( networkContainers?: NetworkResponseContainers, containers: ContainerListViewModel[] = [] ) { if (!networkContainers) { return []; } return containers .filter((container) => networkContainers[container.Id]) .map((container) => ({ ...networkContainers[container.Id], Id: container.Id, })); } ```
/content/code_sandbox/app/react/docker/networks/ItemView/ItemView.tsx
xml
2016-05-19T20:15:28
2024-08-16T19:15:14
portainer
portainer/portainer
30,083
786
```xml import * as React from 'react'; import { Text } from 'ink'; import { Stack } from './Stack.js'; export type ChoiceType = { label: string; value: string; description?: string; }; export const SelectInputChoice = ({ isSelected = false, label, description, }: { isSelected: boolean; label: string; description: string; }) => { return ( <Stack> <Text bold={isSelected ? true : false}>{label}</Text> <Text italic>{description}</Text> </Stack> ); }; ```
/content/code_sandbox/packages/create-react-admin/src/SelectInputChoice.tsx
xml
2016-07-13T07:58:54
2024-08-16T18:32:27
react-admin
marmelab/react-admin
24,624
124
```xml /* eslint-disable no-var */ // This dangerfile is for running as an integration test on CI import { DangerDSLType } from "../../../dsl/DangerDSL" declare var danger: DangerDSLType declare function markdown(params: string): void const showArray = (array: any[], mapFunc?: (a: any) => any) => { const defaultMap = (a: any) => a const mapper = mapFunc || defaultMap return `\n - ${array.map(mapper).join("\n - ")}\n` } const git = danger.git const goAsync = async () => { const firstFileDiff = await git.diffForFile(git.modified_files[0]) const firstJSONFile = git.modified_files.find((f) => f.endsWith("json")) const jsonDiff = firstJSONFile && (await git.JSONDiffForFile(firstJSONFile)) const jsonDiffKeys = jsonDiff && showArray(Object.keys(jsonDiff)) markdown(` created: ${showArray(git.created_files)} modified: ${showArray(git.modified_files)} deleted: ${showArray(git.deleted_files)} commits: ${git.commits.length} messages: ${showArray(git.commits, (c) => c.message)} diffForFile keys:${firstFileDiff && showArray(Object.keys(firstFileDiff))} jsonDiff keys:${jsonDiffKeys || "no JSON files in the diff"} `) } goAsync() ```
/content/code_sandbox/source/platforms/git/_tests/local_dangerfile_example.ts
xml
2016-08-20T12:57:06
2024-08-13T14:00:02
danger-js
danger/danger-js
5,229
301
```xml import { ActionDefinitions, addSheetInputSchema, addSheetOutputSchema, appendValuesInputSchema, appendValuesOutputSchema, clearValuesInputSchema, clearValuesOutputSchema, getInfoInputSchema, getInfoOutputSchema, getValuesInputSchema, getValuesOutputSchema, updateValuesInputSchema, updateValuesOutputSchema, } from '../misc/custom-schemas' import { addSheetUi, appendValuesUi, clearValuesUi, getInfoUi, getValuesUi, updateValuesUi } from '../misc/custom-uis' type ActionDef = ActionDefinitions[string] const getValues = { title: 'Get Values', input: { schema: getValuesInputSchema, ui: getValuesUi, }, output: { schema: getValuesOutputSchema, }, } satisfies ActionDef const updateValues = { title: 'Update Values', input: { schema: updateValuesInputSchema, ui: updateValuesUi, }, output: { schema: updateValuesOutputSchema, }, } satisfies ActionDef const appendValues = { title: 'Append Values', input: { schema: appendValuesInputSchema, ui: appendValuesUi, }, output: { schema: appendValuesOutputSchema, }, } satisfies ActionDef const clearValues = { title: 'Clear Values', input: { schema: clearValuesInputSchema, ui: clearValuesUi, }, output: { schema: clearValuesOutputSchema, }, } satisfies ActionDef const getInfoSpreadsheet = { title: 'Get Info of a SpreadSheet', input: { schema: getInfoInputSchema, ui: getInfoUi, }, output: { schema: getInfoOutputSchema, }, } satisfies ActionDef const addSheet = { title: 'Add Sheet', input: { schema: addSheetInputSchema, ui: addSheetUi, }, output: { schema: addSheetOutputSchema, }, } satisfies ActionDef export const actions = { getValues, updateValues, appendValues, clearValues, getInfoSpreadsheet, addSheet, } satisfies ActionDefinitions ```
/content/code_sandbox/integrations/gsheets/src/definitions/actions.ts
xml
2016-11-16T21:57:59
2024-08-16T18:45:35
botpress
botpress/botpress
12,401
474
```xml import { AnyAction } from 'redux'; import { action } from 'typesafe-actions'; import { createCodeError } from 'shared/models/Error'; import makeCommunicationActionTypes from '../makeCommunicationActionTypes'; import makeCommunicationReducer from '../makeCommunicationReducer'; import { ICommunication } from '../types'; describe('(utils/redux/communication) makeCommunicationReducer', () => { const initialState: ICommunication = { error: undefined, isRequesting: false, isSuccess: false, }; const commActionTypes = makeCommunicationActionTypes({ REQUEST: 'request', SUCCESS: 'success', FAILURE: 'failure', }); const communicationReducer = makeCommunicationReducer({ requestType: commActionTypes.REQUEST, successType: commActionTypes.SUCCESS, failureType: commActionTypes.FAILURE, }); const testCommReducer = ( name: string, action: AnyAction, expected: ICommunication ) => { it(name, () => { const res = communicationReducer(initialState, action); expect(res).toEqual(expected); }); }; it('should return correct initial state', () => { const res = communicationReducer(undefined, { type: '@@init' }); expect(res).toEqual(initialState); }); testCommReducer( 'should return communication in requesting state on request action', action(commActionTypes.REQUEST), { ...initialState, isRequesting: true } ); testCommReducer( 'should return communication in successful state on success action', action(commActionTypes.SUCCESS), { ...initialState, isSuccess: true } ); testCommReducer( 'should return communication in failure state on failure action', action(commActionTypes.FAILURE, createCodeError('error')), { ...initialState, error: createCodeError('error') } ); }); ```
/content/code_sandbox/webapp/client/src/shared/utils/redux/communication/__tests__/makeCommunicationReducer.test.ts
xml
2016-10-19T01:07:26
2024-08-14T03:53:55
modeldb
VertaAI/modeldb
1,689
383
```xml function convertToPoints({ xMin, xMax, yMin, yMax }) { return [ { x: xMin, y: yMin }, // tl { x: xMax, y: yMin }, // tr { x: xMax, y: yMax }, // br { x: xMin, y: yMax }, // bl ]; } export { convertToPoints }; ```
/content/code_sandbox/packages/f2/src/components/interval/util.ts
xml
2016-08-29T06:26:23
2024-08-16T15:50:14
F2
antvis/F2
7,877
91
```xml import { G2Spec } from '../../../src'; export function population2015IntervalDonutTextAnnotation(): G2Spec { return { type: 'view', height: 640, padding: 0, coordinate: { type: 'theta', innerRadius: 0.6 }, children: [ { type: 'interval', data: { type: 'fetch', value: 'data/population2015.csv', }, transform: [{ type: 'stackY' }], scale: { color: { palette: 'spectral', offset: (t) => t * 0.8 + 0.1, }, }, legend: false, encode: { y: 'value', color: 'name', }, }, { type: 'text', style: { text: 'Donut', // Relative position. x: '50%', y: '50%', fontSize: 40, textAlign: 'center', fontWeight: 'bold', }, }, { type: 'text', style: { text: 'chart', // Absolute position. x: (640 - 32) / 2, y: 360, fontSize: 20, textAlign: 'center', fontWeight: 'bold', }, }, ], }; } ```
/content/code_sandbox/__tests__/plots/static/population2015-interval-donut-text-annotation.ts
xml
2016-05-26T09:21:04
2024-08-15T16:11:17
G2
antvis/G2
12,060
300
```xml <ResourceDictionary xmlns="path_to_url" xmlns:x="path_to_url" xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" xmlns:muxc="using:Microsoft.UI.Xaml.Controls"> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Dark"> <!-- TODO: This still seems a bit dark? --> <SolidColorBrush x:Key="ContextualTabBackground" Color="{ThemeResource SystemAltMediumHighColor}" /> </ResourceDictionary> <ResourceDictionary x:Key="Light"> <SolidColorBrush x:Key="ContextualTabBackground" Color="{ThemeResource SystemChromeMediumColor}" /> </ResourceDictionary> <ResourceDictionary x:Key="HighContrast"> <SolidColorBrush x:Key="ContextualTabBackground" Color="{ThemeResource SystemAltLowColor}" /> </ResourceDictionary> </ResourceDictionary.ThemeDictionaries> <SolidColorBrush x:Key="NormalTabBackground" Color="{ThemeResource SystemChromeLowColor}" /> <SolidColorBrush x:Key="NormalTabAcrylicBackground" Color="{ThemeResource SystemControlChromeLowAcrylicWindowBrush}" /> <Style BasedOn="{StaticResource DefaultTabbedCommandBarItemStyle}" TargetType="controls:TabbedCommandBarItem" /> <Style x:Key="DefaultTabbedCommandBarItemStyle" BasedOn="{StaticResource DefaultCommandBarStyle}" TargetType="controls:TabbedCommandBarItem"> <Setter Property="HorizontalAlignment" Value="Stretch" /> <Setter Property="DefaultLabelPosition" Value="Right" /> <Setter Property="Background" Value="{ThemeResource NormalTabBackground}" /> <!-- Is there a way to prevent the overflow button from showing if there aren't any buttons to send to the overflow menu? (See this message in the WinUI channel: path_to_url ) Hardcoding the height of the CommandBar works, but it's a bit of a hack. --> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> </Style> <Style x:Key="TabbedCommandBarItemAcrylicStyle" BasedOn="{StaticResource DefaultTabbedCommandBarItemStyle}" TargetType="controls:TabbedCommandBarItem"> <Setter Property="Background" Value="{ThemeResource NormalTabAcrylicBackground}" /> </Style> <DataTemplate x:Key="NormalTabTemplate"> <muxc:NavigationViewItem Content="{Binding Header}" Visibility="{Binding Visibility}" /> </DataTemplate> <DataTemplate x:Key="ContextualTabTemplate"> <muxc:NavigationViewItem Background="{ThemeResource ContextualTabBackground}" Content="{Binding Header}" Visibility="{Binding Visibility}"> <muxc:NavigationViewItem.Resources> <!-- TODO: These should reference TabbedCommandBarItem-specific resources so they can overriden --> <SolidColorBrush x:Key="TopNavigationViewItemForeground" Color="{ThemeResource SystemAccentColor}" /> <SolidColorBrush x:Key="TopNavigationViewItemForegroundSelected" Color="{ThemeResource SystemAccentColor}" /> <SolidColorBrush x:Key="TopNavigationViewItemForegroundPointerOver" Color="{ThemeResource SystemAccentColorLight2}" /> <SolidColorBrush x:Key="TopNavigationViewItemForegroundPressed" Color="{ThemeResource SystemAccentColorLight2}" /> <!-- TODO: Set BackgroundSelected to match ContextualTabBackground --> <!--<StaticResource x:Key="TopNavigationViewItemBackgroundSelected" ResourceKey="ContextualTabBackgroundColor" />--> </muxc:NavigationViewItem.Resources> </muxc:NavigationViewItem> </DataTemplate> <controls:TabbedCommandBarItemTemplateSelector x:Key="DefaultTabbedCommandBarItemTemplateSelector" Contextual="{StaticResource ContextualTabTemplate}" Normal="{StaticResource NormalTabTemplate}" /> <Style x:Key="TabbedCommandBarElementContainerStyle" TargetType="AppBarElementContainer"> <Setter Property="VerticalAlignment" Value="Stretch" /> <Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="Margin" Value="1,0" /> </Style> <Style x:Key="AppBarSplitButtonStyle" TargetType="SplitButton"> <Setter Property="Background" Value="{ThemeResource AppBarButtonRevealBackground}" /> <Setter Property="Foreground" Value="{ThemeResource AppBarItemForegroundThemeBrush}" /> <Setter Property="BorderBrush" Value="{ThemeResource SplitButtonBorderBrush}" /> <Setter Property="BorderThickness" Value="{ThemeResource SplitButtonBorderThemeThickness}" /> <Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> <Setter Property="FontWeight" Value="Normal" /> <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> <Setter Property="UseSystemFocusVisuals" Value="True" /> <Setter Property="FocusVisualMargin" Value="-3" /> <Setter Property="IsTabStop" Value="True" /> <Setter Property="Padding" Value="{ThemeResource ButtonPadding}" /> <Setter Property="CornerRadius" Value="0" /> <Setter Property="Padding" Value="10" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="SplitButton"> <Grid x:Name="RootGrid" Background="Transparent" CornerRadius="{TemplateBinding CornerRadius}"> <Grid.Resources> <!-- Override the style of the inner buttons so that they don't affect background/foreground/border colors --> <Style TargetType="Button"> <Setter Property="Background" Value="{ThemeResource ButtonRevealBackground}" /> <Setter Property="Foreground" Value="{ThemeResource ButtonForeground}" /> <Setter Property="BorderBrush" Value="{ThemeResource ButtonRevealBorderBrush}" /> <Setter Property="BorderThickness" Value="{ThemeResource ButtonRevealBorderThemeThickness}" /> <Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> <Setter Property="FontWeight" Value="Normal" /> <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> <Setter Property="FocusVisualMargin" Value="-3" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid x:Name="RootGrid" Background="Transparent"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"> <Storyboard> <PointerUpThemeAnimation Storyboard.TargetName="RootGrid" /> </Storyboard> </VisualState> <VisualState x:Name="PointerOver"> <VisualState.Setters> <Setter Target="RootGrid.(RevealBrush.State)" Value="PointerOver" /> <Setter Target="RootGrid.Background" Value="{ThemeResource AppBarButtonRevealBackgroundPointerOver}" /> <Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource AppBarButtonRevealBorderBrushPointerOver}" /> <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> </VisualState.Setters> <Storyboard> <PointerUpThemeAnimation Storyboard.TargetName="RootGrid" /> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <VisualState.Setters> <Setter Target="RootGrid.(RevealBrush.State)" Value="Pressed" /> <Setter Target="RootGrid.Background" Value="{ThemeResource AppBarButtonRevealBackgroundPressed}" /> <Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource AppBarButtonRevealBorderBrushPressed}" /> <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> </VisualState.Setters> <Storyboard> <PointerDownThemeAnimation Storyboard.TargetName="RootGrid" /> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <VisualState.Setters> <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SplitButtonForegroundDisabled}" /> </VisualState.Setters> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <ContentPresenter x:Name="ContentPresenter" Padding="{TemplateBinding Padding}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" AutomationProperties.AccessibilityView="Raw" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" /> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </Grid.Resources> <Grid.ColumnDefinitions> <ColumnDefinition x:Name="PrimaryButtonColumn" Width="*" MinWidth="{ThemeResource SplitButtonPrimaryButtonSize}" /> <ColumnDefinition x:Name="Separator" Width="1" /> <ColumnDefinition x:Name="SecondaryButtonColumn" Width="{ThemeResource SplitButtonSecondaryButtonSize}" /> </Grid.ColumnDefinitions> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> <VisualState x:Name="FlyoutOpen"> <VisualState.Setters> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource AppBarButtonRevealBackgroundPressed}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource AppBarButtonRevealBackgroundPressed}" /> <Setter Target="Border.BorderBrush" Value="{ThemeResource AppBarButtonRevealBorderBrushPressed}" /> <Setter Target="PrimaryButton.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> <Setter Target="SecondaryButton.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="TouchPressed"> <VisualState.Setters> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource AppBarButtonRevealBackgroundPressed}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource AppBarButtonRevealBackgroundPressed}" /> <Setter Target="Border.BorderBrush" Value="{ThemeResource AppBarButtonRevealBorderBrushPressed}" /> <Setter Target="PrimaryButton.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> <Setter Target="SecondaryButton.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="PrimaryPointerOver"> <VisualState.Setters> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource AppBarButtonRevealBackgroundPointerOver}" /> <Setter Target="PrimaryButton.BorderBrush" Value="{ThemeResource AppBarButtonRevealBorderBrushPointerOver}" /> <Setter Target="PrimaryButton.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource AppBarButtonRevealBackground}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="PrimaryPressed"> <VisualState.Setters> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource AppBarButtonBackgroundPressed}" /> <Setter Target="PrimaryButton.BorderBrush" Value="{ThemeResource AppBarButtonRevealBorderBrushPressed}" /> <Setter Target="PrimaryButton.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource AppBarButtonRevealBackground}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="SecondaryPointerOver"> <VisualState.Setters> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource AppBarButtonRevealBackground}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource AppBarButtonRevealBackgroundPointerOver}" /> <Setter Target="SecondaryButton.BorderBrush" Value="{ThemeResource AppBarButtonRevealBorderBrushPointerOver}" /> <Setter Target="SecondaryButton.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="SecondaryPressed"> <VisualState.Setters> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource AppBarButtonRevealBackground}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource AppBarButtonBackgroundPressed}" /> <Setter Target="SecondaryButton.BorderBrush" Value="{ThemeResource AppBarButtonRevealBorderBrushPressed}" /> <Setter Target="SecondaryButton.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="Checked"> <VisualState.Setters> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundChecked}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundChecked}" /> <Setter Target="Border.BorderBrush" Value="{ThemeResource SplitButtonBorderBrushChecked}" /> <Setter Target="PrimaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundChecked}" /> <Setter Target="SecondaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundChecked}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="CheckedFlyoutOpen"> <VisualState.Setters> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundCheckedPressed}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundCheckedPressed}" /> <Setter Target="Border.BorderBrush" Value="{ThemeResource SplitButtonBorderBrushCheckedPressed}" /> <Setter Target="PrimaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundCheckedPressed}" /> <Setter Target="SecondaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundCheckedPressed}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="CheckedTouchPressed"> <VisualState.Setters> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundCheckedPressed}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundCheckedPressed}" /> <Setter Target="Border.BorderBrush" Value="{ThemeResource SplitButtonBorderBrushCheckedPressed}" /> <Setter Target="PrimaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundCheckedPressed}" /> <Setter Target="SecondaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundCheckedPressed}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="CheckedPrimaryPointerOver"> <VisualState.Setters> <Setter Target="Border.BorderBrush" Value="{ThemeResource SplitButtonBorderBrushChecked}" /> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundCheckedPointerOver}" /> <Setter Target="PrimaryButton.BorderBrush" Value="{ThemeResource SplitButtonBorderBrushCheckedPointerOver}" /> <Setter Target="PrimaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundCheckedPointerOver}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundChecked}" /> <Setter Target="SecondaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundChecked}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="CheckedPrimaryPressed"> <VisualState.Setters> <Setter Target="Border.BorderBrush" Value="{ThemeResource SplitButtonBorderBrushChecked}" /> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundCheckedPressed}" /> <Setter Target="PrimaryButton.BorderBrush" Value="{ThemeResource SplitButtonBorderBrushCheckedPressed}" /> <Setter Target="PrimaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundCheckedPressed}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundChecked}" /> <Setter Target="SecondaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundChecked}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="CheckedSecondaryPointerOver"> <VisualState.Setters> <Setter Target="Border.BorderBrush" Value="{ThemeResource SplitButtonBorderBrushChecked}" /> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundChecked}" /> <Setter Target="PrimaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundChecked}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundCheckedPointerOver}" /> <Setter Target="SecondaryButton.BorderBrush" Value="{ThemeResource SplitButtonBorderBrushCheckedPointerOver}" /> <Setter Target="SecondaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundCheckedPointerOver}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="CheckedSecondaryPressed"> <VisualState.Setters> <Setter Target="Border.BorderBrush" Value="{ThemeResource SplitButtonBorderBrushChecked}" /> <Setter Target="PrimaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundChecked}" /> <Setter Target="PrimaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundChecked}" /> <Setter Target="SecondaryBackgroundGrid.Background" Value="{ThemeResource SplitButtonBackgroundCheckedPressed}" /> <Setter Target="SecondaryButton.BorderBrush" Value="{ThemeResource SplitButtonBorderBrushCheckedPressed}" /> <Setter Target="SecondaryButton.Foreground" Value="{ThemeResource SplitButtonForegroundCheckedPressed}" /> </VisualState.Setters> </VisualState> </VisualStateGroup> <VisualStateGroup x:Name="SecondaryButtonPlacementStates"> <VisualState x:Name="SecondaryButtonRight" /> <VisualState x:Name="SecondaryButtonSpan"> <VisualState.Setters> <Setter Target="SecondaryButton.(Grid.Column)" Value="0" /> <Setter Target="SecondaryButton.(Grid.ColumnSpan)" Value="3" /> </VisualState.Setters> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <Grid x:Name="PrimaryBackgroundGrid" Background="{TemplateBinding Background}" /> <Grid x:Name="SecondaryBackgroundGrid" Grid.Column="2" Background="{TemplateBinding Background}" /> <Grid x:Name="Border" Grid.ColumnSpan="3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" /> <Button x:Name="PrimaryButton" Grid.Column="0" Padding="{TemplateBinding Padding}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" AutomationProperties.AccessibilityView="Raw" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" Foreground="{TemplateBinding Foreground}" IsTabStop="False" /> <Button x:Name="SecondaryButton" Grid.Column="2" Padding="0,0,9,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" AutomationProperties.AccessibilityView="Raw" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" Foreground="{TemplateBinding Foreground}" IsTabStop="False"> <Button.Content> <TextBlock HorizontalAlignment="Right" VerticalAlignment="Center" AutomationProperties.AccessibilityView="Raw" FontFamily="{ThemeResource SymbolThemeFontFamily}" FontSize="12" Text="&#xE70D;" /> </Button.Content> </Button> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary> ```
/content/code_sandbox/Microsoft.Toolkit.Uwp.UI.Controls.Core/TabbedCommandBar/TabbedCommandBarItem.xaml
xml
2016-06-17T21:29:46
2024-08-16T09:32:00
WindowsCommunityToolkit
CommunityToolkit/WindowsCommunityToolkit
5,842
4,336
```xml <Window x:Class="TwitchLeecher.Gui.Views.UpdateInfoView" xmlns="path_to_url" xmlns:x="path_to_url" xmlns:ctrl="clr-namespace:TwitchLeecher.Gui.Controls" Style="{DynamicResource TlWindow}" WindowStyle="SingleBorderWindow" WindowStartupLocation="CenterOwner" Width="580" Height="480" MinWidth="450" MinHeight="300"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="../Theme/Constants.xaml" /> <ResourceDictionary Source="../Theme/Templates.xaml" /> <ResourceDictionary Source="../Theme/Styles.xaml" /> <ResourceDictionary Source="../Theme/Images.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> <Border Padding="20"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="10" /> <RowDefinition Height="Auto" /> <RowDefinition Height="10" /> <RowDefinition Height="Auto" /> <RowDefinition Height="10" /> <RowDefinition /> </Grid.RowDefinitions> <Border Grid.Row="0" Padding="0,0,0,5" BorderThickness="0,0,0,1"> <Border.BorderBrush> <SolidColorBrush Color="{StaticResource Global.Theme.Color}" /> </Border.BorderBrush> <TextBlock Text="Update Available" FontSize="21" FontWeight="Bold" /> </Border> <TextBlock Grid.Row="2"> <Run Text="Twitch Leecher" /> <Run Text="{Binding UpdateInfo.NewVersionStr, Mode=OneWay, FallbackValue='X.Y.Z'}" /> <Run Text="has been released on" /> <Run Text="{Binding UpdateInfo.ReleaseDate, Mode=OneWay, FallbackValue='04/21/2016', StringFormat=d}" /> </TextBlock> <TextBlock Grid.Row="4"> <Hyperlink Command="{Binding DownloadCommand}" NavigateUri="{Binding UpdateInfo.DownloadUrl, Mode=OneWay}"> <TextBlock Text="{Binding UpdateInfo.DownloadUrl, Mode=OneWay, FallbackValue='path_to_url}" /> </Hyperlink> </TextBlock> <Border Grid.Row="6" BorderThickness="1"> <Border.BorderBrush> <SolidColorBrush Color="{StaticResource Global.Theme.Border.Color}" /> </Border.BorderBrush> <ctrl:TlScrollingTextBox Style="{StaticResource TlScrollingTextBox}" Text="{Binding UpdateInfo.ReleaseNotes, Mode=OneWay}" /> </Border> </Grid> </Border> </Window> ```
/content/code_sandbox/TwitchLeecher/TwitchLeecher.Gui/Views/UpdateInfoView.xaml
xml
2016-02-20T17:40:32
2024-08-16T19:27:00
TwitchLeecher
Franiac/TwitchLeecher
2,826
592
```xml import { deepMix, isNil } from '@antv/util'; import { jsx } from '@antv/f-engine'; export default (props) => { const { records, animation, clip } = props; return ( <group attrs={{ clip, }} > {records.map((record) => { const { key, children } = record; return ( <group key={key}> {children.map((item) => { const { x, y, size, color, shapeName, shape } = item; if (isNaN(x) || isNaN(y)) { return null; } if (shapeName === 'rect') { const rectSize = isNil(size) ? shape.size : size; return ( <rect key={key} attrs={{ x: x - rectSize, y: y - rectSize, fill: color, stroke: color, ...shape, width: rectSize * 2, height: rectSize * 2, }} animation={deepMix( { appear: { easing: 'linear', duration: 450, }, update: { easing: 'linear', duration: 450, property: ['x', 'y', 'width', 'height', 'fill'], }, }, animation )} /> ); } return ( <circle key={key} style={{ cx: x, cy: y, fill: shapeName === 'circle' ? color : null, stroke: shapeName === 'hollowCircle' ? color : null, ...shape, r: isNil(size) ? shape.size : size, }} animation={deepMix( { appear: { easing: 'linear', duration: 450, }, update: { easing: 'linear', duration: 450, property: ['cx', 'cy', 'r', 'fill'], }, }, animation )} /> ); })} </group> ); })} </group> ); }; ```
/content/code_sandbox/packages/f2/src/components/point/pointView.tsx
xml
2016-08-29T06:26:23
2024-08-16T15:50:14
F2
antvis/F2
7,877
462
```xml import { Chart } from '@antv/g2'; const dataXO = [ { x: 0, y: 0.241, type: 'x', }, { x: 1, y: 0.367, type: 'x', }, { x: 2, y: 0.036, type: 'x', }, { x: 3, y: 0.112, type: 'o', }, { x: 4, y: 0.382, type: 'x', }, { x: 5, y: 0.594, type: 'o', }, { x: 6, y: 0.516, type: 'o', }, { x: 7, y: 0.634, type: 'x', }, { x: 8, y: 0.612, type: 'x', }, { x: 9, y: 0.271, type: 'o', }, { x: 10, y: 0.241, type: 'o', }, { x: 11, y: 0.955, type: 'o', }, { x: 12, y: 0.336, type: 'x', }, { x: 13, y: 0.307, type: 'x', }, { x: 14, y: 0.747, type: 'x', }, ]; const x = 'path_to_url const o = 'path_to_url const chart = new Chart({ container: 'container', autoFit: true, }); chart .image() .data(dataXO) .encode('x', 'x') .encode('y', 'y') .encode('size', 'y') .encode('src', ({ type }) => (type === 'x' ? x : o)) .scale('x', { type: 'band' }) .scale('y', { domain: [0, 1] }) .scale('size', { type: 'linear', range: [12, 32] }) .legend('size', false); chart.render(); ```
/content/code_sandbox/site/examples/general/image/demo/icon.ts
xml
2016-05-26T09:21:04
2024-08-15T16:11:17
G2
antvis/G2
12,060
538
```xml import * as LiveServer from '@compodoc/live-server'; import { InternalConfiguration } from '../../core/entities/internal-configuration'; interface LiveServerConfiguration { root?: string; open?: boolean; quiet: boolean; logLevel: number; wait: number; host?: string; port?: number; } export class ServeService { private static instance: ServeService; public liveServerConfiguration: LiveServerConfiguration; constructor() { this.liveServerConfiguration = { quiet: true, logLevel: 0, wait: 1000 }; } public static getInstance() { if (!ServeService.instance) { ServeService.instance = new ServeService(); } return ServeService.instance; } public serve(configuration: InternalConfiguration) { if (configuration.host !== '') { this.liveServerConfiguration.host = configuration.host; } this.liveServerConfiguration.root = configuration.output; this.liveServerConfiguration.open = false; this.liveServerConfiguration.port = configuration.port; return LiveServer.start(this.liveServerConfiguration); } } export default ServeService.getInstance(); ```
/content/code_sandbox/src-refactored/infrastructure/serving/serve.ts
xml
2016-10-17T07:09:28
2024-08-14T16:30:10
compodoc
compodoc/compodoc
3,980
236
```xml <manifest xmlns:android="path_to_url" package="com.tamsiree.camera"> <uses-permission android:name="android.permission.CAMERA"/> </manifest> ```
/content/code_sandbox/RxCamera/src/main/AndroidManifest.xml
xml
2016-09-24T09:30:45
2024-08-16T09:54:41
RxTool
Tamsiree/RxTool
12,242
37
```xml export { PageHeader } from './PageHeader'; ```
/content/code_sandbox/app/react/components/PageHeader/index.ts
xml
2016-05-19T20:15:28
2024-08-16T19:15:14
portainer
portainer/portainer
30,083
11
```xml import { AppPage } from './app.po'; import { browser, logging } from 'protractor'; describe('workspace-project App', () => { let page: AppPage; beforeEach(() => { page = new AppPage(); }); it('should display welcome message', () => { page.navigateTo(); expect(page.getTitleText()).toEqual('novidades-v9 app is running!'); }); afterEach(async () => { // Assert that there are no errors emitted from the browser const logs = await browser.manage().logs().get(logging.Type.BROWSER); expect(logs).not.toContain(jasmine.objectContaining({ level: logging.Level.SEVERE, } as logging.Entry)); }); }); ```
/content/code_sandbox/novidades-v9/e2e/src/app.e2e-spec.ts
xml
2016-07-02T18:58:48
2024-08-15T23:36:46
curso-angular
loiane/curso-angular
1,910
149
```xml /* eslint-disable @typescript-eslint/no-explicit-any */ // required `any` for Distributive Conditional // path_to_url#distributive-conditional-types /** * Transform a union to a tuple * from 'a' | 'b' | ['c', 'd'] to `['a', 'b', ['c', 'd']]` */ export type ToTuple<Union> = ToTupleRec<Union, []>; // Recursively build a tuple from a union type ToTupleRec<Union, Result extends any[]> = SpliceOne<Union> extends never ? [ExtractOne<Union>, ...Result] : ToTupleRec<SpliceOne<Union>, [ExtractOne<Union>, ...Result]>; // Remove the first element of union type SpliceOne<Union> = Exclude<Union, ExtractOne<Union>>; // Extract the first element of union type ExtractOne<Union> = ExtractParam<UnionToIntersection<UnionToParam<Union>>>; /** * Extract param of function * * Here, used with an intersection of functions generated by UnionToIntersection to pick the first type of intersection * * @example * type EP = ExtractParam<((k: 'a') => void) & ((k: 'b') => void)> // 'a' */ type ExtractParam<F> = F extends { (a: infer A): void } ? A : never; /** * When called with a union of functions, allows to generate an intersection of the functions params types * * --- * * In our usage * ``` * type Inter = UnionToIntersection<UnionToParam<'a' | 'b'>>; * // equals * type Inter = UnionToIntersection<((k: 'a') => void) | ((k: 'b') => void)>; * // which expands to * type Inter = * | ((k: (k: 'a') => void) => void) * | ((k: (k: 'b') => void) => void) extends (k: infer I) => void * ? I * : never; * // using the contra-variant positions, an intersection is inferred. The result is then * type Inter = ((k: 'a') => void) & ((k: 'b') => void); * // (infer I) of 1st Union elem & (infer I) of 2nd Union element * ``` * * --- * * For more details see path_to_url#type-inference-in-conditional-types * * ``` * // The following example demonstrates how multiple candidates for the same type variable in co-variant positions causes a union type to be inferred: * type Foo<T> = T extends { a: infer U; b: infer U } ? U : never; * type T10 = Foo<{ a: string; b: string }>; // string * type T11 = Foo<{ a: string; b: number }>; // string | number * * // Likewise, multiple candidates for the same type variable in contra-variant positions causes an intersection type to be inferred: * type Bar<T> = T extends { a: (x: infer U) => void; b: (x: infer U) => void } ? U : never; * type T20 = Bar<{ a: (x: string) => void; b: (x: string) => void }>; // string * type T21 = Bar<{ a: (x: string) => void; b: (x: number) => void }>; // string & number * ``` * */ type UnionToIntersection<U> = UnionToParam<U> extends (k: infer I) => void ? I : never; /** * Transform T to `(k: T) => void` (excluding never) * * When called with a union of functions, generates a union of functions taking a function as param * * @example * type U = UnionToParam<'a' | 'b'>; * // = ((k: "a") => void) | ((k: "b") => void) * * @example * type U2 = UnionToParam<UnionToParam<'a' | 'b'>>; * // = ((k: (k: "a") => void) => void) | ((k: (k: "b") => void) => void) */ type UnionToParam<U> = U extends any ? (k: U) => void : never; /* eslint-enable @typescript-eslint/no-explicit-any */ ```
/content/code_sandbox/app/types/toTuple.ts
xml
2016-05-19T20:15:28
2024-08-16T19:15:14
portainer
portainer/portainer
30,083
962
```xml import { scanForKits } from '@cmt/kit'; import { fs } from '@cmt/pr'; import { expect } from '@test/util'; suite('MinGW Tests', () => { // TODO: this test needs some work const mingw_dirs: string[] = ['C:\\Qt\\Tools\\mingw492_32', 'C:\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev1\\mingw64']; setup(async function (this: Mocha.Context) { this.timeout(100000); }); test('Test scan of mingw', async () => { const kits = await scanForKits(undefined, { scanDirs: mingw_dirs, ignorePath: true }); const is_kit_MinGW_present = kits.find(kit => kit.name.indexOf('GCC for i686-w64-mingw32 4.9.2') >= 0) ? true : false; const is_kit_MinGW_w64_present = kits.find(kit => kit.name.indexOf('GCC for x86_64-w64-mingw32 7.2.0') >= 0) ? true : false; console.log(JSON.stringify(kits, null, 2)); if (await fs.exists(mingw_dirs[0])) { expect(is_kit_MinGW_present).to.equal(true); } if (await fs.exists(mingw_dirs[1])) { expect(is_kit_MinGW_w64_present).to.equal(true); } }).timeout(100000); }); ```
/content/code_sandbox/test/extension-tests/successful-build/test/scan_kits.test.ts
xml
2016-04-16T21:00:29
2024-08-16T16:41:57
vscode-cmake-tools
microsoft/vscode-cmake-tools
1,450
344
```xml /* * * See the LICENSE file at the top-level directory of this distribution * for licensing information. * * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation, * no part of this software, including this file, may be copied, modified, * propagated, or distributed except according to the terms contained in the * LICENSE file. * * Removal or modification of this copyright notice is prohibited. * */ import { Node } from './node'; export class MinHeap<T, K = bigint | number> { protected _nodes: Array<Node<T, K>>; public constructor(heap?: MinHeap<T, K>) { this._nodes = []; if (heap) { this._insertAll(heap); } } public push(key: K, value: T): void { const node = new Node<T, K>(key, value); this._nodes.push(node); this._moveUp(this._nodes.length - 1); } public pop(): { key: K; value: T } | undefined { if (this.count <= 0) { return undefined; } if (this.count === 1) { const node = this._nodes[0]; this.clear(); return node; } const rootNode = this._nodes[0]; this._nodes[0] = this._nodes.pop() as Node<T, K>; this._moveDown(0); return rootNode; } public peek(): { key: K; value: T } | undefined { if (this._nodes.length <= 0) { return undefined; } return this._nodes[0]; } public clone(): MinHeap<T, K> { return new MinHeap(this); } public clear(): void { this._nodes = []; } public get count(): number { return this._nodes.length; } public get keys(): ReadonlyArray<K> { return this._nodes.map(n => n.key); } public get values(): ReadonlyArray<T> { return this._nodes.map(n => n.value); } protected _moveUp(originalIndex: number): void { let index = originalIndex; const node = this._nodes[index]; while (index > 0) { const parentIndex = this._parentIndex(index); if (this._nodes[parentIndex].key > node.key) { this._nodes[index] = this._nodes[parentIndex]; index = parentIndex; continue; } break; } this._nodes[index] = node; } protected _moveDown(originalIndex: number): void { let index = originalIndex; const node = this._nodes[index]; // eslint-disable-next-line no-bitwise const halfCount = this.count >> 1; while (index < halfCount) { const leftChild = this._leftChildIndex(index); const rightChild = this._rightChildIndex(index); // Choose smaller path const nextPath = rightChild < this.count && this._nodes[rightChild].key < this._nodes[leftChild].key ? rightChild : leftChild; if (this._nodes[nextPath].key > node.key) { break; } this._nodes[index] = this._nodes[nextPath]; index = nextPath; } this._nodes[index] = node; } protected _parentIndex(index: number): number { // eslint-disable-next-line no-bitwise return (index - 1) >> 1; } protected _leftChildIndex(index: number): number { return index * 2 + 1; } protected _rightChildIndex(index: number): number { return index * 2 + 2; } private _insertAll(heap: MinHeap<T, K>): void { if (!(heap instanceof MinHeap)) { throw new Error('Only heap instance can be inserted'); } this._insertAllFromHeap(heap); } private _insertAllFromHeap(heap: MinHeap<T, K>): void { const { keys, values } = heap; if (this.count <= 0) { // Assume that the order of input heap is correct for (let i = 0; i < heap.count; i += 1) { this._nodes.push(new Node(keys[i], values[i])); } return; } for (let i = 0; i < heap.count; i += 1) { this.push(keys[i], values[i]); } } } ```
/content/code_sandbox/elements/lisk-utils/src/data_structures/min_heap.ts
xml
2016-02-01T21:45:35
2024-08-15T19:16:48
lisk-sdk
LiskArchive/lisk-sdk
2,721
982
```xml import StockData from '../StockData'; import HangingMan from './HangingMan'; export default class HangingManUnconfirmed extends HangingMan { constructor() { super(); this.name = 'HangingManUnconfirmed'; } logic (data:StockData) { let isPattern = this.upwardTrend(data, false); isPattern = isPattern && this.includesHammer(data, false); return isPattern; } } export function hangingmanunconfirmed(data:StockData) { return new HangingManUnconfirmed().hasPattern(data); } ```
/content/code_sandbox/src/candlestick/HangingManUnconfirmed.ts
xml
2016-05-02T19:16:32
2024-08-15T14:25:09
technicalindicators
anandanand84/technicalindicators
2,137
120
```xml import { AuthError } from './Errors'; import { TokenResponse } from './TokenRequest'; // @needsAudit /** * Object returned after an auth request has completed. * - If the user cancelled the authentication session by closing the browser, the result is `{ type: 'cancel' }`. * - If the authentication is dismissed manually with `AuthSession.dismiss()`, the result is `{ type: 'dismiss' }`. * - If the authentication flow is successful, the result is `{ type: 'success', params: Object, event: Object }`. * - If the authentication flow is returns an error, the result is `{ type: 'error', params: Object, error: string, event: Object }`. */ export type AuthSessionResult = | { /** * How the auth completed. */ type: 'cancel' | 'dismiss' | 'opened' | 'locked'; } | { /** * How the auth completed. */ type: 'error' | 'success'; /** * @deprecated Legacy error code query param, use `error` instead. */ errorCode: string | null; /** * Possible error if the auth failed with type `error`. */ error?: AuthError | null; /** * Query params from the `url` as an object. */ params: Record<string, string>; /** * Returned when the auth finishes with an `access_token` property. */ authentication: TokenResponse | null; /** * Auth URL that was opened */ url: string; }; // @needsAudit /** * Options passed to `makeRedirectUri`. */ export type AuthSessionRedirectUriOptions = { /** * Optional path to append to a URI. This will not be added to `native`. */ path?: string; /** * URI protocol `<scheme>://` that must be built into your native app. */ scheme?: string; /** * Optional native scheme * URI protocol `<scheme>://` that must be built into your native app. */ queryParams?: Record<string, string | undefined>; /** * Should the URI be triple slashed `scheme:///path` or double slashed `scheme://path`. * Defaults to `false`. */ isTripleSlashed?: boolean; /** * Attempt to convert the Expo server IP address to localhost. * This is useful for testing when your IP changes often, this will only work for iOS simulator. * * @default false */ preferLocalhost?: boolean; /** * Manual scheme to use in Bare and Standalone native app contexts. Takes precedence over all other properties. * You must define the URI scheme that will be used in a custom built native application or standalone Expo application. * The value should conform to your native app's URI schemes. * You can see conformance with `npx uri-scheme list`. */ native?: string; }; ```
/content/code_sandbox/packages/expo-auth-session/src/AuthSession.types.ts
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
631
```xml <dict> <key>LayoutID</key> <integer>138</integer> <key>PathMapRef</key> <array> <dict> <key>CodecID</key> <array> <integer>283902569</integer> </array> <key>Headphone</key> <dict> <key>AmpPostDelay</key> <integer>50</integer> <key>AmpPreDelay</key> <integer>100</integer> <key>DefaultVolume</key> <integer>4292870144</integer> <key>Headset_dBV</key> <integer>-1055916032</integer> </dict> <key>Inputs</key> <array> <string>Mic</string> <string>LineIn</string> </array> <key>IntSpeaker</key> <dict> <key>DefaultVolume</key> <integer>4293722112</integer> <key>MaximumBootBeepValue</key> <integer>48</integer> <key>MuteGPIO</key> <integer>0</integer> <key>SignalProcessing</key> <dict> <key>SoftwareDSP</key> <dict> <key>DspFunction0</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>0</integer> <key>DspFuncName</key> <string>DspEqualization</string> <key>DspFuncProcessingIndex</key> <integer>0</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>Filter</key> <array> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1121130925</integer> <key>7</key> <integer>1062181913</integer> <key>8</key> <integer>-1051960877</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1121437227</integer> <key>7</key> <integer>1062181913</integer> <key>8</key> <integer>-1052549551</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>1</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1147243075</integer> <key>7</key> <integer>1069052072</integer> <key>8</key> <integer>-1059648963</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>1</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1147243075</integer> <key>7</key> <integer>1069052072</integer> <key>8</key> <integer>-1059648963</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>2</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1153510794</integer> <key>7</key> <integer>1079650306</integer> <key>8</key> <integer>0</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>2</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1153270572</integer> <key>7</key> <integer>1074610652</integer> <key>8</key> <integer>-1062064882</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>3</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1163795438</integer> <key>7</key> <integer>1076603811</integer> <key>8</key> <integer>0</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>3</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1163927873</integer> <key>7</key> <integer>1076557096</integer> <key>8</key> <integer>-1067488498</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>4</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>5</integer> <key>6</key> <integer>1165447446</integer> <key>7</key> <integer>1093664768</integer> <key>8</key> <integer>-1094411354</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>4</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>5</integer> <key>6</key> <integer>1137180672</integer> <key>7</key> <integer>1093664768</integer> <key>8</key> <integer>-1095204569</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>5</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1120722521</integer> <key>7</key> <integer>1060714809</integer> <key>8</key> <integer>-1064028699</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>5</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1120926723</integer> <key>7</key> <integer>1060714809</integer> <key>8</key> <integer>-1079922904</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>6</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1125212588</integer> <key>7</key> <integer>1062958591</integer> <key>8</key> <integer>-1070587707</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>6</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1125238907</integer> <key>7</key> <integer>1062998322</integer> <key>8</key> <integer>-1071124578</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>7</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1122038312</integer> <key>7</key> <integer>1074440875</integer> <key>8</key> <integer>-1061498991</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>7</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1121924912</integer> <key>7</key> <integer>1074271873</integer> <key>8</key> <integer>-1061498991</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>8</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1128612513</integer> <key>7</key> <integer>1079014663</integer> <key>8</key> <integer>-1059382945</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>8</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1126665806</integer> <key>7</key> <integer>1087746943</integer> <key>8</key> <integer>-1063010452</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>9</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>6</integer> <key>6</key> <integer>1157720978</integer> <key>7</key> <integer>1103101952</integer> <key>8</key> <integer>-1076613600</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>9</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>6</integer> <key>6</key> <integer>1157720978</integer> <key>7</key> <integer>1103393070</integer> <key>8</key> <integer>-1076613600</integer> </dict> </array> </dict> <key>PatchbayInfo</key> <dict/> </dict> <key>DspFunction1</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>1</integer> <key>DspFuncName</key> <string>DspVirtualization</string> <key>DspFuncProcessingIndex</key> <integer>1</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>10</key> <integer>0</integer> <key>11</key> <integer>1</integer> <key>12</key> <integer>-1060850508</integer> <key>13</key> <integer>-1038329254</integer> <key>14</key> <integer>10</integer> <key>15</key> <integer>210</integer> <key>16</key> <integer>-1049408692</integer> <key>17</key> <integer>5</integer> <key>18</key> <integer>182</integer> <key>19</key> <integer>418</integer> <key>2</key> <integer>-1082130432</integer> <key>20</key> <integer>-1038976903</integer> <key>21</key> <integer>3</integer> <key>22</key> <integer>1633</integer> <key>23</key> <integer>4033</integer> <key>24</key> <integer>-1046401747</integer> <key>25</key> <integer>4003</integer> <key>26</key> <integer>9246</integer> <key>27</key> <integer>168</integer> <key>28</key> <integer>1060875180</integer> <key>29</key> <integer>0</integer> <key>3</key> <integer>-1085584568</integer> <key>30</key> <integer>-1048128813</integer> <key>31</key> <integer>982552730</integer> <key>32</key> <integer>16</integer> <key>33</key> <integer>-1063441106</integer> <key>34</key> <integer>1008902816</integer> <key>35</key> <integer>4</integer> <key>36</key> <integer>-1059986974</integer> <key>37</key> <integer>0</integer> <key>38</key> <integer>234</integer> <key>39</key> <integer>1</integer> <key>4</key> <integer>-1094466626</integer> <key>40</key> <integer>-1047912930</integer> <key>41</key> <integer>1022423360</integer> <key>42</key> <integer>0</integer> <key>43</key> <data>your_sha512_hash/PoLzKPoE9VliZvVAiGD1DUa692FG0PaD8kb1s7dW8Cvd1P4AH1rx9+your_sha256_hasheu8wK0EvN4bnzwcZ4o8XuerPN1Lhzk6gfk7OnQgvG5lGrzURc+8ogiRvJL8ELwRvBg8qQGUPM4QWzzNMaQ7QlzSu3iKYbsKSbK7kk/tuhTxlruJRKu6DVSwORAuiLrWfoA6Hp+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAAAAAAAAAAAAAAAAAAAAAACasrC7Y0/Tu/+3lLv0l7I5r0STO4dM6DtPRRM8zbj/O+Y2ijtWlU67mDwmvK2+GLyKIpu7Sp34um8TZDkTvp+7UZuaOWcGRTrf22i7D3MfPOY9aTyK8oA94CaQPc3Y2z0d9Ik+N3BQPv60hz28u6M975E8PZYjDT2eVgk9Xp1GPfiKqz3S4U49E7QoPZLzJj3+XNg8D5bCPMiRlTyuLAM9dBEcPTXIDT0m1xE9o7/NPE+Cazye/qw7Xhdjuyen1LtqMOG7/Eo9uxlBXDt1St07kpvdO/gnTjt2Fp+your_sha256_hash7lxMiOe/WVDsBH407KMBOO9ILWDn1ciO7L+CmuyDt3bue4My7DhNpu0im9jqJ+8E7SMSkOz/fcTuD/q46618ZO3WrlDvWWeQ6c5P0O7L/zjvkHyw8jTzBO4rc27wJi9C8CA22vV/your_sha256_hashn3rzvEbC8mcWGvHkexLz8tKu86dpLvOicNbzF2eK7zCAvu2TPYTpu+pw7oyjHO5aduDv60iA7afr8uq46j7sjqZK7q6Aeuxms8bjz6Ks6MH/your_sha256_hashyour_sha256_hashuvdhRtD2g/JG9bO3VvAr3dT+AB9a8ffmRvYRgtD2DIq69OpUYPa0bmb0oX4E9Cs+your_sha256_hash5Ozp0ILxuZRq81EXPvKIIkbyS/your_sha256_hashoi61n6AOh6fmTg=</data> <key>5</key> <integer>-1056748724</integer> <key>6</key> <integer>0</integer> <key>7</key> <integer>0</integer> <key>8</key> <integer>0</integer> <key>9</key> <integer>0</integer> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> <key>DspFunction2</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>1</integer> <key>DspFuncName</key> <string>DspMultibandDRC</string> <key>DspFuncProcessingIndex</key> <integer>1</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>Crossover</key> <dict> <key>4</key> <integer>2</integer> <key>5</key> <integer>0</integer> <key>6</key> <integer>1143079818</integer> </dict> <key>Limiter</key> <array> <dict> <key>10</key> <integer>-1058198226</integer> <key>11</key> <integer>1094651663</integer> <key>12</key> <integer>-1047897509</integer> <key>13</key> <integer>1067573730</integer> <key>14</key> <integer>-1027604480</integer> <key>15</key> <integer>1065353216</integer> <key>16</key> <integer>1065353216</integer> <key>17</key> <integer>1073741824</integer> <key>18</key> <integer>1103811283</integer> <key>19</key> <integer>1086830520</integer> <key>2</key> <integer>1</integer> <key>20</key> <integer>1137180672</integer> <key>21</key> <integer>0</integer> <key>22</key> <integer>0</integer> <key>23</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>7</key> <integer>0</integer> <key>8</key> <integer>0</integer> <key>9</key> <integer>-1096637784</integer> </dict> <dict> <key>10</key> <integer>-1060418742</integer> <key>11</key> <integer>1086941546</integer> <key>12</key> <integer>-1047786484</integer> <key>13</key> <integer>1067919143</integer> <key>14</key> <integer>-1027604480</integer> <key>15</key> <integer>1065353216</integer> <key>16</key> <integer>1065353216</integer> <key>17</key> <integer>1073741824</integer> <key>18</key> <integer>1111814385</integer> <key>19</key> <integer>1101004800</integer> <key>2</key> <integer>2</integer> <key>20</key> <integer>1137180672</integer> <key>21</key> <integer>0</integer> <key>22</key> <integer>0</integer> <key>23</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>7</key> <integer>0</integer> <key>8</key> <integer>0</integer> <key>9</key> <integer>-1099105016</integer> </dict> </array> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> </dict> </dict> </dict> <key>LineIn</key> <dict> <key>MuteGPIO</key> <integer>1342242840</integer> <key>SignalProcessing</key> <dict> <key>SoftwareDSP</key> <dict> <key>DspFunction0</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>0</integer> <key>DspFuncName</key> <string>DspNoiseReduction</string> <key>DspFuncProcessingIndex</key> <integer>0</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>-1073029587</integer> <key>5</key> <data>your_sha256_hashHMuYwrl9lcJXm4/CBhmQwuJvlMKbxJTC7qyUwtjDl8KU+ZzCnCaewsmuncK/your_sha512_hash+your_sha256_hashyour_sha256_hashfwhFzosLIZaPCwUOjwo6TosIkR6LC6vehwtrwosIdtJ/CXLmbwlSZmcKDhJXCDFGRwnV6j8JTjY/CrqGQwgqYk8INzpjCuTufwrjlocKviKPC5YqlwgdmpcKZ2aXCGiumwq95osJOIJ/Cxl+ewtWGl8KmPJPC+sSawkdHo8JWB6LCskyhwqk7pcIth6nCh4Wswk+crcK9J6zCYJWqwmVJq8K8063Cyour_sha512_hash+M0MKaftbCpcjdwm+p5sL/CfHCHcT8wrp3A8PiJAzD</data> </dict> <key>PatchbayInfo</key> <dict/> </dict> <key>DspFunction1</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>1</integer> <key>DspFuncName</key> <string>DspGainStage</string> <key>DspFuncProcessingIndex</key> <integer>1</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>1078616770</integer> <key>3</key> <integer>1078616770</integer> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> <key>DspFunction2</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>2</integer> <key>DspFuncName</key> <string>DspEqualization</string> <key>DspFuncProcessingIndex</key> <integer>2</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>Filter</key> <array> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1132560510</integer> <key>7</key> <integer>1064190664</integer> <key>8</key> <integer>-1057196819</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>8</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1150544383</integer> <key>7</key> <integer>1068848526</integer> <key>8</key> <integer>-1073422534</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>15</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>0</integer> <key>6</key> <integer>1182094222</integer> <key>7</key> <integer>1063679547</integer> <key>8</key> <integer>-1048213171</integer> </dict> </array> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> <key>DspFunction3</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>3</integer> <key>DspFuncName</key> <string>DspMultibandDRC</string> <key>DspFuncProcessingIndex</key> <integer>3</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>Crossover</key> <dict> <key>4</key> <integer>1</integer> <key>5</key> <integer>0</integer> <key>6</key> <integer>1128792064</integer> </dict> <key>Limiter</key> <array> <dict> <key>10</key> <integer>-1068807345</integer> <key>11</key> <integer>1097982434</integer> <key>12</key> <integer>-1038380141</integer> <key>13</key> <integer>1068906038</integer> <key>14</key> <integer>-1036233644</integer> <key>15</key> <integer>1065353216</integer> <key>16</key> <integer>1101004800</integer> <key>17</key> <integer>1101004800</integer> <key>18</key> <integer>1128792064</integer> <key>19</key> <integer>1101004800</integer> <key>2</key> <integer>1</integer> <key>20</key> <integer>1127866850</integer> <key>21</key> <integer>0</integer> <key>22</key> <integer>0</integer> <key>23</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>7</key> <integer>0</integer> <key>8</key> <integer>0</integer> <key>9</key> <integer>0</integer> </dict> </array> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>2</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>2</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> </dict> </dict> </dict> <key>Mic</key> <dict> <key>MuteGPIO</key> <integer>1342242841</integer> <key>SignalProcessing</key> <dict> <key>SoftwareDSP</key> <dict> <key>DspFunction0</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>0</integer> <key>DspFuncName</key> <string>DspNoiseReduction</string> <key>DspFuncProcessingIndex</key> <integer>0</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>-1073029587</integer> <key>5</key> <data>your_sha256_hashHMuYwrl9lcJXm4/CBhmQwuJvlMKbxJTC7qyUwtjDl8KU+ZzCnCaewsmuncK/your_sha512_hash+your_sha256_hashyour_sha256_hashfwhFzosLIZaPCwUOjwo6TosIkR6LC6vehwtrwosIdtJ/CXLmbwlSZmcKDhJXCDFGRwnV6j8JTjY/CrqGQwgqYk8INzpjCuTufwrjlocKviKPC5YqlwgdmpcKZ2aXCGiumwq95osJOIJ/Cxl+ewtWGl8KmPJPC+sSawkdHo8JWB6LCskyhwqk7pcIth6nCh4Wswk+crcK9J6zCYJWqwmVJq8K8063Cyour_sha512_hash+M0MKaftbCpcjdwm+p5sL/CfHCHcT8wrp3A8PiJAzD</data> </dict> <key>PatchbayInfo</key> <dict/> </dict> <key>DspFunction1</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>1</integer> <key>DspFuncName</key> <string>DspGainStage</string> <key>DspFuncProcessingIndex</key> <integer>1</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>1078616770</integer> <key>3</key> <integer>1078616770</integer> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> <key>DspFunction2</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>2</integer> <key>DspFuncName</key> <string>DspEqualization</string> <key>DspFuncProcessingIndex</key> <integer>2</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>Filter</key> <array> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1132560510</integer> <key>7</key> <integer>1064190664</integer> <key>8</key> <integer>-1057196819</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>8</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1150544383</integer> <key>7</key> <integer>1068848526</integer> <key>8</key> <integer>-1073422534</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>15</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>0</integer> <key>6</key> <integer>1182094222</integer> <key>7</key> <integer>1063679547</integer> <key>8</key> <integer>-1048213171</integer> </dict> </array> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> <key>DspFunction3</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>3</integer> <key>DspFuncName</key> <string>DspMultibandDRC</string> <key>DspFuncProcessingIndex</key> <integer>3</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>Crossover</key> <dict> <key>4</key> <integer>1</integer> <key>5</key> <integer>0</integer> <key>6</key> <integer>1128792064</integer> </dict> <key>Limiter</key> <array> <dict> <key>10</key> <integer>-1068807345</integer> <key>11</key> <integer>1097982434</integer> <key>12</key> <integer>-1038380141</integer> <key>13</key> <integer>1068906038</integer> <key>14</key> <integer>-1036233644</integer> <key>15</key> <integer>1065353216</integer> <key>16</key> <integer>1101004800</integer> <key>17</key> <integer>1101004800</integer> <key>18</key> <integer>1128792064</integer> <key>19</key> <integer>1101004800</integer> <key>2</key> <integer>1</integer> <key>20</key> <integer>1127866850</integer> <key>21</key> <integer>0</integer> <key>22</key> <integer>0</integer> <key>23</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>7</key> <integer>0</integer> <key>8</key> <integer>0</integer> <key>9</key> <integer>0</integer> </dict> </array> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>2</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>2</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> </dict> </dict> </dict> <key>Outputs</key> <array> <string>IntSpeaker</string> <string>Headphone</string> </array> <key>PathMapID</key> <integer>138</integer> </dict> </array> </dict> ```
/content/code_sandbox/Resources/ALC269/layout138.xml
xml
2016-03-07T20:45:58
2024-08-14T08:57:03
AppleALC
acidanthera/AppleALC
3,420
11,770
```xml import { Localized } from "@fluent/react/compat"; import { useRouter } from "found"; import React, { FunctionComponent, useCallback } from "react"; import ConfigBox from "coral-admin/routes/Configure/ConfigBox"; import Header from "coral-admin/routes/Configure/Header"; import { urls } from "coral-framework/helpers"; import { HorizontalGutter } from "coral-ui/components/v2"; import { ConfigureExternalModerationPhaseForm } from "../ConfigureExternalModerationPhaseForm"; import ExperimentalExternalModerationPhaseCallOut from "../ExperimentalExternalModerationPhaseCallOut"; const AddExternalModerationPhaseContainer: FunctionComponent = () => { const { router } = useRouter(); const onCancel = useCallback(() => { router.push(urls.admin.moderationPhases); }, [router]); return ( <HorizontalGutter size="double"> <ExperimentalExternalModerationPhaseCallOut /> <ConfigBox title={ <Localized id="configure-moderationPhases-addExternalModerationPhase"> <Header>Add external moderation phase</Header> </Localized> } > <ConfigureExternalModerationPhaseForm phase={null} onCancel={onCancel} /> </ConfigBox> </HorizontalGutter> ); }; export default AddExternalModerationPhaseContainer; ```
/content/code_sandbox/client/src/core/client/admin/routes/Configure/sections/ModerationPhases/AddExternalModerationPhase/AddExternalModerationPhaseContainer.tsx
xml
2016-10-31T16:14:05
2024-08-06T16:15:57
talk
coralproject/talk
1,881
280
```xml /* * Squidex Headless CMS * * @license */ import { APP_BASE_HREF } from '@angular/common'; import { provideHttpClient, withInterceptors } from '@angular/common/http'; import { enableProdMode, ErrorHandler } from '@angular/core'; import { bootstrapApplication } from '@angular/platform-browser'; import { provideAnimations } from '@angular/platform-browser/animations'; import { ActivatedRouteSnapshot, BaseRouteReuseStrategy, provideRouter, RouteReuseStrategy } from '@angular/router'; import { TourService as BaseTourService } from 'ngx-ui-tour-core'; import { APP_ROUTES } from '@app/app.routes'; import { ApiUrlConfig, authInterceptor, buildTasks, cachingInterceptor, DateHelper, GlobalErrorHandler, loadingInterceptor, LocalizerService, TASK_CONFIGURATION, TitlesConfig, TourService, UIOptions } from '@app/shared'; import { AppComponent } from './app/app.component'; import { environment } from './environments/environment'; import { provideCharts, withDefaultRegisterables } from 'ng2-charts'; const options = (window as any)['options'] || {}; DateHelper.setlocale(options.more?.culture); function basePath() { const baseElements = document.getElementsByTagName('base'); let baseHref: string = null!; if (baseElements.length > 0) { baseHref = baseElements[0].href; } if (baseHref.indexOf('http') === 0) { baseHref = new URL(baseHref).pathname; } if (!baseHref) { baseHref = ''; } let path = options.embedPath || '/'; while (baseHref.endsWith('/')) { baseHref = baseHref.substring(0, baseHref.length - 1); } return `${baseHref}${path}`; } function configApiUrl() { const baseElements = document.getElementsByTagName('base'); let baseHref: string = null!; if (baseElements.length > 0) { baseHref = baseElements[0].href; } if (!baseHref) { baseHref = '/'; } if (baseHref.indexOf('http') === 0) { return new ApiUrlConfig(baseHref); } else { return new ApiUrlConfig(`${window.location.protocol}//${window.location.host}${baseHref}`); } } function configUIOptions() { return new UIOptions(options); } function configTitles() { return new TitlesConfig(undefined, 'i18n:common.product'); } function configLocalizerService() { return new LocalizerService(environment.textResolver()).logMissingKeys(environment.textLogger); } export class AppRouteReuseStrategy extends BaseRouteReuseStrategy { public shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot) { return (future.routeConfig === curr.routeConfig) || (future.data['reuseId'] && future.data['reuseId'] === curr.data['reuseId']); } } if (environment.production) { enableProdMode(); } bootstrapApplication(AppComponent, { providers: [ provideAnimations(), provideCharts(withDefaultRegisterables()), provideHttpClient( withInterceptors([ loadingInterceptor, cachingInterceptor, authInterceptor, ]), ), provideRouter(APP_ROUTES), { provide: RouteReuseStrategy, useClass: AppRouteReuseStrategy, }, { provide: ApiUrlConfig, useFactory: configApiUrl, }, { provide: LocalizerService, useFactory: configLocalizerService, }, { provide: TitlesConfig, useFactory: configTitles, }, { provide: UIOptions, useFactory: configUIOptions, }, { provide: APP_BASE_HREF, useValue: basePath(), }, { provide: BaseTourService, useClass: TourService, }, { provide: ErrorHandler, useClass: GlobalErrorHandler, multi: false, }, { provide: TASK_CONFIGURATION, useFactory: buildTasks, multi: false, }, ], }); ```
/content/code_sandbox/frontend/src/main.ts
xml
2016-08-29T05:53:40
2024-08-16T17:39:38
squidex
Squidex/squidex
2,222
845
```xml <?xml version="1.0" encoding="UTF-8"?> <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> <component name="FacetManager"> <facet type="Spring" name="Spring"> <configuration> <fileset id="fileset" name="Spring" removed="false"> <file>file://$MODULE_DIR$/src/main/resources/spring.xml</file> </fileset> </configuration> </facet> <facet type="web" name="Web"> <configuration> <descriptors> <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" /> </descriptors> <webroots> <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" /> </webroots> <sourceRoots> <root url="file://$MODULE_DIR$/src/main/java" /> <root url="file://$MODULE_DIR$/src/main/resources" /> </sourceRoots> </configuration> </facet> </component> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6"> <output url="file://$MODULE_DIR$/target/classes" /> <output-test url="file://$MODULE_DIR$/target/test-classes" /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <excludeFolder url="file://$MODULE_DIR$/target" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="library" name="Maven: org.springframework:spring-core:4.2.3.RELEASE" level="project" /> <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" /> <orderEntry type="library" name="Maven: org.springframework:spring-context:4.2.3.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.2.3.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.2.3.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.2.3.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.2.3.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework:spring-tx:4.2.3.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.2.3.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.springframework:spring-web:4.2.3.RELEASE" level="project" /> <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.3.0" level="project" /> <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.2.2" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:5.1.36" level="project" /> <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.9.13" level="project" /> <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.9.13" level="project" /> <orderEntry type="library" name="Maven: javax.servlet:servlet-api:3.0-alpha-1" level="project" /> <orderEntry type="library" name="Maven: javax.servlet:jstl:1.2" level="project" /> <orderEntry type="library" name="Maven: javax.servlet.jsp:jsp-api:2.2.1-b03" level="project" /> <orderEntry type="library" name="Maven: com.alibaba:druid:1.1.0" level="project" /> <orderEntry type="module-library"> <library name="Maven: com.alibaba:jconsole:1.8.0"> <CLASSES> <root url="jar://C:/Program Files/Java/jdk1.8.0_31/lib/jconsole.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> <orderEntry type="module-library"> <library name="Maven: com.alibaba:tools:1.8.0"> <CLASSES> <root url="jar://C:/Program Files/Java/jdk1.8.0_31/lib/tools.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.2.3.RELEASE" level="project" /> <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" /> <orderEntry type="library" name="Maven: org.aspectj:aspectjrt:1.7.1" level="project" /> <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.7.1" level="project" /> <orderEntry type="library" name="Maven: log4j:log4j:1.2.12" level="project" /> <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.5" level="project" /> <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.5" level="project" /> <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.5" level="project" /> <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.2" level="project" /> <orderEntry type="library" name="Maven: commons-io:commons-io:2.2" level="project" /> <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.16.20" level="project" /> </component> </module> ```
/content/code_sandbox/druid_spring_config/druid_spring_config.iml
xml
2016-04-25T16:39:57
2024-08-16T08:33:16
Java
chenhaoxiang/Java
1,250
1,574
```xml import { ClientEngine } from '../ClientEngine.js'; import { GameWorld } from '../GameWorld.js'; import NetworkTransmitter from '../network/NetworkTransmitter.js'; import { Sync, SyncStrategy, SyncStrategyOptions } from './SyncStrategy.js'; const defaults = { clientStepHold: 6, localObjBending: 1.0, // amount of bending towards position of sync object remoteObjBending: 1.0, // amount of bending towards position of sync object bendingIncrements: 6, // the bending should be applied increments (how many steps for entire bend) reflect: false }; interface InterpolateSyncStrategyOptions extends SyncStrategyOptions { localObjBending: number; remoteObjBending: number; bendingIncrements: number; } class InterpolateStrategy extends SyncStrategy { static STEP_DRIFT_THRESHOLDS = { onServerSync: { MAX_LEAD: -8, MAX_LAG: 16 }, // max step lead/lag allowed after every server sync onEveryStep: { MAX_LEAD: -4, MAX_LAG: 24 }, // max step lead/lag allowed at every step clientReset: 40 // if we are behind this many steps, just reset the step counter }; private interpolateOptions: InterpolateSyncStrategyOptions; constructor(interpolateOptions: InterpolateSyncStrategyOptions) { super(interpolateOptions); this.interpolateOptions = Object.assign({}, defaults, interpolateOptions); this.gameEngine.ignoreInputs = true; // client side engine ignores inputs this.gameEngine.ignorePhysics = true; // client side engine ignores physics } // apply a new sync applySync(sync: Sync, required: boolean): string { // if sync is in the past we cannot interpolate to it if (!required && sync.stepCount <= this.gameEngine.world.stepCount) { return SyncStrategy.SYNC_APPLIED; } this.gameEngine.trace.debug(() => 'interpolate applying sync'); // // scan all the objects in the sync // // 1. if the object exists locally, sync to the server object // 2. if the object is new, just create it // this.needFirstSync = false; let world: GameWorld = this.gameEngine.world; for (let ids of Object.keys(sync.syncObjects)) { // TODO: we are currently taking only the first event out of // the events that may have arrived for this object let ev = sync.syncObjects[ids][0]; let curObj = world.objects[ev.objectInstance.id]; if (curObj) { // case 1: this object already exists locally this.gameEngine.trace.trace(() => `object before syncTo: ${curObj.toString()}`); curObj.saveState(); curObj.syncTo(ev.objectInstance); this.gameEngine.trace.trace(() => `object after syncTo: ${curObj.toString()} synced to step[${ev.stepCount}]`); } else { // case 2: object does not exist. create it now this.addNewObject(ev.objectInstance.id, ev.objectInstance); } } // // bend back to original state // for (let objId of Object.keys(world.objects)) { let obj = world.objects[objId]; let isLocal = (obj.playerId == this.gameEngine.playerId); // eslint-disable-line eqeqeq let bending = isLocal ? this.interpolateOptions.localObjBending : this.interpolateOptions.remoteObjBending; obj.bendToCurrentState(bending, this.gameEngine.worldSettings, isLocal, this.interpolateOptions.bendingIncrements); if (typeof obj.refreshRenderObject === 'function') obj.refreshRenderObject(); this.gameEngine.trace.trace(() => `object[${objId}] ${obj.bendingToString()}`); } // destroy objects // TODO: use world.forEachObject((id, ob) => {}); // TODO: identical code is in InterpolateStrategy for (let objIdStr of Object.keys(world.objects)) { let objId = Number(objIdStr); let objEvents = sync.syncObjects[objId]; // if this was a full sync, and we did not get a corresponding object, // remove the local object if (sync.fullUpdate && !objEvents && objId < this.gameEngine.options.clientIDSpace) { this.gameEngine.removeObjectFromWorld(objId); continue; } if (!objEvents || objId >= this.gameEngine.options.clientIDSpace) continue; // if we got an objectDestroy event, destroy the object objEvents.forEach((e) => { if (NetworkTransmitter.getNetworkEvent(e) == 'objectDestroy') this.gameEngine.removeObjectFromWorld(objId); }); } return SyncStrategy.SYNC_APPLIED; } } export { InterpolateStrategy, InterpolateSyncStrategyOptions } ```
/content/code_sandbox/src/syncStrategies/InterpolateStrategy.ts
xml
2016-06-10T12:58:57
2024-08-15T07:16:18
lance
lance-gg/lance
1,570
1,061
```xml <?xml version="1.0" encoding="utf-8"?> <!-- path_to_url Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <resources xmlns:tools="path_to_url"> <string name="cat_toc_transition" tools:ignore="UnusedResources">Transition</string> <string name="cat_transition_title">Transition</string> <string name="cat_transition_description"> Transition choreography is a coordinated sequence of motion that maintains user focus as the interface adapts. </string> <string name="cat_transition_container_transform_activity_title">Container Transform (Activity)</string> <string name="cat_transition_container_transform_fragment_title">Container Transform (Fragment)</string> <string name="cat_transition_card_title">Title</string> <string name="cat_transition_lorem_ipsum" translatable="false">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam in scelerisque sem. Mauris volutpat, dolor id interdum ullamcorper, risus dolor egestas lectus, sit amet mattis purus dui nec risus. Maecenas non sodales nisi, vel dictum dolor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse blandit eleifend diam, vel rutrum tellus vulputate quis. Aliquam eget libero aliquet, imperdiet nisl a, ornare ex. Sed rhoncus est ut libero porta lobortis. Fusce in dictum tellus.\n\n Suspendisse interdum ornare ante. Aliquam nec cursus lorem. Morbi id magna felis. Vivamus egestas, est a condimentum egestas, turpis nisl iaculis ipsum, in dictum tellus dolor sed neque. Morbi tellus erat, dapibus ut sem a, iaculis tincidunt dui. Interdum et malesuada fames ac ante ipsum primis in faucibus. Curabitur et eros porttitor, ultricies urna vitae, molestie nibh. Phasellus at commodo eros, non aliquet metus. Sed maximus nisl nec dolor bibendum, vel congue leo egestas.\n\n Sed interdum tortor nibh, in sagittis risus mollis quis. Curabitur mi odio, condimentum sit amet auctor at, mollis non turpis. Nullam pretium libero vestibulum, finibus orci vel, molestie quam. Fusce blandit tincidunt nulla, quis sollicitudin libero facilisis et. Integer interdum nunc ligula, et fermentum metus hendrerit id. Vestibulum lectus felis, dictum at lacinia sit amet, tristique id quam. Cras eu consequat dui. Suspendisse sodales nunc ligula, in lobortis sem porta sed. Integer id ultrices magna, in luctus elit. Sed a pellentesque est.\n\n Aenean nunc velit, lacinia sed dolor sed, ultrices viverra nulla. Etiam a venenatis nibh. Morbi laoreet, tortor sed facilisis varius, nibh orci rhoncus nulla, id elementum leo dui non lorem. Nam mollis ipsum quis auctor varius. Quisque elementum eu libero sed commodo. In eros nisl, imperdiet vel imperdiet et, scelerisque a mauris. Pellentesque varius ex nunc, quis imperdiet eros placerat ac. Duis finibus orci et est auctor tincidunt. Sed non viverra ipsum. Nunc quis augue egestas, cursus lorem at, molestie sem. Morbi a consectetur ipsum, a placerat diam. Etiam vulputate dignissim convallis. Integer faucibus mauris sit amet finibus convallis.\n\n Phasellus in aliquet mi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In volutpat arcu ut felis sagittis, in finibus massa gravida. Pellentesque id tellus orci. Integer dictum, lorem sed efficitur ullamcorper, libero justo consectetur ipsum, in mollis nisl ex sed nisl. Donec maximus ullamcorper sodales. Praesent bibendum rhoncus tellus nec feugiat. In a ornare nulla. Donec rhoncus libero vel nunc consequat, quis tincidunt nisl eleifend. Cras bibendum enim a justo luctus vestibulum. Fusce dictum libero quis erat maximus, vitae volutpat diam dignissim."</string> <string name="cat_transition_title_content_desc">Sample title</string> <string name="cat_transition_body_content_desc">Sample body text</string> <string name="cat_transition_image_content_desc">Sample header image</string> <string name="cat_transition_container_transform_view_title">Container Transform (View)</string> <string name="cat_transition_contact_card_sandra">Sandra Adams</string> <string name="cat_transition_contact_card_charlie">Charlie Zhao</string> <string name="cat_transition_contact_card_trevor">Trevor Hansen</string> <string name="cat_transition_contact_card_david">David Park</string> <string name="cat_transition_contact_card_compose">Compose New</string> <string name="cat_transition_config_menu_item_title">Configure transition</string> <string name="cat_transition_config_path_motion_title">Path motion</string> <string name="cat_transition_config_path_motion_arc">Arc</string> <string name="cat_transition_config_path_motion_linear">Linear</string> <string name="cat_transition_config_enter_duration_title">Enter Duration</string> <string name="cat_transition_config_return_duration_title">Return Duration</string> <string name="cat_transition_config_interpolation_title">Interpolation</string> <string name="cat_transition_config_default">Default</string> <string name="cat_transition_config_fast_out_slow_in_title">FastOutSlowIn</string> <string name="cat_transition_config_overshoot">Overshoot</string> <string name="cat_transition_config_anticipate_overshoot">AnticipateOvershoot</string> <string name="cat_transition_config_overshoot_tension_hint">Tension</string> <string name="cat_transition_config_bounce">Bounce</string> <string name="cat_transition_config_custom_interpolator_title">Custom cubic bezier</string> <string name="cat_transition_config_custom_interpolator_desc">Custom (%1$.3f, %2$.3f, %3$.3f, %4$.3f)</string> <string name="cat_transition_config_cubic_bezier_control_x1_hint">x1</string> <string name="cat_transition_config_cubic_bezier_control_y1_hint">y1</string> <string name="cat_transition_config_cubic_bezier_control_x2_hint">x2</string> <string name="cat_transition_config_cubic_bezier_control_y2_hint">y2</string> <string name="cat_transition_config_fade_mode_title">Fade mode</string> <string name="cat_transition_config_fade_mode_in">In</string> <string name="cat_transition_config_fade_mode_out">Out</string> <string name="cat_transition_config_fade_mode_cross">Cross</string> <string name="cat_transition_config_fade_mode_through">Through</string> <string name="cat_transition_config_debug_title">Debug</string> <string name="cat_transition_config_draw_debug_checkbox_desc">Draw debugging lines</string> <string name="cat_transition_config_apply_button_text">Apply</string> <string name="cat_transition_config_clear_button_text">Clear</string> <string name="cat_transition_fade_through_title">Fade Through</string> <string name="cat_transition_fade_through_menu_item_albums">Albums</string> <string name="cat_transition_fade_through_menu_item_photos">Photos</string> <string name="cat_transition_fade_through_menu_item_search">Search</string> <string name="cat_transition_fade_through_photo_count">123 photos</string> <string name="cat_transition_shared_axis_fragment_title">Shared Axis (Fragment)</string> <string name="cat_transition_shared_axis_activity_title">Shared Axis (Activity)</string> <string name="cat_transition_shared_axis_view_title">Shared Axis (View)</string> <string name="cat_transition_shared_axis_back">Back</string> <string name="cat_transition_shared_axis_next">Next</string> <string name="cat_transition_shared_axis_x">X</string> <string name="cat_transition_shared_axis_y">Y</string> <string name="cat_transition_shared_axis_z">Z</string> <string name="cat_transition_shared_axis_sign_in_greeting">Hi David Park</string> <string name="cat_transition_shared_axis_sign_in_title">Sign in with your account</string> <string name="cat_transition_shared_axis_sign_in_hint">Email or phone number</string> <string name="cat_transition_shared_axis_sign_in_forgot_email">Forgot email?</string> <string name="cat_transition_shared_axis_sign_in_create_account">Create account</string> <string name="cat_transition_shared_axis_courses_title">Streamline your courses</string> <string name="cat_transition_shared_axis_courses_caption">Bundled categories appear as groups in your feed. You can always change this later.</string> <string name="cat_transition_shared_axis_courses_bundled">Bundled</string> <string name="cat_transition_shared_axis_courses_unbundled">Shown individually</string> <string name="cat_transition_shared_axis_courses_one"><![CDATA[Arts & Crafts]]></string> <string name="cat_transition_shared_axis_courses_two">Business</string> <string name="cat_transition_shared_axis_courses_three">Illustration</string> <string name="cat_transition_shared_axis_courses_four">Design</string> <string name="cat_transition_shared_axis_courses_five">Culinary</string> <string name="cat_transition_fade_title">Fade</string> <string name="cat_transition_fade_button_hide_fab">Hide FAB</string> <string name="cat_transition_fade_button_show_fab">Show FAB</string> </resources> ```
/content/code_sandbox/catalog/java/io/material/catalog/transition/res/values/strings.xml
xml
2016-12-05T16:11:29
2024-08-16T17:51:42
material-components-android
material-components/material-components-android
16,176
2,286
```xml <?xml version="1.0" encoding="utf-8"?> <!-- path_to_url Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <menu xmlns:android="path_to_url" xmlns:app="path_to_url"> <item android:id="@+id/album_menu_finish" android:title="@string/album_menu_finish" app:showAsAction="always|withText"/> </menu> ```
/content/code_sandbox/album/src/main/res/menu/album_menu_gallery.xml
xml
2016-11-02T00:49:15
2024-08-02T07:46:16
Album
yanzhenjie/Album
2,504
112
```xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="path_to_url" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@+id/tv_title" android:layout_margin="48dp" android:scaleType="centerInside" android:src="@drawable/text_to_pdf" /> <TextView android:id="@+id/tv_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@id/tv_desc" android:layout_centerHorizontal="true" android:layout_marginBottom="@dimen/half_margin" android:text="@string/welcome_text_to_pdf" android:textSize="18sp" android:textStyle="bold" /> <TextView android:id="@+id/tv_desc" android:layout_width="250dp" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="45dp" android:text="@string/welcome_text_to_pdf_message" android:textAlignment="center" /> </RelativeLayout> ```
/content/code_sandbox/app/src/main/res/layout/fragment_step_text_to_pdf.xml
xml
2016-02-22T10:00:46
2024-08-16T15:37:50
Images-to-PDF
Swati4star/Images-to-PDF
1,174
280
```xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="path_to_url" xmlns:tools="path_to_url" android:installLocation="auto"> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.READ_CALENDAR" /> <uses-permission android:name="android.permission.WRITE_CALENDAR" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.USE_EXACT_ALARM" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" android:maxSdkVersion="32" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" /> <uses-permission android:name="android.permission.USE_FINGERPRINT" tools:node="remove" /> <queries> <package android:name="com.simplemobiletools.contacts.pro.debug" /> <package android:name="com.simplemobiletools.contacts.pro" /> </queries> <queries> <package android:name="com.simplemobiletools.calendar.debug" /> <package android:name="com.simplemobiletools.calendar" /> </queries> <uses-feature android:name="android.hardware.faketouch" android:required="false" /> <application android:name=".App" android:allowBackup="true" android:appCategory="productivity" android:icon="@mipmap/ic_launcher" android:label="@string/app_launcher_name" android:localeConfig="@xml/locale_config" android:roundIcon="@mipmap/ic_launcher" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".activities.SplashActivity" android:launchMode="singleTask" android:theme="@style/SplashTheme" /> <activity android:name=".activities.MainActivity" android:configChanges="orientation" android:exported="true" android:launchMode="singleTask"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="content" /> <data android:scheme="file" /> <data android:mimeType="text/x-vcalendar" /> <data android:mimeType="text/calendar" /> <data android:mimeType="application/ics" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="time/epoch" /> <data android:host="com.android.calendar" /> <data android:scheme="content" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.item/event" /> </intent-filter> </activity> <activity android:name=".activities.WidgetMonthlyConfigureActivity" android:exported="true" android:screenOrientation="portrait" android:theme="@style/MyWidgetConfigTheme"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" /> </intent-filter> </activity> <activity android:name=".activities.WidgetListConfigureActivity" android:exported="true" android:screenOrientation="portrait" android:theme="@style/MyWidgetConfigTheme"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" /> </intent-filter> </activity> <activity android:name=".activities.WidgetDateConfigureActivity" android:exported="true" android:screenOrientation="portrait" android:theme="@style/MyWidgetConfigTheme"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" /> </intent-filter> </activity> <activity android:name="com.simplemobiletools.commons.activities.AboutActivity" android:configChanges="orientation" android:exported="false" android:label="@string/about" android:parentActivityName=".activities.MainActivity" /> <activity android:name="com.simplemobiletools.commons.activities.CustomizationActivity" android:configChanges="orientation" android:exported="false" android:label="@string/customize_colors" android:parentActivityName=".activities.SettingsActivity" /> <activity android:name=".activities.EventActivity" android:exported="true" android:label="@string/new_event" android:launchMode="singleTask" android:parentActivityName=".activities.MainActivity" android:windowSoftInputMode="adjustResize"> <intent-filter> <action android:name="android.intent.action.EDIT" /> <action android:name="android.intent.action.INSERT" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.item/event" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.EDIT" /> <action android:name="android.intent.action.INSERT" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.dir/event" /> </intent-filter> </activity> <activity android:name=".activities.TaskActivity" android:exported="false" android:label="@string/new_task" android:launchMode="singleTask" android:parentActivityName=".activities.MainActivity" android:windowSoftInputMode="adjustResize" /> <activity android:name=".activities.SelectTimeZoneActivity" android:configChanges="orientation" android:exported="false" android:parentActivityName=".activities.EventActivity"> <meta-data android:name="android.app.default_searchable" android:resource="@xml/searchable" /> <intent-filter> <action android:name="android.intent.action.SEARCH" /> </intent-filter> </activity> <activity android:name=".activities.SettingsActivity" android:configChanges="orientation" android:exported="true" android:label="@string/settings" android:parentActivityName=".activities.MainActivity"> <intent-filter> <action android:name="android.intent.action.APPLICATION_PREFERENCES" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name=".activities.ManageEventTypesActivity" android:configChanges="orientation" android:exported="false" android:label="@string/event_types" android:parentActivityName=".activities.SettingsActivity" /> <activity android:name=".activities.SnoozeReminderActivity" android:configChanges="orientation" android:excludeFromRecents="true" android:exported="false" android:theme="@style/Theme.Transparent" /> <activity android:name=".activities.EventTypePickerActivity" android:configChanges="orientation" android:excludeFromRecents="true" android:exported="false" android:theme="@style/Theme.Transparent" /> <receiver android:name=".helpers.MyWidgetMonthlyProvider" android:exported="true" android:icon="@drawable/img_widget_monthly_preview" android:label="@string/widget_monthly"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_monthly_info" /> </receiver> <receiver android:name=".helpers.MyWidgetListProvider" android:exported="true" android:icon="@drawable/img_widget_list_preview" android:label="@string/widget_list"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_list_info" /> </receiver> <receiver android:name=".helpers.MyWidgetDateProvider" android:exported="true" android:icon="@drawable/img_widget_date_preview" android:label="@string/widget_todays_date"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_date_info" /> </receiver> <service android:name=".services.WidgetService" android:exported="true" android:permission="android.permission.BIND_REMOTEVIEWS" /> <service android:name=".services.WidgetServiceEmpty" android:exported="true" android:permission="android.permission.BIND_REMOTEVIEWS" /> <service android:name=".services.SnoozeService" /> <service android:name=".services.MarkCompletedService" /> <service android:name=".jobs.CalDAVUpdateListener" android:exported="true" android:permission="android.permission.BIND_JOB_SERVICE" /> <receiver android:name=".receivers.NotificationReceiver" android:exported="false" /> <receiver android:name=".receivers.CalDAVSyncReceiver" android:exported="false" /> <receiver android:name=".receivers.BootCompletedReceiver" android:exported="true"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.QUICKBOOT_POWERON" /> <action android:name="com.htc.intent.action.QUICKBOOT_POWERON" /> <action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> </intent-filter> </receiver> <receiver android:name=".receivers.AutomaticBackupReceiver" android:exported="false" /> <provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" /> </provider> <activity-alias android:name=".activities.SplashActivity.Red" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_red" android:roundIcon="@mipmap/ic_launcher_red" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Pink" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_pink" android:roundIcon="@mipmap/ic_launcher_pink" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Purple" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_purple" android:roundIcon="@mipmap/ic_launcher_purple" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Deep_purple" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_deep_purple" android:roundIcon="@mipmap/ic_launcher_deep_purple" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Indigo" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_indigo" android:roundIcon="@mipmap/ic_launcher_indigo" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Blue" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_blue" android:roundIcon="@mipmap/ic_launcher_blue" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Light_blue" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_light_blue" android:roundIcon="@mipmap/ic_launcher_light_blue" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Cyan" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_cyan" android:roundIcon="@mipmap/ic_launcher_cyan" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Teal" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_teal" android:roundIcon="@mipmap/ic_launcher_teal" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Green" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_green" android:roundIcon="@mipmap/ic_launcher_green" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Light_green" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_light_green" android:roundIcon="@mipmap/ic_launcher_light_green" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Lime" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_lime" android:roundIcon="@mipmap/ic_launcher_lime" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Yellow" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_yellow" android:roundIcon="@mipmap/ic_launcher_yellow" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Amber" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_amber" android:roundIcon="@mipmap/ic_launcher_amber" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Orange" android:enabled="true" android:exported="true" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Deep_orange" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_deep_orange" android:roundIcon="@mipmap/ic_launcher_deep_orange" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Brown" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_brown" android:roundIcon="@mipmap/ic_launcher_brown" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Blue_grey" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_blue_grey" android:roundIcon="@mipmap/ic_launcher_blue_grey" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> <activity-alias android:name=".activities.SplashActivity.Grey_black" android:enabled="false" android:exported="true" android:icon="@mipmap/ic_launcher_grey_black" android:roundIcon="@mipmap/ic_launcher_grey_black" android:targetActivity=".activities.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.APP_CALENDAR" /> </intent-filter> </activity-alias> </application> </manifest> ```
/content/code_sandbox/app/src/main/AndroidManifest.xml
xml
2016-01-26T21:02:54
2024-08-15T00:35:32
Simple-Calendar
SimpleMobileTools/Simple-Calendar
3,512
4,678
```xml import en from "../app/i18n/en" import { exec } from "child_process" // Use this array for keys that for whatever reason aren't greppable so they // don't hold your test suite hostage by always failing. const EXCEPTIONS: string[] = [ // "welcomeScreen.readyForLaunch", ] function iterate(obj, stack, array) { for (const property in obj) { if (Object.prototype.hasOwnProperty.call(obj, property)) { if (typeof (obj as object)[property] === "object") { iterate(obj[property], `${stack}.${property}`, array) } else { array.push(`${stack.slice(1)}.${property}`) } } } return array } /** * This tests your codebase for missing i18n strings so you can avoid error strings at render time * * It was taken from path_to_url * and modified slightly to account for our Ignite higher order components, * which take 'tx' and 'fooTx' props. * The grep command is nasty looking, but it's essentially searching the codebase for a few different things: * * tx="*" * Tx="" * tx={""} * Tx={""} * translate("" * * and then grabs the i18n key between the double quotes * * This approach isn't 100% perfect. If you are storing your key string in a variable because you * are setting it conditionally, then it won't be picked up. * */ describe("i18n", () => { test("There are no missing keys", (done) => { // Actual command output: // grep "[T\|t]x=[{]\?\"\S*\"[}]\?\|translate(\"\S*\"" -ohr './app' | grep -o "\".*\"" const command = `grep "[T\\|t]x=[{]\\?\\"\\S*\\"[}]\\?\\|translate(\\"\\S*\\"" -ohr './app' | grep -o "\\".*\\""` exec(command, (_, stdout) => { const allTranslationsDefined = iterate(en, "", []) const allTranslationsUsed = stdout.replace(/"/g, "").split("\n") allTranslationsUsed.splice(-1, 1) for (let i = 0; i < allTranslationsUsed.length; i += 1) { if (!EXCEPTIONS.includes(allTranslationsUsed[i])) { // You can add keys to EXCEPTIONS (above) if you don't want them included in the test expect(allTranslationsDefined).toContainEqual(allTranslationsUsed[i]) } } done() }) }, 240000) }) ```
/content/code_sandbox/boilerplate/test/i18n.test.ts
xml
2016-02-10T16:06:07
2024-08-16T19:52:51
ignite
infinitered/ignite
17,196
570
```xml <?xml version="1.0" encoding="utf-8"?> <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"> <file datatype="xml" source-language="en" target-language="zh-Hant" original="../LocalizableStrings.resx"> <body> <trans-unit id="NetAddCommand"> <source>.NET Add Command</source> <target state="translated">.NET </target> <note /> </trans-unit> </body> </file> </xliff> ```
/content/code_sandbox/src/Cli/dotnet/commands/dotnet-add/xlf/LocalizableStrings.zh-Hant.xlf
xml
2016-07-22T21:26:02
2024-08-16T17:23:58
sdk
dotnet/sdk
2,627
167
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>BNDL</string> <key>CFBundleShortVersionString</key> <string>$(SHARED_VERSION_NUMBER)</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>$(SHARED_BUILD_NUMBER)</string> </dict> </plist> ```
/content/code_sandbox/WSTagsFieldTests/Info.plist
xml
2016-07-04T09:56:23
2024-08-10T14:31:35
WSTagsField
whitesmith/WSTagsField
1,283
234
```xml import React from 'react'; import _ from 'lodash'; import { Toolbar, toolbarItemClassName, toolbarMenuClassName, Ref, Button, toolbarClassName, toolbarItemWrapperClassName, } from '@fluentui/react-northstar'; export const selectors = { toolbarItem: toolbarItemClassName, toolbar: toolbarClassName, toolbarItemWrapper: toolbarItemWrapperClassName, menuTrigger: 'menu-trigger', itemButtonId: 'item-button', toolbarMenu: toolbarMenuClassName, afterToolbarId: 'after', }; export const itemsCount = 20; const buttonAfterToolbarRef = React.createRef<HTMLButtonElement>(); const ToolbarExampleOverflow = () => { const icons = ['bold', 'italic', 'underline']; const itemData = _.times(itemsCount, i => ({ key: `b${i}`, id: `${selectors.itemButtonId}-${i}`, content: `${icons[i % icons.length]} #${i}`, icon: icons[i % icons.length], title: `${icons[i % icons.length]} #${i}`, onClick: i + 1 === itemsCount ? () => buttonAfterToolbarRef.current.focus() : undefined, // first half of items are unwrapped, rest are wrapped, expect of the last item // don't add submenu on last item, on last item onClick with moving focus is tested ...(i >= itemsCount / 2 && i + 1 < itemsCount && { menu: [] }), })); const toolbarItems = itemData.map(item => { return { ...item, content: undefined }; }); const [overflowOpen, setOverflowOpen] = React.useState(false); return ( <> <Toolbar aria-label="Toolbar overflow menu" items={toolbarItems} overflow overflowOpen={overflowOpen} overflowItem={{ title: 'More', id: selectors.menuTrigger, }} onOverflowOpenChange={(e, { overflowOpen }) => { setOverflowOpen(overflowOpen); }} getOverflowItems={startIndex => itemData.slice(startIndex)} /> <Ref innerRef={buttonAfterToolbarRef}> <Button id={selectors.afterToolbarId}>After</Button> </Ref> </> ); }; export default ToolbarExampleOverflow; ```
/content/code_sandbox/packages/fluentui/e2e/tests/toolbarMenuOverflow-example.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
486
```xml /* eslint-disable @typescript-eslint/no-explicit-any */ import * as React from "react"; import { SPComponentLoader } from "@microsoft/sp-loader"; import { ServiceScope, Log, Text } from "@microsoft/sp-core-library"; import { Persona, PersonaSize, IPersonaProps, PersonaInitialsColor } from "office-ui-fabric-react"; export interface IPeopleCardProps { primaryText: string; secondaryText?: string; tertiaryText?: string; optionalText?: string; moreDetail?: HTMLElement | string; email: string; serviceScope: ServiceScope; class?: string; size: PersonaSize; initialsColor?: PersonaInitialsColor; } export interface IPeopleCardState { pictureUrl: string; personaCard: any; } const EXP_SOURCE: string = "SPFxPeopleCardComponent"; const MD5_MODULE_ID: string = "8494e7d7-6b99-47b2-a741-59873e42f16f"; const LIVE_PERSONA_COMPONENT_ID: string = "914330ee-2df2-4f6e-a858-30c23a812408"; const DEFAULT_PERSONA_IMG_HASH: string = "7ad602295f8386b7615b582d87bcc294"; const PROFILE_IMAGE_URL: string = '/_layouts/15/userphoto.aspx?size={0}&accountname={1}'; export default class SPFxPeopleCard extends React.PureComponent<IPeopleCardProps, IPeopleCardState>{ // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility state: IPeopleCardState = { personaCard: null, pictureUrl: null }; public componentDidMount(): any { const size: string = this._getPersonaSize(); const personaImgUrl: string = Text.format(PROFILE_IMAGE_URL, size, this.props.email); this._getImageBase64(personaImgUrl).then((url: string) => { this._getMd5HashForUrl(url).then((newHash)=>{ Log.info(EXP_SOURCE, `${url} h- ${newHash}`); if (newHash !== DEFAULT_PERSONA_IMG_HASH) { this.setState({ pictureUrl: "data:image/png;base64," + url }); } }).catch(console.error); }).catch(console.error); this._loadSPComponentById(LIVE_PERSONA_COMPONENT_ID).then((sharedLibrary: any) => { const livePersonaCard: any = sharedLibrary.LivePersonaCard; this.setState({ personaCard: livePersonaCard }); }).catch(console.error); } private _getPersonaSize(): string { let size: string = 'M'; if(this.props.size <= 3){ size = 'S'; }else if(this.props.size <= 6 && this.props.size > 5){ size = 'M'; } return size; } private _getMoreDetailElement(): React.ReactElement{ if(React.isValidElement(this.props.moreDetail)){ return React.createElement('div', { className: 'more-persona-details' }, this.props.moreDetail); }else{ return React.createElement('div', { className: 'more-persona-details', dangerouslySetInnerHTML: { __html: this.props.moreDetail} }); } } /** * Display default OfficeUIFabric Persona card if SPFx LivePersonaCard not loaded */ private _defaultContactCard(): React.ReactElement { return React.createElement<IPersonaProps>(Persona, { text: this.props.primaryText, secondaryText: this.props.secondaryText, tertiaryText: this.props.tertiaryText, optionalText: this.props.optionalText, imageUrl: this.state.pictureUrl, initialsColor: this.props.initialsColor ? this.props.initialsColor : "#808080", className: this.props.class, size: this.props.size, imageShouldFadeIn: false, imageShouldStartVisible: true }, this._getMoreDetailElement()); } /** * Configure SPFx LivePersona card from SPFx component loader */ private _spfxLiverPersonaCard(): React.ReactElement { return React.createElement(this.state.personaCard, { className: 'people', clientScenario: "PeopleWebPart", disableHover: false, hostAppPersonaInfo: { PersonaType: "User" }, serviceScope: this.props.serviceScope, upn: this.props.email }, this._defaultContactCard()); } /** * Get MD5Hash for the image url to verify whether user has default image or custom image * @param url */ private _getMd5HashForUrl(url: string): Promise<string|any> { return new Promise((resolve, reject) => { this._loadSPComponentById(MD5_MODULE_ID).then((library: any) => { const md5Hash: any = library.Md5Hash; if (md5Hash) { const convertedHash: any = md5Hash(url); resolve(convertedHash); } }).catch((error) => { Log.error(EXP_SOURCE, error, this.props.serviceScope); resolve(url); }); }); } private _getImageBase64(pictureUrl: string): Promise<string> { return new Promise((resolve, reject) => { const image: HTMLImageElement = new Image(); image.addEventListener("load", () => { const tempCanvas: HTMLCanvasElement = document.createElement("canvas"); tempCanvas.width = image.width; tempCanvas.height = image.height; tempCanvas.getContext("2d").drawImage(image, 0, 0); let base64Str: string; try { base64Str = tempCanvas.toDataURL("image/png"); } catch (e) { return ""; } base64Str = base64Str.replace(/^data:image\/png;base64,/, ""); resolve(base64Str); }); image.src = pictureUrl; }); } /** * Load SPFx component by id, SPComponentLoader is used to load the SPFx components * @param componentId - componentId, guid of the component library */ private _loadSPComponentById(componentId: string): Promise<any> { return new Promise((resolve, reject) => { SPComponentLoader.loadComponentById(componentId).then((component: any) => { resolve(component); }).catch((error) => { Log.error(EXP_SOURCE, error, this.props.serviceScope); }); }); } public render(): JSX.Element { return ( <div className={this.props.class}> { this.state.personaCard ? this._spfxLiverPersonaCard() : this._defaultContactCard() } </div> ); } } ```
/content/code_sandbox/samples/react-group-membership-manager/src/webparts/groupMembershipManager/components/SPFxPeopleCard.tsx
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
1,466
```xml <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>AddressBookTab</class> <widget class="QWidget" name="AddressBookTab"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>1062</width> <height>727</height> </rect> </property> <property name="windowTitle"> <string notr="true"/> </property> <layout class="QVBoxLayout" name="verticalLayout"> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="QSplitter" name="splitter"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <widget class="console::ComputerGroupTree" name="tree_group"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="contextMenuPolicy"> <enum>Qt::CustomContextMenu</enum> </property> <property name="dragEnabled"> <bool>false</bool> </property> <property name="dragDropMode"> <enum>QAbstractItemView::DragDrop</enum> </property> <property name="defaultDropAction"> <enum>Qt::MoveAction</enum> </property> <property name="selectionBehavior"> <enum>QAbstractItemView::SelectItems</enum> </property> <attribute name="headerVisible"> <bool>false</bool> </attribute> <column> <property name="text"> <string notr="true"/> </property> </column> </widget> <widget class="console::ComputerTree" name="tree_computer"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <horstretch>1</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="contextMenuPolicy"> <enum>Qt::CustomContextMenu</enum> </property> <property name="dragEnabled"> <bool>true</bool> </property> <property name="dragDropMode"> <enum>QAbstractItemView::DragOnly</enum> </property> <property name="defaultDropAction"> <enum>Qt::MoveAction</enum> </property> <property name="selectionBehavior"> <enum>QAbstractItemView::SelectRows</enum> </property> <property name="indentation"> <number>0</number> </property> <property name="sortingEnabled"> <bool>true</bool> </property> <property name="columnCount"> <number>6</number> </property> <column> <property name="text"> <string>Computer Name</string> </property> </column> <column> <property name="text"> <string>Address / ID</string> </property> </column> <column> <property name="text"> <string>Comment</string> </property> </column> <column> <property name="text"> <string>Created</string> </property> </column> <column> <property name="text"> <string>Modified</string> </property> </column> <column> <property name="text"> <string>Status</string> </property> </column> </widget> </widget> </item> </layout> </widget> <customwidgets> <customwidget> <class>console::ComputerGroupTree</class> <extends>QTreeWidget</extends> <header>console/computer_group_tree.h</header> </customwidget> <customwidget> <class>console::ComputerTree</class> <extends>QTreeWidget</extends> <header>console/computer_tree.h</header> </customwidget> </customwidgets> <resources/> <connections/> </ui> ```
/content/code_sandbox/source/console/address_book_tab.ui
xml
2016-10-26T16:17:31
2024-08-16T13:37:42
aspia
dchapyshev/aspia
1,579
1,026
```xml /* * Tencent is pleased to support the open source community by making * WCDB available. * * All rights reserved. * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #import <WCDB/WCTBinding.h> #import <WCDB/WCTCoding.h> #import <WCDB/WCTColumnBinding.h> #import <WCDB/WCTIndexBinding.h> #import <WCDB/WCTProperty.h> #import <WCDB/error.hpp> #import <objc/runtime.h> WCTBinding::WCTBinding(Class cls) : m_cls(cls) , m_indexBindingMap(nullptr) , m_constraintBindingMap(nullptr) , m_constraintBindingList(nullptr) , m_virtualTableArgumentList(nullptr) { if (![m_cls conformsToProtocol:@protocol(WCTTableCoding)]) { class_addProtocol(m_cls, @protocol(WCTTableCoding)); } } void WCTBinding::_addColumnBinding(const std::string &columnName, const std::shared_ptr<WCTColumnBinding> &columnBinding) { m_columnBindingList.push_back(columnBinding); m_columnBindingMap.insert({columnName, columnBinding}); } std::shared_ptr<WCTColumnBinding> WCTBinding::getColumnBinding(const WCTProperty &property) const { auto iter = m_columnBindingMap.find(property.getName()); return iter != m_columnBindingMap.end() ? iter->second : nullptr; } void WCTBinding::lazyInitIndexBinding() { if (!m_indexBindingMap) { m_indexBindingMap.reset(new WCTIndexBindingMap); } } std::shared_ptr<WCTIndexBinding> WCTBinding::getOrCreateIndexBinding(const std::string &indexSubfixName) { lazyInitIndexBinding(); auto iter = m_indexBindingMap->find(indexSubfixName); if (iter == m_indexBindingMap->end()) { std::shared_ptr<WCTIndexBinding> indexBinding(new WCTIndexBinding(indexSubfixName)); m_indexBindingMap->insert({indexSubfixName, indexBinding}); return indexBinding; } return iter->second; } const std::shared_ptr<WCTIndexBindingMap> WCTBinding::getIndexBindingMap() const { return m_indexBindingMap; } const WCTColumnBindingList &WCTBinding::getColumnBindingList() const { return m_columnBindingList; } const WCTColumnBindingMap &WCTBinding::getColumnBindingMap() const { return m_columnBindingMap; } void WCTBinding::lazyInitConstraintBinding() { if (!m_constraintBindingList) { m_constraintBindingList.reset(new WCTConstraintBindingList); } if (!m_constraintBindingMap) { m_constraintBindingMap.reset(new WCTConstraintBindingMap); } } WCTConstraintBindingBase *WCTBinding::getConstraint(const std::string &constraintName, WCTConstraintBindingType type) { if (!m_constraintBindingMap) { return nullptr; } auto iter = m_constraintBindingMap->find(constraintName); if (iter != m_constraintBindingMap->end()) { WCTConstraintBindingBase *constraintBinding = iter->second.get(); if (constraintBinding->type == type) { return constraintBinding; } WCDB::Error::Abort(([NSString stringWithFormat:@"There are already other constraints with different types of the same name %s", constraintName.c_str()].UTF8String)); } return nullptr; } void WCTBinding::addConstraintBinding(const std::string &constraintName, const std::shared_ptr<WCTConstraintBindingBase> &constraintBinding) { lazyInitConstraintBinding(); m_constraintBindingMap->insert({constraintName, constraintBinding}); m_constraintBindingList->push_back(constraintBinding); } const std::shared_ptr<std::list<std::pair<std::string, std::string>>> WCTBinding::getVirtualTableArgumentList() const { return m_virtualTableArgumentList; } void WCTBinding::lazyInitVirtualTableArgumentList() { if (!m_virtualTableArgumentList) { m_virtualTableArgumentList.reset(new std::list<std::pair<std::string, std::string>>); } } void WCTBinding::addVirtualTableArgument(const std::string &left, const std::string &right) { lazyInitVirtualTableArgumentList(); m_virtualTableArgumentList->push_back({left, right}); } void WCTBinding::addVirtualTableArgument(const std::string &left, NSString *right) { lazyInitVirtualTableArgumentList(); m_virtualTableArgumentList->push_back({left, right.UTF8String}); } WCDB::StatementCreateTable WCTBinding::generateCreateTableStatement(const std::string &tableName) const { WCDB::ColumnDefList columnDefList; for (const auto &columnBinding : m_columnBindingList) { if (columnBinding) { columnDefList.push_back(columnBinding->getColumnDef()); } } WCDB::TableConstraintList constraintList; if (m_constraintBindingList) { for (const auto &constraintBinding : *m_constraintBindingList.get()) { constraintList.push_back(constraintBinding->generateConstraint()); } } return WCDB::StatementCreateTable().create(tableName, columnDefList, constraintList); } WCDB::StatementCreateVirtualTable WCTBinding::generateVirtualCreateTableStatement(const std::string &tableName) const { WCDB::ModuleArgumentList moduleArgumentList; for (const auto &columnBinding : m_columnBindingList) { moduleArgumentList.push_back(columnBinding->getColumnDef()); } if (m_constraintBindingList) { for (const auto &constraintBinding : *m_constraintBindingList.get()) { moduleArgumentList.push_back(constraintBinding->generateConstraint()); } } if (m_virtualTableArgumentList) { for (const auto &moduleArgument : *m_virtualTableArgumentList.get()) { moduleArgumentList.push_back(WCDB::ModuleArgument(moduleArgument.first, moduleArgument.second)); } } return WCDB::StatementCreateVirtualTable().create(tableName).usingModule(m_virtualTableModuleName, moduleArgumentList); } void WCTBinding::setVirtualTableModule(const std::string &moduleName) { m_virtualTableModuleName = moduleName; } void WCTBinding::setVirtualTableModule(NSString *moduleName) { m_virtualTableModuleName = moduleName.UTF8String; } ```
/content/code_sandbox/Pods/WCDB/objc/WCDB/interface/orm/binding/WCTBinding.mm
xml
2016-01-25T12:21:28
2024-08-15T03:10:31
TLChat
tbl00c/TLChat
1,402
1,384
```xml import { EVENTS } from '../constants'; import { PauseToastEventDetail, ToastId, ToasterId } from '../types'; export function pauseToast(toastId: ToastId, toasterId: ToasterId | undefined = undefined, targetDocument: Document) { const event = new CustomEvent<PauseToastEventDetail>(EVENTS.pause, { bubbles: false, cancelable: false, detail: { toastId, toasterId }, }); targetDocument.dispatchEvent(event); } ```
/content/code_sandbox/packages/react-components/react-toast/library/src/state/vanilla/pauseToast.ts
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
103
```xml export const style = { display: "flex", alignItems: "center", justifyContent: "center", border: "solid 1px #ddd", background: "#f0f0f0", }; export const parentBoundary = { background: "#eee", width: "100%", height: "100%", }; export const selectorBoundary = { background: "#d1d8ff", padding: "20px", width: "100%", height: "100%", }; ```
/content/code_sandbox/stories/styles.ts
xml
2016-01-02T07:47:27
2024-08-16T15:01:53
react-rnd
bokuweb/react-rnd
3,859
108
```xml <!-- ~ contributor license agreements. See the NOTICE file distributed with ~ this work for additional information regarding copyright ownership. ~ ~ path_to_url ~ ~ Unless required by applicable law or agreed to in writing, software ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <dataset> <metadata> <column name="extname"/> <column name="extowner"/> <column name="extnamespace"/> <column name="extrelocatable"/> <column name="extversion"/> <column name="extconfig"/> <column name="extcondition"/> </metadata> </dataset> ```
/content/code_sandbox/test/e2e/sql/src/test/resources/cases/dql/dataset/empty_storage_units/opengauss/select_opengauss_pg_catalog_pg_extension.xml
xml
2016-01-18T12:49:26
2024-08-16T15:48:11
shardingsphere
apache/shardingsphere
19,707
144
```xml // See LICENSE.txt for license information. import React, {useCallback} from 'react'; import {useIntl} from 'react-intl'; import OptionItem from '@components/option_item'; import {Screens} from '@constants'; import {dismissBottomSheet, goToScreen} from '@screens/navigation'; import {preventDoubleTap} from '@utils/tap'; type Props = { channelId: string; } const ConvertToChannelLabel = ({channelId}: Props) => { const {formatMessage} = useIntl(); const goToConvertToPrivateChannel = useCallback(preventDoubleTap(async () => { await dismissBottomSheet(); const title = formatMessage({id: 'channel_info.convert_gm_to_channel.screen_title', defaultMessage: 'Convert to Private Channel'}); goToScreen(Screens.CONVERT_GM_TO_CHANNEL, title, {channelId}); }), [channelId]); return ( <OptionItem action={goToConvertToPrivateChannel} icon='lock-outline' label={formatMessage({id: 'channel_info.convert_gm_to_channel', defaultMessage: 'Convert to a Private Channel'})} type='default' /> ); }; export default ConvertToChannelLabel; ```
/content/code_sandbox/app/components/channel_actions/convert_to_channel/convert_to_channel_label.tsx
xml
2016-10-07T16:52:32
2024-08-16T12:08:38
mattermost-mobile
mattermost/mattermost-mobile
2,155
252
```xml <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="path_to_url"> <ItemGroup> <Filter Include="src"> <UniqueIdentifier>{2db2f194-ff1e-44de-81c6-46eed6e517a2}</UniqueIdentifier> </Filter> </ItemGroup> <ItemGroup> <ClCompile Include="wrap_main.cpp"> <Filter>src</Filter> </ClCompile> </ItemGroup> <ItemGroup> <ResourceCompile Include="testdll.rc"> <Filter>src</Filter> </ResourceCompile> </ItemGroup> </Project> ```
/content/code_sandbox/build/mbvipwrap/mbvipwrap.vcxproj.filters
xml
2016-09-27T03:41:10
2024-08-16T10:42:57
miniblink49
weolar/miniblink49
7,069
152
```xml import React, {useState} from 'react'; import {MShell} from 'cad/model/mshell'; import {MDatum} from 'cad/model/mdatum'; import {MOpenFaceShell} from "cad/model/mopenFace"; import {useStream, useStreamWithPatcher} from "ui/effects"; import {MObject} from "cad/model/mobject"; import {SceneInlineDelineation, SceneInlineSection} from "ui/components/SceneInlineSection"; import {GenericExplorerControl, GenericExplorerNode} from "ui/components/GenericExplorer"; import ls from "cad/craft/ui/ObjectExplorer.less"; import Fa from "ui/components/Fa"; import {AiOutlineEye, AiOutlineEyeInvisible} from "react-icons/ai"; import {ModelButtonBehavior} from "cad/craft/ui/ModelButtonBehaviour"; import {ModelAttributes} from "cad/attributes/attributesService"; export function SceneInlineObjectExplorer() { const models = useStream(ctx => ctx.craftService.models$); if (!models) { return null; } return <SceneInlineSection title='OBJECTS'> {models.map(m => { if (m instanceof MOpenFaceShell) { return <OpenFaceSection shell={m} key={m.id} /> } else if (m instanceof MShell) { return <ModelSection model={m} key={m.id} controlVisibility> <Section label='faces' defaultOpen={true}> { m.faces.map(f => <FaceSection face={f} key={f.id}/>) } </Section> <Section label='edges' defaultOpen={true}> {m.edges.map(e => <EdgeSection edge={e} key={e.id}/>)} </Section> </ModelSection> } else if (m instanceof MDatum) { return <ModelSection model={m} key={m.id} controlVisibility/>; } else { return null; } })} </SceneInlineSection> } function EdgeSection({edge}) { return <ModelSection model={edge} key={edge.id}> {edge.adjacentFaces.map(f => <FaceSection face={f} key={f.id}/>)} </ModelSection> } function FaceSection({face}) { return <ModelSection model={face} key={face.id}> {(face.productionInfo && face.productionInfo.role) && <Section label={<span>role: {face.productionInfo.role}</span>}/>} {(face.productionInfo && face.productionInfo.originatedFromPrimitive) && <Section label={<span>origin: {face.productionInfo.originatedFromPrimitive}</span>}/>} <SketchesList face={face}/> {face.edges && <Section label='edges' defaultOpen={false}> {face.edges.map(e => <EdgeSection edge={e} key={e.id}/>)} </Section>} </ModelSection>; } function SketchesList({face}) { return <Section label={face.sketchObjects.length ? 'sketch' : <span className={ls.hint}>{'<no sketch assigned>'}</span>}> {face.sketchObjects.map(o => <ModelSection key={o.id} model={o} expandable={false} />)} </Section>; } export function ModelSection({model, expandable = true, controlVisibility = false, ...props}: { model: MObject, children?: any, controlVisibility?: boolean, expandable?: boolean, }) { return <ModelButtonBehavior model={model} controlVisibility={controlVisibility}> {behavior => <GenericExplorerNode defaultExpanded={false} expandable={expandable} label={behavior.label} selected={behavior.selected} select={behavior.select} highlighted={behavior.highlighted} onMouseEnter={behavior.onMouseEnter} onMouseLeave={behavior.onMouseLeave} controls={behavior.controls}> {props.children} </GenericExplorerNode>} </ModelButtonBehavior>; } function OpenFaceSection({shell}) { return <ModelSection model={shell} key={shell.id} controlVisibility> <SketchesList face={shell.face}/> </ModelSection>; } function Section(props) { const [expanded, setExpanded] = useState(!props.defaultCollapsed); const tweakClose = () => { setExpanded(exp => !exp); }; return <> <SceneInlineDelineation onClick={tweakClose} style={{cursor: 'pointer'}}> <Fa fw icon={'caret-' + (expanded ? 'down' : 'right')}/> <span className={ls.label}>{props.label}</span> </SceneInlineDelineation> {expanded && props.children} </>; } export function VisibleSwitch({modelId}) { const [attrs, patch] = useStreamWithPatcher<ModelAttributes>(ctx => ctx.attributesService.streams.get(modelId)); const onClick = (e) => { patch(attr => { attr.hidden = !attr.hidden }); e.stopPropagation(); return false; } return <GenericExplorerControl onClick={onClick} title={attrs.hidden ? 'show' : 'hide'} on={attrs.hidden}> {attrs.hidden ? <AiOutlineEyeInvisible /> : <AiOutlineEye />} </GenericExplorerControl> } ```
/content/code_sandbox/web/app/cad/craft/ui/SceneInlineObjectExplorer.tsx
xml
2016-08-26T21:55:19
2024-08-15T01:02:53
jsketcher
xibyte/jsketcher
1,461
1,127
```xml <?xml version="1.0" encoding="utf-8"?> <manifest package="sample.github.nisrulz.interprocessservice" xmlns:android="path_to_url"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <service android:name=".MyIntentService" android:exported="true" android:process=":myprocess"> <intent-filter> <action android:name="com.abc.intentservice.action.FOO"/> </intent-filter> </service> </application> </manifest> ```
/content/code_sandbox/InterProcessService/app/src/app1/AndroidManifest.xml
xml
2016-02-25T11:06:48
2024-08-07T21:41:59
android-examples
nisrulz/android-examples
1,747
208
```xml import { ToolbarButton } from '@jupyterlab/apputils'; import { Context } from '@jupyterlab/docregistry'; import { initNotebookContext } from '@jupyterlab/notebook/lib/testutils'; import { JupyterServer } from '@jupyterlab/testing'; import { INotebookModel, NotebookPanel, NotebookWidgetFactory } from '@jupyterlab/notebook'; import * as utils from './utils'; const rendermime = utils.defaultRenderMime(); const server = new JupyterServer(); beforeAll(async () => { await server.start(); }, 30000); afterAll(async () => { await server.shutdown(); }); describe('@jupyterlab/notebook', () => { describe('NotebookWidgetFactory', () => { let context: Context<INotebookModel>; beforeEach(async () => { context = await initNotebookContext(); }); afterEach(() => { context.dispose(); }); describe('#constructor()', () => { it('should create a notebook widget factory', () => { const factory = utils.createNotebookWidgetFactory(); expect(factory).toBeInstanceOf(NotebookWidgetFactory); }); }); describe('#isDisposed', () => { it('should get whether the factory has been disposed', () => { const factory = utils.createNotebookWidgetFactory(); expect(factory.isDisposed).toBe(false); factory.dispose(); expect(factory.isDisposed).toBe(true); }); }); describe('#dispose()', () => { it('should dispose of the resources held by the factory', () => { const factory = utils.createNotebookWidgetFactory(); factory.dispose(); expect(factory.isDisposed).toBe(true); }); it('should be safe to call multiple times', () => { const factory = utils.createNotebookWidgetFactory(); factory.dispose(); factory.dispose(); expect(factory.isDisposed).toBe(true); }); }); describe('#editorConfig', () => { it('should be the editor config passed into the constructor', () => { const factory = utils.createNotebookWidgetFactory(); expect(factory.editorConfig).toBe(utils.defaultEditorConfig); }); it('should be settable', () => { const factory = utils.createNotebookWidgetFactory(); const newConfig = { ...utils.defaultEditorConfig }; factory.editorConfig = newConfig; expect(factory.editorConfig).toBe(newConfig); }); }); describe('#createNew()', () => { it('should create a new `NotebookPanel` widget', () => { const factory = utils.createNotebookWidgetFactory(); const panel = factory.createNew(context); expect(panel).toBeInstanceOf(NotebookPanel); }); it('should create a clone of the rendermime', () => { const factory = utils.createNotebookWidgetFactory(); const panel = factory.createNew(context); expect(panel.content.rendermime).not.toBe(rendermime); }); it('should pass the editor config to the notebook', () => { const factory = utils.createNotebookWidgetFactory(); const panel = factory.createNew(context); expect(panel.content.editorConfig).toBe(utils.defaultEditorConfig); }); it('should populate the default toolbar items', () => { const factory = utils.createNotebookWidgetFactory(); const panel = factory.createNew(context); // It will only contain the popup opener expect(Array.from(panel.toolbar.names())).toHaveLength(1); }); it('should populate the customized toolbar items', () => { const toolbarFactory = () => [ { name: 'foo', widget: new ToolbarButton() }, { name: 'bar', widget: new ToolbarButton() } ]; const factory = utils.createNotebookWidgetFactory(toolbarFactory); const panel = factory.createNew(context); const panel2 = factory.createNew(context); expect(Array.from(panel.toolbar.names())).toEqual([ 'foo', 'bar', 'toolbar-popup-opener' ]); expect(Array.from(panel2.toolbar.names())).toEqual([ 'foo', 'bar', 'toolbar-popup-opener' ]); expect(Array.from(panel.toolbar.children()).length).toBe(3); expect(Array.from(panel2.toolbar.children()).length).toBe(3); }); it('should clone from the optional source widget', () => { const factory = utils.createNotebookWidgetFactory(); const panel = factory.createNew(context); const clone = factory.createNew(panel.context, panel); expect(clone).toBeInstanceOf(NotebookPanel); expect(clone.content.rendermime).toBe(panel.content.rendermime); expect(clone.content.editorConfig).toBe(panel.content.editorConfig); expect(clone.content.notebookConfig).toBe(panel.content.notebookConfig); }); }); }); }); ```
/content/code_sandbox/packages/notebook/test/widgetfactory.spec.ts
xml
2016-06-03T20:09:17
2024-08-16T19:12:44
jupyterlab
jupyterlab/jupyterlab
14,019
992
```xml <?xml version="1.0"?> <wsdl:definitions xmlns="path_to_url" xmlns:soap="path_to_url" xmlns:wsdl="path_to_url" xmlns:xsd="path_to_url" xmlns:tns="path_to_url" targetNamespace="path_to_url"> <wsdl:types> <schema xmlns="path_to_url" targetNamespace="path_to_url" elementFormDefault="qualified"> <import namespace="path_to_url" schemaLocation="recursive_schema_a.xsd"/> </schema> </wsdl:types> <wsdl:portType name="portje"> </wsdl:portType> <wsdl:binding name="binding" type="portje"> <soap:binding style="document" transport="path_to_url"/> </wsdl:binding> <wsdl:service name="SOAPService"> <wsdl:port name="zeepje" binding="tns:binding"> <soap:address location="path_to_url"/> </wsdl:port> </wsdl:service> </wsdl:definitions> ```
/content/code_sandbox/tests/integration/recursive_schema_main.wsdl
xml
2016-02-14T10:31:07
2024-08-14T19:57:41
python-zeep
mvantellingen/python-zeep
1,879
246
```xml <?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15E33e" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> <dependencies> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/> <capability name="Constraints to layout margins" minToolsVersion="6.0"/> </dependencies> <objects> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="idCellMovieSummary" id="NLH-lz-d8G" customClass="MovieSummaryCell" customModule="SpotIt" customModuleProvider="target"> <rect key="frame" x="0.0" y="0.0" width="320" height="100"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="NLH-lz-d8G" id="HIh-we-F9m"> <rect key="frame" x="0.0" y="0.0" width="287" height="99.5"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zxt-Ww-Ngo"> <rect key="frame" x="76" y="10" width="211" height="21"/> <constraints> <constraint firstAttribute="height" constant="21" id="5mT-Eq-LHQ"/> <constraint firstAttribute="width" constant="211" id="M1v-om-uW8"/> </constraints> <fontDescription key="fontDescription" name="Avenir-Black" family="Avenir" pointSize="15"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7au-L5-Ng7"> <rect key="frame" x="262" y="35" width="30" height="30"/> <color key="backgroundColor" red="1" green="0.91764705879999997" blue="0.32549019610000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstAttribute="width" constant="30" id="8n1-Uu-hgL"/> <constraint firstAttribute="height" constant="30" id="IiC-Kh-It8"/> </constraints> <fontDescription key="fontDescription" name="Avenir-Oblique" family="Avenir" pointSize="15"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="K2C-HQ-QwJ"> <rect key="frame" x="76" y="39" width="178" height="47"/> <constraints> <constraint firstAttribute="height" constant="47" id="Ujg-5i-6xV"/> <constraint firstAttribute="width" constant="178" id="s6s-wr-6ky"/> </constraints> <fontDescription key="fontDescription" name="Avenir-Light" family="Avenir" pointSize="13"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="atX-cF-u4r"> <rect key="frame" x="8" y="10" width="60" height="80"/> <constraints> <constraint firstAttribute="width" constant="60" id="IWN-AF-3qh"/> <constraint firstAttribute="height" constant="80" id="M91-AZ-siE"/> </constraints> </imageView> </subviews> <constraints> <constraint firstItem="7au-L5-Ng7" firstAttribute="top" secondItem="zxt-Ww-Ngo" secondAttribute="bottom" constant="4" id="51T-Ii-maW"/> <constraint firstItem="K2C-HQ-QwJ" firstAttribute="leading" secondItem="atX-cF-u4r" secondAttribute="trailing" constant="8" id="SNH-SK-A49"/> <constraint firstAttribute="trailingMargin" secondItem="7au-L5-Ng7" secondAttribute="trailing" constant="-13" id="TKn-7d-JUf"/> <constraint firstItem="atX-cF-u4r" firstAttribute="leading" secondItem="HIh-we-F9m" secondAttribute="leadingMargin" id="ZX4-IX-3lo"/> <constraint firstItem="atX-cF-u4r" firstAttribute="top" secondItem="HIh-we-F9m" secondAttribute="topMargin" constant="2" id="k1l-yx-JlC"/> <constraint firstItem="zxt-Ww-Ngo" firstAttribute="leading" secondItem="atX-cF-u4r" secondAttribute="trailing" constant="8" id="oqg-PL-Tpk"/> <constraint firstItem="zxt-Ww-Ngo" firstAttribute="top" secondItem="HIh-we-F9m" secondAttribute="topMargin" constant="2" id="qig-fX-eW2"/> <constraint firstItem="K2C-HQ-QwJ" firstAttribute="top" secondItem="zxt-Ww-Ngo" secondAttribute="bottom" constant="8" id="yFI-p9-vbC"/> </constraints> </tableViewCellContentView> <connections> <outlet property="imgMovieImage" destination="atX-cF-u4r" id="PWz-od-Bi9"/> <outlet property="lblDescription" destination="K2C-HQ-QwJ" id="YB9-8E-SPG"/> <outlet property="lblRating" destination="7au-L5-Ng7" id="tnF-6H-ULB"/> <outlet property="lblTitle" destination="zxt-Ww-Ngo" id="6Uc-px-hv6"/> </connections> <point key="canvasLocation" x="445" y="337"/> </tableViewCell> </objects> </document> ```
/content/code_sandbox/Project 28 - SpotlightSearch/SpotIt/MovieSummaryCell.xib
xml
2016-02-13T14:02:12
2024-08-16T09:41:59
30DaysofSwift
allenwong/30DaysofSwift
11,506
1,799
```xml import 'reflect-metadata'; import { authenticated, buildSchema, context, createAccountsCoreModule, } from '@accounts/module-core'; import { createAccountsPasswordModule } from '@accounts/module-password'; import { AccountsPassword } from '@accounts/password'; import { AccountsServer, AuthenticationServicesToken, ServerHooks } from '@accounts/server'; import gql from 'graphql-tag'; import mongoose from 'mongoose'; import { createApplication } from 'graphql-modules'; import { createAccountsMongoModule } from '@accounts/module-mongo'; import { createHandler } from 'graphql-http/lib/use/http'; import http from 'http'; import { type IContext } from '@accounts/types'; void (async () => { // Create database connection await mongoose.connect('mongodb://localhost:27017/accounts-js-graphql-example'); const dbConn = mongoose.connection; const typeDefs = gql` type PrivateType @auth { field: String } # Our custom fields to add to the user extend input CreateUserInput { firstName: String! lastName: String! } extend type User { firstName: String! lastName: String! } extend type Query { # Example of how to get the userId from the context and return the current logged in user or null me: User publicField: String # You can only query this if you are logged in privateField: String @auth privateType: PrivateType privateFieldWithAuthResolver: String } extend type Mutation { privateMutation: String @auth publicMutation: String } `; // TODO: use resolvers typings from codegen const resolvers = { Query: { me: (_, __, ctx) => { // ctx.userId will be set if user is logged in if (ctx.userId) { // We could have simply returned ctx.user instead return ctx.injector.get(AccountsServer).findUserById(ctx.userId); } return null; }, publicField: () => 'public', privateField: () => 'private', privateFieldWithAuthResolver: authenticated(() => { return 'private'; }), privateType: () => ({ field: () => 'private', }), }, Mutation: { privateMutation: () => 'private', publicMutation: () => 'public', }, }; const app = createApplication({ modules: [ createAccountsCoreModule({ tokenSecret: 'secret' }), createAccountsPasswordModule({ // This option is called when a new user create an account // Inside we can apply our logic to validate the user fields validateNewUser: (user) => { if (!user.firstName) { throw new Error('First name required'); } if (!user.lastName) { throw new Error('Last name required'); } // For example we can allow only some kind of emails if (user.email.endsWith('.xyz')) { throw new Error('Invalid email'); } return user; }, }), createAccountsMongoModule({ dbConn }), ], providers: [ { provide: AuthenticationServicesToken, useValue: { password: AccountsPassword }, global: true, }, ], schemaBuilder: buildSchema({ typeDefs, resolvers }), }); const { injector, createOperationController } = app; // Create the GraphQL over HTTP Node request handler const handler = createHandler<Pick<IContext, keyof IContext>>({ schema: app.schema, execute: app.createExecution(), context: (request) => context({ request }, { createOperationController }), }); injector.get(AccountsServer).on(ServerHooks.ValidateLogin, ({ user }) => { // This hook is called every time a user try to login. // You can use it to only allow users with verified email to login. // If you throw an error here it will be returned to the client. console.log(`${user.firstName} ${user.lastName} logged in`); }); // Create a HTTP server using the listener on `/graphql` const server = http.createServer((req, res) => { // Set CORS headers res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Request-Method', '*'); res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET'); res.setHeader('Access-Control-Allow-Headers', '*'); if (req.method === 'OPTIONS') { res.writeHead(200); res.end(); return; } if (req.url?.startsWith('/graphql')) { handler(req, res); } else { res.writeHead(404).end(); } }); server.listen(4000); console.log(` Server ready at path_to_url`); })(); ```
/content/code_sandbox/examples/graphql-server-typescript-basic/src/index.ts
xml
2016-10-07T01:43:23
2024-07-14T11:57:08
accounts
accounts-js/accounts
1,492
1,023
```xml import { createAction } from '@reduxjs/toolkit'; import type { MailImportFields } from '@proton/activation/src/components/Modals/CustomizeMailImportModal/CustomizeMailImportModal.interface'; import type { EASY_SWITCH_SOURCES, ImportProvider, ImportType } from '@proton/activation/src/interface'; import type { ImporterCalendar, MailImportState } from './oauthDraft.interface'; export const OAUTH_ACTION_PREFIX = 'draft/oauth'; export const resetOauthDraft = createAction(`${OAUTH_ACTION_PREFIX}/reset`); export const startOauthDraft = createAction<{ provider: ImportProvider; products: ImportType[]; source: EASY_SWITCH_SOURCES; }>(`${OAUTH_ACTION_PREFIX}/start`); export const initOauthMailImport = createAction(`${OAUTH_ACTION_PREFIX}/initOauthImport`); export const displayConfirmLeaveModal = createAction<boolean>(`${OAUTH_ACTION_PREFIX}/displayConfirmLeaveModal`); export const submitProductProvider = createAction<{ products: ImportType[]; scopes: string[] }>( `${OAUTH_ACTION_PREFIX}/submitProductProvider` ); export const submitProducts = createAction<ImportType[]>(`${OAUTH_ACTION_PREFIX}/submitProducts`); export const changeOAuthStep = createAction<MailImportState['step']>(`${OAUTH_ACTION_PREFIX}/changeOAuthStep`); export const updateCalendarData = createAction<ImporterCalendar[]>(`${OAUTH_ACTION_PREFIX}/updateCalendarData`); export const updateEmailsData = createAction<MailImportFields>(`${OAUTH_ACTION_PREFIX}/updateEmailsData`); ```
/content/code_sandbox/packages/activation/src/logic/draft/oauthDraft/oauthDraft.actions.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
314
```xml import {div, VNode} from '@cycle/dom'; import {State} from '../model/index'; import {lastCombStep} from '../model/queries'; import styles from '../styles'; import playIcon from '../../icons/play'; import nextIcon from '../../icons/next'; import endIcon from '../../icons/end'; import resetIcon from '../../icons/reset'; function getArrayOfButtons(state: State): Array<VNode> { const step = state.step; let buttons: Array<VNode> = []; if (step === 0) { buttons = [ div(`.multiply.${styles.multiplyButton}`, [playIcon, 'Multiply']) ]; } else if (step === 1 && !state.canInteract) { buttons = [ div(`.multiply.${styles.multiplyButtonDisabled}`, [playIcon, 'Multiply']) ]; } else if (step >= 1 && step <= lastCombStep(state) && state.canInteract) { buttons = [ div(`.next.${styles.nextButton}`, [nextIcon, 'Next']), div(`.end.${styles.endButton}`, [endIcon, 'End']), ]; } else if (step >= 1 && step <= lastCombStep(state) + 1 && !state.canInteract) { buttons = [ div(`.next.${styles.nextButtonDisabled}`, [nextIcon, 'Next']), div(`.end.${styles.endButtonDisabled}`, [endIcon, 'End']), ]; } else if (step === lastCombStep(state) + 1 && state.canInteract) { buttons = [ div(`.reset.${styles.resetButton}`, [resetIcon, 'Reset']), ]; } return buttons; } export function renderControlPanel(state: State): VNode { return div(`.controlPanel.${styles.controlPanel}`, getArrayOfButtons(state)); } ```
/content/code_sandbox/src/Calculator/view/controlPanel.ts
xml
2016-09-13T13:33:31
2024-08-15T13:43:45
matrixmultiplication.xyz
staltz/matrixmultiplication.xyz
1,129
392
```xml import { AnimationEvent } from '@angular/animations'; import { CommonModule } from '@angular/common'; import { AfterContentInit, booleanAttribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, computed, ContentChildren, effect, ElementRef, EventEmitter, forwardRef, Inject, Input, NgModule, numberAttribute, OnInit, Output, QueryList, signal, SimpleChanges, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { OverlayOptions, OverlayService, PrimeNGConfig, PrimeTemplate, SharedModule, TranslationKeys } from 'primeng/api'; import { DomHandler } from 'primeng/dom'; import { AngleRightIcon } from 'primeng/icons/angleright'; import { AutoFocusModule } from 'primeng/autofocus'; import { ChevronDownIcon } from 'primeng/icons/chevrondown'; import { TimesIcon } from 'primeng/icons/times'; import { Overlay, OverlayModule } from 'primeng/overlay'; import { RippleModule } from 'primeng/ripple'; import { Nullable } from 'primeng/ts-helpers'; import { ObjectUtils, UniqueComponentId } from 'primeng/utils'; import { CascadeSelectBeforeHideEvent, CascadeSelectBeforeShowEvent, CascadeSelectChangeEvent, CascadeSelectHideEvent, CascadeSelectShowEvent } from './cascadeselect.interface'; export const CASCADESELECT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CascadeSelect), multi: true }; @Component({ selector: 'p-cascadeSelectSub', template: ` <ul class="p-cascadeselect-panel p-cascadeselect-items" [ngClass]="{ 'p-cascadeselect-panel-root': root }" [attr.role]="role" aria-orientation="horizontal" [attr.data-pc-section]="level === 0 ? 'list' : 'sublist'" [attr.aria-label]="listLabel" > <ng-template ngFor let-processedOption [ngForOf]="options" let-i="index"> <li [ngClass]="getItemClass(processedOption)" role="treeitem" [attr.aria-level]="level + 1" [attr.aria-setsize]="options.length" [attr.data-pc-section]="'item'" [id]="getOptionId(processedOption)" [attr.aria-label]="getOptionLabelToRender(processedOption)" [attr.aria-selected]="isOptionGroup(processedOption) ? undefined : isOptionSelected(processedOption)" [attr.aria-posinset]="i + 1" > <div class="p-cascadeselect-item-content" (click)="onOptionClick($event, processedOption)" [attr.tabindex]="0" pRipple [attr.data-pc-section]="'content'"> <ng-container *ngIf="optionTemplate; else defaultOptionTemplate"> <ng-container *ngTemplateOutlet="optionTemplate; context: { $implicit: processedOption.option }"></ng-container> </ng-container> <ng-template #defaultOptionTemplate> <span class="p-cascadeselect-item-text" [attr.data-pc-section]="'text'">{{ getOptionLabelToRender(processedOption) }}</span> </ng-template> <span class="p-cascadeselect-group-icon" *ngIf="isOptionGroup(processedOption)" [attr.data-pc-section]="'groupIcon'"> <AngleRightIcon *ngIf="!groupIconTemplate" /> <ng-template *ngTemplateOutlet="groupIconTemplate"></ng-template> </span> </div> <p-cascadeSelectSub *ngIf="isOptionGroup(processedOption) && isOptionActive(processedOption)" [role]="'group'" class="p-cascadeselect-sublist" [selectId]="selectId" [focusedOptionId]="focusedOptionId" [activeOptionPath]="activeOptionPath" [options]="getOptionGroupChildren(processedOption)" [optionLabel]="optionLabel" [optionValue]="optionValue" [level]="level + 1" (onChange)="onOptionChange($event)" [optionGroupLabel]="optionGroupLabel" [optionGroupChildren]="optionGroupChildren" [dirty]="dirty" [optionTemplate]="optionTemplate" > </p-cascadeSelectSub> </li> </ng-template> </ul> `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }) export class CascadeSelectSub implements OnInit { @Input() role: string | undefined; @Input() selectId: string | undefined; @Input() activeOptionPath: any[]; @Input() optionDisabled: any[]; @Input() focusedOptionId: string | undefined; @Input() options: string[] | string | undefined | null; @Input() optionGroupChildren: string[] | string | undefined | null; @Input() optionTemplate: Nullable<TemplateRef<any>>; @Input() groupIconTemplate: Nullable<TemplateRef<any>>; @Input({ transform: numberAttribute }) level: number = 0; @Input() optionLabel: string | undefined; @Input() optionValue: string | undefined; @Input() optionGroupLabel: string | undefined; @Input({ transform: booleanAttribute }) dirty: boolean | undefined; @Input({ transform: booleanAttribute }) root: boolean | undefined; @Output() onChange: EventEmitter<any> = new EventEmitter(); get listLabel(): string { return this.config.getTranslation(TranslationKeys.ARIA)['listLabel']; } constructor(private el: ElementRef, public config: PrimeNGConfig) {} ngOnInit() { if (!this.root) { this.position(); } } onOptionClick(event, option: any) { this.onChange.emit({ originalEvent: event, value: option, isFocus: true }); } onOptionChange(event) { this.onChange.emit(event); } getOptionId(processedOption) { return `${this.selectId}_${processedOption.key}`; } getOptionLabel(processedOption) { return this.optionLabel ? ObjectUtils.resolveFieldData(processedOption.option, this.optionLabel) : processedOption.option; } getOptionValue(processedOption) { return this.optionValue ? ObjectUtils.resolveFieldData(processedOption.option, this.optionValue) : processedOption.option; } getOptionLabelToRender(processedOption) { return this.isOptionGroup(processedOption) ? this.getOptionGroupLabel(processedOption) : this.getOptionLabel(processedOption); } isOptionDisabled(processedOption) { return this.optionDisabled ? ObjectUtils.resolveFieldData(processedOption.option, this.optionDisabled) : false; } getOptionGroupLabel(processedOption) { return this.optionGroupLabel ? ObjectUtils.resolveFieldData(processedOption.option, this.optionGroupLabel) : null; } getOptionGroupChildren(processedOption) { return processedOption.children; } isOptionGroup(processedOption) { return ObjectUtils.isNotEmpty(processedOption.children); } isOptionSelected(processedOption) { return !this.isOptionGroup(processedOption) && this.isOptionActive(processedOption); } isOptionActive(processedOption) { return this.activeOptionPath.some((path) => path.key === processedOption.key); } isOptionFocused(processedOption) { return this.focusedOptionId === this.getOptionId(processedOption); } getItemClass(option: string | string[]) { return { 'p-cascadeselect-item': true, 'p-cascadeselect-item-group': this.isOptionGroup(option), 'p-cascadeselect-item-active p-highlight': this.isOptionActive(option), 'p-focus': this.isOptionFocused(option), 'p-disabled': this.isOptionDisabled(option) }; } position() { const parentItem = this.el.nativeElement.parentElement; const containerOffset = DomHandler.getOffset(parentItem); const viewport = DomHandler.getViewport(); const sublistWidth = this.el.nativeElement.children[0].offsetParent ? this.el.nativeElement.children[0].offsetWidth : DomHandler.getHiddenElementOuterWidth(this.el.nativeElement.children[0]); const itemOuterWidth = DomHandler.getOuterWidth(parentItem.children[0]); if (parseInt(containerOffset.left, 10) + itemOuterWidth + sublistWidth > viewport.width - DomHandler.calculateScrollbarWidth()) { this.el.nativeElement.children[0].style.left = '-200%'; } } } /** * CascadeSelect is a form component to select a value from a nested structure of options. * @group Components */ @Component({ selector: 'p-cascadeSelect', template: ` <div #container [ngClass]="containerClass" [class]="styleClass" [ngStyle]="style" (click)="onContainerClick($event)" [attr.data-pc-name]="'cascadeselect'" [attr.data-pc-section]="'root'"> <div class="p-hidden-accessible" [attr.data-pc-section]="'hiddenInputWrapper'"> <input #focusInput readonly type="text" role="combobox" [disabled]="disabled" [placeholder]="placeholder" [tabindex]="!disabled ? tabindex : -1" [attr.id]="inputId" [attr.aria-label]="ariaLabel" [attr.aria-labelledby]="ariaLabelledBy" aria-haspopup="tree" [attr.aria-expanded]="overlayVisible ?? false" [attr.aria-controls]="overlayVisible ? id + '_tree' : null" [attr.aria-activedescendant]="focused ? focusedOptionId : undefined" (focus)="onInputFocus($event)" (blur)="onInputBlur($event)" (keydown)="onInputKeyDown($event)" pAutoFocus [autofocus]="autofocus" /> </div> <span [ngClass]="labelClass" [attr.data-pc-section]="'label'"> <ng-container *ngIf="valueTemplate; else defaultValueTemplate"> <ng-container *ngTemplateOutlet="valueTemplate; context: { $implicit: value, placeholder: placeholder }"></ng-container> </ng-container> <ng-template #defaultValueTemplate> {{ label() }} </ng-template> </span> <ng-container *ngIf="filled && !disabled && showClear"> <TimesIcon *ngIf="!clearIconTemplate" [styleClass]="'p-cascadeselect-clear-icon'" (click)="clear($event)" [attr.data-pc-section]="'clearicon'" [attr.aria-hidden]="true" /> <span *ngIf="clearIconTemplate" class="p-cascadeselect-clear-icon" (click)="clear($event)" [attr.data-pc-section]="'clearicon'" [attr.aria-hidden]="true"> <ng-template *ngTemplateOutlet="clearIconTemplate"></ng-template> </span> </ng-container> <div class="p-cascadeselect-trigger" role="button" aria-haspopup="listbox" [attr.aria-expanded]="overlayVisible ?? false" [attr.data-pc-section]="'dropdownIcon'" [attr.aria-hidden]="true"> <ng-container *ngIf="loading; else elseBlock"> <ng-container *ngIf="loadingIconTemplate"> <ng-container *ngTemplateOutlet="loadingIconTemplate"></ng-container> </ng-container> <ng-container *ngIf="!loadingIconTemplate"> <span *ngIf="loadingIcon" [ngClass]="'p-cascadeselect-trigger-icon pi-spin ' + loadingIcon" aria-hidden="true"></span> <span *ngIf="!loadingIcon" [class]="'p-cascadeselect-trigger-icon pi pi-spinner pi-spin'" aria-hidden="true"></span> </ng-container> </ng-container> <ng-template #elseBlock> <ChevronDownIcon *ngIf="!triggerIconTemplate" [styleClass]="'p-cascadeselect-trigger-icon'" /> <span *ngIf="triggerIconTemplate" class="p-cascadeselect-trigger-icon"> <ng-template *ngTemplateOutlet="triggerIconTemplate"></ng-template> </span> </ng-template> </div> <span role="status" aria-live="polite" class="p-hidden-accessible"> {{ searchResultMessageText }} </span> <p-overlay #overlay [(visible)]="overlayVisible" [options]="overlayOptions" [target]="'@parent'" [appendTo]="appendTo" [showTransitionOptions]="showTransitionOptions" [hideTransitionOptions]="hideTransitionOptions" (onAnimationDone)="onOverlayAnimationDone($event)" (onBeforeShow)="onBeforeShow.emit($event)" (onShow)="show($event)" (onBeforeHide)="onBeforeHide.emit($event)" (onHide)="hide($event)" > <ng-template pTemplate="content"> <div #panel class="p-cascadeselect-panel p-component" [class]="panelStyleClass" [ngStyle]="panelStyle" [attr.data-pc-section]="'panel'"> <div class="p-cascadeselect-items-wrapper" [attr.data-pc-section]="'wrapper'"> <p-cascadeSelectSub [options]="processedOptions" [selectId]="id" [focusedOptionId]="focused ? focusedOptionId : undefined" [activeOptionPath]="activeOptionPath()" [optionLabel]="optionLabel" [optionValue]="optionValue" [level]="0" [optionTemplate]="optionTemplate" [groupIconTemplate]="groupIconTemplate" [optionGroupLabel]="optionGroupLabel" [optionGroupChildren]="optionGroupChildren" [optionDisabled]="optionDisabled" [optionValue]="optionValue" [optionLabel]="optionLabel" [root]="true" (onChange)="onOptionChange($event)" [dirty]="dirty" [role]="'tree'" > </p-cascadeSelectSub> </div> <span role="status" aria-live="polite" class="p-hidden-accessible"> {{ selectedMessageText }} </span> </div> </ng-template> </p-overlay> </div>`, host: { class: 'p-element p-inputwrapper', '[class.p-inputwrapper-filled]': 'filled', '[class.p-inputwrapper-focus]': 'focused || overlayVisible', '[class.p-cascadeselect-clearable]': 'showClear && !disabled' }, providers: [CASCADESELECT_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styleUrls: ['./cascadeselect.css'] }) export class CascadeSelect implements OnInit, AfterContentInit { /** * Unique identifier of the component * @group Props */ @Input() id: string | undefined; /** * Determines if the option will be selected on focus. * @group Props */ @Input({ transform: booleanAttribute }) selectOnFocus: boolean = false; /** * Text to display when the search is active. Defaults to global value in i18n translation configuration. * @group Props * @defaultValue '{0} results are available' */ @Input() searchMessage: string | undefined; /** * Text to display when there is no data. Defaults to global value in i18n translation configuration. * @group Props */ @Input() emptyMessage: string | undefined; /** * Text to be displayed in hidden accessible field when options are selected. Defaults to global value in i18n translation configuration. * @group Props * @defaultValue '{0} items selected' */ @Input() selectionMessage: string | undefined; /** * Text to display when filtering does not return any results. Defaults to value from PrimeNG locale configuration. * @group Props * @defaultValue 'No available options' */ @Input() emptySearchMessage: string | undefined; /** * Text to display when filtering does not return any results. Defaults to global value in i18n translation configuration. * @group Props * @defaultValue 'No selected item' */ @Input() emptySelectionMessage: string | undefined; /** * Locale to use in searching. The default locale is the host environment's current locale. * @group Props */ @Input() searchLocale: string | undefined; /** * Name of the disabled field of an option. * @group Props */ @Input() optionDisabled: any; /** * Whether to focus on the first visible or selected element when the overlay panel is shown. * @group Props */ @Input({ transform: booleanAttribute }) autoOptionFocus: boolean = true; /** * Style class of the component. * @group Props */ @Input() styleClass: string | undefined; /** * Inline style of the component. * @group Props */ @Input() style: { [klass: string]: any } | null | undefined; /** * An array of selectitems to display as the available options. * @group Props */ @Input() options: string[] | string | undefined; /** * Property name or getter function to use as the label of an option. * @group Props */ @Input() optionLabel: string | undefined; /** * Property name or getter function to use as the value of an option, defaults to the option itself when not defined. * @group Props */ @Input() optionValue: string | undefined; /** * Property name or getter function to use as the label of an option group. * @group Props */ @Input() optionGroupLabel: string | string[] | undefined; /** * Property name or getter function to retrieve the items of a group. * @group Props */ @Input() optionGroupChildren: string | string[] | undefined; /** * Default text to display when no option is selected. * @group Props */ @Input() placeholder: string | undefined; /** * Selected value of the component. * @group Props */ @Input() value: string | undefined | null; /** * A property to uniquely identify an option. * @group Props */ @Input() dataKey: string | undefined; /** * Identifier of the underlying input element. * @group Props */ @Input() inputId: string | undefined; /** * Index of the element in tabbing order. * @group Props */ @Input({ transform: numberAttribute }) tabindex: number | undefined = 0; /** * Establishes relationships between the component and label(s) where its value should be one or more element IDs. * @group Props */ @Input() ariaLabelledBy: string | undefined; /** * Label of the input for accessibility. * @group Props */ @Input() inputLabel: string | undefined; /** * Defines a string that labels the input for accessibility. * @group Props */ @Input() ariaLabel: string | undefined; /** * Id of the element or "body" for document where the overlay should be appended to. * @group Props */ @Input() appendTo: HTMLElement | ElementRef | TemplateRef<any> | string | null | undefined | any; /** * When present, it specifies that the component should be disabled. * @group Props */ @Input({ transform: booleanAttribute }) disabled: boolean | undefined; /** * When enabled, a clear icon is displayed to clear the value. * @group Props */ @Input({ transform: booleanAttribute }) showClear: boolean = false; /** * Style class of the overlay panel. * @group Props */ @Input() panelStyleClass: string | undefined; /** * Inline style of the overlay panel. * @group Props */ @Input() panelStyle: { [klass: string]: any } | null | undefined; /** * Whether to use overlay API feature. The properties of overlay API can be used like an object in it. * @group Props */ @Input() overlayOptions: OverlayOptions | undefined; /** * When present, it specifies that the component should automatically get focus on load. * @group Props */ @Input({ transform: booleanAttribute }) autofocus: boolean | undefined; /** * Transition options of the show animation. * @group Props * @deprecated deprecated since v14.2.0, use overlayOptions property instead. */ @Input() get showTransitionOptions(): string { return this._showTransitionOptions; } set showTransitionOptions(val: string) { this._showTransitionOptions = val; console.warn('The showTransitionOptions property is deprecated since v14.2.0, use overlayOptions property instead.'); } /** * Specifies the input variant of the component. * @group Props */ @Input() variant: 'filled' | 'outlined' = 'outlined'; /** * Whether the dropdown is in loading state. * @group Props */ @Input({ transform: booleanAttribute }) loading: boolean | undefined = false; /** * Icon to display in loading state. * @group Props */ @Input() loadingIcon: string | undefined; /** * Transition options of the hide animation. * @group Props * @deprecated deprecated since v14.2.0, use overlayOptions property instead. */ @Input() get hideTransitionOptions(): string { return this._hideTransitionOptions; } set hideTransitionOptions(val: string) { this._hideTransitionOptions = val; console.warn('The hideTransitionOptions property is deprecated since v14.2.0, use overlayOptions property instead.'); } /** * Callback to invoke on value change. * @param {CascadeSelectChangeEvent} event - Custom change event. * @group Emits */ @Output() onChange: EventEmitter<CascadeSelectChangeEvent> = new EventEmitter<CascadeSelectChangeEvent>(); /** * Callback to invoke when a group changes. * @param {Event} event - Browser event. * @group Emits */ @Output() onGroupChange: EventEmitter<Event> = new EventEmitter<Event>(); /** * Callback to invoke when the overlay is shown. * @param {CascadeSelectShowEvent} event - Custom overlay show event. * @group Emits */ @Output() onShow: EventEmitter<CascadeSelectShowEvent> = new EventEmitter<CascadeSelectShowEvent>(); /** * Callback to invoke when the overlay is hidden. * @param {CascadeSelectHideEvent} event - Custom overlay hide event. * @group Emits */ @Output() onHide: EventEmitter<CascadeSelectHideEvent> = new EventEmitter<CascadeSelectHideEvent>(); /** * Callback to invoke when the clear token is clicked. * @group Emits */ @Output() onClear: EventEmitter<any> = new EventEmitter(); /** * Callback to invoke before overlay is shown. * @param {CascadeSelectBeforeShowEvent} event - Custom overlay show event. * @group Emits */ @Output() onBeforeShow: EventEmitter<CascadeSelectBeforeShowEvent> = new EventEmitter<CascadeSelectBeforeShowEvent>(); /** * Callback to invoke before overlay is hidden. * @param {CascadeSelectBeforeHideEvent} event - Custom overlay hide event. * @group Emits */ @Output() onBeforeHide: EventEmitter<CascadeSelectBeforeHideEvent> = new EventEmitter<CascadeSelectBeforeHideEvent>(); /** * Callback to invoke when input receives focus. * @param {FocusEvent} event - Focus event. * @group Emits */ @Output() onFocus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>(); /** * Callback to invoke when input loses focus. * @param {FocusEvent} event - Focus event. * @group Emits */ @Output() onBlur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>(); @ViewChild('focusInput') focusInputViewChild: Nullable<ElementRef>; @ViewChild('container') containerViewChild: Nullable<ElementRef>; @ViewChild('panel') panelViewChild: Nullable<ElementRef>; @ViewChild('overlay') overlayViewChild: Nullable<Overlay>; @ContentChildren(PrimeTemplate) templates!: QueryList<PrimeTemplate>; _showTransitionOptions: string = ''; _hideTransitionOptions: string = ''; selectionPath: any = null; focused: boolean = false; overlayVisible: boolean = false; dirty: boolean = true; searchValue: string | undefined; searchTimeout: any; valueTemplate: Nullable<TemplateRef<any>>; optionTemplate: Nullable<TemplateRef<any>>; triggerIconTemplate: Nullable<TemplateRef<any>>; loadingIconTemplate: Nullable<TemplateRef<any>>; groupIconTemplate: Nullable<TemplateRef<any>>; clearIconTemplate: Nullable<TemplateRef<any>>; onModelChange: Function = () => {}; onModelTouched: Function = () => {}; focusedOptionInfo = signal<any>({ index: -1, level: 0, parentKey: '' }); activeOptionPath = signal<any>([]); modelValue = signal<any>(null); processedOptions: string[] | string | undefined = []; get containerClass() { return { 'p-cascadeselect p-component p-inputwrapper': true, 'p-disabled': this.disabled, 'p-focus': this.focused, 'p-inputwrapper-filled': this.modelValue(), 'p-variant-filled': this.variant === 'filled' || this.config.inputStyle() === 'filled', 'p-inputwrapper-focus': this.focused || this.overlayVisible, 'p-overlay-open': this.overlayVisible }; } get labelClass() { return { 'p-cascadeselect-label': true, 'p-placeholder': this.label() === this.placeholder, 'p-cascadeselect-label-empty': !this.value && (this.label() === 'p-emptylabel' || this.label().length === 0) }; } get focusedOptionId() { return this.focusedOptionInfo().index !== -1 ? `${this.id}${ObjectUtils.isNotEmpty(this.focusedOptionInfo().parentKey) ? '_' + this.focusedOptionInfo().parentKey : ''}_${this.focusedOptionInfo().index}` : null; } get filled(): boolean { if (typeof this.modelValue() === 'string') return !!this.modelValue(); return this.modelValue() || this.modelValue() != null || this.modelValue() != undefined; } get searchResultMessageText() { return ObjectUtils.isNotEmpty(this.visibleOptions()) ? this.searchMessageText.replaceAll('{0}', this.visibleOptions().length) : this.emptySearchMessageText; } get searchMessageText() { return this.searchMessage || this.config.translation.searchMessage || ''; } get emptySearchMessageText() { return this.emptySearchMessage || this.config.translation.emptySearchMessage || ''; } get emptyMessageText() { return this.emptyMessage || this.config.translation.emptyMessage || ''; } get selectionMessageText() { return this.selectionMessage || this.config.translation.selectionMessage || ''; } get emptySelectionMessageText() { return this.emptySelectionMessage || this.config.translation.emptySelectionMessage || ''; } get selectedMessageText() { return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText; } visibleOptions = computed(() => { const processedOption = this.activeOptionPath().find((p) => p.key === this.focusedOptionInfo().parentKey); return processedOption ? processedOption.children : this.processedOptions; }); label = computed(() => { const label = this.placeholder || 'p-emptylabel'; if (this.hasSelectedOption()) { const activeOptionPath = this.findOptionPathByValue(this.modelValue(), null); const processedOption = ObjectUtils.isNotEmpty(activeOptionPath) ? activeOptionPath[activeOptionPath.length - 1] : null; return processedOption ? this.getOptionLabel(processedOption.option) : label; } return label; }); get _label() { const label = this.placeholder || 'p-emptylabel'; if (this.hasSelectedOption()) { const activeOptionPath = this.findOptionPathByValue(this.modelValue(), null); const processedOption = ObjectUtils.isNotEmpty(activeOptionPath) ? activeOptionPath[activeOptionPath.length - 1] : null; return processedOption ? this.getOptionLabel(processedOption.option) : label; } return label; } ngOnChanges(changes: SimpleChanges): void { if (changes.options) { this.processedOptions = this.createProcessedOptions(changes.options.currentValue || []); this.updateModel(null); } } hasSelectedOption() { return ObjectUtils.isNotEmpty(this.modelValue()); } createProcessedOptions(options, level = 0, parent = {}, parentKey = '') { const processedOptions = []; options && options.forEach((option, index) => { const key = (parentKey !== '' ? parentKey + '_' : '') + index; const newOption = { option, index, level, key, parent, parentKey }; newOption['children'] = this.createProcessedOptions(this.getOptionGroupChildren(option, level), level + 1, newOption, key); processedOptions.push(newOption); }); return processedOptions; } onInputFocus(event: FocusEvent) { if (this.disabled) { // For screenreaders return; } this.focused = true; this.onFocus.emit(event); } onInputBlur(event: FocusEvent) { this.focused = false; this.focusedOptionInfo.set({ indeX: -1, level: 0, parentKey: '' }); this.searchValue = ''; this.onModelTouched(); this.onBlur.emit(event); } onInputKeyDown(event: KeyboardEvent) { if (this.disabled || this.loading) { event.preventDefault(); return; } const metaKey = event.metaKey || event.ctrlKey; switch (event.code) { case 'ArrowDown': this.onArrowDownKey(event); break; case 'ArrowUp': this.onArrowUpKey(event); break; case 'ArrowLeft': this.onArrowLeftKey(event); break; case 'ArrowRight': this.onArrowRightKey(event); break; case 'Home': this.onHomeKey(event); break; case 'End': this.onEndKey(event); break; case 'Space': this.onSpaceKey(event); break; case 'Enter': case 'NumpadEnter': this.onEnterKey(event); break; case 'Escape': this.onEscapeKey(event); break; case 'Tab': this.onTabKey(event); break; case 'Backspace': this.onBackspaceKey(event); break; case 'PageDown': case 'PageUp': case 'ShiftLeft': case 'ShiftRight': //NOOP break; default: if (!metaKey && ObjectUtils.isPrintableCharacter(event.key)) { !this.overlayVisible && this.show(); this.searchOptions(event, event.key); } break; } } onArrowDownKey(event) { const optionIndex = this.focusedOptionInfo().index !== -1 ? this.findNextOptionIndex(this.focusedOptionInfo().index) : this.findFirstFocusedOptionIndex(); this.changeFocusedOptionIndex(event, optionIndex); !this.overlayVisible && this.show(); event.preventDefault(); } onArrowUpKey(event) { if (event.altKey) { if (this.focusedOptionInfo().index !== -1) { const processedOption = this.visibleOptions[this.focusedOptionInfo().index]; const grouped = this.isProccessedOptionGroup(processedOption); !grouped && this.onOptionChange({ originalEvent: event, value: processedOption }); } this.overlayVisible && this.hide(); event.preventDefault(); } else { const optionIndex = this.focusedOptionInfo().index !== -1 ? this.findPrevOptionIndex(this.focusedOptionInfo().index) : this.findLastFocusedOptionIndex(); this.changeFocusedOptionIndex(event, optionIndex); !this.overlayVisible && this.show(); event.preventDefault(); } } onArrowLeftKey(event) { if (this.overlayVisible) { const processedOption = this.visibleOptions()[this.focusedOptionInfo().index]; const parentOption = this.activeOptionPath().find((p) => p.key === processedOption.parentKey); const matched = this.focusedOptionInfo().parentKey === '' || (parentOption && parentOption.key === this.focusedOptionInfo().parentKey); const root = ObjectUtils.isEmpty(processedOption.parent); if (matched) { const activeOptionPath = this.activeOptionPath().filter((p) => p.parentKey !== this.focusedOptionInfo().parentKey); this.activeOptionPath.set(activeOptionPath); } if (!root) { this.focusedOptionInfo.set({ index: -1, parentKey: parentOption ? parentOption.parentKey : '' }); this.searchValue = ''; this.onArrowDownKey(event); } event.preventDefault(); } } onArrowRightKey(event) { if (this.overlayVisible) { const processedOption = this.visibleOptions()[this.focusedOptionInfo().index]; const grouped = this.isProccessedOptionGroup(processedOption); if (grouped) { const matched = this.activeOptionPath().some((p) => processedOption.key === p.key); if (matched) { this.focusedOptionInfo.set({ index: -1, parentKey: processedOption.key }); this.searchValue = ''; this.onArrowDownKey(event); } else { this.onOptionChange({ originalEvent: event, value: processedOption }); } } event.preventDefault(); } } onHomeKey(event) { this.changeFocusedOptionIndex(event, this.findFirstOptionIndex()); !this.overlayVisible && this.show(); event.preventDefault(); } onEndKey(event) { this.changeFocusedOptionIndex(event, this.findLastOptionIndex()); !this.overlayVisible && this.show(); event.preventDefault(); } onEnterKey(event) { if (!this.overlayVisible) { this.onArrowDownKey(event); } else { if (this.focusedOptionInfo().index !== -1) { const processedOption = this.visibleOptions()[this.focusedOptionInfo().index]; const grouped = this.isProccessedOptionGroup(processedOption); this.onOptionChange({ originalEvent: event, value: processedOption }); !grouped && this.hide(); } } event.preventDefault(); } onSpaceKey(event) { this.onEnterKey(event); } onEscapeKey(event) { this.overlayVisible && this.hide(true); event.preventDefault(); } onTabKey(event) { if (this.focusedOptionInfo().index !== -1) { const processedOption = this.visibleOptions()[this.focusedOptionInfo().index]; const grouped = this.isProccessedOptionGroup(processedOption); !grouped && this.onOptionChange({ originalEvent: event, value: processedOption }); } this.overlayVisible && this.hide(); } onBackspaceKey(event) { if (ObjectUtils.isNotEmpty(this.modelValue()) && this.showClear) { this.clear(); } event.stopPropagation(); } equalityKey() { return this.optionValue ? null : this.dataKey; } updateModel(value, event?) { this.value = value; this.onModelChange(value); this.modelValue.set(value); this.onChange.emit({ originalEvent: event, value: value }); } autoUpdateModel() { if (this.selectOnFocus && this.autoOptionFocus && !this.hasSelectedOption()) { this.focusedOptionInfo().index = this.findFirstFocusedOptionIndex(); this.onOptionChange({ originalEvent: null, processedOption: this.visibleOptions()[this.focusedOptionInfo().index], isHide: false }); !this.overlayVisible && this.focusedOptionInfo.set({ index: -1, level: 0, parentKey: '' }); } } scrollInView(index = -1) { const id = index !== -1 ? `${this.id}_${index}` : this.focusedOptionId; const element = DomHandler.findSingle(this.panelViewChild?.nativeElement, `li[id="${id}"]`); if (element) { element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'start' }); } } changeFocusedOptionIndex(event, index) { if (this.focusedOptionInfo().index !== index) { const focusedOptionInfo = this.focusedOptionInfo(); this.focusedOptionInfo.set({ ...focusedOptionInfo, index }); this.scrollInView(); } if (this.selectOnFocus) { this.onOptionChange({ originalEvent: event, processedOption: this.visibleOptions()[index], isHide: false }); } } onOptionChange(event) { const { originalEvent, value, isFocus, isHide } = event; if (ObjectUtils.isEmpty(value)) return; const { index, level, parentKey, children } = value; const grouped = ObjectUtils.isNotEmpty(children); const activeOptionPath = this.activeOptionPath().filter((p) => p.parentKey !== parentKey); activeOptionPath.push(value); this.focusedOptionInfo.set({ index, level, parentKey }); this.activeOptionPath.set(activeOptionPath); grouped ? this.onOptionGroupSelect({ originalEvent, value, isFocus: false }) : this.onOptionSelect({ originalEvent, value, isFocus }); isFocus && DomHandler.focus(this.focusInputViewChild.nativeElement); } onOptionSelect(event) { const { originalEvent, value, isFocus } = event; const newValue = this.getOptionValue(value.option); const activeOptionPath = this.activeOptionPath(); activeOptionPath.forEach((p) => (p.selected = true)); this.activeOptionPath.set(activeOptionPath); this.updateModel(newValue, originalEvent); isFocus && this.hide(true); } onOptionGroupSelect(event) { this.dirty = true; this.onGroupChange.emit(event); } onContainerClick(event: MouseEvent) { if (this.disabled || this.loading) { return; } if (!this.overlayViewChild?.el?.nativeElement?.contains(event.target)) { if (this.overlayVisible) { this.hide(); } else { this.show(); } this.focusInputViewChild?.nativeElement.focus(); } } isOptionMatched(processedOption) { return this.isValidOption(processedOption) && this.getProccessedOptionLabel(processedOption).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale)); } isOptionDisabled(option) { return this.optionDisabled ? ObjectUtils.resolveFieldData(option, this.optionDisabled) : false; } isValidOption(processedOption) { return !!processedOption && !this.isOptionDisabled(processedOption.option); } isValidSelectedOption(processedOption) { return this.isValidOption(processedOption) && this.isSelected(processedOption); } isSelected(processedOption) { return this.activeOptionPath().some((p) => p.key === processedOption.key); } findOptionPathByValue(value, processedOptions?, level = 0) { processedOptions = processedOptions || (level === 0 && this.processedOptions); if (!processedOptions) return null; if (ObjectUtils.isEmpty(value)) return []; for (let i = 0; i < processedOptions.length; i++) { const processedOption = processedOptions[i]; if (ObjectUtils.equals(value, this.getOptionValue(processedOption.option), this.equalityKey())) { return [processedOption]; } const matchedOptions = this.findOptionPathByValue(value, processedOption.children, level + 1); if (matchedOptions) { matchedOptions.unshift(processedOption); return matchedOptions; } } } findFirstOptionIndex() { return this.visibleOptions().findIndex((processedOption) => this.isValidOption(processedOption)); } findLastOptionIndex() { return ObjectUtils.findLastIndex(this.visibleOptions(), (processedOption) => this.isValidOption(processedOption)); } findNextOptionIndex(index) { const matchedOptionIndex = index < this.visibleOptions().length - 1 ? this.visibleOptions() .slice(index + 1) .findIndex((processedOption) => this.isValidOption(processedOption)) : -1; return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index; } findPrevOptionIndex(index) { const matchedOptionIndex = index > 0 ? ObjectUtils.findLastIndex(this.visibleOptions().slice(0, index), (processedOption) => this.isValidOption(processedOption)) : -1; return matchedOptionIndex > -1 ? matchedOptionIndex : index; } findSelectedOptionIndex() { return this.visibleOptions().findIndex((processedOption) => this.isValidSelectedOption(processedOption)); } findFirstFocusedOptionIndex() { const selectedIndex = this.findSelectedOptionIndex(); return selectedIndex < 0 ? this.findFirstOptionIndex() : selectedIndex; } findLastFocusedOptionIndex() { const selectedIndex = this.findSelectedOptionIndex(); return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex; } searchOptions(event, char) { this.searchValue = (this.searchValue || '') + char; let optionIndex = -1; let matched = false; const focusedOptionInfo = this.focusedOptionInfo(); if (focusedOptionInfo.index !== -1) { optionIndex = this.visibleOptions() .slice(focusedOptionInfo.index) .findIndex((processedOption) => this.isOptionMatched(processedOption)); optionIndex = optionIndex === -1 ? this.visibleOptions() .slice(0, focusedOptionInfo.index) .findIndex((processedOption) => this.isOptionMatched(processedOption)) : optionIndex + focusedOptionInfo.index; } else { optionIndex = this.visibleOptions().findIndex((processedOption) => this.isOptionMatched(processedOption)); } if (optionIndex !== -1) { matched = true; } if (optionIndex === -1 && focusedOptionInfo.index === -1) { optionIndex = this.findFirstFocusedOptionIndex(); } if (optionIndex !== -1) { this.changeFocusedOptionIndex(event, optionIndex); } if (this.searchTimeout) { clearTimeout(this.searchTimeout); } this.searchTimeout = setTimeout(() => { this.searchValue = ''; this.searchTimeout = null; }, 500); return matched; } hide(event?, isFocus = false) { const _hide = () => { this.overlayVisible = false; this.activeOptionPath.set([]); this.focusedOptionInfo.set({ index: -1, level: 0, parentKey: '' }); isFocus && DomHandler.focus(this.focusInputViewChild.nativeElement); this.onHide.emit(event); }; setTimeout(() => { _hide(); }, 0); // For ScreenReaders } show(event?, isFocus = false) { this.onShow.emit(event); this.overlayVisible = true; const activeOptionPath = this.hasSelectedOption() ? this.findOptionPathByValue(this.modelValue()) : this.activeOptionPath(); this.activeOptionPath.set(activeOptionPath); let focusedOptionInfo; if (this.hasSelectedOption() && ObjectUtils.isNotEmpty(this.activeOptionPath())) { const processedOption = this.activeOptionPath()[this.activeOptionPath().length - 1]; focusedOptionInfo = { index: this.autoOptionFocus ? processedOption.index : -1, level: processedOption.level, parentKey: processedOption.parentKey }; } else { focusedOptionInfo = { index: this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1, level: 0, parentKey: '' }; } this.focusedOptionInfo.set(focusedOptionInfo); isFocus && DomHandler.focus(this.focusInputViewChild.nativeElement); } clear(event?: MouseEvent) { if (ObjectUtils.isNotEmpty(this.modelValue()) && this.showClear) { this.updateModel(null); this.focusedOptionInfo.set({ index: -1, level: 0, parentKey: '' }); this.activeOptionPath.set([]); this.onClear.emit(); } event && event.stopPropagation(); } getOptionLabel(option) { return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option; } getOptionValue(option) { return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : option; } getOptionGroupLabel(optionGroup) { return this.optionGroupLabel ? ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel) : null; } getOptionGroupChildren(optionGroup, level) { return ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[level]); } isOptionGroup(option, level) { return Object.prototype.hasOwnProperty.call(option, this.optionGroupChildren[level]); } isProccessedOptionGroup(processedOption) { return ObjectUtils.isNotEmpty(processedOption.children); } getProccessedOptionLabel(processedOption) { const grouped = this.isProccessedOptionGroup(processedOption); return grouped ? this.getOptionGroupLabel(processedOption.option) : this.getOptionLabel(processedOption.option); } constructor(private el: ElementRef, private cd: ChangeDetectorRef, private config: PrimeNGConfig, public overlayService: OverlayService) { effect(() => { const activeOptionPath = this.activeOptionPath(); if (ObjectUtils.isNotEmpty(activeOptionPath)) { this.overlayViewChild.alignOverlay(); } }); } ngOnInit() { this.id = this.id || UniqueComponentId(); this.autoUpdateModel(); } ngAfterContentInit() { this.templates.forEach((item) => { switch (item.getType()) { case 'value': this.valueTemplate = item.template; break; case 'option': this.optionTemplate = item.template; break; case 'triggericon': this.triggerIconTemplate = item.template; break; case 'loadingicon': this.loadingIconTemplate = item.template; break; case 'clearicon': this.clearIconTemplate = item.template; break; case 'optiongroupicon': this.groupIconTemplate = item.template; break; } }); } onOverlayAnimationDone(event: AnimationEvent) { switch (event.toState) { case 'void': this.dirty = false; break; } } writeValue(value: any): void { this.value = value; this.updateModel(value); this.cd.markForCheck(); } registerOnChange(fn: Function): void { this.onModelChange = fn; } registerOnTouched(fn: Function): void { this.onModelTouched = fn; } setDisabledState(val: boolean): void { this.disabled = val; this.cd.markForCheck(); } } @NgModule({ imports: [CommonModule, OverlayModule, SharedModule, RippleModule, AutoFocusModule, ChevronDownIcon, AngleRightIcon, TimesIcon], exports: [CascadeSelect, OverlayModule, CascadeSelectSub, SharedModule], declarations: [CascadeSelect, CascadeSelectSub] }) export class CascadeSelectModule {} ```
/content/code_sandbox/src/app/components/cascadeselect/cascadeselect.ts
xml
2016-01-16T09:23:28
2024-08-16T19:58:20
primeng
primefaces/primeng
9,969
10,546
```xml import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' import { FunctionComponent, ReactNode } from 'react' import RadioIndicator from '../Radio/RadioIndicator' type HistoryListItemProps = { isSelected: boolean onClick: () => void children?: ReactNode } const HistoryListItem: FunctionComponent<HistoryListItemProps> = ({ children, isSelected, onClick }) => { return ( <button tabIndex={FOCUSABLE_BUT_NOT_TABBABLE} className={`flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-2.5 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none ${ isSelected ? 'bg-info-backdrop' : '' }`} onClick={onClick} data-selected={isSelected} > <RadioIndicator checked={isSelected} className="mr-2" /> {children} </button> ) } export default HistoryListItem ```
/content/code_sandbox/packages/web/src/javascripts/Components/RevisionHistoryModal/HistoryListItem.tsx
xml
2016-12-05T23:31:33
2024-08-16T06:51:19
app
standardnotes/app
5,180
212
```xml import { BigNumber as EthersBN } from '@ethersproject/bignumber'; import Bignumber from 'bignumber.js'; import BN from 'bn.js'; import { bigify, isBigish } from './bigify'; describe('isBigish()', () => { test('a string is not bigish', () => { expect(isBigish('42')).toBeFalsy(); }); test('a number is not bigish', () => { expect(isBigish(42)).toBeFalsy(); }); test('an object is not bigish', () => { expect(isBigish({})).toBeFalsy(); }); test('a BN is bigish', () => { const value = new BN('42'); expect(isBigish(value)).toEqual(true); }); test('a Bignumber is bigish', () => { const value = new Bignumber('42'); expect(isBigish(value)).toEqual(true); }); test('a BigNumberish is a bigish', () => { const value = EthersBN.from('42'); expect(isBigish(value)).toEqual(true); }); }); describe('bigify', () => { test('bigify supports very big numbers and decimals', () => { const input = '99999999999999999999999999999999999.999999999999999999999999999999'; expect(bigify(input).toString()).toEqual(input); }); test('bigify supports very big numbers with e notation', () => { const input = '2.297630401626e+22'; expect(bigify(input).toString()).toEqual('22976304016260000000000'); }); }); ```
/content/code_sandbox/src/utils/bigify.spec.ts
xml
2016-12-04T01:35:27
2024-08-14T21:41:58
MyCrypto
MyCryptoHQ/MyCrypto
1,347
360
```xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url"> <parent> <groupId>com.ctrip.framework.xpipe</groupId> <artifactId>services</artifactId> <version>1.2.15</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>ctrip-integration-test</artifactId> <properties> <testcontainers.version>1.15.3</testcontainers.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>net.java.dev.jna</groupId> <artifactId>jna</artifactId> <version>5.8.0</version> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>com.ctrip.framework.xpipe</groupId> <artifactId>ctrip-service</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.ctrip.framework.xpipe</groupId> <artifactId>core</artifactId> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>com.ctrip.framework.xpipe.redis</groupId> <artifactId>redis-integration-test</artifactId> <type>test-jar</type> <scope>test</scope> <version>${project.version}</version> </dependency> <dependency> <groupId>com.ctrip.framework.xpipe.redis</groupId> <artifactId>redis-console</artifactId> <type>test-jar</type> <version>${project.version}</version> </dependency> <dependency> <groupId>com.ctrip.framework.xpipe.redis</groupId> <artifactId>redis-checker</artifactId> <version>${project.version}</version> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>com.ctrip.framework.xpipe.redis</groupId> <artifactId>redis-core</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.ctrip.framework.xpipe.redis</groupId> <artifactId>redis-keeper</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.ctrip.framework.xpipe.redis</groupId> <artifactId>redis-meta</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.ctrip.framework.xpipe.redis</groupId> <artifactId>redis-meta</artifactId> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>com.ctrip.framework.xpipe.redis</groupId> <artifactId>redis-console</artifactId> </dependency> <dependency> <groupId>com.ctrip.framework.xpipe.redis</groupId> <artifactId>redis-checker</artifactId> <scope>test</scope> <version>${project.version}</version> </dependency> <dependency> <groupId>com.ctrip.framework.xpipe.redis</groupId> <artifactId>redis-core</artifactId> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-exec</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.unidal.framework</groupId> <artifactId>test-framework</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.curator</groupId> <artifactId>curator-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.testcontainers</groupId> <artifactId>testcontainers</artifactId> <version>${testcontainers.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.testcontainers</groupId> <artifactId>mysql</artifactId> <version>${testcontainers.version}</version> <scope>test</scope> </dependency> </dependencies> </project> ```
/content/code_sandbox/services/ctrip-integration-test/pom.xml
xml
2016-03-29T12:22:36
2024-08-12T11:25:42
x-pipe
ctripcorp/x-pipe
1,977
1,141
```xml export const logger = { setLogLevel: jest.fn(), debug: jest.fn(), log: jest.fn(), info: jest.fn(), warn: jest.fn(), error: jest.fn(), }; ```
/content/code_sandbox/pmm-app/src/shared/core/__mocks__/logger.ts
xml
2016-01-22T07:14:23
2024-08-13T13:01:59
grafana-dashboards
percona/grafana-dashboards
2,661
44
```xml const clientPortalCommentsAdd = ` mutation clientPortalCommentsAdd( $typeId: String! $type: String! $content: String! $userType: String! ) { clientPortalCommentsAdd( typeId: $typeId type: $type content: $content userType: $userType ) { _id } } `; const clientPortalCommentsRemove = ` mutation clientPortalCommentsRemove( $_id: String! ) { clientPortalCommentsRemove( _id: $_id ) } `; export default { clientPortalCommentsAdd, clientPortalCommentsRemove }; ```
/content/code_sandbox/packages/ui-tasks/src/comment/graphql/mutations.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
146
```xml /* * Squidex Headless CMS * * @license */ import { AsyncPipe } from '@angular/common'; import { ChangeDetectionStrategy, Component } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { AddRoleForm, ControlErrorsComponent, FormHintComponent, RolesState, TranslatePipe } from '@app/shared'; @Component({ standalone: true, selector: 'sqx-role-add-form', styleUrls: ['./role-add-form.component.scss'], templateUrl: './role-add-form.component.html', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ AsyncPipe, ControlErrorsComponent, FormHintComponent, FormsModule, ReactiveFormsModule, TranslatePipe, ], }) export class RoleAddFormComponent { public addRoleForm = new AddRoleForm(); constructor( private readonly rolesState: RolesState, ) { } public addRole() { const value = this.addRoleForm.submit(); if (value) { this.rolesState.add(value) .subscribe({ next: () => { this.addRoleForm.submitCompleted(); }, error: error => { this.addRoleForm.submitFailed(error); }, }); } } public cancel() { this.addRoleForm.submitCompleted(); } } ```
/content/code_sandbox/frontend/src/app/features/settings/pages/roles/role-add-form.component.ts
xml
2016-08-29T05:53:40
2024-08-16T17:39:38
squidex
Squidex/squidex
2,222
276
```xml export const data = { labels: [ 'Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running' ], datasets: [ { label: 'My First dataset', backgroundColor: 'rgba(179,181,198,0.2)', borderColor: 'rgba(179,181,198,1)', pointBackgroundColor: 'rgba(179,181,198,1)', pointBorderColor: '#fff', pointHoverBackgroundColor: '#fff', pointHoverBorderColor: 'rgba(179,181,198,1)', data: [65, 59, 90, 81, 56, 55, 40] }, { label: 'My Second dataset', backgroundColor: 'rgba(255,99,132,0.2)', borderColor: 'rgba(255,99,132,1)', pointBackgroundColor: 'rgba(255,99,132,1)', pointBorderColor: '#fff', pointHoverBackgroundColor: '#fff', pointHoverBorderColor: 'rgba(255,99,132,1)', data: [28, 48, 40, 19, 96, 27, 100] } ] } export const options = { responsive: true, maintainAspectRatio: false } ```
/content/code_sandbox/sandboxes/radar/src/chartConfig.ts
xml
2016-06-26T13:25:12
2024-08-15T18:05:48
vue-chartjs
apertureless/vue-chartjs
5,514
293
```xml import React, { ReactNode, useRef } from 'react'; import cx from 'clsx'; import { ItemParams, InternalProps, BooleanPredicate, HandlerParamsEvent, BuiltInOrString, } from '../types'; import { useItemTrackerContext } from './ItemTrackerProvider'; import { NOOP, CssClass } from '../constants'; import { getPredicateValue, isFn } from './utils'; import { contextMenu } from '../core'; export interface ItemProps extends InternalProps, Omit<React.HTMLAttributes<HTMLElement>, 'hidden' | 'disabled' | 'onClick'> { /** * Any valid node that can be rendered */ children: ReactNode; /** * Passed to the `Item` onClick callback. Accessible via `data` */ data?: any; /** * Disable `Item`. If a function is used, a boolean must be returned * * @param id The item id, when defined * @param props The props passed when you called `show(e, {props: yourProps})` * @param data The data defined on the `Item` * @param triggerEvent The event that triggered the context menu * * * ``` * function isItemDisabled({ triggerEvent, props, data }: PredicateParams<type of props, type of data>): boolean * <Item disabled={isItemDisabled} data={data}>content</Item> * ``` */ disabled?: BooleanPredicate; /** * Hide the `Item`. If a function is used, a boolean must be returned * * @param id The item id, when defined * @param props The props passed when you called `show(e, {props: yourProps})` * @param data The data defined on the `Item` * @param triggerEvent The event that triggered the context menu * * * ``` * function isItemHidden({ triggerEvent, props, data }: PredicateParams<type of props, type of data>): boolean * <Item hidden={isItemHidden} data={data}>content</Item> * ``` */ hidden?: BooleanPredicate; /** * Callback when the `Item` is clicked. * * @param id The item id, when defined * @param event The event that occured on the Item node * @param props The props passed when you called `show(e, {props: yourProps})` * @param data The data defined on the `Item` * @param triggerEvent The event that triggered the context menu * * ``` * function handleItemClick({ id, triggerEvent, event, props, data }: ItemParams<type of props, type of data>){ * // retrieve the id of the Item * console.log(id) // item-id * * // access any other dom attribute * console.log(event.currentTarget.dataset.foo) // 123 * * // access the props and the data * console.log(props, data); * * // access the coordinate of the mouse when the menu has been displayed * const { clientX, clientY } = triggerEvent; * } * * <Item id="item-id" onClick={handleItemClick} data={{key: 'value'}} data-foo={123} >Something</Item> * ``` */ onClick?: (args: ItemParams) => void; /** * Let you implement keyboard shortcut for the menu item. It will trigger the * `onClick` hander if the given callback returns `true` * * example: * * ``` * function handleShortcut(e: React.KeyboardEvent<HTMLElement>){ * // let's say we want to match + c * return e.metaKey && e.key === "c"; * } * * <Item onClick={doSomething}>Copy <RightSlot> C</RightSlot></Item> * ``` */ keyMatcher?: (e: KeyboardEvent) => boolean; /** * Useful when using form input inside the Menu * * default: `true` */ closeOnClick?: boolean; /** * Let you specify another event for the `onClick` handler * * default: `onClick` */ handlerEvent?: BuiltInOrString<'onClick' | 'onMouseDown' | 'onMouseUp'>; } export const Item: React.FC<ItemProps> = ({ id, children, className, style, triggerEvent, data, propsFromTrigger, keyMatcher, onClick = NOOP, disabled = false, hidden = false, closeOnClick = true, handlerEvent = 'onClick', ...rest }) => { const itemNode = useRef<HTMLElement>(); const itemTracker = useItemTrackerContext(); const handlerParams = { id, data, triggerEvent: triggerEvent as HandlerParamsEvent, props: propsFromTrigger, } as ItemParams; const isDisabled = getPredicateValue(disabled, handlerParams); const isHidden = getPredicateValue(hidden, handlerParams); function handleClick(e: React.MouseEvent<HTMLElement>) { handlerParams.event = e; e.stopPropagation(); if (!isDisabled) { !closeOnClick ? onClick(handlerParams) : dispatchUserHanlder(); } } // provide a feedback to the user that the item has been clicked before closing the menu function dispatchUserHanlder() { const node = itemNode.current!; node.focus(); node.addEventListener( 'animationend', // defer, required for react 17 () => setTimeout(contextMenu.hideAll), { once: true } ); node.classList.add(CssClass.itemClickedFeedback); onClick(handlerParams); } function registerItem(node: HTMLElement | null) { if (node && !isDisabled) { itemNode.current = node; itemTracker.set(node, { node, isSubmenu: false, keyMatcher: !isDisabled && isFn(keyMatcher) && ((e: KeyboardEvent) => { if (keyMatcher(e)) { e.stopPropagation(); e.preventDefault(); handlerParams.event = e; dispatchUserHanlder(); } }), }); } } function handleKeyDown(e: React.KeyboardEvent<HTMLElement>) { if (e.key === 'Enter' || e.key === ' ') { e.stopPropagation(); handlerParams.event = e; dispatchUserHanlder(); } } if (isHidden) return null; return ( <div {...{ ...rest, [handlerEvent]: handleClick }} className={cx(CssClass.item, className, { [`${CssClass.itemDisabled}`]: isDisabled, })} style={style} onKeyDown={handleKeyDown} ref={registerItem} tabIndex={-1} role="menuitem" aria-disabled={isDisabled} > <div className={CssClass.itemContent}>{children}</div> </div> ); }; ```
/content/code_sandbox/src/components/Item.tsx
xml
2016-06-20T06:32:23
2024-08-07T16:41:03
react-contexify
fkhadra/react-contexify
1,138
1,535
```xml <!-- ~ contributor license agreements. See the NOTICE file distributed with ~ this work for additional information regarding copyright ownership. ~ ~ path_to_url ~ ~ Unless required by applicable law or agreed to in writing, software ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <dataset> <metadata> <column name="object_catalog"/> <column name="object_schema"/> <column name="object_name"/> <column name="object_type"/> <column name="dtd_identifier"/> </metadata> </dataset> ```
/content/code_sandbox/test/e2e/sql/src/test/resources/cases/dql/dataset/empty_storage_units/opengauss/select_opengauss_information_schema_data_type_privileges.xml
xml
2016-01-18T12:49:26
2024-08-16T15:48:11
shardingsphere
apache/shardingsphere
19,707
127
```xml import * as React from 'react'; import * as strings from 'AppInsightsDashboardWebPartStrings'; import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder"; import { DisplayMode } from '@microsoft/sp-core-library'; import { HttpClient } from '@microsoft/sp-http'; import PageViews from '../../../common/components/PageViews'; import UserStatistics from '../../../common/components/UserStatistics'; import PerformanceStatistics from '../../../common/components/PerformanceStatistics'; import Helper from '../../../common/Helper'; import styles from './AppInsightsDashboard.module.scss'; export interface IAppInsightsDashboardProps { AppId: string; AppKey: string; DisplayMode: DisplayMode; onConfigure: () => void; httpClient: HttpClient; cultureName:string; } export const AppInsightsProps = React.createContext<IAppInsightsDashboardProps>(null); const AppInsightsDashboard: React.FunctionComponent<IAppInsightsDashboardProps> = (props) => { const [helper, setHelper] = React.useState<Helper>(null); //KK React.useEffect(() => { setHelper(new Helper(props.AppId, props.AppKey, props.httpClient, props.cultureName)); }, [props.AppId, props.AppKey]); return ( <AppInsightsProps.Provider value={props}> <div className={styles.appInsightsDashboard}> <div className={styles.container}> {(!props.AppId || !props.AppKey) ? ( <Placeholder iconName='Edit' iconText={strings.Config_IconText} description={props.DisplayMode === DisplayMode.Edit ? strings.Config_Desc : strings.Config_Desc_ReadMode} buttonLabel={strings.Config_ButtonText} hideButton={props.DisplayMode === DisplayMode.Read} onConfigure={props.onConfigure} /> ) : ( <> <div className={styles.row}> <PageViews helper={helper} /> </div> <div className={styles.row}> <UserStatistics helper={helper} /> </div> <div className={styles.row}> <PerformanceStatistics helper={helper} /> </div> </> )} </div> </div> </AppInsightsProps.Provider> ); }; export default AppInsightsDashboard; ```
/content/code_sandbox/samples/react-appinsights-dashboard/src/webparts/appInsightsDashboard/components/AppInsightsDashboard.tsx
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
487
```xml <?xml version="1.0" encoding="utf-8"?> <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"> <file datatype="xml" source-language="en" target-language="ja" original="../LocalizableStrings.resx"> <body> <trans-unit id="CommandDescription"> <source>List workloads available.</source> <target state="translated"></target> <note /> </trans-unit> <trans-unit id="WorkloadListFooter"> <source>Use `dotnet workload search` to find additional workloads to install.</source> <target state="translated">`dotnet workload search` </target> <note>{Locked="dotnet workload search"}</note> </trans-unit> <trans-unit id="WorkloadSetFromGlobalJsonInstalled"> <source>Found workload version {0} pinned in the global.json file at {1}.</source> <target state="translated">{1} global.json {0} </target> <note /> </trans-unit> <trans-unit id="WorkloadSetFromGlobalJsonNotInstalled"> <source>Found workload version {0} pinned in the global.json file at {1}, but it was not installed. Running `dotnet workload install`, `dotnet workload update`, or `dotnet workload restore` may fix this.</source> <target state="translated">{1} global.json {0} 'dotnet workload install''dotnet workload update' 'dotnet workload restore' </target> <note /> </trans-unit> <trans-unit id="WorkloadSetVersion"> <source>Workload version: {0}</source> <target state="translated">: {0}</target> <note /> </trans-unit> <trans-unit id="WorkloadUpdatesAvailable"> <source>Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest.</source> <target state="translated">: {0}`dotnet workload update` </target> <note>{Locked="dotnet workload update"}</note> </trans-unit> </body> </file> </xliff> ```
/content/code_sandbox/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ja.xlf
xml
2016-07-22T21:26:02
2024-08-16T17:23:58
sdk
dotnet/sdk
2,627
528
```xml <!-- ~ Nextcloud - Android Client ~ --> <vector xmlns:android="path_to_url" android:width="108dp" android:height="108dp" android:viewportWidth="1594.7866" android:viewportHeight="1594.7866"> <group android:translateX="265.39328" android:translateY="280.15982"> <path android:pathData="M532.7,320C439.3,320 360.9,383.9 337,469.9 316.1,423.9 270.1,391.3 216.6,391.3 143.8,391.3 84,451.2 84,524c-0,72.8 59.8,132.6 132.6,132.7 53.5,-0 99.4,-32.6 120.4,-78.6 23.9,86 102.4,149.9 195.7,149.9 92.8,0 170.8,-63.2 195.3,-148.5 21.2,45.1 66.5,77.2 119.4,77.2 72.8,0 132.7,-59.8 132.6,-132.7 -0,-72.8 -59.9,-132.6 -132.6,-132.6 -52.8,0 -98.2,32 -119.4,77.2 -24.4,-85.3 -102.4,-148.5 -195.3,-148.5zM532.7,397.9c70.1,0 126.1,56 126.1,126.1 0,70.1 -56,126.1 -126.1,126.1 -70.1,-0 -126.1,-56 -126.1,-126.1 0,-70.1 56,-126.1 126.1,-126.1zM216.6,469.2c30.7,0 54.8,24.1 54.8,54.8 0,30.7 -24,54.8 -54.8,54.8 -30.7,0 -54.8,-24.1 -54.8,-54.8 0,-30.7 24.1,-54.8 54.8,-54.8zM847.4,469.2c30.7,-0 54.8,24.1 54.8,54.8 0,30.7 -24.1,54.8 -54.8,54.8 -30.7,0 -54.8,-24.1 -54.8,-54.8 0,-30.7 24.1,-54.8 54.8,-54.8z" android:fillType="nonZero" android:fillColor="#ffffff" /> <path android:fillColor="#ffffff" android:fillType="evenOdd" android:pathData="m522,865.2q0,11.4 -4,21 -4,9.7 -11.2,16.4l19.7,18.6 -10.8,10.3 -22.1,-20.5q-4.5,1.8 -9.4,2.7 -4.8,1 -9.9,1 -20.4,0 -33.2,-14.1 -12.7,-14.1 -12.7,-35.4v-20.7q0,-21.3 12.7,-35.4 12.8,-14.1 33.2,-14.1 21.1,0 34.3,14.1 13.3,14.1 13.3,35.4zM506.2,844.4q0,-16 -8.6,-26.2 -8.6,-10.2 -23.2,-10.2 -13.7,0 -22,10.2 -8.2,10.2 -8.2,26.2v20.9q0,16.1 8.2,26.4 8.2,10.2 22,10.2 14.6,0 23.2,-10.2 8.6,-10.2 8.6,-26.5z" android:strokeWidth="8.18538094" android:strokeColor="#00000000" android:strokeLineCap="butt" android:strokeLineJoin="miter" /> <path android:fillColor="#ffffff" android:fillType="evenOdd" android:pathData="m608.5,883.1h-48.8l-11,30h-16.1l45,-116.4h13.5L635.5,913L619.4,913ZM564.7,869.9L603.8,869.9L584.6,816.9h-0.5z" android:strokeWidth="8.18538094" android:strokeColor="#00000000" android:strokeLineCap="butt" android:strokeLineJoin="miter" /> </group> </vector> ```
/content/code_sandbox/app/src/qa/res/drawable/ic_launcher_foreground.xml
xml
2016-06-06T21:23:36
2024-08-16T18:22:36
android
nextcloud/android
4,122
1,188
```xml import { database as db } from '../common/database'; import { type BaseModel, workspace } from './index'; export const name = 'Mock Server'; export const type = 'MockServer'; export const prefix = 'mock'; export const canDuplicate = true; export const canSync = true; interface BaseMockServer { parentId: string; name: string; url: string; useInsomniaCloud: boolean; } export type MockServer = BaseModel & BaseMockServer; export function init(): BaseMockServer { return { parentId: '', name: 'New Mock', url: 'path_to_url useInsomniaCloud: true, }; } export const isMockServer = (model: Pick<BaseModel, 'type'>): model is MockServer => ( model.type === type ); export function migrate(doc: MockServer) { return doc; } export function create(patch: Partial<MockServer> = {}) { if (!patch.parentId) { throw new Error('New MockServer missing `parentId`: ' + JSON.stringify(patch)); } return db.docCreate<MockServer>(type, patch); } export async function getOrCreateForParentId( workspaceId: string, patch: Partial<MockServer> = {}, ) { const mockServer = await db.getWhere<MockServer>(type, { parentId: workspaceId, }); if (!mockServer) { return db.docCreate<MockServer>(type, { ...patch, parentId: workspaceId }); } return mockServer; } export function update( mockServer: MockServer, patch: Partial<MockServer> = {}, ) { return db.docUpdate<MockServer>(mockServer, patch); } export function getById(id: string) { return db.get<MockServer>(type, id); } export function getByParentId(parentId: string) { return db.getWhere<MockServer>(type, { parentId }); } export async function findByProjectId(projectId: string) { const workspaces = await workspace.findByParentId(projectId); return db.find<MockServer>(type, { parentId: { $in: workspaces.map(ws => ws._id) } }); } export function removeWhere(parentId: string) { return db.removeWhere(type, { parentId }); } export function remove(mockServer: MockServer) { return db.remove(mockServer); } export function all() { return db.all<MockServer>(type); } ```
/content/code_sandbox/packages/insomnia/src/models/mock-server.ts
xml
2016-04-23T03:54:26
2024-08-16T16:50:44
insomnia
Kong/insomnia
34,054
520
```xml // eslint-disable-next-line import/no-relative-packages import twosky from '../../../.twosky.json'; export const LANGUAGES = twosky[0].languages; export const BASE_LOCALE = twosky[0].base_locale; ```
/content/code_sandbox/client/src/helpers/twosky.ts
xml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
52
```xml import { Checkbox } from '@fluentui/react-northstar'; import * as React from 'react'; const CheckboxExampleDisabled = () => ( <> <Checkbox disabled label="Disabled" /> <Checkbox disabled checked label="Disabled & Checked" /> <br /> <Checkbox toggle disabled label="Disabled" /> <Checkbox toggle disabled checked label="Disabled & Checked" /> </> ); export default CheckboxExampleDisabled; ```
/content/code_sandbox/packages/fluentui/docs/src/examples/components/Checkbox/States/CheckboxExampleDisabled.shorthand.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
90
```xml import React, { type JSX } from 'react' import api from '@lib/api' export default function ResolveOrder(): JSX.Element { return <div>{api()}</div> } ```
/content/code_sandbox/test/integration/typescript-paths/pages/resolve-order.tsx
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
38