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
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net$(BundledNETCoreAppTargetFrameworkVersion)</TargetFramework>
<RootNamespace>Xharness.Tests</RootNamespace>
<AssemblyName>Xharness.Tests</AssemblyName>
<LangVersion>latest</LangVersion>
<EnableDefaultItems>false</EnableDefaultItems>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<!--<Nullable>enable</Nullable>-->
</PropertyGroup>
<ItemGroup>
<Compile Include="Jenkins\ErrorKnowledgeBaseTests.cs" />
<Compile Include="TestImporter\Templates\Tests\PListExtensionsTests.cs" />
<Compile Include="TestImporter\Tests\ProjectDefinitionTests.cs" />
<Compile Include="Tests\BCLTestImportTargetFactoryTest.cs" />
<Compile Include="TestImporter\Xamarin\Tests\TestAssemblyDefinitionTest.cs" />
<Compile Include="Tests\AppRunnerTests.cs" />
<Compile Include="TestImporter\Xamarin\Tests\ProjectFilterTest.cs" />
<Compile Include="TestImporter\Xamarin\Tests\AssemblyLocatorTest.cs" />
<Compile Include="TestImporter\Xamarin\Tests\XamariniOSTemplateTest.cs" />
<Compile Include="Jenkins\ITestTaskExtensionsTests.cs" />
<Compile Include="Tests\TestTargetExtensionsTests.cs" />
<Compile Include="Tests\TestPlatformExtensionsTests.cs" />
<Compile Include="Jenkins\MarkdownReportWriterTests.cs" />
<Compile Include="Tests\MacFlavorsExtensionsTests.cs" />
<Compile Include="Jenkins\MakeTestTaskEnumerableTests.cs" />
<Compile Include="Jenkins\NUnitTestTasksEnumerableTests.cs" />
<Compile Include="Jenkins\JenkinsDeviceLoadterTests.cs" />
<Compile Include="Jenkins\ResourceManagerTests.cs" />
<Compile Include="Jenkins\PeriodicCommandTests.cs" />
<Compile Include="Jenkins\TestSelectionTests.cs" />
<Compile Include="Jenkins\TestSelectorTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<EmbeddedResource Include="Samples\TestProject\Info.plist">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<None Include="Samples\TestProject\SystemXunit.csproj">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Samples\NUnitV2Sample.xml" />
<EmbeddedResource Include="Samples\NUnitV3Sample.xml" />
<EmbeddedResource Include="Samples\TouchUnitSample.xml" />
<EmbeddedResource Include="Samples\xUnitSample.xml" />
<EmbeddedResource Include="Samples\devices.xml" />
<EmbeddedResource Include="Samples\simulators.xml" />
<EmbeddedResource Include="Samples\run-log.txt" />
<EmbeddedResource Include="Samples\NUnitV3SampleSuccess.xml" />
<EmbeddedResource Include="Samples\NUnitV3SampleFailure.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\xharness.csproj">
<Project>{e1f53f80-8399-499b-8017-c414b9cd263b}</Project>
<Name>xharness</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.XHarness.iOS.Shared" Version="$(MicrosoftDotNetXHarnessiOSSharedPackageVersion)" />
<PackageReference Include="Mono.Cecil" Version="$(MonoCecilPackageVersion)" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
``` | /content/code_sandbox/tests/xharness/Xharness.Tests/Xharness.Tests.csproj | xml | 2016-04-20T18:24:26 | 2024-08-16T13:29:19 | xamarin-macios | xamarin/xamarin-macios | 2,436 | 909 |
```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 {AnalysisDurationChartEntry} from 'types';
import VariablesTable from './VariablesTable';
import OutlierDetailsModal from './OutlierDetailsModal';
import {OutlierNode, AnalysisProcessDefinitionParameters} from './service';
const selectedOutlierNode = {
name: 'test',
higherOutlier: {
count: 4,
relation: 1.1,
},
data: [
{key: 1, value: 1, outlier: false},
{key: 2, value: 2, outlier: true},
] as AnalysisDurationChartEntry[],
totalCount: 123,
} as OutlierNode;
const props = {
selectedOutlierNode,
onClose: jest.fn(),
config: {} as AnalysisProcessDefinitionParameters,
};
it('should pass outlier data to DurationChart and VariablesTable', () => {
const node = shallow(<OutlierDetailsModal {...props} />);
expect(node.find('DurationChart').prop('data')).toEqual(selectedOutlierNode.data);
expect(node.find('DurationChart').prop('colors')).toEqual(['#eeeeee', '#1991c8']);
expect(node.find(VariablesTable).prop('selectedOutlierNode')).toEqual(selectedOutlierNode);
});
``` | /content/code_sandbox/optimize/client/src/components/Analysis/TaskAnalysis/OutlierDetailsModal.test.tsx | xml | 2016-03-20T03:38:04 | 2024-08-16T19:59:58 | camunda | camunda/camunda | 3,172 | 297 |
```xml
<vector xmlns:android="path_to_url"
xmlns:aapt="path_to_url"
android:width="76dp"
android:height="64dp"
android:viewportWidth="76"
android:viewportHeight="64">
<group>
<clip-path
android:pathData="M0,0h76v64h-76z"/>
<path
android:pathData="M0,6C0,2.6863 2.6863,0 6,0L70,0C73.3137,0 76,2.6863 76,6V58C76,61.3137 73.3137,64 70,64H6C2.6863,64 0,61.3137 0,58V6Z"
android:fillType="evenOdd">
<aapt:attr name="android:fillColor">
<gradient
android:startY="64"
android:startX="76"
android:endY="0"
android:endX="76"
android:type="linear">
<item android:offset="0" android:color="#FFEB1C5C"/>
<item android:offset="1" android:color="#FFE301CA"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M6.0003,2.0001C3.7911,2.0001 2.0003,3.791 2.0003,6.0001V58C2.0003,60.2091 3.7911,62 6.0003,62H70C72.2091,62 74,60.2091 74,58L73.9997,6C73.9997,3.7908 72.2089,2 69.9997,2L6.0003,2.0001ZM46.9378,13.5055C47.7361,13.8392 48.4614,14.3283 49.0723,14.945C49.6834,15.5613 50.1682,16.293 50.499,17.0984C50.8297,17.9039 51,18.7671 51,19.6389C51,20.5108 50.8297,21.374 50.499,22.1794C50.1682,22.9848 49.6834,23.7166 49.0723,24.3329L47.8045,25.612L39.3652,34.1267C38.8884,34.6077 38.1109,34.6077 37.6341,34.1267L29.1948,25.612L27.9271,24.3329C26.6932,23.088 26,21.3995 26,19.6389C26,17.8784 26.6932,16.1899 27.9271,14.945C29.161,13.7 30.8345,13.0006 32.5795,13.0006C34.3245,13.0006 35.998,13.7 37.2319,14.945L38.4997,16.224L39.7674,14.945C40.3783,14.3283 41.1036,13.8392 41.9019,13.5055C42.7001,13.1718 43.5558,13 44.4198,13C45.2839,13 46.1396,13.1718 46.9378,13.5055Z"
android:fillType="evenOdd">
<aapt:attr name="android:fillColor">
<gradient
android:startY="2"
android:startX="2.00027"
android:endY="68"
android:endX="2.00027"
android:type="linear">
<item android:offset="0" android:color="#F2FFFFFF"/>
<item android:offset="1" android:color="#FFFFFFFF"/>
</gradient>
</aapt:attr>
</path>
</group>
</vector>
``` | /content/code_sandbox/app/src/main/res/drawable/ic_category_favourites.xml | xml | 2016-05-04T11:46:20 | 2024-08-15T16:29:10 | android | meganz/android | 1,537 | 960 |
```xml
import { Code } from "./code";
export abstract class Viewlet {
constructor(protected code: Code) { }
public async waitForTitle(fn: (title: string) => boolean): Promise<void> {
await this.code.waitForTextContent(".monaco-workbench .part.sidebar > .title > .title-label > h2", undefined, fn);
}
}
``` | /content/code_sandbox/test/smoke/automation/src/viewlet.ts | xml | 2016-01-20T21:10:07 | 2024-08-16T15:29:52 | vscode-react-native | microsoft/vscode-react-native | 2,617 | 78 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="path_to_url"
xmlns:tools="path_to_url"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="@color/colorPrimary"
android:gravity="bottom"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
tools:ignore="Overdraw">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/cd_app_icon"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:src="@drawable/ic_view_day_black_48dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="@string/app_name"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
</LinearLayout>
``` | /content/code_sandbox/app/src/main/res/layout/nav_header_home.xml | xml | 2016-02-07T19:27:52 | 2024-07-19T03:29:48 | SectionedRecyclerViewAdapter | luizgrp/SectionedRecyclerViewAdapter | 1,678 | 304 |
```xml
import { makeSelectDeletingEntity } from 'features/shared/deletion';
import { initialCommunication } from 'shared/utils/redux/communication';
import { IApplicationState } from '../../../setup/store/store';
import { IDatasetsState } from './types';
const selectState = (state: IApplicationState): IDatasetsState =>
state.datasets;
export const selectDatasets = (state: IApplicationState) =>
selectState(state).data.datasets;
export const selectCommunications = (state: IApplicationState) =>
selectState(state).communications;
export const selectDatasetIdsForDeleting = (state: IApplicationState) => {
return selectState(state).data.datasetIdsForDeleting;
};
export const selectDeletingDataset = makeSelectDeletingEntity({
selectEntityIdsForDeleting: selectDatasetIdsForDeleting,
selectBulkDeleting: state => selectCommunications(state).deletingDatasets,
selectEntityDeleting: (state, id) =>
selectState(state).communications.deletingDataset[id],
});
export const selectDataset = (state: IApplicationState, id: string) => {
return (selectDatasets(state) || []).find(dataset => dataset.id === id);
};
export const selectDatasetsPagination = (state: IApplicationState) =>
selectState(state).data.pagination;
export const selectLoadingDataset = (state: IApplicationState, id: string) => {
if (selectDataset(state, id)) {
return { error: undefined, isRequesting: false, isSuccess: true };
}
return selectCommunications(state).loadingDataset[id] || initialCommunication;
};
``` | /content/code_sandbox/webapp/client/src/features/datasets/store/selectors.ts | xml | 2016-10-19T01:07:26 | 2024-08-14T03:53:55 | modeldb | VertaAI/modeldb | 1,689 | 331 |
```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.
*
*/
export { DecryptCommand as PassphraseDecryptCommand } from './decrypt';
export { EncryptCommand as PassphraseEncryptCommand } from './encrypt';
export { CreateCommand as PassphraseCreateCommand } from './create';
``` | /content/code_sandbox/commander/src/bootstrapping/commands/passphrase/index.ts | xml | 2016-02-01T21:45:35 | 2024-08-15T19:16:48 | lisk-sdk | LiskArchive/lisk-sdk | 2,721 | 129 |
```xml
import {Vec3} from "math/vec";
export interface NurbsCurveData {
degree: number,
controlPoints: Vec3[],
knots: number[],
weights: number[]
}
``` | /content/code_sandbox/modules/geom/curves/nurbsCurveData.ts | xml | 2016-08-26T21:55:19 | 2024-08-15T01:02:53 | jsketcher | xibyte/jsketcher | 1,461 | 42 |
```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 sqrtpi = require( './index' );
// TESTS //
// The function returns a number...
{
sqrtpi( 2 ); // $ExpectType number
}
// The compiler throws an error if the function is provided a value other than a number...
{
sqrtpi( true ); // $ExpectError
sqrtpi( false ); // $ExpectError
sqrtpi( null ); // $ExpectError
sqrtpi( undefined ); // $ExpectError
sqrtpi( '5' ); // $ExpectError
sqrtpi( [] ); // $ExpectError
sqrtpi( {} ); // $ExpectError
sqrtpi( ( x: number ): number => x ); // $ExpectError
}
// The compiler throws an error if the function is provided insufficient arguments...
{
sqrtpi(); // $ExpectError
}
``` | /content/code_sandbox/lib/node_modules/@stdlib/math/base/special/sqrtpi/docs/types/test.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 239 |
```xml
export interface FormatsMethods<T extends string | number> {
compare?: (data1: T, data2: T) => number | undefined;
validate(data: T): boolean;
}
``` | /content/code_sandbox/packages/specs/ajv/src/interfaces/FormatsMethods.ts | xml | 2016-02-21T18:38:47 | 2024-08-14T21:19:48 | tsed | tsedio/tsed | 2,817 | 40 |
```xml
import { smallScenario, mediumScenario, largeScenario } from "./scenarios"
// here's what we'll be testing
const plan = [
"-----------",
"Small Model",
"-----------",
() => smallScenario(100),
() => smallScenario(1000),
() => smallScenario(10000),
() => smallScenario(1000),
() => smallScenario(100),
"",
"------------",
"Medium Model",
"------------",
() => mediumScenario(100),
() => mediumScenario(1000),
() => mediumScenario(10000),
() => mediumScenario(1000),
() => mediumScenario(100),
"",
"------------------------",
"Large Model - 0 children",
"------------------------",
() => largeScenario(100, 0, 0),
() => largeScenario(1000, 0, 0),
() => largeScenario(100, 0, 0),
"",
"-------------------------------------------",
"Large Model - 10 small & 10 medium children",
"-------------------------------------------",
() => largeScenario(50, 10, 10),
() => largeScenario(250, 10, 10),
() => largeScenario(50, 10, 10),
"",
"-------------------------------------------",
"Large Model - 100 small & 0 medium children",
"-------------------------------------------",
() => largeScenario(50, 100, 0),
() => largeScenario(250, 100, 0),
() => largeScenario(50, 100, 0),
"",
"-------------------------------------------",
"Large Model - 0 small & 100 medium children",
"-------------------------------------------",
() => largeScenario(50, 0, 100),
() => largeScenario(250, 0, 100),
() => largeScenario(50, 0, 100)
]
// burn a few to get the juices flowing
smallScenario(1000)
mediumScenario(500)
largeScenario(100, 10, 10)
// remember when this broke the internet?
function leftPad(value: string, length: number, char = " "): string {
return value.toString().length < length ? leftPad(char + value, length) : value
}
// let's start
plan.forEach((fn) => {
// strings get printed, i guess.
if (typeof fn === "string") {
console.log(fn)
return
}
// trigger awkward gc up front if we can
if (global.gc) {
global.gc()
}
// run the report
const result = fn()
// calculate some fields
const seconds = leftPad((result.elapsed / 1.0).toLocaleString(), 8)
const times = leftPad(`x ${result.count.toLocaleString()}`, 10)
const avg = leftPad((result.elapsed / result.count).toFixed(1), 4)
// print
console.log(`${seconds}ms | ${times} | ${avg}ms avg`)
})
console.log("")
``` | /content/code_sandbox/__tests__/perf/report.ts | xml | 2016-09-04T18:28:25 | 2024-08-16T08:48:55 | mobx-state-tree | mobxjs/mobx-state-tree | 6,917 | 660 |
```xml
import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/core';
import { Table } from 'primeng/table';
import { Code } from '@domain/code';
import { Customer, Representative } from '@domain/customer';
import { CustomerService } from '@service/customerservice';
@Component({
selector: 'filter-basic-doc',
template: ` <app-docsectiontext>
<p>
Data filtering is enabled by defining the <i>filters</i> property referring to a <i>DataTableFilterMeta</i> instance. Each column to filter also requires <i>filter</i> to be enabled. Built-in filter element is a input field and using
<i>filterElement</i>, it is possible to customize the filtering with your own UI.
</p>
<p>The optional global filtering searches the data against a single value that is bound to the <i>global</i> key of the <i>filters</i> object. The fields to search against is defined with the <i>globalFilterFields</i>.</p>
</app-docsectiontext>
<p-deferred-demo (load)="loadDemoData()">
<div class="card">
<p-table
#dt2
[value]="customers"
dataKey="id"
[rows]="10"
[rowsPerPageOptions]="[10, 25, 50]"
[loading]="loading"
[paginator]="true"
[globalFilterFields]="['name', 'country.name', 'representative.name', 'status']"
[tableStyle]="{ 'min-width': '75rem' }"
>
<ng-template pTemplate="caption">
<div class="flex">
<p-iconField iconPosition="left" class="ml-auto">
<p-inputIcon>
<i class="pi pi-search"></i>
</p-inputIcon>
<input pInputText type="text" (input)="dt2.filterGlobal($event.target.value, 'contains')" placeholder="Search keyword" />
</p-iconField>
</div>
</ng-template>
<ng-template pTemplate="header">
<tr>
<th style="width:22%">Name</th>
<th style="width:22%">Country</th>
<th style="width:22%">Agent</th>
<th style="width:22%">Status</th>
<th style="width:12%">Verified</th>
</tr>
<tr>
<th>
<p-columnFilter type="text" field="name" placeholder="Search by name" ariaLabel="Filter Name"></p-columnFilter>
</th>
<th>
<p-columnFilter type="text" field="country.name" placeholder="Search by country" ariaLabel="Filter Country"></p-columnFilter>
</th>
<th>
<p-columnFilter field="representative" matchMode="in" [showMenu]="false">
<ng-template pTemplate="filter" let-value let-filter="filterCallback">
<p-multiSelect [(ngModel)]="value" [options]="representatives" placeholder="Any" (onChange)="filter($event.value)" optionLabel="name">
<ng-template let-option pTemplate="item">
<div class="inline-block vertical-align-middle">
<img [alt]="option.label" src="path_to_url{{ option.image }}" width="24" class="vertical-align-middle" />
<span class="ml-1 mt-1">{{ option.name }}</span>
</div>
</ng-template>
</p-multiSelect>
</ng-template>
</p-columnFilter>
</th>
<th>
<p-columnFilter field="status" matchMode="equals" [showMenu]="false">
<ng-template pTemplate="filter" let-value let-filter="filterCallback">
<p-dropdown [(ngModel)]="value" [options]="statuses" (onChange)="filter($event.value)" placeholder="Select One" [showClear]="true">
<ng-template let-option pTemplate="item">
<p-tag [value]="option.value" [severity]="getSeverity(option.label)" />
</ng-template>
</p-dropdown>
</ng-template>
</p-columnFilter>
</th>
<th>
<p-columnFilter type="boolean" field="verified"></p-columnFilter>
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-customer>
<tr>
<td>
{{ customer.name }}
</td>
<td>
<img src="path_to_url" [class]="'flag flag-' + customer.country.code" style="width: 20px" />
<span class="ml-1 vertical-align-middle">{{ customer.country.name }}</span>
</td>
<td>
<img [alt]="customer.representative.name" src="path_to_url{{ customer.representative.image }}" width="32" style="vertical-align: middle" />
<span class="ml-1 vertical-align-middle">{{ customer.representative.name }}</span>
</td>
<td>
<p-tag [value]="customer.status" [severity]="getSeverity(customer.status)" />
</td>
<td>
<i class="pi" [ngClass]="{ 'text-green-500 pi-check-circle': customer.verified, 'text-red-500 pi-times-circle': !customer.verified }"></i>
</td>
</tr>
</ng-template>
<ng-template pTemplate="emptymessage">
<tr>
<td colspan="5">No customers found.</td>
</tr>
</ng-template>
</p-table>
</div>
</p-deferred-demo>
<app-code [code]="code" selector="table-filter-basic-demo" [extFiles]="extFiles"></app-code>`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class FilterBasicDoc {
customers!: Customer[];
representatives!: Representative[];
statuses!: any[];
loading: boolean = true;
activityValues: number[] = [0, 100];
constructor(private customerService: CustomerService, private cd: ChangeDetectorRef) {}
loadDemoData() {
this.customerService.getCustomersLarge().then((customers) => {
this.customers = customers;
this.loading = false;
this.customers.forEach((customer) => (customer.date = new Date(<Date>customer.date)));
this.cd.markForCheck();
});
this.representatives = [
{ name: 'Amy Elsner', image: 'amyelsner.png' },
{ name: 'Anna Fali', image: 'annafali.png' },
{ name: 'Asiya Javayant', image: 'asiyajavayant.png' },
{ name: 'Bernardo Dominic', image: 'bernardodominic.png' },
{ name: 'Elwin Sharvill', image: 'elwinsharvill.png' },
{ name: 'Ioni Bowcher', image: 'ionibowcher.png' },
{ name: 'Ivan Magalhaes', image: 'ivanmagalhaes.png' },
{ name: 'Onyama Limba', image: 'onyamalimba.png' },
{ name: 'Stephen Shaw', image: 'stephenshaw.png' },
{ name: 'Xuxue Feng', image: 'xuxuefeng.png' }
];
this.statuses = [
{ label: 'Unqualified', value: 'unqualified' },
{ label: 'Qualified', value: 'qualified' },
{ label: 'New', value: 'new' },
{ label: 'Negotiation', value: 'negotiation' },
{ label: 'Renewal', value: 'renewal' },
{ label: 'Proposal', value: 'proposal' }
];
}
clear(table: Table) {
table.clear();
}
getSeverity(status: string) {
switch (status) {
case 'unqualified':
return 'danger';
case 'qualified':
return 'success';
case 'new':
return 'info';
case 'negotiation':
return 'warning';
case 'renewal':
return null;
}
}
code: Code = {
basic: `<p-table
#dt2
[value]="customers"
dataKey="id"
[rows]="10"
[rowsPerPageOptions]="[10, 25, 50]"
[loading]="loading"
[paginator]="true"
[globalFilterFields]="['name', 'country.name', 'representative.name', 'status']"
[tableStyle]="{ 'min-width': '75rem' }"
>
<ng-template pTemplate="caption">
<div class="flex">
<p-iconField iconPosition="left" class="ml-auto">
<p-inputIcon>
<i class="pi pi-search"></i>
</p-inputIcon>
<input
pInputText
type="text"
(input)="dt2.filterGlobal($event.target.value, 'contains')"
placeholder="Search keyword" />
</p-iconField>
</div>
</ng-template>
<ng-template pTemplate="header">
<tr>
<th style="width:22%">Name</th>
<th style="width:22%">Country</th>
<th style="width:22%">Agent</th>
<th style="width:22%">Status</th>
<th style="width:12%">Verified</th>
</tr>
<tr>
<th>
<p-columnFilter
type="text"
field="name"
placeholder="Search by name"
ariaLabel="Filter Name" />
</th>
<th>
<p-columnFilter
type="text"
field="country.name"
placeholder="Search by country"
ariaLabel="Filter Country" />
</th>
<th>
<p-columnFilter field="representative" matchMode="in" [showMenu]="false">
<ng-template pTemplate="filter" let-value let-filter="filterCallback">
<p-multiSelect
[(ngModel)]="value"
[options]="representatives"
placeholder="Any"
(onChange)="filter($event.value)"
optionLabel="name">
<ng-template let-option pTemplate="item">
<div class="inline-block vertical-align-middle">
<img
[alt]="option.label"
src="path_to_url{{ option.image }}"
width="24"
class="vertical-align-middle" />
<span class="ml-1 mt-1">{{ option.name }}</span>
</div>
</ng-template>
</p-multiSelect>
</ng-template>
</p-columnFilter>
</th>
<th>
<p-columnFilter field="status" matchMode="equals" [showMenu]="false">
<ng-template pTemplate="filter" let-value let-filter="filterCallback">
<p-dropdown
[(ngModel)]="value"
[options]="statuses"
(onChange)="filter($event.value)"
placeholder="Select One"
[showClear]="true">
<ng-template let-option pTemplate="item">
<p-tag
[value]="option.value"
[severity]="getSeverity(option.label)" />
</ng-template>
</p-dropdown>
</ng-template>
</p-columnFilter>
</th>
<th>
<p-columnFilter type="boolean" field="verified">
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-customer>
<tr>
<td>
{{ customer.name }}
</td>
<td>
<img
src="path_to_url"
[class]="'flag flag-' + customer.country.code"
style="width: 20px" />
<span class="ml-1 vertical-align-middle">
{{ customer.country.name }}
</span>
</td>
<td>
<img
[alt]="customer.representative.name"
src="path_to_url{{ customer.representative.image }}"
width="32"
style="vertical-align: middle" />
<span class="ml-1 vertical-align-middle">
{{ customer.representative.name }}
</span>
</td>
<td>
<p-tag
[value]="customer.status"
[severity]="getSeverity(customer.status)" />
</td>
<td>
<i class="pi" [ngClass]="{ 'text-green-500 pi-check-circle': customer.verified, 'text-red-500 pi-times-circle': !customer.verified }"></i>
</td>
</tr>
</ng-template>
<ng-template pTemplate="emptymessage">
<tr>
<td colspan="5">No customers found.</td>
</tr>
</ng-template>
</p-table>`,
html: `<div class="card">
<p-table
#dt2
[value]="customers"
dataKey="id"
[rows]="10"
[rowsPerPageOptions]="[10, 25, 50]"
[loading]="loading"
[paginator]="true"
[globalFilterFields]="['name', 'country.name', 'representative.name', 'status']"
[tableStyle]="{ 'min-width': '75rem' }"
>
<ng-template pTemplate="caption">
<div class="flex">
<p-iconField iconPosition="left" class="ml-auto">
<p-inputIcon>
<i class="pi pi-search"></i>
</p-inputIcon>
<input
pInputText
type="text"
(input)="dt2.filterGlobal($event.target.value, 'contains')"
placeholder="Search keyword" />
</p-iconField>
</div>
</ng-template>
<ng-template pTemplate="header">
<tr>
<th style="width:22%">Name</th>
<th style="width:22%">Country</th>
<th style="width:22%">Agent</th>
<th style="width:22%">Status</th>
<th style="width:12%">Verified</th>
</tr>
<tr>
<th>
<p-columnFilter
type="text"
field="name"
placeholder="Search by name"
ariaLabel="Filter Name" />
</th>
<th>
<p-columnFilter
type="text"
field="country.name"
placeholder="Search by country"
ariaLabel="Filter Country" />
</th>
<th>
<p-columnFilter field="representative" matchMode="in" [showMenu]="false">
<ng-template pTemplate="filter" let-value let-filter="filterCallback">
<p-multiSelect
[(ngModel)]="value"
[options]="representatives"
placeholder="Any"
(onChange)="filter($event.value)"
optionLabel="name">
<ng-template let-option pTemplate="item">
<div class="inline-block vertical-align-middle">
<img
[alt]="option.label" src="path_to_url{{ option.image }}"
width="24"
class="vertical-align-middle" />
<span class="ml-1 mt-1">
{{ option.name }}
</span>
</div>
</ng-template>
</p-multiSelect>
</ng-template>
</p-columnFilter>
</th>
<th>
<p-columnFilter field="status" matchMode="equals" [showMenu]="false">
<ng-template pTemplate="filter" let-value let-filter="filterCallback">
<p-dropdown
[(ngModel)]="value"
[options]="statuses"
(onChange)="filter($event.value)"
placeholder="Select One"
[showClear]="true">
<ng-template let-option pTemplate="item">
<p-tag
[value]="option.value"
[severity]="getSeverity(option.label)" />
</ng-template>
</p-dropdown>
</ng-template>
</p-columnFilter>
</th>
<th>
<p-columnFilter type="boolean" field="verified" />
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-customer>
<tr>
<td>
{{ customer.name }}
</td>
<td>
<img
src="path_to_url"
[class]="'flag flag-' + customer.country.code"
style="width: 20px" />
<span class="ml-1 vertical-align-middle">
{{ customer.country.name }}
</span>
</td>
<td>
<img
[alt]="customer.representative.name"
src="path_to_url{{ customer.representative.image }}"
width="32"
style="vertical-align: middle" />
<span class="ml-1 vertical-align-middle">
{{ customer.representative.name }}
</span>
</td>
<td>
<p-tag
[value]="customer.status"
[severity]="getSeverity(customer.status)" />
</td>
<td>
<i class="pi" [ngClass]="{ 'text-green-500 pi-check-circle': customer.verified, 'text-red-500 pi-times-circle': !customer.verified }"></i>
</td>
</tr>
</ng-template>
<ng-template pTemplate="emptymessage">
<tr>
<td colspan="5">No customers found.</td>
</tr>
</ng-template>
</p-table>
</div>`,
typescript: `import { Component, OnInit } from '@angular/core';
import { Table } from 'primeng/table';
import { Customer, Representative } from '@domain/customer';
import { CustomerService } from '@service/customerservice';
import { TagModule } from 'primeng/tag';
import { IconFieldModule } from 'primeng/iconfield';
import { InputIconModule } from 'primeng/inputicon';
import { HttpClientModule } from '@angular/common/http';
import { InputTextModule } from 'primeng/inputtext';
import { MultiSelectModule } from 'primeng/multiselect';
import { DropdownModule } from 'primeng/dropdown';
import { CommonModule } from '@angular/common';
@Component({
selector: 'table-filter-basic-demo',
templateUrl: 'table-filter-basic-demo.html',
standalone: true,
imports: [TableModule, TagModule, IconFieldModule, InputTextModule, InputIconModule, MultiSelectModule, DropdownModule, HttpClientModule, CommonModule],
providers:[CustomerService]
})
export class TableFilterBasicDemo implements OnInit {
customers!: Customer[];
representatives!: Representative[];
statuses!: any[];
loading: boolean = true;
activityValues: number[] = [0, 100];
constructor(private customerService: CustomerService) {}
ngOnInit() {
this.customerService.getCustomersLarge().then((customers) => {
this.customers = customers;
this.loading = false;
this.customers.forEach((customer) => (customer.date = new Date(<Date>customer.date)));
});
this.representatives = [
{ name: 'Amy Elsner', image: 'amyelsner.png' },
{ name: 'Anna Fali', image: 'annafali.png' },
{ name: 'Asiya Javayant', image: 'asiyajavayant.png' },
{ name: 'Bernardo Dominic', image: 'bernardodominic.png' },
{ name: 'Elwin Sharvill', image: 'elwinsharvill.png' },
{ name: 'Ioni Bowcher', image: 'ionibowcher.png' },
{ name: 'Ivan Magalhaes', image: 'ivanmagalhaes.png' },
{ name: 'Onyama Limba', image: 'onyamalimba.png' },
{ name: 'Stephen Shaw', image: 'stephenshaw.png' },
{ name: 'Xuxue Feng', image: 'xuxuefeng.png' }
];
this.statuses = [
{ label: 'Unqualified', value: 'unqualified' },
{ label: 'Qualified', value: 'qualified' },
{ label: 'New', value: 'new' },
{ label: 'Negotiation', value: 'negotiation' },
{ label: 'Renewal', value: 'renewal' },
{ label: 'Proposal', value: 'proposal' }
];
}
clear(table: Table) {
table.clear();
}
getSeverity(status: string) {
switch (status) {
case 'unqualified':
return 'danger';
case 'qualified':
return 'success';
case 'new':
return 'info';
case 'negotiation':
return 'warning';
case 'renewal':
return null;
}
}
}`,
data: `{
id: 1000,
name: 'James Butt',
country: {
name: 'Algeria',
code: 'dz'
},
company: 'Benton, John B Jr',
date: '2015-09-13',
status: 'unqualified',
verified: true,
activity: 17,
representative: {
name: 'Ioni Bowcher',
image: 'ionibowcher.png'
},
balance: 70663
},
...`,
service: ['CustomerService']
};
extFiles = [
{
path: 'src/domain/customer.ts',
content: `
export interface Country {
name?: string;
code?: string;
}
export interface Representative {
name?: string;
image?: string;
}
export interface Customer {
id?: number;
name?: string;
country?: Country;
company?: string;
date?: string | Date;
status?: string;
activity?: number;
representative?: Representative;
verified?: boolean;
balance?: number;
}`
}
];
}
``` | /content/code_sandbox/src/app/showcase/doc/table/filterbasic.ts | xml | 2016-01-16T09:23:28 | 2024-08-16T19:58:20 | primeng | primefaces/primeng | 9,969 | 4,855 |
```xml
<EnclaveConfiguration>
<ProdID>0</ProdID>
<ISVSVN>0</ISVSVN>
<StackMaxSize>0x40000</StackMaxSize>
<HeapMaxSize>0x100000</HeapMaxSize>
<TCSNum>10</TCSNum>
<TCSPolicy>1</TCSPolicy>
<EnableAEXNotify>1</EnableAEXNotify>
<!-- Recommend changing 'DisableDebug' to 1 to make the enclave undebuggable for enclave release -->
<DisableDebug>0</DisableDebug>
<MiscSelect>0</MiscSelect>
<MiscMask>0xFFFFFFFF</MiscMask>
</EnclaveConfiguration>
``` | /content/code_sandbox/SampleCode/SampleAEXNotify/Enclave/Enclave.config.xml | xml | 2016-02-23T23:41:25 | 2024-08-15T10:13:48 | linux-sgx | intel/linux-sgx | 1,313 | 156 |
```xml
import { Alert } from "@erxes/ui/src";
import { IUser } from "@erxes/ui/src/auth/types";
import { gql } from "@apollo/client";
import React from "react";
import { useNavigate } from "react-router-dom";
import withCurrentUser from "@erxes/ui/src/auth/containers/withCurrentUser";
import {
ClientPortalUserRemoveMutationResponse,
IClientPortalUser,
} from "../../types";
import { useMutation } from "@apollo/client";
import BasicInfoSection from "../../components/detail/BasicInfoSection";
import { mutations } from "../../graphql";
type Props = {
clientPortalUser: IClientPortalUser;
};
type FinalProps = { currentUser: IUser } & Props &
ClientPortalUserRemoveMutationResponse;
const BasicInfoContainer = (props: FinalProps) => {
const { clientPortalUser } = props;
const navigate = useNavigate();
const [clientPortalUsersRemove] =
useMutation<ClientPortalUserRemoveMutationResponse>(
gql(mutations.clientPortalUsersRemove),
{
refetchQueries: ["clientPortalUserCounts", "clientPortalUsers"],
}
);
const { _id } = clientPortalUser;
const remove = () => {
clientPortalUsersRemove({ variables: { clientPortalUserIds: [_id] } })
.then(() => {
Alert.success("You successfully deleted a client portal user");
navigate("/settings/client-portal/user");
})
.catch((e) => {
Alert.error(e.message);
});
};
const updatedProps = {
...props,
remove,
};
return <BasicInfoSection {...updatedProps} />;
};
export default withCurrentUser(BasicInfoContainer);
``` | /content/code_sandbox/packages/plugin-clientportal-ui/src/containers/details/BasicInfo.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 354 |
```xml
import { isPromise } from './isPromise.js';
import type { PromiseOrValue } from './PromiseOrValue.js';
/**
* Similar to Array.prototype.reduce(), however the reducing callback may return
* a Promise, in which case reduction will continue after each promise resolves.
*
* If the callback does not return a Promise, then this function will also not
* return a Promise.
*/
export function promiseReduce<T, U>(
values: Iterable<T>,
callbackFn: (accumulator: U, currentValue: T) => PromiseOrValue<U>,
initialValue: PromiseOrValue<U>,
): PromiseOrValue<U> {
let accumulator = initialValue;
for (const value of values) {
accumulator = isPromise(accumulator)
? accumulator.then((resolved) => callbackFn(resolved, value))
: callbackFn(accumulator, value);
}
return accumulator;
}
``` | /content/code_sandbox/grafast/grafast/vendor/graphql-js/jsutils/promiseReduce.ts | xml | 2016-04-14T21:29:19 | 2024-08-16T17:12:51 | crystal | graphile/crystal | 12,539 | 182 |
```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>AD_UNIT_ID_FOR_BANNER_TEST</key>
<string>ca-app-pub-3940256099942544/2934735716</string>
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
<string>ca-app-pub-3940256099942544/4411468910</string>
<key>API_KEY</key>
<string>AIzaSyAzlj4APqi5S58nFtE52Da0fYBOHA2MhaY</string>
<key>BUNDLE_ID</key>
<string>com.google.firebase.quickstart.AppdistributionExample</string>
<key>CLIENT_ID</key>
<string>123456789000-hjugbg6ud799v4c49dim8ce2usclthar.apps.googleusercontent.com</string>
<key>DATABASE_URL</key>
<string>path_to_url
<key>GCM_SENDER_ID</key>
<string>123456789000</string>
<key>GOOGLE_APP_ID</key>
<string>1:123456789000:ios:f1bf012572b04063</string>
<key>IS_ADS_ENABLED</key>
<true/>
<key>IS_ANALYTICS_ENABLED</key>
<true/>
<key>IS_APPINVITE_ENABLED</key>
<true/>
<key>IS_GCM_ENABLED</key>
<true/>
<key>IS_SIGNIN_ENABLED</key>
<true/>
<key>PLIST_VERSION</key>
<string>1</string>
<key>PROJECT_ID</key>
<string>mockproject-1234</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.123456789000-hjugbg6ud799v4c49dim8ce2usclthar</string>
<key>STORAGE_BUCKET</key>
<string>mockproject-1234.appspot.com</string>
</dict>
</plist>
``` | /content/code_sandbox/appdistribution/GoogleService-Info.plist | xml | 2016-04-26T17:13:37 | 2024-08-15T05:40:16 | quickstart-ios | firebase/quickstart-ios | 2,773 | 484 |
```xml
import * as React from 'react';
import { mount } from '@cypress/react';
import { useOnKeyboardNavigationChange } from './hooks';
describe('useOnKeyboardNavigationChange', () => {
it('Should invoke callback when navigation mode changes', () => {
const Example = () => {
const [isKeyboard, setIsKeyboard] = React.useState(false);
useOnKeyboardNavigationChange(isNavigatingWithKeyboard => setIsKeyboard(isNavigatingWithKeyboard));
return (
<>
<button id="button">button</button>
<span id="result">Navigation mode: {isKeyboard ? 'keyboard' : 'mouse'}</span>
</>
);
};
mount(<Example />);
cy.get('#button')
.click()
.get('#result')
.should('contain.text', 'mouse')
.get('#button')
.type('{enter}')
.get('#result')
.should('contain.text', 'keyboard')
.get('#button')
.click()
.get('#result')
.should('contain.text', 'mouse');
});
});
``` | /content/code_sandbox/packages/react-components/react-tabster/src/useOnKeyboardNavigationChange.cy.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 231 |
```xml
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
import { Formatter } from "@export/formatter";
import { IViewWrapper } from "@file/document-wrapper";
import { File } from "@file/file";
import * as convenienceFunctions from "@util/convenience-functions";
import { ImageRun } from "./image-run";
describe("ImageRun", () => {
beforeAll(() => {
vi.spyOn(convenienceFunctions, "uniqueId").mockReturnValue("test-unique-id");
});
afterAll(() => {
vi.resetAllMocks();
});
describe("#constructor()", () => {
it("should create with Buffer", () => {
const currentImageRun = new ImageRun({
type: "png",
data: Buffer.from(""),
transformation: {
width: 200,
height: 200,
rotation: 45,
},
floating: {
zIndex: 10,
horizontalPosition: {
offset: 1014400,
},
verticalPosition: {
offset: 1014400,
},
},
});
const tree = new Formatter().format(currentImageRun, {
file: {
Media: {
addImage: vi.fn(),
},
} as unknown as File,
viewWrapper: {} as unknown as IViewWrapper,
stack: [],
});
expect(tree).to.deep.equal({
"w:r": [
{
"w:drawing": [
{
"wp:anchor": [
{
_attr: {
allowOverlap: "1",
behindDoc: "0",
distB: 0,
distL: 0,
distR: 0,
distT: 0,
layoutInCell: "1",
locked: "0",
relativeHeight: 10,
simplePos: "0",
},
},
{
"wp:simplePos": {
_attr: {
x: 0,
y: 0,
},
},
},
{
"wp:positionH": [
{
_attr: {
relativeFrom: "page",
},
},
{
"wp:posOffset": ["1014400"],
},
],
},
{
"wp:positionV": [
{
_attr: {
relativeFrom: "page",
},
},
{
"wp:posOffset": ["1014400"],
},
],
},
{
"wp:extent": {
_attr: {
cx: 1905000,
cy: 1905000,
},
},
},
{
"wp:effectExtent": {
_attr: {
b: 0,
l: 0,
r: 0,
t: 0,
},
},
},
{
"wp:wrapNone": {},
},
{
"wp:docPr": {
_attr: {
descr: "",
id: 1,
name: "",
title: "",
},
},
},
{
"wp:cNvGraphicFramePr": [
{
"a:graphicFrameLocks": {
_attr: {
noChangeAspect: 1,
"xmlns:a": "path_to_url",
},
},
},
],
},
{
"a:graphic": [
{
_attr: {
"xmlns:a": "path_to_url",
},
},
{
"a:graphicData": [
{
_attr: {
uri: "path_to_url",
},
},
{
"pic:pic": [
{
_attr: {
"xmlns:pic": "path_to_url",
},
},
{
"pic:nvPicPr": [
{
"pic:cNvPr": {
_attr: {
descr: "",
id: 0,
name: "",
},
},
},
{
"pic:cNvPicPr": [
{
"a:picLocks": {
_attr: {
noChangeArrowheads: 1,
noChangeAspect: 1,
},
},
},
],
},
],
},
{
"pic:blipFill": [
{
"a:blip": {
_attr: {
cstate: "none",
"r:embed": "rId{test-unique-id.png}",
},
},
},
{
"a:srcRect": {},
},
{
"a:stretch": [
{
"a:fillRect": {},
},
],
},
],
},
{
"pic:spPr": [
{
_attr: {
bwMode: "auto",
},
},
{
"a:xfrm": [
{
_attr: {
rot: 2700000,
},
},
{
"a:off": {
_attr: {
x: 0,
y: 0,
},
},
},
{
"a:ext": {
_attr: {
cx: 1905000,
cy: 1905000,
},
},
},
],
},
{
"a:prstGeom": [
{
_attr: {
prst: "rect",
},
},
{
"a:avLst": {},
},
],
},
],
},
],
},
],
},
],
},
],
},
],
},
],
});
});
it("should create with string", () => {
const currentImageRun = new ImageRun({
type: "png",
data: "",
transformation: {
width: 200,
height: 200,
rotation: 45,
},
floating: {
zIndex: 10,
horizontalPosition: {
offset: 1014400,
},
verticalPosition: {
offset: 1014400,
},
},
});
const tree = new Formatter().format(currentImageRun, {
file: {
Media: {
addImage: vi.fn(),
},
} as unknown as File,
viewWrapper: {} as unknown as IViewWrapper,
stack: [],
});
expect(tree).to.deep.equal({
"w:r": [
{
"w:drawing": [
{
"wp:anchor": [
{
_attr: {
allowOverlap: "1",
behindDoc: "0",
distB: 0,
distL: 0,
distR: 0,
distT: 0,
layoutInCell: "1",
locked: "0",
relativeHeight: 10,
simplePos: "0",
},
},
{
"wp:simplePos": {
_attr: {
x: 0,
y: 0,
},
},
},
{
"wp:positionH": [
{
_attr: {
relativeFrom: "page",
},
},
{
"wp:posOffset": ["1014400"],
},
],
},
{
"wp:positionV": [
{
_attr: {
relativeFrom: "page",
},
},
{
"wp:posOffset": ["1014400"],
},
],
},
{
"wp:extent": {
_attr: {
cx: 1905000,
cy: 1905000,
},
},
},
{
"wp:effectExtent": {
_attr: {
b: 0,
l: 0,
r: 0,
t: 0,
},
},
},
{
"wp:wrapNone": {},
},
{
"wp:docPr": {
_attr: {
descr: "",
id: 1,
name: "",
title: "",
},
},
},
{
"wp:cNvGraphicFramePr": [
{
"a:graphicFrameLocks": {
_attr: {
noChangeAspect: 1,
"xmlns:a": "path_to_url",
},
},
},
],
},
{
"a:graphic": [
{
_attr: {
"xmlns:a": "path_to_url",
},
},
{
"a:graphicData": [
{
_attr: {
uri: "path_to_url",
},
},
{
"pic:pic": [
{
_attr: {
"xmlns:pic": "path_to_url",
},
},
{
"pic:nvPicPr": [
{
"pic:cNvPr": {
_attr: {
descr: "",
id: 0,
name: "",
},
},
},
{
"pic:cNvPicPr": [
{
"a:picLocks": {
_attr: {
noChangeArrowheads: 1,
noChangeAspect: 1,
},
},
},
],
},
],
},
{
"pic:blipFill": [
{
"a:blip": {
_attr: {
cstate: "none",
"r:embed": "rId{test-unique-id.png}",
},
},
},
{
"a:srcRect": {},
},
{
"a:stretch": [
{
"a:fillRect": {},
},
],
},
],
},
{
"pic:spPr": [
{
_attr: {
bwMode: "auto",
},
},
{
"a:xfrm": [
{
_attr: {
rot: 2700000,
},
},
{
"a:off": {
_attr: {
x: 0,
y: 0,
},
},
},
{
"a:ext": {
_attr: {
cx: 1905000,
cy: 1905000,
},
},
},
],
},
{
"a:prstGeom": [
{
_attr: {
prst: "rect",
},
},
{
"a:avLst": {},
},
],
},
],
},
],
},
],
},
],
},
],
},
],
},
],
});
});
it("should return UInt8Array if atob is present", () => {
vi.spyOn(global, "atob").mockReturnValue("atob result");
const currentImageRun = new ImageRun({
type: "png",
data: "",
transformation: {
width: 200,
height: 200,
rotation: 45,
},
floating: {
zIndex: 10,
horizontalPosition: {
offset: 1014400,
},
verticalPosition: {
offset: 1014400,
},
},
});
const tree = new Formatter().format(currentImageRun, {
file: {
Media: {
addImage: vi.fn(),
},
} as unknown as File,
viewWrapper: {} as unknown as IViewWrapper,
stack: [],
});
expect(tree).to.deep.equal({
"w:r": [
{
"w:drawing": [
{
"wp:anchor": [
{
_attr: {
allowOverlap: "1",
behindDoc: "0",
distB: 0,
distL: 0,
distR: 0,
distT: 0,
layoutInCell: "1",
locked: "0",
relativeHeight: 10,
simplePos: "0",
},
},
{
"wp:simplePos": {
_attr: {
x: 0,
y: 0,
},
},
},
{
"wp:positionH": [
{
_attr: {
relativeFrom: "page",
},
},
{
"wp:posOffset": ["1014400"],
},
],
},
{
"wp:positionV": [
{
_attr: {
relativeFrom: "page",
},
},
{
"wp:posOffset": ["1014400"],
},
],
},
{
"wp:extent": {
_attr: {
cx: 1905000,
cy: 1905000,
},
},
},
{
"wp:effectExtent": {
_attr: {
b: 0,
l: 0,
r: 0,
t: 0,
},
},
},
{
"wp:wrapNone": {},
},
{
"wp:docPr": {
_attr: {
descr: "",
id: 1,
name: "",
title: "",
},
},
},
{
"wp:cNvGraphicFramePr": [
{
"a:graphicFrameLocks": {
_attr: {
noChangeAspect: 1,
"xmlns:a": "path_to_url",
},
},
},
],
},
{
"a:graphic": [
{
_attr: {
"xmlns:a": "path_to_url",
},
},
{
"a:graphicData": [
{
_attr: {
uri: "path_to_url",
},
},
{
"pic:pic": [
{
_attr: {
"xmlns:pic": "path_to_url",
},
},
{
"pic:nvPicPr": [
{
"pic:cNvPr": {
_attr: {
descr: "",
id: 0,
name: "",
},
},
},
{
"pic:cNvPicPr": [
{
"a:picLocks": {
_attr: {
noChangeArrowheads: 1,
noChangeAspect: 1,
},
},
},
],
},
],
},
{
"pic:blipFill": [
{
"a:blip": {
_attr: {
cstate: "none",
"r:embed": "rId{test-unique-id.png}",
},
},
},
{
"a:srcRect": {},
},
{
"a:stretch": [
{
"a:fillRect": {},
},
],
},
],
},
{
"pic:spPr": [
{
_attr: {
bwMode: "auto",
},
},
{
"a:xfrm": [
{
_attr: {
rot: 2700000,
},
},
{
"a:off": {
_attr: {
x: 0,
y: 0,
},
},
},
{
"a:ext": {
_attr: {
cx: 1905000,
cy: 1905000,
},
},
},
],
},
{
"a:prstGeom": [
{
_attr: {
prst: "rect",
},
},
{
"a:avLst": {},
},
],
},
],
},
],
},
],
},
],
},
],
},
],
},
],
});
});
it("should use data as is if its not a string", () => {
vi.spyOn(global, "atob").mockReturnValue("atob result");
const currentImageRun = new ImageRun({
type: "png",
data: "",
transformation: {
width: 200,
height: 200,
rotation: 45,
},
floating: {
zIndex: 10,
horizontalPosition: {
offset: 1014400,
},
verticalPosition: {
offset: 1014400,
},
},
});
const tree = new Formatter().format(currentImageRun, {
file: {
Media: {
addImage: vi.fn(),
},
} as unknown as File,
viewWrapper: {} as unknown as IViewWrapper,
stack: [],
});
expect(tree).to.deep.equal({
"w:r": [
{
"w:drawing": [
{
"wp:anchor": [
{
_attr: {
allowOverlap: "1",
behindDoc: "0",
distB: 0,
distL: 0,
distR: 0,
distT: 0,
layoutInCell: "1",
locked: "0",
relativeHeight: 10,
simplePos: "0",
},
},
{
"wp:simplePos": {
_attr: {
x: 0,
y: 0,
},
},
},
{
"wp:positionH": [
{
_attr: {
relativeFrom: "page",
},
},
{
"wp:posOffset": ["1014400"],
},
],
},
{
"wp:positionV": [
{
_attr: {
relativeFrom: "page",
},
},
{
"wp:posOffset": ["1014400"],
},
],
},
{
"wp:extent": {
_attr: {
cx: 1905000,
cy: 1905000,
},
},
},
{
"wp:effectExtent": {
_attr: {
b: 0,
l: 0,
r: 0,
t: 0,
},
},
},
{
"wp:wrapNone": {},
},
{
"wp:docPr": {
_attr: {
descr: "",
id: 1,
name: "",
title: "",
},
},
},
{
"wp:cNvGraphicFramePr": [
{
"a:graphicFrameLocks": {
_attr: {
noChangeAspect: 1,
"xmlns:a": "path_to_url",
},
},
},
],
},
{
"a:graphic": [
{
_attr: {
"xmlns:a": "path_to_url",
},
},
{
"a:graphicData": [
{
_attr: {
uri: "path_to_url",
},
},
{
"pic:pic": [
{
_attr: {
"xmlns:pic": "path_to_url",
},
},
{
"pic:nvPicPr": [
{
"pic:cNvPr": {
_attr: {
descr: "",
id: 0,
name: "",
},
},
},
{
"pic:cNvPicPr": [
{
"a:picLocks": {
_attr: {
noChangeArrowheads: 1,
noChangeAspect: 1,
},
},
},
],
},
],
},
{
"pic:blipFill": [
{
"a:blip": {
_attr: {
cstate: "none",
"r:embed": "rId{test-unique-id.png}",
},
},
},
{
"a:srcRect": {},
},
{
"a:stretch": [
{
"a:fillRect": {},
},
],
},
],
},
{
"pic:spPr": [
{
_attr: {
bwMode: "auto",
},
},
{
"a:xfrm": [
{
_attr: {
rot: 2700000,
},
},
{
"a:off": {
_attr: {
x: 0,
y: 0,
},
},
},
{
"a:ext": {
_attr: {
cx: 1905000,
cy: 1905000,
},
},
},
],
},
{
"a:prstGeom": [
{
_attr: {
prst: "rect",
},
},
{
"a:avLst": {},
},
],
},
],
},
],
},
],
},
],
},
],
},
],
},
],
});
});
it("should strip base64 marker", () => {
const spy = vi.spyOn(global, "atob").mockReturnValue("atob result");
new ImageRun({
type: "png",
data: ";base64,",
transformation: {
width: 200,
height: 200,
rotation: 45,
},
});
expect(spy).toBeCalledWith("");
});
it("should work with svgs", () => {
const currentImageRun = new ImageRun({
type: "svg",
data: Buffer.from(""),
transformation: {
width: 200,
height: 200,
},
fallback: {
type: "png",
data: Buffer.from(""),
},
});
const tree = new Formatter().format(currentImageRun, {
file: {
Media: {
addImage: vi.fn(),
},
} as unknown as File,
viewWrapper: {} as unknown as IViewWrapper,
stack: [],
});
expect(tree).toStrictEqual({
"w:r": [
{
"w:drawing": [
{
"wp:inline": expect.arrayContaining([
{
"a:graphic": expect.arrayContaining([
{
"a:graphicData": expect.arrayContaining([
{
"pic:pic": expect.arrayContaining([
{
"pic:blipFill": expect.arrayContaining([
{
"a:blip": [
{
_attr: {
cstate: "none",
"r:embed": "rId{test-unique-id.png}",
},
},
{
"a:extLst": [
{
"a:ext": [
{
_attr: {
uri: "{96DAC541-7B7A-43D3-8B79-37D633B846F1}",
},
},
{
"asvg:svgBlip": {
_attr: expect.objectContaining({
"r:embed":
"rId{test-unique-id.svg}",
}),
},
},
],
},
],
},
],
},
]),
},
]),
},
]),
},
]),
},
]),
},
],
},
],
});
});
});
});
``` | /content/code_sandbox/src/file/paragraph/run/image-run.spec.ts | xml | 2016-03-26T23:43:56 | 2024-08-16T13:02:47 | docx | dolanmiu/docx | 4,139 | 5,008 |
```xml
import { csv } from 'd3-fetch';
import { autoType } from 'd3-dsv';
import { G2Spec } from '../../../src';
const facetLine = (data) => ({
type: 'facetRect',
data,
encode: { y: 'symbol' },
axis: { y: { title: false } },
children: [
{
type: 'line',
key: 'line',
encode: {
x: (d) => new Date(d.date),
y: 'price',
color: 'symbol',
key: 'symbol',
},
frame: false,
scale: { y: { zero: true, tickCount: 3 } },
axis: { x: { title: false }, y: { title: false } },
animate: { enter: { type: 'pathIn' } },
style: { shape: 'smooth' },
},
],
});
const facetArea = (data) => ({
type: 'facetRect',
data,
encode: { y: 'symbol' },
axis: { y: { title: false } },
children: [
{
type: 'line',
key: 'line',
frame: false,
encode: {
x: (d) => new Date(d.date),
y: 'price',
color: 'symbol',
key: 'symbol',
},
style: { shape: 'smooth' },
axis: { x: { title: false }, y: { title: false } },
scale: { y: { zero: true, facet: false, tickCount: 3 } },
},
{
type: 'area',
key: 'area',
class: 'area',
frame: false,
encode: {
x: (d) => new Date(d.date),
y: 'price',
color: 'symbol',
key: 'symbol',
},
style: { shape: 'smooth' },
scale: { y: { facet: false, zero: true, tickCount: 3 } },
axis: { x: { title: false }, y: { title: false } },
animate: { exit: { type: 'fadeOut' } },
},
],
});
const stackArea = (data) => ({
type: 'area',
data,
key: 'area',
class: 'area',
transform: [{ type: 'stackY', reverse: true }],
axis: { y: { title: false } },
encode: {
x: (d) => new Date(d.date),
y: 'price',
color: 'symbol',
key: 'symbol',
},
style: { shape: 'smooth' },
});
const layerArea = (data) => ({
type: 'area',
key: 'area',
class: 'area',
data,
axis: { y: { title: false } },
encode: {
x: (d) => new Date(d.date),
y: 'price',
color: 'symbol',
key: 'symbol',
},
style: { fillOpacity: 0.5, shape: 'smooth' },
});
const streamgraph = (data) => ({
type: 'area',
key: 'area',
class: 'area',
data,
axis: { y: { title: false } },
transform: [{ type: 'stackY', reverse: true }, { type: 'symmetryY' }],
encode: {
x: (d) => new Date(d.date),
y: 'price',
color: 'symbol',
key: 'symbol',
},
style: { fillOpacity: 1, shape: 'smooth' },
});
const normalizeArea = (data) => ({
type: 'area',
key: 'area',
class: 'area',
data,
axis: { y: { title: false } },
transform: [{ type: 'stackY', reverse: true }, { type: 'normalizeY' }],
encode: {
x: (d) => new Date(d.date),
y: 'price',
color: 'symbol',
key: 'symbol',
},
style: { fillOpacity: 1, shape: 'smooth' },
});
const normalizeBar = (data) => ({
type: 'interval',
data,
encode: {
y: 'price',
color: 'symbol',
key: 'symbol',
},
transform: [
{ type: 'groupColor', y: 'sum' },
{ type: 'stackY', reverse: true },
{ type: 'normalizeY' },
],
scale: { x: { padding: 0 } },
axis: { y: { title: false }, x: { title: false } },
});
const groupBar = (data) => ({
type: 'interval',
data,
transform: [{ type: 'dodgeX' }],
encode: {
x: 'date',
y: 'price',
color: 'symbol',
groupKey: 'symbol',
key: (_, i) => i,
},
scale: { y: { nice: true } },
axis: { x: false, y: { title: false } },
});
const stackBar = (data) => ({
type: 'interval',
data,
transform: [{ type: 'stackY' }],
encode: {
x: 'date',
y: 'price',
color: 'symbol',
groupKey: 'symbol',
key: (_, i) => i,
},
axis: { x: false, y: { title: false } },
});
const bar = (data) => ({
type: 'interval',
data,
transform: [{ type: 'groupX', y: 'sum' }],
encode: {
x: 'symbol',
y: 'price',
color: 'symbol',
key: 'symbol',
},
axis: {
y: { labelFormatter: '~s', title: false },
x: { title: false },
},
});
const pie = (data) => ({
type: 'interval',
paddingLeft: 10,
paddingRight: 10,
paddingBottom: 10,
data,
transform: [{ type: 'groupX', y: 'sum' }, { type: 'stackY' }],
coordinate: { type: 'theta' },
encode: {
y: 'price',
color: 'symbol',
key: 'symbol',
},
legend: { color: { layout: { justifyContent: 'center' } } },
style: { radius: 10 },
});
const rose = (data) => ({
type: 'interval',
data,
paddingLeft: 10,
paddingRight: 10,
paddingBottom: 10,
transform: [{ type: 'groupX', y: 'sum' }],
coordinate: { type: 'polar' },
encode: {
x: 'symbol',
y: 'price',
color: 'symbol',
key: 'symbol',
},
scale: { x: { padding: 0 } },
style: { radius: 10 },
legend: { color: { layout: { justifyContent: 'center' } } },
axis: { y: false },
});
const keyframes = [
facetLine,
facetArea,
stackArea,
layerArea,
streamgraph,
normalizeArea,
normalizeBar,
groupBar,
stackBar,
bar,
pie,
rose,
];
/**
* @see path_to_url
*/
export async function stocksKeyframe(): Promise<G2Spec> {
const data = await csv('data/stocks2.csv', autoType);
// @ts-ignore
return {
type: 'timingKeyframe',
width: 800,
// @ts-ignore
children: keyframes.map((plot) => ({
paddingLeft: 40,
paddingBottom: 50,
paddingRight: 50,
...plot(data),
})),
};
}
// Only test the first three keyframes.
// The tests point of rest of the keyframes will be test in other test cases.
const intervals = keyframes.map((_, i) => (i <= 2 ? [500] : false));
stocksKeyframe.intervals = [false, ...intervals];
``` | /content/code_sandbox/__tests__/plots/animation/stocks-keyframe.ts | xml | 2016-05-26T09:21:04 | 2024-08-15T16:11:17 | G2 | antvis/G2 | 12,060 | 1,794 |
```xml
import { IButtonMutateProps } from '@erxes/ui/src/types';
import { Alert } from '@erxes/ui/src/utils';
import ButtonMutate from '@erxes/ui/src/components/ButtonMutate';
import { IPages } from '@erxes/ui-inbox/src/settings/integrations/types';
import Instagram from '../components/Form';
import React from 'react';
import client from '@erxes/ui/src/apolloClient';
import { getRefetchQueries } from '@erxes/ui-inbox/src/settings/integrations/containers/utils';
import { gql } from '@apollo/client';
import { mutations as inboxMutations } from '@erxes/ui-inbox/src/settings/integrations/graphql/index';
import { queries } from '../graphql';
type Props = {
kind: string;
type?: string;
callBack: () => void;
};
type FinalProps = {} & Props;
type State = {
pages: IPages[];
accountId?: string;
loadingPages?: boolean;
};
class InstagramContainer extends React.Component<FinalProps, State> {
constructor(props: FinalProps) {
super(props);
this.state = { pages: [], loadingPages: false };
}
onAccountSelect = (accountId?: string) => {
if (!accountId) {
return this.setState({ pages: [], accountId: '' });
}
const { kind } = this.props;
this.setState({ loadingPages: true });
client
.query({
query: gql(queries.instagramGetPages),
variables: {
accountId,
kind,
},
})
.then(({ data, loading }: any) => {
if (!loading) {
this.setState({
pages: data.instagramGetPages,
accountId,
loadingPages: false,
});
}
})
.catch((error) => {
Alert.error(error.message);
this.setState({ loadingPages: false });
});
};
onRemoveAccount = () => {
this.setState({ pages: [] });
};
renderButton = ({
passedName,
values,
isSubmitted,
callback,
}: IButtonMutateProps) => {
const { kind } = this.props;
return (
<ButtonMutate
mutation={inboxMutations.integrationsCreateExternalIntegration}
variables={values}
callback={callback}
refetchQueries={getRefetchQueries(kind)}
isSubmitted={isSubmitted}
type="submit"
successMessage={`You successfully added an ${passedName}`}
/>
);
};
render() {
const { callBack, kind } = this.props;
const { accountId, pages, loadingPages } = this.state;
const updatedProps = {
kind,
callBack,
accountId,
pages,
loadingPages,
onAccountSelect: this.onAccountSelect,
onRemoveAccount: this.onRemoveAccount,
renderButton: this.renderButton,
};
return <Instagram {...updatedProps} />;
}
}
export default InstagramContainer;
``` | /content/code_sandbox/packages/plugin-instagram-ui/src/containers/Form.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 623 |
```xml
// Regex from `node/lib/internal/net.js`: path_to_url#L19-L29
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
const v4Seg = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
const v4Str = `(${v4Seg}[.]){3}${v4Seg}`
const v6Seg = '(?:[0-9a-fA-F]{1,4})'
const IPv6Reg = new RegExp(
'^(' +
`(?:${v6Seg}:){7}(?:${v6Seg}|:)|` +
`(?:${v6Seg}:){6}(?:${v4Str}|:${v6Seg}|:)|` +
`(?:${v6Seg}:){5}(?::${v4Str}|(:${v6Seg}){1,2}|:)|` +
`(?:${v6Seg}:){4}(?:(:${v6Seg}){0,1}:${v4Str}|(:${v6Seg}){1,3}|:)|` +
`(?:${v6Seg}:){3}(?:(:${v6Seg}){0,2}:${v4Str}|(:${v6Seg}){1,4}|:)|` +
`(?:${v6Seg}:){2}(?:(:${v6Seg}){0,3}:${v4Str}|(:${v6Seg}){1,5}|:)|` +
`(?:${v6Seg}:){1}(?:(:${v6Seg}){0,4}:${v4Str}|(:${v6Seg}){1,6}|:)|` +
`(?::((?::${v6Seg}){0,5}:${v4Str}|(?::${v6Seg}){1,7}|:))` +
')(%[0-9a-zA-Z-.:]{1,})?$'
)
export function isIPv6(s: string) {
return IPv6Reg.test(s)
}
``` | /content/code_sandbox/packages/next/src/server/lib/is-ipv6.ts | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 665 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.macports.@NAME@</string>
<key>ProcessType</key>
<string>Interactive</string>
<key>Disabled</key>
<false/>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>SessionCreate</key>
<true/>
<key>LaunchOnlyOnce</key>
<false/>
<key>UserName</key>
<string>@USER@</string>
<key>GroupName</key>
<string>@GROUP@</string>
<key>ExitTimeOut</key>
<integer>600</integer>
<key>ProgramArguments</key>
<array>
<string>@PREFIX@/bin/influxd</string>
<string>run</string>
</array>
<key>StandardErrorPath</key>
<string>@LOGFILE@</string>
<key>StandardOutPath</key>
<string>@LOGFILE@</string>
<key>EnvironmentVariables</key>
<dict>
<key>INFLUXD_CONFIG_PATH</key>
<string>@CONF_FILE@</string>
</dict>
</dict>
</plist>
``` | /content/code_sandbox/sysutils/influxdb/files/org.macports.influxdb.plist | xml | 2016-10-09T00:31:44 | 2024-08-16T18:11:47 | macports-ports | macports/macports-ports | 1,499 | 330 |
```xml
<Application x:Class="SkiaSharpSample.App"
xmlns="path_to_url"
xmlns:x="path_to_url"
xmlns:local="clr-namespace:SkiaSharpSample"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
``` | /content/code_sandbox/samples/Gallery/WPF/SkiaSharpSample/App.xaml | xml | 2016-02-22T17:54:43 | 2024-08-16T17:53:42 | SkiaSharp | mono/SkiaSharp | 4,347 | 62 |
```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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.roncoo.education</groupId>
<artifactId>spring-boot-demo-23-1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>spring-boot-demo-23-1</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>2.1.4</version>
</dependency>
<!-- -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!-- mongodb -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.mongo</artifactId>
</dependency>
<!-- caching -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
``` | /content/code_sandbox/spring-boot-demo-23-1/pom.xml | xml | 2016-08-22T02:54:02 | 2024-08-09T03:02:00 | spring-boot-demo | roncoo/spring-boot-demo | 1,718 | 804 |
```xml
import { DisplayMode } from '@microsoft/sp-client-base';
export interface IConfigurationChanged {
listName: string;
sharePointApiUrl: string;
title: string;
description: string;
displayMode: DisplayMode;
}
``` | /content/code_sandbox/samples/angular-multipage/src/webparts/poll/IConfigurationChanged.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 51 |
```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 data-nodes="sql_federation_ds_${0..9}.t_order_${0..9}">
<column name="order_id" type="numeric" />
<column name="user_id" type="numeric" />
<column name="status" type="varchar" />
<column name="merchant_id" type="numeric" />
<column name="remark" type="varchar" />
<column name="creation_date" type="datetime" />
</metadata>
<metadata data-nodes="sql_federation_ds_${0..9}.t_order_item_${0..9}">
<column name="item_id" type="numeric" />
<column name="order_id" type="numeric" />
<column name="user_id" type="numeric" />
<column name="product_id" type="numeric" />
<column name="quantity" type="numeric" />
<column name="creation_date" type="datetime" />
</metadata>
<metadata data-nodes="sql_federation_ds_0.t_user">
<column name="user_id" type="numeric" />
<column name="user_name" type="varchar" />
<column name="password" type="varchar" />
<column name="email" type="varchar" />
<column name="telephone" type="varchar" />
<column name="creation_date" type="datetime" />
</metadata>
<metadata data-nodes="sql_federation_ds_1.t_merchant">
<column name="merchant_id" type="numeric" />
<column name="country_id" type="numeric" />
<column name="merchant_name" type="varchar" />
<column name="business_code" type="varchar" />
<column name="telephone" type="varchar" />
<column name="creation_date" type="datetime" />
</metadata>
<metadata data-nodes="sql_federation_ds_0.t_product">
<column name="product_id" type="numeric" />
<column name="product_name" type="varchar" />
<column name="category_id" type="numeric" />
<column name="price" type="decimal" />
<column name="status" type="varchar" />
<column name="creation_date" type="datetime" />
</metadata>
<metadata data-nodes="sql_federation_ds_0.t_product_extend">
<column name="extend_id" type="int" />
<column name="product_id" type="int" />
<column name="type_int" type="int" />
<column name="type_smallint" type="smallint" />
<column name="type_decimal" type="decimal" />
<column name="type_float" type="float" />
<column name="type_double" type="double" />
<column name="type_bit" type="bit" />
<column name="type_tinyint" type="tinyint" />
<column name="type_mediumint" type="mediumint" />
<column name="type_bigint" type="bigint" />
<column name="type_date" type="Date" />
<column name="type_time" type="time" />
<column name="type_datetime" type="datetime" />
<column name="type_timestamp" type="timestamp" />
<column name="type_year" type="year" />
<column name="type_char" type="char" />
<column name="type_text" type="text" />
<column name="type_varchar" type="varchar" />
<column name="type_longtext" type="longtext" />
<column name="type_longblob" type="longblob" />
<column name="type_mediumtext" type="mediumtext" />
<column name="type_mediumblob" type="mediumblob" />
<column name="type_binary" type="binary" />
<column name="type_varbinary" type="varbinary" />
<column name="type_blob" type="blob" />
<column name="type_enum" type="enum#season" />
<column name="type_set" type="set#season" />
<column name="type_json" type="json" />
<column name="type_unsigned_int" type="int unsigned" />
<column name="type_unsigned_bigint" type="bigint unsigned" />
<column name="type_unsigned_tinyint" type="tinyint unsigned" />
<column name="type_unsigned_smallint" type="smallint unsigned" />
<column name="type_unsigned_float" type="float unsigned" />
<column name="type_unsigned_double" type="double unsigned" />
<column name="type_unsigned_decimal" type="decimal unsigned" />
</metadata>
<metadata data-nodes="sql_federation_ds_1.t_product_detail">
<column name="detail_id" type="numeric" />
<column name="product_id" type="numeric" />
<column name="description" type="varchar" />
<column name="creation_date" type="datetime" />
</metadata>
<metadata data-nodes="sql_federation_ds_${0..9}.t_product_category">
<column name="category_id" type="numeric" />
<column name="category_name" type="varchar" />
<column name="parent_id" type="numeric" />
<column name="level" type="numeric" />
<column name="creation_date" type="datetime" />
</metadata>
<metadata data-nodes="sql_federation_ds_${0..9}.t_country">
<column name="country_id" type="numeric" />
<column name="country_name" type="varchar" />
<column name="continent_name" type="varchar" />
<column name="creation_date" type="datetime" />
</metadata>
<row data-node="sql_federation_ds_0.t_order_0" values="1000, 10, init, 1, test, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_1" values="1001, 10, init, 2, test, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_2" values="1002, 10, init, 3, test, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_3" values="1003, 10, init, 4, test, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_4" values="1004, 10, init, 5, test, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_5" values="1005, 10, init, 6, test, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_6" values="1006, 10, init, 7, test, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_7" values="1007, 10, init, 8, test, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_8" values="1008, 10, init, 9, test, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_9" values="1009, 10, init, 10, test, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_0" values="1100, 11, init, 11, test, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_1" values="1101, 11, init, 12, test, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_2" values="1102, 11, init, 13, test, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_3" values="1103, 11, init, 14, test, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_4" values="1104, 11, init, 15, test, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_5" values="1105, 11, init, 16, test, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_6" values="1106, 11, init, 17, test, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_7" values="1107, 11, init, 18, test, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_8" values="1108, 11, init, 19, test, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_9" values="1109, 11, init, 20, test, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_0" values="1200, 12, init, 1, test, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_1" values="1201, 12, init, 2, test, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_2" values="1202, 12, init, 3, test, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_3" values="1203, 12, init, 4, test, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_4" values="1204, 12, init, 5, test, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_5" values="1205, 12, init, 6, test, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_6" values="1206, 12, init, 7, test, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_7" values="1207, 12, init, 8, test, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_8" values="1208, 12, init, 9, test, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_9" values="1209, 12, init, 10, test, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_0" values="1300, 13, init, 11, test, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_1" values="1301, 13, init, 12, test, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_2" values="1302, 13, init, 13, test, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_3" values="1303, 13, init, 14, test, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_4" values="1304, 13, init, 15, test, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_5" values="1305, 13, init, 16, test, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_6" values="1306, 13, init, 17, test, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_7" values="1307, 13, init, 18, test, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_8" values="1308, 13, init, 19, test, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_9" values="1309, 13, init, 20, test, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_0" values="1400, 14, init, 1, test, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_1" values="1401, 14, init, 2, test, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_2" values="1402, 14, init, 3, test, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_3" values="1403, 14, init, 4, test, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_4" values="1404, 14, init, 5, test, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_5" values="1405, 14, init, 6, test, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_6" values="1406, 14, init, 7, test, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_7" values="1407, 14, init, 8, test, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_8" values="1408, 14, init, 9, test, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_9" values="1409, 14, init, 10, test, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_0" values="1500, 15, init, 11, test, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_1" values="1501, 15, init, 12, test, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_2" values="1502, 15, init, 13, test, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_3" values="1503, 15, init, 14, test, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_4" values="1504, 15, init, 15, test, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_5" values="1505, 15, init, 16, test, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_6" values="1506, 15, init, 17, test, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_7" values="1507, 15, init, 18, test, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_8" values="1508, 15, init, 19, test, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_9" values="1509, 15, init, 20, test, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_0" values="1600, 16, init, 1, test, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_1" values="1601, 16, init, 2, test, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_2" values="1602, 16, init, 3, test, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_3" values="1603, 16, init, 4, test, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_4" values="1604, 16, init, 5, test, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_5" values="1605, 16, init, 6, test, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_6" values="1606, 16, init, 7, test, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_7" values="1607, 16, init, 8, test, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_8" values="1608, 16, init, 9, test, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_9" values="1609, 16, init, 10, test, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_0" values="1700, 17, init, 11, test, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_1" values="1701, 17, init, 12, test, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_2" values="1702, 17, init, 13, test, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_3" values="1703, 17, init, 14, test, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_4" values="1704, 17, init, 15, test, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_5" values="1705, 17, init, 16, test, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_6" values="1706, 17, init, 17, test, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_7" values="1707, 17, init, 18, test, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_8" values="1708, 17, init, 19, test, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_9" values="1709, 17, init, 20, test, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_0" values="1800, 18, init, 1, test, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_1" values="1801, 18, init, 2, test, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_2" values="1802, 18, init, 3, test, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_3" values="1803, 18, init, 4, test, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_4" values="1804, 18, init, 5, test, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_5" values="1805, 18, init, 6, test, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_6" values="1806, 18, init, 7, test, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_7" values="1807, 18, init, 8, test, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_8" values="1808, 18, init, 9, test, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_9" values="1809, 18, init, 10, test, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_0" values="1900, 19, init, 11, test, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_1" values="1901, 19, init, 12, test, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_2" values="1902, 19, init, 13, test, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_3" values="1903, 19, init, 14, test, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_4" values="1904, 19, init, 15, test, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_5" values="1905, 19, init, 16, test, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_6" values="1906, 19, init, 17, test, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_7" values="1907, 19, init, 18, test, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_8" values="1908, 19, init, 19, test, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_9" values="1909, 19, init, 20, test, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_0" values="100000, 1000, 10, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_0" values="100001, 1000, 10, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_1" values="100100, 1001, 10, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_1" values="100101, 1001, 10, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_2" values="100200, 1002, 10, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_2" values="100201, 1002, 10, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_3" values="100300, 1003, 10, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_3" values="100301, 1003, 10, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_4" values="100400, 1004, 10, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_4" values="100401, 1004, 10, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_5" values="100500, 1005, 10, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_5" values="100501, 1005, 10, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_6" values="100600, 1006, 10, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_6" values="100601, 1006, 10, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_7" values="100700, 1007, 10, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_7" values="100701, 1007, 10, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_8" values="100800, 1008, 10, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_8" values="100801, 1008, 10, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_9" values="100900, 1009, 10, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_order_item_9" values="100901, 1009, 10, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_0" values="110000, 1100, 11, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_0" values="110001, 1100, 11, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_1" values="110100, 1101, 11, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_1" values="110101, 1101, 11, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_2" values="110200, 1102, 11, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_2" values="110201, 1102, 11, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_3" values="110300, 1103, 11, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_3" values="110301, 1103, 11, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_4" values="110400, 1104, 11, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_4" values="110401, 1104, 11, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_5" values="110500, 1105, 11, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_5" values="110501, 1105, 11, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_6" values="110600, 1106, 11, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_6" values="110601, 1106, 11, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_7" values="110700, 1107, 11, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_7" values="110701, 1107, 11, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_8" values="110800, 1108, 11, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_8" values="110801, 1108, 11, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_9" values="110900, 1109, 11, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_order_item_9" values="110901, 1109, 11, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_0" values="120000, 1200, 12, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_0" values="120001, 1200, 12, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_1" values="120100, 1201, 12, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_1" values="120101, 1201, 12, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_2" values="120200, 1202, 12, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_2" values="120201, 1202, 12, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_3" values="120300, 1203, 12, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_3" values="120301, 1203, 12, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_4" values="120400, 1204, 12, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_4" values="120401, 1204, 12, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_5" values="120500, 1205, 12, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_5" values="120501, 1205, 12, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_6" values="120600, 1206, 12, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_6" values="120601, 1206, 12, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_7" values="120700, 1207, 12, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_7" values="120701, 1207, 12, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_8" values="120800, 1208, 12, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_8" values="120801, 1208, 12, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_9" values="120900, 1209, 12, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_order_item_9" values="120901, 1209, 12, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_0" values="130000, 1300, 13, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_0" values="130001, 1300, 13, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_1" values="130100, 1301, 13, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_1" values="130101, 1301, 13, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_2" values="130200, 1302, 13, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_2" values="130201, 1302, 13, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_3" values="130300, 1303, 13, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_3" values="130301, 1303, 13, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_4" values="130400, 1304, 13, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_4" values="130401, 1304, 13, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_5" values="130500, 1305, 13, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_5" values="130501, 1305, 13, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_6" values="130600, 1306, 13, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_6" values="130601, 1306, 13, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_7" values="130700, 1307, 13, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_7" values="130701, 1307, 13, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_8" values="130800, 1308, 13, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_8" values="130801, 1308, 13, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_9" values="130900, 1309, 13, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_order_item_9" values="130901, 1309, 13, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_0" values="140000, 1400, 14, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_0" values="140001, 1400, 14, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_1" values="140100, 1401, 14, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_1" values="140101, 1401, 14, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_2" values="140200, 1402, 14, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_2" values="140201, 1402, 14, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_3" values="140300, 1403, 14, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_3" values="140301, 1403, 14, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_4" values="140400, 1404, 14, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_4" values="140401, 1404, 14, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_5" values="140500, 1405, 14, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_5" values="140501, 1405, 14, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_6" values="140600, 1406, 14, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_6" values="140601, 1406, 14, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_7" values="140700, 1407, 14, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_7" values="140701, 1407, 14, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_8" values="140800, 1408, 14, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_8" values="140801, 1408, 14, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_9" values="140900, 1409, 14, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_order_item_9" values="140901, 1409, 14, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_0" values="150000, 1500, 15, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_0" values="150001, 1500, 15, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_1" values="150100, 1501, 15, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_1" values="150101, 1501, 15, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_2" values="150200, 1502, 15, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_2" values="150201, 1502, 15, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_3" values="150300, 1503, 15, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_3" values="150301, 1503, 15, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_4" values="150400, 1504, 15, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_4" values="150401, 1504, 15, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_5" values="150500, 1505, 15, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_5" values="150501, 1505, 15, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_6" values="150600, 1506, 15, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_6" values="150601, 1506, 15, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_7" values="150700, 1507, 15, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_7" values="150701, 1507, 15, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_8" values="150800, 1508, 15, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_8" values="150801, 1508, 15, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_9" values="150900, 1509, 15, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_order_item_9" values="150901, 1509, 15, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_0" values="160000, 1600, 16, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_0" values="160001, 1600, 16, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_1" values="160100, 1601, 16, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_1" values="160101, 1601, 16, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_2" values="160200, 1602, 16, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_2" values="160201, 1602, 16, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_3" values="160300, 1603, 16, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_3" values="160301, 1603, 16, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_4" values="160400, 1604, 16, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_4" values="160401, 1604, 16, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_5" values="160500, 1605, 16, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_5" values="160501, 1605, 16, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_6" values="160600, 1606, 16, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_6" values="160601, 1606, 16, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_7" values="160700, 1607, 16, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_7" values="160701, 1607, 16, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_8" values="160800, 1608, 16, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_8" values="160801, 1608, 16, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_9" values="160900, 1609, 16, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_order_item_9" values="160901, 1609, 16, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_0" values="170000, 1700, 17, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_0" values="170001, 1700, 17, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_1" values="170100, 1701, 17, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_1" values="170101, 1701, 17, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_2" values="170200, 1702, 17, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_2" values="170201, 1702, 17, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_3" values="170300, 1703, 17, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_3" values="170301, 1703, 17, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_4" values="170400, 1704, 17, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_4" values="170401, 1704, 17, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_5" values="170500, 1705, 17, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_5" values="170501, 1705, 17, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_6" values="170600, 1706, 17, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_6" values="170601, 1706, 17, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_7" values="170700, 1707, 17, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_7" values="170701, 1707, 17, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_8" values="170800, 1708, 17, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_8" values="170801, 1708, 17, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_9" values="170900, 1709, 17, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_order_item_9" values="170901, 1709, 17, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_0" values="180000, 1800, 18, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_0" values="180001, 1800, 18, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_1" values="180100, 1801, 18, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_1" values="180101, 1801, 18, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_2" values="180200, 1802, 18, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_2" values="180201, 1802, 18, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_3" values="180300, 1803, 18, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_3" values="180301, 1803, 18, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_4" values="180400, 1804, 18, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_4" values="180401, 1804, 18, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_5" values="180500, 1805, 18, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_5" values="180501, 1805, 18, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_6" values="180600, 1806, 18, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_6" values="180601, 1806, 18, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_7" values="180700, 1807, 18, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_7" values="180701, 1807, 18, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_8" values="180800, 1808, 18, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_8" values="180801, 1808, 18, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_9" values="180900, 1809, 18, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_order_item_9" values="180901, 1809, 18, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_0" values="190000, 1900, 19, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_0" values="190001, 1900, 19, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_1" values="190100, 1901, 19, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_1" values="190101, 1901, 19, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_2" values="190200, 1902, 19, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_2" values="190201, 1902, 19, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_3" values="190300, 1903, 19, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_3" values="190301, 1903, 19, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_4" values="190400, 1904, 19, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_4" values="190401, 1904, 19, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_5" values="190500, 1905, 19, 1, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_5" values="190501, 1905, 19, 2, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_6" values="190600, 1906, 19, 3, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_6" values="190601, 1906, 19, 4, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_7" values="190700, 1907, 19, 5, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_7" values="190701, 1907, 19, 6, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_8" values="190800, 1908, 19, 7, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_8" values="190801, 1908, 19, 8, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_9" values="190900, 1909, 19, 9, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_order_item_9" values="190901, 1909, 19, 10, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="10, zhangsan, 111111, zhangsan@gmail.com, 12345678900, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="11, lisi, 222222, lisi@gmail.com, 12345678901, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="12, wangwu, 333333, wangwu@gmail.com, 12345678902, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="13, zhaoliu, 444444, zhaoliu@gmail.com, 12345678903, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="14, zhuqi, 555555, zhuqi@gmail.com, 12345678904, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="15, liba, 666666, liba@gmail.com, 12345678905, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="16, wangjiu, 777777, wangjiu@gmail.com, 12345678906, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="17, zhuda, 888888, zhuda@gmail.com, 12345678907, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="18, suner, 999999, suner@gmail.com, 12345678908, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="19, zhousan, 123456, zhousan@gmail.com, 12345678909, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="20, tom, 234567, tom@gmail.com, 12345678910, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="21, kobe, 345678, kobe@gmail.com, 12345678911, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="22, jerry, 456789, jerry@gmail.com, 12345678912, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="23, james, 567890, james@gmail.com, 12345678913, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="24, wade, 012345, wade@gmail.com, 12345678914, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="25, rose, 000000, rose@gmail.com, 12345678915, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="26, bosh, 111222, bosh@gmail.com, 12345678916, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="27, jack, 222333, jack@gmail.com, 12345678917, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="28, jordan, 333444, jordan@gmail.com, 12345678918, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_user" values="29, julie, 444555, julie@gmail.com, 12345678919, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="1, 86, tencent, 86000001, 86100000001, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="2, 86, haier, 86000002, 86100000002, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="3, 86, huawei, 86000003, 86100000003, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="4, 86, alibaba, 86000004, 86100000004, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="5, 86, lenovo, 86000005, 86100000005, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="6, 86, moutai, 86000006, 86100000006, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="7, 86, baidu, 86000007, 86100000007, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="8, 86, xiaomi, 86000008, 86100000008, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="9, 86, vivo, 86000009, 86100000009, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="10, 86, oppo, 86000010, 86100000010, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="11, 1, google, 01000011, 01100000011, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="12, 1, walmart, 01000012, 01100000012, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="13, 1, amazon, 01000013, 01100000013, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="14, 1, apple, 01000014, 01100000014, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="15, 1, microsoft, 01000015, 01100000015, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="16, 1, dell, 01000016, 01100000016, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="17, 1, johnson, 01000017, 01100000017, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="18, 1, intel, 01000018, 01100000018, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="19, 1, hp, 01000019, 01100000019, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_merchant" values="20, 1, tesla, 01000020, 01100000020, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="1, qq coins, 2, 200, off sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="2, haier washing machine, 4, 3120.5, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="3, huawei mobile phones, 6, 6666, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="4, alibaba cloud cards, 2, 500, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="5, lenovo mobile phones, 6, 3200, off sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="6, moutai liquor, 8, 3200, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="7, baidu cloud cards, 2, 700, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="8, xiaomi mobile phones, 6, 2799, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="9, vivo mobile phones, 6, 2899, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="10, oppo mobile phones, 6, 2299, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="11, google mobile phones, 6, 3399, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="12, walmart wine, 8, 1000, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="13, amazon cloud cards, 2, 1000, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="14, apple mobile phones, 6, 8200, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="15, microsoft x-box, 9, 5000, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="16, dell xps, 10, 9000, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="17, johnson shampoo, 12, 30, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="18, intel cpu, 10, 1600, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="19, hp computer, 10, 4600, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product" values="20, tesla model 3, 14, 324600, on sale, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_extend" values="1, 1, 1, 1, 1.01, 1.01, 1.01, a, 1, 1000, 100000001, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, A, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, A, A, Blob content, spring, spring, {"key": "value"}, 1, 1, 1, 1, 1.01, 1.01, 1.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="2, 2, 2, 2, 2.01, 2.01, 2.01, b, 2, 2000, 100000002, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, B, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, B, B, Blob content, summer, summer, {"key": "value"}, 2, 2, 2, 2, 2.01, 2.01, 2.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="3, 3, 3, 3, 3.01, 3.01, 3.01, c, 3, 3000, 100000003, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, C, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, C, C, Blob content, autumn, autumn, {"key": "value"}, 3, 3, 3, 3, 3.01, 3.01, 3.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="4, 4, 4, 4, 4.01, 4.01, 4.01, d, 4, 4000, 100000004, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, D, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, D, D, Blob content, winter, winter, {"key": "value"}, 4, 4, 4, 4, 4.01, 4.01, 4.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="5, 5, 5, 5, 5.01, 5.01, 5.01, e, 5, 5000, 100000005, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, E, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, E, E, Blob content, spring, spring, {"key": "value"}, 5, 5, 5, 5, 5.01, 5.01, 5.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="6, 6, 6, 6, 6.01, 6.01, 6.01, f, 6, 6000, 100000006, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, F, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, F, F, Blob content, summer, summer, {"key": "value"}, 6, 6, 6, 6, 6.01, 6.01, 6.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="7, 7, 7, 7, 7.01, 7.01, 7.01, g, 7, 7000, 100000007, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, G, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, G, G, Blob content, autumn, autumn, {"key": "value"}, 7, 7, 7, 7, 7.01, 7.01, 7.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="8, 8, 8, 8, 8.01, 8.01, 8.01, h, 8, 8000, 100000008, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, H, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, H, H, Blob content, winter, winter, {"key": "value"}, 8, 8, 8, 8, 8.01, 8.01, 8.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="9, 9, 9, 9, 9.01, 9.01, 9.01, i, 9, 9000, 100000009, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, I, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, I, I, Blob content, spring, spring, {"key": "value"}, 9, 9, 9, 9, 9.01, 9.01, 9.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="10, 10, 10, 10, 10.01, 10.01, 10.01, j, 10, 10000, 100000010, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, J, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, J, J, Blob content, summer, summer, {"key": "value"}, 10, 10, 10, 10, 10.01, 10.01, 10.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="11, 11, 11, 11, 11.01, 11.01, 11.01, k, 11, 11000, 100000011, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, K, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, K, K, Blob content, autumn, autumn, {"key": "value"}, 11, 11, 11, 11, 11.01, 11.01, 11.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="12, 12, 12, 12, 12.01, 12.01, 12.01, l, 12, 12000, 100000012, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, L, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, L, L, Blob content, winter, winter, {"key": "value"}, 12, 12, 12, 12, 12.01, 12.01, 12.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="13, 13, 13, 13, 13.01, 13.01, 13.01, m, 13, 13000, 100000013, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, M, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, M, M, Blob content, spring, spring, {"key": "value"}, 13, 13, 13, 13, 13.01, 13.01, 13.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="14, 14, 14, 14, 14.01, 14.01, 14.01, n, 14, 14000, 100000014, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, N, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, N, N, Blob content, summer, summer, {"key": "value"}, 14, 14, 14, 14, 14.01, 14.01, 14.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="15, 15, 15, 15, 15.01, 15.01, 15.01, o, 15, 15000, 100000015, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, O, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, O, O, Blob content, autumn, autumn, {"key": "value"}, 15, 15, 15, 15, 15.01, 15.01, 15.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="16, 16, 16, 16, 16.01, 16.01, 16.01, p, 16, 16000, 100000016, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, P, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, P, P, Blob content, winter, winter, {"key": "value"}, 16, 16, 16, 16, 16.01, 16.01, 16.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="17, 17, 17, 17, 17.01, 17.01, 17.01, q, 17, 17000, 100000017, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, Q, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, Q, Q, Blob content, spring, spring, {"key": "value"}, 17, 17, 17, 17, 17.01, 17.01, 17.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="18, 18, 18, 18, 18.01, 18.01, 18.01, r, 18, 18000, 100000018, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, R, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, R, R, Blob content, summer, summer, {"key": "value"}, 18, 18, 18, 18, 18.01, 18.01, 18.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="19, 19, 19, 19, 19.01, 19.01, 19.01, s, 19, 19000, 100000019, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, S, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, S, S, Blob content, autumn, autumn, {"key": "value"}, 19, 19, 19, 19, 19.01, 19.01, 19.01" />
<row data-node="sql_federation_ds_0.t_product_extend" values="20, 20, 20, 20, 20.01, 20.01, 20.01, t, 20, 20000, 100000020, 2024-04-28, 23:59:59, 2024-04-28, 2024-04-28 00:00:00.0, 2024, T, Lorem ipsum dolor sit amet, Varchar, Long text content, Long blob content, Medium text content, Medium blob content, T, T, Blob content, winter, winter, {"key": "value"}, 20, 20, 20, 20, 20.01, 20.01, 20.01" />
<row data-node="sql_federation_ds_1.t_product_detail" values="1, 1, qq coins, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="2, 2, haier washing machine, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="3, 3, huawei mobile phones, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="4, 4, alibaba cloud cards, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="5, 5, lenovo mobile phones, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="6, 6, moutai liquor, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="7, 7, baidu cloud cards, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="8, 8, xiaomi mobile phones, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="9, 9, vivo mobile phones, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="10, 10, oppo mobile phones, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="11, 11, google mobile phones, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="12, 12, walmart wine, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="13, 13, amazon cloud cards, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="14, 14, apple mobile phones, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="15, 15, microsoft x-box, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="16, 16, dell xps, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="17, 17, johnson shampoo, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="18, 18, intel cpu, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="19, 19, hp computer, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_detail" values="20, 20, tesla model 3, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="1, virtual goods, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="2, prepaid cards, 1, 2, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="3, home appliance, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="4, washing machine, 3, 2, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="5, digital products, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="6, mobile phones, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="7, food and drinks, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="8, drinks, 7, 2, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="9, game console, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="10, computer related, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="11, daily commodities, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="12, shampoo, 11, 2, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="13, transportation, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_product_category" values="14, car, 13, 2, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="1, virtual goods, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="2, prepaid cards, 1, 2, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="3, home appliance, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="4, washing machine, 3, 2, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="5, digital products, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="6, mobile phones, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="7, food and drinks, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="8, drinks, 7, 2, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="9, game console, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="10, computer related, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="11, daily commodities, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="12, shampoo, 11, 2, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="13, transportation, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_product_category" values="14, car, 13, 2, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="1, virtual goods, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="2, prepaid cards, 1, 2, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="3, home appliance, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="4, washing machine, 3, 2, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="5, digital products, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="6, mobile phones, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="7, food and drinks, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="8, drinks, 7, 2, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="9, game console, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="10, computer related, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="11, daily commodities, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="12, shampoo, 11, 2, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="13, transportation, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_product_category" values="14, car, 13, 2, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="1, virtual goods, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="2, prepaid cards, 1, 2, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="3, home appliance, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="4, washing machine, 3, 2, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="5, digital products, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="6, mobile phones, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="7, food and drinks, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="8, drinks, 7, 2, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="9, game console, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="10, computer related, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="11, daily commodities, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="12, shampoo, 11, 2, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="13, transportation, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_product_category" values="14, car, 13, 2, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="1, virtual goods, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="2, prepaid cards, 1, 2, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="3, home appliance, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="4, washing machine, 3, 2, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="5, digital products, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="6, mobile phones, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="7, food and drinks, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="8, drinks, 7, 2, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="9, game console, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="10, computer related, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="11, daily commodities, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="12, shampoo, 11, 2, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="13, transportation, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_product_category" values="14, car, 13, 2, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="1, virtual goods, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="2, prepaid cards, 1, 2, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="3, home appliance, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="4, washing machine, 3, 2, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="5, digital products, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="6, mobile phones, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="7, food and drinks, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="8, drinks, 7, 2, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="9, game console, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="10, computer related, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="11, daily commodities, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="12, shampoo, 11, 2, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="13, transportation, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_product_category" values="14, car, 13, 2, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="1, virtual goods, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="2, prepaid cards, 1, 2, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="3, home appliance, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="4, washing machine, 3, 2, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="5, digital products, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="6, mobile phones, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="7, food and drinks, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="8, drinks, 7, 2, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="9, game console, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="10, computer related, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="11, daily commodities, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="12, shampoo, 11, 2, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="13, transportation, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_product_category" values="14, car, 13, 2, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="1, virtual goods, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="2, prepaid cards, 1, 2, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="3, home appliance, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="4, washing machine, 3, 2, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="5, digital products, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="6, mobile phones, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="7, food and drinks, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="8, drinks, 7, 2, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="9, game console, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="10, computer related, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="11, daily commodities, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="12, shampoo, 11, 2, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="13, transportation, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_product_category" values="14, car, 13, 2, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="1, virtual goods, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="2, prepaid cards, 1, 2, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="3, home appliance, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="4, washing machine, 3, 2, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="5, digital products, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="6, mobile phones, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="7, food and drinks, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="8, drinks, 7, 2, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="9, game console, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="10, computer related, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="11, daily commodities, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="12, shampoo, 11, 2, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="13, transportation, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_product_category" values="14, car, 13, 2, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="1, virtual goods, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="2, prepaid cards, 1, 2, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="3, home appliance, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="4, washing machine, 3, 2, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="5, digital products, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="6, mobile phones, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="7, food and drinks, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="8, drinks, 7, 2, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="9, game console, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="10, computer related, 5, 2, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="11, daily commodities, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="12, shampoo, 11, 2, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="13, transportation, 0, 1, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_product_category" values="14, car, 13, 2, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_country" values="1, usa, north america, 2017-08-08" />
<row data-node="sql_federation_ds_0.t_country" values="86, china, asia, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_country" values="1, usa, north america, 2017-08-08" />
<row data-node="sql_federation_ds_1.t_country" values="86, china, asia, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_country" values="1, usa, north america, 2017-08-08" />
<row data-node="sql_federation_ds_2.t_country" values="86, china, asia, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_country" values="1, usa, north america, 2017-08-08" />
<row data-node="sql_federation_ds_3.t_country" values="86, china, asia, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_country" values="1, usa, north america, 2017-08-08" />
<row data-node="sql_federation_ds_4.t_country" values="86, china, asia, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_country" values="1, usa, north america, 2017-08-08" />
<row data-node="sql_federation_ds_5.t_country" values="86, china, asia, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_country" values="1, usa, north america, 2017-08-08" />
<row data-node="sql_federation_ds_6.t_country" values="86, china, asia, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_country" values="1, usa, north america, 2017-08-08" />
<row data-node="sql_federation_ds_7.t_country" values="86, china, asia, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_country" values="1, usa, north america, 2017-08-08" />
<row data-node="sql_federation_ds_8.t_country" values="86, china, asia, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_country" values="1, usa, north america, 2017-08-08" />
<row data-node="sql_federation_ds_9.t_country" values="86, china, asia, 2017-08-08" />
</dataset>
``` | /content/code_sandbox/test/e2e/sql/src/test/resources/env/scenario/db_tbl_sql_federation/data/actual/dataset.xml | xml | 2016-01-18T12:49:26 | 2024-08-16T15:48:11 | shardingsphere | apache/shardingsphere | 19,707 | 27,428 |
```xml
import { IProductionContext } from './ProductionContext';
import { BundlePhase } from './phases/BundlePhase';
import { CodeSplittingPhase } from './phases/CodeSplittingPhase';
import { WarmupPhase } from './phases/WarmupPhase';
export function Engine(productionContext: IProductionContext) {
const defaultPhases = [WarmupPhase, CodeSplittingPhase, BundlePhase];
return {
start: async (phases?: Array<(productionContext: IProductionContext) => void>) => {
phases = phases || defaultPhases;
for (const phase of phases) {
const name = phase.toString().match(/function (\w+)/i)[1];
productionContext.log.info('phase', `Running ${name}`);
await phase(productionContext);
}
},
};
}
``` | /content/code_sandbox/src/production/engine.ts | xml | 2016-10-28T10:37:16 | 2024-07-27T15:17:43 | fuse-box | fuse-box/fuse-box | 4,003 | 175 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="path_to_url">
<item android:top="@dimen/yal_ms_divider_width_half_negative"
android:bottom="@dimen/yal_ms_divider_width_half_negative"
android:right="@dimen/yal_ms_divider_width_half_negative">
<shape android:shape="rectangle">
<stroke android:width="@dimen/yal_ms_divider_width_half" android:color="@color/yal_ms_divider_color" />
<solid android:color="#00000000" />
</shape>
</item>
</layer-list>
``` | /content/code_sandbox/multiselection/src/main/res/drawable/yal_ms_right_side.xml | xml | 2016-10-18T10:43:25 | 2024-07-04T16:43:06 | Multi-Selection | Yalantis/Multi-Selection | 1,378 | 138 |
```xml
import { Client } from '..'; // 'tplink-smarthome-api'
const client = new Client();
client
.getDevice({ host: '10.0.0.60' })
.then(async (device) => {
console.log('Found device:', device.deviceType, device.alias);
if (device.deviceType === 'plug') {
console.log('Turning plug on, then off', device.alias);
await device.setPowerState(true);
await device.setPowerState(false);
}
})
.catch((reason) => {
console.error(reason);
});
``` | /content/code_sandbox/examples/plug-turn-on-off.ts | xml | 2016-07-12T22:34:02 | 2024-08-12T19:23:48 | tplink-smarthome-api | plasticrake/tplink-smarthome-api | 1,015 | 125 |
```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>io.jpress</groupId>
<artifactId>module-page</artifactId>
<version>5.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>io.jpress</groupId>
<artifactId>module-page-model</artifactId>
<dependencies>
<dependency>
<groupId>io.jboot</groupId>
<artifactId>jboot</artifactId>
</dependency>
<dependency>
<groupId>io.jpress</groupId>
<artifactId>jpress-commons</artifactId>
</dependency>
<dependency>
<groupId>io.jpress</groupId>
<artifactId>jpress-core</artifactId>
</dependency>
</dependencies>
</project>
``` | /content/code_sandbox/module-page/module-page-model/pom.xml | xml | 2016-03-26T04:34:41 | 2024-08-16T03:23:49 | jpress | JPressProjects/jpress | 2,652 | 218 |
```xml
/* eslint-disable @angular-eslint/no-input-rename */
import {
Directive,
Injector,
Input,
OnChanges,
OnDestroy,
TemplateRef,
ViewContainerRef,
} from '@angular/core';
import { PropData, PropList } from '../models/props';
@Directive({
exportAs: 'abpPropData',
selector: '[abpPropData]',
standalone: true,
})
export class PropDataDirective<L extends PropList<any>>
extends PropData<InferredData<L>>
implements OnChanges, OnDestroy
{
@Input('abpPropDataFromList') propList?: L;
@Input('abpPropDataWithRecord') record!: InferredData<L>['record'];
@Input('abpPropDataAtIndex') index?: number;
readonly getInjected: InferredData<L>['getInjected'];
constructor(
private tempRef: TemplateRef<any>,
private vcRef: ViewContainerRef,
injector: Injector,
) {
super();
this.getInjected = injector.get.bind(injector);
}
ngOnChanges() {
this.vcRef.clear();
this.vcRef.createEmbeddedView(this.tempRef, {
$implicit: this.data,
index: 0,
});
}
ngOnDestroy() {
this.vcRef.clear();
}
}
type InferredData<L> = PropData<InferredRecord<L>>;
type InferredRecord<L> = L extends PropList<infer R> ? R : never;
``` | /content/code_sandbox/npm/ng-packs/packages/components/extensible/src/lib/directives/prop-data.directive.ts | xml | 2016-12-03T22:56:24 | 2024-08-16T16:24:05 | abp | abpframework/abp | 12,657 | 318 |
```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.
*/
// TypeScript Version: 4.1
/**
* Rounds a double-precision floating-point number toward positive infinity.
*
* @param x - input value
* @returns rounded value
*
* @example
* var v = ceil( -4.2 );
* // returns -4.0
*
* @example
* var v = ceil( 9.99999 );
* // returns 10.0
*
* @example
* var v = ceil( 0.0 );
* // returns 0.0
*
* @example
* var v = ceil( NaN );
* // returns NaN
*/
declare function ceil( x: number ): number;
// EXPORTS //
export = ceil;
``` | /content/code_sandbox/lib/node_modules/@stdlib/math/base/special/ceil/docs/types/index.d.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 198 |
```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 Complex128 = require( '@stdlib/complex/float64/ctor' );
import reim = require( './index' );
// TESTS //
// The function returns a floating-point typed array...
{
reim( new Complex128( 5.0, 3.0 ) ); // $ExpectType Float64Array
}
// The compiler throws an error if the function is provided an argument that is not a complex number...
{
reim( 'abc' ); // $ExpectError
reim( 123 ); // $ExpectError
reim( true ); // $ExpectError
reim( false ); // $ExpectError
reim( [] ); // $ExpectError
reim( {} ); // $ExpectError
reim( ( x: number ): number => x ); // $ExpectError
}
// The compiler throws an error if the function is provided an unsupported number of arguments...
{
reim(); // $ExpectError
reim( new Complex128( 5.0, 3.0 ), 123 ); // $ExpectError
}
``` | /content/code_sandbox/lib/node_modules/@stdlib/complex/float64/reim/docs/types/test.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 272 |
```xml
import { MarkdownString, ThemeIcon, TreeItem, TreeItemCollapsibleState, window } from 'vscode';
import { GlyphChars } from '../../constants';
import type { GitUri } from '../../git/gitUri';
import type { GitBranch } from '../../git/models/branch';
import type { GitLog } from '../../git/models/log';
import type { PullRequest, PullRequestState } from '../../git/models/pullRequest';
import { shortenRevision } from '../../git/models/reference';
import { getHighlanderProviderName } from '../../git/models/remote';
import type { GitStatus } from '../../git/models/status';
import type { GitWorktree } from '../../git/models/worktree';
import { getContext } from '../../system/context';
import { gate } from '../../system/decorators/gate';
import { debug } from '../../system/decorators/log';
import { map } from '../../system/iterable';
import type { Deferred } from '../../system/promise';
import { defer, getSettledValue } from '../../system/promise';
import { pad } from '../../system/string';
import type { ViewsWithWorktrees } from '../viewBase';
import { createViewDecorationUri } from '../viewDecorationProvider';
import { CacheableChildrenViewNode } from './abstract/cacheableChildrenViewNode';
import type { ViewNode } from './abstract/viewNode';
import { ContextValues, getViewNodeId } from './abstract/viewNode';
import { CommitNode } from './commitNode';
import { LoadMoreNode, MessageNode } from './common';
import { CompareBranchNode } from './compareBranchNode';
import { insertDateMarkers } from './helpers';
import { PullRequestNode } from './pullRequestNode';
import { UncommittedFilesNode } from './UncommittedFilesNode';
type State = {
pullRequest: PullRequest | null | undefined;
pendingPullRequest: Promise<PullRequest | undefined> | undefined;
};
export class WorktreeNode extends CacheableChildrenViewNode<'worktree', ViewsWithWorktrees, ViewNode, State> {
limit: number | undefined;
private _branch: GitBranch | undefined;
constructor(
uri: GitUri,
view: ViewsWithWorktrees,
protected override readonly parent: ViewNode,
public readonly worktree: GitWorktree,
private readonly worktreeStatus: { status: GitStatus | undefined; missing: boolean } | undefined,
) {
super('worktree', uri, view, parent);
this.updateContext({ worktree: worktree });
this._uniqueId = getViewNodeId(this.type, this.context);
this.limit = this.view.getNodeLastKnownLimit(this);
}
override get id(): string {
return this._uniqueId;
}
override toClipboard(): string {
return this.worktree.uri.fsPath;
}
get repoPath(): string {
return this.uri.repoPath!;
}
async getChildren(): Promise<ViewNode[]> {
if (this.children == null) {
const branch = this._branch;
let onCompleted: Deferred<void> | undefined;
let pullRequest;
const pullRequestInsertIndex = 0;
if (
branch != null &&
this.view.config.pullRequests.enabled &&
this.view.config.pullRequests.showForBranches &&
(branch.upstream != null || branch.remote) &&
getContext('gitlens:repos:withHostingIntegrationsConnected')?.includes(branch.repoPath)
) {
pullRequest = this.getState('pullRequest');
if (pullRequest === undefined && this.getState('pendingPullRequest') === undefined) {
onCompleted = defer<void>();
const prPromise = this.getAssociatedPullRequest(branch, {
include: ['opened', 'merged'],
});
queueMicrotask(async () => {
await onCompleted?.promise;
// If we are waiting too long, refresh this node to show a spinner while the pull request is loading
let spinner = false;
const timeout = setTimeout(() => {
spinner = true;
this.view.triggerNodeChange(this);
}, 250);
const pr = await prPromise;
clearTimeout(timeout);
// If we found a pull request, insert it into the children cache (if loaded) and refresh the node
if (pr != null && this.children != null) {
this.children.splice(
pullRequestInsertIndex,
0,
new PullRequestNode(this.view, this, pr, branch),
);
}
// Refresh this node to add the pull request node or remove the spinner
if (spinner || pr != null) {
this.view.triggerNodeChange(this);
}
});
}
}
const [logResult, getBranchAndTagTipsResult, unpublishedCommitsResult] = await Promise.allSettled([
this.getLog(),
this.view.container.git.getBranchesAndTagsTipsFn(this.uri.repoPath),
branch != null && !branch.remote
? this.view.container.git.getBranchAheadRange(branch).then(range =>
range
? this.view.container.git.getLogRefsOnly(this.uri.repoPath!, {
limit: 0,
ref: range,
})
: undefined,
)
: undefined,
]);
const log = getSettledValue(logResult);
if (log == null) return [new MessageNode(this.view, this, 'No commits could be found.')];
const children = [];
if (branch != null && pullRequest != null) {
children.push(new PullRequestNode(this.view, this, pullRequest, branch));
}
if (branch != null && this.view.config.showBranchComparison !== false) {
children.push(
new CompareBranchNode(
this.uri,
this.view,
this,
branch,
this.view.config.showBranchComparison,
this.splatted,
),
);
}
const unpublishedCommits = getSettledValue(unpublishedCommitsResult);
const getBranchAndTagTips = getSettledValue(getBranchAndTagTipsResult);
children.push(
...insertDateMarkers(
map(
log.commits.values(),
c =>
new CommitNode(
this.view,
this,
c,
unpublishedCommits?.has(c.ref),
branch,
getBranchAndTagTips,
),
),
this,
),
);
if (log.hasMore) {
children.push(new LoadMoreNode(this.view, this, children[children.length - 1]));
}
if (this.worktreeStatus?.status?.hasChanges) {
children.unshift(new UncommittedFilesNode(this.view, this, this.worktreeStatus.status, undefined));
}
this.children = children;
onCompleted?.fulfill();
}
return this.children;
}
async getTreeItem(): Promise<TreeItem> {
this.splatted = false;
let description = '';
let icon: ThemeIcon | undefined;
let hasChanges = false;
const tooltip = new MarkdownString('', true);
tooltip.isTrusted = true;
const indicators =
this.worktree.main || this.worktree.opened
? ` \u00a0(${
this.worktree.main
? `_main${this.worktree.opened ? ', active_' : '_'}`
: this.worktree.opened
? '_active_'
: ''
})`
: '';
const status = this.worktreeStatus?.status;
const folder = `\\\n$(folder) [\`${
this.worktree.friendlyPath
}\`](command:gitlens.views.revealWorktreeInExplorer?%22${this.worktree.uri.toString()}%22 "Reveal in Explorer")`;
switch (this.worktree.type) {
case 'bare':
icon = new ThemeIcon('folder');
tooltip.appendMarkdown(`${this.worktree.main ? '$(pass) ' : ''}Bare Worktree${indicators}${folder}`);
break;
case 'branch': {
const { branch } = this.worktree;
this._branch = branch;
tooltip.appendMarkdown(
`${this.worktree.main ? '$(pass) ' : ''}Worktree for $(git-branch) \`${
branch?.getNameWithoutRemote() ?? branch?.name
}\`${indicators}${folder}`,
);
icon = new ThemeIcon('git-branch');
if (branch != null) {
if (!branch.remote) {
if (branch.upstream != null) {
let arrows = GlyphChars.Dash;
const remote = await branch.getRemote();
if (!branch.upstream.missing) {
if (remote != null) {
let left;
let right;
for (const { type } of remote.urls) {
if (type === 'fetch') {
left = true;
if (right) break;
} else if (type === 'push') {
right = true;
if (left) break;
}
}
if (left && right) {
arrows = GlyphChars.ArrowsRightLeft;
} else if (right) {
arrows = GlyphChars.ArrowRight;
} else if (left) {
arrows = GlyphChars.ArrowLeft;
}
}
} else {
arrows = GlyphChars.Warning;
}
description = `${branch.getTrackingStatus({
empty: pad(arrows, 0, 2),
suffix: pad(arrows, 2, 2),
})}${branch.upstream.name}`;
tooltip.appendMarkdown(
`\n\nBranch is ${branch.getTrackingStatus({
empty: `${
branch.upstream.missing ? 'missing upstream' : 'up to date with'
} \\\n $(git-branch) \`${branch.upstream.name}\`${
remote?.provider?.name ? ` on ${remote.provider.name}` : ''
}`,
expand: true,
icons: true,
separator: ', ',
suffix: `\\\n$(git-branch) \`${branch.upstream.name}\`${
remote?.provider?.name ? ` on ${remote.provider.name}` : ''
}`,
})}`,
);
} else {
const providerName = getHighlanderProviderName(
await this.view.container.git.getRemotesWithProviders(branch.repoPath),
);
tooltip.appendMarkdown(
`\n\nLocal branch, hasn't been published to ${providerName ?? 'a remote'}`,
);
}
}
}
if (status != null) {
hasChanges = status.hasChanges;
tooltip.appendMarkdown(
`\n\n${status.getFormattedDiffStatus({
prefix: 'Has Uncommitted Changes\\\n',
empty: 'No Uncommitted Changes',
expand: true,
})}`,
);
}
break;
}
case 'detached': {
icon = new ThemeIcon('git-commit');
tooltip.appendMarkdown(
`${this.worktree.main ? '$(pass) ' : ''}Detached Worktree at $(git-commit) ${shortenRevision(
this.worktree.sha,
)}${indicators}${folder}`,
);
if (status != null) {
hasChanges = status.hasChanges;
tooltip.appendMarkdown(
`\n\n${status.getFormattedDiffStatus({
prefix: 'Has Uncommitted Changes',
empty: 'No Uncommitted Changes',
expand: true,
})}`,
);
}
break;
}
}
const pendingPullRequest = this.getState('pendingPullRequest');
if (pendingPullRequest != null) {
tooltip.appendMarkdown(`\n\n$(loading~spin) Loading associated pull request${GlyphChars.Ellipsis}`);
}
const missing = this.worktreeStatus?.missing ?? false;
if (missing) {
tooltip.appendMarkdown(`\n\n${GlyphChars.Warning} Unable to locate worktree path`);
}
const item = new TreeItem(this.worktree.name, TreeItemCollapsibleState.Collapsed);
item.id = this.id;
item.description = description;
item.contextValue = `${ContextValues.Worktree}${this.worktree.main ? '+main' : ''}${
this.worktree.opened ? '+active' : ''
}`;
item.iconPath =
pendingPullRequest != null
? new ThemeIcon('loading~spin')
: this.worktree.opened
? new ThemeIcon('check')
: icon;
item.tooltip = tooltip;
item.resourceUri = createViewDecorationUri('worktree', { hasChanges: hasChanges, missing: missing });
return item;
}
@debug()
override refresh(reset?: boolean) {
super.refresh(true);
if (reset) {
this._log = undefined;
this.deleteState();
}
}
private async getAssociatedPullRequest(
branch: GitBranch,
options?: { include?: PullRequestState[] },
): Promise<PullRequest | undefined> {
let pullRequest = this.getState('pullRequest');
if (pullRequest !== undefined) return Promise.resolve(pullRequest ?? undefined);
let pendingPullRequest = this.getState('pendingPullRequest');
if (pendingPullRequest == null) {
pendingPullRequest = branch.getAssociatedPullRequest(options);
this.storeState('pendingPullRequest', pendingPullRequest);
pullRequest = await pendingPullRequest;
this.storeState('pullRequest', pullRequest ?? null);
this.deleteState('pendingPullRequest');
return pullRequest;
}
return pendingPullRequest;
}
private _log: GitLog | undefined;
private async getLog() {
if (this._log == null) {
this._log = await this.view.container.git.getLog(this.uri.repoPath!, {
ref: this.worktree.sha,
limit: this.limit ?? this.view.config.defaultItemLimit,
});
}
return this._log;
}
get hasMore() {
return this._log?.hasMore ?? true;
}
@gate()
async loadMore(limit?: number | { until?: any }) {
let log = await window.withProgress(
{
location: { viewId: this.view.id },
},
() => this.getLog(),
);
if (!log?.hasMore) return;
log = await log.more?.(limit ?? this.view.config.pageItemLimit);
if (this._log === log) return;
this._log = log;
this.limit = log?.count;
this.children = undefined;
void this.triggerChange(false);
}
}
``` | /content/code_sandbox/src/views/nodes/worktreeNode.ts | xml | 2016-08-08T14:50:30 | 2024-08-15T21:25:09 | vscode-gitlens | gitkraken/vscode-gitlens | 8,889 | 3,170 |
```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="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\programs\psa\key_ladder_demo.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="mbedTLS.vcxproj">
<Project>{46cf2d25-6a36-4189-b59c-e4815388e554}</Project>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{778777A0-393D-45E8-83C1-EAF487236F1F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>key_ladder_demo</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<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 Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<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>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
../../include;../../3rdparty/everest/include/;../../3rdparty/everest/include/everest;../../3rdparty/everest/include/everest/vs2013;../../3rdparty/everest/include/everest/kremlib;../../tests/include </AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>Debug</AdditionalLibraryDirectories>
</Link>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
../../include;../../3rdparty/everest/include/;../../3rdparty/everest/include/everest;../../3rdparty/everest/include/everest/vs2013;../../3rdparty/everest/include/everest/kremlib;../../tests/include </AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>Debug</AdditionalLibraryDirectories>
</Link>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
../../include;../../3rdparty/everest/include/;../../3rdparty/everest/include/everest;../../3rdparty/everest/include/everest/vs2013;../../3rdparty/everest/include/everest/kremlib;../../tests/include </AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>Release</AdditionalLibraryDirectories>
<AdditionalDependencies>bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
../../include;../../3rdparty/everest/include/;../../3rdparty/everest/include/everest;../../3rdparty/everest/include/everest/vs2013;../../3rdparty/everest/include/everest/kremlib;../../tests/include </AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>Release</AdditionalLibraryDirectories>
<AdditionalDependencies>bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
``` | /content/code_sandbox/third_party/mbedtls/repo/visualc/VS2017/key_ladder_demo.vcxproj | xml | 2016-04-08T20:47:41 | 2024-08-16T19:19:28 | openthread | openthread/openthread | 3,445 | 2,187 |
```xml
<vector xmlns:android="path_to_url"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#fff" android:pathData="M12,7L17,12H14V16H10V12H7L12,7M12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20Z" />
</vector>
``` | /content/code_sandbox/app/src/main/res/drawable/up_arrow_circle.xml | xml | 2016-09-23T13:33:17 | 2024-08-15T09:51:19 | xDrip | NightscoutFoundation/xDrip | 1,365 | 204 |
```xml
/**
* As this file is reused in several other files, try to keep it lean and small.
* Importing other npm packages here could lead to needlessly increasing the client bundle size, or end up in a server-only function that don't need it.
*/
function assertValue<T>(v: T | undefined, errorMessage: string): T {
if (v === undefined) {
throw new Error(errorMessage);
}
return v;
}
export const dataset = assertValue(
process.env.NEXT_PUBLIC_SANITY_DATASET,
"Missing environment variable: NEXT_PUBLIC_SANITY_DATASET",
);
export const projectId = assertValue(
process.env.NEXT_PUBLIC_SANITY_PROJECT_ID,
"Missing environment variable: NEXT_PUBLIC_SANITY_PROJECT_ID",
);
/**
* see path_to_url for how versioning works
*/
export const apiVersion =
process.env.NEXT_PUBLIC_SANITY_API_VERSION || "2024-02-28";
/**
* Used to configure edit intent links, for Presentation Mode, as well as to configure where the Studio is mounted in the router.
*/
export const studioUrl = "/studio";
``` | /content/code_sandbox/examples/cms-sanity/sanity/lib/api.ts | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 229 |
```xml
import * as dayjs from "dayjs";
import {
ActionButtons,
Button,
FormControl,
Icon,
NameCard,
Tags,
Tip,
} from "@erxes/ui/src/components";
import { FlexCenter } from "@erxes/ui/src/styles/main";
import { IReport } from "../types";
import { Link } from "react-router-dom";
import React from "react";
import { __ } from "@erxes/ui/src/utils";
type Props = {
report: IReport;
navigate: any;
isChecked: boolean;
toggleReport: (reportId: string, isChecked?: boolean) => void;
removeReports: (reportIds: string[], callback?: any) => void;
};
const Row = (props: Props) => {
const { report, navigate, isChecked, toggleReport, removeReports } = props;
const { updatedBy, createdBy } = report;
const editAction = () => {
return (
<Link to={`/reports/details/${report._id}`}>
<Button btnStyle="link">
<Tip text={__("Edit")} placement="top">
<Icon icon="edit-3" />
</Tip>
</Button>
</Link>
);
};
const removeAction = () => {
const onRemove = () => removeReports([report._id]);
return (
<Tip text={__("Delete")} placement="top">
<Button
id="dashboardDelete"
btnStyle="link"
onClick={onRemove}
icon="times-circle"
/>
</Tip>
);
};
const onCheckReport = (e) => {
if (toggleReport) {
toggleReport(report._id, e.target.checked);
}
};
const onNameClick = () => {
navigate(`/reports/details/${report._id}`);
};
const returnFormattedDateTime = (dateVal: Date) => {
const date = dayjs(dateVal).format("DD/MM/YYYY");
const time = dayjs(dateVal).format("HH:mm");
return `${date} ${time}`;
};
return (
<tr>
<td>
<FormControl
checked={isChecked}
componentclass="checkbox"
onChange={onCheckReport}
/>
</td>
<td onClick={onNameClick}>{report.name}</td>
<td className="text-primary">
<Icon icon="swatchbook" /> <b>{report.chartsCount || 0}</b>
</td>
<td>
<FlexCenter>
<NameCard user={updatedBy} avatarSize={30} />
</FlexCenter>
</td>
<td>
<FlexCenter>
<NameCard user={createdBy} avatarSize={30} />
</FlexCenter>
</td>
<td>
<Icon icon="calendar" />
<span>
{report.updatedAt
? returnFormattedDateTime(new Date(report.updatedAt))
: "-"}
</span>
</td>
<td>
<Icon icon="calendar" />
<span>
{report.createdAt
? returnFormattedDateTime(new Date(report.createdAt))
: "-"}
</span>
</td>
<td>
<Tags tags={report.tags || []} limit={3} />
</td>
<td>
<ActionButtons>
{editAction()}
{removeAction()}
</ActionButtons>
</td>
</tr>
);
};
export default Row;
``` | /content/code_sandbox/packages/plugin-reports-ui/src/components/Row.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 745 |
```xml
import CallHistory from './customer';
export default {
CallHistory,
};
``` | /content/code_sandbox/packages/plugin-calls-api/src/graphql/resolvers/customResolvers/index.ts | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 16 |
```xml
/*
* Squidex Headless CMS
*
* @license
*/
import { booleanAttribute, Component, EventEmitter, Input, Output } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ColorPickerComponent, DropdownComponent, EditableTitleComponent, TagEditorComponent, TranslatePipe, TypedSimpleChanges, WorkflowDto, WorkflowStep, WorkflowStepValues, WorkflowTransition, WorkflowTransitionValues, WorkflowTransitionView } from '@app/shared';
import { WorkflowTransitionComponent } from './workflow-transition.component';
@Component({
standalone: true,
selector: 'sqx-workflow-step',
styleUrls: ['./workflow-step.component.scss'],
templateUrl: './workflow-step.component.html',
imports: [
ColorPickerComponent,
DropdownComponent,
EditableTitleComponent,
FormsModule,
TagEditorComponent,
TranslatePipe,
WorkflowTransitionComponent,
],
})
export class WorkflowStepComponent {
public readonly onBlur: { updateOn: 'blur' } = { updateOn: 'blur' };
@Output()
public makeInitial = new EventEmitter();
@Output()
public transitionAdd = new EventEmitter<WorkflowStep>();
@Output()
public transitionRemove = new EventEmitter<WorkflowTransition>();
@Output()
public transitionUpdate = new EventEmitter<{ transition: WorkflowTransition; values: WorkflowTransitionValues }>();
@Output()
public update = new EventEmitter<WorkflowStepValues>();
@Output()
public rename = new EventEmitter<string>();
@Output()
public remove = new EventEmitter();
@Input({ required: true })
public workflow!: WorkflowDto;
@Input({ required: true })
public step!: WorkflowStep;
@Input({ required: true })
public roles!: ReadonlyArray<string>;
@Input({ transform: booleanAttribute })
public disabled?: boolean | null;
public openSteps!: ReadonlyArray<WorkflowStep>;
public openStep!: WorkflowStep;
public transitions!: ReadonlyArray<WorkflowTransitionView>;
public ngOnChanges(changes: TypedSimpleChanges<this>) {
if (changes.workflow || changes.step) {
this.openSteps = this.workflow.getOpenSteps(this.step);
this.openStep = this.openSteps[0];
this.transitions = this.workflow.getTransitions(this.step);
}
}
public changeTransition(transition: WorkflowTransition, values: WorkflowTransitionValues) {
this.transitionUpdate.emit({ transition, values });
}
public changeName(name: string) {
this.rename.emit(name);
}
public changeColor(color: string) {
this.update.emit({ color });
}
public changeValidate(validate: boolean) {
this.update.emit({ validate });
}
public changeNoUpdate(noUpdate: boolean) {
this.update.emit({ noUpdate });
}
public changeNoUpdateExpression(noUpdateExpression?: string) {
this.update.emit({ noUpdateExpression });
}
public changeNoUpdateRoles(noUpdateRoles?: ReadonlyArray<string>) {
this.update.emit({ noUpdateRoles });
}
}
``` | /content/code_sandbox/frontend/src/app/features/settings/pages/workflows/workflow-step.component.ts | xml | 2016-08-29T05:53:40 | 2024-08-16T17:39:38 | squidex | Squidex/squidex | 2,222 | 621 |
```xml
import { mergeExchanges } from '../scripts/generateZonesConfig.js';
import { OptimizedZonesConfig } from './types.js';
import { fileExists, getJSON, writeJSON } from './utilities.js';
const exchangeConfig = mergeExchanges();
const generateExchangesToIgnore = (
OUT_PATH: string,
zonesConfig: OptimizedZonesConfig
) => {
console.info(`Generating new excluded_aggregated_exchanges.json...`);
const countryKeysToExclude = new Set(
Object.keys(zonesConfig).filter((key) => {
if ((zonesConfig[key].subZoneNames ?? []).length > 0) {
return key;
}
})
);
//Create a list of the exchange keys that we don't want to display in a country view
const unCombinedExchanges = Object.keys(exchangeConfig).filter((key) => {
const split = key.split('->');
const zoneOne = split[0];
const zoneTwo = split[1];
const subzoneSplitOne = zoneOne.split('-');
const subzoneSplitTwo = zoneTwo.split('-');
if (
(zoneOne.includes('-') && countryKeysToExclude.has(subzoneSplitOne[0])) ||
(zoneTwo.includes('-') && countryKeysToExclude.has(subzoneSplitTwo[0]))
) {
return key;
}
});
//Create a list of the exchange keys that we don't want to display in the zone view
const countryExchangesWithSubzones = Object.keys(exchangeConfig).filter((key) => {
const split = key.split('->');
const zoneOne = split[0];
const zoneTwo = split[1];
if (
(!zoneOne.includes('-') && countryKeysToExclude.has(zoneOne)) ||
(!zoneTwo.includes('-') && countryKeysToExclude.has(zoneTwo))
) {
return key;
}
});
const exchanges = {
exchangesToExcludeCountryView: unCombinedExchanges,
exchangesToExcludeZoneView: countryExchangesWithSubzones,
};
const existingExchanges = fileExists(OUT_PATH) ? getJSON(OUT_PATH) : {};
if (JSON.stringify(exchanges) === JSON.stringify(existingExchanges)) {
console.info(`No changes to excluded_aggregated_exchanges.json`);
return;
}
writeJSON(OUT_PATH, exchanges);
};
export { generateExchangesToIgnore };
``` | /content/code_sandbox/web/geo/generateExchangesToExclude.ts | xml | 2016-05-21T16:36:17 | 2024-08-16T17:56:07 | electricitymaps-contrib | electricitymaps/electricitymaps-contrib | 3,437 | 515 |
```xml
import {SizeF2D} from "./SizeF2D";
import {PointF2D} from "./PointF2D";
/**
* Represent a rectangle on a plane
*/
export class RectangleF2D {
public x: number = 0;
public y: number = 0;
public width: number = 0;
public height: number = 0;
/**
*
* @param x
* @param y
* @param width
* @param height
*/
constructor(x: number, y: number, width: number, height: number) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
public static createFromLocationAndSize(location: PointF2D, size: SizeF2D): RectangleF2D {
return new RectangleF2D(location.x, location.y, size.width, size.height);
}
public get Location(): PointF2D {
return new PointF2D(this.x, this.y);
}
public get Size(): SizeF2D {
return new SizeF2D(this.width, this.height);
}
}
``` | /content/code_sandbox/src/Common/DataObjects/RectangleF2D.ts | xml | 2016-02-08T15:47:01 | 2024-08-16T17:49:53 | opensheetmusicdisplay | opensheetmusicdisplay/opensheetmusicdisplay | 1,416 | 251 |
```xml
import { Clock } from 'lucide-react';
import { Datatable } from '@@/datatables';
import { createPersistedStore } from '@@/datatables/types';
import { useTableState } from '@@/datatables/useTableState';
import { useEdgeJobs } from '../queries/useEdgeJobs';
import { TableActions } from './TableActions';
import { columns } from './columns';
const tableKey = 'edge-jobs';
const settingsStore = createPersistedStore(tableKey);
export function EdgeJobsDatatable() {
const jobsQuery = useEdgeJobs();
const tableState = useTableState(settingsStore, tableKey);
return (
<Datatable
columns={columns}
isLoading={jobsQuery.isLoading}
dataset={jobsQuery.data || []}
settingsManager={tableState}
title="Edge Jobs"
titleIcon={Clock}
renderTableActions={(selectedItems) => (
<TableActions selectedItems={selectedItems} />
)}
data-cy="edge-jobs-datatable"
/>
);
}
``` | /content/code_sandbox/app/react/edge/edge-jobs/ListView/EdgeJobsDatatable.tsx | xml | 2016-05-19T20:15:28 | 2024-08-16T19:15:14 | portainer | portainer/portainer | 30,083 | 224 |
```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="es" original="../Resources.resx">
<body>
<trans-unit id="BUILDTASK_ColectFilesInFolder_RootIsNotValid">
<source>The root folder for cllecting files is not a valid directory.({0})</source>
<target state="translated">La carpeta raz para la recoleccin de archivos no es un directorio vlido. ({0})</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_CopyFilesToFolders_CopyFailed">
<source>Copying file {0} to {1} failed. {2}</source>
<target state="translated">No se pudo copiar el archivo {0} en {1}. {2}</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_CopyFilesToFolders_Copying">
<source>Copying {0} to {1}.</source>
<target state="translated">Copiando {0} en {1}.</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_CopyFilesToFolders_DeleteFailed">
<source>Deleting file {0} failed. {1}</source>
<target state="translated">No se pudo eliminar el archivo {0}. {1}</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_CopyFilesToFolders_Deleting">
<source>Deleting {0}.</source>
<target state="translated">Eliminando {0}.</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_CopyFilesToFolders_RetryDelayOutOfRange">
<source>RetryDelay should be greater than zero.</source>
<target state="translated">RetryDelay debe ser mayor que cero.</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_CopyFilesToFolders_UpToDate">
<source>Skip copying {0} to {1}, File {1} is up to date</source>
<target state="translated">Omitir la copia de {0} en {1}, el archivo {1} est actualizado</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_CreateFolder_Failed">
<source>Create Folder {0} failed. {1}</source>
<target state="translated">No se pudo crear la carpeta {0}. {1}</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_DetectAntaresCLR45Error">
<source>Your hosting provider does not yet support ASP.NET 4.6, which your application is configured to use. To learn more about this please visit: path_to_url
<target state="translated">El proveedor de hospedaje an no admite ASP.NET4.6 y la aplicacin est configurada para usarlo. Para obtener ms informacin al respecto, visite path_to_url
<note />
</trans-unit>
<trans-unit id="BUILDTASK_FailedToLoadThisVersionMsDeployTryingTheNext">
<source>Failed to load this version Microsoft.Web.Deployment ({0}) reason: {1}.
Trying the next one specified in $(_MSDeployVersionsToTry)..</source>
<target state="translated">No se pudo cargar esta versin de Microsoft.Web.Deployment ({0}); motivo: {1}.
Se est intentando con la siguiente especificada en $(_MSDeployVersionsToTry).</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_IISSetting_RequireWebAdminDLL">
<source>To include IIS setting, it is required to have assembly Microsoft.Web.Administration installed on the machine.</source>
<target state="translated">Para incluir la configuracin de IIS, es necesario tener el ensamblado Microsoft.Web.Administration instalado en la mquina.</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hash>
<source>Existing package/archiveDir is created by different version of Msdeploy. It is not compatible for incremental build. Mark as Clean needed({0}).</source>
<target state="translated">El paquete o directorio de archivo existente se crea mediante una versin distinta de Msdeploy. No es compatible con la compilacin incremental. Es necesario marcar como limpio({0}).</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_ManifestFile_IISSettingNotInFirst">
<source>Validation failure.IIS Setting should be the first element in the Manifest file.({0})</source>
<target state="translated">Error de validacin. La configuracin de IIS debe ser el primer elemento en el archivo de manifiesto. ({0})</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_MapProjectURLToIisWeb_InvalidProjectURL">
<source>The project URL is not well formed.({0})</source>
<target state="translated">La direccin URL del proyecto no tiene el formato correcto. ({0})</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_MapProjectURLToIisWeb_UnsupportedProjectURL">
<source>The project URL url host name type is not supported.({0})</source>
<target state="translated">No se admite el tipo del nombre host de la direccin URL del proyecto. ({0})</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_MapURIToIisWebServer_AdminRequired">
<source>Retrieving local IIS properties from the URI requires Administrator permission. Please elevate to Administrator before executing the program.</source>
<target state="translated">Para recuperar las propiedades de IIS locales del URI se necesitan permisos de administrador. Eleve sus permisos a administrador antes de ejecutar el programa.</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_RemoveEmptyDirectories_Deleting">
<source>Deleting empty directory {0}.</source>
<target state="translated">Eliminando el directorio vaco {0}.</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_SqlScriptPreprocessFile">
<source>Scanning sql command variable(s) from sql script ({0}).</source>
<target state="translated">Examinando las variables de comando SQL del script SQL ({0}).</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_SqlScriptPreprocessFileDone">
<source>Found {0} sql command variable(s){1}.</source>
<target state="translated">Se encontraron {0} variables de comando SQL{1}.</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_SqlScriptPreprocessFileFailed">
<source>Failed to parse sql command variable sql script ({0}).</source>
<target state="translated">No se pudo analizar el script SQL de variables de comando SQL ({0}).</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_SqlScriptPreprocessFoundMsDeployUnsupportedCommands">
<source>Found {0} unsupported sql command(s) in {1}. The unsupported sql command(s) are: {2}.
Please note ':EXIT' without argument is treated as ':QUIT' command.</source>
<target state="translated">Se encontraron comandos SQL ({0}) no admitidos en {1}. Los comandos SQL no admitidos son: {2}.
Tenga en cuenta que ":EXIT" sin argumento se trata como el comando ":QUIT".</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_SqlScriptPreprocessInvalidSqlScript">
<source>Failed to parse the sql script file {0}. Please make sure the SQL script syntax is correct.
Detail:
{1}.</source>
<target state="translated">No se pudo analizar el archivo de script SQL {0}. Asegrese de que la sintaxis del script SQL es correcta.
Detalles:
{1}.</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_TransformXml_DestinationWriteFailed">
<source>Could not write Destination file: {0}</source>
<target state="translated">No se pudo escribir el archivo de destino: {0}</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_TransformXml_SourceLoadFailed">
<source>Could not open Source file: {0}</source>
<target state="translated">No se pudo abrir el archivo de origen: {0}</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_TransformXml_TransformLoadFailed">
<source>Could not open Transform file: {0}</source>
<target state="translated">No se pudo abrir el archivo de transformacin: {0}</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_TransformXml_TransformOutput">
<source>Output File: {0}</source>
<target state="translated">Archivo de salida: {0}</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_TransformXml_TransformationApply">
<source>Applying Transform File: {0}</source>
<target state="translated">Aplicando el archivo de transformacin: {0}</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_TransformXml_TransformationFailed">
<source>Transformation failed</source>
<target state="translated">Error de transformacin</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_TransformXml_TransformationNoChange">
<source>No transformation occurred, not saving output file</source>
<target state="translated">No se realiz la transformacin, no se guardar el archivo de salida</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_TransformXml_TransformationStart">
<source>Transforming Source File: {0}</source>
<target state="translated">Transformando el archivo de origen: {0}</target>
<note />
</trans-unit>
<trans-unit id="BUILDTASK_TransformXml_TransformationSucceeded">
<source>Transformation succeeded</source>
<target state="translated">La transformacin se realiz correctamente</target>
<note />
</trans-unit>
<trans-unit id="CREATEPROVIDERLIST_FailToCopyFile">
<source>Failded to copy file from '{0}' to '{1}' for SQLExpress Data Publish</source>
<target state="translated">Error al copiar el archivo de '{0}' a '{1}' para SQLExpress Data Publish</target>
<note />
</trans-unit>
<trans-unit id="CREATEPROVIDERLIST_ImportPublishDatabaseSettingNotFound">
<source>Publish Database Setting Source Verification Error: The publish profile specified '{1} ({2})' for '{0}' does not have a corresponding connection string in '{3}'. Because of this publishing has been blocked. If this was intended you can disable this check by specifying the value of "True" for the MSBuild property "IgnoreDatabaseSettingOutOfSync." If this was not intended, open the Publish dialog in Visual Studio with this profile to correct the discrepancy. For more information visit path_to_url </source>
<target state="translated">Error de comprobacin del origen de configuracin de la base de datos de publicacin: el perfil de publicacin "{1} ({2})" especificado para "{0}" no coincide con ninguna cadena de conexin en "{3}". Debido a esto, la publicacin se ha bloqueado. Si se ha hecho de forma intencionada, especifique el valor "True" para la propiedad MSBuild "IgnoreDatabaseSettingOutOfSync" para anular la seleccin de la casilla. En caso contrario, abra el cuadro de dilogo de publicacin en VisualStudio con este perfil y corrija la discrepancia. Para obtener ms informacin, visite path_to_url </target>
<note />
</trans-unit>
<trans-unit id="CREATEPROVIDERLIST_ImportValidationSourceNotFound">
<source>Publish Database Setting Source Verification Error: The source connection string for '{0}' no longer exists in the source '{1}'. Because of this publishing has been blocked. If this was intended you can disable this check by specifying the value of "True" for the MSBuild property "IgnoreDatabaseSettingOutOfSync." If this was not intended, open the Publish dialog in Visual Studio with this profile to correct the discrepancy. For more information visit path_to_url </source>
<target state="translated">Error de comprobacin del origen de configuracin de la base de datos de publicacin: la cadena de conexin de origen de "{0}" ya no existe en el origen "{1}". Debido a esto, la publicacin se ha bloqueado. Si se ha hecho de forma intencionada, especifique el valor "True" para la propiedad MSBuild "IgnoreDatabaseSettingOutOfSync" para anular la seleccin de la casilla. En caso contrario, abra el cuadro de dilogo de publicacin en VisualStudio con este perfil y corrija la discrepancia. Para obtener ms informacin, visite path_to_url </target>
<note />
</trans-unit>
<trans-unit id="CREATEPROVIDERLIST_InvalidMSBuildFormat">
<source>Publish Database Setting Source Verification Error: The publish profile specified '{1}' for '{0}' is not valid and could not be loaded. Review the file for any errors and try again.</source>
<target state="translated">Error de comprobacin de origen de configuracin de base de datos de publicacin: el perfil de publicacin especificado '{1}' para '{0}' no es vlido y no se pudo cargar. Revise el archivo en busca de errores y vuelva a intentarlo.</target>
<note />
</trans-unit>
<trans-unit id="CREATEPROVIDERLIST_InvalidPublishDatabaseSetting">
<source>Publish Database Setting Source Verification Error:The publish profile specified '{1} ({2})' for '{0}' does not have valid $(PublishDatabaseSettings) value. Because of this publishing has been blocked. If this was intended you can disable this check by specifying the value of "True" for the MSBuild property "IgnoreDatabaseSettingOutOfSync." If this was not intended, open the Publish dialog in Visual Studio with this profile to correct the discrepancy. For more information visit path_to_url </source>
<target state="translated">Error de comprobacin del origen de configuracin de la base de datos de publicacin: el perfil de publicacin "{1} ({2})" especificado para "{0}" no tiene un valor $(PublishDatabaseSettings) vlido. Debido a esto, la publicacin se ha bloqueado. Si se ha hecho de forma intencionada, especifique el valor "True" para la propiedad MSBuild "IgnoreDatabaseSettingOutOfSync" para anular la seleccin de la casilla. En caso contrario, abra el cuadro de dilogo de publicacin en VisualStudio con este perfil y corrija la discrepancia. Para obtener ms informacin, visite path_to_url </target>
<note />
</trans-unit>
<trans-unit id="CREATEPROVIDERLIST_MustProviderProvidersXMLorProvidersFile">
<source>CreateProviderList expected either ProvidersXml or ProvidersFile parameter</source>
<target state="translated">CreateProviderList esperaba el parmetro ProvidersXml o ProvidersFile</target>
<note />
</trans-unit>
<trans-unit id="CREATEPROVIDERLIST_NotExpectingAdditionalParameter">
<source>Publish Database Setting encountered an unexpected error. The provider '{0}' doesn't expect any addition arguments '{1}'.</source>
<target state="translated">Error inesperado en la configuracin de la base de datos de publicacin. Este proveedor '{0}' no espera ningn argumento adicional '{1}'.</target>
<note />
</trans-unit>
<trans-unit id="CREATEPROVIDERLIST_NotSupportBothProvidersXMLAndProvidersFile">
<source>CreateProviderList does not support ProvidersXml and ProvidersFile parameters at the same time</source>
<target state="translated">CreateProviderList no admite los parmetros ProvidersXml y ProvidersFile al mismo tiempo</target>
<note />
</trans-unit>
<trans-unit id="CREATEPROVIDERLIST_OutofSyncWithSourcePublishDatabaseSetting">
<source>Publish Database Setting Source Verification Error: The connection '{0}' in the publish profile has changed from what is currently declared for '{1} ({2})'. Because of this publishing has been blocked. If this was intended you can disable this check by specifying the value of "True" for the MSBuild property "IgnoreDatabaseSettingOutOfSync." If this was not intended, open the Publish dialog in Visual Studio with this profile to correct the discrepancy. For more information visit path_to_url </source>
<target state="translated">Error de comprobacin del origen de configuracin de la base de datos de publicacin: la conexin "{0}" del perfil de publicacin ha cambiado respecto a la declaracin actual para "{1} ({2})". Debido a esto, la publicacin se ha bloqueado. Si se ha hecho de forma intencionada, especifique el valor "True" para la propiedad MSBuild "IgnoreDatabaseSettingOutOfSync" para anular la seleccin de la casilla. En caso contrario, abra el cuadro de dilogo de publicacin en VisualStudio con este perfil y corrija la discrepancia. Para obtener ms informacin, visite path_to_url </target>
<note />
</trans-unit>
<trans-unit id="CREATEPROVIDERLIST_SqlExpressPublishRequireLocalDB">
<source>SQL Server Express LocalDB is required in order to publish one or more of your databases. To learn more and install it, follow this link path_to_url </source>
<target state="translated">Se requiere SQL Server Express LocalDB para publicar una o varias bases de datos. Para obtener ms informacin e instalarlo, siga el vnculo path_to_url </target>
<note />
</trans-unit>
<trans-unit id="DeploymentError_MissingDbDacFx">
<source>The remote host does not have the dbDacFx Web Deploy provider installed, which is required for database publishing. To learn more about this visit this link.
FWLink: path_to_url
<target state="translated">El host remoto no tiene instalado el proveedor de Web Deploy dbDacFx, necesario para la publicacin de bases de datos. Para obtener ms informacin, visite este vnculo.
Vnculo redireccionable: path_to_url
<note />
</trans-unit>
<trans-unit id="EFSCRIPT_Generating">
<source>Generating Entity Framework SQL Scripts...</source>
<target state="translated">Generando scripts SQL de Entity Framework...</target>
<note />
</trans-unit>
<trans-unit id="EFSCRIPT_GenerationCompleted">
<source>Generating Entity Framework SQL Scripts completed successfully</source>
<target state="translated">La generacin de scripts SQL de Entity Framework se complet correctamente</target>
<note />
</trans-unit>
<trans-unit id="EFSCRIPT_GenerationFailed">
<source>Entity Framework SQL Script generation failed</source>
<target state="translated">Error al generar scripts SQL de Entity Framework</target>
<note />
</trans-unit>
<trans-unit id="KUDUDEPLOY_AddingFile">
<source>Adding file ({0}).</source>
<target state="translated">Agregando el archivo ({0}).</target>
<note />
</trans-unit>
<trans-unit id="KUDUDEPLOY_AddingFileFailed">
<source>Adding file ({0}) failed. Reason: {1}.</source>
<target state="translated">Error al agregar el archivo ({0}). Motivo: "{1}".</target>
<note />
</trans-unit>
<trans-unit id="KUDUDEPLOY_AzurePublishErrorReason">
<source>Unable to publish to Azure. Error Details : '{0}'.</source>
<target state="translated">No se puede publicar en Azure. Detalles del error: "{0}".</target>
<note />
</trans-unit>
<trans-unit id="KUDUDEPLOY_ConnectionInfoMissing">
<source>Azure connection information cannot be empty.</source>
<target state="translated">La informacin de la conexin de Azure no puede estar vaca.</target>
<note />
</trans-unit>
<trans-unit id="KUDUDEPLOY_CopyingToTempLocation">
<source>Copying all files to temporary location for publish: '{0}'.</source>
<target state="translated">Copiando todos los archivos en la ubicacin temporal para la publicacin: "{0}".</target>
<note />
</trans-unit>
<trans-unit id="KUDUDEPLOY_CopyingToTempLocationCompleted">
<source>Copying all files to temporary location completed.</source>
<target state="translated">Se ha completado la copia de todos los archivos en la ubicacin temporal.</target>
<note />
</trans-unit>
<trans-unit id="KUDUDEPLOY_DeployOutputPathEmpty">
<source>DeployOutputPath property cannot be empty.</source>
<target state="translated">La propiedad DeployOutputPath no puede estar vaca.</target>
<note />
</trans-unit>
<trans-unit id="KUDUDEPLOY_OperationTimeout">
<source>Publish operation timed out.</source>
<target state="translated">Se agot el tiempo de espera de la operacin de publicacin.</target>
<note />
</trans-unit>
<trans-unit id="KUDUDEPLOY_PublishAzure">
<source>Publishing to Azure.</source>
<target state="translated">Publicando en Azure.</target>
<note />
</trans-unit>
<trans-unit id="KUDUDEPLOY_PublishFailed">
<source>Publish Failed.</source>
<target state="translated">Error en la publicacin.</target>
<note />
</trans-unit>
<trans-unit id="KUDUDEPLOY_PublishSucceeded">
<source>Publish Succeeded.</source>
<target state="translated">Se public correctamente.</target>
<note />
</trans-unit>
<trans-unit id="KUDUDEPLOY_PublishZipFailedReason">
<source>Publishing to site '{0}' failed. Reason: '{1}'.</source>
<target state="translated">Error en la publicacin en el sitio "{0}". Motivo: "{1}".</target>
<note />
</trans-unit>
<trans-unit id="MSDEPLOY_EXE_Failed">
<source>Failed to execute msdeploy.exe.</source>
<target state="translated">No se pudo ejecutar msdeploy.exe.</target>
<note />
</trans-unit>
<trans-unit id="MSDEPLOY_EXE_PreviewOnly">
<source>Generate msdeploy.exe command line for preview only.</source>
<target state="translated">Generar la lnea de comandos msdeploy.exe slo para vista previa.</target>
<note />
</trans-unit>
<trans-unit id="MSDEPLOY_EXE_Start">
<source>Running msdeploy.exe.</source>
<target state="translated">Ejecutando msdeploy.exe.</target>
<note />
</trans-unit>
<trans-unit id="MSDEPLOY_EXE_Succeeded">
<source>Successfully execute msdeploy.exe.</source>
<target state="translated">msdeploy.exe se ejecut correctamente.</target>
<note />
</trans-unit>
<trans-unit id="MSDEPLOY_InvalidDestinationCount">
<source>Invalidate destination item count: {0}</source>
<target state="translated">Invalidar recuento de elementos de destino: {0}</target>
<note />
</trans-unit>
<trans-unit id="MSDEPLOY_InvalidSourceCount">
<source>Invalidate source items count: {0}</source>
<target state="translated">Invalidar recuento de elementos de origen: {0}</target>
<note />
</trans-unit>
<trans-unit id="MSDEPLOY_InvalidVerbForTheInput">
<source>Invalid verb({0}) for supplied source ({1}) and destination ({2}).</source>
<target state="translated">verb({0}) no vlido para el origen ({1}) y el destino ({2}) proporcionados.</target>
<note />
</trans-unit>
<trans-unit id="POWERSHELL_PublishProfileParsingError">
<source>Unable to parse the pubxml file {0}.</source>
<target state="translated">No se puede analizar el archivo pubxml {0}.</target>
<note />
</trans-unit>
<trans-unit id="Publich_InvalidPublishToolsVersion_Error">
<source>The publish profile used for publishing was created in a newer version of the Visual Studio Web Publish features. In order to publish using this profile you will need to update your web publish components. To learn more about this, please visit path_to_url
<target state="translated">El perfil de publicacin usado se cre con una versin ms reciente de las caractersticas de publicacin web de VisualStudio. Para realizar la publicacin con este perfil, deber actualizar los componentes de publicacin web. Para obtener ms informacin, visite path_to_url
<note />
</trans-unit>
<trans-unit id="PublishArgumentError_InvalidRemoteServiceUrl">
<source>Invalid Web Deploy service URL</source>
<target state="translated">Direccin URL del servicio Web Deploy no vlida</target>
<note />
</trans-unit>
<trans-unit id="PublishArgumentError_InvalidSiteAppName">
<source>Invalid site/application name</source>
<target state="translated">Nombre de sitio o aplicacin no vlido</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashsformOutputFile">
<source>Auto ConnectionString Transformed {0} into {1}.</source>
<target state="translated">El elemento ConnectionString automtico transform {0} en {1}.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_CheckingForValidMsBuildPropertyValue">
<source>$({0}) is {1}. Validating...</source>
<target state="translated">$({0}) es {1}. Validando...</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashion">
<source>Connection string for setting up this application database.</source>
<target state="translated">Cadena de conexin para configurar esta base de datos de aplicacin.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_DefaultExcludeFileExtentionOutMessage">
<source>Exclude *.out files under root folder.</source>
<target state="translated">Excluir archivos *.out de la carpeta raz.</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashsage">
<source>Exclude all files under obj folder.</source>
<target state="translated">Excluir todos los archivos de la carpeta obj.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_DefaultExcludeSourceControlItems">
<source>Set all .scc .vspscc file as _IgnorableFilesInProjectFolder. Set _CollectFiles_IncludeIgnorableFile to True to include in the packaging.</source>
<target state="translated">Establezca todos los archivos .scc .vspscc como _IgnorableFilesInProjectFolder. Establezca _CollectFiles_IncludeIgnorableFile en True para incluirlos en el empaquetado.</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashiption">
<source>Connection String used by Entity Framework Code First Model to deploy the database.</source>
<target state="translated">Cadena de conexin usada por el primer modelo de cdigo Entity Framework para implementar la base de datos.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_ErrorCannotDeployFromIIS7AboveToLowerIIS">
<source>Deploy with IIS Setting from a IIS 7 or above to a lower verstion of IIS server is not supported. To fix the problem, please set the %24(IncludeIisSettings) to false. Your current setting are $(IncludeIisSettings) is {0}, $(DestinationIisVersion) is {1} and $(LocalIisVersion) is {2}.</source>
<target state="translated">No se admite la implementacin con la configuracin de IIS 7 o posterior en una versin menor del servidor IIS. Para corregir este problema, establezca %24(IncludeIisSettings) en false. La configuracin actual es la siguiente: $(IncludeIisSettings) es {0}, $(DestinationIisVersion) es {1} y $(LocalIisVersion) es {2}.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_ErrorInvalidMSBuildItemCollectionCount">
<source>@({0}) have {1} item(s) in the collection. It should only have {2} item(s).</source>
<target state="translated">@({0}) tiene {1} elementos en la coleccin. Debera tener slo {2} elementos.</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashTrue">
<source>Invalid $({0}): When $({1}) is set True. It is required to have a valid $({0}) to be use for creating parameters correctly.</source>
<target state="translated">$({0}) no vlido: cuando $({1}) est establecido en True. Es necesario tener un $({0}) vlido para crear los parmetros correctamente.</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hash>
<source>'{0}' exists as a folder. You can't package as a single file to be the same path as an existing folder. Please delete the folder before packaging. Alternative,you can call msbuild with /t:CleanWebsitesPackage target to remove it.</source>
<target state="translated">'{0}' existe como carpeta. No puede empaquetar como un solo archivo y que tenga la misma ruta de acceso que una carpeta ya existente. Elimine la carpeta antes del empaquetado. Tambin puede llamar a msbuild con el destino /t:CleanWebsitesPackage para quitarla.</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hash>
<source>'{0}' exists as a file. You can't package as an archive directory to be the same path as an existing file. Please delete the file before packaging. Alternative,you can call msbuild with /t:CleanWebsitesPackage target to remove it.</source>
<target state="translated">'{0}' existe como archivo. No puede empaquetar como un directorio de archivo y que tenga la misma ruta de acceso que un archivo ya existente. Elimine el archivo antes del empaquetado. Tambin puede llamar a msbuild con el destino /t:CleanWebsitesPackage para quitarla.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_ErrorUseIisIsTrueButIisUrlIsEmpty">
<source>IisUrl property is required when UseIis property is True</source>
<target state="translated">Se necesita la propiedad IisUrl cuando la propiedad UseIis es True</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashDependsOnBuildBothTrue">
<source>These two Properties are not compatable: $(UseWPP_CopyWebApplication) and $(PipelineDependsOnBuild) both are True.
Please correct the problem by either set $(Disable_CopyWebApplication) to true or set $(PipelineDependsOnBuild) to false to break the circular build dependency.
Detail: $(UseWPP_CopyWebApplication) make the publsih pipeline (WPP) to be Part of the build and $(PipelineDependsOnBuild) make the WPP depend on build thus cause the build circular build dependency.</source>
<target state="translated">Estas dos propiedades no son compatibles: $(UseWPP_CopyWebApplication) y $(PipelineDependsOnBuild) son ambas True.
Corrija el problema mediante el establecimiento de $(Disable_CopyWebApplication) en true o $(PipelineDependsOnBuild) en false para romper la dependencia de compilacin circular.
Detalles: $(UseWPP_CopyWebApplication) hace que la canalizacin de publicacin (WPP) forme parte de la compilacin y $(PipelineDependsOnBuild) hace que WPP dependa de la compilacin, de forma que se crea una dependencia de compilacin circular.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_ExcludeAllDebugSymbols">
<source>Exclude All Debug Symbols</source>
<target state="translated">Excluir todos los smbolos de depuracin</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_ExcludeAllFilesUnderFolder">
<source>Exclude All files under {0}</source>
<target state="translated">Excluir todos los archivos de {0}</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_FinishGenerateSampleMsDeployBatchScript">
<source>Sample script for deploying this package is generated at the following location:
{0}
For this sample script, you can change the deploy parameters by changing the following file:
{1}</source>
<target state="translated">El script de ejemplo para implementar este paquete se genera en la ubicacin siguiente:
{0}
Para este script de ejemplo, puede cambiar el archivo siguiente para modificar los parmetros de implementacin:
{1}</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_FoundApplicationConfigForTransformation">
<source>Found The following for Config tranformation:
{0}</source>
<target state="translated">Se encontr lo siguiente para la transformacin de configuracin:
{0}</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashion">
<source>Gather all files from project folder except in the exclusion list.</source>
<target state="translated">Recopilar todos los archivos de la carpeta de proyecto excepto los de la lista de exclusin.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_GatherSpecificItemsFromProject">
<source>Gather all files from Project items @({0}). Adding:</source>
<target state="translated">Recopilar todos los archivos de los elementos de proyecto @({0}). Agregando:</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_GatherSpecificItemsFromProjectNoDetail">
<source>Gather all files from Project items @({0}).</source>
<target state="translated">Recopilar todos los archivos de los elementos de proyecto @({0}).</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_GatherSpecificOutputsFromProject">
<source>Gather all files from Project output ({0}). Adding:</source>
<target state="translated">Recopilar todos los archivos de la salida del proyecto ({0}). Agregando:</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_GenerateMsdeploySourceManifestFile">
<source>Generate source manifest file for Web Deploy package/publish ...</source>
<target state="translated">Generar archivo de manifiesto de origen para el empaquetado y publicacin de Web Deploy ...</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_GenerateSampleMsdeployBatchScript">
<source>Generating a sample batch commandline script for deploying this package...</source>
<target state="translated">Generando un script de lnea de comandos por lotes de ejemplo para implementar este paquete...</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_IISAppParameterDescription">
<source>IIS Web Site/Application name</source>
<target state="translated">Nombre de la aplicacin o sitio web de IIS</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_IISAppPhysicalPathDescription">
<source>Physical path for this Web Application.</source>
<target state="translated">Ruta de acceso fsica de esta aplicacin web.</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashConfigToTransformOutputFile">
<source>Insert additional ConnectionString Transformed {0} into {1}.</source>
<target state="translated">Al insertar el elemento ConnectionString adicional se transform {0} en {1}.</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashnfigToTransformOutputFile">
<source>Insert additional EFCodeFirst Database Deployment Transformed {0} into {1}.</source>
<target state="translated">Al insertar la implementacin de base de datos EFCodeFirst adicional se transform {0} en {1}.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_InvalidArgument">
<source>GetPublishingLocalizedString Task encounter invalid argument ID;</source>
<target state="translated">La tarea GetPublishingLocalizedString encontr un identificador de argumento no vlido;</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_MSBuildTargetFailed">
<source>Target {0} failed.</source>
<target state="translated">Error del destino {0}.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_MsBuildPropertySettingValue">
<source>$({0}) is {1}</source>
<target state="translated">$({0}) es {1}</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_PackagingIntoLocation">
<source>Packaging into {0}.</source>
<target state="translated">Empaquetando en {0}.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpEnviroment">
<source>
===========================
Environment-Specific Settings:
--------------------------
</source>
<target state="translated">
===========================
Configuracin especfica del entorno:
--------------------------
</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpEnviromentExplained">
<source>
To customize application-specific settings for each deployment environment (for example, the IIS application name, the physical path, and any connection strings), edit the settings in the following file:
"{0}"</source>
<target state="translated">
Para personalizar la configuracin especfica de la aplicacin para cada entorno de implementacin (por ejemplo, el nombre de aplicacin IIS, la ruta de acceso fsica y las cadenas de conexin), edite la configuracin en el siguiente archivo:
"{0}"</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpMoreInfo">
<source>
===========================
For more information on this deploy script visit: {0}
</source>
<target state="translated">
===========================
Para obtener ms informacin acerca de este script de implementacin, visite: {0}
</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpOptional">
<source>
===========================
Optional Flags:
--------------------------
By Default, this script deploy on the current machine where this script is called with current user credential without agent service. Only pass the following value for advance scenario.
</source>
<target state="translated">
===========================
Marcas opcionales:
--------------------------
De forma predeterminada, este script se implementa en la mquina actual donde se llama al script con las credenciales del usuario actual sin servicio de agente. Pase slo el siguiente valor para un escenario avanzado. Pase slo el siguiente valor para un escenario avanzado.
</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashalFlags">
<source>
[Additional msdeploy.exe flags]
The msdeploy.exe command supports additional flags. You can include any of these additional flags in the "$(ProjectName).Deploy.cmd" file, and the flags are passed through to msdeploy.exe during execution.
Alternatively, you can specify additional flags by setting the "_MsDeployAdditionalFlags" environment variable. These settings are used by this batch file.
Note: Any flag value that includes an equal sign (=) must be enclosed in double quotation marks, as shown in the following example, which will skip deploying the databases that are included in the package:
"-skip:objectName=dbFullSql"
</source>
<target state="translated">
[Marcas de msdeploy.exe adicionales]
El comando msdeploy.exe admite marcas adicionales. Puede incluir cualquiera de estas marcas adicionales en el archivo "$(ProjectName).Deploy.cmd", que se pasan a msdeploy.exe durante la ejecucin.
Tambin puede especificar marcas adicionales estableciendo la variable de entorno "_MsDeployAdditionalFlags". Este archivo por lotes usa esta configuracin.
Nota: los valores de marca que incluyan un signo igual (=) deben encerrarse entre comillas dobles, como se muestra en el ejemplo siguiente, que omitir la implementacin de las bases de datos incluidas en el paquete:
"-skip:objectName=dbFullSql"
</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpOptionalExplainedFlagA">
<source>
/A:<Basic | NTLM>
Specifies the type of authentication to be used. The possible values are NTLM and Basic. If the wmsvc provider setting is specified, the default authentication type is Basic; otherwise, the default authentication type is NTLM.
</source>
<target state="translated">
/A:<Basic | NTLM>
Especifica el tipo de autenticacin que se va a usar. Los valores posibles son NTLM y Basic. Si se especifica la configuracin del proveedor de wmsvc, el tipo de autenticacin predeterminado es Basic; de lo contrario, el tipo de autenticacin predeterminado es NTLM.
</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpOptionalExplainedFlagG">
<source>
/G:<True | False>
Specifies that the package is deployed by creating a temporary listener on the destination server. This requires no special installation on the destination server, but it requires you to be an administrator on that server. The default value of this flag is False.
</source>
<target state="translated">
/G:<True | False>
Especifica que el paquete se implementa creando un cliente de escucha temporal en el servidor de destino. Esto no requiere ninguna instalacin especial en el servidor de destino, pero requiere que sea administrador en ese servidor. El valor predeterminado de esta marca es False.
</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpOptionalExplainedFlagL">
<source>
/L
Specifies that the package is deployed to local IISExpress user instance.
</source>
<target state="translated">
/L
Especifica que el paquete se implementa en la instancia de usuario de IISExpress local.
</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpOptionalExplainedFlagM">
<source>
/M:<Destination server name or Service URL>
If this flag is not specified, the package is installed on the computer where the command is run. The Service URL can be in the following format:
path_to_url
This format requires that IIS 7 be installed on the destination server and that IIS 7 Web Management Service(WMSvc) and Web Deployment Handler be set up.
The service URL can also be in the following format:
path_to_url
This format requires administrative rights on the destination server, and it requires that Web Deploy Remote Service (MsDepSvc) be installed on the destination server. IIS 7 does not have to be installed on the destination server.
</source>
<target state="translated">
/M:<Direccin URL de servicio o nombre del servidor de destino>
Si no se especifica esta marca, el paquete se instala en el equipo donde se ejecuta el comando. La direccin URL de servicio puede tener el siguiente formato:
path_to_url
Este formato requiere que IIS 7 est instalado en el servidor de destino y que estn configurados el Servicio de administracin web (WMSvc) y el Controlador de implementacin web de IIS 7.
La direccin URL de servicio puede tener tambin el siguiente formato:
path_to_url
Este formato requiere derechos administrativos en el servidor de destino y que est instalado el Servicio remoto Web Deploy (MsDepSvc) en el servidor de destino. IIS 7 no tiene que estar instalado en el servidor de destino.
</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpOptionalExplainedFlagUP">
<source>
/U:<UserName>
/P:<Password></source>
<target state="translated">
/U:<UserName>
/P:<Password></target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpPrerequisites">
<source>
===========================
Prerequisites :
--------------------------
To deploy this Web package, Web Deploy (msdeploy.exe) must be installed on the computer that runs the .cmd file. For information about how to install Web Deploy, see the following URL:
{0}
This batch file requires that the package file "{1}" and optionally provided the parameters file "{2}" in the same folder or destination folder by environment variable.
</source>
<target state="translated">
===========================
Requisitos previos:
--------------------------
Para implementar este paquete web, Web Deploy (msdeploy.exe) debe estar instalado en el equipo que ejecuta el archivo .cmd. Para obtener informacin sobre cmo instalar Web Deploy, vea la siguiente direccin URL:
{0}
Este archivo por lotes requiere que el archivo de paquete "{1}" y el archivo de parmetros opcional "{2}" estn en la misma carpeta o carpeta de destino mediante una variable de entorno.
</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpRequired">
<source>
===========================
Required Flags:
--------------------------</source>
<target state="translated">
===========================
Marcas necesarias
--------------------------</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpRequiredExplainedFlagT">
<source>
/T:
Calls msdeploy.exe with the "-whatif" flag, which simulates deployment. This does not deploy the package. Instead, it creates a report of what will happen when you actually deploy the package.</source>
<target state="translated">
/T:
Llama a msdeploy.exe con la marca "-whatif", que simula la implementacin. No implementa el paquete, sino que crea un informe de lo que ocurrir cuando implemente realmente el paquete.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpRequiredExplainedFlagY">
<source>
/Y:
Calls msdeploy.exe without the "-whatif" flag, which deploys the package to the current machine or a destination server. Use /Y after you have verified the output that was generated by using the /T flag.
Note: Do not use /T and /Y in the same command.
</source>
<target state="translated">
/Y:
Llama a msdeploy.exe sin la marca "-whatif", que implementa el paquete en la mquina actual o en un servidor de destino. Use /Y despus de comprobar la salida generada con la marca /T.
Nota: no use /T y /Y en el mismo comando.
</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SampleScriptHelpSection1">
<source>
===========================
Usage:
--------------------------
{0} [/T|/Y] [/M:ComputerName] [/U:UserName] [/P:Password] [/G:UseTempAgent] [Additional msdeploy.exe flags ...]
</source>
<target state="translated">
===========================
Uso:
--------------------------
{0} [/T|/Y] [/M:ComputerName] [/U:UserName] [/P:Password] [/G:UseTempAgent] [Marcas de msdeploy.exe adicionales...]
</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_SqlCommandVariableParameterDescription">
<source>Sql Command Variable for setting up this application database.</source>
<target state="translated">Variable de comando SQL para configurar esta base de datos de aplicacin.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_StartMsDeployPublishToRemote">
<source>Start Web Deploy Publish the Application/package to {0} ...</source>
<target state="translated">Iniciar publicacin de Web Deploy de la aplicacin o paquete en {0} ...</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_TestDeployPackageOnCurrentMachine">
<source>Test deploy this Web Deploy package onto current machine.</source>
<target state="translated">Probar la implementacin de este paquete de Web Deploy en la mquina actual.</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashormOutputFile">
<source>Transformed {0} using {1} into {2}.</source>
<target state="translated">Se transform {0} usando {1} en {2}.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_ValidateErrorMsDeployPublishSetting">
<source>Web Deploy publish/package validating error: Missing or Invalid property value for $({0})</source>
<target state="translated">Error de validacin de empaquetado y publicacin de Web Deploy: falta un valor de propiedad para $({0}) o no es vlido</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_ValidatingMsDeployPublishSettings">
<source>Validating Web Deploy package/publish related properties...</source>
<target state="translated">Validando las propiedades relacionadas de empaquetado y publicacin de Web Deploy...</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashublishAndDeployAsIisApp">
<source>Setting both property values of DeployAsIisApp and IncludeIisSettingsOnPublish to true is not recommended, as IncludeIisSettingsOnPublish is a superset of DeployAsIisApp</source>
<target state="translated">No se recomienda establecer las propiedades DeployAsIisApp e IncludeIisSettingsOnPublish en true, porque IncludeIisSettingsOnPublish es un supraconjunto de DeployAsIisApp</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashnIISSettingIsNotInclude">
<source>Setting value to $(RemoteSitePhysicalPath) might not work if IIS setting is not included</source>
<target state="translated">Si establece el valor en $(RemoteSitePhysicalPath), puede que no funcione si no se incluye la configuracin de IIS</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashtion">
<source>Connection String used in web.config by the application to access the database.</source>
<target state="translated">Cadena de conexin que usa la aplicacin en web.config para obtener acceso a la base de datos.</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashs">
<source>The value for PublishProfile is set to '{0}', expected to find the file at '{1}' but it could not be found.</source>
<target state="translated">El valor de PublishProfile est establecido en '{0}', se esperaba encontrar el archivo en '{1}', pero no se ha encontrado.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_WebPublishMethodIsNotSupportedInCmdLine">
<source>This specific WebPublishMethod({0}) is not yet supported on msbuild command line. Please use Visual Studio to publish.</source>
<target state="translated">Este mtodo WebPublishMethod({0}) todava no es compatible con la lnea de comandos de MsBuild. Use Visual Studio para la publicacin.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_WebPublishPipelineCollectFilesPhase">
<source>Publish Pipeline Collect Files Phase</source>
<target state="translated">Fase de recoleccin de archivos de la canalizacin de publicacin</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_WebPublishPipelineCopyWebApplication">
<source>Copying Web Application Project Files for {0} to {1}.</source>
<target state="translated">Copiando archivos de proyecto de la aplicacin web para {0} en {1}.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_WebPublishPipelineDeployPhase">
<source>Publish Pipeline Deploy Phase</source>
<target state="translated">Fase de implementacin de la canalizacin de publicacin</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_WebPublishPipelineDeployPhaseStage1">
<source>Publish Pipeline Deploy phase Stage {0}</source>
<target state="translated">Paso de fase de implementacin de la canalizacin de publicacin {0}</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_WebPublishPipelineMSDeploySettings">
<source>Invoking Web Deploy to generate the package with the following settings:</source>
<target state="translated">Invocando a Web Deploy para generar el paquete con la siguiente configuracin:</target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hashmpDir">
<source>Copying all files to temporary location below for package/publish:
{0}.</source>
<target state="translated">Copiando todos los archivos en la ubicacin temporal siguiente para el empaquetado y publicacin:
{0}.</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_WebPublishPipelinePhase">
<source>Publish Pipeline {0} Phase</source>
<target state="translated">Fase de {0} de la canalizacin de publicacin</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_WebPublishPipelineTransformPhase">
<source>Publish Pipeline Transform Phase</source>
<target state="translated">Fase de transformacin de la canalizacin de publicacin</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_WebPublishProfileInvalidPropertyValue">
<source>PublishProfile({0}) is set. But the $({1}) does not have a valid value. Current Value is "{2}".</source>
<target state="translated">PublishProfile({0}) est definido, aunque $({1}) no tiene un valor vlido. El valor actual es "{2}".</target>
<note />
</trans-unit>
<trans-unit id="PublishLocalizedString_WebPublishValidatePublishProfileSettings">
<source>Validating PublishProfile({0}) settings.</source>
<target state="translated">Validando configuracin de PublishProfile({0}).</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_AddParameterIntoObject">
<source>Adding Parameter ({0}) with value ({1}) into to object ({2}).</source>
<target state="translated">Agregando el parmetro ({0}) con el valor ({1}) al objeto ({2}).</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_Canceled">
<source>User cancel Web deployment operation.</source>
<target state="translated">El usuario cancel la operacin de implementacin web.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_DuplicateItemMetadata">
<source>The following two items have duplicate item metadata %({0}). The two items data are {1} and {2}.</source>
<target state="translated">Los dos elementos siguientes tienen metadatos de elemento duplicados %({0}). Los dos datos de elemento son {1} y {2}.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_EncryptionExceptionMessage">
<source>An IIS secure setting was detected while packaging/publishing. An encryption password is required to proceed.
In Visual Studio, the password can be entered in the project's Package/Publish property page.
In team build or command line, password can be provided by setting MsBuild $(DeployEncryptKey) property.
Error details:</source>
<target state="translated">Se detect una configuracin segura de IIS durante el empaquetado o la publicacin. Se necesita una contrasea de cifrado para continuar.
En VisualStudio, la contrasea se puede proporcionar en la pgina de propiedades Empaquetar/publicar del proyecto.
En Team Build o en la lnea de comandos, la contrasea se puede proporcionar mediante el establecimiento de la propiedad MsBuild $(DeployEncryptKey).
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_FailedDeploy">
<source>Publish failed to deploy.</source>
<target state="translated">No se pudo implementar la publicacin.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_FailedPackage">
<source>Package failed.</source>
<target state="translated">Error del paquete.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_FailedWithException">
<source>Web deployment task failed. ({0})</source>
<target state="translated">No se pudo realizar la tarea de implementacin web. ({0})</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_FailedWithExceptionWithDetail">
<source>Web deployment task failed. ({0})
{1}</source>
<target state="translated">Error de la tarea de implementacin web. ({0})
{1}</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_InvalidOperation">
<source>Source ({0}) and destination ({1}) are not compatible for given operation.</source>
<target state="translated">El origen ({0}) y el destino ({1}) no son compatibles para la operacin dada.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_InvalidProviderName">
<source>Provider({0})is not a recognized provider.</source>
<target state="translated">({0}) no es un proveedor reconocido.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_InvalidProviderOption">
<source>Unknown ProviderOption:{0}. Known ProviderOptions are:{1}.</source>
<target state="translated">Opcin de proveedor desconocida: {0}. Las opciones de proveedor conocidas son: {1}.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_LoadVSCertUIFailed">
<source>Failed to load publish certificate dialog due to error of {0}</source>
<target state="translated">No se pudo cargar el cuadro de dilogo de certificado de publicacin debido al error {0}</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_MSDEPLOY32bit">
<source>For x86(32 bit): path_to_url
<target state="translated">Para x86 (32bits): path_to_url
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_MSDEPLOY64bit">
<source>For x64(64 bit): path_to_url
<target state="translated">Para x64 (64bits): path_to_url
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_MSDEPLOYASSEMBLYLOAD_FAIL">
<source>Package/Publish task {0} failed to load Web Deploy assemblies. Microsoft Web Deploy is not correctly installed on this machine. Microsoft Web Deploy v3 or higher is recommended.</source>
<target state="translated">La tarea Empaquetar/Publicar {0} no pudo cargar ensamblados Web Deploy. Microsoft Web Deploy no est instalado correctamente en este equipo. Se recomienda Microsoft Web Deploy v3 o superior.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_MSDEPLOYLOADFAIL">
<source>Package/Publish depends on Microsoft Web Deploy technology. Microsoft Web Deploy is not correctly installed on this machine. Please install from following link: {0}{1}. ({2})</source>
<target state="translated">El empaquetado y publicacin depende de la tecnologa de implementacin web de Microsoft. La implementacin web de Microsoft no est instalada correctamente en esta mquina. Instlela desde el siguiente vnculo: {0}{1}. ({2})</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_MSDEPLOYMinVersion">
<source>Package/Publish depends on Microsoft Web Deployment technology. Microsoft Web Deployment is installed but doesn't meet the minimum version requirement. Please reinstall from following link: {0}{1}. (Current Version:{2}, Minimum Version needed:{3})</source>
<target state="translated">El empaquetado y publicacin depende de la tecnologa de implementacin web de Microsoft. La implementacin web de Microsoft est instalada pero no cumple el requisito de versin mnima. Reinstlela desde el siguiente vnculo: {0}{1}. (Versin actual: {2}, versin mnima necesaria: {3})</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_MSDEPLOYVERSIONLOAD">
<source>Package/Publish task {0} load assembly {1}</source>
<target state="translated">Empaquetar/publicar tarea {0}, cargar ensamblado {1}</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_MsDeployExceptionFwlink1Message">
<source>Failed to invoke or execute {0} provider on the web server. The Web Deployment Tool's {0} provider is either not enabled or failed to executed specific commands on the server. Please contact your server administrator for assistance. (Web Deploy Provider is "{0}").
Error details:</source>
<target state="translated">No se pudo invocar ni ejecutar el proveedor {0} en el servidor web. El proveedor {0} de la Herramienta de implementacin web no est habilitado o no pudo ejecutar comandos especficos en el servidor. Pngase en contacto con el administrador del servidor para obtener asistencia. (El proveedor de Web Deploy es "{0}").
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_MsDeployExceptionFwlink1SQLMessage">
<source>Make sure the database connection string for the server is correct and that you have appropriate permission to access the database. (Web Deploy Provider is "{0}").
Error details:</source>
<target state="translated">Asegrese de que la cadena de conexin a base de datos para el servidor es correcta y que tiene el permiso adecuado para acceder a la base de datos. (El proveedor de Web Deploy es "{0}").
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_MsDeployExceptionFwlink1SiteMessage">
<source>Make sure you have appropriate permissions on the server to publish IIS settings. Alternatively, exclude settings that require administrative permissions on the server. (Web Deploy Provider is "{0}").
Error details:</source>
<target state="translated">Asegrese de que tiene los permisos adecuados en el servidor para publicar la configuracin de IIS. Tambin puede excluir la configuracin que requiera permisos administrativos en el servidor. (El proveedor de Web Deploy es "{0}").
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_MsDeployExceptionFwlink2Message">
<source>Make sure you have appropriate permissions on the server to publish IIS settings. Alternatively, exclude settings that require administrative permission on the server.
Error details:</source>
<target state="translated">Asegrese de que tiene los permisos adecuados en el servidor para publicar la configuracin de IIS. Tambin puede excluir la configuracin que requiera permisos administrativos en el servidor.
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_MsDeployExceptionFwlink3Message">
<source>This can occur if the publish process cannot connect to the database on the server. Make sure the database connection string is correct.
Error details:</source>
<target state="translated">Esto puede ocurrir si el proceso de publicacin no puede conectarse a la base de datos del servidor. Asegrese de que la cadena de conexin de base de datos es correcta.
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_MsDeployExceptionFwlink4Message">
<source>Failed to publish the database. This can happen if the remote database cannot run the script. Try modifying the database scripts, or disabling database publishing in the Package/Publish Web properties page. If the script failed due to database tables already exist, try dropping existing database objects before creating new ones. For more information on doing these options from Visual Studio, see path_to_url
Error details:</source>
<target state="translated">No se pudo publicar la base de datos. Esto puede ocurrir si la base de datos remota no puede ejecutar el script. Pruebe a modificar los scripts de la base de datos o a deshabilitar la publicacin de la base de datos en la pgina de propiedades Empaquetar/publicar web. Si el script dio error debido a que ya existen tablas en la base de datos, pruebe a eliminar los objetos existentes en la base de datos antes de crear otros nuevos. Para obtener ms informacin sobre cmo hacer estas tareas en VisualStudio, consulte path_to_url
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_ObjectIdentity">
<source>{0}({1})</source>
<target state="translated">{0}({1})</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_SQLCEMigrationNeedLatestMSDeploy">
<source>Generate schema/data sql scripts from SQLCE require Web Deploy 2.0 and up to function properly. Please install the latest Web Deploy from {0}.</source>
<target state="translated">La generacin de scripts sql de datos/esquema a partir de SQLCE requiere Web Deploy 2.0 o posterior para funcionar correctamente. Instale la versin ms reciente de Web Deploy desde {0}.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_SkipDirectiveSetEnable">
<source>Skip Directive {0} enable state is changed to {1}.</source>
<target state="translated">El estado de habilitacin de la directiva de omisin {0} se ha cambiado a {1}.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_Start">
<source>Starting Web deployment task from source: {0} to Destination: {1}.</source>
<target state="translated">Iniciando la tarea de implementacin web desde el origen:{0} al destino:{1}.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_SucceedArchiveDir">
<source>Package is successfully created as archive directory at the following location:
{0}</source>
<target state="translated">El paquete se cre correctamente como directorio de archivo en la ubicacin siguiente:
{0}</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_SucceedDeploy">
<source>Publish Succeeded.</source>
<target state="translated">Se public correctamente.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_SucceedPackage">
<source>Package "{0}" is successfully created as single file at the following location:
{1}</source>
<target state="translated">El paquete "{0}" se cre correctamente como un solo archivo en la ubicacin siguiente:
{1}</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_Succeeded">
<source>Successfully executed Web deployment task.</source>
<target state="translated">La tarea de implementacin web se ejecut correctamente.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_UnknownParameter">
<source>Unknown Parameter {0}. Source Known Parameters are: {1}.</source>
<target state="translated">Parmetro desconocido {0}. Los parmetros de origen conocidos son: {1}.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_UnknownSkipDirective">
<source>Skip Directive {0} can not be identified.</source>
<target state="translated">No se puede identificar la directiva de omisin {0}.</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_WebException401Message">
<source>Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator.
Error details:</source>
<target state="translated">Asegrese de que el nombre del sitio, el nombre de usuario y la contrasea son correctos. Si no se resuelve el problema, pngase en contacto con el administrador local o del servidor.
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_WebException404Message">
<source>The requested resource does not exist, or the requested URL is incorrect.
Error details:</source>
<target state="translated">El recurso solicitado no existe o la direccin URL solicitada no es correcta.
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_WebException502Message">
<source>Make sure firewall and network settings on your computer and on the server are configured to allow connections between them. If the issue is not resolved, please contact your local or server administrator.
Error details:</source>
<target state="translated">Asegrese de que la configuracin de firewall y red en el equipo y en el servidor permita conexiones entre ellos. Si no se resuelve el problema, pngase en contacto con el administrador local o del servidor.
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_WebException550Message">
<source>Make sure the site that you are deploying to is a valid site on the destination server. If the issue is not resolved, please contact your server administrator.
Error details:</source>
<target state="translated">Asegrese de que el sitio donde va a realizar la implementacin es un sitio vlido en el servidor de destino. Si el problema no se resuelve, pngase en contacto con el administrador del servidor.
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_WebException551Message">
<source>Make sure the appliction that you are deploying to is a valide application on the destination server. If the issue is not resolved, please contact your server administrator.
Error details:</source>
<target state="translated">Asegrese de que la aplicacin donde va a realizar la implementacin es una aplicacin vlida en el servidor de destino. Si el problema no se resuelve, pngase en contacto con el administrador del servidor.
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_WebExceptionConnectFailureMessage">
<source>This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server.
Error details:</source>
<target state="translated">Este error indica que no puede conectarse al servidor. Asegrese de que la direccin URL de servicio es correcta, que la configuracin de firewall y network en este equipo y en el servidor es correcta y que se han iniciado los servicios correspondientes en el servidor.
Detalles del error:</target>
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_WebPackageHelpLink">
<source>path_to_url
<target state="new">path_to_url
<note />
</trans-unit>
<trans-unit id="VSMSDEPLOY_WebPackageHelpLinkMessage">
<source>To get the instructions on how to deploy the web package please visit the following link:</source>
<target state="translated">Para obtener instrucciones para implementar el paquete web, visite el siguiente vnculo:</target>
<note />
</trans-unit>
<trans-unit id="ValidateParameter_ArgumentNullError">
<source>Property '{0}' must be non-empty.</source>
<target state="translated">La propiedad "{0}" no debe estar vaca.</target>
<note />
</trans-unit>
<trans-unit id="WEBDEPLOY_AssemblyInfo_Attribute">
<source>Setting {0}</source>
<target state="translated">Configuracin {0}</target>
<note />
</trans-unit>
<trans-unit id="WEBDEPLOY_AssemblyInfo_Failed">
<source>Failed to Generate AssemblyInfo file.</source>
<target state="translated">No se pudo generar el archivo AssemblyInfo.</target>
<note />
</trans-unit>
<trans-unit id="WEBDEPLOY_AssemblyInfo_Start">
<source>Generating AssemblyInfo.</source>
<target state="translated">Generando informacin del ensamblado.</target>
<note />
</trans-unit>
<trans-unit id="WEBDEPLOY_AssemblyInfo_Succeeded">
<source>Successfully generated AssemblyInfo file.</source>
<target state="translated">El archivo AssemblyInfo se ha generado correctamente.</target>
<note />
</trans-unit>
<trans-unit id="WEBDEPLOY_MERGE_ApplicationPath">
<source>Missing ApplicationPath parameter (the physical path of the precompiled application).</source>
<target state="translated">Falta el parmetro ApplicationPath (la ruta de acceso fsica de la aplicacin precompilada).</target>
<note />
</trans-unit>
<trans-unit id="WEBDEPLOY_MERGE_ContentAssemblyName">
<source>ContentAssembly parameter cannot be combined with the Prefix or NameSingleAssemblyName parameter. If specified, the entire application will be merged to a single assembly with the given name.</source>
<target state="translated">El parmetro ContentAssembly no se puede combinar con los parmetros Prefix o NameSingleAssemblyName. Si se especifica, toda la aplicacin se combinar en un nico ensamblado con el nombre especificado.</target>
<note />
</trans-unit>
<trans-unit id="WEBDEPLOY_MERGE_Failed">
<source>Failed to merge '{0}'.</source>
<target state="translated">No se pudo combinar '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="WEBDEPLOY_MERGE_SingleAssemblyName">
<source>SingleAssemblyName parameter cannot be combined with the Prefix or ContentAssemblyName parameter. If specified, the entire application will be merged to a single assembly with the given name.</source>
<target state="translated">El parmetro SingleAssemblyName no se puede combinar con los parmetros Prefix o ContentAssemblyName. Si se especifica, toda la aplicacin se combinar en un nico ensamblado con el nombre especificado.</target>
<note />
</trans-unit>
<trans-unit id="WEBDEPLOY_MERGE_Start">
<source>Running aspnet_merge.exe.</source>
<target state="translated">Ejecutando aspnet_merge.exe.</target>
<note />
</trans-unit>
<trans-unit id="WEBDEPLOY_MERGE_Succeeded">
<source>Successfully merged '{0}'.</source>
<target state="translated">"{0}" se combin correctamente.</target>
<note />
</trans-unit>
<trans-unit id="WebConfigTransform_HostingModel_Error">
<source>The acceptable value for AspNetCoreHostingModel property is either "InProcess" or "OutOfProcess".</source>
<target state="translated">El valor aceptable para la propiedad AspNetCoreHostingModel es "InProcess" o "OutOfProcess".</target>
<note />
</trans-unit>
<trans-unit id="WebConfigTransform_InvalidHostingOption">
<source>In process hosting is not supported for AspNetCoreModule. Change the AspNetCoreModule to at least AspNetCoreModuleV2.</source>
<target state="translated">No se admite el hospedaje en procesos para AspNetCoreModule. Cambie AspNetCoreModule a AspNetCoreModuleV2 como mnimo.</target>
<note />
</trans-unit>
<trans-unit id="ZIPDEPLOY_Check_DeploymentStatus">
<source>Checking the deployment status...</source>
<target state="translated">Comprobando el estado de la implementacin...</target>
<note />
</trans-unit>
<trans-unit id="ZIPDEPLOY_DeploymentStatus">
<source>Deployment status is {0}.</source>
<target state="translated">El estado de implementacin es {0}.</target>
<note>{0} - Success or failed</note>
</trans-unit>
<trans-unit id="ZIPDEPLOY_DeploymentStatusPolling">
<source>Polling for deployment status...</source>
<target state="translated">Sondeando el estado de implementacin...</target>
<note />
</trans-unit>
<trans-unit id="ZIPDEPLOY_Failed">
<source>Zip Deployment failed. </source>
<target state="translated">No se pudo realizar la implementacin de ZIP. </target>
<note />
</trans-unit>
<trans-unit id="ZIPDEPLOY_FailedDeploy">
<source>The attempt to publish the ZIP file through '{0}' failed with HTTP status code '{1}'.</source>
<target state="translated">Error al intentar publicar el archivo ZIP a travs de "{0}" con el cdigo de estado HTTP "{1}".</target>
<note>{0} - URL to deploy zip, {1} - HTTP response code</note>
</trans-unit>
<trans-unit id="ZIPDEPLOY_FailedDeployWithLogs">
<source>The attempt to publish the ZIP file through '{0}' failed with HTTP status code '{1}'. See the logs at '{2}'.</source>
<target state="translated">Error al intentar publicar el archivo ZIP a travs de "{0}" con el cdigo de estado HTTP "{1}". Consulte los registros en "{2}".</target>
<note>{0} - URL to deploy zip, {1} - HTTP response code, {2} - Logs URL</note>
</trans-unit>
<trans-unit id="ZIPDEPLOY_FailedToRetrieveCred">
<source>Failed to retrieve credentials.</source>
<target state="translated">No se pudieron recuperar las credenciales.</target>
<note />
</trans-unit>
<trans-unit id="ZIPDEPLOY_InvalidSiteNamePublishUrl">
<source>Neither SiteName nor PublishUrl was given a value.</source>
<target state="translated">No se proporcion ningn valor a SiteName ni a PublishUrl.</target>
<note />
</trans-unit>
<trans-unit id="ZIPDEPLOY_PublishingZip">
<source>Publishing {0} to {1}...</source>
<target state="translated">Publicando {0} en {1}...</target>
<note>{0} - Path of zip to publish, {1} - URL to deploy zip</note>
</trans-unit>
<trans-unit id="ZIPDEPLOY_Succeeded">
<source>Zip Deployment succeeded.</source>
<target state="translated">La implementacin de ZIP se realiz correctamente.</target>
<note />
</trans-unit>
<trans-unit id="ZIPDEPLOY_Uploaded">
<source>Uploaded the Zip file to the target.</source>
<target state="translated">El archivo ZIP se ha cargado en el destino.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/src/WebSdk/Publish/Tasks/Properties/xlf/Resources.es.xlf | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 18,443 |
```xml
import * as React from 'react';
import { Avatar, Button, Divider, Segment, Text, Flex } from '@fluentui/react-northstar';
import chatProtoStyle from './chatProtoStyle';
import { ChatData } from './services';
import { TeamCreateIcon, MoreIcon, CallVideoIcon, CallIcon } from '@fluentui/react-icons-northstar';
export interface ChatPaneHeaderProps {
chat?: ChatData;
}
class ChatPaneHeader extends React.PureComponent<ChatPaneHeaderProps> {
render() {
return (
<Flex column>
<Flex.Item>{this.renderBanner()}</Flex.Item>
{this.renderMainArea()}
<Divider size={2} styles={{ padding: '0 32px' }} />
</Flex>
);
}
renderBanner(): React.ReactElement {
return (
<Segment
content={
<TeamCreateIcon styles={{ margin: 'auto 8px' }} variables={siteVars => ({ color: siteVars.colors.white })} />
}
styles={({ variables: v }) => ({
backgroundColor: v.backgroundColor,
borderRadius: 0,
display: 'flex',
height: '40px',
padding: 0,
})}
variables={siteVars => ({ backgroundColor: siteVars.colors.brand[600] })}
/>
);
}
renderMainArea(): React.ReactElement {
const { chat } = this.props;
return (
<Flex
role="region"
aria-labelledby="heading"
hAlign="stretch"
vAlign="center"
styles={{ height: '64px', padding: '0 32px' }}
>
<Avatar name={chat.title} />
<div id="heading" role="heading" aria-level={2} aria-labelledby="chat-header-reader-text chat-header-title">
<div id="chat-header-reader-text" style={chatProtoStyle.screenReaderContainerStyles}>
Chat header
</div>
<Text
id="chat-header-title"
size="large"
content={chat.title}
styles={{ marginLeft: '12px', fontWeight: 600 }}
/>
</div>
<Flex.Item push>{this.renderHeaderButtons()}</Flex.Item>
</Flex>
);
}
renderHeaderButtons(): React.ReactElement {
return (
<div style={{ display: 'inline-flex' }}>
<Button.Group
circular
buttons={[CallVideoIcon, CallIcon].map((Icon, index) => ({
key: index,
icon: <Icon variables={siteVars => ({ color: siteVars.colors.white, margin: 'auto 8px' })} />,
primary: true,
}))}
styles={{ marginRight: '20px' }}
/>
{[TeamCreateIcon, MoreIcon].map((IconComponent, index) => {
return (
<IconComponent
key={`${index}-${name}`}
outline
tabIndex={0}
styles={{
fontWeight: 100,
margin: 'auto',
...(!index && { margin: 'auto 1.6rem auto auto' }),
}}
variables={siteVars => ({ color: siteVars.colors.grey[350] })}
/>
);
})}
</div>
);
}
}
export default ChatPaneHeader;
``` | /content/code_sandbox/packages/fluentui/react-northstar-prototypes/src/prototypes/chatPane/chatPaneHeader.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 698 |
```xml
/* eslint-disable max-len */
import test from 'tape-promise/tape';
import {fixture} from 'test/setup';
import {GL} from '@luma.gl/constants';
import {isWebGL2} from '@luma.gl/webgl-legacy';
import {Buffer, Texture2D, getKey, readPixelsToArray} from '@luma.gl/webgl-legacy';
type WebGLTextureInfo = {
dataFormat: number;
types: number[];
gl2?: boolean;
gl1?: boolean | string;
compressed?: boolean;
}
const WEBGL_TEXTURE_FORMATS: Record<string, WebGLTextureInfo> = {
// Unsized texture format - more performance
[GL.RGB]: {dataFormat: GL.RGB, types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_5_6_5]},
// TODO: format: GL.RGBA type: GL.FLOAT is supported in WebGL1 when 'OES_texure_float' is suported
// we need to update this table structure to specify extensions (gl1ext: 'OES_texure_float', gl2ext: false) for each type.
[GL.RGBA]: {
dataFormat: GL.RGBA,
types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_4_4_4_4, GL.UNSIGNED_SHORT_5_5_5_1]
},
// 32 bit floats
// [GL.R32F]: {dataFormat: GL.RED, types: [GL.FLOAT], gl2: true},
// [GL.RG32F]: {dataFormat: GL.RG, types: [GL.FLOAT], gl2: true},
// [GL.RGB32F]: {dataFormat: GL.RGB, types: [GL.FLOAT], gl2: true},
// [GL.RGBA32F]: {dataFormat: GL.RGBA, types: [GL.FLOAT], gl2: true}
};
export const SAMPLER_PARAMETERS = {
[GL.TEXTURE_MIN_FILTER]: {
[GL.LINEAR]: 'interpolated texel',
[GL.NEAREST]: 'nearest texel',
[GL.NEAREST_MIPMAP_NEAREST]: 'nearest texel in closest mipmap',
[GL.LINEAR_MIPMAP_NEAREST]: 'interpolated texel in closest mipmap',
[GL.NEAREST_MIPMAP_LINEAR]: 'average texel from two closest mipmaps',
[GL.LINEAR_MIPMAP_LINEAR]: 'interpolated texel from two closest mipmaps'
},
[GL.TEXTURE_MAG_FILTER]: {
[GL.LINEAR]: 'interpolated texel',
[GL.NEAREST]: 'nearest texel'
},
[GL.TEXTURE_WRAP_S]: {
[GL.REPEAT]: 'use fractional part of texture coordinates',
[GL.CLAMP_TO_EDGE]: 'clamp texture coordinates',
[GL.MIRRORED_REPEAT]:
'use fractional part of texture coordinate if integer part is odd, otherwise `1 - frac'
},
[GL.TEXTURE_WRAP_T]: {
[GL.REPEAT]: 'use fractional part of texture coordinates',
[GL.CLAMP_TO_EDGE]: 'clamp texture coordinates',
[GL.MIRRORED_REPEAT]:
'use fractional part of texture coordinate if integer part is odd, otherwise `1 - frac'
}
};
export const SAMPLER_PARAMETERS_WEBGL2 = {
[GL.TEXTURE_WRAP_R]: {
[GL.REPEAT]: 'use fractional part of texture coordinates',
[GL.CLAMP_TO_EDGE]: 'clamp texture coordinates',
[GL.MIRRORED_REPEAT]:
'use fractional part of texture coordinate if integer part is odd, otherwise `1 - frac'
},
[GL.TEXTURE_COMPARE_MODE]: {
[GL.NONE]: 'no comparison of `r` coordinate is performed',
[GL.COMPARE_REF_TO_TEXTURE]:
'interpolated and clamped `r` texture coordinate is compared to currently bound depth texture, result is assigned to the red channel'
},
[GL.TEXTURE_COMPARE_FUNC]: {
[GL.LEQUAL]: 'result = 1.0 0.0, r <= D t r > D t',
[GL.GEQUAL]: 'result = 1.0 0.0, r >= D t r < D t',
[GL.LESS]: 'result = 1.0 0.0, r < D t r >= D t',
[GL.GREATER]: 'result = 1.0 0.0, r > D t r <= D t',
[GL.EQUAL]: 'result = 1.0 0.0, r = D t r D t',
[GL.NOTEQUAL]: 'result = 1.0 0.0, r D t r = D t',
[GL.ALWAYS]: 'result = 1.0',
[GL.NEVER]: 'result = 0.0'
}
};
test('WebGL#Texture2D construct/delete', (t) => {
const {gl} = fixture;
t.throws(
// @ts-expect-error
() => new Texture2D(),
/.*WebGLRenderingContext.*/,
'Texture2D throws on missing gl context'
);
const texture = new Texture2D(gl);
t.ok(texture instanceof Texture2D, 'Texture2D construction successful');
t.comment(JSON.stringify(texture.getParameters({keys: true})));
texture.destroy();
t.ok(texture instanceof Texture2D, 'Texture2D delete successful');
texture.destroy();
t.ok(texture instanceof Texture2D, 'Texture2D repeated delete successful');
t.end();
});
function isFormatSupported(format, glContext) {
format = Number(format);
const opts = Object.assign({format}, WEBGL_TEXTURE_FORMATS[format]);
if (!Texture2D.isSupported(glContext, {format}) || (!isWebGL2(glContext) && opts.compressed)) {
return false;
}
return true;
}
test('WebGL#Texture2D check formats', (t) => {
const {gl, gl2} = fixture;
const WEBGL1_FORMATS = [GL.RGB, GL.RGBA];
const WEBGL2_FORMATS = [GL.R32F, GL.RG32F, GL.RGB32F, GL.RGBA32F];
let unSupportedFormats = [];
WEBGL1_FORMATS.forEach((format) => {
if (!isFormatSupported(format, gl)) {
unSupportedFormats.push(format);
}
});
t.deepEqual(unSupportedFormats, [], 'All WebGL1 formats are supported');
if (gl2) {
const gl2Formats = WEBGL1_FORMATS.concat(WEBGL2_FORMATS);
unSupportedFormats = [];
gl2Formats.forEach((format) => {
if (!isFormatSupported(format, gl2)) {
unSupportedFormats.push(format);
}
});
t.deepEqual(unSupportedFormats, [], 'All WebGL2 formats are supported');
} else {
t.comment('WebGL2 not available, skipping tests');
}
t.end();
});
const DEFAULT_TEXTURE_DATA = new Uint8Array([
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]);
const DATA = [1, 0.5, 0.25, 0.125];
const UINT8_DATA = new Uint8Array(DATA);
const UINT16_DATA = new Uint16Array(DATA);
const FLOAT_DATA = new Float32Array(DATA);
const TEXTURE_DATA = {
[GL.UNSIGNED_BYTE]: UINT8_DATA, // RGB_TO[GL.UNSIGNED_BYTE](DATA)),
[GL.UNSIGNED_SHORT_5_6_5]: UINT16_DATA, // RGB_TO[GL.UNSIGNED_SHORT_5_6_5](DATA))
[GL.UNSIGNED_SHORT_4_4_4_4]: UINT16_DATA, // RGB_TO[GL.UNSIGNED_SHORT_5_6_5](DATA))
[GL.UNSIGNED_SHORT_5_5_5_1]: UINT16_DATA, // RGB_TO[GL.UNSIGNED_SHORT_5_6_5](DATA))
[GL.FLOAT]: FLOAT_DATA
};
// const RGB_TO = {
// [GL.UNSIGNED_BYTE]: (r, g, b) => [r * 256, g * 256, b * 256],
// [GL.UNSIGNED_SHORT_5_6_5]: (r, g, b) => r * 32 << 11 + g * 64 << 6 + b * 32
// };
// const RGB_FROM = {
// [GL.UNSIGNED_BYTE]: v => [v[0] / 256, v[1] / 256, v[2] / 256],
// [GL.UNSIGNED_SHORT_5_6_5]: v => [v >> 11 / 32, v >> 6 % 64 / 64, v % 32 * 32]
// };
function testFormatCreation(t, glContext, withData = false) {
for (const formatName in WEBGL_TEXTURE_FORMATS) {
const formatInfo = WEBGL_TEXTURE_FORMATS[formatName];
for (let type of formatInfo.types) {
const format = Number(formatName);
type = Number(type);
const data = withData ? TEXTURE_DATA[type] || DEFAULT_TEXTURE_DATA : null;
const options = Object.assign({}, formatInfo, {
data,
format,
type,
mipmaps: format !== GL.RGB32F, // TODO: for some reason mipmap generation failing for RGB32F format
width: 1,
height: 1
});
if (Texture2D.isSupported(glContext, {format})) {
const texture = new Texture2D(glContext, options);
t.ok(
texture,
`Texture2D({format: ${getKey(glContext, texture.format)}, type: ${getKey(
glContext,
type
)}, dataFormat: ${getKey(glContext, options.dataFormat)}) created`
);
// t.equals(
// texture.format,
// format,
// `Texture2D({format: ${getKey(gl, format)}, type: ${getKey(
// GL,
// type
// )}, dataFormat: ${getKey(gl, options.dataFormat)}) created`
// );
texture.destroy();
}
}
}
}
function testFormatDeduction(t, glContext) {
for (const format in WEBGL_TEXTURE_FORMATS) {
const formatInfo = WEBGL_TEXTURE_FORMATS[format];
const expectedType = formatInfo.types[0];
const expectedDataFormat = formatInfo.dataFormat;
const options = {
format: Number(format),
height: 1,
width: 1,
mipmaps: Number(format) !== GL.RGB32F
};
if (Texture2D.isSupported(glContext, {format: Number(format)})) {
const texture = new Texture2D(glContext, options);
const msg = `Texture2D({format: ${getKey(glContext, format)}}) created`;
t.equals(texture.glFormat, Number(format), msg);
t.equals(texture.type, expectedType, msg);
t.equals(texture.dataFormat, expectedDataFormat, msg);
texture.destroy();
}
}
}
test('WebGL#Texture2D format deduction', (t) => {
const {gl, gl2} = fixture;
testFormatDeduction(t, gl);
if (gl2) {
testFormatDeduction(t, gl2);
} else {
t.comment('WebGL2 not available, skipping tests');
}
t.end();
});
test('WebGL#Texture2D format creation', (t) => {
const {gl, gl2} = fixture;
testFormatCreation(t, gl);
if (gl2) {
// testFormatCreation(t, gl2);
} else {
t.comment('WebGL2 not available, skipping tests');
}
t.end();
});
test('WebGL#Texture2D format creation with data', (t) => {
const {gl, gl2} = fixture;
if (gl2) {
testFormatCreation(t, gl2, true);
} else {
t.comment('WebGL2 not available, skipping tests');
}
testFormatCreation(t, gl, true);
t.end();
});
/*
test('WebGL#Texture2D WebGL1 extension format creation', t => {
const {gl} = fixture;
for (const format of WEBGL_TEXTURE_FORMATS) {
}
let texture = new Texture2D(gl, {});
t.ok(texture instanceof Texture2D, 'Texture2D construction successful');
texture = texture.destroy();
t.ok(texture instanceof Texture2D, 'Texture2D delete successful');
t.end();
});
test('WebGL#Texture2D WebGL2 format creation', t => {
const {gl} = fixture;
for (const format in WEBGL_TEXTURE_FORMATS) {
if (!WEBGL1_FORMATS.indexOf(format)) {
}
}
let texture = new Texture2D(gl, {});
t.ok(texture instanceof Texture2D, 'Texture2D construction successful');
texture = texture.destroy();
t.ok(texture instanceof Texture2D, 'Texture2D delete successful');
t.end();
});
*/
test('WebGL#Texture2D setParameters', (t) => {
const {gl} = fixture;
let texture = new Texture2D(gl, {});
t.ok(texture instanceof Texture2D, 'Texture2D construction successful');
testSamplerParameters({t, texture, parameters: SAMPLER_PARAMETERS});
/*
// Bad tests
const parameter = GL.TEXTURE_MAG_FILTER;
const value = GL.LINEAR_MIPMAP_LINEAR;
texture.setParameters({
[parameter]: value
});
const newValue = texture.getParameter(GL.TEXTURE_MAG_FILTER);
t.equals(newValue, value,
`Texture2D.setParameters({[${getKey(gl, parameter)}]: ${getKey(gl, value)}})`);
*/
texture.destroy();
t.ok(texture instanceof Texture2D, 'Texture2D delete successful');
t.end();
});
test('WebGL2#Texture2D setParameters', (t) => {
const {gl2} = fixture;
if (!gl2) {
t.comment('WebGL2 not available, skipping tests');
t.end();
return;
}
let texture = new Texture2D(gl2, {});
t.ok(texture instanceof Texture2D, 'Texture2D construction successful');
testSamplerParameters({t, texture, parameters: SAMPLER_PARAMETERS_WEBGL2});
texture.destroy();
t.ok(texture instanceof Texture2D, 'Texture2D delete successful');
t.end();
});
test('WebGL#Texture2D NPOT Workaround: texture creation', (t) => {
const {gl} = fixture;
// Create NPOT texture with no parameters
let texture = new Texture2D(gl, {data: null, width: 500, height: 512});
t.ok(texture instanceof Texture2D, 'Texture2D construction successful');
// Default parameters should be changed to supported NPOT parameters.
let minFilter = texture.getParameter(GL.TEXTURE_MIN_FILTER);
t.equals(minFilter, GL.LINEAR, 'NPOT texture min filter is set to LINEAR');
let wrapS = texture.getParameter(GL.TEXTURE_WRAP_S);
t.equals(wrapS, GL.CLAMP_TO_EDGE, 'NPOT texture wrap_s is set to CLAMP_TO_EDGE');
let wrapT = texture.getParameter(GL.TEXTURE_WRAP_T);
t.equals(wrapT, GL.CLAMP_TO_EDGE, 'NPOT texture wrap_t is set to CLAMP_TO_EDGE');
const parameters = {
[GL.TEXTURE_MIN_FILTER]: GL.NEAREST,
[GL.TEXTURE_WRAP_S]: GL.REPEAT,
[GL.TEXTURE_WRAP_T]: GL.MIRRORED_REPEAT
};
// Create NPOT texture with parameters
texture = new Texture2D(gl, {
data: null,
width: 512,
height: 600,
parameters
});
t.ok(texture instanceof Texture2D, 'Texture2D construction successful');
// Above parameters should be changed to supported NPOT parameters.
minFilter = texture.getParameter(GL.TEXTURE_MIN_FILTER);
t.equals(minFilter, GL.NEAREST, 'NPOT texture min filter is set to NEAREST');
wrapS = texture.getParameter(GL.TEXTURE_WRAP_S);
t.equals(wrapS, GL.CLAMP_TO_EDGE, 'NPOT texture wrap_s is set to CLAMP_TO_EDGE');
wrapT = texture.getParameter(GL.TEXTURE_WRAP_T);
t.equals(wrapT, GL.CLAMP_TO_EDGE, 'NPOT texture wrap_t is set to CLAMP_TO_EDGE');
t.end();
});
test('WebGL#Texture2D NPOT Workaround: setParameters', (t) => {
const {gl} = fixture;
// Create NPOT texture
const texture = new Texture2D(gl, {data: null, width: 100, height: 100});
t.ok(texture instanceof Texture2D, 'Texture2D construction successful');
const invalidNPOTParameters = {
[GL.TEXTURE_MIN_FILTER]: GL.LINEAR_MIPMAP_NEAREST,
[GL.TEXTURE_WRAP_S]: GL.MIRRORED_REPEAT,
[GL.TEXTURE_WRAP_T]: GL.REPEAT
};
texture.setParameters(invalidNPOTParameters);
// Above parameters should be changed to supported NPOT parameters.
const minFilter = texture.getParameter(GL.TEXTURE_MIN_FILTER);
t.equals(minFilter, GL.LINEAR, 'NPOT texture min filter is set to LINEAR');
const wrapS = texture.getParameter(GL.TEXTURE_WRAP_S);
t.equals(wrapS, GL.CLAMP_TO_EDGE, 'NPOT texture wrap_s is set to CLAMP_TO_EDGE');
const wrapT = texture.getParameter(GL.TEXTURE_WRAP_T);
t.equals(wrapT, GL.CLAMP_TO_EDGE, 'NPOT texture wrap_t is set to CLAMP_TO_EDGE');
t.end();
});
test('WebGL2#Texture2D NPOT Workaround: texture creation', (t) => {
// WebGL2 supports NPOT texture hence, texture parameters should not be changed.
const {gl2} = fixture;
if (!gl2) {
t.comment('WebGL2 not available, skipping tests');
t.end();
return;
}
// Create NPOT texture with no parameters
let texture = new Texture2D(gl2, {data: null, width: 500, height: 512});
t.ok(texture instanceof Texture2D, 'Texture2D construction successful');
// Default values are un-changed.
let minFilter = texture.getParameter(GL.TEXTURE_MIN_FILTER);
t.equals(
minFilter,
GL.NEAREST_MIPMAP_LINEAR,
'NPOT texture min filter is set to NEAREST_MIPMAP_LINEAR'
);
let wrapS = texture.getParameter(GL.TEXTURE_WRAP_S);
t.equals(wrapS, GL.REPEAT, 'NPOT texture wrap_s is set to REPEAT');
let wrapT = texture.getParameter(GL.TEXTURE_WRAP_T);
t.equals(wrapT, GL.REPEAT, 'NPOT texture wrap_t is set to REPEAT');
const parameters = {
[GL.TEXTURE_MIN_FILTER]: GL.NEAREST,
[GL.TEXTURE_WRAP_S]: GL.REPEAT,
[GL.TEXTURE_WRAP_T]: GL.MIRRORED_REPEAT
};
// Create NPOT texture with parameters
texture = new Texture2D(gl2, {
data: null,
width: 512,
height: 600,
parameters
});
t.ok(texture instanceof Texture2D, 'Texture2D construction successful');
minFilter = texture.getParameter(GL.TEXTURE_MIN_FILTER);
t.equals(minFilter, GL.NEAREST, 'NPOT texture min filter is set to NEAREST');
wrapS = texture.getParameter(GL.TEXTURE_WRAP_S);
t.equals(wrapS, GL.REPEAT, 'NPOT texture wrap_s is set to REPEAT');
wrapT = texture.getParameter(GL.TEXTURE_WRAP_T);
t.equals(wrapT, GL.MIRRORED_REPEAT, 'NPOT texture wrap_t is set to MIRRORED_REPEAT');
t.end();
});
test('WebGL2#Texture2D NPOT Workaround: setParameters', (t) => {
const {gl2} = fixture;
if (!gl2) {
t.comment('WebGL2 not available, skipping tests');
t.end();
return;
}
// Create NPOT texture
const texture = new Texture2D(gl2, {data: null, width: 100, height: 100});
t.ok(texture instanceof Texture2D, 'Texture2D construction successful');
const invalidNPOTParameters = {
[GL.TEXTURE_MIN_FILTER]: GL.LINEAR_MIPMAP_NEAREST,
[GL.TEXTURE_WRAP_S]: GL.MIRRORED_REPEAT,
[GL.TEXTURE_WRAP_T]: GL.REPEAT
};
texture.setParameters(invalidNPOTParameters);
// Above parameters are not changed for NPOT texture when using WebGL2 context.
const minFilter = texture.getParameter(GL.TEXTURE_MIN_FILTER);
t.equals(
minFilter,
GL.LINEAR_MIPMAP_NEAREST,
'NPOT texture min filter is set to LINEAR_MIPMAP_NEAREST'
);
const wrapS = texture.getParameter(GL.TEXTURE_WRAP_S);
t.equals(wrapS, GL.MIRRORED_REPEAT, 'NPOT texture wrap_s is set to MIRRORED_REPEAT');
const wrapT = texture.getParameter(GL.TEXTURE_WRAP_T);
t.equals(wrapT, GL.REPEAT, 'NPOT texture wrap_t is set to REPEAT');
t.end();
});
test('WebGL1#Texture2D setImageData', (t) => {
const {gl} = fixture;
const texture = new Texture2D(gl, {data: null, width: 2, height: 1, mipmaps: false});
t.deepEquals(readPixelsToArray(texture), new Float32Array(8), 'Pixels are empty');
// data: typed array
const data = new Uint8Array([0, 1, 2, 3, 128, 201, 255, 255]);
texture.setImageData({data});
t.deepEquals(readPixelsToArray(texture), data, 'Pixels are set correctly');
// data: canvas
if (typeof document !== 'undefined') {
const canvas = document.createElement('canvas');
canvas.width = 2;
canvas.height = 1;
const ctx = canvas.getContext('2d')!;
const imageData = ctx.getImageData(0, 0, 2, 1);
imageData.data[2] = 128;
imageData.data[3] = 255;
imageData.data[7] = 1;
ctx.putImageData(imageData, 0, 0);
texture.setImageData({data: canvas});
t.deepEquals(
readPixelsToArray(texture),
new Uint8Array([0, 0, 128, 255, 0, 0, 0, 1]),
'Pixels are set correctly'
);
}
t.end();
});
test('WebGL2#Texture2D setImageData', (t) => {
const {gl2} = fixture;
if (!gl2) {
t.comment('WebGL2 not available, skipping tests');
t.end();
return;
}
let data;
// data: null
const texture = new Texture2D(gl2, {
data: null,
width: 2,
height: 1,
format: GL.RGBA32F,
type: GL.FLOAT,
mipmaps: false
});
t.deepEquals(readPixelsToArray(texture), new Float32Array(8), 'Pixels are empty');
// data: typed array
data = new Float32Array([0.1, 0.2, -3, -2, 0, 0.5, 128, 255]);
texture.setImageData({data});
t.deepEquals(readPixelsToArray(texture), data, 'Pixels are set correctly');
// data: buffer
data = new Float32Array([21, 0.82, 0, 1, 0, 255, 128, 3.333]);
const buffer = new Buffer(gl2, {data, accessor: {size: 4, type: GL.FLOAT}});
texture.setImageData({data: buffer});
t.deepEquals(readPixelsToArray(texture), data, 'Pixels are set correctly');
// data: canvas
if (typeof document !== 'undefined') {
const canvas = document.createElement('canvas');
canvas.width = 2;
canvas.height = 1;
const ctx = canvas.getContext('2d');
ctx.fillRect(0, 0, 2, 1);
texture.setImageData({data: canvas});
t.deepEquals(
readPixelsToArray(texture),
new Float32Array([0, 0, 0, 1, 0, 0, 0, 1]),
'Pixels are set correctly'
);
}
t.end();
});
test('WebGL1#Texture2D setSubImageData', (t) => {
const {gl} = fixture;
// data: null
const texture = new Texture2D(gl, {data: null, width: 2, height: 1, mipmaps: false});
t.deepEquals(readPixelsToArray(texture), new Uint8Array(8), 'Pixels are empty');
// data: typed array
const data = new Uint8Array([1, 2, 3, 4]);
texture.setSubImageData({data, x: 0, y: 0, width: 1, height: 1});
t.deepEquals(
readPixelsToArray(texture),
new Uint8Array([1, 2, 3, 4, 0, 0, 0, 0]),
'Pixels are set correctly'
);
// data: canvas
if (typeof document !== 'undefined') {
const canvas = document.createElement('canvas');
canvas.width = 1;
canvas.height = 1;
const ctx = canvas.getContext('2d');
ctx.fillRect(0, 0, 1, 1);
texture.setSubImageData({data: canvas, x: 1, y: 0, width: 1, height: 1});
t.deepEquals(
readPixelsToArray(texture),
new Uint8Array([1, 2, 3, 4, 0, 0, 0, 255]),
'Pixels are set correctly'
);
}
t.end();
});
test('WebGL2#Texture2D setSubImageData', (t) => {
const {gl2} = fixture;
if (!gl2) {
t.comment('WebGL2 not available, skipping tests');
t.end();
return;
}
let data;
// data: null
const texture = new Texture2D(gl2, {
data: null,
width: 2,
height: 1,
format: GL.RGBA32F,
type: GL.FLOAT,
mipmaps: false
});
t.deepEquals(readPixelsToArray(texture), new Float32Array(8), 'Pixels are empty');
// data: typed array
data = new Float32Array([0.1, 0.2, -3, -2]);
texture.setSubImageData({data, x: 0, y: 0, width: 1, height: 1});
t.deepEquals(
readPixelsToArray(texture),
new Float32Array([0.1, 0.2, -3, -2, 0, 0, 0, 0]),
'Pixels are set correctly'
);
// data: buffer
data = new Float32Array([-3, 255, 128, 3.333]);
const buffer = new Buffer(gl2, {data, accessor: {size: 4, type: GL.FLOAT}});
texture.setSubImageData({data: buffer, x: 1, y: 0, width: 1, height: 1});
t.deepEquals(
readPixelsToArray(texture),
new Float32Array([0.1, 0.2, -3, -2, -3, 255, 128, 3.333]),
'Pixels are set correctly'
);
// data: canvas
if (typeof document !== 'undefined') {
const canvas = document.createElement('canvas');
canvas.width = 1;
canvas.height = 1;
const ctx = canvas.getContext('2d');
ctx.fillRect(0, 0, 1, 1);
texture.setSubImageData({data: canvas, x: 1, y: 0, width: 1, height: 1});
t.deepEquals(
readPixelsToArray(texture),
new Float32Array([0.1, 0.2, -3, -2, 0, 0, 0, 1]),
'Pixels are set correctly'
);
}
t.end();
});
test('WebGL2#Texture2D resize', (t) => {
const {gl} = fixture;
let texture = new Texture2D(gl, {
data: null,
width: 2,
height: 2,
mipmaps: true
});
texture.resize({
width: 4,
height: 4,
mipmaps: true
});
t.ok(texture.mipmaps, 'mipmaps should set to true for POT.');
texture.resize({
width: 3,
height: 3,
mipmaps: true
});
t.notOk(texture.mipmaps, 'mipmaps should set to false when resizing to NPOT.');
texture = new Texture2D(gl, {
data: null,
width: 2,
height: 2,
mipmaps: true
});
texture.resize({
width: 4,
height: 4
});
t.notOk(texture.mipmaps, 'mipmaps should set to false when resizing.');
t.end();
});
test('WebGL2#Texture2D generateMipmap', (t) => {
const {gl} = fixture;
let texture = new Texture2D(gl, {
data: null,
width: 3,
height: 3,
mipmaps: false
});
texture.generateMipmap();
t.notOk(texture.mipmaps, 'Should not turn on mipmaps for NPOT.');
texture = new Texture2D(gl, {
data: null,
width: 2,
height: 2,
mipmaps: false
});
texture.generateMipmap();
t.ok(texture.mipmaps, 'Should turn on mipmaps for POT.');
t.end();
});
// Shared with texture*.spec.js
export function testSamplerParameters({t, texture, parameters}) {
for (const parameterName in parameters) {
const values = parameters[parameterName];
const parameter = Number(parameterName);
for (const valueName in values) {
const value = Number(valueName);
texture.setParameters({
[parameter]: value
});
const name = texture.constructor.name;
const newValue = texture.getParameter(parameter);
t.equals(
newValue,
value,
// `${name}.setParameters({[${getKey(gl, parameter)}]: ${getKey(gl, value)}}) read back OK`
`${name}.setParameters({[${parameter}]: ${value}}) read back OK`
);
}
}
}
``` | /content/code_sandbox/wip/modules-wip/webgl-legacy/test/classic/texture.spec.ts | xml | 2016-01-25T09:41:59 | 2024-08-16T10:03:05 | luma.gl | visgl/luma.gl | 2,280 | 6,845 |
```xml
import { deprecated } from "../../src/utils"
import { flow, createFlowSpawner } from "../../src/core/flow"
import { process as mstProcess, createProcessSpawner } from "../../src/core/process"
import { expect, jest, test } from "bun:test"
function createDeprecationListener() {
// clear previous deprecation dedupe keys
deprecated.ids = {}
// save console.warn native implementation
const originalWarn = console.warn
// create spy to track warning call
const spyWarn = (console.warn = jest.fn())
// return callback to check if warn was called properly
return function isDeprecated() {
// replace original implementation
console.warn = originalWarn
// test for correct log message, if in development
if (process.env.NODE_ENV !== "production") {
expect(spyWarn).toHaveBeenCalledTimes(1)
expect(spyWarn.mock.calls[0][0].message).toMatch(/Deprecation warning:/)
}
}
}
test("`process` should mirror `flow`", () => {
const isDeprecated = createDeprecationListener()
const generator = function* () {}
const flowResult = flow(generator)
const processResult = mstProcess(generator)
expect(processResult.name).toBe(flowResult.name)
isDeprecated()
})
test("`createProcessSpawner` should mirror `createFlowSpawner`", () => {
const isDeprecated = createDeprecationListener()
const alias = "generatorAlias"
const generator = function* (): IterableIterator<void> {}
const flowSpawnerResult = createFlowSpawner(alias, generator)
const processSpawnerResult = createProcessSpawner(alias, generator)
expect(processSpawnerResult.name).toBe(flowSpawnerResult.name)
isDeprecated()
})
``` | /content/code_sandbox/__tests__/core/deprecated.test.ts | xml | 2016-09-04T18:28:25 | 2024-08-16T08:48:55 | mobx-state-tree | mobxjs/mobx-state-tree | 6,917 | 378 |
```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 { expect } from "chai";
import { type MountRendererProps, type ReactWrapper, mount as untypedMount } from "enzyme";
import * as React from "react";
import * as ReactDOM from "react-dom";
import * as TestUtils from "react-dom/test-utils";
import sinon from "sinon";
import { Utils as CoreUtils } from "@blueprintjs/core";
import { dispatchMouseEvent, expectPropValidationError } from "@blueprintjs/test-commons";
import { Cell, Column, RegionCardinality, Table2, TableLoadingOption, type TableProps } from "../src";
import type { CellCoordinates, FocusedCellCoordinates } from "../src/common/cellTypes";
import * as Classes from "../src/common/classes";
import * as Errors from "../src/common/errors";
import type { ColumnIndices, RowIndices } from "../src/common/grid";
import { Rect } from "../src/common/rect";
import { RenderMode } from "../src/common/renderMode";
import { TableQuadrant } from "../src/quadrants/tableQuadrant";
import { TableQuadrantStack } from "../src/quadrants/tableQuadrantStack";
import { type Region, Regions } from "../src/regions";
import type { TableState } from "../src/tableState";
import { CellType, expectCellLoading } from "./cellTestUtils";
import { type ElementHarness, ReactHarness } from "./harness";
import { createStringOfLength, createTableOfSize } from "./mocks/table";
/**
* @see path_to_url#issuecomment-465304376
*/
const mount = (el: React.ReactElement<TableProps>, options?: MountRendererProps) => untypedMount<Table2>(el, options);
describe("<Table2>", function (this) {
// allow retrying failed tests here to reduce flakes.
this.retries(2);
const COLUMN_HEADER_SELECTOR = `.${Classes.TABLE_QUADRANT_MAIN} .${Classes.TABLE_COLUMN_HEADERS} .${Classes.TABLE_HEADER}`;
let containerElement: HTMLElement | undefined;
const harness = new ReactHarness();
beforeEach(() => {
containerElement = document.createElement("div");
document.body.appendChild(containerElement);
});
afterEach(() => {
harness.unmount();
if (containerElement !== undefined) {
ReactDOM.unmountComponentAtNode(containerElement);
containerElement.remove();
}
});
after(() => {
harness.destroy();
});
describe("Basic rendering", () => {
it("Defaults to Base26Alpha column names", () => {
const table = harness.mount(
<Table2>
<Column />
<Column />
<Column name="My Name" />
</Table2>,
);
expect(table.find(`.${Classes.TABLE_COLUMN_NAME_TEXT}`, 2)!.text()).to.equal("My Name");
expect(table.find(`.${Classes.TABLE_COLUMN_NAME_TEXT}`, 1)!.text()).to.equal("B");
});
it("Adds custom className to table container", () => {
const CLASS_NAME = "my-custom-class-name";
const table = harness.mount(
<Table2 className={CLASS_NAME}>
<Column />
<Column />
<Column />
</Table2>,
);
const hasCustomClass = table.find(`.${Classes.TABLE_CONTAINER}`, 0)!.hasClass(CLASS_NAME);
expect(hasCustomClass).to.be.true;
});
it("Renders without ghost cells", () => {
const table = harness.mount(
<Table2>
<Column />
</Table2>,
);
expect(table.find(COLUMN_HEADER_SELECTOR, 0)!.element).to.be.ok;
expect(table.find(COLUMN_HEADER_SELECTOR, 1)!.element).to.not.be.ok;
});
it("Renders ghost cells", () => {
const table = harness.mount(
<Table2 enableGhostCells={true}>
<Column />
</Table2>,
);
expect(table.find(COLUMN_HEADER_SELECTOR, 0)!.element).to.be.ok;
expect(table.find(COLUMN_HEADER_SELECTOR, 1)!.element).to.be.ok;
});
it("Renders correctly with loading options", () => {
const loadingOptions = [
TableLoadingOption.CELLS,
TableLoadingOption.COLUMN_HEADERS,
TableLoadingOption.ROW_HEADERS,
];
const tableHarness = harness.mount(
<Table2 loadingOptions={loadingOptions} numRows={2}>
<Column name="Column0" cellRenderer={renderDummyCell} />
<Column name="Column1" cellRenderer={renderDummyCell} />
</Table2>,
);
expect(tableHarness.text()).to.equal("");
const cells = Array.from(tableHarness.element!.querySelectorAll(`.${Classes.TABLE_CELL}`));
cells.forEach(cell => expectCellLoading(cell, CellType.BODY_CELL));
const columnHeaders = Array.from(tableHarness.element!.querySelectorAll(COLUMN_HEADER_SELECTOR));
columnHeaders.forEach(columnHeader => expectCellLoading(columnHeader, CellType.COLUMN_HEADER));
const rowHeaders = Array.from(
tableHarness.element!.querySelectorAll(`.${Classes.TABLE_ROW_HEADERS} .${Classes.TABLE_HEADER}`),
);
rowHeaders.forEach(rowHeader => expectCellLoading(rowHeader, CellType.ROW_HEADER));
});
});
describe("onVisibleCellsChange callback", () => {
it("Invokes onVisibleCellsChange on mount", () => {
const onVisibleCellsChange = sinon.spy();
const cellRenderer = () => <Cell>foo</Cell>;
mount(
<Table2 onVisibleCellsChange={onVisibleCellsChange} numRows={3}>
<Column name="Column0" cellRenderer={cellRenderer} />
</Table2>,
);
// the callback is called quite often even in the courseof a single render cycle.
// don't bother to count the invocations.
expect(onVisibleCellsChange.called).to.be.true;
const rowIndices: RowIndices = { rowIndexStart: 0, rowIndexEnd: 2 };
const columnIndices: ColumnIndices = { columnIndexStart: 0, columnIndexEnd: 0 };
expect(onVisibleCellsChange.lastCall.calledWith(rowIndices, columnIndices)).to.be.true;
});
it("Invokes onVisibleCellsChange when the table body scrolls", () => {
const onVisibleCellsChange = sinon.spy();
const cellRenderer = () => <Cell>foo</Cell>;
const table = mount(
<Table2 onVisibleCellsChange={onVisibleCellsChange} numRows={3}>
<Column name="Column0" cellRenderer={cellRenderer} />
</Table2>,
);
table
.find(`.${Classes.TABLE_QUADRANT_MAIN} .${Classes.TABLE_QUADRANT_SCROLL_CONTAINER}`)
.simulate("scroll");
expect(onVisibleCellsChange.callCount).to.be.greaterThan(1);
const rowIndices: RowIndices = { rowIndexStart: 0, rowIndexEnd: 2 };
const columnIndices: ColumnIndices = { columnIndexStart: 0, columnIndexEnd: 0 };
expect(onVisibleCellsChange.lastCall.calledWith(rowIndices, columnIndices)).to.be.true;
});
});
describe("Horizontally scrolling", () => {
const CONTAINER_WIDTH = 500;
const CONTAINER_HEIGHT = 500;
describe("with no rows of data and ghost cells enabled", () => {
it("isn't disabled when there are actual columns filling width", () => {
// large values that will force scrolling
const LARGE_COLUMN_WIDTH = 300;
const columnWidths = Array(3).fill(LARGE_COLUMN_WIDTH);
const table = mountTable({ columnWidths });
const tableContainer = table.find(`.${Classes.TABLE_CONTAINER}`);
expect(tableContainer.hasClass(Classes.TABLE_NO_HORIZONTAL_SCROLL)).to.be.false;
});
it("is disabled when there are ghost cells filling width", () => {
// small value so no scrolling needed
const SMALL_COLUMN_WIDTH = 50;
const columnWidths = Array(3).fill(SMALL_COLUMN_WIDTH);
const table = mountTable({ columnWidths });
const tableContainer = table.find(`.${Classes.TABLE_CONTAINER}`);
expect(tableContainer.hasClass(Classes.TABLE_NO_HORIZONTAL_SCROLL)).to.be.true;
});
});
it("does not render ghost columns when there is horizontal overflow", () => {
mountTable(
{ numRows: 2, defaultRowHeight: 20, defaultColumnWidth: 100 },
{
height: 200,
// 300px leaves just enough space for the 3 columns, but there is 30px taken up by
// the row header, which will overflow.
width: 300,
},
);
const numGhostCellsInFirstRow = containerElement!.querySelectorAll(
`.${Classes.TABLE_CELL_GHOST}.${Classes.rowCellIndexClass(0)}`,
).length;
expect(numGhostCellsInFirstRow).to.be.eq(0);
});
function mountTable(
tableProps: Partial<TableProps> = {},
tableDimensions: { width: number; height: number } = { width: CONTAINER_WIDTH, height: CONTAINER_HEIGHT },
) {
containerElement!.style.width = `${tableDimensions.width}px`;
containerElement!.style.height = `${tableDimensions.height}px`;
TableQuadrantStack.defaultProps.throttleScrolling = false;
return mount(
<Table2 numRows={0} enableGhostCells={true} {...tableProps}>
<Column cellRenderer={renderDummyCell} />
<Column cellRenderer={renderDummyCell} />
<Column cellRenderer={renderDummyCell} />
</Table2>,
{ attachTo: containerElement },
);
}
});
describe("Vertically scrolling", () => {
runTestToEnsureScrollingIsEnabled(true);
runTestToEnsureScrollingIsEnabled(false);
it("does not render ghost rows when there is vertical overflow", () => {
// we need _some_ amount of vertical overflow to avoid the code path which disables vertical scroll
// in the table altogether. 200px leaves just enough space for the rows, but there is 30px taken up by
// the column header, which will overflow.
runTestToEnsureGhostCellsAreNotVisible(200);
});
it("does not render ghost rows when there is vertical exact fit", () => {
// 200px for row heights, 30px for row header
runTestToEnsureGhostCellsAreNotVisible(230);
});
function runTestToEnsureGhostCellsAreNotVisible(height: number) {
mountTable(
{ defaultRowHeight: 20, enableGhostCells: true },
{
height,
width: 300,
},
);
const numGhostCellsInFirstColumn = containerElement!.querySelectorAll(
`.${Classes.TABLE_CELL_GHOST}.${Classes.columnCellIndexClass(0)}`,
).length;
expect(numGhostCellsInFirstColumn).to.be.eq(0);
}
function runTestToEnsureScrollingIsEnabled(enableGhostCells: boolean) {
it(`isn't disabled when there is half a row left to scroll to and enableGhostCells is set to ${enableGhostCells}`, () => {
const table = mountTable(
{ defaultRowHeight: 30, enableGhostCells },
{
height: 320,
width: 300,
},
);
const tableContainer = table.find(`.${Classes.TABLE_CONTAINER}`);
// There should be 10px left of scrolling. Height is 320, rows take up 300, and headerRow takes up 30
expect(tableContainer.hasClass(Classes.TABLE_NO_VERTICAL_SCROLL)).to.be.false;
});
}
function mountTable(tableProps: Partial<TableProps> = {}, tableDimensions: { width: number; height: number }) {
containerElement!.style.width = `${tableDimensions.width}px`;
containerElement!.style.height = `${tableDimensions.height}px`;
TableQuadrantStack.defaultProps.throttleScrolling = false;
return mount(
<Table2 numRows={10} {...tableProps}>
<Column cellRenderer={renderDummyCell} />
</Table2>,
{ attachTo: containerElement },
);
}
});
describe("Instance methods", () => {
describe("resizeRowsByApproximateHeight", () => {
const STR_LENGTH_SHORT = 10;
const STR_LENGTH_LONG = 100;
const NUM_ROWS = 4;
const cellTextShort = createStringOfLength(STR_LENGTH_SHORT);
const cellTextLong = createStringOfLength(STR_LENGTH_LONG);
const getCellText = (rowIndex: number) => {
return rowIndex === 0 ? cellTextShort : cellTextLong;
};
const cellRenderer = (rowIndex: number) => {
return <Cell wrapText={true}>{getCellText(rowIndex)}</Cell>;
};
let table: Table2 | undefined;
const saveTable = (t: Table2) => (table = t);
beforeEach(() => {
harness.mount(
<Table2 ref={saveTable} numRows={NUM_ROWS}>
<Column name="Column0" cellRenderer={cellRenderer} />
<Column name="Column1" cellRenderer={cellRenderer} />
</Table2>,
);
});
afterEach(() => {
table = undefined;
});
it("resizes each row to fit its respective tallest cell", () => {
table!.resizeRowsByApproximateHeight(getCellText);
expect(table!.state.rowHeights).to.deep.equal([36, 144, 144, 144]);
});
it("still uses defaults if an empty `options` object is passed", () => {
table!.resizeRowsByApproximateHeight(getCellText, {});
expect(table!.state.rowHeights).to.deep.equal([36, 144, 144, 144]);
});
it("can customize options", () => {
table!.resizeRowsByApproximateHeight(getCellText, { getNumBufferLines: 2 });
expect(table!.state.rowHeights).to.deep.equal([54, 162, 162, 162]);
});
});
describe("resizeRowsByTallestCell", () => {
// HACKHACK: skipping since MAX_HEIGHT ends up being 60px instead of 40px in CI (but works fine locally)
// see path_to_url
it.skip("Gets and sets the tallest cell by columns correctly", () => {
const DEFAULT_RESIZE_HEIGHT = 20;
const MAX_HEIGHT = 40;
const renderCellLong = () => <Cell wrapText={true}>my cell value with lots and lots of words</Cell>;
const renderCellShort = () => <Cell wrapText={false}>short value</Cell>;
let table: Table2;
const saveTable = (t: Table2) => (table = t);
harness.mount(
<Table2 ref={saveTable} numRows={4}>
<Column name="Column0" cellRenderer={renderCellLong} />
<Column name="Column1" cellRenderer={renderCellShort} />
</Table2>,
);
table!.resizeRowsByTallestCell(0);
expect(table!.state.rowHeights[0], "resizes by first column").to.equal(MAX_HEIGHT);
table!.resizeRowsByTallestCell(1);
expect(table!.state.rowHeights[0], "resizes by second column").to.equal(DEFAULT_RESIZE_HEIGHT);
table!.resizeRowsByTallestCell([0, 1]);
expect(table!.state.rowHeights[0], "resizes by both column").to.equal(MAX_HEIGHT);
table!.resizeRowsByTallestCell([1]);
expect(table!.state.rowHeights[0], "resizes by second column via array").to.equal(
DEFAULT_RESIZE_HEIGHT,
);
table!.resizeRowsByTallestCell();
expect(table!.state.rowHeights[0], "resizes by visible columns").to.equal(MAX_HEIGHT);
});
it("Works on a frozen column when the corresponding MAIN-quadrant column is out of view", () => {
const CONTAINER_WIDTH = 500;
const CONTAINER_HEIGHT = 500;
const EXPECTED_MAX_ROW_HEIGHT = 20;
const FROZEN_COLUMN_INDEX = 0;
const cellRenderer = () => <Cell wrapText={true}>my cell value with lots and lots of words</Cell>;
// huge values that will force scrolling
const LARGE_COLUMN_WIDTH = 1000;
// need 5 columns to ensure the first column won't be included
// in the 3 "bleed" columns once we scroll rightward.
const columnWidths = Array(5).fill(LARGE_COLUMN_WIDTH);
// resize container element to enforce a maximum viewport size
// small enough to cause scrolling.
containerElement!.style.width = `${CONTAINER_WIDTH}px`;
containerElement!.style.height = `${CONTAINER_HEIGHT}px`;
// need to mount directly into the DOM for this test to work
const table = mount(
<Table2 numRows={4} numFrozenColumns={1} columnWidths={columnWidths}>
<Column name="Column0" cellRenderer={cellRenderer} />
<Column name="Column1" cellRenderer={cellRenderer} />
<Column name="Column2" cellRenderer={cellRenderer} />
<Column name="Column3" cellRenderer={cellRenderer} />
<Column name="Column4" cellRenderer={cellRenderer} />
</Table2>,
{ attachTo: containerElement },
);
// scroll the frozen column out of view in the MAIN quadrant,
// and expect a non-zero height.
const tableInstance = table.instance() as Table2;
tableInstance.scrollToRegion(Regions.column(columnWidths.length - 1));
tableInstance.resizeRowsByTallestCell(FROZEN_COLUMN_INDEX);
expect(table.state().rowHeights[0]).to.equal(EXPECTED_MAX_ROW_HEIGHT);
});
});
describe("scrollToRegion", () => {
const CONTAINER_WIDTH = 200;
const CONTAINER_HEIGHT = 200;
const ROW_HEIGHT = 300;
const COLUMN_WIDTH = 400;
const NUM_ROWS = 3;
const NUM_COLUMNS = 3;
const TARGET_ROW = 1;
const TARGET_COLUMN = 2;
let tableInstance: Table2;
it("should calculate coordinates for scrolling to cell", () => {
mountTable();
checkInstanceMethod(
Regions.cell(TARGET_ROW, TARGET_COLUMN),
TARGET_COLUMN * COLUMN_WIDTH,
TARGET_ROW * ROW_HEIGHT,
);
});
it("should calculate coordinates for scrolling to frozen cell", () => {
mountTable({ numFrozenRows: TARGET_ROW + 1, numFrozenColumns: TARGET_COLUMN + 1 });
checkInstanceMethod(Regions.cell(TARGET_ROW, TARGET_COLUMN), 0, 0);
});
it("should calculate coordinates for scrolling to row", () => {
mountTable();
checkInstanceMethod(Regions.row(TARGET_ROW), 0, TARGET_ROW * ROW_HEIGHT);
});
it("should calculate coordinates for scrolling to frozen row", () => {
mountTable({ numFrozenRows: TARGET_ROW + 1 });
checkInstanceMethod(Regions.row(TARGET_ROW), 0, 0);
});
it("should calculate coordinates for scrolling to column", () => {
mountTable();
checkInstanceMethod(Regions.column(TARGET_COLUMN), TARGET_COLUMN * COLUMN_WIDTH, 0);
});
it("should calculate coordinates for scrolling to frozen column", () => {
mountTable({ numFrozenColumns: TARGET_COLUMN + 1 });
checkInstanceMethod(Regions.column(TARGET_COLUMN), 0, 0);
});
it("should calculate coordinates for scrolling to full table", () => {
mountTable();
checkInstanceMethod(Regions.table(), 0, 0);
});
function checkInstanceMethod(region: Region, expectedScrollLeft: number, expectedScrollTop: number) {
// cast as `any` to access private members
const spy = sinon.spy((tableInstance as any).quadrantStackInstance, "scrollToPosition");
tableInstance.scrollToRegion(region);
// just check that the scroll event would be triggered with the proper args; don't
// bother checking the result of the whole action
expect(spy.firstCall.args).to.deep.equal([expectedScrollLeft, expectedScrollTop]);
spy.restore();
}
function saveTable(ref: Table2) {
tableInstance = ref;
}
function mountTable(tableProps: Partial<TableProps> = {}) {
mount(
<div style={{ width: CONTAINER_WIDTH, height: CONTAINER_HEIGHT }}>
<Table2
columnWidths={Array(NUM_COLUMNS).fill(COLUMN_WIDTH)}
numRows={NUM_ROWS}
rowHeights={Array(NUM_ROWS).fill(ROW_HEIGHT)}
ref={saveTable}
{...tableProps}
>
<Column cellRenderer={renderDummyCell} />
<Column cellRenderer={renderDummyCell} />
<Column cellRenderer={renderDummyCell} />
</Table2>
</div>,
);
}
});
});
describe("Full-table selection", () => {
const onFocusedCell = sinon.spy();
const onSelection = sinon.spy();
afterEach(() => {
onFocusedCell.resetHistory();
onSelection.resetHistory();
});
it("Selects all and moves focus cell to (0, 0) on click of upper-left corner", () => {
const table = mountTable();
selectFullTable(table);
expect(onSelection.args[0][0]).to.deep.equal([Regions.table()]);
expect(onFocusedCell.args[0][0]).to.deep.equal({
col: 0,
focusSelectionIndex: 0,
row: 0,
});
});
it("Does not move focused cell on shift+click", () => {
const table = mountTable();
selectFullTable(table, { shiftKey: true });
expect(onSelection.args[0][0]).to.deep.equal([Regions.table()]);
expect(onFocusedCell.called).to.be.false;
});
it("Selects and deselects column/row headers when selecting and deselecting the full table", () => {
const table = mountTable();
// select the full table
selectFullTable(table);
let columnHeader = table.find(COLUMN_HEADER_SELECTOR).hostNodes().first();
let rowHeader = table
.find(`.${Classes.TABLE_ROW_HEADERS}`)
.find(`.${Classes.TABLE_HEADER}`)
.hostNodes()
.first();
expect(columnHeader.hasClass(Classes.TABLE_HEADER_SELECTED)).to.be.true;
expect(rowHeader.hasClass(Classes.TABLE_HEADER_SELECTED)).to.be.true;
// deselect the full table
table.setProps({ selectedRegions: [] });
table.update();
columnHeader = table.find(COLUMN_HEADER_SELECTOR).hostNodes().first();
rowHeader = table
.find(`.${Classes.TABLE_ROW_HEADERS}`)
.find(`.${Classes.TABLE_HEADER}`)
.hostNodes()
.first();
expect(columnHeader.hasClass(Classes.TABLE_HEADER_SELECTED)).to.be.false;
expect(rowHeader.hasClass(Classes.TABLE_HEADER_SELECTED)).to.be.false;
});
it("Aligns properly with the table borders", () => {
const table = mountTable();
selectFullTable(table);
// we'll pass this to parseInt as the radix argument.
const BASE_10 = 10;
// the test framework doesn't necessarily return the expected values
// via getBoundingClientRect(), so let's just grab the inline
// width/height styles from the bottom container.
const bottomContainer = table
.find(`.${Classes.TABLE_QUADRANT_MAIN}`)
.find(`.${Classes.TABLE_BOTTOM_CONTAINER}`)
.hostNodes()
.getDOMNode() as HTMLElement;
const { width: expectedWidth, height: expectedHeight } = bottomContainer.style;
const [expectedWidthAsNumber, expectedHeightAsNumber] = [expectedWidth, expectedHeight].map(n =>
parseInt(n, BASE_10),
);
// use chained .find()'s instead of one long selector just for the
// sake of reducing line length
const selectionOverlay = table
.find(`.${Classes.TABLE_QUADRANT_MAIN}`)
.find(`.${Classes.TABLE_QUADRANT_BODY_CONTAINER}`)
.find(`.${Classes.TABLE_SELECTION_REGION}`)
.hostNodes()
.getDOMNode() as HTMLElement;
const { width: actualWidth, height: actualHeight } = selectionOverlay.style;
const [actualWidthAsNumber, actualHeightAsNumber] = [actualWidth, actualHeight].map(n =>
parseInt(n, BASE_10),
);
// the "actual" selection width should be 1px greater than the
// "expected' table width, because of a correction necessary for
// maintaining proper alignment on the bottom/right sides of the
// selection region (see: styleBodyRegion() in table.tsx).
expect(actualWidthAsNumber).to.equal(expectedWidthAsNumber + 1);
expect(actualHeightAsNumber).to.equal(expectedHeightAsNumber + 1);
});
function mountTable() {
return mount(
<Table2 enableFocusedCell={true} onFocusedCell={onFocusedCell} onSelection={onSelection} numRows={10}>
<Column cellRenderer={renderDummyCell} />
<Column cellRenderer={renderDummyCell} />
<Column cellRenderer={renderDummyCell} />
</Table2>,
);
}
function selectFullTable(table: ReactWrapper<any>, ...mouseEventArgs: any[]) {
const menu = table.find(`.${Classes.TABLE_QUADRANT_MAIN} .${Classes.TABLE_MENU}`);
menu.simulate("mousedown", ...mouseEventArgs).simulate("mouseup", ...mouseEventArgs);
}
});
describe("Changing selectionModes", () => {
it("Removes uncontrolled selected region if selectionModes change to make it invalid", () => {
const table = mount(
<Table2 selectionModes={[RegionCardinality.FULL_COLUMNS]}>
<Column />
</Table2>,
);
table.setState({ selectedRegions: [Regions.column(0)] });
table.setProps({ selectionModes: [] });
expect(table.state("selectedRegions").length).to.equal(0);
});
it("Leaves controlled selected region if selectionModes change to make it invalid", () => {
const table = mount(
<Table2 selectionModes={[RegionCardinality.FULL_COLUMNS]} selectedRegions={[Regions.column(0)]}>
<Column />
</Table2>,
);
table.setProps({ selectionModes: [] });
expect(table.state("selectedRegions").length).to.equal(1);
});
});
describe("onCompleteRender", () => {
it("triggers immediately on mount/update with RenderMode.NONE", () => {
const onCompleteRenderSpy = sinon.spy();
const table = mount(
<Table2 numRows={100} onCompleteRender={onCompleteRenderSpy} renderMode={RenderMode.NONE}>
<Column cellRenderer={renderDummyCell} />
</Table2>,
);
expect(onCompleteRenderSpy.callCount, "call count on mount").to.equal(1);
table.setProps({ numRows: 101 });
expect(onCompleteRenderSpy.callCount, "call count on update").to.equal(2);
});
it("does not try to render cells that no longer exist", () => {
const onCompleteRenderSpy = sinon.spy();
let numRows = 2;
const cellRenderer = (rowIndex: number) => {
if (rowIndex >= numRows) {
throw new Error(`There is no row with index ${rowIndex}`);
}
return <Cell>Row ${rowIndex}</Cell>;
};
const table = mount(
<Table2 numRows={numRows} onCompleteRender={onCompleteRenderSpy} renderMode={RenderMode.NONE}>
<Column cellRenderer={cellRenderer} />
</Table2>,
);
numRows = 1;
expect(() => table.setProps({ numRows })).does.not.throw();
});
it("triggers immediately on mount with RenderMode.BATCH_ON_UPDATE", () => {
const onCompleteRenderSpy = sinon.spy();
mount(
<Table2 onCompleteRender={onCompleteRenderSpy} numRows={100} renderMode={RenderMode.BATCH_ON_UPDATE}>
<Column cellRenderer={renderDummyCell} />
</Table2>,
);
expect(onCompleteRenderSpy.callCount, "call count on mount").to.equal(2);
});
it("triggers immediately on mount/update with RenderMode.BATCH for very small batches", () => {
const onCompleteRenderSpy = sinon.spy();
const numRows = 1;
// RenderMode.BATCH is the default
const table = mount(
<Table2 numRows={numRows} onCompleteRender={onCompleteRenderSpy}>
<Column cellRenderer={renderDummyCell} />
</Table2>,
);
expect(onCompleteRenderSpy.callCount, "call count on mount").to.equal(2);
table.setProps({ numRows: 2 }); // still small enough to fit in one batch
expect(onCompleteRenderSpy.callCount, "call count on update").to.equal(3);
});
});
describe("Freezing", () => {
let consoleWarn: sinon.SinonStub | undefined;
before(() => (consoleWarn = sinon.stub(console, "warn")));
afterEach(() => consoleWarn?.resetHistory());
after(() => consoleWarn?.restore());
describe("columns validation", () => {
it("doesn't print a warning with default (0) frozen", () => {
const table = mount(<Table2 />);
expect(table.state("numFrozenColumnsClamped")).to.equal(0, "clamped state");
expect(consoleWarn?.calledWith(Errors.TABLE_NUM_FROZEN_COLUMNS_BOUND_WARNING)).to.be.false;
});
it("prints a warning and clamps numFrozenColumns with 0 columns, 1 frozen", () => {
const table = mount(<Table2 numFrozenColumns={1} />);
expect(table.state("numFrozenColumnsClamped")).to.equal(0, "clamped state");
expect(consoleWarn?.calledWith(Errors.TABLE_NUM_FROZEN_COLUMNS_BOUND_WARNING)).to.be.true;
});
it("prints a warning and clamps numFrozenColumns with 1 column, 2 frozen", () => {
const table = mount(
<Table2 numFrozenColumns={2}>
<Column />
</Table2>,
);
expect(table.state("numFrozenColumnsClamped")).to.equal(1, "clamped state");
expect(consoleWarn?.calledWith(Errors.TABLE_NUM_FROZEN_COLUMNS_BOUND_WARNING)).to.be.true;
});
});
describe("rows validation", () => {
it("doesn't print a warning with default (0) frozen", () => {
const table = mount(<Table2 />);
expect(table.state("numFrozenRowsClamped")).to.equal(0, "clamped state");
expect(consoleWarn?.calledWith(Errors.TABLE_NUM_FROZEN_ROWS_BOUND_WARNING)).to.be.false;
});
it("prints a warning and clamps numFrozenRows with 0 rows, 1 frozen", () => {
const table = mount(<Table2 numFrozenRows={1} numRows={0} />);
expect(table.state("numFrozenRowsClamped")).to.equal(0, "clamped state");
expect(consoleWarn?.calledWith(Errors.TABLE_NUM_FROZEN_ROWS_BOUND_WARNING)).to.be.true;
});
it("prints a warning and clamps numFrozenRows with 1 row, 2 frozen", () => {
const table = mount(
<Table2 numFrozenRows={2} numRows={1}>
<Column />
</Table2>,
);
expect(table.state("numFrozenRowsClamped")).to.equal(1, "clamped state");
expect(consoleWarn?.calledWith(Errors.TABLE_NUM_FROZEN_ROWS_BOUND_WARNING)).to.be.true;
});
});
const NUM_ROWS = 4;
const NUM_COLUMNS = 3;
// assuming numFrozenColumns=1 and numFrozenRows=1
const NUM_TOP_LEFT_COLUMNS = 1;
const NUM_TOP_LEFT_ROWS = 1;
const NUM_TOP = NUM_COLUMNS - NUM_TOP_LEFT_COLUMNS;
const NUM_LEFT = NUM_ROWS - NUM_TOP_LEFT_ROWS;
const NUM_TOP_LEFT = NUM_TOP_LEFT_COLUMNS * NUM_TOP_LEFT_ROWS;
it("does not render frozen bleed cells if numFrozenRows=0 and numFrozenColumns=0", () => {
const table = mount(createTableOfSize(NUM_COLUMNS, NUM_ROWS));
expect(table.find(`.${Classes.TABLE_QUADRANT_TOP} .${Classes.TABLE_CELL}`).length).to.equal(0);
expect(table.find(`.${Classes.TABLE_QUADRANT_LEFT} .${Classes.TABLE_CELL}`).length).to.equal(0);
expect(table.find(`.${Classes.TABLE_QUADRANT_TOP_LEFT} .${Classes.TABLE_CELL}`).length).to.equal(0);
});
it("renders only one row of frozen cells (i.e. no bleed cells) if numFrozenRows = 1", () => {
const table = mount(createTableOfSize(NUM_COLUMNS, NUM_ROWS, {}, { numFrozenRows: 1 }));
expect(table.find(`.${Classes.TABLE_QUADRANT_TOP} .${Classes.TABLE_CELL}`).length).to.equal(NUM_COLUMNS);
expect(table.find(`.${Classes.TABLE_QUADRANT_LEFT} .${Classes.TABLE_CELL}`).length).to.equal(0);
expect(table.find(`.${Classes.TABLE_QUADRANT_TOP_LEFT} .${Classes.TABLE_CELL}`).length).to.equal(0);
});
it("renders only one column of frozen cells (i.e. no bleed cells) if numFrozenColumns = 1", () => {
const table = mount(createTableOfSize(NUM_COLUMNS, NUM_ROWS, {}, { numFrozenColumns: 1 }));
expect(table.find(`.${Classes.TABLE_QUADRANT_TOP} .${Classes.TABLE_CELL}`).length).to.equal(0);
expect(table.find(`.${Classes.TABLE_QUADRANT_LEFT} .${Classes.TABLE_CELL}`).length).to.equal(NUM_ROWS);
expect(table.find(`.${Classes.TABLE_QUADRANT_TOP_LEFT} .${Classes.TABLE_CELL}`).length).to.equal(0);
});
it("renders correct number of frozen cells if numFrozenRows = 1 and numFrozenColumns = 1", () => {
const table = mount(
createTableOfSize(NUM_COLUMNS, NUM_ROWS, {}, { numFrozenRows: 1, numFrozenColumns: 1 }),
);
expect(table.find(`.${Classes.TABLE_QUADRANT_TOP} .${Classes.TABLE_CELL}`).length).to.equal(NUM_TOP);
expect(table.find(`.${Classes.TABLE_QUADRANT_LEFT} .${Classes.TABLE_CELL}`).length).to.equal(NUM_LEFT);
expect(table.find(`.${Classes.TABLE_QUADRANT_TOP_LEFT} .${Classes.TABLE_CELL}`).length).to.equal(
NUM_TOP_LEFT,
);
});
it("renders correct number of frozen cells if numFrozenRows and numFrozenColumns are changed to > 0", () => {
const table = mount(createTableOfSize(NUM_COLUMNS, NUM_ROWS));
table.setProps({ numFrozenRows: 1, numFrozenColumns: 1 });
table.update();
expect(table.find(`.${Classes.TABLE_QUADRANT_TOP} .${Classes.TABLE_CELL}`).length).to.equal(NUM_TOP);
expect(table.find(`.${Classes.TABLE_QUADRANT_LEFT} .${Classes.TABLE_CELL}`).length).to.equal(NUM_LEFT);
expect(table.find(`.${Classes.TABLE_QUADRANT_TOP_LEFT} .${Classes.TABLE_CELL}`).length).to.equal(
NUM_TOP_LEFT,
);
});
it("renders correct number of frozen cells if numFrozenRows and numFrozenColumns are changed to 0", () => {
const table = mount(
createTableOfSize(NUM_COLUMNS, NUM_ROWS, {}, { numFrozenRows: 1, numFrozenColumns: 1 }),
);
table.setProps({ numFrozenRows: 0, numFrozenColumns: 0 });
table.update();
expect(table.find(`.${Classes.TABLE_QUADRANT_TOP} .${Classes.TABLE_CELL}`).length).to.equal(0);
expect(table.find(`.${Classes.TABLE_QUADRANT_LEFT} .${Classes.TABLE_CELL}`).length).to.equal(0);
expect(table.find(`.${Classes.TABLE_QUADRANT_TOP_LEFT} .${Classes.TABLE_CELL}`).length).to.equal(0);
});
});
describe("Resizing", () => {
it("Resizes selected rows together", () => {
const table = mountTable();
const rows = getRowHeadersWrapper(table)!;
const resizeHandleTarget = getResizeHandle(rows, 0)!;
resizeHandleTarget.mouse("mousemove").mouse("mousedown").mouse("mousemove", 0, 2).mouse("mouseup");
expect(rows.find(`.${Classes.TABLE_HEADER}`, 0)!.bounds()!.height).to.equal(3);
expect(rows.find(`.${Classes.TABLE_HEADER}`, 1)!.bounds()!.height).to.equal(3);
expect(rows.find(`.${Classes.TABLE_HEADER}`, 2)!.bounds()!.height).to.equal(1);
expect(rows.find(`.${Classes.TABLE_HEADER}`, 3)!.bounds()!.height).to.equal(1);
expect(rows.find(`.${Classes.TABLE_HEADER}`, 4)!.bounds()!.height).to.equal(3);
expect(rows.find(`.${Classes.TABLE_HEADER}`, 5)!.bounds()!.height).to.equal(3);
expect(rows.find(`.${Classes.TABLE_HEADER}`, 6)!.bounds()!.height).to.equal(3);
expect(rows.find(`.${Classes.TABLE_HEADER}`, 7)!.bounds()!.height).to.equal(1);
expect(rows.find(`.${Classes.TABLE_HEADER}`, 8)!.bounds()!.height).to.equal(3);
});
it("Resizes columns when row headers are hidden without throwing an error", () => {
const table = mountTable({ enableRowHeader: false });
const columnHeader = table.find(`.${Classes.TABLE_COLUMN_HEADERS}`)!;
const resizeHandleTarget = getResizeHandle(columnHeader, 0)!;
expect(() => {
resizeHandleTarget.mouse("mousemove").mouse("mousedown").mouse("mousemove", 0, 2).mouse("mouseup");
}).not.to.throw();
});
it("Hides selected-region styles while resizing", () => {
const table = mountTable();
const resizeHandleTarget = getResizeHandle(getRowHeadersWrapper(table)!, 0)!;
resizeHandleTarget.mouse("mousemove").mouse("mousedown").mouse("mousemove", 0, 2);
expect(table.find(`.${Classes.TABLE_SELECTION_REGION}`)!.exists()).to.be.false;
resizeHandleTarget.mouse("mouseup");
expect(table.find(`.${Classes.TABLE_SELECTION_REGION}`)!.exists()).to.be.true;
});
it("resizes frozen column on double-click when corresponding MAIN-quadrant column not in view", () => {
const CONTAINER_WIDTH = 500;
const CONTAINER_HEIGHT = 500;
const EXPECTED_COLUMN_WIDTH_WITH_LOCAL_KARMA = 212;
const EXPECTED_ROW_HEADER_WIDTH = 30;
const FROZEN_COLUMN_INDEX = 0;
const cellRenderer = () => <Cell wrapText={false}>my cell value with lots and lots of words</Cell>;
// huge values that will force scrolling
const LARGE_COLUMN_WIDTH = 1000;
// need 5 columns to ensure the first column won't be included
// in the 3 "bleed" columns once we scroll rightward.
const columnWidths = Array(5).fill(LARGE_COLUMN_WIDTH);
// set dimennsions on container element to enforce a maximum viewport size
// small enough to cause scrolling.
containerElement!.style.width = `${CONTAINER_WIDTH}px`;
containerElement!.style.height = `${CONTAINER_HEIGHT}px`;
// need to mount directly into the DOM for this test to work
let table: Table2 | undefined;
const saveTable = (ref: Table2) => (table = ref);
const tableElement = harness.mount(
<Table2 ref={saveTable} numRows={1} numFrozenColumns={1} columnWidths={columnWidths}>
<Column name="Column0" cellRenderer={cellRenderer} />
<Column name="Column1" cellRenderer={cellRenderer} />
<Column name="Column2" cellRenderer={cellRenderer} />
<Column name="Column3" cellRenderer={cellRenderer} />
<Column name="Column4" cellRenderer={cellRenderer} />
</Table2>,
);
// scroll the frozen column out of view in the MAIN quadrant,
// and expect a non-zero height.
table!.scrollToRegion(Regions.column(columnWidths.length - 1));
const quadrantSelector = `.${Classes.TABLE_QUADRANT_LEFT}`;
const columnHeaderSelector = `${quadrantSelector} .${Classes.TABLE_COLUMN_HEADERS}`;
const resizeHandleSelector = `${columnHeaderSelector} .${Classes.TABLE_RESIZE_HANDLE_TARGET}`;
const quadrantElement = tableElement.find(quadrantSelector, 0)!;
const frozenColumnResizeHandle = tableElement.find(resizeHandleSelector, FROZEN_COLUMN_INDEX)!;
// double-click the frozen column's resize handle
frozenColumnResizeHandle.mouse("mousedown").mouse("mouseup", 10).mouse("mousedown").mouse("mouseup", 10);
const columnWidth = table!.state.columnWidths[0];
const quadrantWidth = parseInt(quadrantElement.style()!.width, 10);
const expectedQuadrantWidth = EXPECTED_ROW_HEADER_WIDTH + EXPECTED_COLUMN_WIDTH_WITH_LOCAL_KARMA;
// local `gulp karma` expects 216px, and Circle CI `gulp test`
// expects 265px. :/ .at.least() seems more reliable than bounding
// the width in [216,265] and introducing potential test flakiness.
expect(columnWidth, "column resizes correctly").to.be.at.least(EXPECTED_COLUMN_WIDTH_WITH_LOCAL_KARMA);
expect(quadrantWidth, "quadrant resizes correctly").to.be.at.least(expectedQuadrantWidth);
});
function mountTable(tableProps: Partial<TableProps> = {}) {
return harness.mount(
// set the row height so small so they can all fit in the viewport and be rendered
<Table2
defaultRowHeight={1}
enableRowResizing={true}
minRowHeight={1}
numRows={10}
selectedRegions={[Regions.row(0, 1), Regions.row(4, 6), Regions.row(8)]}
{...tableProps}
>
<Column cellRenderer={renderDummyCell} />
<Column cellRenderer={renderDummyCell} />
<Column cellRenderer={renderDummyCell} />
</Table2>,
);
}
function getRowHeadersWrapper(table: ElementHarness) {
return table.find(`.${Classes.TABLE_ROW_HEADERS}`);
}
function getResizeHandle(header: ElementHarness, index: number) {
return header.find(`.${Classes.TABLE_RESIZE_HANDLE_TARGET}`, index);
}
});
describe("Reordering", () => {
const OLD_INDEX = 0;
const NEW_INDEX = 1;
const LENGTH = 2;
const NUM_COLUMNS = 5;
const NUM_ROWS = 5;
// considerations:
// - make the rows and columns fit exactly in the table dimensions; not trying to test scrolling.
// - ensure the columns are wide enough to fit their reorder handle.
const CONTAINER_WIDTH_IN_PX = 200;
const CONTAINER_HEIGHT_IN_PX = 200;
const ROW_HEIGHT_IN_PX = CONTAINER_HEIGHT_IN_PX / NUM_ROWS;
const COLUMN_WIDTH_IN_PX = CONTAINER_WIDTH_IN_PX / NUM_COLUMNS;
const OFFSET_X = (NEW_INDEX + LENGTH) * COLUMN_WIDTH_IN_PX;
const OFFSET_Y = (NEW_INDEX + LENGTH) * ROW_HEIGHT_IN_PX;
const onColumnsReordered = sinon.spy();
const onRowsReordered = sinon.spy();
const onSelection = sinon.spy();
afterEach(() => {
onColumnsReordered.resetHistory();
onRowsReordered.resetHistory();
onSelection.resetHistory();
});
it("Shows preview guide and invokes callback when selected columns reordered", () => {
const table = mountTable({
enableColumnReordering: true,
onColumnsReordered,
selectedRegions: [Regions.column(OLD_INDEX, LENGTH - 1)],
});
const headerCell = getHeaderCell(getColumnHeadersWrapper(table)!, 0)!;
const reorderHandle = getReorderHandle(headerCell)!;
reorderHandle.mouse("mousedown").mouse("mousemove", getAdjustedOffsetX(OFFSET_X, reorderHandle));
const guide = table.find(`.${Classes.TABLE_VERTICAL_GUIDE}`);
expect(guide).to.exist;
reorderHandle.mouse("mouseup", getAdjustedOffsetX(OFFSET_X, reorderHandle));
expect(onColumnsReordered.called).to.be.true;
expect(onColumnsReordered.calledWith(OLD_INDEX, NEW_INDEX, LENGTH)).to.be.true;
});
it("Shows preview guide and invokes callback when selected rows reordered", () => {
const table = mountTable({
enableRowReordering: true,
onRowsReordered,
selectedRegions: [Regions.row(OLD_INDEX, LENGTH - 1)],
});
const headerCell = getHeaderCell(getRowHeadersWrapper(table)!, 0)!;
headerCell.mouse("mousedown").mouse("mousemove", 0, OFFSET_Y);
const guide = table.find(`.${Classes.TABLE_HORIZONTAL_GUIDE}`)!;
expect(guide, "Could not find preview guide").to.exist;
headerCell.mouse("mouseup", 0, OFFSET_Y);
expect(onRowsReordered.called, "Reorder callback not called").to.be.true;
// HACKHACK: path_to_url
// expect(
// onRowsReordered.calledWith(OLD_INDEX, NEW_INDEX, LENGTH),
// "Reorder callback called with unexpected args",
// ).to.be.true;
});
it("Reorders an unselected column and selects it afterward", () => {
const table = mountTable({
enableColumnReordering: true,
onColumnsReordered,
onSelection,
});
const headerCell = getHeaderCell(getColumnHeadersWrapper(table)!, 0)!;
const reorderHandle = getReorderHandle(headerCell)!;
reorderHandle
.mouse("mousedown")
.mouse("mousemove", getAdjustedOffsetX(OFFSET_X, reorderHandle))
.mouse("mouseup", getAdjustedOffsetX(OFFSET_X, reorderHandle));
expect(onColumnsReordered.called).to.be.true;
expect(onSelection.firstCall.calledWith([Regions.column(0)]));
});
it("Doesn't work on rows if there is no selected region defined yet", () => {
const table = mountTable({
enableColumnReordering: true,
onColumnsReordered,
});
getHeaderCell(getColumnHeadersWrapper(table)!, 0)!
.mouse("mousedown")
.mouse("mousemove", OFFSET_X)
.mouse("mouseup", OFFSET_X);
expect(onColumnsReordered.called).to.be.false;
});
it("Clears all selections except the reordered column after reordering", () => {
const table = mountTable({
enableColumnReordering: true,
onColumnsReordered,
onSelection,
selectedRegions: [Regions.column(2)], // some other column
});
const headerCell = getHeaderCell(getColumnHeadersWrapper(table)!, 0)!;
const reorderHandle = getReorderHandle(headerCell)!;
// now we can reorder the column one spot to the right
const newIndex = 1;
const length = 1;
const offsetX = (newIndex + length) * COLUMN_WIDTH_IN_PX;
const adjustedOffsetX = getAdjustedOffsetX(offsetX, reorderHandle);
reorderHandle.mouse("mousedown").mouse("mousemove", adjustedOffsetX).mouse("mouseup", adjustedOffsetX);
// called once on mousedown (to select column 0), once on mouseup (to move the selection)
expect(onSelection.callCount).to.equal(2);
expect(onSelection.getCall(1).args).to.deep.equal([[Regions.column(newIndex)]]);
});
it("Deselects a selected row on cmd+click (without reordering)", () => {
const table = mountTable({
enableRowReordering: true,
onRowsReordered,
onSelection,
selectedRegions: [Regions.row(OLD_INDEX)],
});
const headerCell = getHeaderCell(getRowHeadersWrapper(table)!, 0)!;
headerCell.mouse("mousedown", { metaKey: true }).mouse("mousemove", 0, OFFSET_Y);
const guide = table.find(`.${Classes.TABLE_HORIZONTAL_GUIDE}`)!;
expect(guide.exists(), "guide not drawn").be.false;
headerCell.mouse("mouseup", 0, OFFSET_Y);
expect(onSelection.called, "onSelection called").to.be.true;
expect(onSelection.calledWith([]), "onSelection called with []").to.be.true;
expect(onRowsReordered.called, "onRowsReordered not called").to.be.false;
});
it("Deselects a selected column on cmd+click (without reordering)", () => {
const table = mountTable({
enableColumnReordering: true,
onColumnsReordered,
onSelection,
selectedRegions: [Regions.column(OLD_INDEX)],
});
const headerCell = getHeaderCell(getColumnHeadersWrapper(table)!, 0)!;
headerCell.mouse("mousedown", { metaKey: true }).mouse("mousemove", 0, OFFSET_Y);
const guide = table.find(`.${Classes.TABLE_VERTICAL_GUIDE}`)!;
expect(guide.exists(), "guide not drawn").be.false;
headerCell.mouse("mouseup", 0, OFFSET_Y);
expect(onSelection.called, "onSelection called").to.be.true;
expect(onSelection.calledWith([]), "onSelection called with []").to.be.true;
expect(onColumnsReordered.called, "onColumnsReordered not called").to.be.false;
});
it("Does not deselect a selected column when the reorder handle is cmd+click'd", () => {
const table = mountTable({
enableColumnReordering: true,
onColumnsReordered,
onSelection,
});
const headerCell = getHeaderCell(getColumnHeadersWrapper(table)!, 0)!;
const reorderHandle = getReorderHandle(headerCell)!;
reorderHandle
.mouse("mousedown", { metaKey: true })
.mouse("mousemove", getAdjustedOffsetX(OFFSET_X, reorderHandle))
.mouse("mouseup", getAdjustedOffsetX(OFFSET_X, reorderHandle));
expect(onColumnsReordered.called).to.be.true;
expect(onSelection.firstCall.calledWith([Regions.column(0)]));
});
function mountTable(props: Partial<TableProps>) {
const table = harness.mount(
<div style={{ width: CONTAINER_WIDTH_IN_PX, height: CONTAINER_HEIGHT_IN_PX }}>
<Table2
columnWidths={Array(NUM_COLUMNS).fill(COLUMN_WIDTH_IN_PX)}
numRows={NUM_ROWS}
rowHeights={Array(NUM_ROWS).fill(ROW_HEIGHT_IN_PX)}
{...props}
>
<Column cellRenderer={renderDummyCell} />
<Column cellRenderer={renderDummyCell} />
<Column cellRenderer={renderDummyCell} />
<Column cellRenderer={renderDummyCell} />
<Column cellRenderer={renderDummyCell} />
</Table2>
</div>,
);
return table;
}
function getColumnHeadersWrapper(table: ElementHarness) {
return table.find(`.${Classes.TABLE_COLUMN_HEADERS}`);
}
function getRowHeadersWrapper(table: ElementHarness) {
return table.find(`.${Classes.TABLE_ROW_HEADERS}`);
}
function getHeaderCell(headersWrapper: ElementHarness, index: number) {
return headersWrapper.find(`.${Classes.TABLE_HEADER}`, index);
}
function getReorderHandle(header: ElementHarness) {
return header.find(`.${Classes.TABLE_REORDER_HANDLE_TARGET}`);
}
function getAdjustedOffsetX(offsetX: number, reorderHandle: ElementHarness) {
// adjust the x coordinate to account for the rendered width of the reorder handle
return offsetX - reorderHandle.bounds()!.width;
}
});
// HACKHACK: path_to_url
describe.skip("Focused cell", () => {
let onFocusedCell: sinon.SinonSpy;
let onVisibleCellsChange: sinon.SinonSpy;
const NUM_ROWS = 3;
const NUM_COLS = 3;
// center the initial focus cell
const DEFAULT_FOCUSED_CELL_COORDS: FocusedCellCoordinates = { row: 1, col: 1 } as any;
// Enzyme appears to render our Table2 at 60px high x 400px wide. make all rows and columns
// the same size as the table to force scrolling no matter which direction we move the focus
// cell.
const ROW_HEIGHT = 60;
const COL_WIDTH = 400;
// make these values arbitrarily bigger than the table bounds
const OVERSIZED_ROW_HEIGHT = 10000;
const OVERSIZED_COL_WIDTH = 10000;
beforeEach(() => {
onFocusedCell = sinon.spy();
onVisibleCellsChange = sinon.spy();
});
it("removes the focused cell if enableFocusedCell is reset to false", () => {
const { component } = mountTable();
const focusCellSelector = `.${Classes.TABLE_FOCUS_REGION}`;
expect(component.find(focusCellSelector).exists()).to.be.true;
component.setProps({ enableFocusedCell: false });
component.update();
expect(component.find(focusCellSelector).exists()).to.be.false;
});
describe("moves a focus cell with arrow keys", () => {
runFocusCellMoveTest("ArrowUp", { row: 0, col: 1, focusSelectionIndex: 0 });
runFocusCellMoveTest("ArrowDown", {
col: 1,
focusSelectionIndex: 0,
row: 2,
});
runFocusCellMoveTest("ArrowLeft", {
col: 0,
focusSelectionIndex: 0,
row: 1,
});
runFocusCellMoveTest("ArrowRight", {
col: 2,
focusSelectionIndex: 0,
row: 1,
});
it("doesn't move a focus cell if modifier key is pressed", () => {
const { component } = mountTable();
component.simulate("keyDown", createKeyEventConfig(component, "ArrowRight", true));
expect(onFocusedCell.called).to.be.false;
});
function runFocusCellMoveTest(key: string, expectedCoords: FocusedCellCoordinates) {
it(key, () => {
const { component } = mountTable();
component.simulate("keyDown", createKeyEventConfig(component, key));
expect(onFocusedCell.called).to.be.true;
expect(onFocusedCell.getCall(0).args[0]).to.deep.equal(expectedCoords);
});
}
});
describe("moves a focus cell internally with tab and enter", () => {
function runFocusCellMoveInternalTest(
name: string,
key: string,
shiftKey: boolean,
focusCellCoords: FocusedCellCoordinates,
expectedCoords: FocusedCellCoordinates,
) {
it(name, () => {
const selectedRegions: Region[] = [
{ cols: [0, 1], rows: [0, 1] },
{ cols: [2, 2], rows: [2, 2] },
];
const tableHarness = mount(
<Table2
numRows={5}
enableFocusedCell={true}
focusedCell={focusCellCoords}
onFocusedCell={onFocusedCell}
selectedRegions={selectedRegions}
>
<Column name="Column0" cellRenderer={renderDummyCell} />
<Column name="Column1" cellRenderer={renderDummyCell} />
<Column name="Column2" cellRenderer={renderDummyCell} />
<Column name="Column3" cellRenderer={renderDummyCell} />
<Column name="Column4" cellRenderer={renderDummyCell} />
</Table2>,
);
tableHarness.simulate("keyDown", createKeyEventConfig(tableHarness, key, shiftKey));
expect(onFocusedCell.args[0][0]).to.deep.equal(expectedCoords);
});
}
runFocusCellMoveInternalTest(
"moves a focus cell on tab",
"Tab",
false,
{ row: 0, col: 0, focusSelectionIndex: 0 },
{ row: 0, col: 1, focusSelectionIndex: 0 },
);
runFocusCellMoveInternalTest(
"wraps a focus cell around with tab",
"Tab",
false,
{ row: 0, col: 1, focusSelectionIndex: 0 },
{ row: 1, col: 0, focusSelectionIndex: 0 },
);
runFocusCellMoveInternalTest(
"moves a focus cell to next region with tab",
"Tab",
false,
{ row: 1, col: 1, focusSelectionIndex: 0 },
{ row: 2, col: 2, focusSelectionIndex: 1 },
);
runFocusCellMoveInternalTest(
"moves a focus cell on enter",
"Enter",
false,
{ row: 0, col: 0, focusSelectionIndex: 0 },
{ row: 1, col: 0, focusSelectionIndex: 0 },
);
runFocusCellMoveInternalTest(
"wraps a focus cell around with enter",
"Enter",
false,
{ row: 1, col: 0, focusSelectionIndex: 0 },
{ row: 0, col: 1, focusSelectionIndex: 0 },
);
runFocusCellMoveInternalTest(
"moves a focus cell to next region with enter",
"Enter",
false,
{ row: 1, col: 1, focusSelectionIndex: 0 },
{ row: 2, col: 2, focusSelectionIndex: 1 },
);
runFocusCellMoveInternalTest(
"moves a focus cell on shift+tab",
"Tab",
true,
{ row: 0, col: 1, focusSelectionIndex: 0 },
{ row: 0, col: 0, focusSelectionIndex: 0 },
);
runFocusCellMoveInternalTest(
"wraps a focus cell around with shift+tab",
"Tab",
true,
{ row: 1, col: 0, focusSelectionIndex: 0 },
{ row: 0, col: 1, focusSelectionIndex: 0 },
);
runFocusCellMoveInternalTest(
"moves a focus cell to prev region with shift+tab",
"Tab",
true,
{ row: 0, col: 0, focusSelectionIndex: 0 },
{ row: 2, col: 2, focusSelectionIndex: 1 },
);
runFocusCellMoveInternalTest(
"moves a focus cell on shift+enter",
"Enter",
true,
{ row: 1, col: 0, focusSelectionIndex: 0 },
{ row: 0, col: 0, focusSelectionIndex: 0 },
);
runFocusCellMoveInternalTest(
"wraps a focus cell around with shift+enter",
"Enter",
true,
{ row: 0, col: 1, focusSelectionIndex: 0 },
{ row: 1, col: 0, focusSelectionIndex: 0 },
);
runFocusCellMoveInternalTest(
"moves a focus cell to next region with shift+enter",
"Enter",
true,
{ row: 0, col: 0, focusSelectionIndex: 0 },
{ row: 2, col: 2, focusSelectionIndex: 1 },
);
});
describe("scrolls viewport to fit focused cell after moving it", () => {
runFocusCellViewportScrollTest("ArrowUp", "top", ROW_HEIGHT * 0);
runFocusCellViewportScrollTest("ArrowDown", "top", ROW_HEIGHT * 2);
runFocusCellViewportScrollTest("ArrowLeft", "left", COL_WIDTH * 0);
runFocusCellViewportScrollTest("ArrowRight", "left", COL_WIDTH * 2);
it("keeps top edge of oversized focus cell in view when moving left and right", () => {
// subtract one pixel to avoid clipping the focus cell
const EXPECTED_TOP_OFFSET = OVERSIZED_ROW_HEIGHT * 1 - 1;
const { component } = mountTable(OVERSIZED_ROW_HEIGHT, OVERSIZED_COL_WIDTH);
const keyEventConfig = createKeyEventConfig(component, "ArrowRight");
// move right twice, expecting the viewport to snap to the top of the oversize
// focused cell both times
component.simulate("keyDown", keyEventConfig);
expect(component.state("viewportRect")!.top).to.equal(EXPECTED_TOP_OFFSET);
component.simulate("keyDown", keyEventConfig);
expect(component.state("viewportRect")!.top).to.equal(EXPECTED_TOP_OFFSET);
});
it("keeps left edge of oversized focus cell in view when moving up and down", () => {
// subtract one pixel to avoid clipping the focus cell
const EXPECTED_LEFT_OFFSET = OVERSIZED_COL_WIDTH * 1 - 1;
const { component } = mountTable(OVERSIZED_ROW_HEIGHT, OVERSIZED_COL_WIDTH);
const keyEventConfig = createKeyEventConfig(component, "ArrowDown");
// move down twice, expecting the viewport to snap to the left of the oversize
// focused cell both times
component.simulate("keyDown", keyEventConfig);
expect(component.state("viewportRect")!.left).to.equal(EXPECTED_LEFT_OFFSET);
component.simulate("keyDown", keyEventConfig);
expect(component.state("viewportRect")!.left).to.equal(EXPECTED_LEFT_OFFSET);
});
function runFocusCellViewportScrollTest(key: string, attrToCheck: "top" | "left", expectedOffset: number) {
it(key, () => {
const { component } = mountTable();
component.simulate("keyDown", createKeyEventConfig(component, key));
expect(component.state("viewportRect")![attrToCheck]).to.equal(expectedOffset);
expect(onVisibleCellsChange.callCount, "onVisibleCellsChange call count").to.equal(6);
const rowIndices: RowIndices = { rowIndexStart: 0, rowIndexEnd: NUM_ROWS - 1 };
const columnIndices: ColumnIndices = {
columnIndexEnd: NUM_COLS - 1,
columnIndexStart: 0,
};
expect(
onVisibleCellsChange.lastCall.calledWith(rowIndices, columnIndices),
"onVisibleCellsChange row/col indices",
).to.be.true;
});
}
});
function mountTable(rowHeight = ROW_HEIGHT, colWidth = COL_WIDTH) {
const attachTo = document.createElement("div");
// need to `.fill` with some explicit value so that mapping will work, apparently
const columns = Array(NUM_COLS)
.fill(undefined)
.map((_, i) => <Column key={i} cellRenderer={renderDummyCell} />);
const component = mount(
<Table2
columnWidths={Array(NUM_ROWS).fill(colWidth)}
enableFocusedCell={true}
focusedCell={DEFAULT_FOCUSED_CELL_COORDS}
onFocusedCell={onFocusedCell}
onVisibleCellsChange={onVisibleCellsChange}
rowHeights={Array(NUM_ROWS).fill(rowHeight)}
numRows={NUM_ROWS}
>
{columns}
</Table2>,
{ attachTo },
);
// center the viewport on the focused cell
const viewportLeft = DEFAULT_FOCUSED_CELL_COORDS.col * COL_WIDTH;
const viewportTop = DEFAULT_FOCUSED_CELL_COORDS.row * ROW_HEIGHT;
const viewportWidth = COL_WIDTH;
const viewportHeight = ROW_HEIGHT;
component.setState({
viewportRect: new Rect(viewportLeft, viewportTop, viewportWidth, viewportHeight),
});
return { attachTo, component };
}
});
// HACKHACK: path_to_url
describe.skip("Manually scrolling while drag-selecting", () => {
const ACTIVATION_CELL_COORDS: CellCoordinates = { row: 1, col: 1 };
const NUM_ROWS = 3;
const NUM_COLS = 3;
const ROW_HEIGHT = 60;
const COL_WIDTH = 400;
let onSelection: sinon.SinonSpy;
beforeEach(() => {
onSelection = sinon.spy();
});
runTest("up");
runTest("down");
runTest("left");
runTest("right");
function runTest(direction: "up" | "down" | "left" | "right") {
// create a new object so that tests don't keep mutating the same object instance.
const { row, col } = ACTIVATION_CELL_COORDS;
const nextCellCoords = { row, col };
if (direction === "up") {
nextCellCoords.col -= 1;
} else if (direction === "down") {
nextCellCoords.col += 1;
} else if (direction === "left") {
nextCellCoords.row -= 1;
} else {
// if direction === "right"
nextCellCoords.row += 1;
}
it(`should keep the same activation coordinates when manually scrolling ${direction}`, () => {
assertActivationCellUnaffected(nextCellCoords);
});
}
function assertActivationCellUnaffected(nextCellCoords: CellCoordinates) {
// setup
const table = mountTable();
const { grid, locator } = table.instance() as Table2;
const prevViewportRect = locator!.getViewportRect();
// get native DOM nodes
const tableNode = table.getDOMNode();
const tableBodySelector = `.${Classes.TABLE_BODY_VIRTUAL_CLIENT}`;
const tableBodyNode = ReactDOM.findDOMNode(tableNode.querySelector(tableBodySelector));
// trigger a drag-selection starting at the center of the activation cell
const activationX = COL_WIDTH / 2;
const activationY = ROW_HEIGHT / 2;
dispatchMouseEvent(tableBodyNode!, "mousedown", activationX, activationY);
// scroll the next cell into view
updateLocatorElements(
table,
grid!.getCumulativeWidthBefore(nextCellCoords.col),
grid!.getCumulativeHeightBefore(nextCellCoords.row),
prevViewportRect.height,
prevViewportRect.width,
);
// move the mouse a little to trigger a selection update
dispatchMouseEvent(document, "mousemove", activationX, activationY + 1);
// verify the selection is still anchored to the activation cell
// (onSelection will now have been called after the "mousedown" and after the "mousemove")
const selections = onSelection.getCall(1).args[0];
const selection = selections[0];
const selectedCols = selection.cols;
const selectedRows = selection.rows;
const expectedCols = sortInterval(ACTIVATION_CELL_COORDS.col, nextCellCoords.col);
const expectedRows = sortInterval(ACTIVATION_CELL_COORDS.row, nextCellCoords.row);
expect(CoreUtils.arraysEqual(selectedCols, expectedCols)).to.be.true;
expect(CoreUtils.arraysEqual(selectedRows, expectedRows)).to.be.true;
}
function mountTable(rowHeight = ROW_HEIGHT, colWidth = COL_WIDTH) {
// need to explicitly `.fill` a new array with empty values for mapping to work
const defineColumn = (_unused: any, i: number) => <Column key={i} cellRenderer={renderDummyCell} />;
const columns = Array(NUM_COLS).fill(undefined).map(defineColumn);
const table = mount(
<Table2
columnWidths={Array(NUM_COLS).fill(colWidth)}
onSelection={onSelection}
rowHeights={Array(NUM_ROWS).fill(rowHeight)}
numRows={NUM_ROWS}
>
{columns}
</Table2>,
);
// scroll to the activation cell
updateLocatorElements(
table,
ACTIVATION_CELL_COORDS.col * colWidth,
ACTIVATION_CELL_COORDS.row * rowHeight,
colWidth,
rowHeight,
);
return table;
}
function sortInterval(coord1: number, coord2: number) {
return coord1 > coord2 ? [coord2, coord1] : [coord1, coord2];
}
});
// HACKHACK: path_to_url
// These tests were not running their assertions correctly for a while, and when that was fixed, the tests broke.
// Skipping for now so that the rest of the suite can run without error.
describe.skip("Autoscrolling when rows/columns decrease in count or size", () => {
const COL_WIDTH = 400;
const ROW_HEIGHT = 60;
const NUM_COLS = 10;
const NUM_ROWS = 10;
const UPDATED_NUM_COLS = NUM_COLS - 1;
const UPDATED_NUM_ROWS = NUM_ROWS - 1;
// small, 1px tweaks that keep the entire table larger than the viewport but that also
// require autoscrolling
const UPDATED_COL_WIDTH = COL_WIDTH - 1;
const UPDATED_ROW_HEIGHT = ROW_HEIGHT - 1;
let onVisibleCellsChange: sinon.SinonSpy;
beforeEach(() => {
onVisibleCellsChange = sinon.spy();
});
it("when column count decreases", done => {
const table = mountTable(NUM_COLS, 1);
scrollTable(table, (NUM_COLS - 1) * COL_WIDTH, 0, () => {
const newColumns = renderColumns(UPDATED_NUM_COLS);
table.setProps({ children: newColumns, columnWidths: Array(UPDATED_NUM_COLS).fill(COL_WIDTH) });
// the viewport should have auto-scrolled to fit the last column in view
const viewportRect = table.state("viewportRect")!;
expect(viewportRect.left).to.equal(UPDATED_NUM_COLS * COL_WIDTH - viewportRect.width);
// this callback is invoked more than necessary in response to a single change.
// feel free to tighten the screws and reduce this expected count.
expect(onVisibleCellsChange.callCount).to.equal(5);
done();
});
});
it("when row count decreases", done => {
const table = mountTable(1, NUM_ROWS);
scrollTable(table, 0, (NUM_ROWS - 1) * ROW_HEIGHT, () => {
table.setProps({ numRows: UPDATED_NUM_ROWS, rowHeights: Array(UPDATED_NUM_ROWS).fill(ROW_HEIGHT) });
const viewportRect = table.state("viewportRect")!;
expect(viewportRect.top).to.equal(UPDATED_NUM_ROWS * ROW_HEIGHT - viewportRect.height);
expect(onVisibleCellsChange.callCount).to.equal(5);
done();
});
});
it("when column widths decrease", done => {
const table = mountTable(NUM_COLS, 1);
scrollTable(table, (NUM_COLS - 1) * COL_WIDTH, 0, () => {
table.setProps({ columnWidths: Array(NUM_COLS).fill(UPDATED_COL_WIDTH) });
const viewportRect = table.state("viewportRect")!;
expect(viewportRect.left).to.equal(NUM_COLS * UPDATED_COL_WIDTH - viewportRect.width);
expect(onVisibleCellsChange.callCount).to.equal(5);
done();
});
});
it("when row heights decrease", done => {
const table = mountTable(1, NUM_ROWS);
scrollTable(table, 0, (NUM_ROWS - 1) * ROW_HEIGHT, () => {
table.setProps({ rowHeights: Array(NUM_ROWS).fill(UPDATED_ROW_HEIGHT) });
const viewportRect = table.state("viewportRect")!;
expect(viewportRect.top).to.equal(NUM_ROWS * UPDATED_ROW_HEIGHT - viewportRect.height);
expect(onVisibleCellsChange.callCount).to.equal(5);
done();
});
});
function mountTable(numCols: number, numRows: number) {
return mount(
<Table2
columnWidths={Array(numCols).fill(COL_WIDTH)}
rowHeights={Array(numRows).fill(ROW_HEIGHT)}
numRows={numRows}
onVisibleCellsChange={onVisibleCellsChange}
>
{renderColumns(numCols)}
</Table2>,
);
}
function renderColumns(numCols: number) {
return Array(numCols).fill(undefined).map(renderColumn);
}
function renderColumn(_unused: any, i: number) {
return <Column key={i} cellRenderer={renderDummyCell} />;
}
function scrollTable(table: ReactWrapper<any>, scrollLeft: number, scrollTop: number, callback: () => void) {
// make the viewport small enough to fit only one cell
updateLocatorElements(table, scrollLeft, scrollTop, COL_WIDTH, ROW_HEIGHT);
table.find(TableQuadrant).first().simulate("scroll");
// delay to next frame to let throttled scroll logic execute first
delayToNextFrame(callback);
}
});
describe("Validation", () => {
describe("on mount", () => {
describe("errors", () => {
// const DEFAULT_NUM_ROWS = 3;
// const DEFAULT_NUM_COLS = 3;
// const consoleErrorSpy = sinon.spy(console, "error");
// function mountTable(props?: Partial<TableProps>, rowHeight = 60, colWidth = 400) {
// // need to explicitly `.fill` a new array with empty values for mapping to work
// const defineColumn = (_unused: any, i: number) => <Column key={i} cellRenderer={renderDummyCell} />;
// const columns = Array(DEFAULT_NUM_COLS).fill(undefined).map(defineColumn);
// return mount(
// <Table2
// columnWidths={Array(DEFAULT_NUM_COLS).fill(colWidth)}
// rowHeights={Array(DEFAULT_NUM_ROWS).fill(rowHeight)}
// numRows={DEFAULT_NUM_ROWS}
// {...props}
// >
// {columns}
// </Table2>,
// );
// }
// beforeEach(() => {
// consoleErrorSpy.resetHistory();
// });
// `expectPropValidationError` incorrectly infers the prop type from the constructor,
// which includes the default prop keys... so we need to cast to the more partial props type
const TableClass = Table2 as React.ComponentClass<TableProps>;
it("throws an error if numRows < 0", () => {
expectPropValidationError(TableClass, { numRows: -1 }, Errors.TABLE_NUM_ROWS_NEGATIVE);
// mountTable({ numRows: -1 });
// expect(consoleErrorSpy.calledWith(Errors.TABLE_NUM_ROWS_NEGATIVE));
});
it("throws an error if numFrozenRows < 0", () => {
expectPropValidationError(TableClass, { numFrozenRows: -1 }, Errors.TABLE_NUM_FROZEN_ROWS_NEGATIVE);
});
it("throws an error if numFrozenColumns < 0", () => {
expectPropValidationError(
TableClass,
{ numFrozenColumns: -1 },
Errors.TABLE_NUM_FROZEN_COLUMNS_NEGATIVE,
);
});
it("throws an error if rowHeights.length !== numRows", () => {
expectPropValidationError(
TableClass,
{ numRows: 3, rowHeights: [1, 2] },
Errors.TABLE_NUM_ROWS_ROW_HEIGHTS_MISMATCH,
);
});
it("throws an error if columnWidths.length !== number of <Column>s", () => {
expectPropValidationError(
TableClass,
{
children: [<Column key={0} />, <Column key={1} />, <Column key={2} />],
columnWidths: [1, 2],
},
Errors.TABLE_NUM_COLUMNS_COLUMN_WIDTHS_MISMATCH,
);
});
it("throws an error if a non-<Column> child is provided", () => {
// we were printing a warning before, but the Table2 would
// eventually throw an error from deep inside, so might as
// well just throw a clear error at the outset.
expectPropValidationError(
TableClass,
{
children: <span>I'm a span, not a column</span>,
},
Errors.TABLE_NON_COLUMN_CHILDREN_WARNING,
);
});
});
describe("warnings", () => {
let consoleWarn: sinon.SinonStub;
before(() => (consoleWarn = sinon.stub(console, "warn")));
afterEach(() => consoleWarn.resetHistory());
after(() => consoleWarn.restore());
it("should print a warning when numFrozenRows > numRows", () => {
mount(<Table2 numRows={1} numFrozenRows={2} />);
expect(consoleWarn.calledOnce);
expect(consoleWarn.firstCall.args).to.deep.equal([Errors.TABLE_NUM_FROZEN_ROWS_BOUND_WARNING]);
});
it("should print a warning when numFrozenColumns > num <Column>s", () => {
mount(
<Table2 numFrozenColumns={2}>
<Column />
</Table2>,
);
expect(consoleWarn.calledOnce);
expect(consoleWarn.firstCall.args).to.deep.equal([Errors.TABLE_NUM_FROZEN_COLUMNS_BOUND_WARNING]);
});
});
});
});
// HACKHACK: path_to_url
it.skip("Accepts a sparse array of column widths", () => {
const table = harness.mount(
<Table2 columnWidths={[null, 200, null]} defaultColumnWidth={75}>
<Column />
<Column />
<Column />
</Table2>,
);
const columns = table.find(`.${Classes.TABLE_COLUMN_HEADERS}`)!;
expect(columns.find(`.${Classes.TABLE_HEADER}`, 0)!.bounds()!.width).to.equal(75);
expect(columns.find(`.${Classes.TABLE_HEADER}`, 1)!.bounds()!.width).to.equal(200);
expect(columns.find(`.${Classes.TABLE_HEADER}`, 2)!.bounds()!.width).to.equal(75);
});
// HACKHACK: path_to_url
describe.skip("Persists column widths", () => {
const expectHeaderWidth = (table: ElementHarness, index: number, width: number) => {
expect(
table.find(`.${Classes.TABLE_COLUMN_HEADERS}`)!.find(`.${Classes.TABLE_HEADER}`, index)!.bounds()!
.width,
).to.equal(width);
};
it("remembers width for columns that have an ID", () => {
const columns = [<Column key="a" id="a" />, <Column key="b" id="b" />, <Column key="c" id="c" />];
// default and explicit sizes sizes
const table0 = harness.mount(
<Table2 columnWidths={[null, 100, null]} defaultColumnWidth={50}>
{columns}
</Table2>,
);
expectHeaderWidth(table0, 0, 50);
expectHeaderWidth(table0, 1, 100);
expectHeaderWidth(table0, 2, 50);
// removing explicit size props
const table1 = harness.mount(<Table2>{columns}</Table2>);
expectHeaderWidth(table1, 0, 50);
expectHeaderWidth(table1, 1, 100);
expectHeaderWidth(table1, 2, 50);
// re-arranging and REMOVING columns
const table2 = harness.mount(<Table2>{[columns[1], columns[0]]}</Table2>);
expectHeaderWidth(table2, 0, 100);
expectHeaderWidth(table2, 1, 50);
// re-arranging and ADDING columns
const table3 = harness.mount(<Table2 defaultColumnWidth={51}>{columns}</Table2>);
expectHeaderWidth(table3, 0, 50);
expectHeaderWidth(table3, 1, 100);
expectHeaderWidth(table3, 2, 51);
});
it("remembers width for columns without IDs using index", () => {
const columns = [<Column key="a" id="a" />, <Column key="b" />, <Column key="c" />];
// default and explicit sizes sizes
const table0 = harness.mount(
<Table2 columnWidths={[null, 100, null]} defaultColumnWidth={50}>
{columns}
</Table2>,
);
expectHeaderWidth(table0, 0, 50);
expectHeaderWidth(table0, 1, 100);
expectHeaderWidth(table0, 2, 50);
// removing explicit size props
const table1 = harness.mount(<Table2>{columns}</Table2>);
expectHeaderWidth(table1, 0, 50);
expectHeaderWidth(table1, 1, 100);
expectHeaderWidth(table1, 2, 50);
// re-arranging and REMOVING columns
const table2 = harness.mount(<Table2>{[columns[1], columns[0]]}</Table2>);
expectHeaderWidth(table2, 0, 50); // <= difference when no IDs
expectHeaderWidth(table2, 1, 50);
// re-arranging and ADDING columns
const table3 = harness.mount(<Table2 defaultColumnWidth={51}>{columns}</Table2>);
expectHeaderWidth(table3, 0, 50);
expectHeaderWidth(table3, 1, 50); // <= difference when no IDs
expectHeaderWidth(table3, 2, 51);
});
});
describe("Empty-state", () => {
const CELL_INDEX = 0;
const SELECTED_REGIONS = [Regions.row(0), Regions.column(0), Regions.cell(0, 0), Regions.table()];
let table: ReactWrapper<TableProps, TableState>;
describe("disables all selection modes", () => {
it("when numRows = 0", () => {
table = mountTable(0, 1);
clickColumnHeaderCell();
expectNoSelectedRegions();
clickTableMenu();
expectNoSelectedRegions();
});
it("when numCols = 0", () => {
table = mountTable(1, 0);
clickRowHeaderCell();
expectNoSelectedRegions();
clickTableMenu();
expectNoSelectedRegions();
});
});
describe("clears all uncontrolled selections", () => {
it("when numRows becomes 0", () => {
table = mountTable(1, 1);
table.setState({ selectedRegions: SELECTED_REGIONS });
table.setProps({ numRows: 0 });
expectNoSelectedRegions();
});
it("when numCols becomes 0", () => {
table = mountTable(1, 1);
table.setState({ selectedRegions: SELECTED_REGIONS });
table.setProps({ children: [] });
expectNoSelectedRegions();
});
});
describe("leaves controlled selections in place", () => {
it("when numRows becomes 0", () => {
table = mountTable(1, 1, { selectedRegions: SELECTED_REGIONS });
table.setProps({ numRows: 0, selectedRegions: SELECTED_REGIONS });
expect(table.state().selectedRegions).to.deep.equal(SELECTED_REGIONS);
});
it("when numCols becomes 0", () => {
table = mountTable(1, 1, { selectedRegions: SELECTED_REGIONS });
table.setProps({ children: [], selectedRegions: SELECTED_REGIONS });
expect(table.state().selectedRegions).to.deep.equal(SELECTED_REGIONS);
});
});
function mountTable(numRows: number, numCols: number, tableProps: Partial<TableProps> = {}) {
// this createTableOfSize API is backwards from the codebase's
// normal [row, column] parameter order. :/
return mount(
createTableOfSize(numCols, numRows, {
cellRenderer: renderDummyCell,
enableGhostCells: true,
enableRowHeader: true,
...tableProps,
}),
);
}
function click(component: ReactWrapper<any, any>) {
component.simulate("mousedown").simulate("mouseup");
}
function find(selector: string) {
return table.find(`.${Classes.TABLE_QUADRANT_MAIN} ${selector}`);
}
function clickRowHeaderCell() {
click(find(`.${Classes.TABLE_ROW_HEADERS} .${Classes.TABLE_HEADER}`).at(CELL_INDEX));
}
function clickColumnHeaderCell() {
click(find(`.${Classes.TABLE_COLUMN_HEADERS} .${Classes.TABLE_HEADER}`).at(CELL_INDEX));
}
function clickTableMenu() {
click(find(`.${Classes.TABLE_MENU}`));
}
function expectNoSelectedRegions() {
expect(table.state("selectedRegions")).to.be.empty;
}
});
// HACKHACK: path_to_url
describe.skip("Hotkey: shift + arrow keys", () => {
const NUM_ROWS = 3;
const NUM_COLS = 3;
const SELECTED_CELL_ROW = 1;
const SELECTED_CELL_COL = 1;
const selectedRegions = [Regions.cell(SELECTED_CELL_ROW, SELECTED_CELL_COL)];
it("resizes a selection on shift + arrow keys", () => {
const onSelection = sinon.spy();
const component = mount(createTableOfSize(NUM_COLS, NUM_ROWS, {}, { onSelection, selectedRegions }), {
attachTo: containerElement,
});
const tableContainerEl = component.find(`.${Classes.TABLE_CONTAINER}`).getDOMNode();
TestUtils.Simulate.keyDown(tableContainerEl, { key: "ArrowRight", shiftKey: true });
expect(onSelection.callCount).to.equal(1, "should expand rightward");
expect(onSelection.firstCall.args).to.deep.equal([
[Regions.cell(SELECTED_CELL_ROW, SELECTED_CELL_COL, SELECTED_CELL_ROW, SELECTED_CELL_COL + 1)],
]);
});
it("resizes a selection on shift + arrow keys if focusedCell is defined", () => {
const onSelection = sinon.spy();
const focusedCell = {
col: SELECTED_CELL_COL,
focusSelectionIndex: 0,
row: SELECTED_CELL_ROW,
};
const tableProps = {
enableFocusedCell: true,
focusedCell,
onSelection,
selectedRegions,
};
const component = mount(createTableOfSize(NUM_COLS, NUM_ROWS, {}, tableProps), {
attachTo: containerElement,
});
const tableContainerEl = component.find(`.${Classes.TABLE_CONTAINER}`).getDOMNode();
const expectedSelectedRegions = [
Regions.cell(SELECTED_CELL_ROW, SELECTED_CELL_COL, SELECTED_CELL_ROW, SELECTED_CELL_COL + 1),
];
// should expand rightward
TestUtils.Simulate.keyDown(tableContainerEl, { key: "ArrowRight", shiftKey: true });
expect(onSelection.callCount).to.equal(1, "should expand rightward");
expect(onSelection.firstCall.args).to.deep.equal([expectedSelectedRegions]);
onSelection.resetHistory();
// pretend the selection change persisted
component.setProps({ selectedRegions: expectedSelectedRegions });
// should undo the expansion
TestUtils.Simulate.keyDown(tableContainerEl, { key: "ArrowLeft", shiftKey: true });
expect(onSelection.callCount).to.equal(1, "should contract selection leftward");
expect(onSelection.firstCall.args).to.deep.equal([selectedRegions]);
});
it("does not change a selection on shift + arrow keys if enableMultipleSelection=false", () => {
const onSelection = sinon.spy();
const tableProps = { enableMultipleSelection: false, onSelection, selectedRegions };
const component = mount(createTableOfSize(NUM_COLS, NUM_ROWS, {}, tableProps), {
attachTo: containerElement,
});
const tableContainerEl = component.find(`.${Classes.TABLE_CONTAINER}`).getDOMNode();
TestUtils.Simulate.keyDown(tableContainerEl, { key: "ArrowRight", shiftKey: true });
expect(onSelection.callCount).to.equal(0, "should not change selection");
});
});
describe("EXPERIMENTAL: cellRendererDependencies", () => {
it("Does not re-render cells when dependencies don't change", () => {
const dependencies: any[] = ["stable"];
const cellRenderer = sinon.stub().returns(<Cell>foo</Cell>);
const table = mount(
<Table2 numRows={1} cellRendererDependencies={dependencies}>
<Column name="Column0" cellRenderer={cellRenderer} />
</Table2>,
);
const originalCallCount = cellRenderer.callCount;
// replace the single dependency with a shallow-equal value
dependencies[0] = "stable";
table.setProps({ cellRendererDependencies: dependencies });
expect(cellRenderer.callCount).to.be.equal(
originalCallCount,
"cellRenderer should not have been called again when cellRendererDependencies are the same",
);
});
it("Does re-render cells when dependencies change", () => {
const dependencies: string[] = ["some data from external store"];
const cellRenderer = () => <Cell>{dependencies[0]}</Cell>;
const table = mount(
<Table2 numRows={1} cellRendererDependencies={dependencies.slice()}>
<Column name="Column0" cellRenderer={cellRenderer} />
</Table2>,
);
expect(getFirstCellText()).to.equal(dependencies[0]);
// replace the single dependency with a shallow-equal value
dependencies[0] = "new data from external store";
table.setProps({ cellRendererDependencies: dependencies.slice() });
expect(getFirstCellText()).to.equal(
dependencies[0],
"cellRenderer should have been called again when cellRendererDependencies changed",
);
function getFirstCellText() {
return table
.find(`.${Classes.rowCellIndexClass(0)}.${Classes.columnCellIndexClass(0)}`)
.hostNodes()
.text();
}
});
});
function renderDummyCell() {
return <Cell>gg</Cell>;
}
function updateLocatorElements(
table: ReactWrapper<any>,
scrollLeft: number,
scrollTop: number,
clientWidth: number,
clientHeight: number,
) {
const locator = (table.instance() as any).locator;
const baseStyles = { clientHeight, clientWidth };
locator.scrollContainerElement = {
...baseStyles,
getBoundingClientRect: () => ({ left: 0, top: 0 }),
scrollLeft,
scrollTop,
};
const rowHeadersElement = table.getDOMNode().querySelector<HTMLElement>(`.${Classes.TABLE_ROW_HEADERS}`);
const rowHeaderWidth = rowHeadersElement == null ? 0 : parseInt(rowHeadersElement.style.width, 10);
// the scrollContainerElement *contains* the cellContainerElement, so
// when we scroll the former, the latter's bounding rect offsets change
// commensurately.
locator.cellContainerElement = {
...baseStyles,
getBoundingClientRect: () => ({
left: rowHeaderWidth - scrollLeft,
top: 0 - scrollTop,
}),
};
}
function delayToNextFrame(callback: () => void) {
setTimeout(callback);
}
function createKeyEventConfig(wrapper: ReactWrapper<any, any>, key: string, shiftKey = false) {
const eventConfig = {
key,
preventDefault: () => {
/* Empty */
},
shiftKey,
stopPropagation: () => {
/* Empty */
},
target: wrapper.instance(),
};
return {
eventConfig,
nativeEvent: eventConfig,
};
}
});
``` | /content/code_sandbox/packages/table/test/table2Tests.tsx | xml | 2016-10-25T21:17:50 | 2024-08-16T15:14:48 | blueprint | palantir/blueprint | 20,593 | 19,793 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="path_to_url"
xmlns:app="path_to_url"
xmlns:tools="path_to_url">
<data>
<import type="com.topjohnwu.magisk.ui.home.HomeViewModel.State" />
<variable
name="viewModel"
type="com.topjohnwu.magisk.ui.home.HomeViewModel" />
</data>
<com.google.android.material.card.MaterialCardView
style="@style/WidgetFoundation.Card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/l1"
android:paddingTop="@dimen/l_50"
android:paddingEnd="@dimen/l1"
android:paddingBottom="@dimen/l_50"
tools:layout_gravity="center">
<ImageView
android:id="@+id/home_manager_icon"
style="@style/WidgetFoundation.Icon.Primary"
android:padding="@dimen/l_50"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_manager" />
<TextView
android:id="@+id/home_manager_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:text="@string/home_app_title"
android:textAppearance="@style/AppearanceFoundation.Title"
android:textColor="?colorPrimary"
android:maxLines="1"
android:ellipsize="end"
app:layout_constraintBottom_toBottomOf="@+id/home_manager_icon"
app:layout_constraintEnd_toStartOf="@+id/home_manager_button"
app:layout_constraintStart_toEndOf="@+id/home_manager_icon"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/home_app_title" />
<FrameLayout
android:id="@+id/home_manager_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/home_manager_title"
app:layout_constraintTop_toTopOf="@+id/home_manager_title">
<Button
style="@style/WidgetFoundation.Button"
gone="@{viewModel.appState != State.OUTDATED}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="@{() -> viewModel.onManagerPressed()}"
android:text="@string/update"
android:textAllCaps="false"
android:layout_gravity="end"
app:icon="@drawable/ic_update_md2" />
<Button
style="@style/WidgetFoundation.Button.Text"
gone="@{viewModel.appState != State.UP_TO_DATE}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:onClick="@{() -> viewModel.onManagerPressed()}"
android:text="@string/install"
android:textAllCaps="false"
app:icon="@drawable/ic_install"/>
</FrameLayout>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/home_manager_title_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:referencedIds="@{viewModel.appTitleBarrierIds}"
tools:constraint_referenced_ids="home_manager_icon,home_manager_title,home_manager_button" />
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fadingEdgeLength="@dimen/l1"
android:requiresFadingEdge="horizontal"
android:scrollbars="none"
app:layout_constraintTop_toBottomOf="@+id/home_manager_title_barrier">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/home_manager_latest_version"
style="@style/W.Home.Item.Top"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
style="@style/W.Home.ItemContent"
android:text="@string/home_latest_version" />
<TextView
style="@style/W.Home.ItemContent.Right"
android:text="@{viewModel.managerRemoteVersion}"
tools:text="22.0 (22000) (16)" />
</LinearLayout>
<LinearLayout
android:id="@+id/home_manager_installed_version"
style="@style/W.Home.Item"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_manager_latest_version">
<TextView
style="@style/W.Home.ItemContent"
android:text="@string/home_installed_version" />
<TextView
style="@style/W.Home.ItemContent.Right"
android:text="@{viewModel.managerInstalledVersion}"
tools:text="22.0 (22000) (16)" />
</LinearLayout>
<LinearLayout
android:id="@+id/home_manager_internal_connection"
style="@style/W.Home.Item.Bottom"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_manager_installed_version">
<TextView
style="@style/W.Home.ItemContent"
android:text="@string/home_package" />
<TextView
android:id="@+id/home_manager_extra_connection_value"
style="@style/W.Home.ItemContent.Right"
android:text="@{context.packageName}"
tools:text="com.topjohnwu.magisk" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<ProgressBar
style="@style/WidgetFoundation.ProgressBar"
gone="@{viewModel.stateManagerProgress == 0 || viewModel.stateManagerProgress == 100}"
android:layout_width="match_parent"
android:layout_gravity="bottom"
android:max="100"
android:progress="@{viewModel.stateManagerProgress}" />
</LinearLayout>
</HorizontalScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</layout>
``` | /content/code_sandbox/app/apk/src/main/res/layout/include_home_manager.xml | xml | 2016-09-08T12:42:53 | 2024-08-16T19:41:25 | Magisk | topjohnwu/Magisk | 46,424 | 1,397 |
```xml
export interface UpdateUserData {
firstname?: string;
language?: string;
}
``` | /content/code_sandbox/src/app/modules/auth/shared/interfaces/update-user-data.interface.ts | xml | 2016-11-22T17:10:18 | 2024-08-14T21:36:59 | angular-example-app | Ismaestro/angular-example-app | 2,150 | 17 |
```xml
import type {
RuleGroupType,
RuleProcessor,
ValueProcessorByRule,
ValueProcessorLegacy,
} from '../../types/index.noReact';
import { prepareRuleGroup } from '../prepareQueryObjects';
import { defaultRuleProcessorMongoDB } from './defaultRuleProcessorMongoDB';
import { formatQuery } from './formatQuery';
import {
getValidationTestData,
queryForNumberParsing,
queryForRuleProcessor,
queryIC,
testQueryDQ,
} from './formatQueryTestUtils';
import { defaultMongoDBValueProcessor, defaultValueProcessorByRule } from './index';
const mongoQuery: RuleGroupType = {
id: 'g-root',
combinator: 'and',
rules: [
{ field: '~', operator: '~', value: 'Placeholder' },
{ field: '~', operator: '=', value: 'Placeholder' },
{ field: 'firstName', operator: '~', value: 'Placeholder' },
{ field: 'invalid', value: '', operator: 'invalid' },
{ field: 'firstName', value: '', operator: 'null' },
{ field: 'lastName', value: '', operator: 'notNull' },
{ field: 'firstName', value: 'Test,This', operator: 'in' },
{ field: 'lastName', value: 'Test,This', operator: 'notIn' },
{ field: 'firstName', value: false, operator: 'in' },
{ field: 'firstName', value: 'Test,This', operator: 'between' },
{ field: 'firstName', value: ['Test', 'This'], operator: 'between' },
{ field: 'lastName', value: 'Test,This', operator: 'notBetween' },
{ field: 'firstName', value: '', operator: 'between' },
{ field: 'firstName', value: false, operator: 'between' },
{ field: 'age', value: '12,14', operator: 'between' },
{ field: 'age', value: '26', operator: '=' },
{ field: 'isMusician', value: true, operator: '=' },
{ field: 'isLucky', value: false, operator: '=' },
{ field: 'email', value: '@', operator: 'contains' },
{ field: 'email', value: 'ab', operator: 'beginsWith' },
{ field: 'email', value: 'com', operator: 'endsWith' },
{ field: 'hello', value: 'com', operator: 'doesNotContain' },
{ field: 'job', value: 'Man', operator: 'doesNotBeginWith' },
{ field: 'job', value: 'ger', operator: 'doesNotEndWith' },
{
id: 'g-sub1',
combinator: 'or',
rules: [
{ field: 'job', value: 'Sales Executive', operator: '=' },
{ field: 'job', value: [], operator: 'in' },
{ field: 'job', value: ['just one value'], operator: 'between' },
],
not: false,
},
],
not: false,
};
const mongoQueryWithValueSourceField: RuleGroupType = {
id: 'g-root',
combinator: 'and',
rules: [
{ field: 'invalid', operator: 'invalid', value: '', valueSource: 'field' },
{ field: 'firstName', operator: 'null', value: '', valueSource: 'field' },
{ field: 'lastName', operator: 'notNull', value: '', valueSource: 'field' },
{ field: 'firstName', operator: 'in', value: 'middleName,lastName', valueSource: 'field' },
{ field: 'lastName', operator: 'notIn', value: 'middleName,lastName', valueSource: 'field' },
{ field: 'firstName', operator: 'in', value: false, valueSource: 'field' },
{ field: 'firstName', operator: 'between', value: 'middleName,lastName', valueSource: 'field' },
{
field: 'firstName',
operator: 'between',
value: ['middleName', 'lastName'],
valueSource: 'field',
},
{
field: 'lastName',
operator: 'notBetween',
value: 'middleName,lastName',
valueSource: 'field',
},
{ field: 'firstName', operator: 'between', value: '', valueSource: 'field' },
{ field: 'firstName', operator: 'between', value: false, valueSource: 'field' },
{ field: 'age', operator: '=', value: 'iq', valueSource: 'field' },
{ field: 'isMusician', operator: '=', value: 'isCreative', valueSource: 'field' },
{ field: 'email', operator: 'contains', value: 'atSign', valueSource: 'field' },
{ field: 'email', operator: 'beginsWith', value: 'name', valueSource: 'field' },
{ field: 'email', operator: 'endsWith', value: 'dotCom', valueSource: 'field' },
{ field: 'hello', operator: 'doesNotContain', value: 'dotCom', valueSource: 'field' },
{ field: 'job', operator: 'doesNotBeginWith', value: 'noJob', valueSource: 'field' },
{ field: 'job', operator: 'doesNotEndWith', value: 'noJob', valueSource: 'field' },
{
id: 'g-sub1',
combinator: 'or',
rules: [{ field: 'job', operator: '=', value: 'executiveJobName', valueSource: 'field' }],
not: false,
},
],
not: false,
};
const mongoQueryExpectation = {
$and: [
{ firstName: null },
{ lastName: { $ne: null } },
{ firstName: { $in: ['Test', 'This'] } },
{ lastName: { $nin: ['Test', 'This'] } },
{ firstName: { $in: [] } },
{ firstName: { $gte: 'Test', $lte: 'This' } },
{ firstName: { $gte: 'Test', $lte: 'This' } },
{ $or: [{ lastName: { $lt: 'Test' } }, { lastName: { $gt: 'This' } }] },
{ age: { $gte: 12, $lte: 14 } },
{ age: '26' },
{ isMusician: true },
{ isLucky: false },
{ email: { $regex: '@' } },
{ email: { $regex: '^ab' } },
{ email: { $regex: 'com$' } },
{ hello: { $not: { $regex: 'com' } } },
{ job: { $not: { $regex: '^Man' } } },
{ job: { $not: { $regex: 'ger$' } } },
{
$or: [{ job: 'Sales Executive' }, { job: { $in: [] } }],
},
],
};
const mongoQueryExpectationForValueSourceField = {
$and: [
{ firstName: null },
{ lastName: { $ne: null } },
{ $where: '[this.middleName,this.lastName].includes(this.firstName)' },
{ $where: '![this.middleName,this.lastName].includes(this.lastName)' },
{ $where: '[].includes(this.firstName)' },
{
$and: [
{ $expr: { $gte: ['$firstName', '$middleName'] } },
{ $expr: { $lte: ['$firstName', '$lastName'] } },
],
},
{
$and: [
{ $expr: { $gte: ['$firstName', '$middleName'] } },
{ $expr: { $lte: ['$firstName', '$lastName'] } },
],
},
{
$or: [
{ $expr: { $lt: ['$lastName', '$middleName'] } },
{ $expr: { $gt: ['$lastName', '$lastName'] } },
],
},
{ $expr: { $eq: ['$age', '$iq'] } },
{ $expr: { $eq: ['$isMusician', '$isCreative'] } },
{ $where: 'this.email.includes(this.atSign)' },
{ $where: 'this.email.startsWith(this.name)' },
{ $where: 'this.email.endsWith(this.dotCom)' },
{ $where: '!this.hello.includes(this.dotCom)' },
{ $where: '!this.job.startsWith(this.noJob)' },
{ $where: '!this.job.endsWith(this.noJob)' },
{ $expr: { $eq: ['$job', '$executiveJobName'] } },
],
};
it('formats to mongo query correctly', () => {
expect(JSON.parse(formatQuery(mongoQuery, 'mongodb'))).toEqual(mongoQueryExpectation);
expect(JSON.parse(formatQuery(mongoQueryWithValueSourceField, 'mongodb'))).toEqual(
mongoQueryExpectationForValueSourceField
);
expect(
JSON.parse(
formatQuery(mongoQueryWithValueSourceField, {
format: 'mongodb',
valueProcessor: defaultMongoDBValueProcessor,
})
)
).toEqual(mongoQueryExpectationForValueSourceField);
// Test for newline in value
expect(
JSON.parse(
formatQuery(
{
combinator: 'and',
rules: [{ field: 'f1', operator: '=', value: 'value\nwith newline' }],
},
'mongodb'
)
)
).toEqual({ f1: 'value\nwith newline' });
});
it('handles custom valueProcessors correctly', () => {
const queryWithArrayValue: RuleGroupType = {
id: 'g-root',
combinator: 'and',
rules: [
{ field: 'instrument', value: ['Guitar', 'Vocals'], operator: 'in' },
{ field: 'lastName', value: 'Vai', operator: '=' },
],
not: false,
};
const valueProcessorLegacy: ValueProcessorLegacy = (_field, operator, value) => {
if (operator === 'in') {
return `(${value.map((v: string) => `'${v.trim()}'`).join(', /* and */ ')})`;
} else {
return `'${value}'`;
}
};
expect(
formatQuery(queryWithArrayValue, {
format: 'sql',
valueProcessor: valueProcessorLegacy,
})
).toBe(`(instrument in ('Guitar', /* and */ 'Vocals') and lastName = 'Vai')`);
const queryForNewValueProcessor: RuleGroupType = {
combinator: 'and',
rules: [{ field: 'f1', operator: '=', value: `v'1`, valueSource: 'value' }],
};
const valueProcessor: ValueProcessorByRule = (
{ field, operator, value, valueSource },
opts = {}
) => `${field}-${operator}-${value}-${valueSource}-${!!opts.parseNumbers}-${!!opts.escapeQuotes}`;
expect(
formatQuery(queryForNewValueProcessor, {
format: 'sql',
parseNumbers: true,
valueProcessor,
})
).toBe(`(f1 = f1-=-v'1-value-true-true)`);
const valueProcessorAsPassThrough: ValueProcessorByRule = (r, opts) =>
defaultValueProcessorByRule(r, opts);
// handles escapeQuotes correctly
expect(
formatQuery(queryForNewValueProcessor, {
format: 'sql',
valueProcessor: valueProcessorAsPassThrough,
})
).toBe(`(f1 = 'v''1')`);
// handles escapeQuotes exactly the same as defaultValueProcessorByRule
expect(
formatQuery(queryForNewValueProcessor, {
format: 'sql',
valueProcessor: valueProcessorAsPassThrough,
})
).toBe(formatQuery(queryForNewValueProcessor, 'sql'));
});
it('handles quoteFieldNamesWith correctly', () => {
const queryToTest: RuleGroupType = {
id: 'g-root',
combinator: 'and',
rules: [
{ field: 'instrument', value: 'Guitar, Vocals', operator: 'in' },
{ field: 'lastName', value: 'Vai', operator: '=' },
{ field: 'lastName', value: 'firstName', operator: '!=', valueSource: 'field' },
],
not: false,
};
expect(formatQuery(queryToTest, { format: 'sql', quoteFieldNamesWith: '`' })).toBe(
"(`instrument` in ('Guitar', 'Vocals') and `lastName` = 'Vai' and `lastName` != `firstName`)"
);
expect(formatQuery(queryToTest, { format: 'sql', quoteFieldNamesWith: ['[', ']'] })).toBe(
"([instrument] in ('Guitar', 'Vocals') and [lastName] = 'Vai' and [lastName] != [firstName])"
);
});
it('handles custom fallbackExpression correctly', () => {
const fallbackExpression = 'fallbackExpression';
const queryToTest: RuleGroupType = { id: 'g-root', combinator: 'and', rules: [] };
expect(formatQuery(queryToTest, { format: 'sql', fallbackExpression })).toBe(fallbackExpression);
});
it('handles json_without_ids correctly', () => {
const queryToTest: RuleGroupType & { extraProperty: string } = {
id: 'root',
combinator: 'and',
rules: [{ field: 'firstName', value: '', operator: 'null', valueSource: 'value' }],
not: false,
extraProperty: 'extraProperty',
};
const expectedResult = JSON.parse(
'{"rules":[{"field":"firstName","value":"","operator":"null","valueSource":"value"}],"combinator":"and","not":false,"extraProperty":"extraProperty"}'
);
expect(JSON.parse(formatQuery(prepareRuleGroup(queryToTest), 'json_without_ids'))).toEqual(
expectedResult
);
});
it('uses paramPrefix correctly', () => {
const queryToTest: RuleGroupType = {
combinator: 'and',
rules: [
{ field: 'firstName', operator: '=', value: 'Test' },
{ field: 'lastName', operator: 'in', value: 'Test1,Test2' },
{ field: 'age', operator: 'between', value: [26, 52] },
],
};
const sql = `(firstName = $firstName_1 and lastName in ($lastName_1, $lastName_2) and age between $age_1 and $age_2)`;
const paramPrefix = '$';
// Control (default) - param prefixes removed
expect(formatQuery(queryToTest, { format: 'parameterized_named', paramPrefix })).toEqual({
sql,
params: {
firstName_1: 'Test',
lastName_1: 'Test1',
lastName_2: 'Test2',
age_1: 26,
age_2: 52,
},
});
// Experimental - param prefixes retained
expect(
formatQuery(queryToTest, {
format: 'parameterized_named',
paramPrefix,
paramsKeepPrefix: true,
})
).toEqual({
sql,
params: {
[`${paramPrefix}firstName_1`]: 'Test',
[`${paramPrefix}lastName_1`]: 'Test1',
[`${paramPrefix}lastName_2`]: 'Test2',
[`${paramPrefix}age_1`]: 26,
[`${paramPrefix}age_2`]: 52,
},
});
});
describe('escapes quotes when appropriate', () => {
it('escapes double quotes (if appropriate) for mongodb', () => {
expect(formatQuery(testQueryDQ, 'mongodb')).toEqual(`{"f1":"Te\\"st"}`);
});
});
describe('independent combinators', () => {
it('handles independent combinators for mongodb', () => {
expect(formatQuery(queryIC, 'mongodb')).toBe(
'{"$or":[{"$and":[{"firstName":"Test"},{"middleName":"Test"}]},{"lastName":"Test"}]}'
);
});
});
describe('validation', () => {
describe('mongodb', () => {
const validationResults: Record<string, string> = {
'should invalidate mongodb': '{"$and":[{"$expr":true}]}',
'should invalidate mongodb even if fields are valid': '{"$and":[{"$expr":true}]}',
'should invalidate mongodb rule by validator function': '{"field2":""}',
'should invalidate mongodb rule specified by validationMap': '{"field2":""}',
'should invalidate mongodb outermost group': '{"$and":[{"$expr":true}]}',
'should invalidate mongodb inner group': '{"$and":[{"$expr":true}]}',
'should convert mongodb inner group with no rules to fallbackExpression':
'{"$and":[{"field":""},{"$and":[{"$expr":true}]}]}',
};
for (const vtd of getValidationTestData('mongodb')) {
if (typeof validationResults[vtd.title] !== 'undefined') {
it(vtd.title, () => {
expect(formatQuery(vtd.query, vtd.options)).toEqual(validationResults[vtd.title]);
});
}
}
});
});
describe('ruleProcessor', () => {
it('handles custom MongoDB rule processor', () => {
const ruleProcessor: RuleProcessor = r =>
r.operator === 'custom_operator' ? r.operator : defaultRuleProcessorMongoDB(r);
expect(formatQuery(queryForRuleProcessor, { format: 'mongodb', ruleProcessor })).toBe(
'{"$and":[custom_operator,{"f2":"v2"}]}'
);
expect(
formatQuery(queryForRuleProcessor, { format: 'mongodb', valueProcessor: ruleProcessor })
).toBe('{"$and":[custom_operator,{"f2":"v2"}]}');
});
});
describe('parseNumbers', () => {
it('parses numbers for mongodb', () => {
expect(formatQuery(queryForNumberParsing, { format: 'mongodb', parseNumbers: true })).toBe(
'{"$and":[{"f":{"$gt":"NaN"}},{"f":0},{"f":0},{"f":0},{"$or":[{"f":{"$lt":1.5}},{"f":{"$gt":1.5}}]},{"f":{"$in":[0,1,2]}},{"f":{"$in":[0,1,2]}},{"f":{"$in":[0,"abc",2]}},{"f":{"$gte":0,"$lte":1}},{"f":{"$gte":0,"$lte":1}},{"f":{"$gte":0,"$lte":"abc"}},{"f":{"$gte":{},"$lte":{}}}]}'
);
});
});
``` | /content/code_sandbox/packages/react-querybuilder/src/utils/formatQuery/formatQuery.MongoDB.test.ts | xml | 2016-06-17T22:03:19 | 2024-08-16T10:28:42 | react-querybuilder | react-querybuilder/react-querybuilder | 1,131 | 4,107 |
```xml
import { Fiat, ISettings, TCurrencySymbol, TFiatTicker } from '@types';
interface FiatObject {
[key: string]: Fiat;
}
export const USD = {
ticker: 'USD' as TFiatTicker,
name: 'US Dollars',
symbol: '$' as TCurrencySymbol
};
export const EUR = {
ticker: 'EUR' as TFiatTicker,
name: 'Euros',
symbol: '' as TCurrencySymbol
};
export const GBP = {
ticker: 'GBP' as TFiatTicker,
name: 'British Pounds',
symbol: '' as TCurrencySymbol
};
export const RUB = {
ticker: 'RUB' as TFiatTicker,
name: 'Rubles',
symbol: '' as TCurrencySymbol
};
export const INR = {
ticker: 'INR' as TFiatTicker,
name: 'Rupee',
symbol: '' as TCurrencySymbol
};
export const CNY = {
ticker: 'CNY' as TFiatTicker,
name: 'Yuan',
symbol: '' as TCurrencySymbol
};
export const TRY = {
ticker: 'TRY' as TFiatTicker,
name: 'Turkish Lira',
symbol: '' as TCurrencySymbol
};
export const CAD = {
ticker: 'CAD' as TFiatTicker,
name: 'Canadian Dollar',
symbol: '$' as TCurrencySymbol
};
export const DKK = {
ticker: 'DKK' as TFiatTicker,
name: 'Danish krone',
symbol: 'kr' as TCurrencySymbol
};
export const Fiats: FiatObject = { USD, EUR, GBP, RUB, INR, CNY, TRY, CAD, DKK };
export const getFiat = (settings: ISettings) => Fiats[settings.fiatCurrency];
``` | /content/code_sandbox/src/config/fiats.ts | xml | 2016-12-04T01:35:27 | 2024-08-14T21:41:58 | MyCrypto | MyCryptoHQ/MyCrypto | 1,347 | 399 |
```xml
<legalnotice id="legalnotice">
<para>
Autorizase a copiar, distribur e modificar este documento baixo os termos
da Licencia de Documentacin Libre de GNU (GFDL), versin 1.1 ou posterior
publicada pola Free Software Foundation sen cambiar seccins, sen textos de
portada nin textos de contraportada. Pode conseguir unha copia da GFDL nesta
<ulink type="help" url="ghelp:fdl">ligazn</ulink> ou no ficheiro
COPYING-DOCS distribuido con este manual.
</para>
<para> Este manual parte dunha coleccin de manuais de GNOME distribuidas baixo a
GFDL. Se quere distribuir este manual de forma separada da coleccin pode
facelo engadindo unha copia da licenza ao manual, como se describe na
seccin 6 da licenza.
</para>
<para>
Moitos dos nomes usados por empresas para distinguir os seus produtos e
servizos mencinanse como marcas comerciais. Onde aparezan ditos nomes en
calquera documentacin GNOME, e para que os membros do proxecto de
documentacin recoezan ditas marcas comerciais, ditos nomes imprmense en
maisculas ou iniciais en maisculas.
</para>
<para>
DO DOCUMENTO OU DAS VERSINS MODIFICADAS DO DOCUMENTO OUTRGASE BAIXO OS
TERMOS DA LICENZA DE DOCUMENTACIN LIBRE GNU NO ENTENDEMENTO DE QUE:
<orderedlist>
<listitem>
<para>O DOCUMENTO FORNECESE TAL CAL, SEN GARANTA DE NINGN TIPO, NIN EXPLCITA
NIN IMPLCITA INCLUNDO, SEN LIMITACIN, GARANTA DE QUE O DOCUMENTO OU
VERSIN MODIFICADA DE ESTE CAREZA DE DEFECTOS COMERCIAIS, SEXA AXEITADO A UN
FIN CONCRETO OU INCUMPRA ALGUNHA NORMATIVA. TODO O RISCO RELATIVO
CALIDADE, PRECISIN E UTILIDADE DO DOCUMENTO OU A SA VERSIN MODIFICADA
RECAE EN VOSTEDE. SE CALQUERA DOCUMENTO OU VERSIN MODIFICADA DE AQUEL
RESULTARA DEFECTUOSO EN CALQUERA ASPECTO, VOSTEDE (E NON O REDACTOR INICIAL,
AUTOR OU COLABORADOR) ASUMIR OS CUSTES DE TODA REPARACIN, MANTEMENTO OU
CORRECCIN NECESARIOS. ESTA RENUNCIA DE GARANTA UNHA PARTE ESENCIAL DESTA
LICENZA. NON SE AUTORIZA O USO DE NINGN DOCUMENTO NIN VERSIN MODIFICADA
DESTE POLO PRESENTE, SALVO DENTRO DO CUMPRIMENTO DA RENUNCIA; E
</para>
</listitem>
<listitem>
<para>EN NINGUNHA CIRCUNSTANCIA NIN BAIXO NINGUNHA TEORA LEGAL, SEXA POR ERRO
(INCLUNDO NEGLIXENCIA) CONTRATO OU DOCUMENTO DE OUTRO TIPO, O AUTOR, O
ESCRITOR INICIAL, O AUTOR DE APARTACINS NIN NINGN DISTRIBUIDOR DO
DOCUMENTO OU VERSIN MODIFICADA DO DOCUMENTO, NIN NINGN PROVEDOR DE
NINGUNHA DESAS PARTES, SER RESPONSBEL ANTE NINGUNHA PERSOA POR NINGN DANO
DIRECTO, INDIRECTO, ESPECIAL, INCIDENTAL OU DERIVADO DE NINGN TIPO,
INCLUNDO, SEN LIMITACIN DANOS POR PERDA DE FONDO DE COMERCIO, PARO
TCNICO, FALLO INFORMTICO OU AVARA OU CALQUERA OUTRO POSBEL DANO OU
AVARA DERIVADO OU RELACIONADO CO USO DO DOCUMENTO OU AS SAS VERSINS
MODIFICADAS, ANDA QUE DITA PARTE TEA SIDO INFORMADA DA POSIBILIDADE DE QUE
SE PRODUCISEN ESES DANOS.
</para>
</listitem>
</orderedlist>
</para>
</legalnotice>
``` | /content/code_sandbox/help/gl/legal.xml | xml | 2016-08-08T17:54:58 | 2024-08-06T13:58:47 | x-mario-center | fossasia/x-mario-center | 1,487 | 996 |
```xml
import { useEffect, useState } from 'react';
import { addDays, endOfToday, getUnixTime, isToday } from 'date-fns';
import { c } from 'ttag';
import { Href } from '@proton/atoms/Href';
import { DateInputTwo, InputFieldTwo, TimeInput, generateUID, useUserSettings } from '@proton/components';
import { getKnowledgeBaseUrl } from '@proton/shared/lib/helpers/url';
import { getWeekStartsOn } from '@proton/shared/lib/settings/helper';
import { useMailDispatch } from 'proton-mail/store/hooks';
import { SCHEDULED_MAX_DATE_DAYS } from '../../../constants';
import { getMinScheduleTime } from '../../../helpers/schedule';
import useFutureTimeDate from '../../../hooks/message/useFutureTimeDate';
import type { MessageState } from '../../../store/messages/messagesTypes';
import { updateScheduled } from '../../../store/messages/scheduled/scheduledActions';
import ComposerInnerModal from './ComposerInnerModal';
import { getChooseDateText } from './helper';
interface Props {
message: MessageState;
onClose: () => void;
onSubmit: (timestamp: number) => void;
}
const ComposerScheduleSendModal = ({ message, onClose, onSubmit }: Props) => {
const dispatch = useMailDispatch();
const [userSettings] = useUserSettings();
const [uid] = useState(generateUID('schedule-send-modal'));
const defaultDate =
message && message.draftFlags?.scheduledAt
? new Date(message.draftFlags?.scheduledAt * 1000)
: addDays(new Date(), 1);
if (!message || (message && !message.draftFlags?.scheduledAt)) {
defaultDate.setHours(8, 0, 0, 0);
}
const maxDateErrorMessage = getChooseDateText(SCHEDULED_MAX_DATE_DAYS);
const {
date,
time,
disabled,
handleChangeDate,
handleChangeTime,
formatDateInput,
scheduleDateTime,
minDate,
maxDate,
errorDate,
errorTime,
} = useFutureTimeDate({
defaultDate,
maxDaysAllowed: SCHEDULED_MAX_DATE_DAYS,
maxDateErrorMessage,
});
useEffect(() => {
dispatch(updateScheduled({ ID: message.localID, scheduledAt: getUnixTime(scheduleDateTime) }));
}, [scheduleDateTime]);
const handleSubmit = () => {
onSubmit(getUnixTime(scheduleDateTime));
onClose();
};
const handleCancel = () => {
onClose();
};
return (
<ComposerInnerModal
title={c('Title').t`Schedule send`}
disabled={disabled}
submit={c('Action').t`Schedule message`}
onSubmit={handleSubmit}
onCancel={handleCancel}
>
<div className="mb-4 flex">
<span data-testid="composer:schedule-send:custom-modal:title">{c('Info')
.t`When do you want your message to be sent?`}</span>
<Href className="underline inline-block" href={getKnowledgeBaseUrl('/schedule-email-send')}>{c('Link')
.t`Learn more`}</Href>
</div>
<div className="flex gap-2 flex-row flex-nowrap">
<InputFieldTwo
as={DateInputTwo}
id={`composer-schedule-date-${uid}`}
label={c('Label').t`Date`}
onChange={handleChangeDate}
value={date}
min={minDate}
weekStartsOn={getWeekStartsOn({ WeekStart: userSettings.WeekStart })}
max={maxDate}
toFormatter={formatDateInput}
preventValueReset
error={errorDate}
data-testid="composer:schedule-date-input"
/>
<InputFieldTwo
as={TimeInput}
id={`composer-schedule-time-${uid}`}
label={c('Label').t`Time`}
onChange={handleChangeTime}
value={time}
min={getMinScheduleTime(date)}
max={isToday(date) ? endOfToday() : undefined}
error={errorTime}
data-testid="composer:schedule-time-input"
/>
</div>
</ComposerInnerModal>
);
};
export default ComposerScheduleSendModal;
``` | /content/code_sandbox/applications/mail/src/app/components/composer/modals/ComposerScheduleSendModal.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 898 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor name="standard">
<requiredProperties>
<requiredProperty key="groupId" />
<requiredProperty key="artifactId" />
<requiredProperty key="version">
<defaultValue>1.0.0-SNAPSHOT</defaultValue>
</requiredProperty>
<requiredProperty key="package">
<defaultValue>${groupId}</defaultValue>
</requiredProperty>
<requiredProperty key="artifactIdCamelCase">
<defaultValue>${artifactId.replaceAll("^a|-a", "A").replaceAll("^b|-b", "B").replaceAll("^c|-c", "C").replaceAll("^d|-d", "D").replaceAll("^e|-e", "E").replaceAll("^f|-f", "F").replaceAll("^g|-g", "G").replaceAll("^h|-h", "H").replaceAll("^i|-i", "I").replaceAll("^j|-j", "J").replaceAll("^k|-k", "K").replaceAll("^l|-l", "L").replaceAll("^m|-m", "M").replaceAll("^n|-n", "N").replaceAll("^o|-o", "O").replaceAll("^p|-p", "P").replaceAll("^q|-q", "Q").replaceAll("^r|-r", "R").replaceAll("^s|-s", "S").replaceAll("^t|-t", "T").replaceAll("^u|-u", "U").replaceAll("^v|-v", "V").replaceAll("^w|-w", "W").replaceAll("^x|-x", "X").replaceAll("^y|-y", "Y").replaceAll("^z|-z", "Z")}</defaultValue>
</requiredProperty>
<requiredProperty key="includeActuator">
<defaultValue>false</defaultValue>
</requiredProperty>
</requiredProperties>
<modules>
<module id="${rootArtifactId}-api" name="${rootArtifactId}-api" dir="__rootArtifactId__-api">
</module>
<module id="${rootArtifactId}-service" name="${rootArtifactId}-service" dir="__rootArtifactId__-service">
</module>
</modules>
<fileSets>
<fileSet filtered="true" encoding="UTF-8" packaged="true">
<directory>__rootArtifactId__-api/src/main/java</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8" packaged="true">
<directory>__rootArtifactId__-api/src/test/java</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8" packaged="true">
<directory>__rootArtifactId__-service/src/main/java</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8" packaged="true">
<directory>__rootArtifactId__-service/src/test/java</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory />
<includes>
<include>**/.gitignore</include>
<include>**/log4j2.xml</include>
<include>**/*.yaml</include>
<include>**/*.yml</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>
``` | /content/code_sandbox/whatsmars-archetypes/dubbo-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml | xml | 2016-04-01T10:33:04 | 2024-08-14T23:44:08 | whatsmars | javahongxi/whatsmars | 1,952 | 778 |
```xml
import { isValidObjectId, Types } from '@fiora/database/mongoose';
import assert from 'assert';
import User from '@fiora/database/mongoose/models/user';
import Group from '@fiora/database/mongoose/models/group';
import Message from '@fiora/database/mongoose/models/message';
import { createOrUpdateHistory } from '@fiora/database/mongoose/models/history';
export async function updateHistory(
ctx: Context<{ userId: string; linkmanId: string; messageId: string }>,
) {
const { linkmanId, messageId } = ctx.data;
const self = ctx.socket.user.toString();
if (!Types.ObjectId.isValid(messageId)) {
return {
msg: `not update with invalid messageId:${messageId}`,
};
}
// @ts-ignore
const [user, linkman, message] = await Promise.all([
User.findOne({ _id: self }),
isValidObjectId(linkmanId)
? Group.findOne({ _id: linkmanId })
: User.findOne({ _id: linkmanId.replace(self, '') }),
Message.findOne({ _id: messageId }),
]);
assert(user, '');
assert(linkman, '');
assert(message, '');
await createOrUpdateHistory(self, linkmanId, messageId);
return {
msg: 'ok',
};
}
``` | /content/code_sandbox/packages/server/src/routes/history.ts | xml | 2016-02-15T14:47:58 | 2024-08-14T13:07:55 | fiora | yinxin630/fiora | 6,485 | 276 |
```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.
-->
<vector xmlns:android="path_to_url"
xmlns:tools="path_to_url"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp"
tools:ignore="NewApi">
<!-- The circle -->
<path
android:fillColor="@color/m3_chip_text_color"
android:pathData="M12,12m-12,0a12,12 0,1 1,24 0a12,12 0,1 1,-24 0"
android:strokeColor="#00000000"
android:strokeWidth="1"/>
<!-- The checkmark -->
<path
android:fillColor="@color/m3_chip_background_color"
android:pathData="M9.189,15.939l-3.127,-3.128l-1.061,1.061l4.189,4.189l9,-9l-1.061,-1.061z"
android:strokeColor="#00000000"
android:strokeWidth="1"/>
</vector>
``` | /content/code_sandbox/lib/java/com/google/android/material/chip/res/drawable/ic_m3_chip_checked_circle.xml | xml | 2016-12-05T16:11:29 | 2024-08-16T17:51:42 | material-components-android | material-components/material-components-android | 16,176 | 295 |
```xml
//
//
// Microsoft Bot Framework: path_to_url
//
// Bot Framework Emulator Github:
// path_to_url
//
// All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
export * from './conversationResource';
export * from './errorResponse';
export * from './resource';
``` | /content/code_sandbox/packages/sdk/shared/src/types/response/index.ts | xml | 2016-11-11T23:15:09 | 2024-08-16T12:45:29 | BotFramework-Emulator | microsoft/BotFramework-Emulator | 1,803 | 274 |
```xml
// See LICENSE in the project root for license information.
import * as path from 'path';
import { PackageJsonLookup, type IPackageJson, Text, FileSystem, Async } from '@rushstack/node-core-library';
import {
Colorize,
ConsoleTerminalProvider,
DEFAULT_CONSOLE_WIDTH,
type ITerminalProvider,
PrintUtilities,
Terminal,
type ITerminal
} from '@rushstack/terminal';
import { type ILogMessageCallbackOptions, pnpmSyncCopyAsync } from 'pnpm-sync-lib';
import { Utilities } from '../utilities/Utilities';
import { ProjectCommandSet } from '../logic/ProjectCommandSet';
import { type ILaunchOptions, Rush } from '../api/Rush';
import { RushConfiguration } from '../api/RushConfiguration';
import { NodeJsCompatibility } from '../logic/NodeJsCompatibility';
import { RushStartupBanner } from './RushStartupBanner';
import { EventHooksManager } from '../logic/EventHooksManager';
import { Event } from '../api/EventHooks';
import { EnvironmentVariableNames } from '../api/EnvironmentConfiguration';
import { RushConstants } from '../logic/RushConstants';
import { PnpmSyncUtilities } from '../utilities/PnpmSyncUtilities';
interface IRushXCommandLineArguments {
/**
* Flag indicating whether to suppress any rushx startup information.
*/
quiet: boolean;
/**
* Flag indicating whether the user has asked for help.
*/
help: boolean;
/**
* Flag indicating whether the user has requested debug mode.
*/
isDebug: boolean;
/**
* Flag indicating whether the user wants to not call hooks.
*/
ignoreHooks: boolean;
/**
* The command to run (i.e., the target "script" in package.json.)
*/
commandName: string;
/**
* Any additional arguments/parameters passed after the command name.
*/
commandArgs: string[];
}
class ProcessError extends Error {
public readonly exitCode: number;
public constructor(message: string, exitCode: number) {
super(message);
// Manually set the prototype, as we can no longer extend built-in classes like Error, Array, Map, etc.
// path_to_url#extending-built-ins-like-error-array-and-map-may-no-longer-work
//
// Note: the prototype must also be set on any classes which extend this one
(this as any).__proto__ = ProcessError.prototype; // eslint-disable-line @typescript-eslint/no-explicit-any
this.exitCode = exitCode;
}
}
export class RushXCommandLine {
public static async launchRushXAsync(launcherVersion: string, options: ILaunchOptions): Promise<void> {
try {
const rushxArguments: IRushXCommandLineArguments = RushXCommandLine._parseCommandLineArguments();
const rushConfiguration: RushConfiguration | undefined = RushConfiguration.tryLoadFromDefaultLocation({
showVerbose: false
});
const eventHooksManager: EventHooksManager | undefined = rushConfiguration
? new EventHooksManager(rushConfiguration)
: undefined;
const suppressHooks: boolean = process.env[EnvironmentVariableNames._RUSH_RECURSIVE_RUSHX_CALL] === '1';
const attemptHooks: boolean = !suppressHooks && !rushxArguments.help;
if (attemptHooks) {
try {
eventHooksManager?.handle(Event.preRushx, rushxArguments.isDebug, rushxArguments.ignoreHooks);
} catch (error) {
// eslint-disable-next-line no-console
console.error(Colorize.red('PreRushx hook error: ' + (error as Error).message));
}
}
// Node.js can sometimes accidentally terminate with a zero exit code (e.g. for an uncaught
// promise exception), so we start with the assumption that the exit code is 1
// and set it to 0 only on success.
process.exitCode = 1;
await RushXCommandLine._launchRushXInternalAsync(rushxArguments, rushConfiguration, options);
if (attemptHooks) {
try {
eventHooksManager?.handle(Event.postRushx, rushxArguments.isDebug, rushxArguments.ignoreHooks);
} catch (error) {
// eslint-disable-next-line no-console
console.error(Colorize.red('PostRushx hook error: ' + (error as Error).message));
}
}
// Getting here means that we are all done with no major errors
process.exitCode = 0;
} catch (error) {
if (error instanceof ProcessError) {
process.exitCode = error.exitCode;
} else {
process.exitCode = 1;
}
// eslint-disable-next-line no-console
console.error(Colorize.red('Error: ' + (error as Error).message));
}
}
private static async _launchRushXInternalAsync(
rushxArguments: IRushXCommandLineArguments,
rushConfiguration: RushConfiguration | undefined,
options: ILaunchOptions
): Promise<void> {
if (!rushxArguments.quiet) {
RushStartupBanner.logStreamlinedBanner(Rush.version, options.isManaged);
}
// Are we in a Rush repo?
NodeJsCompatibility.warnAboutCompatibilityIssues({
isRushLib: true,
alreadyReportedNodeTooNewError: options.alreadyReportedNodeTooNewError || false,
rushConfiguration
});
// Find the governing package.json for this folder:
const packageJsonLookup: PackageJsonLookup = new PackageJsonLookup();
const packageJsonFilePath: string | undefined = packageJsonLookup.tryGetPackageJsonFilePathFor(
process.cwd()
);
if (!packageJsonFilePath) {
throw Error(
'This command should be used inside a project folder. ' +
'Unable to find a package.json file in the current working directory or any of its parents.'
);
}
if (rushConfiguration && !rushConfiguration.tryGetProjectForPath(process.cwd())) {
// GitHub #2713: Users reported confusion resulting from a situation where "rush install"
// did not install the project's dependencies, because the project was not registered.
// eslint-disable-next-line no-console
console.log(
Colorize.yellow(
'Warning: You are invoking "rushx" inside a Rush repository, but this project is not registered in ' +
`${RushConstants.rushJsonFilename}.`
)
);
}
const packageJson: IPackageJson = packageJsonLookup.loadPackageJson(packageJsonFilePath);
const projectCommandSet: ProjectCommandSet = new ProjectCommandSet(packageJson);
if (rushxArguments.help) {
RushXCommandLine._showUsage(packageJson, projectCommandSet);
return;
}
const scriptBody: string | undefined = projectCommandSet.tryGetScriptBody(rushxArguments.commandName);
if (scriptBody === undefined) {
let errorMessage: string = `The command "${rushxArguments.commandName}" is not defined in the package.json file for this project.`;
if (projectCommandSet.commandNames.length > 0) {
errorMessage +=
'\nAvailable commands for this project are: ' +
projectCommandSet.commandNames.map((x) => `"${x}"`).join(', ');
}
throw Error(errorMessage);
}
let commandWithArgs: string = scriptBody;
let commandWithArgsForDisplay: string = scriptBody;
if (rushxArguments.commandArgs.length > 0) {
// This approach is based on what NPM 7 now does:
// path_to_url#L34
const escapedRemainingArgs: string[] = rushxArguments.commandArgs.map((x) =>
Utilities.escapeShellParameter(x)
);
commandWithArgs += ' ' + escapedRemainingArgs.join(' ');
// Display it nicely without the extra quotes
commandWithArgsForDisplay += ' ' + rushxArguments.commandArgs.join(' ');
}
if (!rushxArguments.quiet) {
// eslint-disable-next-line no-console
console.log(`> ${JSON.stringify(commandWithArgsForDisplay)}\n`);
}
const packageFolder: string = path.dirname(packageJsonFilePath);
const exitCode: number = Utilities.executeLifecycleCommand(commandWithArgs, {
rushConfiguration,
workingDirectory: packageFolder,
// If there is a rush.json then use its .npmrc from the temp folder.
// Otherwise look for npmrc in the project folder.
initCwd: rushConfiguration ? rushConfiguration.commonTempFolder : packageFolder,
handleOutput: false,
environmentPathOptions: {
includeProjectBin: true
}
});
const terminalProvider: ITerminalProvider = new ConsoleTerminalProvider({
debugEnabled: rushxArguments.isDebug,
verboseEnabled: rushxArguments.isDebug
});
const terminal: ITerminal = new Terminal(terminalProvider);
if (rushConfiguration?.packageManager === 'pnpm' && rushConfiguration?.experimentsConfiguration) {
const { configuration: experiments } = rushConfiguration?.experimentsConfiguration;
if (experiments?.usePnpmSyncForInjectedDependencies) {
const pnpmSyncJsonPath: string = packageFolder + '/node_modules/.pnpm-sync.json';
if (await FileSystem.existsAsync(pnpmSyncJsonPath)) {
const { PackageExtractor } = await import(
/* webpackChunkName: 'PackageExtractor' */
'@rushstack/package-extractor'
);
await pnpmSyncCopyAsync({
pnpmSyncJsonPath,
ensureFolderAsync: FileSystem.ensureFolderAsync,
forEachAsyncWithConcurrency: Async.forEachAsync,
getPackageIncludedFiles: PackageExtractor.getPackageIncludedFilesAsync,
logMessageCallback: (logMessageOptions: ILogMessageCallbackOptions) =>
PnpmSyncUtilities.processLogMessage(logMessageOptions, terminal)
});
}
}
}
if (exitCode > 0) {
throw new ProcessError(
`Failed calling ${commandWithArgsForDisplay}. Exit code: ${exitCode}`,
exitCode
);
}
}
private static _parseCommandLineArguments(): IRushXCommandLineArguments {
// 0 = node.exe
// 1 = rushx
const args: string[] = process.argv.slice(2);
const unknownArgs: string[] = [];
let help: boolean = false;
let quiet: boolean = false;
let commandName: string = '';
let isDebug: boolean = false;
let ignoreHooks: boolean = false;
const commandArgs: string[] = [];
for (let index: number = 0; index < args.length; index++) {
const argValue: string = args[index];
if (!commandName) {
if (argValue === '-q' || argValue === '--quiet') {
quiet = true;
} else if (argValue === '-h' || argValue === '--help') {
help = true;
} else if (argValue === '-d' || argValue === '--debug') {
isDebug = true;
} else if (argValue === '--ignore-hooks') {
ignoreHooks = true;
} else if (argValue.startsWith('-')) {
unknownArgs.push(args[index]);
} else {
commandName = args[index];
}
} else {
commandArgs.push(args[index]);
}
}
if (!commandName) {
help = true;
}
if (unknownArgs.length > 0) {
// Future TODO: Instead of just displaying usage info, we could display a
// specific error about the unknown flag the user tried to pass to rushx.
// eslint-disable-next-line no-console
console.log(Colorize.red(`Unknown arguments: ${unknownArgs.map((x) => JSON.stringify(x)).join(', ')}`));
help = true;
}
return {
help,
quiet,
isDebug,
ignoreHooks,
commandName,
commandArgs
};
}
private static _showUsage(packageJson: IPackageJson, projectCommandSet: ProjectCommandSet): void {
// eslint-disable-next-line no-console
console.log('usage: rushx [-h]');
// eslint-disable-next-line no-console
console.log(' rushx [-q/--quiet] [-d/--debug] [--ignore-hooks] <command> ...\n');
// eslint-disable-next-line no-console
console.log('Optional arguments:');
// eslint-disable-next-line no-console
console.log(' -h, --help Show this help message and exit.');
// eslint-disable-next-line no-console
console.log(' -q, --quiet Hide rushx startup information.');
// eslint-disable-next-line no-console
console.log(' -d, --debug Run in debug mode.\n');
if (projectCommandSet.commandNames.length > 0) {
// eslint-disable-next-line no-console
console.log(`Project commands for ${Colorize.cyan(packageJson.name)}:`);
// Calculate the length of the longest script name, for formatting
let maxLength: number = 0;
for (const commandName of projectCommandSet.commandNames) {
maxLength = Math.max(maxLength, commandName.length);
}
for (const commandName of projectCommandSet.commandNames) {
const escapedScriptBody: string = JSON.stringify(projectCommandSet.getScriptBody(commandName));
// The length of the string e.g. " command: "
const firstPartLength: number = 2 + maxLength + 2;
// The length for truncating the escaped escapedScriptBody so it doesn't wrap
// to the next line
const consoleWidth: number = PrintUtilities.getConsoleWidth() || DEFAULT_CONSOLE_WIDTH;
const truncateLength: number = Math.max(0, consoleWidth - firstPartLength) - 1;
// eslint-disable-next-line no-console
console.log(
// Example: " command: "
' ' +
Colorize.cyan(Text.padEnd(commandName + ':', maxLength + 2)) +
// Example: "do some thin..."
Text.truncateWithEllipsis(escapedScriptBody, truncateLength)
);
}
if (projectCommandSet.malformedScriptNames.length > 0) {
// eslint-disable-next-line no-console
console.log(
'\n' +
Colorize.yellow(
'Warning: Some "scripts" entries in the package.json file' +
' have malformed names: ' +
projectCommandSet.malformedScriptNames.map((x) => `"${x}"`).join(', ')
)
);
}
} else {
// eslint-disable-next-line no-console
console.log(Colorize.yellow('Warning: No commands are defined yet for this project.'));
// eslint-disable-next-line no-console
console.log(
'You can define a command by adding a "scripts" table to the project\'s package.json file.'
);
}
}
}
``` | /content/code_sandbox/libraries/rush-lib/src/cli/RushXCommandLine.ts | xml | 2016-09-30T00:28:20 | 2024-08-16T18:54:35 | rushstack | microsoft/rushstack | 5,790 | 3,177 |
```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.
*/
// TypeScript Version: 4.1
/// <reference types="@stdlib/types"/>
import { NumericAndGenericDataTypeMap, AnyArray, TypedArray, ComplexTypedArray } from '@stdlib/types/array';
/**
* Creates an array filled with ones and having the same length and data type as a provided input array.
*
* @param x - input array from which to derive the output array length
* @returns filled array
*
* @example
* var zeros = require( '@stdlib/array/zeros' );
*
* var x = zeros( 2, 'generic' );
* // returns [ 0, 0 ]
*
* var y = onesLike( x );
* // returns [ 1, 1 ]
*/
declare function onesLike( x: Array<any> ): Array<number>;
/**
* Creates an array filled with ones and having the same length and data type as a provided input array.
*
* @param x - input array from which to derive the output array length
* @returns filled array
*
* @example
* var zeros = require( '@stdlib/array/zeros' );
*
* var x = zeros( 2, 'float64' );
* // returns <Float64Array>[ 0.0, 0.0 ]
*
* var y = onesLike( x );
* // returns <Float64Array>[ 1.0, 1.0 ]
*/
declare function onesLike<T extends TypedArray | ComplexTypedArray>( x: T ): T;
/**
* Creates an array filled with ones and having the same length as a provided input array.
*
* The function supports the following data types:
*
* - `float64`: double-precision floating-point numbers (IEEE 754)
* - `float32`: single-precision floating-point numbers (IEEE 754)
* - `complex128`: double-precision complex floating-point numbers
* - `complex64`: single-precision complex floating-point numbers
* - `int32`: 32-bit two's complement signed integers
* - `uint32`: 32-bit unsigned integers
* - `int16`: 16-bit two's complement signed integers
* - `uint16`: 16-bit unsigned integers
* - `int8`: 8-bit two's complement signed integers
* - `uint8`: 8-bit unsigned integers
* - `uint8c`: 8-bit unsigned integers clamped to `0-255`
* - `generic`: generic JavaScript values
*
* @param x - input array from which to derive the output array length
* @param dtype - data type
* @returns filled array
*
* @example
* var zeros = require( '@stdlib/array/zeros' );
*
* var x = zeros( 2, 'float64' );
* // returns <Float64Array>[ 0.0, 0.0 ]
*
* var y = onesLike( x, 'float32' );
* // returns <Float32Array>[ 1.0, 1.0 ]
*/
declare function onesLike<T extends keyof NumericAndGenericDataTypeMap<number>>( x: AnyArray, dtype: T ): NumericAndGenericDataTypeMap<number>[T];
// EXPORTS //
export = onesLike;
``` | /content/code_sandbox/lib/node_modules/@stdlib/array/ones-like/docs/types/index.d.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 728 |
```xml
export * from 'rxjs-compat/observable/using';
``` | /content/code_sandbox/deps/node-10.15.3/tools/node_modules/eslint/node_modules/rxjs/observable/using.d.ts | xml | 2016-09-05T10:18:44 | 2024-08-11T13:21:40 | LiquidCore | LiquidPlayer/LiquidCore | 1,010 | 13 |
```xml
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <ReactNativeNavigation/ReactNativeNavigation.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
[ReactNativeNavigation bootstrapWithBridge:bridge];
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};
// return [super application:application didFinishLaunchingWithOptions:launchOptions];
return YES;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
///
/// @see: path_to_url
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
- (BOOL)concurrentRootEnabled
{
return true;
}
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
return [ReactNativeNavigation extraModulesForBridge:bridge];
}
@end
``` | /content/code_sandbox/ios/CalendarsExample/AppDelegate.mm | xml | 2016-11-11T12:17:27 | 2024-08-16T16:43:58 | react-native-calendars | wix/react-native-calendars | 9,403 | 323 |
```xml
/*your_sha256_hash-----------------------------
*your_sha256_hash----------------------------*/
import { testTokenization } from '../test/testRunner';
testTokenization('python', [
// Keywords
[
{
line: 'def func():',
tokens: [
{ startIndex: 0, type: 'keyword.python' },
{ startIndex: 3, type: 'white.python' },
{ startIndex: 4, type: 'identifier.python' },
{ startIndex: 8, type: 'delimiter.parenthesis.python' },
{ startIndex: 10, type: 'delimiter.python' }
]
}
],
[
{
line: 'func(str Y3)',
tokens: [
{ startIndex: 0, type: 'identifier.python' },
{ startIndex: 4, type: 'delimiter.parenthesis.python' },
{ startIndex: 5, type: 'keyword.python' },
{ startIndex: 8, type: 'white.python' },
{ startIndex: 9, type: 'identifier.python' },
{ startIndex: 11, type: 'delimiter.parenthesis.python' }
]
}
],
[
{
line: '@Dec0_rator:',
tokens: [
{ startIndex: 0, type: 'tag.python' },
{ startIndex: 11, type: 'delimiter.python' }
]
}
],
// Comments
[
{
line: ' # Comments! ## "jfkd" ',
tokens: [
{ startIndex: 0, type: 'white.python' },
{ startIndex: 1, type: 'comment.python' }
]
}
],
// Strings
[
{
line: "'s0'",
tokens: [
{ startIndex: 0, type: 'string.escape.python' },
{ startIndex: 1, type: 'string.python' },
{ startIndex: 3, type: 'string.escape.python' }
]
}
],
[
{
line: '"\' " "',
tokens: [
{ startIndex: 0, type: 'string.escape.python' },
{ startIndex: 1, type: 'string.python' },
{ startIndex: 3, type: 'string.escape.python' },
{ startIndex: 4, type: 'white.python' },
{ startIndex: 5, type: 'string.escape.python' }
]
}
],
[
{
line: "'''Lots of string'''",
tokens: [{ startIndex: 0, type: 'string.python' }]
}
],
[
{
line: '"""Lots \'\'\' \'\'\'"""',
tokens: [{ startIndex: 0, type: 'string.python' }]
}
],
[
{
line: "'''Lots '''0.3e-5",
tokens: [
{ startIndex: 0, type: 'string.python' },
{ startIndex: 11, type: 'number.python' }
]
}
],
// path_to_url
[
{
line: 'def f():',
tokens: [
{ startIndex: 0, type: 'keyword.python' },
{ startIndex: 3, type: 'white.python' },
{ startIndex: 4, type: 'identifier.python' },
{ startIndex: 5, type: 'delimiter.parenthesis.python' },
{ startIndex: 7, type: 'delimiter.python' }
]
},
{
line: ' """multi',
tokens: [
{ startIndex: 0, type: 'white.python' },
{ startIndex: 3, type: 'string.python' }
]
},
{
line: ' line',
tokens: [{ startIndex: 0, type: 'string.python' }]
},
{
line: ' comment',
tokens: [{ startIndex: 0, type: 'string.python' }]
},
{
line: ' """ + """',
tokens: [
{ startIndex: 0, type: 'string.python' },
{ startIndex: 6, type: 'white.python' },
{ startIndex: 7, type: '' },
{ startIndex: 8, type: 'white.python' },
{ startIndex: 9, type: 'string.python' }
]
},
{
line: ' another',
tokens: [{ startIndex: 0, type: 'string.python' }]
},
{
line: ' multi',
tokens: [{ startIndex: 0, type: 'string.python' }]
},
{
line: ' line',
tokens: [{ startIndex: 0, type: 'string.python' }]
},
{
line: ' comment"""',
tokens: [{ startIndex: 0, type: 'string.python' }]
},
{
line: ' code',
tokens: [
{ startIndex: 0, type: 'white.python' },
{ startIndex: 3, type: 'identifier.python' }
]
}
],
// Numbers
[
{
line: '0xAcBFd',
tokens: [{ startIndex: 0, type: 'number.hex.python' }]
}
],
[
{
line: '0x0cH',
tokens: [
{ startIndex: 0, type: 'number.hex.python' },
{ startIndex: 4, type: 'identifier.python' }
]
}
],
[
{
line: '456.7e-7j',
tokens: [{ startIndex: 0, type: 'number.python' }]
}
],
// F-Strings
[
{
line: 'f"str {var} str"',
tokens: [
{ startIndex: 0, type: 'string.escape.python' },
{ startIndex: 2, type: 'string.python' },
{ startIndex: 6, type: 'identifier.python' },
{ startIndex: 11, type: 'string.python' },
{ startIndex: 15, type: 'string.escape.python' }
]
}
],
[
{
line: `f'''str {var} str'''`,
tokens: [
{ startIndex: 0, type: 'string.escape.python' },
{ startIndex: 4, type: 'string.python' },
{ startIndex: 8, type: 'identifier.python' },
{ startIndex: 13, type: 'string.python' },
{ startIndex: 17, type: 'string.escape.python' }
]
}
],
[
{
line: 'f"{var:.3f}{var!r}{var=}"',
tokens: [
{ startIndex: 0, type: 'string.escape.python' },
{ startIndex: 2, type: 'identifier.python' },
{ startIndex: 6, type: 'string.python' },
{ startIndex: 10, type: 'identifier.python' },
{ startIndex: 15, type: 'string.python' },
{ startIndex: 17, type: 'identifier.python' },
{ startIndex: 22, type: 'string.python' },
{ startIndex: 23, type: 'identifier.python' },
{ startIndex: 24, type: 'string.escape.python' }
]
}
],
[
{
line: 'f"\' " "',
tokens: [
{ startIndex: 0, type: 'string.escape.python' },
{ startIndex: 2, type: 'string.python' },
{ startIndex: 4, type: 'string.escape.python' },
{ startIndex: 5, type: 'white.python' },
{ startIndex: 6, type: 'string.escape.python' }
]
}
],
[
{
line: '"{var}"',
tokens: [
{ startIndex: 0, type: 'string.escape.python' },
{ startIndex: 1, type: 'string.python' },
{ startIndex: 6, type: 'string.escape.python' }
]
}
]
]);
``` | /content/code_sandbox/src/basic-languages/python/python.test.ts | xml | 2016-06-07T16:56:31 | 2024-08-16T17:17:05 | monaco-editor | microsoft/monaco-editor | 39,508 | 1,912 |
```xml
import * as React from 'react';
import { Header, Table, AcceptIcon, CloseIcon } from '@fluentui/react-northstar';
import DocPage from '../components/DocPage';
const acceptIconLabelled = <AcceptIcon alt="applied attribute" title="applied" />;
const closeIconLabelled = <CloseIcon alt="not applied attribute" title="not applied" />;
const header = {
items: [
'content',
'title',
'aria-label(AL)',
'aria-labelledby (ALBY)',
'aria-describedby (ADBY)',
'NVDA',
'JAWS',
'VoiceOver',
],
};
const rows = [
{
key: 1,
items: [
acceptIconLabelled,
closeIconLabelled,
closeIconLabelled,
closeIconLabelled,
closeIconLabelled,
'[content] button',
'[content] button',
'[content] button ',
],
},
{
key: 2,
items: [
acceptIconLabelled,
acceptIconLabelled,
closeIconLabelled,
closeIconLabelled,
closeIconLabelled,
'[content] button [title]',
'[content] button [title]',
'[content] button',
],
},
{
key: 3,
items: [
acceptIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
closeIconLabelled,
closeIconLabelled,
'[AL] button [title]',
'[AL] button [title]',
'[AL] button [title]',
],
},
{
key: 4,
items: [
acceptIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
closeIconLabelled,
'[ALBY] button [title]',
'[ALBY] button [title]',
'[ALBY] button [title]',
],
},
{
key: 5,
items: [
acceptIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
'[ALBY] button [ADBY]',
'[ALBY] button [ADBY]',
'[ALBY] button [ADBY]',
],
},
{
key: 6,
items: [
acceptIconLabelled,
closeIconLabelled,
acceptIconLabelled,
closeIconLabelled,
closeIconLabelled,
'[AL] button',
'[AL] button',
'[AL] button',
],
},
{
key: 7,
items: [
acceptIconLabelled,
closeIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
closeIconLabelled,
'[ALBY] button',
'[ALBY] button',
'[ALBY] button',
],
},
{
key: 8,
items: [
acceptIconLabelled,
closeIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
'[ALBY] button [ADBY]',
'[ALBY] button [ADBY]',
'[ALBY] button [ADBY]',
],
},
{
key: 9,
items: [
acceptIconLabelled,
closeIconLabelled,
closeIconLabelled,
acceptIconLabelled,
closeIconLabelled,
'[ALBY] button',
'[ALBY] button',
'[ALBY] button',
],
},
{
key: 10,
items: [
acceptIconLabelled,
closeIconLabelled,
closeIconLabelled,
closeIconLabelled,
acceptIconLabelled,
'[content] button [ADBY]',
'[content] button [ADBY]',
'[content] button [ADBY]',
],
},
{
key: 11,
items: [
closeIconLabelled,
acceptIconLabelled,
closeIconLabelled,
closeIconLabelled,
closeIconLabelled,
'[title] button',
'[title] button',
'[title] button',
],
},
{
key: 12,
items: [
closeIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
closeIconLabelled,
closeIconLabelled,
'[AL] button [title]',
'[AL] button [title]',
'[AL] button [title]',
],
},
{
key: 13,
items: [
closeIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
closeIconLabelled,
'[ALBY] button [title]',
'[ALBY] button [title]',
'[ALBY] button [title]',
],
},
{
key: 14,
items: [
closeIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
'[ALBY] button [ADBY]',
'[ALBY] button [ADBY]',
'[ALBY] button [ADBY]',
],
},
{
key: 15,
items: [
closeIconLabelled,
closeIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
closeIconLabelled,
'[ALBY] button',
'[ALBY] button',
'[ALBY] button',
],
},
{
key: 16,
items: [
closeIconLabelled,
closeIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
acceptIconLabelled,
'[ALBY] button [ADBY]',
'[ALBY] button [ADBY]',
'[ALBY] button [ADBY]',
],
},
{
key: 17,
items: [
closeIconLabelled,
acceptIconLabelled,
closeIconLabelled,
acceptIconLabelled,
closeIconLabelled,
'[ALBY] button [title]',
'[ALBY] button [title]',
'[ALBY] button [title]',
],
},
];
const TableExampleStaticShorthand = () => (
<DocPage title="Accessbility name computation">
<Header as="h2">Button accessibility name computation based on used attributes</Header>
<p>
In the table below on the left side is group of the attributes which can be used for button labelling. On the
right side are results how particular screen reader narrates used attributes.
</p>
<p>
Icon {acceptIconLabelled} means that attribute is used for name computation. Icon {closeIconLabelled} means that
attribute is not used for name computation.
</p>
<p>Be aware 'button' is the role which reader narrate.</p>
{/* <Table header={headerVisual} aria-hidden="true" /> */}
<Table
styles={{
'& .ui-table__row:nth-child(even)': { background: 'aliceblue' },
'& .ui-table__row:nth-child(6)': { borderLeft: '1px dashed grey' },
}}
header={header}
rows={rows}
aria-label="Button accessibility name computation"
/>
</DocPage>
);
export default TableExampleStaticShorthand;
``` | /content/code_sandbox/packages/fluentui/docs/src/views/ButtonNameComputation.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 1,603 |
```xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="NXDrawKit" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>
``` | /content/code_sandbox/Example/NXDrawKit/Base.lproj/LaunchScreen.xib | xml | 2016-07-25T15:24:46 | 2024-08-12T10:55:51 | NXDrawKit | Nicejinux/NXDrawKit | 1,340 | 848 |
```xml
export interface Source {
id: string,
name: string
}
``` | /content/code_sandbox/ui/cypress/support/types.ts | xml | 2016-08-24T23:28:56 | 2024-08-13T19:50:03 | chronograf | influxdata/chronograf | 1,494 | 16 |
```xml
import React from 'react';
import { localized, PropTypes, Actions, TaskFactory, ExtensionRegistry } from 'mailspring-exports';
import { ThreadWithMessagesMetadata } from './types';
class ThreadListIcon extends React.Component<{ thread: ThreadWithMessagesMetadata }> {
static displayName = 'ThreadListIcon';
static propTypes = { thread: PropTypes.object };
_extensionsIconClassNames = () => {
return ExtensionRegistry.ThreadList.extensions()
.filter(ext => ext.cssClassNamesForThreadListIcon != null)
.reduce((prev, ext) => prev + ' ' + ext.cssClassNamesForThreadListIcon(this.props.thread), '')
.trim();
};
_iconClassNames = () => {
if (!this.props.thread) {
return 'thread-icon-star-on-hover';
}
const extensionIconClassNames = this._extensionsIconClassNames();
if (extensionIconClassNames.length > 0) {
return extensionIconClassNames;
}
if (this.props.thread.starred) {
return 'thread-icon-star';
}
if (this.props.thread.unread) {
return 'thread-icon-unread thread-icon-star-on-hover';
}
const msgs = this._nonDraftMessages();
const last = msgs[msgs.length - 1];
if (msgs.length > 1 && (last.from[0] != null ? last.from[0].isMe() : undefined)) {
if (last.isForwarded()) {
return 'thread-icon-forwarded thread-icon-star-on-hover';
} else {
return 'thread-icon-replied thread-icon-star-on-hover';
}
}
return 'thread-icon-none thread-icon-star-on-hover';
};
_nonDraftMessages() {
let msgs = this.props.thread.__messages;
if (!msgs || !(msgs instanceof Array)) {
return [];
}
msgs = msgs.filter(m => m.id && !m.draft);
return msgs;
}
shouldComponentUpdate(nextProps) {
if (nextProps.thread === this.props.thread) {
return false;
}
return true;
}
render() {
return (
<div
className={`thread-icon ${this._iconClassNames()}`}
title={localized('Star')}
onClick={this._onToggleStar}
/>
);
}
_onToggleStar = event => {
Actions.queueTask(
TaskFactory.taskForInvertingStarred({
threads: [this.props.thread],
source: 'Thread List Icon',
})
);
// Don't trigger the thread row click
return event.stopPropagation();
};
}
export default ThreadListIcon;
``` | /content/code_sandbox/app/internal_packages/thread-list/lib/thread-list-icon.tsx | xml | 2016-10-13T06:45:50 | 2024-08-16T18:14:37 | Mailspring | Foundry376/Mailspring | 15,331 | 557 |
```xml
import { DialogModule } from "@angular/cdk/dialog";
import { CommonModule } from "@angular/common";
import { Component, EventEmitter, Output } from "@angular/core";
import { ReactiveFormsModule, FormsModule } from "@angular/forms";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { I18nPipe } from "@bitwarden/angular/platform/pipes/i18n.pipe";
import {
ButtonModule,
LinkModule,
TypographyModule,
FormFieldModule,
AsyncActionsModule,
} from "@bitwarden/components";
@Component({
standalone: true,
selector: "app-two-factor-auth-authenticator",
templateUrl: "two-factor-auth-authenticator.component.html",
imports: [
CommonModule,
JslibModule,
DialogModule,
ButtonModule,
LinkModule,
TypographyModule,
ReactiveFormsModule,
FormFieldModule,
AsyncActionsModule,
FormsModule,
],
providers: [I18nPipe],
})
export class TwoFactorAuthAuthenticatorComponent {
tokenValue: string;
@Output() token = new EventEmitter<string>();
}
``` | /content/code_sandbox/libs/angular/src/auth/components/two-factor-auth/two-factor-auth-authenticator.component.ts | xml | 2016-03-09T23:14:01 | 2024-08-16T15:07:51 | clients | bitwarden/clients | 8,877 | 227 |
```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.
export const description = "Capture no props if prototype is used but does not use this #1";
class C {
a: number;
b: number;
constructor() {
this.a = 1;
this.b = 2;
}
m() { }
}
const o = new C();
export const func = function () { o.m(); };
``` | /content/code_sandbox/sdk/nodejs/tests/runtime/testdata/closure-tests/cases/110-Capture-no-props-if-prototype-is-used-but-does-not-use-this-1/index.ts | xml | 2016-10-31T21:02:47 | 2024-08-16T19:47:04 | pulumi | pulumi/pulumi | 20,743 | 114 |
```xml
import React, { FC } from 'react';
import { Icon, useStyles } from '@grafana/ui';
import { Overlay } from 'shared/components/Elements/Overlay/Overlay';
import { Highlight } from 'shared/components/Hightlight/Highlight';
import Tippy from '@tippyjs/react';
import { getStyles } from './Plan.styles';
import { Messages } from './Plan.messages';
import { usePlan } from './Plan.hooks';
import { OVERLAY_LOADER_SIZE } from '../Details.constants';
export const Plan: FC = () => {
const styles = useStyles(getStyles);
const [plan, loading] = usePlan();
return (
<Overlay isPending={loading} size={OVERLAY_LOADER_SIZE}>
<div className={styles.planWrapper}>
{plan ? (
<>
<Highlight key={plan?.id || ''} language="sql">
{plan?.plan || ''}
</Highlight>
<div className={styles.tooltipWrapper}>
<Tippy
delay={[100, 100]}
className={styles.tippy}
content={`${Messages.planId} ${plan?.id}`}
placement="left"
interactive
appendTo={document.body}
>
<Icon name="info-circle" />
</Tippy>
</div>
</>
) : (
!loading && <pre>{Messages.noPlan}</pre>
)}
</div>
</Overlay>
);
};
``` | /content/code_sandbox/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.tsx | xml | 2016-01-22T07:14:23 | 2024-08-13T13:01:59 | grafana-dashboards | percona/grafana-dashboards | 2,661 | 302 |
```xml
import { expect } from 'chai';
import $ from './data/_.nested'; // FORMS
// describe('Form performance', () => {
//
// it('DVR enabled', () => {
// const t0 = Date.now();
//
// $.$Z.submit();
// const span = Date.now() - t0;
// expect(span).lessThan(5000);
// });
//
// });
``` | /content/code_sandbox/tests/nested.performance.ts | xml | 2016-06-20T22:10:41 | 2024-08-10T13:14:33 | mobx-react-form | foxhound87/mobx-react-form | 1,093 | 89 |
```xml
import * as React from 'react';
import createSvgIcon from '../utils/createSvgIcon';
const OrgIcon = createSvgIcon({
svg: ({ classes }) => (
<svg xmlns="path_to_url" viewBox="0 0 2048 2048" className={classes.svg} focusable="false">
<path d="M1664 your_sha256_hash40V640H640V0h640v640h-256v256h640v384zM768 128v384h384V128H768zM512 1792v-384H128v384h384zm1280 0v-384h-384v384h384z" />
</svg>
),
displayName: 'OrgIcon',
});
export default OrgIcon;
``` | /content/code_sandbox/packages/react-icons-mdl2/src/components/OrgIcon.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 162 |
```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>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
``` | /content/code_sandbox/Support/Info.plist | xml | 2016-04-25T03:21:39 | 2024-08-13T16:06:11 | GlitchLabel | kciter/GlitchLabel | 1,045 | 248 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="path_to_url">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{47891C37-4AB1-4332-AD03-ED1DBE8A978C}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>NumericStrings</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</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)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>D:\temp\CodingInterviewBin\</OutDir>
<IntDir>D:\temp\CodingInterviewBin\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<BuildLog>
<Path>D:\temp\CodingInterviewBin\$(MSBuildProjectName).log</Path>
</BuildLog>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="NumericString.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
``` | /content/code_sandbox/ChineseCodingInterviewAppendix-master/NumericStrings/NumericStrings.vcxproj | xml | 2016-04-08T08:38:19 | 2024-08-16T11:26:26 | CodingInterviews | gatieme/CodingInterviews | 4,823 | 1,035 |
```xml
import { ICommunication } from 'shared/utils/redux/communication';
import { bind } from 'decko';
import React from 'react';
import { connect } from 'react-redux';
import Fai from 'shared/view/elements/Fai/Fai';
import { Icon } from 'shared/view/elements/Icon/Icon';
import Preloader from 'shared/view/elements/Preloader/Preloader';
import ShareLink from 'shared/view/elements/ShareLink/ShareLink';
import { Project } from 'shared/models/Project';
import { chartsPageSettings } from 'features/experimentRuns/store';
import { selectProject } from 'features/projects/store';
import { IApplicationState, IConnectedReduxProps } from 'setup/store/store';
import styles from './ChartRangeFilter.module.css';
interface IPropsFromState {
project: Project | undefined;
}
interface ILocalProps {
projectId: string;
loadingSequentialChartData: ICommunication;
paginatedDataLength: number;
updateIsRangeAppliedAtParent(isRangeApplied: boolean): void;
resetChartConfigAtParent(): void;
}
type AllProps = ILocalProps & IPropsFromState & IConnectedReduxProps;
interface ILocalState {
isRangeFilterApplied: boolean;
}
class ChartRangeFilter extends React.Component<AllProps, ILocalState> {
public state: ILocalState = {
isRangeFilterApplied: false,
};
public render() {
const { project, loadingSequentialChartData } = this.props;
return (
<div className={styles.chart_section_wrapper}>
<div className={styles.range_filter_container}>
<div className={styles.chart_actions_panel}>
<div className={styles.panel_heading}>
{project ? project.name : 'Unnamed Project'}
</div>
<div className={styles.action_wrapper}>
<div className={styles.action_container}>
<div className={styles.share_label}>Reset:</div>
<div className={styles.share_link}>
<Fai
theme="primary"
variant="outlined"
icon={<Icon type="share-change" />}
onClick={this.resetChartConfig}
/>
</div>
</div>
<div className={styles.action_container}>
<div className={styles.share_label}>Share:</div>
<div className={styles.share_link}>
<ShareLink link={window.location.href} buttonType="fai" />
</div>
</div>
</div>
</div>
<div className={styles.data_range_container}>
<div className={styles.pagination_info}>
Data count:{' '}
<span className={styles.pagination_value}>
{this.props.paginatedDataLength}
</span>
</div>
{this.props.paginatedDataLength >=
chartsPageSettings.datapointLimit && (
<div className={styles.pageSizeWarnMeta}>
<div className={styles.pageSizeWarnLogo}>
<Icon
className={styles.desc_action_icon}
type={'exclamation-triangle-lite'}
/>
</div>
Max data limit reached, consider applying filters.
</div>
)}
{loadingSequentialChartData.isRequesting && (
<div className={styles.loading_container}>
<Preloader variant="dots" />
<div className={styles.loading_info}>Loading more data...</div>
</div>
)}
</div>
</div>
</div>
);
}
@bind
private resetChartConfig() {
this.props.resetChartConfigAtParent();
}
}
const mapStateToProps = (
state: IApplicationState,
localProps: ILocalProps
): IPropsFromState => ({
project: selectProject(state, localProps.projectId),
});
export default connect(mapStateToProps)(ChartRangeFilter);
``` | /content/code_sandbox/webapp/client/src/pages/authorized/ProjectsPages/ProjectDetailsPages/ChartsPage/Charts/ChartRangeFilter/ChartRangeFilterManager.tsx | xml | 2016-10-19T01:07:26 | 2024-08-14T03:53:55 | modeldb | VertaAI/modeldb | 1,689 | 787 |
```xml
import React, { useEffect, useMemo, useRef, useState, useCallback } from 'react'
import { useSet } from 'react-use'
import { difference } from 'lodash'
import styled from '../../../design/lib/styled'
import { SerializedDocWithSupplemental } from '../../interfaces/db/doc'
import { SerializedFolderWithBookmark } from '../../interfaces/db/folder'
import ContentManagerToolbar from '../ContentManager/ContentManagerToolbar'
import ViewsSelector from './ViewsSelector'
import { sortTableViewColumns } from '../../lib/views/table'
import { SerializedView, ViewParent } from '../../interfaces/db/view'
import { SerializedWorkspace } from '../../interfaces/db/workspace'
import { SerializedTeam } from '../../interfaces/db/team'
import TableView from './Table/TableView'
import FolderList from './FolderList'
import Scroller from '../../../design/components/atoms/Scroller'
import { sortByLexorankProperty } from '../../lib/utils/string'
import CalendarView from './Calendar/CalendarView'
import KanbanView from './Kanban'
import ListView from './List'
import { sortListViewProps } from '../../lib/views/list'
import { useRouter } from '../../lib/router'
import { useCloudDocPreview } from '../../lib/hooks/useCloudDocPreview'
import { getDefaultViewShortId } from '../../lib/views'
type ViewsManagerProps = {
views: SerializedView[]
parent: ViewParent
workspacesMap: Map<string, SerializedWorkspace>
docs: SerializedDocWithSupplemental[]
folders?: SerializedFolderWithBookmark[]
currentUserIsCoreMember: boolean
currentWorkspaceId?: string
currentFolderId?: string
team: SerializedTeam
}
export const ViewsManager = ({
views,
parent,
team,
docs,
folders,
currentUserIsCoreMember,
currentFolderId,
currentWorkspaceId,
workspacesMap,
}: ViewsManagerProps) => {
const [selectedViewShortId, setSelectedViewShortId] = useState<
string | undefined
>(() =>
views.length > 0
? sortByLexorankProperty(views, 'order')[0].shortId
: getDefaultViewShortId()
)
const [updating, setUpdating] = useState<string[]>([])
const [
selectedFolderSet,
{
add: addFolderInSelection,
has: hasFolderInSelection,
toggle: toggleFolderInSelection,
reset: resetFoldersInSelection,
remove: removeFolderInSelection,
},
] = useSet<string>(new Set())
const [
selectedDocSet,
{
add: addDocinSelection,
has: hasDocInSelection,
toggle: toggleDocInSelection,
remove: removeDocInSelection,
reset: resetDocsInSelection,
},
] = useSet<string>(new Set())
const { query, push, pathname } = useRouter()
useCloudDocPreview(team)
const currentDocumentsRef = useRef(
new Map<string, SerializedDocWithSupplemental>(
docs.map((doc) => [doc.id, doc])
)
)
const currentFoldersRef = useRef(
new Map<string, SerializedFolderWithBookmark>(
(folders || []).map((folder) => [folder.id, folder])
)
)
useEffect(() => {
if (!query || typeof query.view !== 'string') {
return
}
if (Number.isNaN(query.view)) {
return
}
const viewShortId = query.view
const viewToLoad = views.find((view) => view.shortId === viewShortId)
if (viewToLoad != null) {
setSelectedViewShortId(viewShortId)
}
}, [query, views])
useEffect(() => {
const newMap = new Map(docs.map((doc) => [doc.id, doc]))
const idsToClean: string[] = difference(
[...currentDocumentsRef.current.keys()],
[...newMap.keys()]
)
idsToClean.forEach(removeDocInSelection)
currentDocumentsRef.current = newMap
}, [docs, removeDocInSelection])
useEffect(() => {
const newMap = new Map((folders || []).map((folder) => [folder.id, folder]))
const idsToClean: string[] = difference(
[...currentFoldersRef.current.keys()],
[...newMap.keys()]
)
idsToClean.forEach(removeFolderInSelection)
currentFoldersRef.current = newMap
}, [folders, removeFolderInSelection])
const currentView = useMemo(() => {
if (selectedViewShortId == null || views.length === 0) {
return undefined
}
const index = views.findIndex(
(view) => view.shortId === selectedViewShortId
)
if (index !== -1) {
return views[index]
}
return sortByLexorankProperty(views, 'order')[0]
}, [selectedViewShortId, views])
const toolbarColumns = useMemo(() => {
if (
currentView == null ||
!(currentView.type === 'table' || currentView.type === 'list')
) {
return []
}
if (currentView.type === 'table') {
return sortTableViewColumns(currentView.data.columns || {})
}
return sortListViewProps(currentView.data.props)
}, [currentView])
const selectViewShortId = useCallback(
(shortId: string) => {
push(`${pathname}?view=${shortId}`)
setSelectedViewShortId(shortId)
resetDocsInSelection()
resetFoldersInSelection()
},
[pathname, push, resetDocsInSelection, resetFoldersInSelection]
)
const viewsSelector = useMemo(() => {
return (
<ViewsSelector
selectedViewShortId={
currentView != null ? currentView.shortId : undefined
}
setSelectedViewShortId={selectViewShortId}
parent={parent}
views={views}
currentUserIsCoreMember={currentUserIsCoreMember}
/>
)
}, [parent, views, currentView, selectViewShortId, currentUserIsCoreMember])
return (
<Container>
<Scroller className='view__scroller'>
{currentView != null && (
<>
{currentView.type === 'list' ? (
<ListView
viewsSelector={viewsSelector}
team={team}
currentWorkspaceId={currentWorkspaceId}
currentFolderId={currentFolderId}
view={currentView}
docs={docs}
currentUserIsCoreMember={currentUserIsCoreMember}
selectViewShortId={setSelectedViewShortId}
addDocInSelection={addDocinSelection}
hasDocInSelection={hasDocInSelection}
toggleDocInSelection={toggleDocInSelection}
resetDocsInSelection={resetDocsInSelection}
addFolderInSelection={addFolderInSelection}
hasFolderInSelection={hasFolderInSelection}
toggleFolderInSelection={toggleFolderInSelection}
folders={folders}
updating={updating}
setUpdating={setUpdating}
resetFoldersInSelection={resetFoldersInSelection}
/>
) : currentView.type === 'table' ? (
<TableView
viewsSelector={viewsSelector}
team={team}
currentWorkspaceId={currentWorkspaceId}
currentFolderId={currentFolderId}
view={currentView}
docs={docs}
currentUserIsCoreMember={currentUserIsCoreMember}
selectViewShortId={setSelectedViewShortId}
addDocInSelection={addDocinSelection}
hasDocInSelection={hasDocInSelection}
toggleDocInSelection={toggleDocInSelection}
resetDocsInSelection={resetDocsInSelection}
/>
) : currentView.type === 'kanban' ? (
<KanbanView
viewsSelector={viewsSelector}
team={team}
view={currentView}
currentUserIsCoreMember={currentUserIsCoreMember}
docs={docs}
currentFolderId={currentFolderId}
currentWorkspaceId={currentWorkspaceId}
/>
) : currentView.type === 'calendar' ? (
<CalendarView
view={currentView}
viewsSelector={viewsSelector}
docs={docs}
team={team}
currentUserIsCoreMember={currentUserIsCoreMember}
currentFolderId={currentFolderId}
currentWorkspaceId={currentWorkspaceId}
/>
) : null}
</>
)}
{currentView != null && currentView.type !== 'list' && (
<FolderList
folders={folders}
team={team}
currentUserIsCoreMember={currentUserIsCoreMember}
updating={updating}
setUpdating={setUpdating}
currentWorkspaceId={currentWorkspaceId}
currentFolderId={currentFolderId}
addFolderInSelection={addFolderInSelection}
hasFolderInSelection={hasFolderInSelection}
toggleFolderInSelection={toggleFolderInSelection}
resetFoldersInSelection={resetFoldersInSelection}
/>
)}
<div className='views__placeholder' />
</Scroller>
{currentUserIsCoreMember && (
<ContentManagerToolbar
propsColumns={toolbarColumns}
selectedDocs={selectedDocSet}
selectedFolders={selectedFolderSet}
documentsMap={currentDocumentsRef.current}
foldersMap={currentFoldersRef.current}
workspacesMap={workspacesMap}
team={team}
updating={updating}
setUpdating={setUpdating}
/>
)}
</Container>
)
}
const Container = styled.div`
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
.views__header {
flex: 0 0 auto;
width: 100%;
}
.view__scroller {
height: 100%;
}
.views__placeholder {
height: 40px;
width: 100%;
}
.content__manager__list__header--margin {
margin-top: ${({ theme }) => theme.sizes.spaces.df}px;
}
.content__manager__add-row {
height: 40px;
display: flex;
align-items: center;
padding: 0 ${({ theme }) => theme.sizes.spaces.xl}px;
color: ${({ theme }) => theme.colors.text.subtle};
width: 100%;
&:not(.content__manager__add-row--folder) {
border-bottom: 1px solid ${({ theme }) => theme.colors.border.second};
}
button {
padding: 0;
justify-content: flex-start;
}
.form__toggable__input,
button,
input {
width: 100%;
}
}
`
``` | /content/code_sandbox/src/cloud/components/Views/index.tsx | xml | 2016-11-19T14:30:34 | 2024-08-16T03:13:45 | BoostNote-App | BoostIO/BoostNote-App | 3,745 | 2,258 |
```xml
import rule from './index';
import { getHtmlRuleTester, getInvalidTestFactory, getTsRuleTester } from '../../test-helper.spec';
const tsRuleTester = getTsRuleTester();
const htmlRuleTester = getHtmlRuleTester();
const getInvalidInputTest = getInvalidTestFactory('clrInputFailure');
htmlRuleTester.run('no-clr-input', rule, {
invalid: [
getInvalidInputTest({
code: `<input clrInput>`,
locations: [{ line: 1, column: 1 }],
}),
getInvalidInputTest({
code: `
<clr-input-container>
<input clrInput>
</clr-input-container>
`,
locations: [{ line: 2, column: 9 }],
}),
getInvalidInputTest({
code: `<input class="clr-input">`,
locations: [{ line: 1, column: 1 }],
}),
],
valid: [`<input>`, `<div clrInput></div>`],
});
tsRuleTester.run('no-clr-input', rule, {
invalid: [
getInvalidInputTest({
code: `
@Component({
template: \`
<input clrInput>
\`
})
export class CustomInputComponent {}
`,
locations: [{ line: 4, column: 11 }],
}),
getInvalidInputTest({
code: `
@Component({
template: \`
<clr-input-container>
<input clrInput>
</clr-input-container>
\`
})
export class CustomInputComponent {}
`,
locations: [{ line: 4, column: 11 }],
}),
getInvalidInputTest({
code: `
@Component({
template: \`
<input class="clr-input">
\`
})
export class CustomInputComponent {}
`,
locations: [{ line: 4, column: 11 }],
}),
],
valid: [
`
@Component({
template: \`
<input>
\`
})
export class CustomInputComponent {}
`,
`
@Component({
template: \`
<div clrInput></div>
\`
})
export class CustomInputComponent {}
`,
],
});
``` | /content/code_sandbox/packages/eslint-plugin-clarity-adoption/src/rules/no-clr-input/no-clr-input.spec.ts | xml | 2016-09-29T17:24:17 | 2024-08-11T17:06:15 | clarity | vmware-archive/clarity | 6,431 | 478 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="path_to_url">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="test_split_interval_map_infix.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\test_interval_map_shared.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\test_type_lists.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
``` | /content/code_sandbox/deps/boost_1_66_0/libs/icl/test/test_split_interval_map_infix_/vc10_test_split_interval_map_infix.vcxproj.filters | xml | 2016-09-05T10:18:44 | 2024-08-11T13:21:40 | LiquidCore | LiquidPlayer/LiquidCore | 1,010 | 368 |
```xml
import i18n from "i18n-js"
import { TxKeyPath } from "./i18n"
/**
* Translates text.
*
* @param key The i18n key.
* @param options The i18n options.
* @returns The translated text.
*
* @example
* Translations:
*
* ```en.ts
* {
* "hello": "Hello, {{name}}!"
* }
* ```
*
* Usage:
* ```ts
* import { translate } from "i18n-js"
*
* translate("common.ok", { name: "world" })
* // => "Hello world!"
* ```
*/
export function translate(key: TxKeyPath, options?: i18n.TranslateOptions) {
return i18n.t(key, options)
}
``` | /content/code_sandbox/apps/example-app/app/i18n/translate.ts | xml | 2016-04-15T21:58:32 | 2024-08-16T11:39:46 | reactotron | infinitered/reactotron | 14,757 | 164 |
```xml
import handler from "@payloadcms/next-payload/dist/handlers/[collection]/first-register";
export default handler;
export const config = {
api: {
bodyParser: false,
externalResolver: true,
},
};
``` | /content/code_sandbox/examples/cms-payload/pages/api/[collection]/first-register.ts | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 48 |
```xml
import React from "react";
import { Rnd } from "../../src";
import { style } from "../styles";
type State = {
x: number;
y: number;
width: number;
height: number;
};
export default class Example extends React.Component<{}, State> {
constructor(props) {
super(props);
this.state = {
width: 200,
height: 200,
x: 0,
y: 0,
};
}
render() {
return (
<div>
<div style={{ marginLeft: "30px" }}>
<Rnd
style={style}
bounds="window"
default={{
width: 200,
height: 200,
x: 0,
y: 0,
}}
position={{
x: this.state.x,
y: this.state.y,
}}
onDragStop={(e, d) => {
this.setState({ x: d.x, y: d.y });
}}
onResize={(e, direction, ref, delta, position) => {
this.setState({
width: ref.offsetWidth,
height: ref.offsetHeight,
...position,
});
}}
>
001
</Rnd>
</div>
</div>
);
}
}
``` | /content/code_sandbox/stories/bounds/window-controlled.tsx | xml | 2016-01-02T07:47:27 | 2024-08-16T15:01:53 | react-rnd | bokuweb/react-rnd | 3,859 | 278 |
```xml
import UserAuthentication from "@server/models/UserAuthentication";
import { buildUser } from "@server/test/factories";
import UserDeletedProcessor from "./UserDeletedProcessor";
const ip = "127.0.0.1";
describe("UserDeletedProcessor", () => {
test("should remove relationships", async () => {
const user = await buildUser();
expect(
await UserAuthentication.count({
where: {
userId: user.id,
},
})
).toBe(1);
const processor = new UserDeletedProcessor();
await processor.perform({
name: "users.delete",
userId: user.id,
actorId: user.id,
teamId: user.teamId,
ip,
});
expect(
await UserAuthentication.count({
where: {
userId: user.id,
},
})
).toBe(0);
});
});
``` | /content/code_sandbox/server/queues/processors/UserDeletedProcessor.test.ts | xml | 2016-05-22T21:31:47 | 2024-08-16T19:57:22 | outline | outline/outline | 26,751 | 181 |
```xml
import * as React from 'react';
import createSvgIcon from '../utils/createSvgIcon';
const IncreaseIndentMirroredIcon = createSvgIcon({
svg: ({ classes }) => (
<svg xmlns="path_to_url" viewBox="0 0 2048 2048" className={classes.svg} focusable="false">
<path d="M1920 128v128H128V128h1792zM128 1792v-128h1792v128H128zM896 640v128H128V640h768zm0 512v128H128v-128h768zm506-256h646v128h-646l163 163-90 90-317-317 317-317 90 90-163 163z" />
</svg>
),
displayName: 'IncreaseIndentMirroredIcon',
});
export default IncreaseIndentMirroredIcon;
``` | /content/code_sandbox/packages/react-icons-mdl2/src/components/IncreaseIndentMirroredIcon.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 192 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="path_to_url"
xmlns:app="path_to_url"
xmlns:tools="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/tableLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:stretchColumns="*"
tools:context=".fragment.AddImagesFragment">
<TextView
android:id="@+id/invert_pdf_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:padding="5dp"
android:text="@string/invert_pdf_info"
android:textSize="15sp"
android:textStyle="bold" />
<com.dd.morphingbutton.MorphingButton
android:id="@+id/selectFile"
style="@style/MorphingButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="24dp"
android:maxWidth="30dp"
android:padding="3dip"
android:text="@string/merge_file_select"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.dd.morphingbutton.MorphingButton
android:id="@+id/invert"
style="@style/MorphingButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="16dp"
android:layout_marginTop="112dp"
android:padding="10dp"
android:text="@string/invert_pdf_title"
app:layout_constraintBottom_toTopOf="@id/recyclerView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textView" />
<Button
android:id="@+id/view_pdf"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:background="@color/mb_green"
android:text="@string/view_pdf"
android:visibility="invisible" />
</LinearLayout>
<include layout="@layout/bottom_sheet" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
``` | /content/code_sandbox/app/src/main/res/layout/fragment_invert_pdf.xml | xml | 2016-02-22T10:00:46 | 2024-08-16T15:37:50 | Images-to-PDF | Swati4star/Images-to-PDF | 1,174 | 559 |
```xml
// See LICENSE in the project root for license information.
import vm from 'vm';
import { FileSystem } from '@rushstack/node-core-library';
import type { IPseudolocaleOptions } from './interfaces';
const pseudolocalePath: string = require.resolve('pseudolocale/pseudolocale.min.js');
interface IPseudolocale {
option: IPseudolocaleOptions;
str(str: string): string;
}
/**
* Get a function that pseudolocalizes a string.
*
* @public
*/
export function getPseudolocalizer(options: IPseudolocaleOptions): (str: string) => string {
const pseudolocaleCode: string = FileSystem.readFile(pseudolocalePath);
const context: {
pseudolocale: IPseudolocale | undefined;
} = {
pseudolocale: undefined
};
// Load pseudolocale in an isolated context because the configuration for is stored on a singleton
vm.runInNewContext(pseudolocaleCode, context);
const { pseudolocale } = context;
if (!pseudolocale) {
throw new Error(`Failed to load pseudolocale module`);
}
Object.assign(pseudolocale.option, options);
// `pseudolocale.str` captures `pseudolocale` in its closure and refers to `pseudolocale.option`.
return pseudolocale.str;
}
``` | /content/code_sandbox/libraries/localization-utilities/src/Pseudolocalization.ts | xml | 2016-09-30T00:28:20 | 2024-08-16T18:54:35 | rushstack | microsoft/rushstack | 5,790 | 294 |
```xml
import React, { useCallback, useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import Attachment from '@rsuite/icons/legacy/Attachment';
import Reload from '@rsuite/icons/Reload';
import { oneOf } from '@/internals/propTypes';
import { useClassNames } from '@/internals/hooks';
import { previewFile } from './utils/previewFile';
import { FileType } from './Uploader';
import { UploaderLocale } from '../locales';
import CloseButton from '@/internals/CloseButton';
import { WithAsProps } from '@/internals/types';
export interface UploadFileItemProps extends WithAsProps {
file: FileType;
listType?: 'text' | 'picture-text' | 'picture';
disabled?: boolean;
className?: string;
maxPreviewFileSize?: number;
classPrefix?: string;
removable?: boolean;
allowReupload?: boolean;
locale?: UploaderLocale;
renderFileInfo?: (file: FileType, fileElement: React.ReactNode) => React.ReactNode;
renderThumbnail?: (file: FileType, thumbnail: React.ReactNode) => React.ReactNode;
onCancel?: (fileKey: number | string, event: React.MouseEvent) => void;
onPreview?: (file: FileType, event: React.MouseEvent) => void;
onReupload?: (file: FileType, event: React.MouseEvent) => void;
}
/**
* Format display file size
* @param size
*/
export const formatSize = (size = 0): string => {
const K = 1024;
const M = 1024 * 1024;
const G = 1024 * 1024 * 1024;
if (size > G) {
return `${(size / G).toFixed(2)}GB`;
}
if (size > M) {
return `${(size / M).toFixed(2)}MB`;
}
if (size > K) {
return `${(size / K).toFixed(2)}KB`;
}
return `${size}B`;
};
const UploadFileItem = React.forwardRef<HTMLDivElement, UploadFileItemProps>((props, ref) => {
const {
as: Component = 'div',
disabled,
allowReupload = true,
file,
classPrefix = 'uploader-file-item',
listType = 'text',
className,
removable = true,
maxPreviewFileSize = 1024 * 1024 * 5, // 5MB
locale,
renderFileInfo,
renderThumbnail,
onPreview,
onCancel,
onReupload,
...rest
} = props;
const { merge, withClassPrefix, prefix } = useClassNames(classPrefix);
const classes = merge(
className,
withClassPrefix(listType, { disabled, 'has-error': file.status === 'error' })
);
const [previewImage, setPreviewImage] = useState(file.url ? file.url : null);
/**
* Get thumbnail of image file
*/
const getThumbnail = useCallback(
callback => {
if (!~['picture-text', 'picture'].indexOf(listType)) {
return;
}
// The thumbnail file size cannot be larger than the preset value.
if (!file.blobFile || file?.blobFile?.size > maxPreviewFileSize) {
return;
}
previewFile(file.blobFile, callback);
},
[file, listType, maxPreviewFileSize]
);
useEffect(() => {
if (!file.url) {
getThumbnail((previewImage: any) => {
setPreviewImage(previewImage);
});
}
}, [file.url, getThumbnail]);
const handlePreview = useCallback(
(event: React.MouseEvent) => {
if (disabled) {
return;
}
onPreview?.(file, event);
},
[disabled, file, onPreview]
);
const handleRemove = useCallback(
(event: React.MouseEvent) => {
if (disabled) {
return;
}
onCancel?.(file.fileKey as number | string, event);
},
[disabled, file.fileKey, onCancel]
);
const handleReupload = useCallback(
(event: React.MouseEvent<HTMLAnchorElement>) => {
if (disabled) {
return;
}
onReupload?.(file, event);
},
[disabled, file, onReupload]
);
/**
* Rendering progress bar
*/
const renderProgressBar = () => {
const { progress = 0, status } = file;
const show = !disabled && status === 'uploading';
const visibility = show ? 'visible' : 'hidden';
const wrapStyle: React.CSSProperties = {
visibility
};
const progressbarStyle = {
width: `${progress}%`
};
return (
<div className={prefix('progress')} style={wrapStyle}>
<div className={prefix('progress-bar')} style={progressbarStyle} />
</div>
);
};
const renderPreview = () => {
const thumbnail = previewImage ? (
<img
role="presentation"
src={previewImage}
alt={file.name}
onClick={handlePreview}
aria-label={`Preview: ${file.name}`}
/>
) : (
<Attachment className={prefix('icon')} />
);
return (
<div className={prefix('preview')}>
{renderThumbnail ? renderThumbnail(file, thumbnail) : thumbnail}
</div>
);
};
/**
* Render the loading state.
*/
const renderIcon = () => {
const uploading = file.status === 'uploading';
const classes = prefix('icon-wrapper', { 'icon-loading': uploading });
if (uploading) {
return (
<div className={classes}>
<i className={prefix('icon')} aria-label="Uploading" />
</div>
);
}
if (listType === 'picture' || listType === 'picture-text') {
return null;
}
return (
<div className={classes}>
<Attachment className={prefix('icon')} />
</div>
);
};
/**
* Render the remove file button.
*/
const renderRemoveButton = () => {
if (!removable) {
return null;
}
let closeLabel = 'Remove file';
if (locale?.removeFile) {
closeLabel = locale?.removeFile + (file?.name ? `: ${file?.name}` : '');
}
return (
<CloseButton
className={prefix('btn-remove')}
onClick={handleRemove}
tabIndex={-1}
locale={{ closeLabel }}
aria-hidden={disabled}
/>
);
};
/**
* Render error messages.
*/
const renderErrorStatus = () => {
if (file.status === 'error') {
return (
<div className={prefix('status')}>
{<span>{locale?.error}</span>}
{allowReupload && (
<a role="button" tabIndex={-1} onClick={handleReupload} aria-label="Retry">
<Reload className={prefix('icon-reupload')} />
</a>
)}
</div>
);
}
return null;
};
/**
* Render file size.
*/
const renderFileSize = () => {
if (file.status !== 'error' && file.blobFile) {
return <span className={prefix('size')}>{formatSize(file?.blobFile?.size)}</span>;
}
return null;
};
/**
* Render file panel
*/
const renderFilePanel = () => {
const fileElement = (
<div
className={prefix('title')}
tabIndex={-1}
onClick={handlePreview}
aria-label={`Preview: ${file.name}`}
>
{file.name}
</div>
);
return (
<div className={prefix('panel')}>
<div className={prefix('content')}>
{renderFileInfo ? renderFileInfo(file, fileElement) : fileElement}
{renderErrorStatus()}
{renderFileSize()}
</div>
</div>
);
};
if (listType === 'picture') {
return (
<Component {...rest} ref={ref} className={classes}>
{renderIcon()}
{renderPreview()}
{renderErrorStatus()}
{renderRemoveButton()}
</Component>
);
}
if (listType === 'picture-text') {
return (
<Component {...rest} ref={ref} className={classes}>
{renderIcon()}
{renderPreview()}
{renderFilePanel()}
{renderProgressBar()}
{renderRemoveButton()}
</Component>
);
}
return (
<Component {...rest} ref={ref} className={classes}>
{renderIcon()}
{renderFilePanel()}
{renderProgressBar()}
{renderRemoveButton()}
</Component>
);
});
UploadFileItem.displayName = 'UploadFileItem';
UploadFileItem.propTypes = {
locale: PropTypes.any,
file: PropTypes.object.isRequired,
listType: oneOf(['text', 'picture-text', 'picture'] as const),
disabled: PropTypes.bool,
className: PropTypes.string,
maxPreviewFileSize: PropTypes.number,
classPrefix: PropTypes.string,
removable: PropTypes.bool,
allowReupload: PropTypes.bool,
renderFileInfo: PropTypes.func,
renderThumbnail: PropTypes.func,
onCancel: PropTypes.func,
onPreview: PropTypes.func,
onReupload: PropTypes.func
};
export default UploadFileItem;
``` | /content/code_sandbox/src/Uploader/UploadFileItem.tsx | xml | 2016-06-06T02:27:46 | 2024-08-16T16:41:54 | rsuite | rsuite/rsuite | 8,263 | 2,031 |
```xml
import type { ReactNode } from 'react';
import React, { useState } from 'react';
import { IconButton, TooltipLinkList, WithTooltip } from 'storybook/internal/components';
import { Global, styled } from 'storybook/internal/theming';
import { AccessibilityIcon } from '@storybook/icons';
import { Filters } from './ColorFilters';
const iframeId = 'storybook-preview-iframe';
interface Option {
name: string;
percentage?: number;
}
export const baseList = [
{ name: 'blurred vision', percentage: 22.9 },
{ name: 'deuteranomaly', percentage: 2.7 },
{ name: 'deuteranopia', percentage: 0.56 },
{ name: 'protanomaly', percentage: 0.66 },
{ name: 'protanopia', percentage: 0.59 },
{ name: 'tritanomaly', percentage: 0.01 },
{ name: 'tritanopia', percentage: 0.016 },
{ name: 'achromatopsia', percentage: 0.0001 },
{ name: 'grayscale' },
] as Option[];
type Filter = Option | null;
const getFilter = (filterName: string) => {
if (!filterName) {
return 'none';
}
if (filterName === 'blurred vision') {
return 'blur(2px)';
}
if (filterName === 'grayscale') {
return 'grayscale(100%)';
}
return `url('#${filterName}')`;
};
const Hidden = styled.div(() => ({
'&, & svg': {
position: 'absolute',
width: 0,
height: 0,
},
}));
const ColorIcon = styled.span<{ filter: string }>(
{
background: 'linear-gradient(to right, #F44336, #FF9800, #FFEB3B, #8BC34A, #2196F3, #9C27B0)',
borderRadius: '1rem',
display: 'block',
height: '1rem',
width: '1rem',
},
({ filter }) => ({
filter: getFilter(filter),
}),
({ theme }) => ({
boxShadow: `${theme.appBorderColor} 0 0 0 1px inset`,
})
);
export interface Link {
id: string;
title: ReactNode;
right?: ReactNode;
active: boolean;
onClick: () => void;
}
const Column = styled.span({
display: 'flex',
flexDirection: 'column',
});
const Title = styled.span({
textTransform: 'capitalize',
});
const Description = styled.span(({ theme }) => ({
fontSize: 11,
color: theme.textMutedColor,
}));
const getColorList = (active: Filter, set: (i: Filter) => void): Link[] => [
...(active !== null
? [
{
id: 'reset',
title: 'Reset color filter',
onClick: () => {
set(null);
},
right: undefined,
active: false,
},
]
: []),
...baseList.map((i) => {
const description = i.percentage !== undefined ? `${i.percentage}% of users` : undefined;
return {
id: i.name,
title: (
<Column>
<Title>{i.name}</Title>
{description && <Description>{description}</Description>}
</Column>
),
onClick: () => {
set(i);
},
right: <ColorIcon filter={i.name} />,
active: active === i,
};
}),
];
export const VisionSimulator = () => {
const [filter, setFilter] = useState<Filter>(null);
return (
<>
{filter && (
<Global
styles={{
[`#${iframeId}`]: {
filter: getFilter(filter.name),
},
}}
/>
)}
<WithTooltip
placement="top"
tooltip={({ onHide }) => {
const colorList = getColorList(filter, (i) => {
setFilter(i);
onHide();
});
return <TooltipLinkList links={colorList} />;
}}
closeOnOutsideClick
onDoubleClick={() => setFilter(null)}
>
<IconButton key="filter" active={!!filter} title="Vision simulator">
<AccessibilityIcon />
</IconButton>
</WithTooltip>
<Hidden>
<Filters />
</Hidden>
</>
);
};
``` | /content/code_sandbox/code/addons/a11y/src/components/VisionSimulator.tsx | xml | 2016-03-18T04:23:44 | 2024-08-16T19:22:08 | storybook | storybookjs/storybook | 83,755 | 965 |
```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.
*/
// TypeScript Version: 4.1
/// <reference types="@stdlib/types"/>
import { Collection } from '@stdlib/types/array';
/**
* Converts a strided array to a non-strided generic array.
*
* ## Notes
*
* - The function assumes that the input array is compatible with the specified number of elements, index stride, and index offset.
*
* @param N - number of indexed elements
* @param x - input array
* @param stride - index stride
* @param offset - index of the first indexed value in the input array
* @returns two-dimensional nested array
*
* @example
* var x = [ 1, 2, 3, 4, 5, 6 ];
*
* var arr = strided2array( 3, x, 2, 0 );
* // returns [ 1, 3, 5 ]
*/
declare function strided2array<T = unknown, U = T>( N: number, x: Collection<T>, stride: number, offset: number ): Array<U>;
// EXPORTS //
export = strided2array;
``` | /content/code_sandbox/lib/node_modules/@stdlib/array/base/from-strided/docs/types/index.d.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 284 |
```xml
import { Box, keyframes, SxProps, Theme } from "@mui/material";
import React from "react";
import {
RiCheckboxCircleFill,
RiCloseCircleFill,
RiLoader4Line,
RiStopCircleFill,
} from "react-icons/ri";
import { StatusChip } from "../components/StatusChip";
import { JobStatus, UnifiedJob } from "../type/job";
import { ClassNameProps } from "./props";
const spinner = keyframes`
from {
transform: rotate(0deg)
},
to {
transform: rotate(360deg)
}`;
type JobRunningIconProps = {
title?: string;
small?: boolean;
sx?: SxProps<Theme>;
} & ClassNameProps;
export const JobRunningIcon = ({
className,
title,
small = false,
sx = [],
...props
}: JobRunningIconProps) => {
return (
<Box
component={RiLoader4Line}
sx={[
{
width: small ? 16 : 20,
height: small ? 16 : 20,
color: "#1E88E5",
animation: `${spinner} 1s linear infinite`,
},
...(Array.isArray(sx) ? sx : [sx]),
]}
title={title}
{...props}
/>
);
};
type JobStatusIconProps = {
job: UnifiedJob;
small?: boolean;
sx?: SxProps<Theme>;
} & ClassNameProps;
export const JobStatusIcon = ({
job,
small = false,
className,
sx,
}: JobStatusIconProps) => {
switch (job.status) {
case JobStatus.SUCCEEDED:
return (
<Box
component={RiCheckboxCircleFill}
className={className}
sx={[
{
width: small ? 16 : 20,
height: small ? 16 : 20,
color: (theme) => theme.palette.success.main,
},
...(Array.isArray(sx) ? sx : [sx]),
]}
/>
);
case JobStatus.FAILED:
return (
<Box
component={RiCloseCircleFill}
className={className}
sx={[
{
width: small ? 16 : 20,
height: small ? 16 : 20,
color: (theme) => theme.palette.error.main,
},
...(Array.isArray(sx) ? sx : [sx]),
]}
/>
);
case JobStatus.STOPPED:
return (
<Box
component={RiStopCircleFill}
className={className}
sx={[
{
width: small ? 16 : 20,
height: small ? 16 : 20,
color: "#757575",
},
...(Array.isArray(sx) ? sx : [sx]),
]}
/>
);
default:
return <JobRunningIcon className={className} sx={sx} small={small} />;
}
};
type JobStatusWithIconProps = {
job: UnifiedJob;
};
export const JobStatusWithIcon = ({ job }: JobStatusWithIconProps) => {
return (
<Box display="inline-flex" alignItems="center">
<StatusChip
type="job"
status={job.status}
icon={job.status === JobStatus.RUNNING && <JobRunningIcon />}
/>
</Box>
);
};
``` | /content/code_sandbox/python/ray/dashboard/client/src/common/JobStatus.tsx | xml | 2016-10-25T19:38:30 | 2024-08-16T19:46:34 | ray | ray-project/ray | 32,670 | 725 |
```xml
<vector xmlns:android="path_to_url"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M16.59,8.59L12,13.17 7.41,8.59 6,10l6,6 6,-6z" />
</vector>
``` | /content/code_sandbox/app/src/main/res/drawable/ic_expand_more_black_24dp.xml | xml | 2016-04-16T22:20:07 | 2024-07-18T10:04:59 | StickyHeaders | ShamylZakariya/StickyHeaders | 1,404 | 105 |
```xml
/*
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
*/
type VariableFormValues = {
[key: string]: string;
} & {
newVariables?: {id: string; name: string; value: string}[];
};
export type {VariableFormValues};
``` | /content/code_sandbox/operate/client/src/modules/types/variables.ts | xml | 2016-03-20T03:38:04 | 2024-08-16T19:59:58 | camunda | camunda/camunda | 3,172 | 71 |
```xml
/// <reference types="node" />
import * as Cache from './Cache';
import { compositeImagesAsync, generateFaviconAsync, generateImageAsync, getPngInfo } from './Image';
import { ImageFormat, ImageOptions, ResizeMode } from './Image.types';
import { jimpAsync, createSquareAsync } from './jimp';
import { findSharpInstanceAsync, isAvailableAsync, sharpAsync } from './sharp';
import { SharpCommandOptions, SharpGlobalOptions } from './sharp.types';
export declare function imageAsync(options: SharpGlobalOptions, commands?: SharpCommandOptions[]): Promise<Buffer | string[]>;
export { jimpAsync, createSquareAsync, findSharpInstanceAsync, isAvailableAsync, sharpAsync, generateImageAsync, generateFaviconAsync, Cache, compositeImagesAsync, getPngInfo, };
export { SharpGlobalOptions, SharpCommandOptions, ResizeMode, ImageFormat, ImageOptions };
``` | /content/code_sandbox/packages/@expo/image-utils/build/index.d.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 189 |
```xml
import { usePanGestureHandler, useValue, timing } from 'react-native-redash';
import { useMemo } from 'react';
import Reanimated, {
Extrapolate,
useCode,
cond,
eq,
set,
Easing,
greaterOrEq,
call,
} from 'react-native-reanimated';
import { State } from 'react-native-gesture-handler';
import { Dimensions } from 'react-native';
const SCREEN_HEIGHT = Dimensions.get('window').height;
export type GestureHandlerType = {
onHandlerStateChange: (...args: unknown[]) => void;
onGestureEvent: (...args: unknown[]) => void;
};
export interface DismissGestureState {
gestureHandler: GestureHandlerType;
dismissAnimationProgress: Reanimated.Value<number>;
controlsOpacity: Reanimated.Value<number>;
cardBorderRadius: Reanimated.Node<number>;
viewScale: Reanimated.Node<number>;
}
/**
* Use a drag-down-to-dismiss gesture powered by native animations (Reanimated)
* @param navigateBack The callback to invoke when the view has been dragged down and needs to navigate back to the last screen.
* @returns An object of animation states (and the gesture handler which needs to be attached to the <PanGestureHandler> component)
*/
export default function useDismissGesture(navigateBack: () => void): DismissGestureState {
// TODO: Maybe experiment with some translateX?
const gestureHandler = usePanGestureHandler();
const dismissAnimationProgress = useValue(0); // Animation from 0 -> 1, where 1 is dismiss.
const controlsOpacity = useValue(0); // Extra opacity setting for controls to interactively fade out on drag down
const enableGesture = useValue<0 | 1>(1); // Overrides gestureHandler.state to not trigger State.END cond() block when already released and navigating back
const cardBorderRadius = useMemo(() => {
return Reanimated.interpolateNode(dismissAnimationProgress, {
inputRange: [0, 1],
outputRange: [0, 30],
extrapolate: Extrapolate.CLAMP,
});
}, [dismissAnimationProgress]);
const viewScale = useMemo(() => {
return Reanimated.interpolateNode(dismissAnimationProgress, {
inputRange: [0, 1],
outputRange: [1, 0.8],
extrapolate: Extrapolate.CLAMP,
});
}, [dismissAnimationProgress]);
useCode(
() => [
cond(eq(enableGesture, 1), [
cond(eq(gestureHandler.state, State.ACTIVE), [
set(
dismissAnimationProgress,
Reanimated.interpolateNode(gestureHandler.translation.y, {
inputRange: [0, SCREEN_HEIGHT * 0.2],
outputRange: [0, 1],
})
),
set(
controlsOpacity,
Reanimated.interpolateNode(gestureHandler.translation.y, {
inputRange: [0, SCREEN_HEIGHT * 0.1, SCREEN_HEIGHT * 0.2],
outputRange: [1, 0, 0],
})
),
]),
cond(eq(gestureHandler.state, State.END), [
set(
dismissAnimationProgress,
timing({
from: dismissAnimationProgress,
to: 0,
duration: 200,
easing: Easing.out(Easing.ease),
})
),
set(
controlsOpacity,
timing({ from: controlsOpacity, to: 1, duration: 200, easing: Easing.linear })
),
]),
]),
cond(greaterOrEq(dismissAnimationProgress, 1), [
set(enableGesture, 0),
call([], navigateBack),
]),
],
[
controlsOpacity,
dismissAnimationProgress,
enableGesture,
gestureHandler.state,
gestureHandler.translation.y,
navigateBack,
]
);
return {
gestureHandler: gestureHandler.gestureHandler,
dismissAnimationProgress,
controlsOpacity,
cardBorderRadius,
viewScale,
};
}
``` | /content/code_sandbox/playground/src/screens/sharedElementCarDealer/useDismissGesture.ts | xml | 2016-03-11T11:22:54 | 2024-08-15T09:05:44 | react-native-navigation | wix/react-native-navigation | 13,021 | 847 |
```xml
/*
*
* This source code is licensed under the MIT license which is detailed in the LICENSE.txt file.
*/
import { TripleKeyMap } from "./TripleKeyMap.js";
const TEST_ITEMS: Array<[Array<number>, string]> = [
[[1, 4, 3], "1st value"],
[[1, 0, 1], "101 value"],
[[1, 0, 2], "102 value"],
[[2, 4, 5], "2nd value"],
];
function testData(): TripleKeyMap<number, number, number, string> {
const map3 = new TripleKeyMap<number, number, number, string>();
for (const kvPair of TEST_ITEMS) {
const key = kvPair[0];
map3.set(key[0], key[1], key[2], kvPair[1]);
}
return map3;
}
describe.each(TEST_ITEMS)("Insert/get cases", (key: number[], value: string) => {
test(`insert/get value ${value}`, done => {
const data = testData();
expect(data.get(key[0], key[1], key[2])).toBe(value);
done();
});
});
test(`get() on missing key return undefined`, done => {
const data = testData();
expect(data.get(0, 1, 3)).toBe(undefined);
done();
});
test(`delete $(value)`, done => {
const data = testData();
expect(data.get(2, 4, 5)).toBe("2nd value");
data.delete(2, 4, 5);
expect(data.get(2, 4, 5)).toBe(undefined);
done();
});
test(`values()`, done => {
const data = testData();
const valuesSet = new Set(data.values());
expect(valuesSet.has("1st value")).toBe(true);
expect(valuesSet.has("2nd value")).toBe(true);
done();
});
``` | /content/code_sandbox/packages/extraterm-data-structures/src/TripleKeyMap.jest.ts | xml | 2016-03-04T12:39:59 | 2024-08-16T18:44:37 | extraterm | sedwards2009/extraterm | 2,501 | 412 |
```xml
import { vec3, mat4, vec2, ReadonlyVec3 } from "gl-matrix";
import { SceneObjHolder, getObjectName, SceneObj, SpecialTextureType } from "../Main.js";
import { GfxDevice, GfxBuffer, GfxBufferUsage, GfxBufferFrequencyHint, GfxInputLayout, GfxFormat, GfxVertexAttributeDescriptor, GfxVertexBufferFrequency, GfxInputLayoutBufferDescriptor, GfxVertexBufferDescriptor, GfxIndexBufferDescriptor } from "../../gfx/platform/GfxPlatform.js";
import { ViewerRenderInput } from "../../viewer.js";
import { JMapInfoIter } from "../JMapInfo.js";
import { clamp } from "../../MathHelpers.js";
import AnimationController from "../../AnimationController.js";
import { colorFromRGBA8 } from "../../Color.js";
import { assert } from "../../util.js";
import { makeStaticDataBuffer } from "../../gfx/helpers/BufferHelpers.js";
import { getVertexInputLocation } from "../../gx/gx_material.js";
import * as GX from "../../gx/gx_enum.js";
import { GXMaterialHelperGfx } from "../../gx/gx_render.js";
import { MaterialParams, DrawParams, ColorKind } from "../../gx/gx_render.js";
import { GfxRenderInstManager, makeSortKey, GfxRendererLayer } from "../../gfx/render/GfxRenderInstManager.js";
import { DrawType, NameObj, MovementType } from "../NameObj.js";
import { LiveActor, ZoneAndLayer } from "../LiveActor.js";
import { GfxRenderCache } from "../../gfx/render/GfxRenderCache.js";
import { GXMaterialBuilder } from "../../gx/GXMaterialBuilder.js";
import { BTIData } from "../../Common/JSYSTEM/JUTTexture.js";
import { initDefaultPos, connectToScene, loadBTIData, loadTexProjectionMtx, setTextureMatrixST, isValidDraw, vecKillElement, calcActorAxis } from "../ActorUtil.js";
import { VertexAttributeInput } from "../../gx/gx_displaylist.js";
import { isCameraInWater, WaterAreaHolder, WaterInfo } from "../MiscMap.js";
function calcHeightStatic(wave1Time: number, wave2Time: number, x: number, z: number): number {
const wave1 = 40 * Math.sin(wave1Time + 0.003 * z);
const wave2 = 30 * Math.sin(wave2Time + 0.003 * x + 0.003 * z);
return wave1 + wave2;
}
class OceanBowlPoint {
public drawPosition: vec3 = vec3.create();
public gridPosition: vec3 = vec3.create();
public heightScale: number = 1.0;
public updatePos(wave1Time: number, wave2Time: number): void {
const height = this.heightScale * calcHeightStatic(wave1Time, wave2Time, this.gridPosition[0], this.gridPosition[2]);
// The original code is written really bizarrely but it seems to boil down to this.
vec3.copy(this.drawPosition, this.gridPosition);
this.drawPosition[1] += height;
}
}
class OceanBowlBloomDrawer extends NameObj {
constructor(sceneObjHolder: SceneObjHolder, private bowl: OceanBowl) {
super(sceneObjHolder, 'OceanBowlBloomDrawer');
connectToScene(sceneObjHolder, this, -1, -1, -1, DrawType.OceanBowlBloomDrawer);
}
public override draw(sceneObjHolder: SceneObjHolder, renderInstManager: GfxRenderInstManager, viewerInput: ViewerRenderInput): void {
super.draw(sceneObjHolder, renderInstManager, viewerInput);
if (!isValidDraw(this.bowl))
return;
if (!isCameraInWater(sceneObjHolder))
return;
this.bowl.drawBloom(sceneObjHolder, renderInstManager, viewerInput);
}
}
const scratchVec3 = vec3.create();
const materialParams = new MaterialParams();
const drawParams = new DrawParams();
export class OceanBowl extends LiveActor {
private points: OceanBowlPoint[] = [];
private animationController = new AnimationController(60);
private water: BTIData;
private waterIndirect: BTIData;
private mask: BTIData;
private positionBuffer: GfxBuffer;
private positionDataF32: Float32Array;
private positionDataU8: Uint8Array;
private colorBuffer: GfxBuffer;
private indexBuffer: GfxBuffer;
private texCoord0Buffer: GfxBuffer;
private indexCount: number;
private inputLayout: GfxInputLayout;
private vertexBufferDescriptors: GfxVertexBufferDescriptor[];
private indexBufferDescriptor: GfxIndexBufferDescriptor;
private materialHelper: GXMaterialHelperGfx;
private materialHelperBloom: GXMaterialHelperGfx;
private gridAxisPointCount: number;
private gridSpacing: number;
private tex0Trans = vec2.create();
private tex1Trans = vec2.create();
private tex2Trans = vec2.create();
private tex4Scale = 0.04;
private axisX = vec3.create();
private axisY = vec3.create();
private axisZ = vec3.create();
private bloomDrawer: OceanBowlBloomDrawer;
constructor(zoneAndLayer: ZoneAndLayer, sceneObjHolder: SceneObjHolder, infoIter: JMapInfoIter) {
super(zoneAndLayer, sceneObjHolder, getObjectName(infoIter));
connectToScene(sceneObjHolder, this, MovementType.MapObj, -1, -1, DrawType.OceanBowl);
initDefaultPos(sceneObjHolder, this, infoIter);
calcActorAxis(this.axisX, this.axisY, this.axisZ, this);
const device = sceneObjHolder.modelCache.device;
const cache = sceneObjHolder.modelCache.cache;
this.initPoints(device, cache);
const waterWaveArc = sceneObjHolder.modelCache.getObjectData('WaterWave')!;
this.water = loadBTIData(sceneObjHolder, waterWaveArc, `Water.bti`);
this.waterIndirect = loadBTIData(sceneObjHolder, waterWaveArc, `WaterIndirect.bti`);
this.mask = loadBTIData(sceneObjHolder, waterWaveArc, `Mask.bti`);
sceneObjHolder.create(SceneObj.WaterAreaHolder);
sceneObjHolder.waterAreaHolder!.entryOceanBowl(this);
this.bloomDrawer = new OceanBowlBloomDrawer(sceneObjHolder, this);
}
public calcWaterInfo(dst: WaterInfo, pos: ReadonlyVec3, gravity: ReadonlyVec3): void {
vec3.sub(scratchVec3, pos, this.translation);
dst.depth = -vecKillElement(scratchVec3, scratchVec3, this.axisY);
}
public isInWater(v: ReadonlyVec3): boolean {
vec3.sub(scratchVec3, v, this.translation);
const mag = vec3.squaredLength(scratchVec3);
const radius = this.scale[0] * 100;
const radiusSq = radius * radius;
if (mag < radiusSq) {
const dot = vec3.dot(scratchVec3, this.axisY);
if (dot < 0.0)
return true;
}
return false;
}
private initPoints(device: GfxDevice, cache: GfxRenderCache): void {
// The original code uses a grid of 25x25 surrounding the player camera, spaced 200 units apart.
// We use a grid big enough to cover scaleX * 100 units.
const gridRadius = Math.ceil(this.scale[0]) * 100;
const gridSpacing = 200;
const gridAxisPointCount = gridRadius * 2 / gridSpacing;
this.gridSpacing = gridSpacing;
this.gridAxisPointCount = gridAxisPointCount;
for (let z = 0; z < gridAxisPointCount; z++) {
for (let x = 0; x < gridAxisPointCount; x++) {
// Center inside the grid.
const scaleX = gridSpacing / 2 + ((gridSpacing * x) - gridAxisPointCount * gridSpacing / 2);
const scaleZ = gridSpacing / 2 + ((gridSpacing * z) - gridAxisPointCount * gridSpacing / 2);
const point = new OceanBowlPoint();
vec3.copy(point.gridPosition, this.translation);
vec3.scaleAndAdd(point.gridPosition, point.gridPosition, this.axisX, scaleX);
vec3.scaleAndAdd(point.gridPosition, point.gridPosition, this.axisZ, scaleZ);
const dist = clamp((gridRadius - vec3.distance(point.gridPosition, this.translation)) / 500, 0, 1);
point.heightScale = dist;
this.points.push(point);
}
}
const pointCount = this.points.length;
this.positionBuffer = device.createBuffer(pointCount * 3, GfxBufferUsage.Vertex, GfxBufferFrequencyHint.Dynamic);
this.positionDataF32 = new Float32Array(pointCount * 3);
this.positionDataU8 = new Uint8Array(this.positionDataF32.buffer);
const colorData = new Uint8Array(pointCount * 4);
let colorIdx = 0;
for (let i = 0; i < this.points.length; i++) {
colorData[colorIdx++] = 0xFF;
colorData[colorIdx++] = 0xFF;
colorData[colorIdx++] = 0xFF;
colorData[colorIdx++] = this.points[i].heightScale * 0xFF;
}
this.colorBuffer = makeStaticDataBuffer(device, GfxBufferUsage.Vertex, colorData.buffer);
// Texture coordinate buffer
const texCoordData = new Int16Array(this.points.length * 2);
let texCoordIdx = 0;
for (let z = 0; z < gridAxisPointCount; z++) {
for (let x = 0; x < gridAxisPointCount; x++) {
texCoordData[texCoordIdx++] = (z / (gridAxisPointCount - 1)) * 0x7FFF;
texCoordData[texCoordIdx++] = (x / (gridAxisPointCount - 1)) * 0x7FFF;
}
}
this.texCoord0Buffer = makeStaticDataBuffer(device, GfxBufferUsage.Vertex, texCoordData.buffer);
assert(texCoordIdx === texCoordData.length);
// Create the index buffer. We have (N-1)*(N-1) quads, N being gridAxisPointCount, and we have 6 indices per quad...
const indexBufferCount = (gridAxisPointCount - 1) * (gridAxisPointCount - 1) * 6;
this.indexCount = indexBufferCount;
const indexData = new Uint16Array(indexBufferCount);
let indexIdx = 0;
for (let z = 1; z < gridAxisPointCount; z++) {
for (let x = 1; x < gridAxisPointCount; x++) {
const x1 = x - 1, x2 = x;
const z1 = z - 1, z2 = z;
// Now get the indexes of the four points.
const i0 = z1*gridAxisPointCount + x1;
const i1 = z2*gridAxisPointCount + x1;
const i2 = z1*gridAxisPointCount + x2;
const i3 = z2*gridAxisPointCount + x2;
indexData[indexIdx++] = i0;
indexData[indexIdx++] = i1;
indexData[indexIdx++] = i2;
indexData[indexIdx++] = i2;
indexData[indexIdx++] = i1;
indexData[indexIdx++] = i3;
}
}
assert(indexIdx === indexBufferCount);
this.indexBuffer = makeStaticDataBuffer(device, GfxBufferUsage.Index, indexData.buffer);
const vertexAttributeDescriptors: GfxVertexAttributeDescriptor[] = [
{ location: getVertexInputLocation(VertexAttributeInput.POS), format: GfxFormat.F32_RGB, bufferIndex: 0, bufferByteOffset: 0, },
{ location: getVertexInputLocation(VertexAttributeInput.CLR0), format: GfxFormat.U8_RGBA_NORM, bufferIndex: 1, bufferByteOffset: 0, },
{ location: getVertexInputLocation(VertexAttributeInput.TEX01), format: GfxFormat.S16_RG_NORM, bufferIndex: 2, bufferByteOffset: 0, },
];
const vertexBufferDescriptors: GfxInputLayoutBufferDescriptor[] = [
{ byteStride: 4*3, frequency: GfxVertexBufferFrequency.PerVertex, },
{ byteStride: 4, frequency: GfxVertexBufferFrequency.PerVertex, },
{ byteStride: 4, frequency: GfxVertexBufferFrequency.PerVertex, },
];
this.inputLayout = cache.createInputLayout({
indexBufferFormat: GfxFormat.U16_R,
vertexAttributeDescriptors,
vertexBufferDescriptors,
});
this.vertexBufferDescriptors = [
{ buffer: this.positionBuffer, byteOffset: 0, },
{ buffer: this.colorBuffer, byteOffset: 0, },
{ buffer: this.texCoord0Buffer, byteOffset: 0, },
];
this.indexBufferDescriptor = { buffer: this.indexBuffer, byteOffset: 0 };
// Material.
let mb: GXMaterialBuilder;
mb = new GXMaterialBuilder('OceanBowl');
mb.setChanCtrl(GX.ColorChannelID.COLOR0A0, false, GX.ColorSrc.VTX, GX.ColorSrc.VTX, 0, GX.DiffuseFunction.NONE, GX.AttenuationFunction.NONE);
mb.setTexCoordGen(GX.TexCoordID.TEXCOORD0, GX.TexGenType.MTX2x4, GX.TexGenSrc.TEX0, GX.TexGenMatrix.TEXMTX0);
mb.setTexCoordGen(GX.TexCoordID.TEXCOORD1, GX.TexGenType.MTX2x4, GX.TexGenSrc.TEX0, GX.TexGenMatrix.TEXMTX1);
mb.setTexCoordGen(GX.TexCoordID.TEXCOORD2, GX.TexGenType.MTX2x4, GX.TexGenSrc.TEX0, GX.TexGenMatrix.TEXMTX2);
mb.setTexCoordGen(GX.TexCoordID.TEXCOORD3, GX.TexGenType.MTX3x4, GX.TexGenSrc.POS, GX.TexGenMatrix.TEXMTX3);
mb.setTexCoordGen(GX.TexCoordID.TEXCOORD4, GX.TexGenType.MTX2x4, GX.TexGenSrc.TEX0, GX.TexGenMatrix.TEXMTX4, true);
mb.setTevOrder(0, GX.TexCoordID.TEXCOORD0, GX.TexMapID.TEXMAP0, GX.RasColorChannelID.COLOR_ZERO);
mb.setTevColorIn(0, GX.CC.TEXC, GX.CC.ZERO, GX.CC.ZERO, GX.CC.ZERO);
mb.setTevColorOp(0, GX.TevOp.ADD, GX.TevBias.ZERO, GX.TevScale.SCALE_1, false, GX.Register.PREV);
mb.setTevAlphaIn(0, GX.CA.TEXA, GX.CA.ZERO, GX.CA.ZERO, GX.CA.ZERO);
mb.setTevAlphaOp(0, GX.TevOp.ADD, GX.TevBias.ZERO, GX.TevScale.SCALE_1, false, GX.Register.PREV);
mb.setTevOrder(1, GX.TexCoordID.TEXCOORD1, GX.TexMapID.TEXMAP0, GX.RasColorChannelID.COLOR_ZERO);
mb.setTevColorIn(1, GX.CC.ZERO, GX.CC.TEXC, GX.CC.CPREV, GX.CC.ZERO);
mb.setTevColorOp(1, GX.TevOp.ADD, GX.TevBias.ZERO, GX.TevScale.DIVIDE_2, false, GX.Register.PREV);
mb.setTevAlphaIn(1, GX.CA.ZERO, GX.CA.TEXA, GX.CA.APREV, GX.CA.ZERO);
mb.setTevAlphaOp(1, GX.TevOp.ADD, GX.TevBias.ZERO, GX.TevScale.SCALE_2, false, GX.Register.PREV);
mb.setTevOrder(2, GX.TexCoordID.TEXCOORD4, GX.TexMapID.TEXMAP3, GX.RasColorChannelID.COLOR0A0);
mb.setTevColorIn(2, GX.CC.CPREV, GX.CC.A0, GX.CC.C0, GX.CC.CPREV);
mb.setTevColorOp(2, GX.TevOp.COMP_R8_EQ, GX.TevBias.ZERO, GX.TevScale.SCALE_1, false, GX.Register.PREV);
mb.setTevAlphaIn(2, GX.CA.ZERO, GX.CA.RASA, GX.CA.TEXA, GX.CA.ZERO);
mb.setTevAlphaOp(2, GX.TevOp.ADD, GX.TevBias.ZERO, GX.TevScale.SCALE_1, false, GX.Register.PREV);
mb.setTevOrder(3, GX.TexCoordID.TEXCOORD3, GX.TexMapID.TEXMAP1, GX.RasColorChannelID.COLOR_ZERO);
mb.setTevColorIn(3, GX.CC.ZERO, GX.CC.TEXC, GX.CC.C1, GX.CC.CPREV);
mb.setTevColorOp(3, GX.TevOp.ADD, GX.TevBias.ZERO, GX.TevScale.SCALE_1, true, GX.Register.PREV);
mb.setTevAlphaIn(3, GX.CA.APREV, GX.CA.ZERO, GX.CA.ZERO, GX.CA.ZERO);
mb.setTevAlphaOp(3, GX.TevOp.ADD, GX.TevBias.ZERO, GX.TevScale.SCALE_1, false, GX.Register.PREV);
mb.setIndTexOrder(GX.IndTexStageID.STAGE0, GX.TexCoordID.TEXCOORD2, GX.TexMapID.TEXMAP2);
mb.setTevIndWarp(3, GX.IndTexStageID.STAGE0, true, false, GX.IndTexMtxID._0);
mb.setBlendMode(GX.BlendMode.BLEND, GX.BlendFactor.SRCALPHA, GX.BlendFactor.INVSRCALPHA);
mb.setZMode(true, GX.CompareType.LEQUAL, false);
mb.setUsePnMtxIdx(false);
this.materialHelper = new GXMaterialHelperGfx(mb.finish());
// Material.
mb = new GXMaterialBuilder('OceanBowlBloomDrawer');
mb.setChanCtrl(GX.ColorChannelID.COLOR0A0, false, GX.ColorSrc.VTX, GX.ColorSrc.VTX, 0, GX.DiffuseFunction.NONE, GX.AttenuationFunction.NONE);
mb.setTexCoordGen(GX.TexCoordID.TEXCOORD0, GX.TexGenType.MTX2x4, GX.TexGenSrc.TEX0, GX.TexGenMatrix.TEXMTX0);
mb.setTexCoordGen(GX.TexCoordID.TEXCOORD1, GX.TexGenType.MTX2x4, GX.TexGenSrc.TEX0, GX.TexGenMatrix.TEXMTX1);
mb.setTevOrder(0, GX.TexCoordID.TEXCOORD0, GX.TexMapID.TEXMAP0, GX.RasColorChannelID.COLOR0A0);
mb.setTevColorIn(0, GX.CC.ZERO, GX.CC.TEXC, GX.CC.C0, GX.CC.C1);
mb.setTevColorOp(0, GX.TevOp.ADD, GX.TevBias.ZERO, GX.TevScale.SCALE_1, true, GX.Register.PREV);
mb.setTevAlphaIn(0, GX.CA.ZERO, GX.CA.TEXA, GX.CA.RASA, GX.CA.ZERO);
mb.setTevAlphaOp(0, GX.TevOp.ADD, GX.TevBias.ZERO, GX.TevScale.SCALE_1, true, GX.Register.PREV);
mb.setTevOrder(1, GX.TexCoordID.TEXCOORD1, GX.TexMapID.TEXMAP0, GX.RasColorChannelID.COLOR0A0);
mb.setTevColorIn(1, GX.CC.ZERO, GX.CC.TEXC, GX.CC.C0, GX.CC.CPREV);
mb.setTevColorOp(1, GX.TevOp.ADD, GX.TevBias.ZERO, GX.TevScale.SCALE_1, true, GX.Register.PREV);
mb.setTevAlphaIn(1, GX.CA.ZERO, GX.CA.TEXA, GX.CA.RASA, GX.CA.APREV);
mb.setTevAlphaOp(1, GX.TevOp.ADD, GX.TevBias.ZERO, GX.TevScale.SCALE_2, true, GX.Register.PREV);
mb.setBlendMode(GX.BlendMode.BLEND, GX.BlendFactor.SRCALPHA, GX.BlendFactor.INVSRCALPHA);
mb.setZMode(true, GX.CompareType.LEQUAL, true);
mb.setUsePnMtxIdx(false);
this.materialHelperBloom = new GXMaterialHelperGfx(mb.finish());
}
public override movement(sceneObjHolder: SceneObjHolder): void {
// Every frame, we add -0.04 onto the counter.
this.animationController.setTimeFromViewerInput(sceneObjHolder.viewerInput);
const time = this.animationController.getTimeInFrames();
const posTime = time * -0.04;
for (let i = 0; i < this.points.length; i++)
this.points[i].updatePos(posTime, posTime);
this.tex0Trans[0] = (1.0 + time * -0.0008) % 1.0;
this.tex0Trans[1] = (1.0 + time * -0.0008) % 1.0;
this.tex1Trans[0] = (1.0 + time * -0.001) % 1.0;
this.tex1Trans[1] = (1.0 + time * 0.0008) % 1.0;
this.tex2Trans[0] = (1.0 + time * -0.003) % 1.0;
this.tex2Trans[1] = (1.0 + time * -0.001) % 1.0;
}
public override draw(sceneObjHolder: SceneObjHolder, renderInstManager: GfxRenderInstManager, viewerInput: ViewerRenderInput): void {
super.draw(sceneObjHolder, renderInstManager, viewerInput);
if (!isValidDraw(this))
return;
const device = sceneObjHolder.modelCache.device;
const cache = sceneObjHolder.modelCache.cache;
for (let i = 0; i < this.points.length; i++) {
const p = this.points[i];
let offs = i * 3;
this.positionDataF32[offs++] = p.drawPosition[0];
this.positionDataF32[offs++] = p.drawPosition[1];
this.positionDataF32[offs++] = p.drawPosition[2];
}
device.uploadBufferData(this.positionBuffer, 0, this.positionDataU8);
// Fill in our material params.
this.water.fillTextureMapping(materialParams.m_TextureMapping[0]);
sceneObjHolder.specialTextureBinder.registerTextureMapping(materialParams.m_TextureMapping[1], SpecialTextureType.OpaqueSceneTexture);
this.waterIndirect.fillTextureMapping(materialParams.m_TextureMapping[2]);
this.mask.fillTextureMapping(materialParams.m_TextureMapping[3]);
colorFromRGBA8(materialParams.u_Color[ColorKind.C0], 0x28282814);
colorFromRGBA8(materialParams.u_Color[ColorKind.C1], 0xC8E6D2FF);
// The original code set up texture coordinate buffers that increased by 0.05 for every
// grid point. This mesh would be 25 grid points big -- so the 0th point had texture coordinate 0
// and the 24th point had 1.20. The math below will recreate the same mapping.
const scale0 = 0.05 * this.gridAxisPointCount;
const scale2 = 0.1 * this.gridAxisPointCount;
const scale4 = this.tex4Scale * this.gridAxisPointCount;
const camera = viewerInput.camera;
setTextureMatrixST(materialParams.u_TexMtx[0], scale0, this.tex0Trans);
setTextureMatrixST(materialParams.u_TexMtx[1], scale0, this.tex1Trans);
setTextureMatrixST(materialParams.u_TexMtx[2], scale2, this.tex2Trans);
loadTexProjectionMtx(materialParams.u_TexMtx[3], materialParams.m_TextureMapping[1], camera);
setTextureMatrixST(materialParams.u_IndTexMtx[0], 0.1, null);
setTextureMatrixST(materialParams.u_TexMtx[4], scale4, null);
// The original code centers around the player. We center around the camera.
const playerX = camera.worldMatrix[12];
const playerZ = camera.worldMatrix[14];
// The position of the point which has texture coordinate 0.
const zeroTexX = this.points[0].gridPosition[0];
const zeroTexZ = this.points[0].gridPosition[2];
const gridAxisSize = this.gridAxisPointCount * this.gridSpacing;
// Position the camera is along X/Z against the edges, but unclamped.
const normPosX = (playerX - zeroTexX) / gridAxisSize;
const normPosZ = (playerZ - zeroTexZ) / gridAxisSize;
// Place our texture centered in this scale.
materialParams.u_TexMtx[4][12] = (-normPosZ * scale4) + 0.5;
materialParams.u_TexMtx[4][13] = (-normPosX * scale4) + 0.5;
// Now create our draw instance.
const renderInst = renderInstManager.newRenderInst();
renderInst.setVertexInput(this.inputLayout, this.vertexBufferDescriptors, this.indexBufferDescriptor);
renderInst.setDrawCount(this.indexCount);
this.materialHelper.setOnRenderInst(cache, renderInst);
renderInst.sortKey = makeSortKey(GfxRendererLayer.TRANSLUCENT, this.materialHelper.programKey);
this.materialHelper.allocateMaterialParamsDataOnInst(renderInst, materialParams);
renderInst.setSamplerBindingsFromTextureMappings(materialParams.m_TextureMapping);
mat4.copy(drawParams.u_PosMtx[0], camera.viewMatrix);
this.materialHelper.allocateDrawParamsDataOnInst(renderInst, drawParams);
renderInstManager.submitRenderInst(renderInst);
}
public drawBloom(sceneObjHolder: SceneObjHolder, renderInstManager: GfxRenderInstManager, viewerInput: ViewerRenderInput): void {
const device = sceneObjHolder.modelCache.device;
const cache = sceneObjHolder.modelCache.cache;
// Fill in our material params.
this.water.fillTextureMapping(materialParams.m_TextureMapping[0]);
colorFromRGBA8(materialParams.u_Color[ColorKind.C0], 0x5F5F5FFF);
colorFromRGBA8(materialParams.u_Color[ColorKind.C1], 0x323232FF);
const scale0 = 0.05 * this.gridAxisPointCount;
const camera = viewerInput.camera;
setTextureMatrixST(materialParams.u_TexMtx[0], scale0, this.tex0Trans);
setTextureMatrixST(materialParams.u_TexMtx[1], scale0, this.tex1Trans);
const renderInst = renderInstManager.newRenderInst();
renderInst.setVertexInput(this.inputLayout, this.vertexBufferDescriptors, this.indexBufferDescriptor);
renderInst.setDrawCount(this.indexCount);
this.materialHelperBloom.setOnRenderInst(cache, renderInst);
renderInst.sortKey = makeSortKey(GfxRendererLayer.TRANSLUCENT, this.materialHelperBloom.programKey);
this.materialHelperBloom.allocateMaterialParamsDataOnInst(renderInst, materialParams);
renderInst.setSamplerBindingsFromTextureMappings(materialParams.m_TextureMapping);
mat4.copy(drawParams.u_PosMtx[0], camera.viewMatrix);
this.materialHelperBloom.allocateDrawParamsDataOnInst(renderInst, drawParams);
renderInstManager.submitRenderInst(renderInst);
}
public override destroy(device: GfxDevice): void {
this.water.destroy(device);
this.waterIndirect.destroy(device);
this.mask.destroy(device);
device.destroyBuffer(this.positionBuffer);
device.destroyBuffer(this.colorBuffer);
device.destroyBuffer(this.texCoord0Buffer);
device.destroyBuffer(this.indexBuffer);
}
public static override requestArchives(sceneObjHolder: SceneObjHolder, infoIter: JMapInfoIter): void {
sceneObjHolder.modelCache.requestObjectData('WaterWave');
WaterAreaHolder.requestArchives(sceneObjHolder);
}
}
``` | /content/code_sandbox/src/SuperMarioGalaxy/Actors/OceanBowl.ts | xml | 2016-10-06T21:43:45 | 2024-08-16T17:03:52 | noclip.website | magcius/noclip.website | 3,206 | 6,357 |
```xml
const listQuery = `
query KhanbankConfigsList($page: Int, $perPage: Int) {
khanbankConfigsList(page: $page, perPage: $perPage) {
list {
_id
consumerKey
secretKey
description
name
}
totalCount
}
}
`;
export default {
listQuery
};
``` | /content/code_sandbox/packages/plugin-khanbank-ui/src/modules/configs/graphql/queries.ts | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 79 |
```xml
<!--
Description: feed language
-->
<feed xmlns="path_to_url" xml:lang="en">
</feed>
``` | /content/code_sandbox/testdata/parser/atom/atom10_feed_xml_lang.xml | xml | 2016-01-23T02:44:34 | 2024-08-16T15:16:03 | gofeed | mmcdole/gofeed | 2,547 | 26 |
```xml
import Transition from './Transition';
export type { TransitionProps } from './Transition';
export default Transition;
``` | /content/code_sandbox/packages/zarm/src/transition/index.ts | xml | 2016-07-13T11:45:37 | 2024-08-12T19:23:48 | zarm | ZhongAnTech/zarm | 1,707 | 21 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<agents version="1" signature="2392260077">
<agent type="CPerformanceAgent" base="behaviac::Agent" signature="935575243">
<properties>
<property name="DistanceToEnemy" type="float" member="true" static="false" agent="CPerformanceAgent" />
<property name="Food" type="float" member="true" static="false" agent="CPerformanceAgent" />
<property name="HP" type="float" member="true" static="false" agent="CPerformanceAgent" />
<property name="Hungry" type="float" member="true" static="false" agent="CPerformanceAgent" />
</properties>
</agent>
</agents>
``` | /content/code_sandbox/test/btperformance/behaviac/exported/meta/BehaviacPerformance.meta.xml | xml | 2016-11-21T05:08:08 | 2024-08-16T07:18:30 | behaviac | Tencent/behaviac | 2,831 | 185 |
```xml
/**
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {COMMIT_END_MARK, parseCommitInfoOutput} from '../templates';
import {mockLogger} from 'shared/testUtils';
describe('template parsing', () => {
it('parses normal commits', () => {
expect(
parseCommitInfoOutput(
mockLogger,
`\
77fdcef8759fb65da46a7a6431310829f12cef5b
Commit A
Author <author@example.com>
2024-04-24 14:16:24 -0700
draft
3f41d88ab69446763404eccd0f3e579352ba2753\x00
[]
["sapling/addons/isl/README.md"]
[]
1
false
|
Commit A
Summary:
this is my summary
${COMMIT_END_MARK}
e4594714fb9b3410a0ef4affc955f9d76d61c8a7
Commit B
Author <author@example.com>
2024-04-24 12:19:08 -0700
draft
2934650733c9181bdf64b7d00f5e0c7ca93d7ed7\x00
["sapling/addons/isl/README.md"]
[]
[]
9637166dabea9ac50ccb93902f3f41df4d8a15c4,
false
|
Commit B
`,
null,
),
).toEqual([
{
author: 'Author <author@example.com>',
bookmarks: [],
closestPredecessors: [],
date: new Date('2024-04-24T21:16:24.000Z'),
description: 'Summary:\nthis is my summary',
diffId: '1',
filesSample: [
{
path: 'sapling/addons/isl/README.md',
status: 'M',
},
],
hash: '77fdcef8759fb65da46a7a6431310829f12cef5b',
isDot: false,
isFollower: false,
parents: ['3f41d88ab69446763404eccd0f3e579352ba2753'],
phase: 'draft',
remoteBookmarks: [],
stableCommitMetadata: undefined,
successorInfo: undefined,
title: 'Commit A',
totalFileCount: 1,
},
{
author: 'Author <author@example.com>',
bookmarks: [],
closestPredecessors: ['9637166dabea9ac50ccb93902f3f41df4d8a15c4'],
date: new Date('2024-04-24T19:19:08.000Z'),
description: '',
diffId: undefined,
filesSample: [
{
path: 'sapling/addons/isl/README.md',
status: 'A',
},
],
hash: 'e4594714fb9b3410a0ef4affc955f9d76d61c8a7',
isDot: false,
isFollower: false,
parents: ['2934650733c9181bdf64b7d00f5e0c7ca93d7ed7'],
phase: 'draft',
remoteBookmarks: [],
stableCommitMetadata: undefined,
successorInfo: undefined,
title: 'Commit B',
totalFileCount: 1,
},
]);
});
it('handles commits with no title+description ', () => {
expect(
parseCommitInfoOutput(
mockLogger,
`\
77fdcef8759fb65da46a7a6431310829f12cef5b
Author <author@example.com>
2024-04-24 14:16:24 -0700
draft
3f41d88ab69446763404eccd0f3e579352ba2753\x00
[]
["sapling/addons/isl/README.md"]
[]
1
false
|
${COMMIT_END_MARK}
`,
null,
),
).toEqual([
{
author: 'Author <author@example.com>',
bookmarks: [],
closestPredecessors: [],
date: new Date('2024-04-24T21:16:24.000Z'),
description: '',
diffId: '1',
filesSample: [
{
path: 'sapling/addons/isl/README.md',
status: 'M',
},
],
hash: '77fdcef8759fb65da46a7a6431310829f12cef5b',
isDot: false,
isFollower: false,
parents: ['3f41d88ab69446763404eccd0f3e579352ba2753'],
phase: 'draft',
remoteBookmarks: [],
stableCommitMetadata: undefined,
successorInfo: undefined,
title: '',
totalFileCount: 1,
},
]);
});
});
``` | /content/code_sandbox/addons/isl-server/src/__tests__/templates.test.ts | xml | 2016-05-05T16:53:47 | 2024-08-16T19:12:02 | sapling | facebook/sapling | 5,987 | 1,103 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.