repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
hieutran3010/EnglishOnline
src/app/components/collection/List/List.tsx
<filename>src/app/components/collection/List/List.tsx import React, { useState, useEffect, useCallback } from 'react'; import isEmpty from 'lodash/fp/isEmpty'; import getOr from 'lodash/fp/getOr'; import map from 'lodash/fp/map'; import { List, Input, Pagination, Space, Select, Tooltip, Button } from 'antd'; import { R...
hieutran3010/EnglishOnline
src/app/components/collection/DataGrid/SearchControls/styles/StyledIndex.ts
<reponame>hieutran3010/EnglishOnline import styled from 'styled-components/macro'; export const TextSearchContainer = styled.div` padding: 8px; .ant-input-group { display: flex !important; } `;
hieutran3010/EnglishOnline
src/app/services/firebase/index.ts
import * as firebase from 'firebase/app'; const initializeFirebase = () => { const config = require('./config.json'); // Initialize Firebase firebase.initializeApp(config); }; export { initializeFirebase };
hieutran3010/EnglishOnline
src/app/containers/Auth/Login/types.ts
<gh_stars>0 /* --- STATE --- */ export interface LoginState { error: string; isBeingLogin: boolean; isRecovering: boolean; recoveryError: string; } export interface LoginAction { email: string; password: string; } export type ContainerState = LoginState;
hieutran3010/EnglishOnline
src/app/containers/Auth/UserProfile/index.tsx
<filename>src/app/containers/Auth/UserProfile/index.tsx /** * * UserProfile * */ import React, { memo, useMemo, useCallback, useEffect } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { useInjectReducer, useInjectSaga } from 'utils/redux-injectors'; import { reducer, sliceKey, action...
hieutran3010/EnglishOnline
src/app/components/Input/index.ts
<reponame>hieutran3010/EnglishOnline import CurrencyInput from './CurrencyInput'; import PasswordInput from './PasswordInput'; export { CurrencyInput, PasswordInput };
hieutran3010/EnglishOnline
src/app/containers/Post/slice.ts
import { PayloadAction } from '@reduxjs/toolkit'; import Post from 'app/models/post'; import { createSlice } from 'utils/@reduxjs/toolkit'; import { ContainerState } from './types'; import { v4 as uuidv4 } from 'uuid'; // The initial state of the Post container export const initialState: ContainerState = { posts: []...
hieutran3010/EnglishOnline
src/app/fetchers/base/index.ts
import GraphQLFetcherBase from './GraphQLFetcherBase'; import RestfulFetcherBase from './RestfulFetcherBase'; export { GraphQLFetcherBase, RestfulFetcherBase };
hieutran3010/EnglishOnline
src/app/components/collection/List/index.ts
import List from './List'; import InfiniteLoadingList from './InfiniteLoadingList'; import DatasourceInfiniteLoadingList from './DatasourceInfiniteLoadingList'; export { List, InfiniteLoadingList, DatasourceInfiniteLoadingList };
hieutran3010/EnglishOnline
src/app/services/auth/authStorage.ts
<gh_stars>0 import User from 'app/models/user'; import { isEmpty } from 'lodash'; const CACHE_KEY = { USER: 'USER', }; class AuthStorage { storeUser = (user: User) => { localStorage.setItem(CACHE_KEY.USER, JSON.stringify(user)); }; getUser = (): User => { const userStr = localStorage.getItem(CACHE_KEY...
hieutran3010/EnglishOnline
src/app/components/Select/CountrySelect.tsx
<filename>src/app/components/Select/CountrySelect.tsx import React, { useMemo, memo } from 'react'; import { Select } from 'antd'; import map from 'lodash/fp/map'; import find from 'lodash/fp/find'; import isEmpty from 'lodash/fp/isEmpty'; import isNil from 'lodash/fp/isNil'; import isUndefined from 'lodash/fp/isUndefi...
hieutran3010/EnglishOnline
src/app/containers/Auth/Login/Loadable.tsx
/** * * Asynchronously loads the component for Login * */ import { lazyLoad } from 'utils/loadable'; import { LazyLoadingSkeleton } from 'app/components/Skeleton'; import React from 'react'; export const Login = lazyLoad( () => import('./index'), module => module.Login, { fallback: <LazyLoadingSkeleton /> }...
hieutran3010/EnglishOnline
src/types/RootState.ts
import { LoginState } from 'app/containers/Auth/Login/types'; import { UserProfileState } from 'app/containers/Auth/UserProfile/types'; import { HomepageState } from 'app/containers/HomePage/types'; import { PostState } from 'app/containers/Post/types'; import { CoursesState } from 'app/containers/Courses/types'; // [I...
hieutran3010/EnglishOnline
src/app/components/Logo/index.tsx
<gh_stars>0 import React, { memo } from 'react'; interface Props { isSmall?: boolean; logoSmallSrc?: string | any; logoSrc?: string | any; height?: number; } const Logo = ({ isSmall, logoSmallSrc, logoSrc, height }: Props) => { return ( <img src={isSmall ? logoSmallSrc : logoSrc} height={`${h...
hieutran3010/EnglishOnline
src/app/components/Skeleton/LazyLoadingSkeleton.tsx
<filename>src/app/components/Skeleton/LazyLoadingSkeleton.tsx import React, { memo } from 'react'; import { Space, Spin, Typography } from 'antd'; const { Text } = Typography; const LazyLoadingSkeleton = props => { if (props.error) { window.location.reload(true); return <></>; } return ( <Space> ...
hieutran3010/EnglishOnline
src/app/components/AppNavigation/styles/StyledTopNavigation.ts
import styled from 'styled-components/macro'; export const StyledLogoWrapper = styled.div` display: flex; align-items: center; justify-content: center; height: 60px; padding-left: 20px; `;
hieutran3010/EnglishOnline
src/app/containers/HomePage/UserNavigation.tsx
import React, { memo, useMemo, useCallback } from 'react'; import { Avatar, Dropdown, Menu, Divider, Space } from 'antd'; import { UserOutlined, LogoutOutlined } from '@ant-design/icons'; import { Link } from 'react-router-dom'; import toString from 'lodash/fp/toString'; import { authService, authStorage } from 'app/s...
hieutran3010/EnglishOnline
src/app/containers/Post/saga.ts
import { take, call, put, select, takeLatest } from 'redux-saga/effects'; import PostFetcher from 'app/fetchers/postFetcher'; import { actions } from './slice'; import Post from 'app/models/post'; const postFetcher = new PostFetcher(); export function* fetchPostsTask() { let posts: Post[] = [ { id: 'p1', ...
hieutran3010/EnglishOnline
src/app/containers/Auth/Login/slice.ts
import { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from 'utils/@reduxjs/toolkit'; import { ContainerState, LoginAction } from './types'; // The initial state of the Login container export const initialState: ContainerState = { error: '', isBeingLogin: false, isRecovering: false, recoveryE...
hieutran3010/EnglishOnline
src/app/containers/HomePage/slice.ts
import { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from 'utils/@reduxjs/toolkit'; import { getScreenMode, ScreenMode } from 'app/components/AppNavigation'; import { ContainerState } from './types'; const initScreenMode = getScreenMode(); // The initial state of the CustomerCreateOrUpdatePage con...
hieutran3010/EnglishOnline
src/app/components/AppNavigation/types.ts
import { ReactElement } from 'react'; export enum ScreenMode { FULL = 'FULL', TABLET = 'TABLET', MOBILE = 'MOBILE', } export interface IMenuItem { key: string; order?: number; icon: ReactElement; path?: string; displayName: string; activePaths?: string[]; childMenu?: IMenuItem[]; canShow?: () =>...
hieutran3010/EnglishOnline
src/app/containers/Auth/components/UserAvatar.tsx
<filename>src/app/containers/Auth/components/UserAvatar.tsx import React, { memo, useState, useEffect } from 'react'; import { Popover, Avatar, Spin, Typography, Descriptions } from 'antd'; import { UserOutlined } from '@ant-design/icons'; import isEmpty from 'lodash/fp/isEmpty'; import { PopoverProps } from 'antd/lib/...
hieutran3010/EnglishOnline
src/app/components/Layout/AppLayout.tsx
<reponame>hieutran3010/EnglishOnline<filename>src/app/components/Layout/AppLayout.tsx import React, { memo, useCallback, useMemo, useState } from 'react'; import { Layout } from 'antd'; import { LeftNavigation, TopNavigation, ScreenMode, } from 'app/components/AppNavigation'; import { IMenuItem } from 'app/compon...
hieutran3010/EnglishOnline
src/app/components/AppNavigation/Menu.tsx
import React, { memo, useCallback } from 'react'; import { Link } from 'react-router-dom'; import map from 'lodash/fp/map'; import { Menu as AntMenu } from 'antd'; import { IMenu, IMenuItem } from './types'; import isEmpty from 'lodash/fp/isEmpty'; const { SubMenu } = AntMenu; const Menu = ({ items, onSelectedMenuCha...
hieutran3010/EnglishOnline
src/app/collection-datasource/graphql/utils.ts
import isEmpty from 'lodash/fp/isEmpty'; import toLower from 'lodash/fp/toLower'; import { GRAPHQL_QUERY_OPERATOR } from './constants'; import { QueryCriteria } from '../types'; const formatCriteriaValue = (criteria: QueryCriteria) => { const { value, isExplicitFilter } = criteria; if (isExplicitFilter && typeof ...
hieutran3010/EnglishOnline
src/app/collection-datasource/index.ts
<gh_stars>0 import GraphQLDataSource from './graphql'; import PostFetcher from 'app/fetchers/postFetcher'; import PostCommentFetcher from 'app/fetchers/postCommentFetcher'; export enum FETCHER_KEY { POST, POST_COMMENT, } const getDataSource = (fetcherKey: FETCHER_KEY, extendFields?: string[]) => { switch (fetch...
hieutran3010/EnglishOnline
src/utils/colorUtils.ts
<filename>src/utils/colorUtils.ts const getContrast = (hexColor?: string) => { if (!hexColor) { return 'black'; } // If a leading # is provided, remove it if (hexColor.slice(0, 1) === '#') { hexColor = hexColor.slice(1); } // Convert to RGB value var r = parseInt(hexColor.substr(0, 2), 16); va...
hieutran3010/EnglishOnline
src/app/services/auth/AuthService.ts
<reponame>hieutran3010/EnglishOnline<filename>src/app/services/auth/AuthService.ts<gh_stars>0 import { Subject } from 'rxjs'; import isEmpty from 'lodash/fp/isEmpty'; import toString from 'lodash/fp/toString'; import firebase from 'firebase/app'; import 'firebase/auth'; import User from 'app/models/user'; import { aut...
hieutran3010/EnglishOnline
src/app/containers/Auth/Login/styles/StyledIndex.ts
<gh_stars>0 import styled from 'styled-components/macro'; export const StyledLogInContainer = styled.div` display: flex; height: 100vh; background-color: rgb(217, 217, 217, 0.3); justify-content: center; align-items: center; img { margin-bottom: 24px; margin-left: auto; margin-right: auto; }...
hieutran3010/EnglishOnline
src/app/components/AppNavigation/DrawerMenu.tsx
import { Drawer } from 'antd'; import React, { memo } from 'react'; import Menu from './Menu'; import { IDrawerMenu } from './types'; const DrawerMenu = ({ visible, header, onClose, ...restProps }: IDrawerMenu) => { return ( <Drawer placement="left" visible={visible} closable={false} ...
hieutran3010/EnglishOnline
src/app/components/collection/List/InfiniteLoadingList.tsx
<reponame>hieutran3010/EnglishOnline import React, { memo, ReactElement, useCallback } from 'react'; import { List, Spin } from 'antd'; import InfiniteScroll from 'react-infinite-scroller'; import size from 'lodash/fp/size'; export interface IInfiniteLoadingListProps { onRenderItem: (item: any) => ReactElement; lo...
hieutran3010/EnglishOnline
src/app/components/collection/DataGrid/SimpleDataGrid.tsx
<reponame>hieutran3010/EnglishOnline /* eslint-disable indent */ import React, { useState, useCallback, useMemo } from 'react'; import { Table } from 'antd'; import { Key, TablePaginationConfig } from 'antd/lib/table/interface'; import keys from 'lodash/fp/keys'; import find from 'lodash/fp/find'; import get from 'loda...
hieutran3010/EnglishOnline
src/app/components/Layout/index.ts
import AppLayout from './AppLayout'; import RootContainer from './RootContainer'; import ContentContainer from './ContentContainer'; export { AppLayout, RootContainer, ContentContainer };
hieutran3010/EnglishOnline
src/app/components/AppNavigation/index.ts
import LeftNavigation from './LeftNavigation'; import TopNavigation from './TopNavigation'; import { ScreenMode } from './types'; const getScreenMode = (): ScreenMode => { if (window.innerWidth <= 760) { return ScreenMode.MOBILE; } if (window.innerWidth <= 1440) { return ScreenMode.TABLET; } return...
hieutran3010/EnglishOnline
src/app/fetchers/userFetcher.ts
import User from 'app/models/user'; import { RestfulFetcherBase } from './base'; export default class UserFetcher extends RestfulFetcherBase<User> { constructor() { super('account'); } }
hieutran3010/EnglishOnline
src/app/containers/Auth/UserProfile/slice.ts
<reponame>hieutran3010/EnglishOnline import { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from 'utils/@reduxjs/toolkit'; import { ContainerState } from './types'; // The initial state of the UserProfile container export const initialState: ContainerState = { isChangingPass: false, passChangingE...
hieutran3010/EnglishOnline
src/app/containers/Auth/Login/saga.ts
import { call, put, takeLatest } from 'redux-saga/effects'; import { actions } from './slice'; import { PayloadAction } from '@reduxjs/toolkit'; import { LoginAction } from './types'; import { authService } from 'app/services/auth'; export function* loginTask(action: PayloadAction<LoginAction>) { yield put(actions.s...
hieutran3010/EnglishOnline
src/app/components/AppNavigation/TopNavigation.tsx
<reponame>hieutran3010/EnglishOnline<filename>src/app/components/AppNavigation/TopNavigation.tsx import React, { memo } from 'react'; import { Button, Layout } from 'antd'; import { MenuUnfoldOutlined, MenuFoldOutlined, MenuOutlined, } from '@ant-design/icons'; import { StyledLogoWrapper } from './styles/StyledTo...
hieutran3010/EnglishOnline
src/app/components/collection/DataGrid/index.ts
import DataGrid from './DataGrid'; import SimpleDataGrid from './SimpleDataGrid'; import { COLUMN_TYPES } from './constants'; import { ColumnDefinition } from './types'; export { DataGrid, SimpleDataGrid, COLUMN_TYPES }; export type { ColumnDefinition };
hieutran3010/EnglishOnline
src/app/models/postComment.ts
import ModelBase from './modelBase'; export default class PostComment extends ModelBase { owner!: string; content!: string; postId!: string; }
hieutran3010/EnglishOnline
src/app/containers/Auth/UserProfile/types.ts
<reponame>hieutran3010/EnglishOnline /* --- STATE --- */ export interface UserProfileState { isChangingPass: boolean; passChangingError: string; } export type ContainerState = UserProfileState;
hieutran3010/EnglishOnline
src/index.tsx
<reponame>hieutran3010/EnglishOnline /** * index.tsx * * This is the entry file for the application, only setup and boilerplate * code. */ import 'react-app-polyfill/ie11'; import 'react-app-polyfill/stable'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { Provider } from 'react-r...
hieutran3010/EnglishOnline
src/app/services/auth/index.ts
<filename>src/app/services/auth/index.ts import { AuthService } from './AuthService'; import authStorage from './authStorage'; const authService = new AuthService(); export { authService, authStorage };
hieutran3010/EnglishOnline
src/app/containers/Auth/UserProfile/saga.ts
import { call, put, takeLatest } from 'redux-saga/effects'; import { actions } from './slice'; import { PayloadAction } from '@reduxjs/toolkit'; import { authService } from 'app/services/auth'; import { toast } from 'react-toastify'; export function* changePassTask( action: PayloadAction<{ newPass: string; onSuccess...
hieutran3010/EnglishOnline
src/app/containers/Auth/Login/selectors.ts
<filename>src/app/containers/Auth/Login/selectors.ts import { createSelector } from '@reduxjs/toolkit'; import { RootState } from 'types'; import { initialState } from './slice'; const selectDomain = (state: RootState) => state.login || initialState; export const selectIsBeingLogin = createSelector( [selectDomain]...
hieutran3010/EnglishOnline
src/app/components/collection/DataGrid/constants.ts
export const COLUMN_TYPES = { STRING: 'string', DATE: 'date', DATE_TIME: 'dateTime', DATE_WITHOUT_YEAR: 'dateWithoutYear', NUMBER: 'number', CURRENCY: 'currency', BOOLEAN: 'boolean', PERCENT: 'percent', };
hieutran3010/EnglishOnline
src/app/collection-datasource/types.ts
<reponame>hieutran3010/EnglishOnline export interface QueryCriteria { field: string; value: any; isExplicitFilter?: boolean; operator: string; }
hieutran3010/EnglishOnline
src/app/models/validators/userValidator.ts
<reponame>hieutran3010/EnglishOnline<filename>src/app/models/validators/userValidator.ts import { Rule } from 'antd/lib/form'; import { REGEX_PATTERN } from 'utils/numberFormat'; type UserValidator = { email: Rule[]; password: Rule[]; name: Rule[]; phoneNumber: Rule[]; role: Rule[]; }; const getUserValidator...
hieutran3010/EnglishOnline
src/app/containers/Post/index.tsx
/** * * Post * */ import React, { memo, useCallback, useEffect } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { Avatar, Button, Card, Col, List, Row, Skeleton, Typography, Form, Input, Space, Comment, } from 'antd'; import { LikeOutlined, CommentOutlined } fr...
hieutran3010/EnglishOnline
src/app/components/Modal/utils.tsx
<gh_stars>0 import React from 'react'; import { Modal } from 'antd'; import { ExclamationCircleOutlined } from '@ant-design/icons'; export const showConfirm = (message: string, onOk?, onCancel?) => { Modal.confirm({ title: 'Xác Nhận', icon: <ExclamationCircleOutlined />, content: message, okText: 'OK...
hieutran3010/EnglishOnline
src/app/components/Skeleton/index.ts
import LazyLoadingSkeleton from './LazyLoadingSkeleton'; export { LazyLoadingSkeleton };
hieutran3010/EnglishOnline
src/app/components/collection/DataGrid/DataGrid.tsx
<filename>src/app/components/collection/DataGrid/DataGrid.tsx /* eslint-disable indent */ import React, { useEffect, useState, useCallback, useMemo } from 'react'; import { Table } from 'antd'; import { Key, TablePaginationConfig, TableLocale, } from 'antd/lib/table/interface'; import keys from 'lodash/fp/keys'; ...
hieutran3010/EnglishOnline
src/app/components/collection/DataGrid/types.ts
<reponame>hieutran3010/EnglishOnline import { ReactElement } from 'react'; import { OrderOption, QueryCriteria } from '../types'; export interface ColumnDefinition { title: string; type?: string; dataIndex?: string; canFilter?: boolean; filterField?: string; searchOperator?: string; key: string; width?...
hieutran3010/EnglishOnline
src/app/components/collection/types.ts
import { Subject } from 'rxjs'; export interface IDataSource { queryManyAsync: (params: QueryParams, isSearchOr?: boolean) => Promise<any[]>; countAsync: (queryCriteria: QueryCriteria[]) => Promise<number>; onReloaded: Subject<any>; addAsync: (model: any) => Promise<any>; onReloadData: () => void; } export ...
hieutran3010/EnglishOnline
src/app/containers/HomePage/selectors.ts
import { createSelector } from '@reduxjs/toolkit'; import { RootState } from 'types'; import { initialState } from './slice'; const selectDomain = (state: RootState) => state.homepage || initialState; export const selectScreenMode = createSelector( [selectDomain], homepageState => homepageState.screenMode, ); e...
hieutran3010/EnglishOnline
src/utils/numberFormat.ts
import { padStart, trimStart, replace, trim, toString } from 'lodash'; const toCurrency = (value: number, isUsd: boolean = false) => { const formatted = toString(value).replace(/\B(?=(\d{3})+(?!\d))/g, ','); if (isUsd === true) { const formatter = new Intl.NumberFormat('en-US', { style: 'currency', ...
hieutran3010/EnglishOnline
src/app/models/modelBase.ts
<reponame>hieutran3010/EnglishOnline export default class ModelBase { id: string; constructor(entity: any = undefined) { if (entity) { this.id = entity.id; } else { this.id = ''; } } }
hieutran3010/EnglishOnline
src/app/components/Input/PasswordInput.tsx
import React, { memo } from 'react'; import Input, { InputProps } from 'antd/lib/input'; import { EyeTwoTone, EyeInvisibleOutlined } from '@ant-design/icons'; const PasswordInput = React.forwardRef((props: InputProps, ref: any) => { return ( <Input.Password ref={ref} iconRender={visible => vi...
hieutran3010/EnglishOnline
src/app/containers/HomePage/types.ts
<reponame>hieutran3010/EnglishOnline import { ScreenMode } from 'app/components/AppNavigation'; /* --- STATE --- */ export interface HomepageState { screenMode: ScreenMode; collapsedMenu: boolean; } export type ContainerState = HomepageState;
hieutran3010/EnglishOnline
src/app/collection-datasource/graphql/index.ts
<filename>src/app/collection-datasource/graphql/index.ts<gh_stars>0 import isEmpty from 'lodash/fp/isEmpty'; import isNil from 'lodash/fp/isNil'; import map from 'lodash/fp/map'; import { GraphQLEntityFetcher } from 'graphql-door-client'; import { Subject } from 'rxjs'; import { IDataSource, QueryParams, QueryCri...
hieutran3010/EnglishOnline
src/app/components/collection/DataGrid/SearchControls/index.tsx
/* eslint-disable no-param-reassign */ /* eslint-disable react/prop-types */ import React from 'react'; import { Input, Space, Button } from 'antd'; import { SearchOutlined, ClearOutlined } from '@ant-design/icons'; const getColumnSearchProps = (dataIndex: string, searchInput?: any) => ({ filterDropdown: ({ setS...
hieutran3010/EnglishOnline
src/styles/global-styles.ts
import { createGlobalStyle } from 'styled-components'; export const GlobalStyle = createGlobalStyle` html, body { height: 100%; width: 100%; } .ant-btn .anticon svg { margin-bottom: 6px } .ant-btn-link .anticon svg { margin-bottom: 3px!important; } .ant-avatar .anticon svg { margi...
hieutran3010/EnglishOnline
src/app/components/collection/DataGrid/utils.tsx
<filename>src/app/components/collection/DataGrid/utils.tsx<gh_stars>0 import React from 'react'; import assign from 'lodash/fp/assign'; import map from 'lodash/fp/map'; import moment from 'moment'; import { ColumnDefinition } from './types'; import { COLUMN_TYPES } from './constants'; import { getColumnSearchProps } fr...
hieutran3010/EnglishOnline
src/app/components/Input/CurrencyInput.tsx
<filename>src/app/components/Input/CurrencyInput.tsx import React, { memo } from 'react'; import { InputNumber } from 'antd'; import { InputNumberProps } from 'antd/lib/input-number'; const CurrencyInput = React.forwardRef((props: InputNumberProps, ref: any) => { return ( <InputNumber ref={ref} forma...
sadnessOjisan/shop.ojisan.io
src/components/tags.tsx
<reponame>sadnessOjisan/shop.ojisan.io<filename>src/components/tags.tsx import Link from "next/link"; import { VFC } from "react"; import { tagsStyle } from "../style/tags.css"; type Props = { tags: { id: string; name: string }[]; className?: string }; export const Tags: VFC<Props> = (props) => { return ( <span...
sadnessOjisan/shop.ojisan.io
src/pages/tags/[tid].tsx
<filename>src/pages/tags/[tid].tsx import { GetStaticPaths, GetStaticProps } from "next"; import Head from "next/head"; import Link from "next/link"; import { VFC } from "react"; import { ItemListItem } from "../../components/item-list-item"; import { Layout } from "../../components/layout"; import { META_TAG_CONTENT ...
sadnessOjisan/shop.ojisan.io
src/style/tags.css.ts
<gh_stars>1-10 import { style } from "@vanilla-extract/css"; export const tagsStyle = { tips: style({ display: "flex" }), category: style({ background: "lightgray", padding: "2px 8px", marginLeft: "4px", borderRadius: "4px", fontSize: 12, ":first-child": { marginLeft: 0, }, }), ...
sadnessOjisan/shop.ojisan.io
src/pages/about.tsx
<reponame>sadnessOjisan/shop.ojisan.io<filename>src/pages/about.tsx<gh_stars>1-10 import Head from "next/head"; import { VFC } from "react"; import { Layout } from "../components/layout"; import { META_TAG_CONTENT } from "../const"; import { aboutPageStyles } from "../style/about-page.css"; const TermPage: VFC = () =...
LazyDuke/ts-promise
src/typescript/index.ts
<reponame>LazyDuke/ts-promise import isArrayLikeObject from 'lodash.isarraylikeobject' class TsPromise { static PENDING = 'PENDING' static FULFILLED = 'FULFILLED' static REJECTED = 'REJECTED' static resolvePromise: ResolvePromise = ( anotherPromise, x, resolve, reject ) => { // 如果 onFulf...
seriouslag/vue-tagsinput
src/index.ts
<reponame>seriouslag/vue-tagsinput /** * This file is the main import for the built library */ import { VueConstructor } from 'vue'; import TagsInput from './TagsInput.vue'; export * from './Tag'; export { TagsInput }; export function install (Vue: VueConstructor) { Vue.component('TagsInput', TagsInput); } exp...
seriouslag/vue-tagsinput
src/shims-vue.d.ts
/* Shim file to help typescript understand vue files */ declare module '*.vue' { import Vue from 'vue'; export default Vue; }
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/team/src/app/news/news.component.ts
import { Component, OnInit, Input, ViewEncapsulation } from '@angular/core'; import { NewsConfig } from '../news.interface'; import { NgElement, NgElementStrategy } from '@angular/elements'; import { Subscription } from 'rxjs'; @Component({ // selector: 'team-news', template: ` <div class="card card-plain card-...
sathyaleo08/MicroFrotEndWithWebComponent-code
src/app/models/players.interface.ts
export interface PlayersRoot { error: string; total: string; data: PlayersInfo[]; } export interface PlayersInfo { id: string; firstname: string; lastname: string; shirtnumber: string; position: string; quote: string; statusSent?: boolean; skills: PlayerStats[]; stats: PlayerStats[]; } export i...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/team/src/app/team.service.ts
<gh_stars>1-10 import { Injectable } from '@angular/core'; import { Observable, Subject } from 'rxjs'; @Injectable({ providedIn: 'root' }) export class TeamService { private state$ = new Subject<any>(); constructor() {} public getState(): Observable<any> { return this.state$.asObservable(); } public se...
sathyaleo08/MicroFrotEndWithWebComponent-code
src/app/navbar/navbar.component.ts
<filename>src/app/navbar/navbar.component.ts import { Component, OnInit, OnDestroy } from '@angular/core'; import { StateService } from '../state.service'; import { Subscription } from 'rxjs'; import { AcknowledgementStatus } from '../models/acknowledgement.interface'; import { PlayersInfo } from '../models/players.int...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/news/src/app/app.module.ts
import { BrowserModule } from '@angular/platform-browser'; import { NgModule, CUSTOM_ELEMENTS_SCHEMA, Injector } from '@angular/core'; import { RouterModule } from '@angular/router'; import { createCustomElement } from '@angular/elements'; import { NewsPageComponent } from './news-page/news-page.component'; import { C...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/team/src/app/core/core.component.ts
import { Component, OnInit, ViewEncapsulation } from '@angular/core'; @Component({ // selector: 'team-core', template: ` <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-header"> <div class="framework"> <img alt="..." src="assets/img/angular.png" class="avat...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/team/src/app/fixtures/fixtures.component.ts
import { Component, OnInit } from '@angular/core'; @Component({ selector: 'team-fixtures', templateUrl: './fixtures.component.html', styleUrls: ['./fixtures.component.scss'] }) export class FixturesComponent implements OnInit { fixtures: any[]; constructor() {} ngOnInit(): void { this.fixtures = [{ ...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/news/src/app/news/news.component.ts
import { Component, OnInit, Input, ViewEncapsulation } from '@angular/core'; @Component({ // selector: 'team-news', template: ` <div class="card card-plain card-blog"> <div class="card-body"> <div class="framework"><img alt="..." src="assets/img/angular.png" class="avatar" /></div> <h6 class="cate...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/team/src/app/app.module.ts
<reponame>sathyaleo08/MicroFrotEndWithWebComponent-code import { TeamService } from './team.service'; import { FixturesComponent } from './fixtures/fixtures.component'; import { BrowserModule } from '@angular/platform-browser'; import { NgModule, Injector, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { RouterM...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/news/src/app/core/core.component.ts
<filename>projects/news/src/app/core/core.component.ts import { Component, OnInit } from '@angular/core'; @Component({ // selector: 'news-core', template: ` <div class="row"> <div class="col-sm-12"> <div class="card"> <div class="card-header"> <div class="framework"><img alt="..." src="assets/...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/news/src/app/app.component.ts
<reponame>sathyaleo08/MicroFrotEndWithWebComponent-code import { Component, OnInit, Input, Output, EventEmitter, ViewEncapsulation } from '@angular/core'; import { Router } from '@angular/router'; @Component({ // selector: 'news-root', template: ` <div> <router-outlet></router-outlet> </d...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/news/src/app/news-page/news-page.component.ts
import { Component, OnInit } from '@angular/core'; @Component({ // tslint:disable-next-line: component-selector selector: 'news-page', template: ` <div class="row"> <div class="col-sm-12"> <div class="card card-blog card-plain blog-horizontal"> <div class="row"> <div class="col-lg-4"> ...
sathyaleo08/MicroFrotEndWithWebComponent-code
src/app/app.component.ts
import { AcknowledgementStatus } from './models/acknowledgement.interface'; import { Component, OnInit } from '@angular/core'; import { element } from 'protractor'; import { Subject } from 'rxjs'; import { StateService } from './state.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html'...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/team/src/app/news.interface.ts
export interface NewsConfig{ title: string; content: string; author: string; channel: string; }
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/team/src/app/standings/standings.component.ts
import { Component, OnInit, OnDestroy } from '@angular/core'; import { TeamService } from '../team.service'; import { Subscription } from 'rxjs'; @Component({ selector: 'team-standings', templateUrl: './standings.component.html', styleUrls: ['./standings.component.scss'] }) export class StandingsComponent implem...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/players/src/app/detail/detail.component.ts
<filename>projects/players/src/app/detail/detail.component.ts<gh_stars>1-10 import { Component, OnInit, OnDestroy } from '@angular/core'; import { Subscription } from 'rxjs'; import { PlayersService } from '../players.service'; import { PlayersInfo } from '../models/players.interface'; @Component({ selector: 'player...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/team/src/app/app.component.ts
import { TeamService } from './team.service'; import { Component, OnInit, Input, Output, EventEmitter, ViewEncapsulation } from '@angular/core'; import { Router } from '@angular/router'; @Component({ // selector: 'team-root', template: ` <div> <router-outlet></router-outlet> </div> `, ...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/players/src/app/cards/cards.component.ts
import { PlayersService } from './../players.service'; import { Component, OnInit, OnDestroy } from '@angular/core'; import { Subscription } from 'rxjs'; import { AcknowledgementStatus } from 'src/app/models/acknowledgement.interface'; import { PlayersInfo } from '../models/players.interface'; @Component({ selector:...
sathyaleo08/MicroFrotEndWithWebComponent-code
src/app/state.service.ts
import { Injectable } from '@angular/core'; import { Subject, Observable } from 'rxjs'; import { HttpClient } from '@angular/common/http'; @Injectable({ providedIn: 'root' }) export class StateService { constructor(private http: HttpClient) {} private state$ = new Subject(); private message$ = new Subject<any>(...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/team/src/app/line-up/line-up.component.ts
import { Component, OnInit } from '@angular/core'; @Component({ selector: 'team-line-up', templateUrl: './line-up.component.html', styleUrls: ['./line-up.component.scss'] }) export class LineUpComponent implements OnInit { constructor() { } ngOnInit(): void { this.loadWebComponentLibrary(); } loadW...
sathyaleo08/MicroFrotEndWithWebComponent-code
projects/players/src/app/players.service.ts
<filename>projects/players/src/app/players.service.ts import { Injectable, EventEmitter } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { HttpClient } from '@angular/common/http'; @Injectable({ providedIn: 'root' }) export class PlayersService { private state$ = new Subject<any>(); pri...
PopeFelix/assemblyscript-json
assembly/__tests__/string_escape.spec.ts
import { JSON } from '../JSON' describe('Escaped characters', () => { it('Does not escape characters unneccessarily', () => { const strings = [ 'sphinx of black quartz, judge my vow', '{}', '[]', '/', '|', '/|||/|||[{]}<>,.', 'ஂ ஃ அ ஆ இ ஈ உ ஊ எ ஏ ஐ ஒ ஓ ஔ க ங ச ஜ ஞ ட ண த ...
culmat/bal-ui-library
src/components/bal-accordion/bal-accordion.tsx
<reponame>culmat/bal-ui-library import {Component, Host, h, Prop, State, Watch, Method} from "@stencil/core"; @Component({ tag: "bal-accordion", shadow: true, }) export class BalAccordion { @State() isCollapsed: boolean = true; /** * Type defines the theme of the accordion toggle */ @Prop() type: ...
culmat/bal-ui-library
src/components/autocomplete-item/autocomplete-item.tsx
import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from "@stencil/core"; import {Components} from "../../components"; @Component({ tag: "bal-autocomplete-item", styleUrl: "autocomplete-item.scss", shadow: true, }) export class AutocompleteItem { @Element() element!: HTMLEleme...
culmat/bal-ui-library
src/components/tab-item/tab-item.tsx
import {Component, Host, h, Prop, Method, State, Watch} from "@stencil/core"; export interface TabItemOptions { value: string; label: string; active: boolean; } @Component({ tag: "bal-tab-item", styleUrl: "tab-item.scss", shadow: true, }) export class TabItem { @State() isContentHidden = true; /** ...
culmat/bal-ui-library
src/components/bal-dropdown/bal-dropdown.tsx
import {Component, Host, h, State, Method, Prop, EventEmitter, Event, Listen, Element, Watch} from "@stencil/core"; export interface DropDownOption { label: string; value: any; } @Component({ tag: "bal-dropdown", styleUrl: "bal-dropdown.scss", shadow: true, }) export class BalDropdown { @Element() element...
culmat/bal-ui-library
src/components/bal-button/bal-button.e2e.ts
<reponame>culmat/bal-ui-library import {newE2EPage} from "@stencil/core/testing"; describe("bal-button", () => { it("renders", async () => { const page = await newE2EPage(); await page.setContent( `<bal-button type="is-primary">Press me</bal-button>`, ); const buttonElement = await page.find("...
culmat/bal-ui-library
src/components.d.ts
<reponame>culmat/bal-ui-library /* eslint-disable */ /* tslint:disable */ /** * This is an autogenerated file created by the Stencil compiler. * It contains typing information for all components that exist in this project. */ import { HTMLStencilElement, JSXBase } from '@stencil/core/internal'; import { DateCall...
culmat/bal-ui-library
stencil.config.ts
import {Config} from "@stencil/core"; import {sass} from "@stencil/sass"; import {postcss} from "@stencil/postcss"; import autoprefixer from "autoprefixer"; export const config: Config = { devServer: { reloadStrategy: "pageReload", }, namespace: "bal-ui-library", globalStyle: "src/scss/bal-ui-library.scss"...