text
stringlengths
9
39.2M
dir
stringlengths
26
295
lang
stringclasses
185 values
created_date
timestamp[us]
updated_date
timestamp[us]
repo_name
stringlengths
1
97
repo_full_name
stringlengths
7
106
star
int64
1k
183k
len_tokens
int64
1
13.8M
```xml import type RootStore from "~/stores/RootStore"; declare global { interface ImportMeta { /** * A special feature that allows you to get all matching modules starting from some base directory. */ glob: (pattern: string, option?: { eager: boolean }) => any; } interface Window { dataLayer: any[]; gtag: (...args: any[]) => void; stores: RootStore; DesktopBridge: { /** * The name of the platform running on. */ platform: string; /** * The version of the loaded application. */ version: () => string; /** * Restarts the application. */ restart: () => Promise<void>; /** * Restarts the application and installs the update. */ restartAndInstall: () => Promise<void>; /** * Tells the updater to check for updates now. */ checkForUpdates: () => Promise<void>; /** * Passes double click events from titlebar area */ onTitlebarDoubleClick: () => Promise<void>; /** * Passes log out events from the app to the main process */ onLogout: () => Promise<void>; /** * Adds a custom host to config */ addCustomHost: (host: string) => Promise<void>; /** * Set the language used by the spellchecker on Windows/Linux. */ setSpellCheckerLanguages: (languages: string[]) => Promise<void>; /** * Set the badge on the app icon. */ setNotificationCount: (count: number) => Promise<void>; /** * Registers a callback to be called when the window is focused. */ focus: (callback: () => void) => void; /** * Registers a callback to be called when the window loses focus. */ blur: (callback: () => void) => void; /** * Registers a callback to be called when a route change is requested from the main process. * This would usually be when it is responding to a deeplink. */ redirect: (callback: (path: string, replace: boolean) => void) => void; /** * Registers a callback to be called when the application is ready to update. */ updateDownloaded: (callback: () => void) => void; /** * Registers a callback to be called when the application wants to open keyboard shortcuts. */ openKeyboardShortcuts: (callback: () => void) => void; /** * Go back in history, if possible */ goBack: () => void; /** * Go forward in history, if possible */ goForward: () => void; /** * Registers a callback to be called when the application wants to open the find in page dialog. */ onFindInPage: (callback: () => void) => void; /** * Registers a callback to be called when the application wants to open the replace in page dialog. */ onReplaceInPage: (callback: () => void) => void; }; } } export {}; ```
/content/code_sandbox/app/typings/window.d.ts
xml
2016-05-22T21:31:47
2024-08-16T19:57:22
outline
outline/outline
26,751
672
```xml import { mapEnumToOptions } from '../utils/form-utils'; enum SomeEnum { NotApplicable = 'N/A', Foo = 0, Bar, } describe('Form Utils', () => { describe('#mapEnumToOptions', () => { it('should return options from enum', () => { const options = mapEnumToOptions(SomeEnum); expect(options).toEqual([ { key: 'NotApplicable', value: SomeEnum.NotApplicable, }, { key: 'Foo', value: SomeEnum.Foo, }, { key: 'Bar', value: SomeEnum.Bar, }, ]); }); }); }); ```
/content/code_sandbox/npm/ng-packs/packages/core/src/lib/tests/form-utils.spec.ts
xml
2016-12-03T22:56:24
2024-08-16T16:24:05
abp
abpframework/abp
12,657
148
```xml import { LoginSliderPage } from './login-slider'; import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; @NgModule({ declarations: [ LoginSliderPage, ], imports: [ IonicPageModule.forChild(LoginSliderPage), ], exports: [ LoginSliderPage ] }) export class LoginSliderPageModule { } ```
/content/code_sandbox/src/pages/login/login-slider/login-slider.module.ts
xml
2016-11-04T05:48:23
2024-08-03T05:22:54
ionic3-components
yannbf/ionic3-components
1,679
78
```xml import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart, IPropertyPaneConfiguration, PropertyPaneTextField } from '@microsoft/sp-webpart-base'; import * as strings from 'SuggestedTeamMembersWebPartStrings'; import SuggestedTeamMembers from './components/SuggestedTeamMembers'; import { ISuggestedTeamMembersProps } from './components/ISuggestedTeamMembersProps'; export interface ISuggestedTeamMembersWebPartProps { description: string; } export default class SuggestedTeamMembersWebPart extends BaseClientSideWebPart<ISuggestedTeamMembersWebPartProps> { private _teamsContext: microsoftTeams.Context; protected onInit(): Promise<any> { let retVal: Promise<any> = Promise.resolve(); if (this.context.microsoftTeams) { retVal = new Promise((resolve, reject) => { this.context.microsoftTeams.getContext(context => { this._teamsContext = context; resolve(); }); }); } return retVal; } public render(): void { const element: React.ReactElement<ISuggestedTeamMembersProps > = React.createElement( SuggestedTeamMembers, { teamsContext: this._teamsContext, graphHttpClient: this.context.graphHttpClient, groupId: this.context.pageContext.site.group.id } ); ReactDom.render(element, this.domElement); } protected onDispose(): void { ReactDom.unmountComponentAtNode(this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: strings.PropertyPaneDescription }, groups: [ { groupName: strings.BasicGroupName, groupFields: [ PropertyPaneTextField('description', { label: strings.DescriptionFieldLabel }) ] } ] } ] }; } } ```
/content/code_sandbox/samples/react-teams-tab-suggested-members/src/webparts/suggestedTeamMembers/SuggestedTeamMembersWebPart.ts
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
432
```xml <?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="path_to_url"> <TextureView android:id="@+id/texture_view" android:layout_width="match_parent" android:layout_height="match_parent" /> </merge> ```
/content/code_sandbox/camerakit/src/main/res/layout/texture_view.xml
xml
2016-11-27T19:29:43
2024-08-15T07:21:04
camerakit-android
CameraKit/camerakit-android
5,357
62
```xml import { BrowserWindow } from 'electron'; import { environment } from '../environment'; import { MIN_WINDOW_CONTENT_WIDTH, MIN_WINDOW_CONTENT_HEIGHT } from '../config'; type getContentMinimumSizeResponse = { minWindowsWidth: number; minWindowsHeight: number; }; /** * * getContentMinimumSize * * This function is necessary because Electron's function * `setMinimumSize` takes the native OS menu into account. * By setting `useContentSize` in the BrowserWindow's options, * it's possible to grab the menu & frame sizes, * then add to the minimum `width` and `height` * */ export const getContentMinimumSize = ( window: BrowserWindow ): getContentMinimumSizeResponse => { const { isWindows } = environment; const { width: frameWidth, height: frameHeight } = window.getBounds(); const { width: contentWidth, height: contentHeight, } = window.getContentBounds(); const paddingWidth = frameWidth - contentWidth || 0; let paddingHeight = frameHeight - contentHeight || 0; if (isWindows) { paddingHeight += 20; } const minWindowsWidth = MIN_WINDOW_CONTENT_WIDTH + paddingWidth; const minWindowsHeight = MIN_WINDOW_CONTENT_HEIGHT + paddingHeight; return { minWindowsWidth, minWindowsHeight, }; }; ```
/content/code_sandbox/source/main/utils/getContentMinimumSize.ts
xml
2016-10-05T13:48:54
2024-08-13T22:03:19
daedalus
input-output-hk/daedalus
1,230
286
```xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:test-suite xmlns:ns2="urn:model.allure.qatools.yandex.ru" start="1412949538851" stop="1412949560013" version="1.4.4-SNAPSHOT"> <name>my.company.NonAsciiTest</name> <test-cases> <test-case start="1412949540562" stop="1412949540660" status="broken"> <name>test_raise_cyrilling</name> <title>test_raise_cyrilling ( !)</title> <description type="text"> </description> <failure> <message>Exception: !</message> <stack-trace>java.lang.Exception: ! at my.company.NonAsciiTest.test_raise_cyrilling(NonAsciiTest.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) </stack-trace> </failure> <steps/> <attachments/> <labels> <label name="host" value="my.cool.host.com"/> <label name="thread" value="pool-1-thread-8"/> </labels> </test-case> <test-case start="1412949540562" stop="1412949540565" status="passed"> <name>test_pass</name> <description type="text"> </description> <steps/> <attachments/> <labels> <label name="host" value="my.cool.host.com"/> <label name="thread" value="pool-1-thread-9"/> </labels> </test-case> </test-cases> <labels> <label name="framework" value="JUnit"/> <label name="language" value="JAVA"/> </labels> </ns2:test-suite> ```
/content/code_sandbox/allure-generator/src/test/resources/allure1data/d3692af2-58c6-4ab0-ae4e-2918d9b3bf89-testsuite.xml
xml
2016-05-27T14:06:05
2024-08-16T20:00:51
allure2
allure-framework/allure2
4,013
691
```xml import React from 'react'; import { render } from '@testing-library/react'; import Divider from '../index'; import { getStyle, toRGB, inChrome } from '@test/utils'; import '../styles/index.less'; describe('Divider styles', () => { it('Should render the correct styles', () => { const instanceRef = React.createRef<HTMLDivElement>(); render(<Divider ref={instanceRef} />); const element = instanceRef.current as HTMLElement; assert.equal(getStyle(element, 'backgroundColor'), toRGB('#e5e5ea'), 'Divider background'); assert.equal(getStyle(element, 'height'), '1px', 'Divider height'); inChrome && assert.equal(getStyle(element, 'margin'), '24px 0px', 'Divider margin'); }); }); ```
/content/code_sandbox/src/Divider/test/DividerStylesSpec.tsx
xml
2016-06-06T02:27:46
2024-08-16T16:41:54
rsuite
rsuite/rsuite
8,263
165
```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 { assert } from "chai"; import { mount, shallow } from "enzyme"; import * as React from "react"; import sinon from "sinon"; import { Card, Classes, H4 } from "../../src"; describe("<Card>", () => { it("supports elevation, interactive, and className props", () => { const wrapper = shallow(<Card elevation={3} interactive={true} className={Classes.TEXT_MUTED} />); assert.isTrue(wrapper.hasClass(Classes.CARD), Classes.CARD); assert.isTrue(wrapper.hasClass(Classes.ELEVATION_3), Classes.ELEVATION_3); assert.isTrue(wrapper.hasClass(Classes.INTERACTIVE), Classes.INTERACTIVE); assert.isTrue(wrapper.hasClass(Classes.TEXT_MUTED), Classes.TEXT_MUTED); }); it("renders children", () => { const wrapper = shallow( <Card> <H4>Card content</H4> </Card>, ); assert.isTrue(wrapper.find(H4).exists()); }); it("calls onClick when card is clicked", () => { const onClick = sinon.spy(); shallow(<Card onClick={onClick} />).simulate("click"); assert.isTrue(onClick.calledOnce); }); it("supports HTML props", () => { const onChange = sinon.spy(); const card = shallow(<Card onChange={onChange} title="foo" tabIndex={4000} />).find("div"); assert.strictEqual(card.prop("onChange"), onChange); assert.strictEqual(card.prop("title"), "foo"); }); it("supports ref prop", () => { const elementRef = React.createRef<HTMLDivElement>(); mount(<Card ref={elementRef} />); assert.isDefined(elementRef.current); }); }); ```
/content/code_sandbox/packages/core/test/card/cardTests.tsx
xml
2016-10-25T21:17:50
2024-08-16T15:14:48
blueprint
palantir/blueprint
20,593
397
```xml import fetch from "node-fetch"; import { IContext, sendContactsMessage, sendPosMessage, sendProductsMessage } from "../../../messageBroker"; import { getConfig } from "../../../utils"; const msdynamicCheckMutations = { async toCheckMsdProducts( _root, { brandId }: { brandId: string }, { subdomain }: IContext ) { const configs = await getConfig(subdomain, "DYNAMIC", {}); const config = configs[brandId || "noBrand"]; const updateProducts: any = []; const createProducts: any = []; const deleteProducts: any = []; let matchedCount = 0; if (!config.itemApi || !config.username || !config.password) { throw new Error("MS Dynamic config not found."); } const { itemApi, username, password } = config; const productQry: any = { status: { $ne: "deleted" } }; if (brandId && brandId !== "noBrand") { productQry.scopeBrandIds = { $in: [brandId] }; } else { productQry.$or = [ { scopeBrandIds: { $exists: false } }, { scopeBrandIds: { $size: 0 } } ]; } try { const productsCount = await sendProductsMessage({ subdomain, action: "productCount", data: { query: productQry }, isRPC: true }); const products = await sendProductsMessage({ subdomain, action: "productFind", data: { query: productQry, limit: productsCount }, isRPC: true }); const productCodes = (products || []).map(p => p.code) || []; const response = await fetch( `${itemApi}?$filter=Item_Category_Code ne '' and Blocked ne true and Allow_Ecommerce eq true`, { headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json", Authorization: `Basic ${Buffer.from( `${username}:${password}` ).toString("base64")}` }, timeout: 180000 } ).then(res => res.json()); console.log( "summary count of products response: ", response.value.length ); const resultCodes = response.value.map(r => r.No) || []; const productByCode = {}; for (const product of products) { productByCode[product.code] = product; if (!resultCodes.includes(product.code)) { deleteProducts.push(product); } } for (const resProd of response.value) { if (productCodes.includes(resProd.No)) { const product = productByCode[resProd.No]; if ( resProd?.Description === product.name && resProd?.Base_Unit_of_Measure === product.uom ) { matchedCount = matchedCount + 1; } else { updateProducts.push(resProd); } } else { createProducts.push(resProd); } } } catch (e) { console.log(e, "error"); } return { create: { count: createProducts.length, items: createProducts }, update: { count: updateProducts.length, items: updateProducts }, delete: { count: deleteProducts.length, items: deleteProducts }, matched: { count: matchedCount } }; }, async toCheckMsdProductCategories( _root, { brandId, categoryId }: { brandId: string; categoryId: string }, { subdomain }: IContext ) { const configs = await getConfig(subdomain, "DYNAMIC", {}); const config = configs[brandId || "noBrand"]; const updateCategories: any = []; const createCategories: any = []; const deleteCategories: any = []; let matchedCount = 0; if (!config.itemCategoryApi || !config.username || !config.password) { throw new Error("MS Dynamic config not found."); } const { itemCategoryApi, username, password } = config; try { const categoriesCount = await sendProductsMessage({ subdomain, action: "categories.count", data: { query: { status: { $ne: "deleted" } } }, isRPC: true }); const categories = await sendProductsMessage({ subdomain, action: "categories.find", data: { query: { status: { $ne: "deleted" } }, limit: categoriesCount }, isRPC: true }); const response = await fetch(itemCategoryApi, { headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json", Authorization: `Basic ${Buffer.from( `${username}:${password}` ).toString("base64")}` } }).then(res => res.json()); const resultCodes = response.value.map(r => r.Code) || []; const categoryByCode = {}; const categoryById = {}; for (const category of categories) { categoryByCode[category.code] = category; categoryById[category._id] = category; if (!resultCodes.includes(category.code)) { deleteCategories.push(category); } } for (const resProd of response.value) { const category = categoryByCode[resProd.Code]; if (category) { if ( resProd.Code === category.code && (categoryId === category.parentId || categoryById[category.parentId]?.code === resProd.Parent_Category) && category.name === resProd.Description ) { matchedCount = matchedCount + 1; } else { updateCategories.push(resProd); } } else { createCategories.push(resProd); } } } catch (e) { console.log(e, "error"); } return { create: { count: createCategories.length, items: createCategories }, update: { count: updateCategories.length, items: updateCategories }, delete: { count: deleteCategories.length, items: deleteCategories }, matched: { count: matchedCount } }; }, async toCheckMsdCustomers( _root, { brandId }: { brandId: string }, { subdomain }: IContext ) { const configs = await getConfig(subdomain, "DYNAMIC", {}); const config = configs[brandId || "noBrand"]; const createCustomers: any = []; const updateCustomers: any = []; const deleteCustomers: any = []; let matchedCount = 0; if (!config.customerApi || !config.username || !config.password) { throw new Error("MS Dynamic config not found."); } const { customerApi, username, password } = config; try { const companies = await sendContactsMessage({ subdomain, action: "companies.findActiveCompanies", data: {}, isRPC: true, defaultValue: {} }); const customers = await sendContactsMessage({ subdomain, action: "customers.findActiveCustomers", data: {}, isRPC: true, defaultValue: {} }); const companyCodes = (companies || []).map(c => c.code) || []; const customerCodes = (customers || []).map(c => c.code) || []; const response = await fetch(customerApi, { headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json", Authorization: `Basic ${Buffer.from( `${username}:${password}` ).toString("base64")}` }, timeout: 60000 }).then(res => res.json()); const resultCodes = response.value.map(r => r.No.replace(/\s/g, "")) || []; const companyByCode = {}; const customerByCode = {}; for (const company of companies) { companyByCode[company.code] = company; if (!resultCodes.includes(company.code)) { deleteCustomers.push(company); } } for (const customer of customers) { customerByCode[customer.code] = customer; if (!resultCodes.includes(customer.code)) { deleteCustomers.push(customer); } } /* company and customer rquest function*/ const companyRequest = resCompany => { if (companyCodes.includes(resCompany.No.replace(/\s/g, ""))) { const company = companyByCode[resCompany.No.replace(/\s/g, "")]; if (resCompany?.Name === company.primaryName) { matchedCount = matchedCount + 1; } else { updateCustomers.push(resCompany); } } else { createCustomers.push(resCompany); } }; const customerRequest = resCompany => { if (customerCodes.includes(resCompany.No.replace(/\s/g, ""))) { const customer = customerByCode[resCompany.No.replace(/\s/g, "")]; if (resCompany?.Name === customer.firstName) { matchedCount = matchedCount + 1; } else { updateCustomers.push(resCompany); } } else { createCustomers.push(resCompany); } }; /* ---------------------- */ for (const resCompany of response.value) { if (resCompany?.Partner_Type === "Company") { companyRequest(resCompany); } if (resCompany?.Partner_Type === "Person") { if (resCompany.VAT_Registration_No.length === 7) { companyRequest(resCompany); } else { customerRequest(resCompany); } } if ( resCompany?.Partner_Type === " " && resCompany.VAT_Registration_No ) { companyRequest(resCompany); } if ( resCompany?.Partner_Type === " " && !resCompany.VAT_Registration_No ) { customerRequest(resCompany); } } } catch (e) { console.log(e, "error"); } return { create: { count: createCustomers.length, items: createCustomers }, update: { count: updateCustomers.length, items: updateCustomers }, delete: { count: deleteCustomers.length, items: deleteCustomers }, matched: { count: matchedCount } }; }, async toCheckMsdSynced( _root, { ids, brandId }: { ids: string[]; brandId: string }, { subdomain }: IContext ) { const configs = await getConfig(subdomain, "DYNAMIC", {}); const config = configs[brandId || "noBrand"]; if (!config.salesApi || !config.username || !config.password) { throw new Error("MS Dynamic config not found."); } const { salesApi, username, password } = config; let filterSection = ""; let dynamicNo = [] as any; let dynamicId = [] as any; for (const id of ids) { const order = await sendPosMessage({ subdomain, action: "orders.findOne", data: { _id: id }, isRPC: true }); if (order && order.syncErkhetInfo) { const obj = {}; obj[order.syncErkhetInfo] = id; dynamicNo.push(order.syncErkhetInfo); dynamicId.push(obj); } } if (dynamicNo) { for (const no of dynamicNo) { filterSection += `No eq '${no}' or `; } filterSection = filterSection.slice(0, -4) + ""; } const url = `${salesApi}?$filter=(${filterSection})`; const response = await fetch(url, { headers: { "Content-Type": "application/json", Accept: "application/json", Authorization: `Basic ${Buffer.from(`${username}:${password}`).toString( "base64" )}` }, timeout: 60000 }).then(r => r.json()); const datas = response?.value; return (datas || []).map(data => { const key = data.No; const valueObject = dynamicId.find(obj => key in obj); return { _id: valueObject[key], isSynced: true, syncedDate: data.Order_Date, syncedBillNumber: data.No, syncedCustomer: data.Sell_to_Customer_No }; }); } }; export default msdynamicCheckMutations; ```
/content/code_sandbox/packages/plugin-msdynamic-api/src/graphql/resolvers/mutations/checkDynamic.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
2,709
```xml import { isBefore } from 'date-fns'; import { MONTHLY_TYPE, WEEKLY_TYPE } from '@proton/shared/lib/calendar/constants'; import { getNegativeSetpos, getPositiveSetpos } from '@proton/shared/lib/calendar/recurrence/rrule'; import { fromLocalDate, toUTCDate } from '@proton/shared/lib/date/timezone'; import type { DateTimeModel, FrequencyModel } from '@proton/shared/lib/interfaces/calendar'; import replace from '@proton/utils/replace'; const getFrequencyModelChange = ( oldStart: DateTimeModel, newStart: DateTimeModel, frequencyModel: FrequencyModel ): FrequencyModel => { // change days in weekly const oldStartDay = oldStart.date.getDay(); const newStartDay = newStart.date.getDay(); const oldDays = frequencyModel.weekly && frequencyModel.weekly.days; const newDays = oldDays ? replace(oldDays, oldStartDay, newStartDay).sort() : []; /** * Notice that after replacement we may end up with repeated days in the newDays array. * That would indicate that the user entered a multiple-day selection, and we want to keep track of that. * Notice that if we filtered by unique days, an initial two-day selection of e.g. MO and WE (oldDays = [1,3]), with * the recurring event starting on MO, would be changed into a one-day selection if the user moves * the starting starting date of the event to a WE, i.e. (newDays = [3]). If the user changes her mind again and moves * the starting date to a TH now, we would display a single-day selection (newDays = [4]), but from a UX * perspective it makes more sense to display a two-day selection WE and TH (i.e. newDays = [4, 4]) */ const startFakeUtcDate = toUTCDate(fromLocalDate(newStart.date)); // change monthly type const changeToNthDay = frequencyModel.monthly.type === MONTHLY_TYPE.ON_MINUS_NTH_DAY && getNegativeSetpos(startFakeUtcDate) !== -1; const changeToMinusNthDay = frequencyModel.monthly.type === MONTHLY_TYPE.ON_NTH_DAY && getPositiveSetpos(startFakeUtcDate) === 5; const newFrequencyModel = { ...frequencyModel, weekly: { type: WEEKLY_TYPE.ON_DAYS, days: newDays, }, }; if (changeToNthDay) { return { ...newFrequencyModel, monthly: { type: MONTHLY_TYPE.ON_NTH_DAY } }; } if (changeToMinusNthDay) { return { ...newFrequencyModel, monthly: { type: MONTHLY_TYPE.ON_MINUS_NTH_DAY } }; } const { ends: { until: oldRecurringUntil }, } = frequencyModel; if (oldRecurringUntil && isBefore(oldRecurringUntil, newStart.date)) { newFrequencyModel.ends = { ...frequencyModel.ends, until: newStart.date, }; } return newFrequencyModel; }; export default getFrequencyModelChange; ```
/content/code_sandbox/applications/calendar/src/app/components/eventModal/eventForm/getFrequencyModelChange.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
679
```xml // See LICENSE.txt for license information. import React, {useCallback, useState} from 'react'; import {useIntl} from 'react-intl'; import {retryInitialTeamAndChannel} from '@actions/remote/retry'; import LoadingError from '@components/loading_error'; import {useServerDisplayName, useServerUrl} from '@context/server'; import {setTeamLoading} from '@store/team_load_store'; const LoadTeamsError = () => { const {formatMessage} = useIntl(); const serverUrl = useServerUrl(); const serverName = useServerDisplayName(); const [loading, setLoading] = useState(false); const onRetryTeams = useCallback(async () => { setLoading(true); setTeamLoading(serverUrl, true); const {error} = await retryInitialTeamAndChannel(serverUrl); setTeamLoading(serverUrl, false); if (error) { setLoading(false); } }, []); return ( <LoadingError loading={loading} message={formatMessage({id: 'load_teams_error.message', defaultMessage: 'There was a problem loading content for this server.'})} onRetry={onRetryTeams} title={formatMessage({id: 'load_teams_error.title', defaultMessage: "Couldn't load {serverName}"}, {serverName})} /> ); }; export default LoadTeamsError; ```
/content/code_sandbox/app/screens/home/channel_list/categories_list/load_teams_error/index.tsx
xml
2016-10-07T16:52:32
2024-08-16T12:08:38
mattermost-mobile
mattermost/mattermost-mobile
2,155
285
```xml import * as React from 'react'; import { IChartProps, ILineChartProps, LineChart, ILineChartDataPoint } from '@fluentui/react-charting'; import { DefaultPalette } from '@fluentui/react/lib/Styling'; import { Toggle } from '@fluentui/react/lib/Toggle'; interface ILineChartBasicState { width: number; height: number; allowMultipleShapes: boolean; } export class LineChartLargeDataExample extends React.Component<{}, ILineChartBasicState> { constructor(props: ILineChartProps) { super(props); this.state = { width: 700, height: 300, allowMultipleShapes: false, }; } public render(): JSX.Element { return <div>{this._basicExample()}</div>; } private _onWidthChange = (e: React.ChangeEvent<HTMLInputElement>) => { this.setState({ width: parseInt(e.target.value, 10) }); }; private _onHeightChange = (e: React.ChangeEvent<HTMLInputElement>) => { this.setState({ height: parseInt(e.target.value, 10) }); }; private _onShapeChange = (ev: React.MouseEvent<HTMLElement>, checked: boolean) => { this.setState({ allowMultipleShapes: checked }); }; private _getdata = () => { const data: ILineChartDataPoint[] = []; const startdate = new Date('2020-03-01T00:00:00.000Z'); for (let i = 0; i < 10000; i++) { const newDate = new Date(startdate); newDate.setUTCHours(startdate.getUTCHours() + i); data.push({ x: newDate, y: 500000 }); } return data; }; private _getdata2 = () => { const data: ILineChartDataPoint[] = []; const startdate = new Date('2020-03-01T00:00:00.000Z'); for (let i = 1000; i < 9000; i++) { const newDate = new Date(startdate); newDate.setUTCHours(startdate.getUTCHours() + i); data.push({ x: newDate, y: this._getY(i) }); } return data; }; private _getY = (i: number) => { let res: number = 0; const newN = i % 1000; if (newN < 500) { res = newN * newN; } else { res = 1000000 - newN * newN; } return res; }; private _basicExample(): JSX.Element { const data: IChartProps = { chartTitle: 'Line Chart', lineChartData: [ { legend: 'From_Legacy_to_O365', data: this._getdata(), color: DefaultPalette.blue, onLineClick: () => console.log('From_Legacy_to_O365'), hideNonActiveDots: true, lineOptions: { lineBorderWidth: '4', }, }, { legend: 'All', data: this._getdata2(), color: DefaultPalette.green, lineOptions: { lineBorderWidth: '4', }, }, { legend: 'single point', data: [ { x: new Date('2020-03-05T00:00:00.000Z'), y: 282000, }, ], color: DefaultPalette.yellow, }, ], }; const rootStyle = { width: `${this.state.width}px`, height: `${this.state.height}px` }; const margins = { left: 35, top: 20, bottom: 35, right: 20 }; return ( <> <label htmlFor="changeWidth_basic">Change Width:</label> <input type="range" value={this.state.width} min={200} max={1000} id="changeWidth_Basic" onChange={this._onWidthChange} aria-valuetext={`ChangeWidthSlider${this.state.width}`} /> <label htmlFor="changeHeight_Basic">Change Height:</label> <input type="range" value={this.state.height} min={200} max={1000} id="changeHeight_Basic" onChange={this._onHeightChange} aria-valuetext={`ChangeHeightslider${this.state.height}`} /> <Toggle label="Enabled multiple shapes for each line" onText="On" offText="Off" onChange={this._onShapeChange} checked={this.state.allowMultipleShapes} /> <div style={rootStyle}> <LineChart culture={window.navigator.language} data={data} legendsOverflowText={'Overflow Items'} yMinValue={200} yMaxValue={301} height={this.state.height} width={this.state.width} margins={margins} allowMultipleShapesForPoints={this.state.allowMultipleShapes} optimizeLargeData={true} enablePerfOptimization={true} /> </div> </> ); } } ```
/content/code_sandbox/packages/react-examples/src/react-charting/LineChart/LineChart.LargeData.Example.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
1,144
```xml import { PuppeteerCrawler } from 'crawlee'; const crawler = new PuppeteerCrawler({ async requestHandler({ page }) { // Puppeteer does not have the automatic waiting functionality // of Playwright, so we have to explicitly wait for the element. await page.waitForSelector('.ActorStoreItem'); // Puppeteer does not have helper methods like locator.textContent, // so we have to manually extract the value using in-page JavaScript. const actorText = await page.$eval('.ActorStoreItem', (el) => { return el.textContent; }); console.log(`ACTOR: ${actorText}`); }, }); await crawler.run(['path_to_url ```
/content/code_sandbox/docs/guides/javascript-rendering-puppeteer.ts
xml
2016-08-26T18:35:03
2024-08-16T16:40:08
crawlee
apify/crawlee
14,153
145
```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. --> <selector xmlns:android="path_to_url"> <item android:color="@android:color/system_neutral2_600" android:lStar="17"/> </selector> ```
/content/code_sandbox/lib/java/com/google/android/material/color/res/color-v31/m3_ref_palette_dynamic_neutral_variant17.xml
xml
2016-12-05T16:11:29
2024-08-16T17:51:42
material-components-android
material-components/material-components-android
16,176
99
```xml <?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="sfB-oL-VeL"> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> </dependencies> <scenes> <!--Navigation Controller--> <scene sceneID="sYw-kI-VLd"> <objects> <navigationController id="sfB-oL-VeL" sceneMemberID="viewController"> <navigationBar key="navigationBar" contentMode="scaleToFill" id="mCI-2p-q3h"> <rect key="frame" x="0.0" y="0.0" width="320" height="44"/> <autoresizingMask key="autoresizingMask"/> </navigationBar> <connections> <segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="uLH-EB-JMv"/> </connections> </navigationController> <placeholder placeholderIdentifier="IBFirstResponder" id="2Vr-Nw-tt5" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="-520" y="-99"/> </scene> <!--View Controller--> <scene sceneID="tne-QT-ifu"> <objects> <viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController"> <layoutGuides> <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> </layoutGuides> <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> </view> <navigationItem key="navigationItem" id="ePh-M9-Po0"/> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="269" y="-69"/> </scene> </scenes> </document> ```
/content/code_sandbox/WXSTransition/Base.lproj/Main.storyboard
xml
2016-06-06T16:08:26
2024-06-21T14:01:01
WXSTransition
alanwangmodify/WXSTransition
1,529
631
```xml 'use strict'; import * as path from 'path'; import { dirname } from 'path'; import { arePathsSame, getPythonSetting, onDidChangePythonSetting, pathExists, shellExecute, } from '../externalDependencies'; import { cache } from '../../../common/utils/decorators'; import { traceError, traceVerbose } from '../../../logging'; import { getOSType, getUserHomeDir, OSType } from '../../../common/utils/platform'; export const ACTIVESTATETOOLPATH_SETTING_KEY = 'activeStateToolPath'; const STATE_GENERAL_TIMEOUT = 5000; export type ProjectInfo = { name: string; organization: string; local_checkouts: string[]; // eslint-disable-line camelcase executables: string[]; }; export async function isActiveStateEnvironment(interpreterPath: string): Promise<boolean> { const execDir = path.dirname(interpreterPath); const runtimeDir = path.dirname(execDir); return pathExists(path.join(runtimeDir, '_runtime_store')); } export class ActiveState { private static statePromise: Promise<ActiveState | undefined> | undefined; public static async getState(): Promise<ActiveState | undefined> { if (ActiveState.statePromise === undefined) { ActiveState.statePromise = ActiveState.locate(); } return ActiveState.statePromise; } constructor() { onDidChangePythonSetting(ACTIVESTATETOOLPATH_SETTING_KEY, () => { ActiveState.statePromise = undefined; }); } public static getStateToolDir(): string | undefined { const home = getUserHomeDir(); if (!home) { return undefined; } return getOSType() === OSType.Windows ? path.join(home, 'AppData', 'Local', 'ActiveState', 'StateTool') : path.join(home, '.local', 'ActiveState', 'StateTool'); } private static async locate(): Promise<ActiveState | undefined> { const stateToolDir = this.getStateToolDir(); const stateCommand = getPythonSetting<string>(ACTIVESTATETOOLPATH_SETTING_KEY) ?? ActiveState.defaultStateCommand; if (stateToolDir && ((await pathExists(stateToolDir)) || stateCommand !== this.defaultStateCommand)) { return new ActiveState(); } return undefined; } public async getProjects(): Promise<ProjectInfo[] | undefined> { return this.getProjectsCached(); } private static readonly defaultStateCommand: string = 'state'; @cache(30_000, true, 10_000) // eslint-disable-next-line class-methods-use-this private async getProjectsCached(): Promise<ProjectInfo[] | undefined> { try { const stateCommand = getPythonSetting<string>(ACTIVESTATETOOLPATH_SETTING_KEY) ?? ActiveState.defaultStateCommand; const result = await shellExecute(`${stateCommand} projects -o editor`, { timeout: STATE_GENERAL_TIMEOUT, }); if (!result) { return undefined; } let output = result.stdout.trimEnd(); if (output[output.length - 1] === '\0') { // '\0' is a record separator. output = output.substring(0, output.length - 1); } traceVerbose(`${stateCommand} projects -o editor: ${output}`); const projects = JSON.parse(output); ActiveState.setCachedProjectInfo(projects); return projects; } catch (ex) { traceError(ex); return undefined; } } // Stored copy of known projects. isActiveStateEnvironmentForWorkspace() is // not async, so getProjects() cannot be used. ActiveStateLocator sets this // when it resolves project info. private static cachedProjectInfo: ProjectInfo[] = []; public static getCachedProjectInfo(): ProjectInfo[] { return this.cachedProjectInfo; } private static setCachedProjectInfo(projects: ProjectInfo[]): void { this.cachedProjectInfo = projects; } } export function isActiveStateEnvironmentForWorkspace(interpreterPath: string, workspacePath: string): boolean { const interpreterDir = dirname(interpreterPath); for (const project of ActiveState.getCachedProjectInfo()) { if (project.executables) { for (const [i, dir] of project.executables.entries()) { // Note multiple checkouts for the same interpreter may exist. // Check them all. if (arePathsSame(dir, interpreterDir) && arePathsSame(workspacePath, project.local_checkouts[i])) { return true; } } } } return false; } ```
/content/code_sandbox/src/client/pythonEnvironments/common/environmentManagers/activestate.ts
xml
2016-01-19T10:50:01
2024-08-12T21:05:24
pythonVSCode
DonJayamanne/pythonVSCode
2,078
979
```xml /** @jsx jsx */ import { Transforms } from 'slate' import { jsx } from '../../..' export const run = (editor, options = {}) => { Transforms.insertNodes( editor, <inline void> <text /> </inline>, options ) } export const input = ( <editor> <block void> <cursor /> </block> </editor> ) export const output = ( <editor> <block void> <cursor /> </block> </editor> ) ```
/content/code_sandbox/packages/slate/test/transforms/insertNodes/inline/block-void.tsx
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
118
```xml <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="path_to_url" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="4dp" android:layout_marginTop="4dp" android:layout_marginBottom="4dp" android:orientation="horizontal"> <FrameLayout android:layout_width="32dp" android:layout_height="32dp" android:background="@drawable/circle_step_done" android:layout_gravity="center"> <TextView android:id="@+id/day" android:layout_width="match_parent" android:layout_height="match_parent" android:textColor="#ffffff" android:gravity="center" android:layout_gravity="center_vertical" android:textSize="18sp"/> </FrameLayout> </FrameLayout> ```
/content/code_sandbox/app/src/main/res/layout/step_days_of_week_day_layout.xml
xml
2016-06-13T19:59:59
2024-08-07T21:44:04
VerticalStepperForm
ernestoyaquello/VerticalStepperForm
1,052
195
```xml import { Path } from 'slate' export const input = { path: [0], another: [0, 1], } export const test = ({ path, another }) => { return Path.endsAfter(path, another) } export const output = false ```
/content/code_sandbox/packages/slate/test/interfaces/Path/endsAfter/below.tsx
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
58
```xml import { Localized } from "@fluent/react/compat"; import React, { FunctionComponent, useCallback } from "react"; import { graphql } from "react-relay"; import { useLocal, useMutation } from "coral-framework/lib/relay"; import { Option, SelectField } from "coral-ui/components/v2"; import { QueueSortLocal } from "coral-admin/__generated__/QueueSortLocal.graphql"; import { ChangeQueueSortMutation } from "./ChangeQueueSortMutation"; import styles from "./QueueSort.css"; const QueueSort: FunctionComponent = () => { const changeQueueSort = useMutation(ChangeQueueSortMutation); const onChange = useCallback( async (e: React.ChangeEvent<HTMLSelectElement>) => { const sortOrder = e.target.value as "CREATED_AT_DESC" | "CREATED_AT_ASC"; await changeQueueSort({ sortOrder }); }, [changeQueueSort] ); const [{ moderationQueueSort }] = useLocal<QueueSortLocal>(graphql` fragment QueueSortLocal on Local { moderationQueueSort } `); const sort = moderationQueueSort ? moderationQueueSort : "CREATED_AT_DESC"; return ( <div className={styles.root}> <SelectField value={sort} onChange={onChange}> <Localized id="queue-sortMenu-newest"> <Option value="CREATED_AT_DESC">Newest</Option> </Localized> <Localized id="queue-sortMenu-oldest"> <Option value="CREATED_AT_ASC">Oldest</Option> </Localized> </SelectField> </div> ); }; export default QueueSort; ```
/content/code_sandbox/client/src/core/client/admin/routes/Moderate/Queue/QueueSort/QueueSort.tsx
xml
2016-10-31T16:14:05
2024-08-06T16:15:57
talk
coralproject/talk
1,881
349
```xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="path_to_url" android:shape="rectangle" android:visible="true" > <corners android:radius="@dimen/material3_widget_corner_radius" /> <solid android:color="#FFFDFCFF" /> </shape> ```
/content/code_sandbox/app/src/main/res/drawable/widget_card_light.xml
xml
2016-02-21T04:39:19
2024-08-16T13:35:51
GeometricWeather
WangDaYeeeeee/GeometricWeather
2,420
77
```xml import { Component, ViewChild } from '@angular/core'; import { NavController, Slides, IonicPage } from 'ionic-angular'; @IonicPage() @Component({ selector: 'page-slide-custom-pagination', templateUrl: 'slide-custom-pagination.html' }) export class SlideCustomPaginationPage { @ViewChild('sliderOne') sliderOne: Slides; @ViewChild('sliderTwo') sliderTwo: Slides; @ViewChild('sliderThree') sliderThree: Slides; slides = [ { title: 'Dream\'s Adventure', imageUrl: 'assets/img/lists/wishlist-1.jpg', songs: 2, private: false }, { title: 'For the Weekend', imageUrl: 'assets/img/lists/wishlist-2.jpg', songs: 4, private: false }, { title: 'Family Time', imageUrl: 'assets/img/lists/wishlist-3.jpg', songs: 5, private: true }, { title: 'My Trip', imageUrl: 'assets/img/lists/wishlist-4.jpg', songs: 12, private: true } ]; constructor(public navCtrl: NavController) { } ngAfterViewInit() { this.sliderOne.paginationBulletRender = (index, className) => { return `<span class="custom-pagination ${className}>${index + 1}</span>`; }; this.sliderTwo.paginationBulletRender = (index, className) => { return `<span class="custom-pagination-2 ${className}>${index + 1}</span>`; }; this.sliderThree.paginationBulletRender = (index, className) => { return `<span class="custom-pagination-3 bullet-icon-${index + 1} ${className}></span>`; }; } } ```
/content/code_sandbox/src/pages/slide/slide-custom-pagination/slide-custom-pagination.ts
xml
2016-11-04T05:48:23
2024-08-03T05:22:54
ionic3-components
yannbf/ionic3-components
1,679
378
```xml license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to by applicable law or agreed to in writing, software distributed under the <project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-all</artifactId> <version>5.3.1-SNAPSHOT</version> </parent> <artifactId>rocketmq-auth</artifactId> <name>rocketmq-auth ${project.version}</name> <properties> <project.root>${basedir}/..</project.root> </properties> <dependencies> <dependency> <groupId>${project.groupId}</groupId> <artifactId>rocketmq-proto</artifactId> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>rocketmq-remoting</artifactId> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>rocketmq-common</artifactId> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> <dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-acl</artifactId> </dependency> <dependency> <groupId>com.github.ben-manes.caffeine</groupId> <artifactId>caffeine</artifactId> <exclusions> <exclusion> <groupId>org.checkerframework</groupId> <artifactId>checker-qual</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${maven-surefire-plugin.version}</version> <configuration> <forkCount>1</forkCount> <reuseForks>false</reuseForks> </configuration> </plugin> </plugins> </build> </project> ```
/content/code_sandbox/auth/pom.xml
xml
2016-11-30T08:00:08
2024-08-16T09:03:42
rocketmq
apache/rocketmq
20,962
568
```xml import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { Subscription } from 'rxjs/Rx'; import { CursosService } from '../cursos.service'; @Component({ selector: 'app-curso-detalhe', templateUrl: './curso-detalhe.component.html', styleUrls: ['./curso-detalhe.component.css'] }) export class CursoDetalheComponent implements OnInit { id: number; inscricao: Subscription; curso: any; constructor( private route: ActivatedRoute, private router: Router, private cursosService: CursosService ) { //this.id = this.route.snapshot.params['id']; //console.log(this.route); } ngOnInit() { this.inscricao = this.route.params.subscribe( (params: any) => { this.id = params['id']; this.curso = this.cursosService.getCurso(this.id); if (this.curso == null){ this.router.navigate(['/cursos/naoEncontrado']); } } ); } ngOnDestroy(){ this.inscricao.unsubscribe(); } } ```
/content/code_sandbox/rotas/src/app/cursos/curso-detalhe/curso-detalhe.component.ts
xml
2016-07-02T18:58:48
2024-08-15T23:36:46
curso-angular
loiane/curso-angular
1,910
246
```xml <?xml version="1.0" encoding="utf-8"?> <resources> <item name="BaseQuickAdapter_viewholder_support" type="id"/> <item name="BaseQuickAdapter_swiping_support" type="id"/> <item name="BaseQuickAdapter_dragging_support" type="id"/> <item name="BaseQuickAdapter_databinding_support" type="id"/> <item name="BaseQuickAdapter_key_multi" type="id"/> <item name="BaseQuickAdapter_empty_view" type="id"/> </resources> ```
/content/code_sandbox/library/src/main/res/values/ids.xml
xml
2016-04-10T07:40:11
2024-08-16T08:32:36
BaseRecyclerViewAdapterHelper
CymChad/BaseRecyclerViewAdapterHelper
24,251
116
```xml // Libraries import React, {PureComponent} from 'react' // Decorators import {ErrorHandling} from 'src/shared/decorators/errors' interface Props { link: string } class TooltipLink extends PureComponent<Props> { public render() { const {link} = this.props return ( <p> Still have questions? Check out the{' '} <a target="_blank" href={link}> Flux Docs </a> . </p> ) } } export default ErrorHandling(TooltipLink) ```
/content/code_sandbox/ui/src/flux/components/flux_functions_toolbar/TooltipLink.tsx
xml
2016-08-24T23:28:56
2024-08-13T19:50:03
chronograf
influxdata/chronograf
1,494
119
```xml /** * @vitest-environment jsdom */ import { it, describe, expect, beforeAll } from 'vitest'; import { CovalentBadge } from './badge'; describe('Covalent Badge', () => { let badgeElements: NodeListOf<CovalentBadge>; beforeAll(() => { document.body.innerHTML = `<cv-badge content="99"></cv-badge> <cv-badge content="0" showZero="true"></cv-badge> <cv-badge content="99" size="small"></cv-badge> <cv-badge content="1000" max="999"></cv-badge> `; badgeElements = document.body.querySelectorAll('cv-badge'); }); it('should work', () => { expect(new CovalentBadge()).toBeDefined(); }); it('should show content', () => { expect(badgeElements[0]?.shadowRoot?.innerHTML).toContain('99'); }); it('should show zero when showZero prop is true', () => { expect(badgeElements[1]?.shadowRoot?.innerHTML).toContain('0'); }); it('should not show content when size is small', () => { if (badgeElements[2]?.shadowRoot?.innerHTML) { expect(badgeElements[2]?.shadowRoot?.innerHTML).not.toContain('99'); } }); it('should cap the content based on max prop', () => { expect(badgeElements[3]?.shadowRoot?.innerHTML).toContain('999+'); }); }); ```
/content/code_sandbox/libs/components/src/badge/badge.spec.ts
xml
2016-07-11T23:30:52
2024-08-15T15:20:45
covalent
Teradata/covalent
2,228
318
```xml const SessionRecoveryInProgressModalIllustration = ({ hoursRemaining }: { hoursRemaining: number }) => { return ( <svg width="276" height="156" viewBox="0 0 276 156" fill="none" xmlns="path_to_url"> <g clip-path="url(#clip0_33_17820)"> <path d="M216 135H60V42.8255C60 37.9715 63.8331 34 68.5179 34H207.482C212.167 34 216 37.9715 216 42.8255V135Z" fill="#372580" /> <path d="M209 135H67V43.1579C67 41.9673 67.9222 41 69.0572 41H206.872C208.007 41 208.929 41.9673 208.929 43.1579V135H209Z" fill="white" /> <path d="M233.075 138H42.9252C41.2842 138 40 136.629 40 134.876V133.124C40 131.371 41.2842 130 42.9252 130H233.075C234.716 130 236 131.371 236 133.124V134.876C236 136.629 234.644 138 233.075 138Z" fill="#EAE8E5" /> <path d="M147.591 134H128.409C125.934 134 124 132.175 124 130H152C152 132.175 150.066 134 147.591 134Z" fill="#D1CFCD" /> <path d="M79.7 86C79.7 81.9683 82.9683 78.7 87 78.7H189C193.032 78.7 196.3 81.9683 196.3 86V96C196.3 100.032 193.032 103.3 189 103.3H87C82.9683 103.3 79.7 100.032 79.7 96V86Z" fill="white" stroke="#F0ECE6" stroke-width="1.4" /> <path d="M94.476 90.6552H92.262L93.8256 89.0869C93.9094 88.9865 93.9526 88.8583 93.9467 88.7277C93.9408 88.597 93.8862 88.4733 93.7937 88.3808C93.7013 88.2884 93.5775 88.2338 93.4469 88.2279C93.3162 88.222 93.1881 88.2652 93.0876 88.3489L91.5194 89.9172V87.7032C91.5194 87.5642 91.4642 87.4309 91.3659 87.3327C91.2676 87.2344 91.1344 87.1792 90.9954 87.1792C90.8564 87.1792 90.7231 87.2344 90.6249 87.3327C90.5266 87.4309 90.4714 87.5642 90.4714 87.7032V89.9172L88.9077 88.3489C88.8616 88.2915 88.8038 88.2445 88.7382 88.2108C88.6726 88.1772 88.6007 88.1578 88.5271 88.1538C88.4535 88.1498 88.3799 88.1614 88.311 88.1877C88.2422 88.2141 88.1797 88.2547 88.1276 88.3068C88.0755 88.3589 88.0349 88.4214 88.0085 88.4902C87.9822 88.559 87.9706 88.6327 87.9746 88.7063C87.9786 88.7799 87.998 88.8518 88.0316 88.9174C88.0653 88.983 88.1123 89.0407 88.1697 89.0869L89.738 90.6552H87.524C87.385 90.6552 87.2517 90.7104 87.1535 90.8087C87.0552 90.9069 87 91.0402 87 91.1792C87 91.3182 87.0552 91.4514 87.1535 91.5497C87.2517 91.648 87.385 91.7032 87.524 91.7032H89.738L88.1697 93.2715C88.1138 93.3181 88.0683 93.3758 88.0359 93.441C88.0036 93.5063 87.9852 93.5775 87.9819 93.6502C87.9786 93.7229 87.9905 93.7955 88.0168 93.8634C88.0432 93.9313 88.0833 93.9929 88.1348 94.0444C88.1863 94.0958 88.2479 94.136 88.3158 94.1624C88.3837 94.1887 88.4563 94.2006 88.529 94.1973C88.6017 94.194 88.6729 94.1756 88.7382 94.1433C88.8034 94.1109 88.8611 94.0654 88.9077 94.0095L90.4714 92.4412V94.6552C90.4714 94.7942 90.5266 94.9275 90.6249 95.0257C90.7231 95.124 90.8564 95.1792 90.9954 95.1792C91.1344 95.1792 91.2676 95.124 91.3659 95.0257C91.4642 94.9275 91.5194 94.7942 91.5194 94.6552V92.4412L93.0876 94.0095C93.1343 94.0654 93.192 94.1109 93.2572 94.1433C93.3224 94.1756 93.3937 94.194 93.4664 94.1973C93.5391 94.2006 93.6117 94.1887 93.6796 94.1624C93.7475 94.136 93.8091 94.0958 93.8606 94.0444C93.912 93.9929 93.9522 93.9313 93.9786 93.8634C94.0049 93.7955 94.0168 93.7229 94.0135 93.6502C94.0102 93.5775 93.9918 93.5063 93.9595 93.441C93.9271 93.3758 93.8816 93.3181 93.8256 93.2715L92.262 91.7032H94.476C94.615 91.7032 94.7483 91.648 94.8465 91.5497C94.9448 91.4514 95 91.3182 95 91.1792C95 91.0402 94.9448 90.9069 94.8465 90.8087C94.7483 90.7104 94.615 90.6552 94.476 90.6552Z" fill="#706D6B" /> <path d="M110.143 90.6552H107.929L109.492 89.0869C109.576 88.9865 109.619 88.8583 109.613 88.7277C109.608 88.597 109.553 88.4733 109.46 88.3808C109.368 88.2884 109.244 88.2338 109.114 88.2279C108.983 88.222 108.855 88.2652 108.754 88.3489L107.186 89.9172V87.7032C107.186 87.5642 107.131 87.4309 107.033 87.3327C106.934 87.2344 106.801 87.1792 106.662 87.1792C106.523 87.1792 106.39 87.2344 106.292 87.3327C106.193 87.4309 106.138 87.5642 106.138 87.7032V89.9172L104.574 88.3489C104.528 88.2915 104.471 88.2445 104.405 88.2108C104.339 88.1772 104.267 88.1578 104.194 88.1538C104.12 88.1498 104.047 88.1614 103.978 88.1877C103.909 88.2141 103.846 88.2547 103.794 88.3068C103.742 88.3589 103.702 88.4214 103.675 88.4902C103.649 88.559 103.637 88.6327 103.641 88.7063C103.645 88.7799 103.665 88.8518 103.698 88.9174C103.732 88.983 103.779 89.0407 103.836 89.0869L105.405 90.6552H103.191C103.052 90.6552 102.918 90.7104 102.82 90.8087C102.722 90.9069 102.667 91.0402 102.667 91.1792C102.667 91.3182 102.722 91.4514 102.82 91.5497C102.918 91.648 103.052 91.7032 103.191 91.7032H105.405L103.836 93.2715C103.781 93.3181 103.735 93.3758 103.703 93.441C103.67 93.5063 103.652 93.5775 103.649 93.6502C103.645 93.7229 103.657 93.7955 103.684 93.8634C103.71 93.9313 103.75 93.9929 103.802 94.0444C103.853 94.0958 103.915 94.136 103.983 94.1624C104.05 94.1887 104.123 94.2006 104.196 94.1973C104.268 94.194 104.34 94.1756 104.405 94.1433C104.47 94.1109 104.528 94.0654 104.574 94.0095L106.138 92.4412V94.6552C106.138 94.7942 106.193 94.9275 106.292 95.0257C106.39 95.124 106.523 95.1792 106.662 95.1792C106.801 95.1792 106.934 95.124 107.033 95.0257C107.131 94.9275 107.186 94.7942 107.186 94.6552V92.4412L108.754 94.0095C108.801 94.0654 108.859 94.1109 108.924 94.1433C108.989 94.1756 109.06 94.194 109.133 94.1973C109.206 94.2006 109.278 94.1887 109.346 94.1624C109.414 94.136 109.476 94.0958 109.527 94.0444C109.579 93.9929 109.619 93.9313 109.645 93.8634C109.672 93.7955 109.684 93.7229 109.68 93.6502C109.677 93.5775 109.659 93.5063 109.626 93.441C109.594 93.3758 109.548 93.3181 109.492 93.2715L107.929 91.7032H110.143C110.282 91.7032 110.415 91.648 110.513 91.5497C110.612 91.4514 110.667 91.3182 110.667 91.1792C110.667 91.0402 110.612 90.9069 110.513 90.8087C110.415 90.7104 110.282 90.6552 110.143 90.6552Z" fill="#706D6B" /> <path d="M125.809 90.6552H123.595L125.159 89.0869C125.243 88.9865 125.286 88.8583 125.28 88.7277C125.274 88.597 125.219 88.4733 125.127 88.3808C125.035 88.2884 124.911 88.2338 124.78 88.2279C124.649 88.222 124.521 88.2652 124.421 88.3489L122.853 89.9172V87.7032C122.853 87.5642 122.797 87.4309 122.699 87.3327C122.601 87.2344 122.468 87.1792 122.329 87.1792C122.19 87.1792 122.056 87.2344 121.958 87.3327C121.86 87.4309 121.805 87.5642 121.805 87.7032V89.9172L120.241 88.3489C120.195 88.2915 120.137 88.2445 120.071 88.2108C120.006 88.1772 119.934 88.1578 119.86 88.1538C119.787 88.1498 119.713 88.1614 119.644 88.1877C119.575 88.2141 119.513 88.2547 119.461 88.3068C119.409 88.3589 119.368 88.4214 119.342 88.4902C119.315 88.559 119.304 88.6327 119.308 88.7063C119.312 88.7799 119.331 88.8518 119.365 88.9174C119.399 88.983 119.446 89.0407 119.503 89.0869L121.071 90.6552H118.857C118.718 90.6552 118.585 90.7104 118.487 90.8087C118.388 90.9069 118.333 91.0402 118.333 91.1792C118.333 91.3182 118.388 91.4514 118.487 91.5497C118.585 91.648 118.718 91.7032 118.857 91.7032H121.071L119.503 93.2715C119.447 93.3181 119.402 93.3758 119.369 93.441C119.337 93.5063 119.318 93.5775 119.315 93.6502C119.312 93.7229 119.324 93.7955 119.35 93.8634C119.376 93.9313 119.417 93.9929 119.468 94.0444C119.52 94.0958 119.581 94.136 119.649 94.1624C119.717 94.1887 119.79 94.2006 119.862 94.1973C119.935 94.194 120.006 94.1756 120.071 94.1433C120.137 94.1109 120.194 94.0654 120.241 94.0095L121.805 92.4412V94.6552C121.805 94.7942 121.86 94.9275 121.958 95.0257C122.056 95.124 122.19 95.1792 122.329 95.1792C122.468 95.1792 122.601 95.124 122.699 95.0257C122.797 94.9275 122.853 94.7942 122.853 94.6552V92.4412L124.421 94.0095C124.468 94.0654 124.525 94.1109 124.59 94.1433C124.656 94.1756 124.727 94.194 124.8 94.1973C124.872 94.2006 124.945 94.1887 125.013 94.1624C125.081 94.136 125.142 94.0958 125.194 94.0444C125.245 93.9929 125.285 93.9313 125.312 93.8634C125.338 93.7955 125.35 93.7229 125.347 93.6502C125.343 93.5775 125.325 93.5063 125.293 93.441C125.26 93.3758 125.215 93.3181 125.159 93.2715L123.595 91.7032H125.809C125.948 91.7032 126.082 91.648 126.18 91.5497C126.278 91.4514 126.333 91.3182 126.333 91.1792C126.333 91.0402 126.278 90.9069 126.18 90.8087C126.082 90.7104 125.948 90.6552 125.809 90.6552Z" fill="#706D6B" /> <path d="M141.476 90.6552H139.262L140.826 89.0869C140.909 88.9865 140.953 88.8583 140.947 88.7277C140.941 88.597 140.886 88.4733 140.794 88.3808C140.701 88.2884 140.578 88.2338 140.447 88.2279C140.316 88.222 140.188 88.2652 140.088 88.3489L138.519 89.9172V87.7032C138.519 87.5642 138.464 87.4309 138.366 87.3327C138.268 87.2344 138.134 87.1792 137.995 87.1792C137.856 87.1792 137.723 87.2344 137.625 87.3327C137.527 87.4309 137.471 87.5642 137.471 87.7032V89.9172L135.908 88.3489C135.862 88.2915 135.804 88.2445 135.738 88.2108C135.673 88.1772 135.601 88.1578 135.527 88.1538C135.453 88.1498 135.38 88.1614 135.311 88.1877C135.242 88.2141 135.18 88.2547 135.128 88.3068C135.075 88.3589 135.035 88.4214 135.009 88.4902C134.982 88.559 134.971 88.6327 134.975 88.7063C134.979 88.7799 134.998 88.8518 135.032 88.9174C135.065 88.983 135.112 89.0407 135.17 89.0869L136.738 90.6552H134.524C134.385 90.6552 134.252 90.7104 134.153 90.8087C134.055 90.9069 134 91.0402 134 91.1792C134 91.3182 134.055 91.4514 134.153 91.5497C134.252 91.648 134.385 91.7032 134.524 91.7032H136.738L135.17 93.2715C135.114 93.3181 135.068 93.3758 135.036 93.441C135.004 93.5063 134.985 93.5775 134.982 93.6502C134.979 93.7229 134.99 93.7955 135.017 93.8634C135.043 93.9313 135.083 93.9929 135.135 94.0444C135.186 94.0958 135.248 94.136 135.316 94.1624C135.384 94.1887 135.456 94.2006 135.529 94.1973C135.602 94.194 135.673 94.1756 135.738 94.1433C135.803 94.1109 135.861 94.0654 135.908 94.0095L137.471 92.4412V94.6552C137.471 94.7942 137.527 94.9275 137.625 95.0257C137.723 95.124 137.856 95.1792 137.995 95.1792C138.134 95.1792 138.268 95.124 138.366 95.0257C138.464 94.9275 138.519 94.7942 138.519 94.6552V92.4412L140.088 94.0095C140.134 94.0654 140.192 94.1109 140.257 94.1433C140.322 94.1756 140.394 94.194 140.466 94.1973C140.539 94.2006 140.612 94.1887 140.68 94.1624C140.747 94.136 140.809 94.0958 140.861 94.0444C140.912 93.9929 140.952 93.9313 140.979 93.8634C141.005 93.7955 141.017 93.7229 141.014 93.6502C141.01 93.5775 140.992 93.5063 140.959 93.441C140.927 93.3758 140.882 93.3181 140.826 93.2715L139.262 91.7032H141.476C141.615 91.7032 141.748 91.648 141.847 91.5497C141.945 91.4514 142 91.3182 142 91.1792C142 91.0402 141.945 90.9069 141.847 90.8087C141.748 90.7104 141.615 90.6552 141.476 90.6552Z" fill="#706D6B" /> <path d="M157.143 90.6552H154.929L156.492 89.0869C156.576 88.9865 156.619 88.8583 156.613 88.7277C156.608 88.597 156.553 88.4733 156.46 88.3808C156.368 88.2884 156.244 88.2338 156.114 88.2279C155.983 88.222 155.855 88.2652 155.754 88.3489L154.186 89.9172V87.7032C154.186 87.5642 154.131 87.4309 154.033 87.3327C153.934 87.2344 153.801 87.1792 153.662 87.1792C153.523 87.1792 153.39 87.2344 153.292 87.3327C153.193 87.4309 153.138 87.5642 153.138 87.7032V89.9172L151.574 88.3489C151.528 88.2915 151.471 88.2445 151.405 88.2108C151.339 88.1772 151.267 88.1578 151.194 88.1538C151.12 88.1498 151.047 88.1614 150.978 88.1877C150.909 88.2141 150.846 88.2547 150.794 88.3068C150.742 88.3589 150.702 88.4214 150.675 88.4902C150.649 88.559 150.637 88.6327 150.641 88.7063C150.645 88.7799 150.665 88.8518 150.698 88.9174C150.732 88.983 150.779 89.0407 150.836 89.0869L152.405 90.6552H150.191C150.052 90.6552 149.918 90.7104 149.82 90.8087C149.722 90.9069 149.667 91.0402 149.667 91.1792C149.667 91.3182 149.722 91.4514 149.82 91.5497C149.918 91.648 150.052 91.7032 150.191 91.7032H152.405L150.836 93.2715C150.781 93.3181 150.735 93.3758 150.703 93.441C150.67 93.5063 150.652 93.5775 150.649 93.6502C150.645 93.7229 150.657 93.7955 150.684 93.8634C150.71 93.9313 150.75 93.9929 150.802 94.0444C150.853 94.0958 150.915 94.136 150.983 94.1624C151.05 94.1887 151.123 94.2006 151.196 94.1973C151.268 94.194 151.34 94.1756 151.405 94.1433C151.47 94.1109 151.528 94.0654 151.574 94.0095L153.138 92.4412V94.6552C153.138 94.7942 153.193 94.9275 153.292 95.0257C153.39 95.124 153.523 95.1792 153.662 95.1792C153.801 95.1792 153.934 95.124 154.033 95.0257C154.131 94.9275 154.186 94.7942 154.186 94.6552V92.4412L155.754 94.0095C155.801 94.0654 155.859 94.1109 155.924 94.1433C155.989 94.1756 156.06 94.194 156.133 94.1973C156.206 94.2006 156.278 94.1887 156.346 94.1624C156.414 94.136 156.476 94.0958 156.527 94.0444C156.579 93.9929 156.619 93.9313 156.645 93.8634C156.672 93.7955 156.684 93.7229 156.68 93.6502C156.677 93.5775 156.659 93.5063 156.626 93.441C156.594 93.3758 156.548 93.3181 156.492 93.2715L154.929 91.7032H157.143C157.282 91.7032 157.415 91.648 157.513 91.5497C157.612 91.4514 157.667 91.3182 157.667 91.1792C157.667 91.0402 157.612 90.9069 157.513 90.8087C157.415 90.7104 157.282 90.6552 157.143 90.6552Z" fill="#706D6B" /> <path d="M172.809 90.6552H170.595L172.159 89.0869C172.243 88.9865 172.286 88.8583 172.28 88.7277C172.274 88.597 172.219 88.4733 172.127 88.3808C172.035 88.2884 171.911 88.2338 171.78 88.2279C171.649 88.222 171.521 88.2652 171.421 88.3489L169.853 89.9172V87.7032C169.853 87.5642 169.797 87.4309 169.699 87.3327C169.601 87.2344 169.468 87.1792 169.329 87.1792C169.19 87.1792 169.056 87.2344 168.958 87.3327C168.86 87.4309 168.805 87.5642 168.805 87.7032V89.9172L167.241 88.3489C167.195 88.2915 167.137 88.2445 167.071 88.2108C167.006 88.1772 166.934 88.1578 166.86 88.1538C166.787 88.1498 166.713 88.1614 166.644 88.1877C166.575 88.2141 166.513 88.2547 166.461 88.3068C166.409 88.3589 166.368 88.4214 166.342 88.4902C166.315 88.559 166.304 88.6327 166.308 88.7063C166.312 88.7799 166.331 88.8518 166.365 88.9174C166.399 88.983 166.446 89.0407 166.503 89.0869L168.071 90.6552H165.857C165.718 90.6552 165.585 90.7104 165.487 90.8087C165.388 90.9069 165.333 91.0402 165.333 91.1792C165.333 91.3182 165.388 91.4514 165.487 91.5497C165.585 91.648 165.718 91.7032 165.857 91.7032H168.071L166.503 93.2715C166.447 93.3181 166.402 93.3758 166.369 93.441C166.337 93.5063 166.318 93.5775 166.315 93.6502C166.312 93.7229 166.324 93.7955 166.35 93.8634C166.376 93.9313 166.417 93.9929 166.468 94.0444C166.52 94.0958 166.581 94.136 166.649 94.1624C166.717 94.1887 166.79 94.2006 166.862 94.1973C166.935 94.194 167.006 94.1756 167.071 94.1433C167.137 94.1109 167.194 94.0654 167.241 94.0095L168.805 92.4412V94.6552C168.805 94.7942 168.86 94.9275 168.958 95.0257C169.056 95.124 169.19 95.1792 169.329 95.1792C169.468 95.1792 169.601 95.124 169.699 95.0257C169.797 94.9275 169.853 94.7942 169.853 94.6552V92.4412L171.421 94.0095C171.468 94.0654 171.525 94.1109 171.59 94.1433C171.656 94.1756 171.727 94.194 171.8 94.1973C171.872 94.2006 171.945 94.1887 172.013 94.1624C172.081 94.136 172.142 94.0958 172.194 94.0444C172.245 93.9929 172.285 93.9313 172.312 93.8634C172.338 93.7955 172.35 93.7229 172.347 93.6502C172.343 93.5775 172.325 93.5063 172.293 93.441C172.26 93.3758 172.215 93.3181 172.159 93.2715L170.595 91.7032H172.809C172.948 91.7032 173.082 91.648 173.18 91.5497C173.278 91.4514 173.333 91.3182 173.333 91.1792C173.333 91.0402 173.278 90.9069 173.18 90.8087C173.082 90.7104 172.948 90.6552 172.809 90.6552Z" fill="#706D6B" /> <path d="M188.476 90.6552H186.262L187.826 89.0869C187.909 88.9865 187.953 88.8583 187.947 88.7277C187.941 88.597 187.886 88.4733 187.794 88.3808C187.701 88.2884 187.578 88.2338 187.447 88.2279C187.316 88.222 187.188 88.2652 187.088 88.3489L185.519 89.9172V87.7032C185.519 87.5642 185.464 87.4309 185.366 87.3327C185.268 87.2344 185.134 87.1792 184.995 87.1792C184.856 87.1792 184.723 87.2344 184.625 87.3327C184.527 87.4309 184.471 87.5642 184.471 87.7032V89.9172L182.908 88.3489C182.862 88.2915 182.804 88.2445 182.738 88.2108C182.673 88.1772 182.601 88.1578 182.527 88.1538C182.453 88.1498 182.38 88.1614 182.311 88.1877C182.242 88.2141 182.18 88.2547 182.128 88.3068C182.075 88.3589 182.035 88.4214 182.009 88.4902C181.982 88.559 181.971 88.6327 181.975 88.7063C181.979 88.7799 181.998 88.8518 182.032 88.9174C182.065 88.983 182.112 89.0407 182.17 89.0869L183.738 90.6552H181.524C181.385 90.6552 181.252 90.7104 181.153 90.8087C181.055 90.9069 181 91.0402 181 91.1792C181 91.3182 181.055 91.4514 181.153 91.5497C181.252 91.648 181.385 91.7032 181.524 91.7032H183.738L182.17 93.2715C182.114 93.3181 182.068 93.3758 182.036 93.441C182.004 93.5063 181.985 93.5775 181.982 93.6502C181.979 93.7229 181.99 93.7955 182.017 93.8634C182.043 93.9313 182.083 93.9929 182.135 94.0444C182.186 94.0958 182.248 94.136 182.316 94.1624C182.384 94.1887 182.456 94.2006 182.529 94.1973C182.602 94.194 182.673 94.1756 182.738 94.1433C182.803 94.1109 182.861 94.0654 182.908 94.0095L184.471 92.4412V94.6552C184.471 94.7942 184.527 94.9275 184.625 95.0257C184.723 95.124 184.856 95.1792 184.995 95.1792C185.134 95.1792 185.268 95.124 185.366 95.0257C185.464 94.9275 185.519 94.7942 185.519 94.6552V92.4412L187.088 94.0095C187.134 94.0654 187.192 94.1109 187.257 94.1433C187.322 94.1756 187.394 94.194 187.466 94.1973C187.539 94.2006 187.612 94.1887 187.68 94.1624C187.747 94.136 187.809 94.0958 187.861 94.0444C187.912 93.9929 187.952 93.9313 187.979 93.8634C188.005 93.7955 188.017 93.7229 188.014 93.6502C188.01 93.5775 187.992 93.5063 187.959 93.441C187.927 93.3758 187.882 93.3181 187.826 93.2715L186.262 91.7032H188.476C188.615 91.7032 188.748 91.648 188.847 91.5497C188.945 91.4514 189 91.3182 189 91.1792C189 91.0402 188.945 90.9069 188.847 90.8087C188.748 90.7104 188.615 90.6552 188.476 90.6552Z" fill="#706D6B" /> <path d="M14 69C14 58.5066 22.5066 50 33 50C43.4934 50 52 58.5066 52 69V88H33C22.5066 88 14 79.4934 14 69Z" fill="url(#paint0_linear_33_17820)" /> <path fill-rule="evenodd" clip-rule="evenodd" d="M37.9455 63.2756V65.1182H39.8177C40.4581 65.1182 41 65.6142 41 66.252V75.8661C41 76.4803 40.4828 77 39.8177 77H27.1823C26.5419 77 26 76.5039 26 75.8661V66.252C26 65.6379 26.5172 65.1182 27.1823 65.1182H29.0293V63.2756C29.0293 60.9134 31.0244 59 33.4874 59C35.9505 59 37.9455 60.9134 37.9455 63.2756ZM36.0683 63.2756V65.1182H30.9558V63.2756C30.9558 61.5748 32.3101 60.824 33.512 60.824C34.714 60.824 36.0683 61.5748 36.0683 63.2756ZM33.5 68C34.3333 68 35 68.6696 35 69.5065C35 70.0804 34.6905 70.5826 34.2143 70.8217L34.8333 73.5H32.1667L32.7857 70.8217C32.3095 70.5587 32 70.0804 32 69.5065C32 68.6696 32.6667 68 33.5 68Z" fill="white" /> <g opacity="0.2" filter="url(#filter0_f_33_17820)"> <path d="M119 95C119 85.0589 127.059 77 137 77H139C148.941 77 157 85.0589 157 95C157 104.941 148.941 113 139 113H137C127.059 113 119 104.941 119 95Z" fill="#1F1548" /> </g> <rect x="114" y="63" width="48" height="48" rx="24" fill="url(#paint1_linear_33_17820)" /> <g filter="url(#filter1_i_33_17820)"> <circle cx="138" cy="87" r="20" fill="url(#paint2_linear_33_17820)" /> </g> <path d="M138.455 75V87.1129L133 93.5455" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> <rect x="142" y="96" width="26" height="21" rx="5.83333" fill="url(#paint3_linear_33_17820)" /> <text x="147" y="111" fontWeight={800} font-size="13" fill="white"> {hoursRemaining} </text> </g> <defs> <filter id="filter0_f_33_17820" x="109.3" y="67.3" width="57.4" height="55.4" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB" > <feFlood flood-opacity="0" result="BackgroundImageFix" /> <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" /> <feGaussianBlur stdDeviation="4.85" result="effect1_foregroundBlur_33_17820" /> </filter> <filter id="filter1_i_33_17820" x="118" y="67" width="40" height="40.3333" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB" > <feFlood flood-opacity="0" result="BackgroundImageFix" /> <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" /> <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" /> <feOffset dy="0.333333" /> <feGaussianBlur stdDeviation="0.166667" /> <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" /> <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0" /> <feBlend mode="normal" in2="shape" result="effect1_innerShadow_33_17820" /> </filter> <linearGradient id="paint0_linear_33_17820" x1="37.0714" y1="50" x2="17.2885" y2="93.4808" gradientUnits="userSpaceOnUse" > <stop stop-color="#FFD66C" /> <stop offset="1" stop-color="#FF8E4F" /> </linearGradient> <linearGradient id="paint1_linear_33_17820" x1="187" y1="34.5" x2="126.5" y2="124.5" gradientUnits="userSpaceOnUse" > <stop offset="0.217324" stop-color="white" /> <stop offset="0.621556" stop-color="#ECEAE6" /> <stop offset="0.936658" stop-color="#BEBBB9" /> </linearGradient> <linearGradient id="paint2_linear_33_17820" x1="138" y1="67" x2="138" y2="107" gradientUnits="userSpaceOnUse" > <stop stop-color="#8F8F8F" /> <stop offset="1" /> </linearGradient> <linearGradient id="paint3_linear_33_17820" x1="155" y1="91.7045" x2="155" y2="117.955" gradientUnits="userSpaceOnUse" > <stop stop-color="#FFA693" /> <stop offset="1" stop-color="#F43D5E" /> </linearGradient> <clipPath id="clip0_33_17820"> <rect width="276" height="156" fill="white" /> </clipPath> </defs> </svg> ); }; export default SessionRecoveryInProgressModalIllustration; ```
/content/code_sandbox/packages/components/containers/account/sessionRecovery/SessionRecoveryInProgressModalIllustration.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
11,533
```xml import "reflect-metadata" import { closeTestingConnections, createTestingConnections, reloadTestingDatabases, } from "../../utils/test-utils" import { DataSource } from "../../../src/data-source/DataSource" import { Device } from "./entity/Device" import { DeviceInstance } from "./entity/DeviceInstance" describe("github issues > #695 Join columns are not using correct length", () => { let connections: DataSource[] before( async () => (connections = await createTestingConnections({ entities: [__dirname + "/entity/*{.js,.ts}"], enabledDrivers: ["mysql"], })), ) beforeEach(() => reloadTestingDatabases(connections)) after(() => closeTestingConnections(connections)) it("should set correct length on to join columns", () => Promise.all( connections.map(async (connection) => { const queryRunner = connection.createQueryRunner() const table = await queryRunner.getTable("device_instances") await queryRunner.release() const device = new Device() device.id = "ABCDEFGHIJKL" device.registrationToken = "123456" await connection.manager.save(device) const deviceInstance = new DeviceInstance() deviceInstance.id = "new post" deviceInstance.device = device deviceInstance.instance = 10 deviceInstance.type = "type" await connection.manager.save(deviceInstance) table! .findColumnByName("device_id")! .type.should.be.equal("char") table! .findColumnByName("device_id")! .length!.should.be.equal("12") }), )) }) ```
/content/code_sandbox/test/github-issues/695/issue-695.ts
xml
2016-02-29T07:41:14
2024-08-16T18:28:52
typeorm
typeorm/typeorm
33,875
339
```xml import { Localized } from "@fluent/react/compat"; import cn from "classnames"; import { FORM_ERROR } from "final-form"; import React, { FunctionComponent, useCallback } from "react"; import { Field, Form } from "react-final-form"; import Main from "coral-auth/components/Main"; import { getViewURL } from "coral-auth/helpers"; import useResizePopup from "coral-auth/hooks/useResizePopup"; import { SetViewMutation } from "coral-auth/mutations"; import { useCoralContext } from "coral-framework/lib/bootstrap"; import { InvalidRequestError } from "coral-framework/lib/errors"; import { streamColorFromMeta } from "coral-framework/lib/form"; import { useMutation } from "coral-framework/lib/relay"; import { composeValidators, required, validateEmail, } from "coral-framework/lib/validation"; import CLASSES from "coral-stream/classes"; import { AlertCircleIcon, SvgIcon } from "coral-ui/components/icons"; import { Flex, FormField, InputLabel, TextField } from "coral-ui/components/v2"; import { Button, CallOut, ValidationMessage } from "coral-ui/components/v3"; import ForgotPasswordMutation from "./ForgotPasswordMutation"; import styles from "./ForgotPasswordForm.css"; interface FormProps { email: string; } interface Props { email: string | null; onCheckEmail: (email: string) => void; } const ForgotPasswordForm: FunctionComponent<Props> = ({ email, onCheckEmail, }) => { const { window } = useCoralContext(); const ref = useResizePopup(); const signInHref = getViewURL("SIGN_IN", window); const forgotPassword = useMutation(ForgotPasswordMutation); const setView = useMutation(SetViewMutation); const onSubmit = useCallback( async (form: FormProps) => { try { await forgotPassword(form); onCheckEmail(form.email); } catch (error) { if (error instanceof InvalidRequestError) { return error.invalidArgs; } return { [FORM_ERROR]: error.message }; } return; }, [forgotPassword, onCheckEmail] ); const onGotoSignIn = useCallback( (e: React.MouseEvent) => { setView({ view: "SIGN_IN", history: "push" }); if (e.preventDefault) { e.preventDefault(); } }, [setView] ); return ( <div ref={ref} data-testid="forgotPassword-container"> <div role="banner" className={cn(CLASSES.login.bar, styles.bar)}> <Localized id="forgotPassword-forgotPasswordHeader"> <div className={cn(CLASSES.login.title, styles.title)}> Forgot password? </div> </Localized> </div> {/* If an email address has been provided, then they are already logged in. */} {!email && ( <div role="region" className={cn(CLASSES.login.subBar, styles.subBar)}> <Flex alignItems="center" justifyContent="center"> <Button color="primary" variant="flat" fontFamily="primary" fontWeight="semiBold" fontSize="small" paddingSize="none" underline href={signInHref} onClick={onGotoSignIn} > <Localized id="forgotPassword-gotBackToSignIn"> Go back to sign in page </Localized> </Button> </Flex> </div> )} <Main id="forgot-password-main" data-testid="forgotPassword-main"> <Form onSubmit={onSubmit} initialValues={{ email: email ? email : "" }}> {({ handleSubmit, submitting, submitError }) => ( <form autoComplete="off" onSubmit={handleSubmit}> <Localized id="forgotPassword-enterEmailAndGetALink"> <div className={styles.description}> Enter your email address below and we will send you a link to reset your password. </div> </Localized> {submitError && ( <div className={cn(CLASSES.login.errorContainer, styles.error)}> <CallOut className={CLASSES.login.error} color="error" icon={<SvgIcon Icon={AlertCircleIcon} />} title={submitError} /> </div> )} <div className={cn(CLASSES.login.field, styles.field)}> <Field name="email" validate={composeValidators(required, validateEmail)} > {({ input, meta }) => ( <FormField> <Localized id="forgotPassword-emailAddressLabel"> <InputLabel htmlFor={input.name}> Email Address </InputLabel> </Localized> <Localized id="forgotPassword-emailAddressTextField" attrs={{ placeholder: true }} > <TextField {...input} id={input.name} placeholder="Email Address" color={streamColorFromMeta(meta)} disabled={submitting} fullWidth /> </Localized> <ValidationMessage meta={meta} /> </FormField> )} </Field> </div> <div className={styles.actions}> <Localized id="forgotPassword-sendEmailButton"> <Button variant="filled" color="primary" fontSize="medium" paddingSize="medium" upperCase fullWidth type="submit" disabled={submitting} > Send email </Button> </Localized> </div> </form> )} </Form> </Main> </div> ); }; export default ForgotPasswordForm; ```
/content/code_sandbox/client/src/core/client/auth/views/ForgotPassword/ForgotPasswordForm.tsx
xml
2016-10-31T16:14:05
2024-08-06T16:15:57
talk
coralproject/talk
1,881
1,194
```xml import { Element } from 'slate' export const input = { element: { children: [], type: 'bold' }, props: { type: 'bold' }, } export const test = ({ element, props }) => { return Element.matches(element, props) } export const output = true ```
/content/code_sandbox/packages/slate/test/interfaces/Element/matches/custom-prop-match.tsx
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
65
```xml import { Operation } from 'slate' export const input = { type: 'remove_node', path: [0], node: { children: [], }, } export const test = value => { return Operation.isOperation(value) } export const output = true ```
/content/code_sandbox/packages/slate/test/interfaces/Operation/isOperation/remove_node.tsx
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
60
```xml import * as React from 'react'; import { Steps } from 'storywright'; import { getStoryVariant, RTL, StoryWrightDecorator, TestWrapperDecorator } from '../utilities'; import { Rating, RatingSize } from '@fluentui/react'; export default { title: 'Rating', decorators: [ TestWrapperDecorator, StoryWrightDecorator( new Steps() .snapshot('default', { cropTo: '.testWrapper' }) .click('button.ms-Rating-button:nth-of-type(2)') .snapshot('click', { cropTo: '.testWrapper' }) .end(), ), ], }; export const Root = () => <Rating min={1} max={5} />; export const Rated = () => <Rating min={1} max={5} rating={2} />; export const RatedRTL = getStoryVariant(Rated, RTL); export const _Large = () => <Rating min={1} max={5} size={RatingSize.Large} />; export const Disabled = () => <Rating min={1} max={5} disabled />; ```
/content/code_sandbox/apps/vr-tests/src/stories/Rating.stories.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
229
```xml /// <reference types="cypress" /> // *********************************************** // This example commands.ts shows you how to // create various custom commands and overwrite // existing commands. // // For more comprehensive examples of custom // commands please read more here: // path_to_url // *********************************************** // // // -- This is a parent command -- // Cypress.Commands.add('login', (email, password) => { ... }) // // // -- This is a child command -- // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) // // // -- This is a dual command -- // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) // // // -- This will overwrite an existing command -- // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) // // declare global { // namespace Cypress { // interface Chainable { // login(email: string, password: string): Chainable<void> // drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element> // dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element> // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element> // } // } // } // Prevent TypeScript from reading file as legacy script export {}; ```
/content/code_sandbox/examples/with-cypress/cypress/support/commands.ts
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
292
```xml import { testInjector, factory, assertions, TempTestDirectorySandbox } from '@stryker-mutator/test-helpers'; import { expect } from 'chai'; import { createJasmineTestRunnerFactory, JasmineTestRunner } from '../../src/index.js'; describe('Infinite loop', () => { let sut: JasmineTestRunner; let sandbox: TempTestDirectorySandbox; beforeEach(async () => { sandbox = new TempTestDirectorySandbox('infinite-loop-instrumented'); await sandbox.init(); sut = testInjector.injector.injectFunction(createJasmineTestRunnerFactory('__stryker2__')); }); afterEach(async () => { await sandbox.dispose(); }); it('should be able to recover using a hit counter', async () => { // Arrange const options = factory.mutantRunOptions({ activeMutant: factory.mutant({ id: '19' }), testFilter: ['spec2'], hitLimit: 10, }); // Act const result = await sut.mutantRun(options); // Assert assertions.expectTimeout(result); expect(result.reason).contains('Hit limit reached'); }); it('should reset hit counter state correctly between runs', async () => { const firstResult = await sut.mutantRun( factory.mutantRunOptions({ activeMutant: factory.mutant({ id: '19' }), testFilter: ['spec2'], hitLimit: 10, }), ); const secondResult = await sut.mutantRun( factory.mutantRunOptions({ // 22 is a 'normal' mutant that should be killed activeMutant: factory.mutant({ id: '22' }), testFilter: ['spec2'], hitLimit: 10, }), ); // Assert assertions.expectTimeout(firstResult); assertions.expectKilled(secondResult); }); }); ```
/content/code_sandbox/packages/jasmine-runner/test/integration/timeout-on-infinite-loop.it.spec.ts
xml
2016-02-12T13:14:28
2024-08-15T18:38:25
stryker-js
stryker-mutator/stryker-js
2,561
412
```xml import { createDefaultEsmLegacyPreset, createDefaultEsmPreset, createDefaultLegacyPreset, createDefaultPreset, createJsWithBabelEsmLegacyPreset, createJsWithBabelEsmPreset, createJsWithBabelLegacyPreset, createJsWithBabelPreset, createJsWithTsEsmLegacyPreset, createJsWithTsEsmPreset, createJsWithTsLegacyPreset, createJsWithTsPreset, } from './create-jest-preset' const allPresets = { get defaults() { return createDefaultPreset() }, get defaultsLegacy() { return createDefaultLegacyPreset() }, get defaultsESM() { return createDefaultEsmPreset() }, get defaultsESMLegacy() { return createDefaultEsmLegacyPreset() }, get jsWithTs() { return createJsWithTsPreset() }, get jsWithTsLegacy() { return createJsWithTsLegacyPreset() }, get jsWithTsESM() { return createJsWithTsEsmPreset() }, get jsWithTsESMLegacy() { return createJsWithTsEsmLegacyPreset() }, get jsWithBabel() { return createJsWithBabelPreset() }, get jsWithBabelLegacy() { return createJsWithBabelLegacyPreset() }, get jsWithBabelESM() { return createJsWithBabelEsmPreset() }, get jsWithBabelESMLegacy() { return createJsWithBabelEsmLegacyPreset() }, } export default allPresets ```
/content/code_sandbox/src/presets/all-presets.ts
xml
2016-08-30T13:47:17
2024-08-16T15:05:40
ts-jest
kulshekhar/ts-jest
6,902
382
```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="ko" original="../LocalizableStrings.resx"> <body> <trans-unit id="stringExtractor_log_jsonElementAdded"> <source>Adding into localizable strings: {0}</source> <target state="translated"> : {0}</target> <note>{0} is a string similar to "postActions/0/manualInstructions/2/text"</note> </trans-unit> <trans-unit id="stringExtractor_log_jsonElementExcluded"> <source>The following element in the template.json will not be included in the localizations because it does not match any of the rules for localizable elements: {0}</source> <target state="translated">template.json . {0}</target> <note>{0} is any string from a json file. Such as "postActions", "myParameter", "author" etc.</note> </trans-unit> <trans-unit id="stringExtractor_log_jsonKeyIsNotUnique"> <source>Each child of '{0}' should have a unique id. Currently, the id '{1}' is shared by multiple children.</source> <target state="translated">{0} ID . ID {1}() .</target> <note>{0} is an identifier string similar to "postActions/0/manualInstructions/2/text" {1} is a user-defined string such as "myPostAction", "pa0", "postActionFirst" etc.</note> </trans-unit> <trans-unit id="stringExtractor_log_jsonMemberIsMissing"> <source>Json element '{0}' must have a member '{1}'.</source> <target state="translated">Json {0} {1} .</target> <note>{0} and {1} are strings such as "postActions", "manualInstructions", "id" etc.</note> </trans-unit> <trans-unit id="stringExtractor_log_skippingAlreadyAddedElement"> <source>The following element in the template.json will be skipped since it was already added to the list of localizable strings: {0}</source> <target state="translated">template.json . {0}</target> <note>{0} is a string similar to "postActions/0/manualInstructions/2/text"</note> </trans-unit> <trans-unit id="stringUpdater_log_dataIsUnchanged"> <source>The contents of the following file seems to be the same as before. The file will not be overwritten. File: '{0}'</source> <target state="translated"> . . : '{0}'</target> <note>{0} is a file path.</note> </trans-unit> <trans-unit id="stringUpdater_log_failedToReadLocFile"> <source>Failed to read the existing strings from '{0}'</source> <target state="translated">{0} .</target> <note>{0} is a file path.</note> </trans-unit> <trans-unit id="stringUpdater_log_loadingLocFile"> <source>Loading existing localizations from file '{0}'</source> <target state="translated">{0} </target> <note>{0} is a file path.</note> </trans-unit> <trans-unit id="stringUpdater_log_localizedStringAlreadyExists"> <source>The file already contains a localized string for key '{0}'. The old value will be preserved.</source> <target state="translated"> '{0}' . .</target> <note>{0} is a file path.</note> </trans-unit> <trans-unit id="stringUpdater_log_openingTemplatesJson"> <source>Opening the following templatestrings.json file for writing: '{0}'</source> <target state="translated"> templatestrings.json : {0}</target> <note>{0} is a file path.</note> </trans-unit> </body> </file> </xliff> ```
/content/code_sandbox/tools/Microsoft.TemplateEngine.TemplateLocalizer.Core/xlf/LocalizableStrings.ko.xlf
xml
2016-06-28T20:54:16
2024-08-16T14:39:38
templating
dotnet/templating
1,598
952
```xml import { Component, OnInit } from '@angular/core'; import { Code } from '@domain/code'; import { PhotoService } from '@service/photoservice'; @Component({ selector: 'template-doc', template: ` <app-docsectiontext> <p>Using <i>activeIndex</i>, Galleria is displayed with a specific initial image.</p> </app-docsectiontext> <div class="card"> <div *ngIf="images" class="grid" style="max-width: 800px;"> <div *ngFor="let image of images; let index = index" class="col-3" key="index"> <img [src]="image.thumbnailImageSrc" [alt]="image.alt" style="cursor: pointer" (click)="imageClick(index)" /> </div> </div> <p-galleria [(value)]="images" [(visible)]="displayCustom" [(activeIndex)]="activeIndex" [responsiveOptions]="responsiveOptions" [containerStyle]="{ 'max-width': '850px' }" [numVisible]="7" [circular]="true" [fullScreen]="true" [showItemNavigators]="true" [showThumbnails]="false" > <ng-template pTemplate="item" let-item> <img [src]="item.itemImageSrc" style="width: 100%; display: block;" /> </ng-template> </p-galleria> </div> <app-code [code]="code" selector="galleria-full-screen-template-demo"></app-code> ` }) export class FullScreenTemplateDoc implements OnInit { displayCustom: boolean | undefined; activeIndex: number = 0; images: any[] | undefined; responsiveOptions: any[] = [ { breakpoint: '1500px', numVisible: 5 }, { breakpoint: '1024px', numVisible: 3 }, { breakpoint: '768px', numVisible: 2 }, { breakpoint: '560px', numVisible: 1 } ]; constructor(private photoService: PhotoService) {} ngOnInit() { this.photoService.getImages().then((images) => (this.images = images)); } imageClick(index: number) { this.activeIndex = index; this.displayCustom = true; } code: Code = { basic: `<p-galleria [(value)]="images" [(visible)]="displayCustom" [(activeIndex)]="activeIndex" [responsiveOptions]="responsiveOptions" [containerStyle]="{ 'max-width': '850px' }" [numVisible]="7" [circular]="true" [fullScreen]="true" [showItemNavigators]="true" [showThumbnails]="false"> <ng-template pTemplate="item" let-item> <img [src]="item.itemImageSrc" style="width: 100%; display: block;" /> </ng-template> </p-galleria> `, html: `<div class="card"> <div *ngIf="images" class="grid" style="max-width: 800px;"> <div *ngFor="let image of images; let index = index" class="col-3" key="index"> <img [src]="image.thumbnailImageSrc" [alt]="image.alt" style="cursor: pointer" (click)="imageClick(index)" /> </div> </div> <p-galleria [(value)]="images" [(visible)]="displayCustom" [(activeIndex)]="activeIndex" [responsiveOptions]="responsiveOptions" [containerStyle]="{ 'max-width': '850px' }" [numVisible]="7" [circular]="true" [fullScreen]="true" [showItemNavigators]="true" [showThumbnails]="false"> <ng-template pTemplate="item" let-item> <img [src]="item.itemImageSrc" style="width: 100%; display: block;" /> </ng-template> </p-galleria> </div>`, typescript: `import { Component, OnInit } from '@angular/core'; import { PhotoService } from '@service/photoservice'; import { PhotoService } from '@service/photoservice'; import { GalleriaModule } from 'primeng/galleria'; import { CommonModule } from '@angular/common'; @Component({ selector: 'galleria-full-screen-template-demo', templateUrl: './galleria-full-screen-template-demo.html', standalone: true, imports: [GalleriaModule, CommonModule], providers: [PhotoService] }) export class GalleriaFullScreenTemplateDemo implements OnInit { displayCustom: boolean | undefined; activeIndex: number = 0; images: any[] | undefined; responsiveOptions: any[] = [ { breakpoint: '1500px', numVisible: 5 }, { breakpoint: '1024px', numVisible: 3 }, { breakpoint: '768px', numVisible: 2 }, { breakpoint: '560px', numVisible: 1 } ]; constructor(private photoService: PhotoService) {} ngOnInit() { this.photoService.getImages().then((images) => (this.images = images)); } imageClick(index: number) { this.activeIndex = index; this.displayCustom = true; } }`, data: ` /* PhotoService */ { itemImageSrc: 'path_to_url thumbnailImageSrc: 'path_to_url alt: 'Description for Image 1', title: 'Title 1' }, ...`, service: ['PhotoService'] }; } ```
/content/code_sandbox/src/app/showcase/doc/galleria/fullscreen/customcontentdoc.ts
xml
2016-01-16T09:23:28
2024-08-16T19:58:20
primeng
primefaces/primeng
9,969
1,285
```xml export * from "./Menu" export * from "./MenuComponent" export * from "./Filter" import { Configuration } from "./../Configuration" import { OverlayManager } from "./../Overlay" import { MenuManager } from "./Menu" let _menuManager: MenuManager export const activate = (configuration: Configuration, overlayManager: OverlayManager) => { _menuManager = new MenuManager(configuration, overlayManager) } export const getInstance = (): MenuManager => { return _menuManager } ```
/content/code_sandbox/browser/src/Services/Menu/index.ts
xml
2016-11-16T14:42:55
2024-08-14T11:48:05
oni
onivim/oni
11,355
103
```xml import { G2Spec } from '../../../src'; export function gainLostIntervalCornered(): G2Spec { return { type: 'view', data: { type: 'fetch', value: 'data/gain-lost.json', transform: [ { type: 'fold', fields: [ 'lost > 100$', 'lost <= 100$', 'gained <= 100$', 'gained > 100$', ], }, ], }, children: [ { type: 'interval', transform: [{ type: 'stackY' }], encode: { x: 'user', y: 'value', color: 'key', }, scale: { x: { padding: 0.2 }, y: { domainMin: -100, domainMax: 100 }, color: { domain: [ 'lost > 100$', 'lost <= 100$', 'gained <= 100$', 'gained > 100$', ], range: ['#e25c3b', '#f47560', '#97e3d5', '#61cdbb'], }, }, legend: { color: { title: false }, }, axis: { y: { position: 'right', title: false, labelFormatter: (v) => `${v}%`, }, }, labels: [ { text: 'value', position: 'inside', formatter: (v) => (v ? `${v}%` : ''), transform: [{ type: 'overlapDodgeY' }], fill: '#000', fontSize: 10, }, ], style: { radius: 10, }, }, { type: 'lineY', data: [0], style: { lineWidth: 2, stroke: '#e25c3d', strokeOpacity: 1, }, }, { type: 'text', style: { x: 0, y: '20%', text: 'gain', fontWeight: 'bold', dy: -10, transform: 'rotate(-90)', fill: '#61cdbb', }, }, { type: 'text', style: { x: 0, y: '70%', text: 'lost', fontWeight: 'bold', dy: -10, transform: 'rotate(-90)', fill: '#e25c3b', }, }, ], }; } ```
/content/code_sandbox/__tests__/plots/static/gain-lost-interval-cornered.ts
xml
2016-05-26T09:21:04
2024-08-15T16:11:17
G2
antvis/G2
12,060
567
```xml <dict> <key>LayoutID</key> <integer>23</integer> <key>PathMapRef</key> <array> <dict> <key>CodecID</key> <array> <integer>283902601</integer> </array> <key>Headphone</key> <dict/> <key>Inputs</key> <array> <string>Mic</string> <string>LineIn</string> </array> <key>IntSpeaker</key> <dict/> <key>LineIn</key> <dict> <key>MuteGPIO</key> <integer>1342242843</integer> <key>SignalProcessing</key> <dict> <key>SoftwareDSP</key> <dict> <key>DspFunction0</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>0</integer> <key>DspFuncName</key> <string>DspNoiseReduction</string> <key>DspFuncProcessingIndex</key> <integer>0</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>-1073029587</integer> <key>5</key> <data>your_sha256_hashHMuYwrl9lcJXm4/CBhmQwuJvlMKbxJTC7qyUwtjDl8KU+ZzCnCaewsmuncK/your_sha512_hash+your_sha256_hashyour_sha256_hashfwhFzosLIZaPCwUOjwo6TosIkR6LC6vehwtrwosIdtJ/CXLmbwlSZmcKDhJXCDFGRwnV6j8JTjY/CrqGQwgqYk8INzpjCuTufwrjlocKviKPC5YqlwgdmpcKZ2aXCGiumwq95osJOIJ/Cxl+ewtWGl8KmPJPC+sSawkdHo8JWB6LCskyhwqk7pcIth6nCh4Wswk+crcK9J6zCYJWqwmVJq8K8063Cyour_sha512_hash+M0MKaftbCpcjdwm+p5sL/CfHCHcT8wrp3A8PiJAzD</data> </dict> <key>PatchbayInfo</key> <dict/> </dict> <key>DspFunction1</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>1</integer> <key>DspFuncName</key> <string>DspEqualization32</string> <key>DspFuncProcessingIndex</key> <integer>1</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>9</key> <integer>0</integer> <key>Filter</key> <array> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1119939268</integer> <key>7</key> <integer>1060439283</integer> <key>8</key> <integer>-1069504319</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>4</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1165674830</integer> <key>7</key> <integer>1106304591</integer> <key>8</key> <integer>-1073964333</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>5</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1141348835</integer> <key>7</key> <integer>1084737706</integer> <key>8</key> <integer>-1065063953</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>6</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1139052693</integer> <key>7</key> <integer>1080938866</integer> <key>8</key> <integer>-1073319056</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>8</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1161958655</integer> <key>7</key> <integer>1099668786</integer> <key>8</key> <integer>-1073319056</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>9</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1148922426</integer> <key>7</key> <integer>1086508776</integer> <key>8</key> <integer>-1076100424</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>10</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1169908270</integer> <key>7</key> <integer>1106659062</integer> <key>8</key> <integer>-1078236516</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>11</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1168889995</integer> <key>7</key> <integer>1103911084</integer> <key>8</key> <integer>-1082886964</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>12</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1160729473</integer> <key>7</key> <integer>1095247586</integer> <key>8</key> <integer>-1076100424</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>19</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1171440929</integer> <key>7</key> <integer>1103785747</integer> <key>8</key> <integer>-1075032379</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>21</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1163187837</integer> <key>7</key> <integer>1102690138</integer> <key>8</key> <integer>-1073319056</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>23</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1172459204</integer> <key>7</key> <integer>1098523915</integer> <key>8</key> <integer>-1062927862</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>24</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1175303133</integer> <key>7</key> <integer>1102375714</integer> <key>8</key> <integer>-1061058782</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>25</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1179874390</integer> <key>7</key> <integer>1097945441</integer> <key>8</key> <integer>-1054338996</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>26</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1167504019</integer> <key>7</key> <integer>1102555367</integer> <key>8</key> <integer>-1044515201</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>27</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1177335863</integer> <key>7</key> <integer>1102845396</integer> <key>8</key> <integer>-1054739513</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>31</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>0</integer> <key>6</key> <integer>1184146588</integer> <key>7</key> <integer>1060439283</integer> <key>8</key> <integer>-1069504319</integer> </dict> </array> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> <key>DspFunction2</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>2</integer> <key>DspFuncName</key> <string>DspGainStage</string> <key>DspFuncProcessingIndex</key> <integer>2</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>1065353216</integer> <key>3</key> <integer>1065353216</integer> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> </dict> </dict> </dict> <key>Mic</key> <dict> <key>SignalProcessing</key> <dict> <key>SoftwareDSP</key> <dict> <key>DspFunction0</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>0</integer> <key>DspFuncName</key> <string>DspNoiseReduction</string> <key>DspFuncProcessingIndex</key> <integer>0</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>-1073029587</integer> <key>5</key> <data>your_sha256_hashHMuYwrl9lcJXm4/CBhmQwuJvlMKbxJTC7qyUwtjDl8KU+ZzCnCaewsmuncK/your_sha512_hash+your_sha256_hashyour_sha256_hashfwhFzosLIZaPCwUOjwo6TosIkR6LC6vehwtrwosIdtJ/CXLmbwlSZmcKDhJXCDFGRwnV6j8JTjY/CrqGQwgqYk8INzpjCuTufwrjlocKviKPC5YqlwgdmpcKZ2aXCGiumwq95osJOIJ/Cxl+ewtWGl8KmPJPC+sSawkdHo8JWB6LCskyhwqk7pcIth6nCh4Wswk+crcK9J6zCYJWqwmVJq8K8063Cyour_sha512_hash+M0MKaftbCpcjdwm+p5sL/CfHCHcT8wrp3A8PiJAzD</data> </dict> <key>PatchbayInfo</key> <dict/> </dict> <key>DspFunction1</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>1</integer> <key>DspFuncName</key> <string>DspEqualization32</string> <key>DspFuncProcessingIndex</key> <integer>1</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>9</key> <integer>0</integer> <key>Filter</key> <array> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1119939268</integer> <key>7</key> <integer>1060439283</integer> <key>8</key> <integer>-1069504319</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>4</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1165674830</integer> <key>7</key> <integer>1106304591</integer> <key>8</key> <integer>-1073964333</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>5</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1141348835</integer> <key>7</key> <integer>1084737706</integer> <key>8</key> <integer>-1065063953</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>6</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1139052693</integer> <key>7</key> <integer>1080938866</integer> <key>8</key> <integer>-1073319056</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>8</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1161958655</integer> <key>7</key> <integer>1099668786</integer> <key>8</key> <integer>-1073319056</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>9</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1148922426</integer> <key>7</key> <integer>1086508776</integer> <key>8</key> <integer>-1076100424</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>10</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1169908270</integer> <key>7</key> <integer>1106659062</integer> <key>8</key> <integer>-1078236516</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>11</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1168889995</integer> <key>7</key> <integer>1103911084</integer> <key>8</key> <integer>-1082886964</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>12</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1160729473</integer> <key>7</key> <integer>1095247586</integer> <key>8</key> <integer>-1076100424</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>19</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1171440929</integer> <key>7</key> <integer>1103785747</integer> <key>8</key> <integer>-1075032379</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>21</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1163187837</integer> <key>7</key> <integer>1102690138</integer> <key>8</key> <integer>-1073319056</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>23</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1172459204</integer> <key>7</key> <integer>1098523915</integer> <key>8</key> <integer>-1062927862</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>24</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1175303133</integer> <key>7</key> <integer>1102375714</integer> <key>8</key> <integer>-1061058782</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>25</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1179874390</integer> <key>7</key> <integer>1097945441</integer> <key>8</key> <integer>-1054338996</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>26</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1167504019</integer> <key>7</key> <integer>1102555367</integer> <key>8</key> <integer>-1044515201</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>27</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1177335863</integer> <key>7</key> <integer>1102845396</integer> <key>8</key> <integer>-1054739513</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>31</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>0</integer> <key>6</key> <integer>1184146588</integer> <key>7</key> <integer>1060439283</integer> <key>8</key> <integer>-1069504319</integer> </dict> </array> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> <key>DspFunction2</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>2</integer> <key>DspFuncName</key> <string>DspGainStage</string> <key>DspFuncProcessingIndex</key> <integer>2</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>1065353216</integer> <key>3</key> <integer>1065353216</integer> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> </dict> </dict> </dict> <key>Outputs</key> <array> <string>Headphone</string> <string>IntSpeaker</string> </array> <key>PathMapID</key> <integer>289</integer> </dict> </array> </dict> ```
/content/code_sandbox/Resources/ALC289/layout23.xml
xml
2016-03-07T20:45:58
2024-08-14T08:57:03
AppleALC
acidanthera/AppleALC
3,420
7,825
```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. */ --> <Keyboard xmlns:android="path_to_url" android:keyWidth="8.33%p" android:horizontalGap="0px" android:verticalGap="@dimen/key_bottom_gap" > <Row android:rowEdgeFlags="top" > <Key android:keyLabel="x" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_x" android:keyEdgeFlags="left" /> <Key android:keyLabel="v" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_v" /> <Key android:keyLabel="l" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_l" /> <Key android:keyLabel="c" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_c" /> <Key android:keyLabel="w" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_w" /> <Key android:keyLabel="k" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_k" /> <Key android:keyLabel="h" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_h" /> <Key android:keyLabel="g" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_g" /> <Key android:keyLabel="f" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_f" /> <Key android:keyLabel="q" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_q" /> <Key android:keyLabel="" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters=""/> <Key android:codes="@integer/key_delete" android:keyIcon="@drawable/sym_keyboard_delete" android:iconPreview="@drawable/sym_keyboard_feedback_delete" android:keyWidth="8.33%p" android:isModifier="true" android:isRepeatable="true" android:keyEdgeFlags="right" /> </Row> <Row> <Key android:keyLabel="u" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_u" android:horizontalGap="4.545454%p" android:keyEdgeFlags="left" /> <Key android:keyLabel="i" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_i" /> <Key android:keyLabel="a" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_a" /> <Key android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_e" android:keyLabel="e" /> <Key android:keyLabel="o" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_o" /> <Key android:keyLabel="s" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_s" /> <Key android:keyLabel="n" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_n" /> <Key android:keyLabel="r" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_r" /> <Key android:keyLabel="t" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_t" /> <Key android:keyLabel="d" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_d" /> <Key android:keyLabel="y" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_y" android:keyEdgeFlags="right" /> </Row> <Row> <Key android:codes="@integer/key_shift" android:keyIcon="@drawable/sym_keyboard_shift" android:iconPreview="@drawable/sym_keyboard_feedback_shift" android:keyWidth="8.33%p" android:isModifier="true" android:isSticky="true" android:keyEdgeFlags="left" /> <Key android:keyLabel="" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="#" /> <Key android:keyLabel="" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="$" /> <Key android:keyLabel="" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="|" /> <Key android:keyLabel="p" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_p" /> <Key android:keyLabel="z" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_z" /> <Key android:keyLabel="b" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_b" /> <Key android:keyLabel="m" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_m" /> <Key android:keyLabel="," android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="\&quot;" /> <Key android:keyLabel="." android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="\'" /> <Key android:keyLabel="j" android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="@string/alternates_for_j" /></Row> <Row android:keyboardMode="@+id/mode_normal" android:keyWidth="10%p" android:rowEdgeFlags="bottom" > <Key android:codes="@integer/key_symbol" android:keyLabel="@string/label_symbol_key" android:keyWidth="20%p" android:isModifier="true" android:keyEdgeFlags="left" /> <Key android:codes="@integer/key_f1" android:isModifier="true" /> <Key android:codes="@integer/key_space" android:keyIcon="@drawable/sym_keyboard_space" android:iconPreview="@drawable/sym_keyboard_feedback_space" android:keyWidth="40%p" android:isModifier="true" /> <Key android:keyLabel="." android:keyIcon="@drawable/hint_popup" android:popupKeyboard="@xml/popup_punctuation" android:isModifier="true" /> <Key android:codes="@integer/key_return" android:keyIcon="@drawable/sym_keyboard_return" android:iconPreview="@drawable/sym_keyboard_feedback_return" android:keyWidth="20%p" android:isModifier="true" android:keyEdgeFlags="right" /> </Row> <Row android:keyboardMode="@+id/mode_url" android:keyWidth="10%p" android:rowEdgeFlags="bottom" > <Key android:codes="@integer/key_symbol" android:keyLabel="@string/label_symbol_key" android:keyWidth="20%p" android:isModifier="true" android:keyEdgeFlags="left" /> <Key android:codes="@integer/key_f1" android:isModifier="true" /> <Key android:codes="@integer/key_space" android:keyIcon="@drawable/sym_keyboard_space" android:iconPreview="@drawable/sym_keyboard_feedback_space" android:keyWidth="40%p" android:isModifier="true" /> <Key android:keyLabel="." android:keyIcon="@drawable/hint_popup" android:popupKeyboard="@xml/popup_punctuation" android:isModifier="true" /> <Key android:codes="@integer/key_return" android:keyIcon="@drawable/sym_keyboard_return" android:iconPreview="@drawable/sym_keyboard_feedback_return" android:keyWidth="20%p" android:isModifier="true" android:keyEdgeFlags="right" /> </Row> <Row android:keyboardMode="@+id/mode_email" android:keyWidth="10%p" android:rowEdgeFlags="bottom" > <Key android:codes="@integer/key_symbol" android:keyLabel="@string/label_symbol_key" android:keyWidth="20%p" android:isModifier="true" android:keyEdgeFlags="left" /> <Key android:codes="@integer/key_f1" android:isModifier="true" /> <Key android:codes="@integer/key_space" android:keyIcon="@drawable/sym_keyboard_space" android:iconPreview="@drawable/sym_keyboard_feedback_space" android:keyWidth="40%p" android:isModifier="true" /> <Key android:keyLabel="." android:keyIcon="@drawable/hint_popup" android:popupKeyboard="@xml/popup_punctuation" android:isModifier="true" /> <Key android:codes="@integer/key_return" android:keyIcon="@drawable/sym_keyboard_return" android:iconPreview="@drawable/sym_keyboard_feedback_return" android:keyWidth="20%p" android:isModifier="true" android:keyEdgeFlags="right" /> </Row> <Row android:keyboardMode="@+id/mode_im" android:keyWidth="10%p" android:rowEdgeFlags="bottom" > <Key android:codes="@integer/key_symbol" android:keyLabel="@string/label_symbol_key" android:keyWidth="20%p" android:isModifier="true" android:keyEdgeFlags="left" /> <Key android:codes="@integer/key_f1" android:isModifier="true" /> <Key android:codes="@integer/key_space" android:keyIcon="@drawable/sym_keyboard_space" android:iconPreview="@drawable/sym_keyboard_feedback_space" android:keyWidth="40%p" android:isModifier="true" /> <Key android:keyLabel="." android:keyIcon="@drawable/hint_popup" android:popupKeyboard="@xml/popup_punctuation" android:isModifier="true" /> <Key android:keyLabel=":-)" android:keyOutputText=":-) " android:keyIcon="@drawable/hint_popup" android:popupKeyboard="@xml/popup_smileys" android:keyWidth="20%p" android:isModifier="true" android:keyEdgeFlags="right" /> </Row> <Row android:keyboardMode="@+id/mode_webentry" android:keyWidth="10%p" android:rowEdgeFlags="bottom" > <Key android:codes="@integer/key_symbol" android:keyLabel="@string/label_symbol_key" android:keyWidth="20%p" android:isModifier="true" android:keyEdgeFlags="left" /> <Key android:codes="@integer/key_f1" android:isModifier="true" /> <Key android:codes="@integer/key_space" android:keyIcon="@drawable/sym_keyboard_space" android:iconPreview="@drawable/sym_keyboard_feedback_space" android:keyWidth="30%p" android:isModifier="true" /> <Key android:codes="@integer/key_tab" android:keyIcon="@drawable/sym_keyboard_tab" android:iconPreview="@drawable/sym_keyboard_feedback_tab" android:isModifier="true" /> <Key android:keyLabel="." android:keyIcon="@drawable/hint_popup" android:popupKeyboard="@xml/popup_punctuation" android:isModifier="true" /> <Key android:codes="@integer/key_return" android:keyIcon="@drawable/sym_keyboard_return" android:iconPreview="@drawable/sym_keyboard_feedback_return" android:keyWidth="20%p" android:isModifier="true" android:keyEdgeFlags="right" /> </Row> <Row android:keyboardMode="@+id/mode_normal_with_settings_key" android:keyWidth="10%p" android:rowEdgeFlags="bottom" > <Key android:codes="@integer/key_symbol" android:keyLabel="@string/label_symbol_key" android:keyWidth="15%p" android:isModifier="true" android:keyEdgeFlags="left" /> <Key android:codes="@integer/key_settings" android:keyIcon="@drawable/sym_keyboard_settings" android:iconPreview="@drawable/sym_keyboard_feedback_settings" android:isModifier="true" /> <Key android:codes="@integer/key_f1" android:isModifier="true" /> <Key android:codes="@integer/key_space" android:keyIcon="@drawable/sym_keyboard_space" android:iconPreview="@drawable/sym_keyboard_feedback_space" android:keyWidth="30%p" android:isModifier="true" /> <Key android:keyLabel="." android:keyIcon="@drawable/hint_popup" android:popupKeyboard="@xml/popup_punctuation" android:isModifier="true" /> <Key android:codes="@integer/key_return" android:keyIcon="@drawable/sym_keyboard_return" android:iconPreview="@drawable/sym_keyboard_feedback_return" android:keyWidth="25%p" android:isModifier="true" android:keyEdgeFlags="right" /> </Row> <Row android:keyboardMode="@+id/mode_url_with_settings_key" android:keyWidth="10%p" android:rowEdgeFlags="bottom" > <Key android:codes="@integer/key_symbol" android:keyLabel="@string/label_symbol_key" android:keyWidth="15%p" android:isModifier="true" android:keyEdgeFlags="left" /> <Key android:codes="@integer/key_settings" android:keyIcon="@drawable/sym_keyboard_settings" android:iconPreview="@drawable/sym_keyboard_feedback_settings" android:isModifier="true" /> <Key android:codes="@integer/key_f1" android:isModifier="true" /> <Key android:codes="@integer/key_space" android:keyIcon="@drawable/sym_keyboard_space" android:iconPreview="@drawable/sym_keyboard_feedback_space" android:keyWidth="30%p" android:isModifier="true" /> <Key android:keyLabel="." android:keyIcon="@drawable/hint_popup" android:popupKeyboard="@xml/popup_punctuation" android:isModifier="true" /> <Key android:codes="@integer/key_return" android:keyIcon="@drawable/sym_keyboard_return" android:iconPreview="@drawable/sym_keyboard_feedback_return" android:keyWidth="25%p" android:isModifier="true" android:keyEdgeFlags="right" /> </Row> <Row android:keyboardMode="@+id/mode_email_with_settings_key" android:keyWidth="10%p" android:rowEdgeFlags="bottom" > <Key android:codes="@integer/key_symbol" android:keyLabel="@string/label_symbol_key" android:keyWidth="15%p" android:isModifier="true" android:keyEdgeFlags="left" /> <Key android:codes="@integer/key_settings" android:keyIcon="@drawable/sym_keyboard_settings" android:iconPreview="@drawable/sym_keyboard_feedback_settings" android:isModifier="true" /> <Key android:codes="@integer/key_f1" android:isModifier="true" /> <Key android:codes="@integer/key_space" android:keyIcon="@drawable/sym_keyboard_space" android:iconPreview="@drawable/sym_keyboard_feedback_space" android:keyWidth="30%p" android:isModifier="true" /> <Key android:keyLabel="." android:keyIcon="@drawable/hint_popup" android:popupKeyboard="@xml/popup_punctuation" android:isModifier="true" /> <Key android:codes="@integer/key_return" android:keyIcon="@drawable/sym_keyboard_return" android:iconPreview="@drawable/sym_keyboard_feedback_return" android:keyWidth="25%p" android:isModifier="true" android:keyEdgeFlags="right" /> </Row> <Row android:keyboardMode="@+id/mode_im_with_settings_key" android:keyWidth="10%p" android:rowEdgeFlags="bottom" > <Key android:codes="@integer/key_symbol" android:keyLabel="@string/label_symbol_key" android:keyWidth="15%p" android:isModifier="true" android:keyEdgeFlags="left" /> <Key android:codes="@integer/key_settings" android:keyIcon="@drawable/sym_keyboard_settings" android:iconPreview="@drawable/sym_keyboard_feedback_settings" android:isModifier="true" /> <Key android:codes="@integer/key_f1" android:isModifier="true" /> <Key android:codes="@integer/key_space" android:keyIcon="@drawable/sym_keyboard_space" android:iconPreview="@drawable/sym_keyboard_feedback_space" android:keyWidth="30%p" android:isModifier="true" /> <Key android:keyLabel="." android:keyIcon="@drawable/hint_popup" android:popupKeyboard="@xml/popup_punctuation" android:isModifier="true" /> <Key android:keyLabel=":-)" android:keyOutputText=":-) " android:keyIcon="@drawable/hint_popup" android:popupKeyboard="@xml/popup_smileys" android:keyWidth="25%p" android:isModifier="true" android:keyEdgeFlags="right" /> </Row> <Row android:keyboardMode="@+id/mode_webentry_with_settings_key" android:keyWidth="10%p" android:rowEdgeFlags="bottom" > <Key android:codes="@integer/key_symbol" android:keyLabel="@string/label_symbol_key" android:keyWidth="15%p" android:isModifier="true" android:keyEdgeFlags="left" /> <Key android:codes="@integer/key_settings" android:keyIcon="@drawable/sym_keyboard_settings" android:iconPreview="@drawable/sym_keyboard_feedback_settings" android:isModifier="true" /> <Key android:codes="@integer/key_f1" android:isModifier="true" /> <Key android:codes="@integer/key_space" android:keyIcon="@drawable/sym_keyboard_space" android:iconPreview="@drawable/sym_keyboard_feedback_space" android:keyWidth="30%p" android:isModifier="true" /> <Key android:codes="@integer/key_tab" android:keyIcon="@drawable/sym_keyboard_tab" android:iconPreview="@drawable/sym_keyboard_feedback_tab" android:isModifier="true" /> <Key android:keyLabel="." android:keyIcon="@drawable/hint_popup" android:popupKeyboard="@xml/popup_punctuation" android:isModifier="true" /> <Key android:codes="@integer/key_return" android:keyIcon="@drawable/sym_keyboard_return" android:iconPreview="@drawable/sym_keyboard_feedback_return" android:keyWidth="15%p" android:isModifier="true" android:keyEdgeFlags="right" /> </Row> </Keyboard> ```
/content/code_sandbox/app/src/main/res/xml-de-rNE/kbd_qwerty.xml
xml
2016-01-22T21:40:54
2024-08-16T11:54:30
hackerskeyboard
klausw/hackerskeyboard
1,807
4,490
```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="fr" original="../LocalizableStrings.resx"> <body> <trans-unit id="UnableToCheckCertificateChainPolicy"> <source>The requested certificate chain policy could not be checked: {0}</source> <target state="translated">Impossible de vrifier la stratgie de chane de certificats demande : {0}</target> <note /> </trans-unit> </body> </file> </xliff> ```
/content/code_sandbox/src/Cli/dotnet/Installer/Windows/xlf/LocalizableStrings.fr.xlf
xml
2016-07-22T21:26:02
2024-08-16T17:23:58
sdk
dotnet/sdk
2,627
192
```xml import { AnimationDirection } from '../Calendar/Calendar.types'; import { DayOfWeek, FirstWeekOfYear, DateRangeType } from '@fluentui/date-time-utilities'; import type { IBaseProps, IRefObject, IStyleFunctionOrObject } from '@fluentui/utilities'; import type { ICalendarStrings, IDateFormatting, IDayGridOptions } from '@fluentui/date-time-utilities'; import type { IStyle, ITheme, IProcessedStyleSet } from '@fluentui/style-utilities'; /** * {@docCategory Calendar} */ export interface ICalendarDayGrid { focus(): void; } /** * {@docCategory Calendar} */ export interface ICalendarDayGridProps extends IDayGridOptions, IBaseProps<ICalendarDayGrid> { /** * Optional callback to access the ICalendarDayGrid interface. Use this instead of ref for accessing * the public methods and properties of the component. */ componentRef?: IRefObject<ICalendarDayGrid>; /** * Customized styles for the component. */ styles?: IStyleFunctionOrObject<ICalendarDayGridStyleProps, ICalendarDayGridStyles>; /** * Theme (provided through customization). */ theme?: ITheme; /** * Additional CSS class(es) to apply to the CalendarDayGrid. */ className?: string; /** * Localized strings to use in the CalendarDayGrid */ strings: ICalendarStrings; /** * The currently selected date */ selectedDate: Date; /** * The currently navigated date */ navigatedDate: Date; /** * Callback issued when a date is selected * @param date - The date the user selected * @param selectedDateRangeArray - The resultant list of dates that are selected based on the date range type set * for the component. */ onSelectDate?: (date: Date, selectedDateRangeArray?: Date[]) => void; /** * Callback issued when a date in the calendar is navigated * @param date - The date that is navigated to * @param focusOnNavigatedDay - Whether to set the focus to the navigated date. */ onNavigateDate: (date: Date, focusOnNavigatedDay: boolean) => void; /** * Callback issued when calendar day is closed */ onDismiss?: () => void; /** * The first day of the week for your locale. * @defaultvalue DayOfWeek.Sunday */ firstDayOfWeek: DayOfWeek; /** * Defines when the first week of the year should start, FirstWeekOfYear.FirstDay, * FirstWeekOfYear.FirstFullWeek or FirstWeekOfYear.FirstFourDayWeek are the possible values * @defaultvalue FirstWeekOfYear.FirstDay */ firstWeekOfYear: FirstWeekOfYear; /** * The date range type indicating how many days should be selected as the user * selects days * @defaultValue DateRangeType.Day */ dateRangeType: DateRangeType; /** * The number of days to select while dateRangeType === DateRangeType.Day. Used in order to have multi-day * views. * @defaultValue 1 */ daysToSelectInDayView?: number; /** * Value of today. If unspecified, current time in client machine will be used. */ today?: Date; /** * Whether the calendar should show the week number (weeks 1 to 53) before each week row * @defaultvalue false */ showWeekNumbers?: boolean; /** * Apply additional formatting to dates, for example localized date formatting. */ dateTimeFormatter: IDateFormatting; /** * Ref callback for individual days. Allows for customization of the styling, properties, or listeners of the * specific day. */ customDayCellRef?: (element: HTMLElement, date: Date, classNames: IProcessedStyleSet<ICalendarDayGridStyles>) => void; /** * How many weeks to show by default. If not provided, will show enough weeks to display the current * month, between 4 and 6 depending * @defaultvalue undefined */ weeksToShow?: number; /** * If set the Calendar will not allow navigation to or selection of a date earlier than this value. */ minDate?: Date; /** * If set the Calendar will not allow navigation to or selection of a date later than this value. */ maxDate?: Date; /** * If set the Calendar will not allow selection of dates in this array. */ restrictedDates?: Date[]; /** * The days that are selectable when `dateRangeType` is WorkWeek. * If `dateRangeType` is not WorkWeek this property does nothing. * @defaultvalue [Monday,Tuesday,Wednesday,Thursday,Friday] */ workWeekDays?: DayOfWeek[]; /** * Whether the close button should be shown or not * @defaultvalue false */ showCloseButton?: boolean; /** * Allows all dates and buttons to be focused, including disabled ones * @defaultvalue false */ allFocusable?: boolean; /** * The ID of the control that labels this one */ labelledBy?: string; /** * Whether to show days outside the selected month with lighter styles * @defaultvalue true */ lightenDaysOutsideNavigatedMonth?: boolean; /** * The cardinal directions for animation to occur during transitions, either horizontal or veritcal */ animationDirection?: AnimationDirection; /** * Optional callback function to mark specific days with a small symbol. Fires when the date range changes, * gives the starting and ending displayed dates and expects the list of which days in between should be * marked. */ getMarkedDays?: (startingDate: Date, endingDate: Date) => Date[]; } /** * {@docCategory Calendar} */ export interface ICalendarDayGridStyleProps { /** * Theme provided by High-Order Component. */ theme: ITheme; /** * Accept custom classNames */ className?: string; /** * The date range type */ dateRangeType?: DateRangeType; /** * Whether week numbers are being shown */ showWeekNumbers?: boolean; /** * Whether to show days outside the selected month with lighter styles */ lightenDaysOutsideNavigatedMonth?: boolean; /** * Whether grid entering animation should be forwards or backwards */ animateBackwards?: boolean; /** * The cardinal directions for animation to occur during transitions, either horizontal or vertical */ animationDirection?: AnimationDirection; } /** * {@docCategory Calendar} */ export interface ICalendarDayGridStyles { /** * The style for the root div */ wrapper?: IStyle; /** * The style for the table containing the grid */ table?: IStyle; /** * The style to apply to the grid cells for days */ dayCell?: IStyle; /** * The style to apply to grid cells for days in the selected range */ daySelected?: IStyle; /** * The style to apply to row around weeks */ weekRow?: IStyle; /** * The style to apply to the column headers above the weeks */ weekDayLabelCell?: IStyle; /** * The style to apply to grid cells for week numbers */ weekNumberCell?: IStyle; /** * The style to apply to individual days that are outside the min/max date range */ dayOutsideBounds?: IStyle; /** * The style to apply to individual days that are outside the current month */ dayOutsideNavigatedMonth?: IStyle; /** * The style to apply to the button element within the day cells */ dayButton?: IStyle; /** * The style to apply to the individual button element that matches the "today" parameter */ dayIsToday?: IStyle; /** * The style applied to the first placeholder week used during transitions */ firstTransitionWeek?: IStyle; /** * The style applied to the last placeholder week used during transitions */ lastTransitionWeek?: IStyle; /** * The style applied to the marker on days to mark as important */ dayMarker?: IStyle; /** * The styles to apply to days for rounded corners. Can apply multiple to round multiple corners */ topRightCornerDate?: IStyle; topLeftCornerDate?: IStyle; bottomRightCornerDate?: IStyle; bottomLeftCornerDate?: IStyle; /** * The styles to apply to days for focus borders. Can apply multiple if there are multiple focused days * around the current focused date */ datesAbove?: IStyle; datesBelow?: IStyle; datesLeft?: IStyle; datesRight?: IStyle; } ```
/content/code_sandbox/packages/react/src/components/CalendarDayGrid/CalendarDayGrid.types.ts
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
1,963
```xml import clientPortal from './clientPortal'; import clientPortalUser from './clientPortalUser'; import clientPortalNotifications from './clientPortalNotifications'; import comment from './comment'; import fieldConfig from './fieldConfig'; export default { ...clientPortal, ...clientPortalUser, ...clientPortalNotifications, ...comment, ...fieldConfig }; ```
/content/code_sandbox/packages/plugin-clientportal-api/src/graphql/resolvers/queries/index.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
73
```xml <?xml version="1.0" encoding="utf-8" standalone="yes"?> <strings> <string id="1000">Allgemein</string> <string id="1010">Nach einem Neustart neu kalibrieren</string> <string id="1020">Touchscreen reinigen</string> <string id="2010">Touchscreen</string> <string id="2020">Sie knnen jetzt den Touchscreen sicher reinigen.</string> <string id="2030">Noch %d Sekunden brig.</string> </strings> ```
/content/code_sandbox/packages/addons/service/touchscreen/source/resources/language/German/strings.xml
xml
2016-03-13T01:46:18
2024-08-16T11:58:29
LibreELEC.tv
LibreELEC/LibreELEC.tv
2,216
127
```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. ** ** ** 5-row layout for English QWERTY. ** ** See path_to_url for ** more information. */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="key_tlde_main"></string> <string name="key_tlde_shift"></string> <string name="key_tlde_alt"></string> <string name="key_ae01_main">1</string> <string name="key_ae01_shift">!</string> <string name="key_ae01_alt">1</string> <string name="key_ae02_main">2</string> <string name="key_ae02_shift">\"</string> <string name="key_ae02_alt">2\@</string> <string name="key_ae03_main">3</string> <string name="key_ae03_shift">#</string> <string name="key_ae03_alt">3</string> <string name="key_ae04_main">4</string> <string name="key_ae04_shift"></string> <string name="key_ae04_alt">4$</string> <string name="key_ae05_main">5</string> <string name="key_ae05_shift">%</string> <string name="key_ae05_alt">5</string> <string name="key_ae06_main">6</string> <string name="key_ae06_shift">&amp;</string> <string name="key_ae06_alt"></string> <string name="key_ae07_main">7</string> <string name="key_ae07_shift">/</string> <string name="key_ae07_alt">7{</string> <string name="key_ae08_main">8</string> <string name="key_ae08_shift">(</string> <string name="key_ae08_alt">8[</string> <string name="key_ae09_main">9</string> <string name="key_ae09_shift">)</string> <string name="key_ae09_alt">9]</string> <string name="key_ae10_main">0</string> <string name="key_ae10_shift">=</string> <string name="key_ae10_alt">0}</string> <string name="key_ae11_main">+</string> <string name="key_ae11_shift">\?</string> <string name="key_ae11_alt">+\\</string> <string name="key_ae12_main"></string> <string name="key_ae12_shift">`</string> <string name="key_ae12_alt"></string> <string name="key_ad01_main">q</string> <string name="key_ad01_shift">Q</string> <string name="key_ad01_alt"></string> <string name="key_ad02_main">w</string> <string name="key_ad02_shift">W</string> <string name="key_ad02_alt"></string> <string name="key_ad03_main">e</string> <string name="key_ad03_shift">E</string> <string name="key_ad03_alt"></string> <string name="key_ad04_main">r</string> <string name="key_ad04_shift">R</string> <string name="key_ad04_alt">r</string> <string name="key_ad05_main">t</string> <string name="key_ad05_shift">T</string> <string name="key_ad05_alt"></string> <string name="key_ad06_main">y</string> <string name="key_ad06_shift">Y</string> <string name="key_ad06_alt"></string> <string name="key_ad07_main">u</string> <string name="key_ad07_shift">U</string> <string name="key_ad07_alt"></string> <string name="key_ad08_main">i</string> <string name="key_ad08_shift">I</string> <string name="key_ad08_alt"></string> <string name="key_ad09_main">o</string> <string name="key_ad09_shift">O</string> <string name="key_ad09_alt"></string> <string name="key_ad10_main">p</string> <string name="key_ad10_shift">P</string> <string name="key_ad10_alt"></string> <string name="key_ad11_main"></string> <string name="key_ad11_shift"></string> <string name="key_ad11_alt"></string> <string name="key_ad12_main"></string> <string name="key_ad12_shift">^</string> <string name="key_ad12_alt">~</string> <string name="key_bksl_main">&gt;</string> <string name="key_bksl_shift">&lt;</string> <string name="key_bksl_alt">&gt;|</string> <string name="key_ac01_main">a</string> <string name="key_ac01_shift">A</string> <string name="key_ac01_alt"></string> <string name="key_ac02_main">s</string> <string name="key_ac02_shift">S</string> <string name="key_ac02_alt"></string> <string name="key_ac03_main">d</string> <string name="key_ac03_shift">D</string> <string name="key_ac03_alt"></string> <string name="key_ac04_main">f</string> <string name="key_ac04_shift">F</string> <string name="key_ac04_alt"></string> <string name="key_ac05_main">g</string> <string name="key_ac05_shift">G</string> <string name="key_ac05_alt"></string> <string name="key_ac06_main">h</string> <string name="key_ac06_shift">H</string> <string name="key_ac06_alt"></string> <string name="key_ac07_main">j</string> <string name="key_ac07_shift">J</string> <string name="key_ac07_alt"></string> <string name="key_ac08_main">k</string> <string name="key_ac08_shift">K</string> <string name="key_ac08_alt"></string> <string name="key_ac09_main">l</string> <string name="key_ac09_shift">L</string> <string name="key_ac09_alt"></string> <string name="key_ac10_main"></string> <string name="key_ac10_shift"></string> <string name="key_ac10_alt"></string> <string name="key_ac11_main"></string> <string name="key_ac11_shift"></string> <string name="key_ac11_alt"></string> <string name="key_lsgt_main">\'</string> <string name="key_lsgt_shift">*</string> <string name="key_lsgt_alt"></string> <string name="key_ab01_main">z</string> <string name="key_ab01_shift">Z</string> <string name="key_ab01_alt"></string> <string name="key_ab02_main">x</string> <string name="key_ab02_shift">X</string> <string name="key_ab02_alt"></string> <string name="key_ab03_main">c</string> <string name="key_ab03_shift">C</string> <string name="key_ab03_alt"></string> <string name="key_ab04_main">v</string> <string name="key_ab04_shift">V</string> <string name="key_ab04_alt"></string> <string name="key_ab05_main">b</string> <string name="key_ab05_shift">B</string> <string name="key_ab05_alt"></string> <string name="key_ab06_main">n</string> <string name="key_ab06_shift">N</string> <string name="key_ab06_alt"></string> <string name="key_ab07_main">m</string> <string name="key_ab07_shift">M</string> <string name="key_ab07_alt"></string> <string name="key_ab08_main">,</string> <string name="key_ab08_shift">;</string> <string name="key_ab08_alt"></string> <string name="key_ab09_main">.</string> <string name="key_ab09_shift">:</string> <string name="key_ab09_alt"></string> <string name="key_ab10_main">-</string> <string name="key_ab10_shift">_</string> <string name="key_ab10_alt">-</string> </resources> ```
/content/code_sandbox/app/src/main/res/values-sv/donottranslate-keymap.xml
xml
2016-01-22T21:40:54
2024-08-16T11:54:30
hackerskeyboard
klausw/hackerskeyboard
1,807
2,092
```xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="path_to_url" xmlns:app="path_to_url"> <item android:id="@+id/action_settings" android:orderInCategory="100" android:title="@string/action_settings" app:showAsAction="never" /> </menu> ```
/content/code_sandbox/sample/src/main/res/menu/main.xml
xml
2016-06-02T09:26:56
2024-08-15T10:52:54
MVVMLight
Kelin-Hong/MVVMLight
1,847
77
```xml import * as React from 'react'; import { useDataGridRow_unstable } from './useDataGridRow'; import { renderDataGridRow_unstable } from './renderDataGridRow'; import { useDataGridRowStyles_unstable } from './useDataGridRowStyles.styles'; import type { DataGridRowProps } from './DataGridRow.types'; import type { ForwardRefComponent } from '@fluentui/react-utilities'; import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts'; /** * DataGridRow component */ export const DataGridRow: ForwardRefComponent<DataGridRowProps> & (<TItem>(props: DataGridRowProps<TItem>) => JSX.Element) = React.forwardRef((props, ref) => { const state = useDataGridRow_unstable(props, ref); useDataGridRowStyles_unstable(state); useCustomStyleHook_unstable('useDataGridRowStyles_unstable')(state); return renderDataGridRow_unstable(state); }) as ForwardRefComponent<DataGridRowProps> & (<TItem>(props: DataGridRowProps<TItem>) => JSX.Element); DataGridRow.displayName = 'DataGridRow'; ```
/content/code_sandbox/packages/react-components/react-table/library/src/components/DataGridRow/DataGridRow.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
252
```xml import * as React from 'react'; import { ISearchSpfxWebPartProps } from '../ISearchSpfxWebPartProps'; import { IWebPartContext } from '@microsoft/sp-webpart-base'; import searchActions from '../flux/actions/searchActions'; import searchStore from '../flux/stores/searchStore'; import { IExternalTemplate } from '../utils/ITemplates'; import TemplateLoader from '../templates/TemplateLoader'; import 'SearchSpfx.module.scss'; export interface ISearchSpfxProps extends ISearchSpfxWebPartProps { context: IWebPartContext; firstRender: Boolean; externalTemplate?: IExternalTemplate; } export interface ISearchState { results?: any[]; loaded?: Boolean; component?: any; template?: string; } export default class SearchSpfx extends React.Component<ISearchSpfxProps, ISearchState> { private loader: TemplateLoader = new TemplateLoader(); constructor(props: ISearchSpfxProps, context: IWebPartContext) { super(props, context); this.state = { results: [], loaded: false, component: null, template: "" }; this._onChange = this._onChange.bind(this); }; public componentWillMount(): void { // Check if rendering is done from an external template if (typeof this.props.externalTemplate !== 'undefined') { // Loading internal template this.loader.getComponent(this.props.template).then((component) => { this.setState({ template: this.props.template, component: component }); }); } } public componentDidMount(): void { searchStore.addChangeListener(this._onChange); this._getResults(this.props); } public componentWillUnmount(): void { searchStore.removeChangeListener(this._onChange); } public componentWillReceiveProps(nextProps: ISearchSpfxProps): void { // Get the new results this._getResults(nextProps); } private _getResults(crntProps: ISearchSpfxProps): void { if (typeof crntProps.externalTemplate !== 'undefined') { searchActions.get(crntProps.context, crntProps.query, crntProps.maxResults, crntProps.sorting, crntProps.externalTemplate.properties.mappings); } else { searchActions.get(crntProps.context, crntProps.query, crntProps.maxResults, crntProps.sorting, this.loader.getTemplateMappings(crntProps.template)); } } private _onChange(): void { // Check if another template needs to be loaded if (typeof this.props.externalTemplate === 'undefined' && this.state.template !== this.props.template) { this.loader.getComponent(this.props.template).then((component) => { this.setState({ template: this.props.template, component: component }); }); } this.setState({ results: searchStore.getSearchResults(), loaded: true }); } public render(): JSX.Element { if (this.props.firstRender || this.state.loaded) { if (this.state.results.length === 0) { return ( <div /> ); } else { // Load the template if (typeof this.props.externalTemplate !== 'undefined') { /* tslint:disable:variable-name */ const CrntComponent: any = this.props.externalTemplate.component; /* tslint:disable:variable-name */ return <CrntComponent {...this.props} results={this.state.results} />; } else if (this.state.component !== null) { /* tslint:disable:variable-name */ const CrntComponent: any = this.state.component; /* tslint:disable:variable-name */ return <CrntComponent {...this.props} results={this.state.results} />; } else { return (<div />); } } } else { return (<div />); } } } ```
/content/code_sandbox/samples/react-search/src/webparts/searchSpfx/components/SearchSpfx.tsx
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
824
```xml import { ExposeOptions } from '..'; /** * This object represents metadata assigned to a property via the @Expose decorator. */ export interface ExposeMetadata { target: Function; /** * The property name this metadata belongs to on the target (class or property). * * Note: If the decorator is applied to a class the propertyName will be undefined. */ propertyName: string | undefined; /** * Options passed to the @Expose operator for this property. */ options: ExposeOptions; } ```
/content/code_sandbox/src/interfaces/metadata/expose-metadata.interface.ts
xml
2016-02-09T13:26:52
2024-08-16T11:51:20
class-transformer
typestack/class-transformer
6,715
111
```xml <?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> <device id="retina4_7" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> <!--View Controller--> <scene sceneID="tne-QT-ifu"> <objects> <viewController id="BYZ-38-t0r" customClass="ViewController" customModule="RandomColorization" customModuleProvider="target" sceneMemberID="viewController"> <layoutGuides> <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> </layoutGuides> <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kWM-YG-rxV"> <rect key="frame" x="113" y="260" width="148" height="148"/> <state key="normal" image="music play"/> <connections> <action selector="playMusicButtonDidTouch:" destination="BYZ-38-t0r" eventType="touchUpInside" id="0Pd-10-0Gw"/> </connections> </button> </subviews> <color key="backgroundColor" red="0.1290857195854187" green="0.0" blue="0.44728690385818481" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstItem="kWM-YG-rxV" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="Qjo-c0-zu6"/> <constraint firstItem="kWM-YG-rxV" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="vXc-Q9-QXF"/> </constraints> </view> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> </objects> </scene> </scenes> <resources> <image name="music play" width="148" height="148"/> </resources> </document> ```
/content/code_sandbox/Project 08 - RandomGradientColorMusic/RandomColorization/Base.lproj/Main.storyboard
xml
2016-02-13T14:02:12
2024-08-16T09:41:59
30DaysofSwift
allenwong/30DaysofSwift
11,506
734
```xml import { modeAtom } from "@/store" import { useAtomValue } from "jotai" import { ListFilterIcon } from "lucide-react" import { Button } from "@/components/ui/button" import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover" const RenderFilter = ({ children }: React.PropsWithChildren) => { const mode = useAtomValue(modeAtom) if (mode !== "mobile") return <>{children}</> return ( <Popover> <PopoverTrigger asChild> <Button size={"sm"}> <ListFilterIcon className="h-5 w-5 mr-1" /> </Button> </PopoverTrigger> <PopoverContent className="w-screen">{children}</PopoverContent> </Popover> ) } export default RenderFilter ```
/content/code_sandbox/pos/app/(main)/(orders)/components/renderFilter.tsx
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
183
```xml <?xml version="1.0" encoding="UTF-8" ?> <!-- --> <!DOCTYPE ldml SYSTEM "../../dtd/cldr/common/dtd/ldml.dtd"> <ldml> <identity> <version number="$Revision$"/> <language type="ru"/> </identity> <rbnf> <rulesetGrouping type="SpelloutRules"> <ruleset type="lenient-parse" access="private"> <rbnfrule value="0">&amp;[last primary ignorable ] ' ' ',' '-' '';</rbnfrule> </ruleset> </rulesetGrouping> </rbnf> </ldml> ```
/content/code_sandbox/icu4c/source/data/xml/rbnf/ru.xml
xml
2016-01-08T02:42:32
2024-08-16T18:14:55
icu
unicode-org/icu
2,693
149
```xml /** * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import {Operation} from './Operation'; export class RunMergeDriversOperation extends Operation { static opName = 'RunMergeDrivers'; constructor() { super('RunMergeDriversOperation'); } getArgs() { return ['resolve', '--all']; } } ```
/content/code_sandbox/addons/isl/src/operations/RunMergeDriversOperation.ts
xml
2016-05-05T16:53:47
2024-08-16T19:12:02
sapling
facebook/sapling
5,987
87
```xml /// <reference types="../../../../types/cypress" /> import { NAME } from '..' import { generate } from '@/../cypress/templates' const props = {} const stories = { Default: <NAME />, } // Tests describe('NAME', () => { generate({ stories, props, component: NAME }) }) ```
/content/code_sandbox/templates/cypress-test.tsx
xml
2016-09-12T00:39:35
2024-08-16T20:06:39
vuetify
vuetifyjs/vuetify
39,539
67
```xml import toTabularFormat from '../../src/formatter/tabularStyle.js'; describe('toTabularFormat()', () => { it('does nothing in standard style', () => { expect(toTabularFormat('FROM', 'standard')).toBe('FROM'); expect(toTabularFormat('INNER JOIN', 'standard')).toBe('INNER JOIN'); expect(toTabularFormat('INSERT INTO', 'standard')).toBe('INSERT INTO'); }); it('formats in tabularLeft style', () => { expect(toTabularFormat('FROM', 'tabularLeft')).toBe('FROM '); expect(toTabularFormat('INNER JOIN', 'tabularLeft')).toBe('INNER JOIN'); expect(toTabularFormat('INSERT INTO', 'tabularLeft')).toBe('INSERT INTO'); }); it('formats in tabularRight style', () => { expect(toTabularFormat('FROM', 'tabularRight')).toBe(' FROM'); expect(toTabularFormat('INNER JOIN', 'tabularRight')).toBe(' INNER JOIN'); expect(toTabularFormat('INSERT INTO', 'tabularRight')).toBe(' INSERT INTO'); }); }); ```
/content/code_sandbox/test/unit/tabularStyle.test.ts
xml
2016-09-12T13:09:04
2024-08-16T10:30:12
sql-formatter
sql-formatter-org/sql-formatter
2,272
245
```xml /* * * This source code is licensed under the MIT license which is detailed in the LICENSE.txt file. */ import { Readable } from "node:stream"; import { BulkFileState, BulkFileMetadata, Event, Disposable } from "@extraterm/extraterm-extension-api"; import { BulkFile } from "./BulkFile.js"; import { DisposableNullTransform } from "./DisposableNullTransform.js"; const ONE_KILOBYTE = 1024; export class BlobBulkFile implements BulkFile { #peekBuffer: Buffer = null; #mimeType: string = null; #metadata: BulkFileMetadata = null; #blobBuffer: Buffer = null; onAvailableSizeChanged: Event<number>; onStateChanged: Event<BulkFileState>; constructor(mimeType: string, metadata: BulkFileMetadata, blobBuffer: Buffer) { this.#mimeType = mimeType; this.#metadata = metadata; this.#blobBuffer = blobBuffer; } getFilePath(): string { return null; } getUrl(): string { return null; } createReadableStream(): NodeJS.ReadableStream & Disposable { const stream = Readable.from(this.#blobBuffer); const dnt = new DisposableNullTransform(null); stream.pipe(dnt); return dnt; } getState(): BulkFileState { return BulkFileState.COMPLETED; } getByteCount(): number { return this.getTotalSize(); } getTotalSize(): number { return this.#blobBuffer.length; } getMetadata(): BulkFileMetadata { return this.#metadata; } getPeekBuffer(): Buffer { if (this.#peekBuffer == null) { const peekSize = Math.min(ONE_KILOBYTE, this.#blobBuffer.length); this.#peekBuffer = Buffer.alloc(peekSize); this.#blobBuffer.copy(this.#peekBuffer, 0, 0, peekSize); } return this.#peekBuffer; } ref(): number { return 0; } deref(): number { return 0; } getRefCount(): number { return 0; } } ```
/content/code_sandbox/main/src/bulk_file_handling/BlobBulkFile.ts
xml
2016-03-04T12:39:59
2024-08-16T18:44:37
extraterm
sedwards2009/extraterm
2,501
462
```xml import "reflect-metadata" import { DataSource } from "../../../src/data-source/DataSource" import { closeTestingConnections, createTestingConnections, } from "../../utils/test-utils" import { Post } from "./entity/Post" describe("github issues > #438 how can i define unsigned column?", () => { let connections: DataSource[] before(async () => { connections = await createTestingConnections({ entities: [__dirname + "/entity/*{.js,.ts}"], enabledDrivers: ["mysql"], schemaCreate: true, dropSchema: true, }) }) after(() => closeTestingConnections(connections)) it("should correctly create and change column with UNSIGNED and ZEROFILL attributes", () => Promise.all( connections.map(async (connection) => { const queryRunner = connection.createQueryRunner() const metadata = connection.getMetadata(Post) const idColumnMetadata = metadata.findColumnWithPropertyName("id") const numColumnMetadata = metadata.findColumnWithPropertyName("num") let table = await queryRunner.getTable("post") table!.findColumnByName("id")!.unsigned!.should.be.true table!.findColumnByName("num")!.zerofill!.should.be.true table!.findColumnByName("num")!.unsigned!.should.be.true idColumnMetadata!.unsigned = false numColumnMetadata!.zerofill = false numColumnMetadata!.unsigned = false await connection.synchronize() table = await queryRunner.getTable("post") table!.findColumnByName("id")!.unsigned!.should.be.false table!.findColumnByName("num")!.zerofill!.should.be.false table!.findColumnByName("num")!.unsigned!.should.be.false await queryRunner.release() }), )) }) ```
/content/code_sandbox/test/github-issues/438/issue-438.ts
xml
2016-02-29T07:41:14
2024-08-16T18:28:52
typeorm
typeorm/typeorm
33,875
382
```xml /** @jsx jsx */ import { Transforms } from 'slate' import { jsx } from '../../..' export const run = editor => { Transforms.delete(editor) } export const input = ( <editor> <block> wo <anchor /> rd </block> <block> an <focus /> other </block> </editor> ) export const output = ( <editor> <block> wo <cursor /> other </block> </editor> ) ```
/content/code_sandbox/packages/slate/test/transforms/delete/selection/block-across.tsx
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
120
```xml /* * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ export interface NgAddOptions { project?: string; module?: string; } ```
/content/code_sandbox/packages/schematics/src/utility/ng-add-options.ts
xml
2016-09-29T17:24:17
2024-08-11T17:06:15
clarity
vmware-archive/clarity
6,431
47
```xml import { isPlainObject } from 'is-plain-object' import { Element, createEditor as makeEditor } from 'slate' import { createAnchor, createCursor, createEditor, createElement, createFocus, createFragment, createSelection, createText, } from './creators' /** * The default creators for Slate objects. */ const DEFAULT_CREATORS = { anchor: createAnchor, cursor: createCursor, editor: createEditor(makeEditor), element: createElement, focus: createFocus, fragment: createFragment, selection: createSelection, text: createText, } /** * `HyperscriptCreators` are dictionaries of `HyperscriptCreator` functions * keyed by tag name. */ type HyperscriptCreators<T = any> = Record< string, (tagName: string, attributes: { [key: string]: any }, children: any[]) => T > /** * `HyperscriptShorthands` are dictionaries of properties applied to specific * kind of object, keyed by tag name. They allow you to easily define custom * hyperscript tags for your domain. */ type HyperscriptShorthands = Record<string, Record<string, any>> /** * Create a Slate hyperscript function with `options`. */ const createHyperscript = ( options: { creators?: HyperscriptCreators elements?: HyperscriptShorthands } = {} ) => { const { elements = {} } = options const elementCreators = normalizeElements(elements) const creators = { ...DEFAULT_CREATORS, ...elementCreators, ...options.creators, } const jsx = createFactory(creators) return jsx } /** * Create a Slate hyperscript function with `options`. */ const createFactory = <T extends HyperscriptCreators>(creators: T) => { const jsx = <S extends keyof T & string>( tagName: S, attributes?: Object, ...children: any[] ): ReturnType<T[S]> => { const creator = creators[tagName] if (!creator) { throw new Error(`No hyperscript creator found for tag: <${tagName}>`) } if (attributes == null) { attributes = {} } if (!isPlainObject(attributes)) { children = [attributes].concat(children) attributes = {} } children = children.filter(child => Boolean(child)).flat() const ret = creator(tagName, attributes, children) return ret } return jsx } /** * Normalize a dictionary of element shorthands into creator functions. */ const normalizeElements = (elements: HyperscriptShorthands) => { const creators: HyperscriptCreators<Element> = {} for (const tagName in elements) { const props = elements[tagName] if (typeof props !== 'object') { throw new Error( `Properties specified for a hyperscript shorthand should be an object, but for the custom element <${tagName}> tag you passed: ${props}` ) } creators[tagName] = ( tagName: string, attributes: { [key: string]: any }, children: any[] ) => { return createElement('element', { ...props, ...attributes }, children) } } return creators } export { createHyperscript, HyperscriptCreators, HyperscriptShorthands } ```
/content/code_sandbox/packages/slate-hyperscript/src/hyperscript.ts
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
733
```xml import { FilesController } from '@/Controllers/FilesController' import { LinkingController } from '@/Controllers/LinkingController' import { NoteType, SNNote } from '@standardnotes/snjs' import { useEffect } from 'react' import { useApplication } from '../ApplicationProvider' import { useFileDragNDrop } from '../FileDragNDropProvider' type Props = { note: SNNote linkingController: LinkingController filesController: FilesController noteViewElement: HTMLElement | null } const NoteViewFileDropTarget = ({ note, linkingController, noteViewElement, filesController }: Props) => { const application = useApplication() const { isDraggingFiles, addDragTarget, removeDragTarget } = useFileDragNDrop() useEffect(() => { const target = noteViewElement if (target) { const tooltipText = 'Drop your files to upload and link them to the current note' if (note.noteType === NoteType.Super) { addDragTarget(target, { tooltipText, handleFileUpload: (fileOrHandle) => { filesController.uploadAndInsertFileToCurrentNote(fileOrHandle) }, note, }) } else { addDragTarget(target, { tooltipText, callback: async (uploadedFile) => { await linkingController.linkItems(note, uploadedFile) void application.changeAndSaveItem.execute(uploadedFile, (mutator) => { mutator.protected = note.protected }) filesController.notifyObserversOfUploadedFileLinkingToCurrentNote(uploadedFile.uuid) }, note, }) } } return () => { if (target) { removeDragTarget(target) } } }, [addDragTarget, linkingController, note, noteViewElement, removeDragTarget, filesController, application]) return isDraggingFiles ? ( // Required to block drag events to editor iframe <div id="file-drag-iframe-overlay" className="absolute left-0 top-0 z-dropdown-menu h-full w-full" /> ) : null } export default NoteViewFileDropTarget ```
/content/code_sandbox/packages/web/src/javascripts/Components/NoteView/NoteViewFileDropTarget.tsx
xml
2016-12-05T23:31:33
2024-08-16T06:51:19
app
standardnotes/app
5,180
462
```xml import type { Container } from '../../container'; import type { GitContributor } from '../../git/models/contributor'; import type { Repository } from '../../git/models/repository'; import { executeCoreCommand } from '../../system/command'; import { normalizePath } from '../../system/path'; import type { ViewsWithRepositoryFolders } from '../../views/viewBase'; import type { PartialStepState, StepGenerator, StepState } from '../quickCommand'; import { endSteps, QuickCommand, StepResultBreak } from '../quickCommand'; import { pickContributorsStep, pickRepositoryStep } from '../quickCommand.steps'; interface Context { repos: Repository[]; activeRepo: Repository | undefined; associatedView: ViewsWithRepositoryFolders; title: string; } interface State { repo: string | Repository; contributors: GitContributor | GitContributor[]; } export interface CoAuthorsGitCommandArgs { readonly command: 'co-authors'; state?: Partial<State>; } type CoAuthorStepState<T extends State = State> = ExcludeSome<StepState<T>, 'repo', string>; export class CoAuthorsGitCommand extends QuickCommand<State> { constructor(container: Container, args?: CoAuthorsGitCommandArgs) { super(container, 'co-authors', 'co-authors', 'Add Co-Authors', { description: 'adds co-authors to a commit message', }); let counter = 0; if (args?.state?.repo != null) { counter++; } if ( args?.state?.contributors != null && (!Array.isArray(args.state.contributors) || args.state.contributors.length !== 0) ) { counter++; } this.initialState = { counter: counter, confirm: false, ...args?.state, }; } override get canConfirm() { return false; } async execute(state: CoAuthorStepState) { const repo = await this.container.git.getOrOpenScmRepository(state.repo.path); if (repo == null) return; let message = repo.inputBox.value; const index = message.indexOf('Co-authored-by: '); if (index !== -1) { message = message.substring(0, index - 1).trimRight(); } if (state.contributors != null && !Array.isArray(state.contributors)) { state.contributors = [state.contributors]; } for (const c of state.contributors) { let newlines; if (message.includes('Co-authored-by: ')) { newlines = '\n'; } else if (message.length !== 0 && message.endsWith('\n')) { newlines = '\n\n'; } else { newlines = '\n\n\n'; } message += `${newlines}Co-authored-by: ${c.getCoauthor()}`; } repo.inputBox.value = message; void (await executeCoreCommand('workbench.view.scm')); } protected async *steps(state: PartialStepState<State>): StepGenerator { const context: Context = { repos: this.container.git.openRepositories, activeRepo: undefined, associatedView: this.container.contributorsView, title: this.title, }; const scmRepositories = await this.container.git.getOpenScmRepositories(); if (scmRepositories.length) { // Filter out any repo's that are not known to the built-in git context.repos = context.repos.filter(repo => scmRepositories.find(r => normalizePath(r.rootUri.fsPath) === repo.path), ); // Ensure that the active repo is known to the built-in git context.activeRepo = await this.container.git.getOrOpenRepositoryForEditor(); if ( context.activeRepo != null && !scmRepositories.some(r => r.rootUri.fsPath === context.activeRepo!.path) ) { context.activeRepo = undefined; } } let skippedStepOne = false; while (this.canStepsContinue(state)) { context.title = this.title; if (state.counter < 1 || state.repo == null || typeof state.repo === 'string') { skippedStepOne = false; if (context.repos.length === 1) { skippedStepOne = true; if (state.repo == null) { state.counter++; } state.repo = context.repos[0]; } else { const result = yield* pickRepositoryStep(state, context); // Always break on the first step (so we will go back) if (result === StepResultBreak) break; state.repo = result; } } if (state.counter < 2 || state.contributors == null) { const result = yield* pickContributorsStep( state as CoAuthorStepState, context, 'Choose contributors to add as co-authors', ); if (result === StepResultBreak) { // If we skipped the previous step, make sure we back up past it if (skippedStepOne) { state.counter--; } continue; } state.contributors = result; } endSteps(state); void this.execute(state as CoAuthorStepState); } return state.counter < 0 ? StepResultBreak : undefined; } } ```
/content/code_sandbox/src/commands/git/coauthors.ts
xml
2016-08-08T14:50:30
2024-08-15T21:25:09
vscode-gitlens
gitkraken/vscode-gitlens
8,889
1,155
```xml import { Entity } from "../../../../src/decorator/entity/Entity" import { PrimaryGeneratedColumn } from "../../../../src/decorator/columns/PrimaryGeneratedColumn" import { Column } from "../../../../src/decorator/columns/Column" import { One } from "./One" import { ManyToOne } from "../../../../src" @Entity() export class Two { @PrimaryGeneratedColumn() id: number @ManyToOne((type) => One) one: One @Column({ type: "text" }) aaaaa: string @Column({ type: "text" }) bbbbb: string @Column({ type: "text" }) ccccc: string @Column({ type: "text" }) ddddd: string @Column({ type: "text" }) eeeee: string @Column({ type: "text" }) fffff: string @Column({ type: "text" }) ggggg: string @Column({ type: "text" }) hhhhh: string } ```
/content/code_sandbox/test/benchmark/multiple-joins-querybuilder/entity/Two.ts
xml
2016-02-29T07:41:14
2024-08-16T18:28:52
typeorm
typeorm/typeorm
33,875
228
```xml <?xml version='1.0' encoding='UTF-8'?> <epp xmlns='urn:ietf:params:xml:ns:epp-1.0'> <response> <result code='1000'> <msg>Throwaway Message</msg> </result> <trID> <clTRID>@@CLTRID@@</clTRID> <svTRID>@@SVTRID@@</svTRID> </trID> </response> </epp> ```
/content/code_sandbox/prober/src/main/resources/google/registry/monitoring/blackbox/message/success_response.xml
xml
2016-02-29T20:16:48
2024-08-15T19:49:29
nomulus
google/nomulus
1,685
112
```xml import * as fs from 'fs-extra'; // import * as path from 'path'; import { homedir } from 'os'; import { handleOutputFlag } from '../../src/utils/output'; import { OWNER_READ_WRITE } from '../../src/constants'; jest.mock('fs-extra'); // jest.mock('path'); describe('handleOutputFlag', () => { const namespace = 'testNamespace'; const data = { key: 'value' }; const outputPath = process.cwd(); const relativePath = 'testPath'; const absolutePath = '/testPath'; const filename = 'testFile.json'; const error = new Error('write error'); beforeEach(() => { (fs.writeJSONSync as jest.Mock).mockClear(); }); it('should write data to file in the current working directory if outputPath is not provided', async () => { const outputFilePath = `${outputPath}/${namespace}.json`; await handleOutputFlag('', data, namespace); expect(fs.writeJSONSync).toHaveBeenCalledWith(outputFilePath, data, { spaces: ' ', mode: OWNER_READ_WRITE, }); }); it('should respond with success message if writing data to file in the current working directory succeeds', async () => { const outputFilePath = `${outputPath}/${namespace}.json`; const res = await handleOutputFlag(outputFilePath, data, namespace); expect(res).toBe(`Successfully written data to ${outputFilePath}`); }); it('should throw error if writing data to file in the current working directory fails', async () => { const outputFilePath = `${outputPath}/${namespace}.json`; (fs.writeJSONSync as jest.Mock).mockImplementationOnce(() => { throw error; }); await expect(handleOutputFlag(outputFilePath, data, namespace)).rejects.toThrow( `Error writing data to ${outputFilePath}: ${error.toString()}`, ); }); it('should write data to relative path if outputPath is provided', async () => { const outputFilePath = `${outputPath}/testPath/${namespace}.json`; await handleOutputFlag(relativePath, data, namespace); expect(fs.writeJSONSync).toHaveBeenCalledWith(outputFilePath, data, { spaces: ' ', mode: OWNER_READ_WRITE, }); }); it('should respond with success message if writing data to relative path succeeds', async () => { const outputFilePath = `${outputPath}/testPath/${namespace}.json`; const res = await handleOutputFlag(relativePath, data, namespace); expect(res).toBe(`Successfully written data to ${outputFilePath}`); }); it('should throw error if writing data to relative path fails', async () => { const outputFilePath = `${outputPath}/testPath/${namespace}.json`; (fs.writeJSONSync as jest.Mock).mockImplementationOnce(() => { throw error; }); await expect(handleOutputFlag(relativePath, data, namespace)).rejects.toThrow( `Error writing data to ${outputFilePath}: ${error.toString()}`, ); }); it('should write data to absolute path if outputPath is provided', async () => { const outputFilePath = '/testPath/testNamespace.json'; await handleOutputFlag(absolutePath, data, namespace); expect(fs.writeJSONSync).toHaveBeenCalledWith(outputFilePath, data, { spaces: ' ', mode: OWNER_READ_WRITE, }); }); it('should respond with success message if writing data to absolute path succeeds', async () => { const outputFilePath = '/testPath/testNamespace.json'; const res = await handleOutputFlag(absolutePath, data, namespace); expect(res).toBe(`Successfully written data to ${outputFilePath}`); }); it('should throw error if writing data to absolute path fails', async () => { const outputFilePath = '/testPath/testNamespace.json'; (fs.writeJSONSync as jest.Mock).mockImplementationOnce(() => { throw error; }); await expect(handleOutputFlag(absolutePath, data, namespace)).rejects.toThrow( `Error writing data to ${outputFilePath}: ${error.toString()}`, ); }); it('should write data to file in the current working directory if outputPath is provided with filename', async () => { const outputFilePath = `${outputPath}/${filename}`; await handleOutputFlag('', data, namespace, filename); expect(fs.writeJSONSync).toHaveBeenCalledWith(outputFilePath, data, { spaces: ' ', mode: OWNER_READ_WRITE, }); }); it('should respond with success message if writing data to file in the current working directory with filename succeeds', async () => { const outputFilePath = `${outputPath}/${filename}`; const res = await handleOutputFlag('', data, namespace, filename); expect(res).toBe(`Successfully written data to ${outputFilePath}`); }); it('should throw error if writing data to file in the current working directory with filename fails', async () => { const outputFilePath = `${outputPath}/${filename}`; (fs.writeJSONSync as jest.Mock).mockImplementationOnce(() => { throw error; }); await expect(handleOutputFlag('', data, namespace, filename)).rejects.toThrow( `Error writing data to ${outputFilePath}: ${error.toString()}`, ); }); it('should write data to user home if ~ is provided', async () => { const outputFilePath = `${homedir()}/${namespace}.json`; await handleOutputFlag('~', data, namespace); expect(fs.writeJSONSync).toHaveBeenCalledWith(outputFilePath, data, { spaces: ' ', mode: OWNER_READ_WRITE, }); }); }); ```
/content/code_sandbox/commander/test/utils/output.spec.ts
xml
2016-02-01T21:45:35
2024-08-15T19:16:48
lisk-sdk
LiskArchive/lisk-sdk
2,721
1,172
```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. --> <manifest xmlns:android="path_to_url" package="com.example.android.sunshine"> <!-- This permission is necessary in order for Sunshine to perform network access. --> <uses-permission android:name="android.permission.INTERNET" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <!--TODO (4) Configure DetailActivity's up button functionality--> </application> </manifest> ```
/content/code_sandbox/S04.01-Exercise-LaunchNewActivity/app/src/main/AndroidManifest.xml
xml
2016-11-02T04:42:26
2024-08-12T19:38:06
ud851-Sunshine
udacity/ud851-Sunshine
1,999
231
```xml export const data = { labels: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], datasets: [ { label: 'Data One', backgroundColor: '#f87979', data: [40, 20, 12, 39, 10, 40, 39, 80, 40, 20, 12, 11] } ] } export const options = { responsive: true, maintainAspectRatio: false } ```
/content/code_sandbox/sandboxes/events/src/chartConfig.ts
xml
2016-06-26T13:25:12
2024-08-15T18:05:48
vue-chartjs
apertureless/vue-chartjs
5,514
142
```xml === Empty mapping --- yaml \--- {} --- perl [ {} ] # Simple hashs === one_hash1 --- yaml --- foo: bar --- perl [ { foo => 'bar' } ] === one_hash2 --- yaml --- foo: bar this: ~ --- perl [ { this => undef, foo => 'bar' } ] === one_hash3 --- yaml --- -foo: bar --- perl [ { '-foo' => 'bar' } ] # Implicit document start === implicit_hash --- yaml foo: bar --- perl [ { foo => 'bar' } ] # Make sure we support x-foo keys === x-foo key --- yaml --- x-foo: 1 --- perl [ { 'x-foo' => 1 } ] # Hash key legally containing a colon === module_hash_key --- yaml --- Foo::Bar: 1 --- perl [ { 'Foo::Bar' => 1 } ] # Hash indented === hash_indented --- yaml --- foo: bar --- perl [ { foo => "bar" } ] ##################################################################### # Empty Values and Premature EOF === empty hash keys --- yaml --- foo: 0 requires: build_requires: --- perl [ { foo => 0, requires => undef, build_requires => undef } ] --- noyamlpm ##################################################################### # Confirm we can read the synopsis === synopsis --- yaml --- rootproperty: blah section: one: two three: four Foo: Bar empty: ~ --- perl [ { rootproperty => 'blah', section => { one => 'two', three => 'four', Foo => 'Bar', empty => undef, }, } ] ##################################################################### # Indentation after empty hash value === Indentation after empty hash value --- yaml --- Test: optmods: Bad: 0 Foo: 1 Long: 0 version: 5 Test_IncludeA: optmods: Test_IncludeB: optmods: _meta: name: 'test profile' note: 'note this test profile' --- perl [ { Test => { optmods => { Bad => 0, Foo => 1, Long => 0, }, version => 5, }, Test_IncludeA => { optmods => undef, }, Test_IncludeB => { optmods => undef, }, _meta => { name => 'test profile', note => 'note this test profile', }, } ] ##################################################################### # Spaces in the Key === spaces in the key --- yaml --- the key: the value --- perl [ { 'the key' => 'the value' } ] # Complex keys === key_with_whitespace --- yaml --- a b: c d --- perl [ { 'a b' => 'c d' } ] === quoted_empty_key --- yaml --- '': foo --- perl [ { '' => 'foo' } ] ```
/content/code_sandbox/gnu/usr.bin/perl/cpan/CPAN-Meta-YAML/t/tml-local/yaml-roundtrip/mapping.tml
xml
2016-08-30T18:18:25
2024-08-16T17:21:09
src
openbsd/src
3,139
681
```xml <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="path_to_url" xmlns:flowable="path_to_url" targetNamespace="Examples"> <process id="startProcessFromDelegate" isExecutable="true"> <startEvent id="theStart"/> <sequenceFlow id="flow1" sourceRef="theStart" targetRef="service"/> <serviceTask id="service" flowable:expression="${startProcessInstanceDelegate.startProcess()}"/> <sequenceFlow id="flow2" sourceRef="service" targetRef="task"/> <userTask id="task"/> <sequenceFlow id="flow3" sourceRef="task" targetRef="theEnd"/> <endEvent id="theEnd"/> </process> <process id="oneTaskProcess" isExecutable="true"> <startEvent id="oneTaskProcessStart"/> <sequenceFlow id="oneTaskProcessFlow1" sourceRef="oneTaskProcessStart" targetRef="oneTaskProcessTask"/> <userTask id="oneTaskProcessTask"/> <sequenceFlow id="oneTaskProcessFlow2" sourceRef="oneTaskProcessTask" targetRef="oneTaskProcessEnd"/> <endEvent id="oneTaskProcessEnd"/> </process> </definitions> ```
/content/code_sandbox/modules/flowable-spring/src/test/resources/org/flowable/spring/test/servicetask/UseFlowableServiceInServiceTaskTest.testUseInjectedRuntimeServiceInServiceTask.bpmn20.xml
xml
2016-10-13T07:21:43
2024-08-16T15:23:14
flowable-engine
flowable/flowable-engine
7,715
276
```xml import {contrastColor} from './color.ts'; test('contrastColor', () => { expect(contrastColor('#d73a4a')).toBe('#fff'); expect(contrastColor('#0075ca')).toBe('#fff'); expect(contrastColor('#cfd3d7')).toBe('#000'); expect(contrastColor('#a2eeef')).toBe('#000'); expect(contrastColor('#7057ff')).toBe('#fff'); expect(contrastColor('#008672')).toBe('#fff'); expect(contrastColor('#e4e669')).toBe('#000'); expect(contrastColor('#d876e3')).toBe('#000'); expect(contrastColor('#ffffff')).toBe('#000'); expect(contrastColor('#2b8684')).toBe('#fff'); expect(contrastColor('#2b8786')).toBe('#fff'); expect(contrastColor('#2c8786')).toBe('#000'); expect(contrastColor('#3bb6b3')).toBe('#000'); expect(contrastColor('#7c7268')).toBe('#fff'); expect(contrastColor('#7e716c')).toBe('#fff'); expect(contrastColor('#81706d')).toBe('#fff'); expect(contrastColor('#807070')).toBe('#fff'); expect(contrastColor('#84b6eb')).toBe('#000'); }); ```
/content/code_sandbox/web_src/js/utils/color.test.ts
xml
2016-11-01T02:13:26
2024-08-16T19:51:49
gitea
go-gitea/gitea
43,694
283
```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 type { DatePickerBaseProps } from "./datePickerBaseProps"; import { isDateValid, isDayInRange } from "./dateUtils"; export interface DateFormatProps { /** * The error message to display when the date selected is invalid. * * @default "Invalid date" */ invalidDateMessage?: string; /** * The locale name, which is passed to `formatDate`, `parseDate`, and the functions in `localeUtils`. */ locale?: string; /** * The error message to display when the date selected is out of range. * * @default "Out of range" */ outOfRangeMessage?: string; /** * Placeholder text to display in empty input fields. * Recommended practice is to indicate the expected date format. */ placeholder?: string; /** * Function to render a JavaScript `Date` to a string. * Optional `localeCode` argument comes directly from the prop on this component: * if the prop is defined, then the argument will be too. */ formatDate(date: Date, localeCode?: string): string; /** * Function to deserialize user input text to a JavaScript `Date` object. * Return `false` if the string is an invalid date. * Return `null` to represent the absence of a date. * Optional `localeCode` argument comes directly from the prop on this component. */ parseDate(str: string, localeCode?: string): Date | false | null; } export function getFormattedDateString( date: Date | false | null | undefined, props: Omit<DateFormatProps, "parseDate"> & Pick<DatePickerBaseProps, "maxDate" | "minDate">, ignoreRange = false, ) { if (date == null) { return ""; } else if (!isDateValid(date)) { return props.invalidDateMessage; } else if (ignoreRange || isDayInRange(date, [props.minDate, props.maxDate])) { return props.formatDate(date, props.locale); } else { return props.outOfRangeMessage; } } ```
/content/code_sandbox/packages/datetime/src/common/dateFormatProps.tsx
xml
2016-10-25T21:17:50
2024-08-16T15:14:48
blueprint
palantir/blueprint
20,593
494
```xml import styled from 'styled-components'; import { dimensions, colors } from '@erxes/ui/src/styles'; export const Attributes = styled.ul` list-style: none; margin: 0; right: 20px; max-height: 200px; min-width: 200px; overflow: auto; padding: ${dimensions.unitSpacing}px; border-radius: ${dimensions.unitSpacing - 5}px; > div { padding: 0; } b { margin-bottom: ${dimensions.unitSpacing + 10}px; color: black; } li { color: ${colors.colorCoreGray}; padding-bottom: ${dimensions.unitSpacing - 5}px; cursor: pointer; font-weight: 400; transition: all ease 0.3s; &:hover { color: ${colors.textPrimary}; } } `; export const AttributeTrigger = styled.span` color: ${colors.colorSecondary}; font-weight: 500; `; export const ActionFooter = styled.div` padding: ${dimensions.unitSpacing}px; bottom: ${dimensions.coreSpacing}px; `; ```
/content/code_sandbox/packages/ui-automations/src/components/forms/actions/styles.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
242
```xml <wpf:FormsApplicationPage xmlns:wpf="clr-namespace:Xamarin.Forms.Platform.WPF;assembly=Xamarin.Forms.Platform.WPF" x:Class="Demo.WPF.MainWindow" xmlns="path_to_url" xmlns:x="path_to_url" xmlns:d="path_to_url" xmlns:mc="path_to_url" xmlns:local="clr-namespace:Demo.WPF" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> </Grid> </wpf:FormsApplicationPage> ```
/content/code_sandbox/Samples/Demo.WPF/MainWindow.xaml
xml
2016-02-17T11:33:17
2024-08-08T23:31:44
Rg.Plugins.Popup
rotorgames/Rg.Plugins.Popup
1,151
126
```xml <?xml version="1.0" encoding="utf-8"?> <Project> <!-- Directory.Build.targets is automatically picked up and imported by Microsoft.Common.targets. This file needs to exist, even if empty so that files in the parent directory tree, with the same name, are not imported instead. They import fairly late and most other props/targets will have been imported beforehand. We also don't need to add ourselves to MSBuildAllProjects, as that is done by the file that imports us. --> <!-- Import the shared src .targets file --> <Import Project="$(MSBuildThisFileDirectory)..\shared-infrastructure\msbuild\targets\SixLabors.Src.targets" /> <!-- Import the solution .targets file. --> <Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.targets" /> </Project> ```
/content/code_sandbox/src/Directory.Build.targets
xml
2016-10-28T04:46:36
2024-08-16T11:16:39
ImageSharp
SixLabors/ImageSharp
7,302
186
```xml <Directives xmlns="path_to_url"> <Library Name="Microsoft.Toolkit.Uwp.UI.Behaviors"> <!-- add directives for your library here --> </Library> </Directives> ```
/content/code_sandbox/Microsoft.Toolkit.Uwp.UI.Behaviors/Properties/Microsoft.Toolkit.Uwp.UI.Behaviors.rd.xml
xml
2016-06-17T21:29:46
2024-08-16T09:32:00
WindowsCommunityToolkit
CommunityToolkit/WindowsCommunityToolkit
5,842
41
```xml <?xml version="1.0" encoding="utf-8"?> <!-- ~ ~ ~ path_to_url ~ ~ Unless required by applicable law or agreed to in writing, software ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="material_timepicker_pm">p.m.</string> <string name="material_timepicker_am">a.m.</string> <string name="material_timepicker_select_time">Selecciona una hora</string> <string name="material_timepicker_minute">Minuto</string> <string name="material_timepicker_hour">Hora</string> <string name="material_hour_suffix">%1$sen punto</string> <string name="material_hour_24h_suffix">%1$shoras</string> <string name="material_minute_suffix">%1$s minutos</string> <string name="material_hour_selection">Seleccione la hora.</string> <string name="material_minute_selection">Seleccionar minutos</string> <string name="material_clock_toggle_content_description">Selecciona a.m. o p.m.</string> <string name="mtrl_timepicker_confirm">Aceptar</string> <string name="mtrl_timepicker_cancel">Cancelar</string> <string name="material_timepicker_text_input_mode_description">Cambia al modo de entrada de texto para ingresar la hora.</string> <string name="material_timepicker_clock_mode_description">Cambia al modo de reloj para ingresar la hora.</string> </resources> ```
/content/code_sandbox/lib/java/com/google/android/material/timepicker/res/values-b+es+419/strings.xml
xml
2016-12-05T16:11:29
2024-08-16T17:51:42
material-components-android
material-components/material-components-android
16,176
354
```xml import {AuthenticationMWs} from '../middlewares/user/AuthenticationMWs'; import {Express} from 'express'; import {RenderingMWs} from '../middlewares/RenderingMWs'; import {UserRoles} from '../../common/entities/UserDTO'; import {PersonMWs} from '../middlewares/PersonMWs'; import {ThumbnailGeneratorMWs} from '../middlewares/thumbnail/ThumbnailGeneratorMWs'; import {VersionMWs} from '../middlewares/VersionMWs'; import {Config} from '../../common/config/private/Config'; import {ServerTimingMWs} from '../middlewares/ServerTimingMWs'; export class PersonRouter { public static route(app: Express): void { this.updatePerson(app); this.addGetPersons(app); this.getPersonThumbnail(app); } protected static updatePerson(app: Express): void { app.post( [Config.Server.apiPath + '/person/:name'], // common part AuthenticationMWs.authenticate, AuthenticationMWs.authorise(Config.Faces.writeAccessMinRole), VersionMWs.injectGalleryVersion, // specific part PersonMWs.updatePerson, ServerTimingMWs.addServerTiming, RenderingMWs.renderResult ); } protected static addGetPersons(app: Express): void { app.get( [Config.Server.apiPath + '/person'], // common part AuthenticationMWs.authenticate, AuthenticationMWs.authorise(Config.Faces.readAccessMinRole), VersionMWs.injectGalleryVersion, // specific part PersonMWs.listPersons, // PersonMWs.addSamplePhotoForAll, ThumbnailGeneratorMWs.addThumbnailInfoForPersons, PersonMWs.cleanUpPersonResults, ServerTimingMWs.addServerTiming, RenderingMWs.renderResult ); } protected static getPersonThumbnail(app: Express): void { app.get( [Config.Server.apiPath + '/person/:name/thumbnail'], // common part AuthenticationMWs.authenticate, AuthenticationMWs.authorise(UserRoles.User), VersionMWs.injectGalleryVersion, // specific part PersonMWs.getPerson, ThumbnailGeneratorMWs.generatePersonThumbnail, ServerTimingMWs.addServerTiming, RenderingMWs.renderFile ); } } ```
/content/code_sandbox/src/backend/routes/PersonRouter.ts
xml
2016-03-12T11:46:41
2024-08-16T19:56:44
pigallery2
bpatrik/pigallery2
1,727
476
```xml import { defaultTo } from "lodash"; import Context from "coral-server/graph/context"; import { ACTION_TYPE, CommentActionConnectionInput, retrieveCommentActionConnection, } from "coral-server/models/action/comment"; import { Cursor } from "coral-server/models/helpers"; import { GQLCOMMENT_FLAG_REPORTED_REASON, GQLCOMMENT_SORT, GQLSectionFilter, } from "../schema/__generated__/types"; import { requiredPropertyFilter, sectionFilter } from "./helpers"; interface FilteredConnectionInput { first?: number; after?: Cursor; storyID?: string; siteID?: string; section?: GQLSectionFilter; orderBy: GQLCOMMENT_SORT; filter: { actionType?: ACTION_TYPE; reason: { $in: GQLCOMMENT_FLAG_REPORTED_REASON[]; }; }; } export default (ctx: Context) => ({ connection: ({ first, after, orderBy, filter, }: CommentActionConnectionInput) => retrieveCommentActionConnection(ctx.mongo, ctx.tenant.id, { first: defaultTo(first, 10), after, filter, orderBy: defaultTo(orderBy, GQLCOMMENT_SORT.CREATED_AT_DESC), }), forFilter: ({ first, after, storyID, siteID, orderBy, section, filter, }: FilteredConnectionInput) => { return retrieveCommentActionConnection(ctx.mongo, ctx.tenant.id, { first: defaultTo(first, 10), after, filter: { ...filter, ...sectionFilter(ctx.tenant, section), // If these properties are not provided or are null, remove them from // the filter because they do not exist in a nullable state on the // database model. ...requiredPropertyFilter({ storyID, siteID }), }, orderBy: defaultTo(orderBy, GQLCOMMENT_SORT.CREATED_AT_DESC), }); }, }); ```
/content/code_sandbox/server/src/core/server/graph/loaders/CommentActions.ts
xml
2016-10-31T16:14:05
2024-08-06T16:15:57
talk
coralproject/talk
1,881
417
```xml import * as Egg from 'egg'; declare module 'egg' { interface Application { fromYadan(): Promise<string>; } interface Context { fromYadan(): Promise<string>; } interface EggAppConfig { yadanType: string; } } declare module 'yadan' { class YadanApplication extends Application { superYadan(): Promise<string>; } } export = Egg; ```
/content/code_sandbox/test/fixtures/apps/app-ts-type-check/yadan.d.ts
xml
2016-06-18T06:53:23
2024-08-16T10:11:28
egg
eggjs/egg
18,851
89
```xml <?xml version="1.0" encoding="UTF-8"?> <!-- Notwithstanding anything to the contrary herein, any previous version of Tencent GT shall not be subject to the license hereunder. All right, title, and interest, including all intellectual property rights, in and to the previous version of Tencent GT (including any and all copies thereof) shall be owned and retained by Tencent and subject to the license under the path_to_url Unless required by applicable law or agreed to in writing, software distributed --> <selector xmlns:android="path_to_url"> <item android:state_checked="false" android:state_enabled="true" android:drawable="@drawable/bg_slip_off_1" /> <item android:state_checked="true" android:state_enabled="true" android:drawable="@drawable/bg_slip_on_1" /> </selector> ```
/content/code_sandbox/android/GT_APP/app/src/main/res/drawable/gtcheckbox.xml
xml
2016-01-13T10:29:55
2024-08-13T06:40:00
GT
Tencent/GT
4,384
189
```xml import * as React from 'react'; import { unmountComponentAtNode } from 'react-dom'; import type { ReactElement } from 'react'; type ChildrenElement<T> = ChildrenElement<T>[] | T; // ref: path_to_url#L11 const INSTANCE_KEY = '_r'; const REACT_ELEMENT_TYPE = Symbol.for('react.element'); // Mocked `Rax.shared`. const shared = { Element(type: any, key: any, ref: any, props: any, owner: any) { // ref: path_to_url#L149-L161 return { // This tag allows us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, // Built-in properties that belong on the element type: type, key: key, ref: ref, props: props, // Record the component responsible for creating this element. _owner: owner, }; }, Host: { get owner() { return (React as any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current; }, }, Instance: { get(node: any) { return Object.assign({}, node[INSTANCE_KEY], { _internal: { unmountComponent: () => { node.parentNode?.removeChild(node); return unmountComponentAtNode(node); }, }, }); }, remove(node: any) { node[INSTANCE_KEY] = null; }, set(node: any, instance: any) { if (!node[INSTANCE_KEY]) { node[INSTANCE_KEY] = instance; } }, }, flattenChildren, }; function flattenChildren(children: ChildrenElement<ReactElement>) { if (children == null) { return children; } const result: ReactElement[] = []; // If length equal 1, return the only one. traverseChildren(children, result); return result.length - 1 ? result : result[0]; } function traverseChildren(children: ChildrenElement<ReactElement>, result: ReactElement[]) { if (Array.isArray(children)) { for (let i = 0, l = children.length; i < l; i++) { traverseChildren(children[i], result); } } else { result.push(children); } } export default shared; ```
/content/code_sandbox/packages/rax-compat/src/shared.ts
xml
2016-11-03T06:59:15
2024-08-16T10:11:29
ice
alibaba/ice
17,815
501
```xml /* * * See the LICENSE file at the top-level directory of this distribution * for licensing information. * * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation, * no part of this software, including this file, may be copied, modified, * propagated, or distributed except according to the terms contained in the * LICENSE file. * * Removal or modification of this copyright notice is prohibited. */ import { CommandVerifyContext, VerificationResult, VerifyStatus, CommandExecuteContext, } from '../../../state_machine'; import { BaseCommand } from '../../base_command'; import { CommissionChangeEvent } from '../events/commission_change'; import { changeCommissionCommandParamsSchema } from '../schemas'; import { ValidatorStore } from '../stores/validator'; import { ChangeCommissionParams } from '../types'; export class ChangeCommissionCommand extends BaseCommand { public schema = changeCommissionCommandParamsSchema; private _commissionIncreasePeriod!: number; private _maxCommissionIncreaseRate!: number; public init(args: { commissionIncreasePeriod: number; maxCommissionIncreaseRate: number }) { this._commissionIncreasePeriod = args.commissionIncreasePeriod; this._maxCommissionIncreaseRate = args.maxCommissionIncreaseRate; } public async verify( context: CommandVerifyContext<ChangeCommissionParams>, ): Promise<VerificationResult> { const validatorStore = this.stores.get(ValidatorStore); const validatorExists = await validatorStore.has(context, context.transaction.senderAddress); if (!validatorExists) { return { status: VerifyStatus.FAIL, error: new Error('Transaction sender has not registered as a validator.'), }; } const validatorData = await validatorStore.get(context, context.transaction.senderAddress); const oldCommission = validatorData.commission; const hasIncreasedCommissionRecently = context.header.height - validatorData.lastCommissionIncreaseHeight < this._commissionIncreasePeriod; if (context.params.newCommission > oldCommission && hasIncreasedCommissionRecently) { return { status: VerifyStatus.FAIL, error: new Error( `Can only increase the commission again ${this._commissionIncreasePeriod} blocks after the last commission increase.`, ), }; } if (context.params.newCommission - oldCommission > this._maxCommissionIncreaseRate) { return { status: VerifyStatus.FAIL, error: new Error( `Invalid argument: Commission increase larger than ${this._maxCommissionIncreaseRate}.`, ), }; } return { status: VerifyStatus.OK, }; } public async execute(context: CommandExecuteContext<ChangeCommissionParams>): Promise<void> { const validatorStore = this.stores.get(ValidatorStore); const validatorAccount = await validatorStore.get(context, context.transaction.senderAddress); const oldCommission = validatorAccount.commission; validatorAccount.commission = context.params.newCommission; if (validatorAccount.commission >= oldCommission) { validatorAccount.lastCommissionIncreaseHeight = context.header.height; } await validatorStore.set(context, context.transaction.senderAddress, validatorAccount); this.events.get(CommissionChangeEvent).log(context, { validatorAddress: context.transaction.senderAddress, oldCommission, newCommission: context.params.newCommission, }); } } ```
/content/code_sandbox/framework/src/modules/pos/commands/change_commission.ts
xml
2016-02-01T21:45:35
2024-08-15T19:16:48
lisk-sdk
LiskArchive/lisk-sdk
2,721
685
```xml <vector android:height="24dp" android:tint="@android:color/white" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp" xmlns:android="path_to_url"> <group android:scaleX="0.9" android:scaleY="0.9" android:translateX="1.2" android:translateY="1.2"> <path android:fillColor="@android:color/white" android:pathData="M20,2L4,2c-1.1,0 -2,0.9 -2,2v16c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM20,20L4,20L4,4h16v16zM18,6h-5c-1.1,0 -2,0.9 -2,2v2.28c-0.6,0.35 -1,0.98 -1,1.72 0,1.1 0.9,2 2,2s2,-0.9 2,-2c0,-0.74 -0.4,-1.38 -1,-1.72L13,8h3v8L8,16L8,8h2L10,6L6,6v12h12L18,6z"/> </group> </vector> ```
/content/code_sandbox/app/src/main/res/drawable-night/ic_nfc_icon_24dp.xml
xml
2016-02-01T23:48:36
2024-08-15T03:35:42
TagMo
HiddenRamblings/TagMo
2,976
347
```xml import { IContext, IModels } from "../../connectionResolver"; import QueryBuilder, { IListArgs } from "../../conversationQueryBuilder"; import { checkPermission, moduleRequireLogin } from "@erxes/api-utils/src/permissions"; import { CONVERSATION_STATUSES } from "../../models/definitions/constants"; import { IMessageDocument } from "../../models/definitions/conversationMessages"; import { countByConversations } from "../../conversationUtils"; import { paginate } from "@erxes/api-utils/src"; import { sendCoreMessage } from "../../messageBroker"; interface ICountBy { [index: string]: number; } interface IConversationRes { [index: string]: number | ICountBy; } // count helper const count = async (models: IModels, query: any): Promise<number> => { const result = await models.Conversations.find(query).countDocuments(); return Number(result); }; const conversationQueries: any = { /** * Conversations list */ async conversations( _root, params: IListArgs, { user, models, subdomain, serverTiming }: IContext ) { serverTiming.startTime("conversations"); // filter by ids of conversations if (params && params.ids) { return models.Conversations.find({ _id: { $in: params.ids } }) .sort({ updatedAt: -1 }) .skip(params.skip || 0) .limit(params.limit || 0); } serverTiming.startTime("buildQuery"); // initiate query builder const qb = new QueryBuilder(models, subdomain, params, { _id: user._id, code: user.code, starredConversationIds: user.starredConversationIds, role: user.role }); await qb.buildAllQueries(); serverTiming.endTime("buildQuery"); serverTiming.startTime("conversationsQuery"); const conversations = await models.Conversations.find(qb.mainQuery()) .sort({ updatedAt: -1 }) .skip(params.skip || 0) .limit(params.limit || 0); serverTiming.endTime("conversationsQuery"); serverTiming.endTime("conversations"); return conversations; }, /** * Get conversation messages */ async conversationMessages( _root, { conversationId, skip, limit, getFirst }: { conversationId: string; skip: number; limit: number; getFirst: boolean; }, { models }: IContext ) { const query = { conversationId }; let messages: IMessageDocument[] = []; if (limit) { const sort: any = getFirst ? { createdAt: 1 } : { createdAt: -1 }; messages = await models.ConversationMessages.find(query) .sort(sort) .skip(skip || 0) .limit(limit); return getFirst ? messages : messages.reverse(); } messages = await models.ConversationMessages.find(query) .sort({ createdAt: -1 }) .limit(50); return messages.reverse(); }, /** * Get all conversation messages count. We will use it in pager */ async conversationMessagesTotalCount( _root, { conversationId }: { conversationId: string }, { models }: IContext ) { return models.ConversationMessages.countDocuments({ conversationId }); }, /** * Group conversation counts by brands, channels, integrations, status */ async conversationCounts( _root, params: IListArgs, { user, models, subdomain }: IContext ) { const { only } = params; const response: IConversationRes = {}; const _user = { _id: user._id, code: user.code, starredConversationIds: user.starredConversationIds, role: user.role }; const qb = new QueryBuilder(models, subdomain, params, _user); await qb.buildAllQueries(); const queries = qb.queries; const integrationIds = queries.integrations.integrationId.$in; if (only) { response[only] = await countByConversations( models, subdomain, params, integrationIds, _user, only ); } const mainQuery = { ...qb.mainQuery(), ...queries.integrations, ...queries.extended }; // unassigned count response.unassigned = await count(models, { ...mainQuery, ...qb.unassignedFilter() }); // participating count response.participating = await count(models, { ...mainQuery, ...qb.participatingFilter() }); // starred count response.starred = await count(models, { ...mainQuery, ...qb.starredFilter() }); // resolved count response.resolved = await count(models, { ...mainQuery, ...qb.statusFilter(["closed"]) }); // awaiting response count response.awaitingResponse = await count(models, { ...mainQuery, ...qb.awaitingResponse() }); return response; }, /** * Get one conversation */ async conversationDetail( _root, { _id }: { _id: string }, { models }: IContext ) { return models.Conversations.findOne({ _id }); }, /** * Get all conversations count. We will use it in pager */ async conversationsTotalCount( _root, params: IListArgs, { user, models, subdomain }: IContext ) { // initiate query builder const qb = new QueryBuilder(models, subdomain, params, { _id: user._id, code: user.code, starredConversationIds: user.starredConversationIds }); await qb.buildAllQueries(); return models.Conversations.find(qb.mainQuery()).countDocuments(); }, /** * Get last conversation */ async conversationsGetLast( _root, params: IListArgs, { user, models, subdomain }: IContext ) { // initiate query builder const qb = new QueryBuilder(models, subdomain, params, { _id: user._id, code: user.code, starredConversationIds: user.starredConversationIds }); await qb.buildAllQueries(); return models.Conversations.findOne(qb.mainQuery()) .sort({ updatedAt: -1 }) .lean(); }, /** * Get all unread conversations for logged in user */ async conversationsTotalUnreadCount( _root, _args, { user, models, subdomain, serverTiming }: IContext ) { serverTiming.startTime("buildQuery"); // initiate query builder const qb = new QueryBuilder( models, subdomain, {}, { _id: user._id, code: user.code } ); await qb.buildAllQueries(); serverTiming.endTime("buildQuery"); serverTiming.startTime("integrationFilter"); // get all possible integration ids const integrationsFilter = await qb.integrationsFilter(); serverTiming.endTime("integrationFilter"); serverTiming.startTime("query"); const response = await models.Conversations.find({ ...integrationsFilter, status: { $in: [CONVERSATION_STATUSES.NEW, CONVERSATION_STATUSES.OPEN] }, readUserIds: { $ne: user._id }, $and: [{ $or: qb.userRelevanceQuery() }] }).countDocuments(); serverTiming.endTime("query"); return response; }, async inboxFields(_root, _args, { subdomain }: IContext) { const response: { customer?: any[]; conversation?: any[]; device?: any[]; } = { customer: [], conversation: [], device: [] }; const customerGroup = await sendCoreMessage({ subdomain, action: "fieldsGroups.findOne", data: { query: { contentType: "core:customer", isDefinedByErxes: true, name: "Basic information" } }, isRPC: true }); if (customerGroup) { response.customer = await sendCoreMessage({ subdomain, action: "fields.find", data: { query: { groupId: customerGroup._id } }, isRPC: true, defaultValue: [] }); } const conversationGroup = await sendCoreMessage({ subdomain, action: "fieldsGroups.findOne", data: { query: { contentType: "inbox:conversation", isDefinedByErxes: true, name: "Basic information" } }, isRPC: true }); if (conversationGroup) { response.conversation = await sendCoreMessage({ subdomain, action: "fields.find", data: { query: { groupId: conversationGroup._id } }, isRPC: true, defaultValue: [] }); } const deviceGroup = await sendCoreMessage({ subdomain, action: "fieldsGroups.findOne", data: { query: { contentType: "core:device", isDefinedByErxes: true, name: "Basic information" } }, isRPC: true }); if (deviceGroup) { response.device = await sendCoreMessage({ subdomain, action: "fields.find", data: { query: { groupId: deviceGroup._id } }, isRPC: true, defaultValue: [] }); } return response; }, /** * Users conversations list */ async userConversations( _root, { _id, perPage }: { _id: string; perPage: number }, { models }: IContext ) { const selector = { participatedUserIds: { $in: [_id] } }; const list = paginate(models.Conversations.find(selector), { perPage }); const totalCount = models.Conversations.find(selector).countDocuments(); return { list, totalCount }; } }; moduleRequireLogin(conversationQueries); checkPermission(conversationQueries, "conversations", "showConversations", []); conversationQueries.conversationMessage = ( _, { _id }, { models }: IContext ) => { return models.ConversationMessages.findOne({ _id }); }; export default conversationQueries; ```
/content/code_sandbox/packages/plugin-inbox-api/src/graphql/resolvers/conversationQueries.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
2,248
```xml import { Operator } from '../Operator'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { Observer, OperatorFunction } from '../types'; /** * Compares all values of two observables in sequence using an optional comparor function * and returns an observable of a single boolean value representing whether or not the two sequences * are equal. * * <span class="informal">Checks to see of all values emitted by both observables are equal, in order.</span> * * ![](sequenceEqual.png) * * `sequenceEqual` subscribes to two observables and buffers incoming values from each observable. Whenever either * observable emits a value, the value is buffered and the buffers are shifted and compared from the bottom * up; If any value pair doesn't match, the returned observable will emit `false` and complete. If one of the * observables completes, the operator will wait for the other observable to complete; If the other * observable emits before completing, the returned observable will emit `false` and complete. If one observable never * completes or emits after the other complets, the returned observable will never complete. * * ## Example * figure out if the Konami code matches * ```javascript * const codes = from([ * 'ArrowUp', * 'ArrowUp', * 'ArrowDown', * 'ArrowDown', * 'ArrowLeft', * 'ArrowRight', * 'ArrowLeft', * 'ArrowRight', * 'KeyB', * 'KeyA', * 'Enter', // no start key, clearly. * ]); * * const keys = fromEvent(document, 'keyup').pipe(map(e => e.code)); * const matches = keys.pipe( * bufferCount(11, 1), * mergeMap( * last11 => from(last11).pipe(sequenceEqual(codes)), * ), * ); * matches.subscribe(matched => console.log('Successful cheat at Contra? ', matched)); * ``` * * @see {@link combineLatest} * @see {@link zip} * @see {@link withLatestFrom} * * @param {Observable} compareTo The observable sequence to compare the source sequence to. * @param {function} [comparor] An optional function to compare each value pair * @return {Observable} An Observable of a single boolean value representing whether or not * the values emitted by both observables were equal in sequence. * @method sequenceEqual * @owner Observable */ export declare function sequenceEqual<T>(compareTo: Observable<T>, comparor?: (a: T, b: T) => boolean): OperatorFunction<T, boolean>; export declare class SequenceEqualOperator<T> implements Operator<T, boolean> { private compareTo; private comparor; constructor(compareTo: Observable<T>, comparor: (a: T, b: T) => boolean); call(subscriber: Subscriber<boolean>, source: any): any; } /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ export declare class SequenceEqualSubscriber<T, R> extends Subscriber<T> { private compareTo; private comparor; private _a; private _b; private _oneComplete; constructor(destination: Observer<R>, compareTo: Observable<T>, comparor: (a: T, b: T) => boolean); protected _next(value: T): void; _complete(): void; checkValues(): void; emit(value: boolean): void; nextB(value: T): void; completeB(): void; } ```
/content/code_sandbox/deps/node-10.15.3/tools/node_modules/eslint/node_modules/rxjs/internal/operators/sequenceEqual.d.ts
xml
2016-09-05T10:18:44
2024-08-11T13:21:40
LiquidCore
LiquidPlayer/LiquidCore
1,010
764
```xml import Joi from "joi"; import { v4 as uuid } from "uuid"; import { LanguageCode, LOCALES, } from "coral-common/common/lib/helpers/i18n/locales"; import { AppOptions } from "coral-server/app"; import { validate } from "coral-server/app/request/body"; import { RequestLimiter } from "coral-server/app/request/limiter"; import { Config } from "coral-server/config"; import { InstallationForbiddenError, TenantInstalledAlreadyError, } from "coral-server/errors"; import { CreateSiteInput } from "coral-server/models/site"; import { LocalProfile } from "coral-server/models/user"; import { createJWTSigningConfig, extractTokenFromRequest, JWTSigningConfig, } from "coral-server/services/jwt"; import { verifyInstallationTokenString } from "coral-server/services/management"; import { create as createSite } from "coral-server/services/sites"; import { install, InstallTenant, isInstalled, } from "coral-server/services/tenant"; import { create, CreateUser } from "coral-server/services/users"; import { CoralRequest, Request, RequestHandler, } from "coral-server/types/express"; import { GQLUSER_ROLE } from "coral-server/graph/schema/__generated__/types"; export type TenantInstallCheckHandlerOptions = Pick< AppOptions, "redis" | "config" >; export const installCheckHandler = ({ config, redis, }: TenantInstallCheckHandlerOptions): RequestHandler<CoralRequest> => { const { managementEnabled, signingConfig } = managementSigningConfig(config); const limiter = new RequestLimiter({ redis, ttl: "10s", max: 2, prefix: "ip", config, }); return async (req, res, next) => { try { // Limit based on the IP address. await limiter.test(req, req.ip); // Pull the tenant out. const { tenant, cache } = req.coral; // If there's already a Tenant on the request! No need to process further. if (tenant) { return next(new TenantInstalledAlreadyError()); } // Check to see if the server already has a tenant installed. const alreadyInstalled = await isInstalled(cache.tenant); if (!alreadyInstalled) { // No tenants are installed at all, we can of course proceed with the // install now. return res.sendStatus(204); } // Check to see if management is enabled for this server. if (managementEnabled && signingConfig) { await checkForInstallationToken(req, signingConfig); // We've determined that there is already a tenant installed on this // server, but we have a valid management token, so we're good! return res.sendStatus(204); } return next(new TenantInstalledAlreadyError()); } catch (err) { return next(err); } }; }; export interface TenantInstallBody { tenant: Omit<InstallTenant, "domain" | "locale"> & { locale: LanguageCode | null; }; site: Omit<CreateSiteInput, "tenantID">; user: Required<Pick<CreateUser, "username" | "email"> & { password: string }>; } const TenantInstallBodySchema = Joi.object().keys({ tenant: Joi.object().keys({ organization: Joi.object().keys({ name: Joi.string().trim(), url: Joi.string().trim().uri(), contactEmail: Joi.string().trim().lowercase().email(), }), locale: Joi.string() .default(null) .valid(...LOCALES) .optional(), }), site: Joi.object().keys({ name: Joi.string().trim(), allowedOrigins: Joi.array().items( Joi.string() .trim() .uri({ scheme: ["http", "https"] }) ), }), user: Joi.object().keys({ username: Joi.string().trim(), password: Joi.string(), email: Joi.string().trim().lowercase().email(), }), }); export type TenantInstallHandlerOptions = Pick< AppOptions, "redis" | "mongo" | "config" | "mailerQueue" | "i18n" | "migrationManager" >; export const installHandler = ({ mongo, redis, config, i18n, migrationManager, }: TenantInstallHandlerOptions): RequestHandler => { const { managementEnabled, signingConfig } = managementSigningConfig(config); const limiter = new RequestLimiter({ redis, ttl: "10s", max: 1, prefix: "ip", config, }); return async (req, res, next) => { try { // Limit based on the IP address. await limiter.test(req, req.ip); if (!req.coral) { return next(new Error("coral was not set")); } if (!req.coral.cache) { return next(new Error("cache was not set")); } if (req.coral.tenant) { // There's already a Tenant on the request! No need to process further. return next(new TenantInstalledAlreadyError()); } // Check to see if the server already has a tenant installed. let alreadyInstalled = await isInstalled(req.coral.cache.tenant); // Check to see if management is enabled for this server. if (managementEnabled && signingConfig) { // Management is enabled for this server, check now if the server already // has a tenant installed. if (alreadyInstalled) { await checkForInstallationToken(req, signingConfig); // We've determined that there is at least one tenant already // installed, and we've verified that the current call to install // this tenant came with a signed token that was signed by the // management secret, so we can safely mark that this tenant is // indeed, not already been installed. alreadyInstalled = false; } } // Guard against installs trying to install multiple tenants when management // hasn't been enabled. if (alreadyInstalled) { return next(new TenantInstalledAlreadyError()); } // Validate that the payload passed in was correct, it will throw if the // payload is invalid. const { tenant: { locale: tenantLocale, ...tenantInput }, site: siteInput, user: userInput, }: TenantInstallBody = validate(TenantInstallBodySchema, req.body); // Default the locale to the default locale if not provided. let locale = tenantLocale; if (!locale) { locale = config.get("default_locale") as LanguageCode; } // Execute the pending migrations now, as the schema and types are already // current for the new tenant being installed now. No point in creating // a tenant when migrations have not been ran yet. await migrationManager.executePendingMigrations(mongo, redis, true); // Install will throw if it can not create a Tenant, or it has already been // installed. const tenant = await install( mongo, redis, req.coral.cache.tenant, i18n, { ...tenantInput, // Infer the Tenant domain via the hostname parameter. domain: req.hostname, // Add the locale that we had to default to the default locale from the // config. locale, }, req.coral.now ); await createSite(mongo, tenant, siteInput); // Pull the user details out of the input for the user. const { email, username, password } = userInput; // Configure with profile. const profile: LocalProfile = { type: "local", id: email, password, passwordID: uuid(), }; // Create the first admin user. await create( mongo, tenant, { email, username, profile, role: GQLUSER_ROLE.ADMIN, }, {}, req.coral.now ); // Send back the Tenant. return res.sendStatus(204); } catch (err) { return next(err); } }; }; async function checkForInstallationToken( req: Request, signingConfig: JWTSigningConfig ) { // The server already has another tenant installed. Every additional // tenant must be installed via the signed domain method. Check to see // now if the given domain is signed. const accessToken = extractTokenFromRequest(req, true); if (accessToken) { // Verify the JWT on the request to ensure it was signed by the // management secret. const { token } = await verifyInstallationTokenString( signingConfig, accessToken, req.coral.now ); // Check to see that the domain on the token matches the hostname on // the request. if (req.hostname !== token.sub) { throw new InstallationForbiddenError(req.hostname); } } else { throw new InstallationForbiddenError(req.hostname); } } function managementSigningConfig(config: Config) { const managementSigningSecret = config.get("management_signing_secret"); const managementSigningAlgorithm = config.get("management_signing_algorithm"); const managementEnabled = Boolean(managementSigningSecret); const signingConfig = managementSigningSecret ? createJWTSigningConfig( managementSigningSecret, managementSigningAlgorithm ) : null; return { managementEnabled, signingConfig }; } ```
/content/code_sandbox/server/src/core/server/app/handlers/api/install.ts
xml
2016-10-31T16:14:05
2024-08-06T16:15:57
talk
coralproject/talk
1,881
2,046
```xml import { scrollWidthAtom } from "@/store" import { useAtom } from "jotai" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" const ScrollerWidth = () => { const [width, setWidth] = useAtom(scrollWidthAtom) return ( <div className="w-full pb-5"> <Label className="block pb-1">Scroll- </Label> <Input value={width} onChange={(e) => setWidth(Number(e.target.value))} type="number" max={48} /> </div> ) } export default ScrollerWidth ```
/content/code_sandbox/pos/modules/settings/components/ScrollerWidth.tsx
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
142
```xml import {Injectable} from '@angular/core'; import {NetworkService} from '../../../model/network/network.service'; import {FileDTO} from '../../../../../common/entities/FileDTO'; import {Utils} from '../../../../../common/Utils'; import {Config} from '../../../../../common/config/public/Config'; import {MapLayers, MapProviders,} from '../../../../../common/config/public/ClientConfig'; import {LatLngLiteral} from 'leaflet'; @Injectable() export class MapService { private static readonly OSMLAYERS: MapLayers[] = [ { name: 'street', url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', darkLayer: false }, ]; private static MAPBOXLAYERS: MapLayers[] = []; constructor(private networkService: NetworkService) { MapService.MAPBOXLAYERS = [ { name: $localize`street`, url: 'path_to_url{z}/{x}/{y}?access_token=' + Config.Map.mapboxAccessToken, darkLayer: false }, { name: $localize`satellite`, url: 'path_to_url{z}/{x}/{y}?access_token=' + Config.Map.mapboxAccessToken, darkLayer: false }, { name: $localize`hybrid`, url: 'path_to_url{z}/{x}/{y}?access_token=' + Config.Map.mapboxAccessToken, darkLayer: false }, { name: $localize`dark`, url: 'path_to_url{z}/{x}/{y}?access_token=' + Config.Map.mapboxAccessToken, darkLayer: true }, ]; } public get ShortAttributions(): string { const OSM = '<a href="path_to_url">OSM</a>'; const MB = '<a href="path_to_url">Mapbox</a>'; if (Config.Map.mapProvider === MapProviders.OpenStreetMap) { return ' &copy; ' + OSM; } if (Config.Map.mapProvider === MapProviders.Mapbox) { return OSM + ' | ' + MB; } return ''; } public get Attributions(): string { const OSM = '&copy; <a href="path_to_url">OpenStreetMap</a>'; const MB = '&copy; <a href="path_to_url">Mapbox</a>'; if (Config.Map.mapProvider === MapProviders.OpenStreetMap) { return OSM; } if (Config.Map.mapProvider === MapProviders.Mapbox) { return OSM + ' | ' + MB; } return ''; } public get MapLayer(): MapLayers { return (this.Layers.find(ml => !ml.darkLayer) || this.Layers[0]); } public get DarkMapLayer(): MapLayers { return (this.Layers.find(ml => ml.darkLayer) || this.MapLayer); } public get Layers(): MapLayers[] { switch (Config.Map.mapProvider) { case MapProviders.Custom: return Config.Map.customLayers; case MapProviders.Mapbox: return MapService.MAPBOXLAYERS; case MapProviders.OpenStreetMap: return MapService.OSMLAYERS; } } public async getMapCoordinates( file: FileDTO ): Promise<{ name: string, path: LatLngLiteral[][]; markers: LatLngLiteral[] }> { const filePath = Utils.concatUrls( file.directory.path, file.directory.name, file.name ); const gpx = await this.networkService.getXML( '/gallery/content/' + filePath + '/bestFit' ); const getCoordinates = (inputElement: Document, tagName: string): LatLngLiteral[] => { const elements = inputElement.getElementsByTagName(tagName); const ret: LatLngLiteral[] = []; // eslint-disable-next-line @typescript-eslint/prefer-for-of for (let i = 0; i < elements.length; i++) { ret.push({ lat: parseFloat(elements[i].getAttribute('lat')), lng: parseFloat(elements[i].getAttribute('lon')), }); } return ret; }; const trksegs = gpx.getElementsByTagName('trkseg'); if (!trksegs) { return { name: gpx.getElementsByTagName('name')?.[0]?.textContent || '', path: [getCoordinates(gpx, 'trkpt')], markers: getCoordinates(gpx, 'wpt'), }; } const trksegArr = [].slice.call(trksegs); return { name: gpx.getElementsByTagName('name')?.[0]?.textContent || '', path: [...trksegArr].map(t => getCoordinates(t, 'trkpt')), markers: getCoordinates(gpx, 'wpt'), }; } } ```
/content/code_sandbox/src/frontend/app/ui/gallery/map/map.service.ts
xml
2016-03-12T11:46:41
2024-08-16T19:56:44
pigallery2
bpatrik/pigallery2
1,727
1,037
```xml import { Component } from '@angular/core'; import { Code } from '@domain/code'; @Component({ selector: 'step-doc', template: ` <app-docsectiontext> <p>Size of each movement is defined with the <i>step</i> property.</p> </app-docsectiontext> <div class="card flex justify-content-center"> <p-knob [(ngModel)]="value" [step]="10" /> </div> <app-code [code]="code" selector="knob-step-demo"></app-code> ` }) export class StepDoc { value!: number; code: Code = { basic: `<p-knob [(ngModel)]="value" [step]="10" />`, html: `<div class="card flex justify-content-center"> <p-knob [(ngModel)]="value" [step]="10" /> </div>`, typescript: `import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { KnobModule } from 'primeng/knob'; @Component({ selector: 'knob-step-demo', templateUrl: './knob-step-demo.html', standalone: true, imports: [FormsModule, KnobModule] }) export class KnobStepDemo { value!: number; }` }; } ```
/content/code_sandbox/src/app/showcase/doc/knob/stepdoc.ts
xml
2016-01-16T09:23:28
2024-08-16T19:58:20
primeng
primefaces/primeng
9,969
286
```xml import React from 'react'; import { StyleSheet, View, Image, ImageSourcePropType } from 'react-native'; interface Props { image: ImageSourcePropType; sharedElementId: string; } export default class ImageGalleryItemScreen extends React.Component<Props> { render() { return ( <View style={styles.container}> <Image // @ts-ignore nativeID isn't included in react-native Image props. nativeID={`image-${this.props.sharedElementId}Dest`} style={styles.image} source={this.props.image} /> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#ffffff', alignItems: 'center', justifyContent: 'center', }, image: { width: 400, height: 400, }, }); ```
/content/code_sandbox/playground/src/screens/imageGallery/ImageGalleryItemScreen.tsx
xml
2016-03-11T11:22:54
2024-08-15T09:05:44
react-native-navigation
wix/react-native-navigation
13,021
185
```xml import { TableOptions } from '@tanstack/react-table'; import { defaultGlobalFilterFn } from '../Datatable'; import { DefaultType } from '../types'; import { OptionsExtension } from './types'; export function withGlobalFilter< D extends DefaultType, TFilter extends { search: string; }, >(filterFn: typeof defaultGlobalFilterFn<D, TFilter>): OptionsExtension<D> { return function extendOptions(options: TableOptions<D>) { return { ...options, globalFilterFn: filterFn, }; }; } ```
/content/code_sandbox/app/react/components/datatables/extend-options/withGlobalFilter.ts
xml
2016-05-19T20:15:28
2024-08-16T19:15:14
portainer
portainer/portainer
30,083
118
```xml type IconProps = { className?: string; }; export default function RemixLogo({ className = "h-7" }: IconProps) { return ( <svg xmlns="path_to_url" fill="currentColor" viewBox="0 0 754 200" className={className} > <path fillRule="evenodd" clipRule="evenodd" d="M155.744 148.947C157.387 170.214 157.387 180.183 157.387 191.065H108.558C108.558 188.694 108.6 186.526 108.642 184.327C108.774 177.492 108.912 170.365 107.813 155.971C106.361 134.899 97.356 130.216 80.798 130.216H66.128H4V91.876H83.122C104.037 91.876 114.494 85.464 114.494 68.489C114.494 53.563 104.037 44.517 83.122 44.517H4V7H91.836C139.186 7 162.716 29.536 162.716 65.535C162.716 92.461 146.158 110.021 123.79 112.948C142.672 116.753 153.71 127.582 155.744 148.947Z" fill="currentColor" /> <path d="M4 191.065V162.483H55.63C64.254 162.483 66.126 168.929 66.126 172.772V191.065H4Z" fill="currentColor" /> <path d="M744.943 62.524H696.548L674.523 93.474L653.079 62.524H601.206L647.862 126.467L597.148 192.745H645.544L671.336 157.416L697.127 192.745H749L697.996 124.423L744.943 62.524Z" fill="currentColor" /> <path d="M440.111 84.105C434.604 68.922 422.723 58.411 399.829 58.411C380.413 58.411 366.503 67.171 359.548 81.477V61.915H312.602V192.135H359.548V128.193C359.548 108.631 365.054 95.784 380.413 95.784C394.613 95.784 398.091 105.127 398.091 122.938V192.135H445.037V128.193C445.037 108.631 450.253 95.784 465.902 95.784C480.102 95.784 483.29 105.127 483.29 122.938V192.135H530.236V110.383C530.236 83.229 519.804 58.411 484.159 58.411C462.425 58.411 447.066 69.506 440.111 84.105Z" fill="currentColor" /> <path d="M263.716 141.599C259.369 151.818 251.255 156.197 238.504 156.197C224.304 156.197 212.712 148.606 211.553 132.547H302.258V119.409C302.258 84.08 279.365 54.298 236.185 54.298C195.904 54.298 165.766 83.788 165.766 124.956C165.766 166.416 195.325 191.526 236.765 191.526C270.961 191.526 294.724 174.884 301.389 145.102L263.716 141.599ZM212.133 109.773C213.871 97.51 220.537 88.167 235.606 88.167C249.516 88.167 257.05 98.094 257.63 109.773H212.133Z" fill="currentColor" /> <path d="M545.592 62.78V193H592.538V62.78H545.592ZM545.302 50.517H592.828V9.056H545.302V50.517Z" fill="currentColor" /> </svg> ); } ```
/content/code_sandbox/packages/remix/test/fixtures-vite/02-interactive-remix-routing-v2/app/components/RemixLogo/RemixLogo.tsx
xml
2016-09-09T01:12:08
2024-08-16T17:39:45
vercel
vercel/vercel
12,545
1,080
```xml import { IReadonlyTheme } from '@microsoft/sp-component-base'; import { DisplayMode } from '@microsoft/sp-core-library'; import { WebPartContext } from '@microsoft/sp-webpart-base'; export interface IFlightTrackerProps { title: string; isDarkTheme: boolean; hasTeamsContext: boolean; currentTheme: IReadonlyTheme | undefined; context: WebPartContext numberItemsPerPage: number; displayMode: DisplayMode; updateProperty: (value: string) => void; webpartContainerWidth: number; } ```
/content/code_sandbox/samples/react-flighttracker/src/components/FlightTracker/IFlightTrackerProps.ts
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
123
```xml // See LICENSE.txt for license information. import React, {useCallback} from 'react'; import { Platform, Pressable, type PressableAndroidRippleConfig, type PressableStateCallbackType, type StyleProp, StyleSheet, type ViewStyle, } from 'react-native'; import CompassIcon from '@components/compass_icon'; type Props = { activated: boolean; iconName: string; onPress: () => void; style?: StyleProp<ViewStyle>; } const pressedStyle = ({pressed}: PressableStateCallbackType) => { let opacity = 1; if (Platform.OS === 'ios' && pressed) { opacity = 0.5; } return [{opacity}]; }; const baseStyle = StyleSheet.create({ container: { width: 40, height: 40, borderRadius: 4, alignItems: 'center', justifyContent: 'center', backgroundColor: '#000', }, containerActivated: { backgroundColor: '#fff', }, }); const androidRippleConfig: PressableAndroidRippleConfig = {borderless: true, radius: 24, color: '#FFF'}; const InvertedAction = ({activated, iconName, onPress, style}: Props) => { const pressableStyle = useCallback((pressed: PressableStateCallbackType) => ([ pressedStyle(pressed), baseStyle.container, activated && baseStyle.containerActivated, style, ]), [style, activated]); return ( <Pressable android_ripple={androidRippleConfig} hitSlop={4} onPress={onPress} style={pressableStyle} > <CompassIcon color={activated ? '#000' : '#fff'} name={iconName} size={24} /> </Pressable> ); }; export default InvertedAction; ```
/content/code_sandbox/app/screens/gallery/footer/actions/inverted_action.tsx
xml
2016-10-07T16:52:32
2024-08-16T12:08:38
mattermost-mobile
mattermost/mattermost-mobile
2,155
401
```xml import { ToastType } from '@standardnotes/toast' export interface ToastServiceInterface { showToast(type: ToastType, message: string): string hideToast(toastId: string): void } ```
/content/code_sandbox/packages/ui-services/src/Toast/ToastServiceInterface.ts
xml
2016-12-05T23:31:33
2024-08-16T06:51:19
app
standardnotes/app
5,180
44
```xml import { useState, useEffect } from "react"; import { Dimension } from "../types"; export function useWindowSize(): Dimension { const [windowSize, setWindowSize] = useState<Dimension>({ width: 0, height: 0, }); useEffect(() => { const handleResize = () => { setWindowSize({ width: window.innerWidth, height: window.innerHeight, }); }; window.addEventListener("resize", handleResize); return () => window.removeEventListener("resize", handleResize); }, [setWindowSize]); return windowSize; } ```
/content/code_sandbox/multiplayer/src/hooks/useWindowSize.ts
xml
2016-01-24T19:35:52
2024-08-16T16:39:39
pxt
microsoft/pxt
2,069
120
```xml import { SharedObject } from 'expo'; import { getResults } from './utils.web'; import { ImageResult, SaveFormat, SaveOptions } from '../ImageManipulator.types'; export default class ImageManipulatorImageRef extends SharedObject { private canvas: HTMLCanvasElement; readonly width: number; readonly height: number; constructor(canvas: HTMLCanvasElement) { super(); this.canvas = canvas; this.width = canvas.width; this.height = canvas.height; } async saveAsync(options: SaveOptions = { format: SaveFormat.PNG }): Promise<ImageResult> { return getResults(this.canvas, options); } } ```
/content/code_sandbox/packages/expo-image-manipulator/src/web/ImageManipulatorImageRef.web.ts
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
137