This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _ from 'lodash'; | |
// Optional. | |
import $ from 'jquery'; | |
// You need to mount/init the autoComplete utils first. | |
// const autocomplete = new google.maps.places.Autocomplete(inputElement, config); | |
function getPredictionEle (autocomplete: any): null | Element { | |
// Use this to make sure that we will not fall into an endless loop. | |
let MAX_DEEP_DIVE_IN_LEVEL = 50; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-unused-vars */ | |
import { Component, Prop, Vue } from 'vue-property-decorator'; | |
import { CreateElement, VNode, VueConstructor } from 'vue'; | |
import { FunctionalComponentOptions } from 'vue/types/options'; | |
import _ from 'lodash'; | |
export function randomString(len?: number): string { | |
len = len || 32; | |
const $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; | |
const maxPos = $chars.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DirectiveOptions } from 'vue'; | |
import _ from 'lodash'; | |
import $ from 'jquery'; | |
const _toString = Object.prototype.toString; | |
/** | |
* Copied from vue2 source code. | |
* @param val {*} | |
* @return {string} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type TPromiseAllSettledParam<F = any, R = any> = | |
Array<Promise<F> | F> | |
| Record<string, Promise<F> | F>; | |
export type TPromiseAllSettledReturnValue<F, R> = Promise<Array<IPromiseAllSettledFulfilledResult<F> | IPromiseAllSettledRejectedResult<R>>>; | |
export interface IPromiseAllSettledFulfilledResult<F = any> { | |
status: EPromiseAllSettledStatus.fulfilled, | |
value: F | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Update the QueryString Param | |
* @param uri {string} | |
* @param key {string} | |
* @param value {string} | |
*/ | |
export function updateQueryStringParam( | |
uri: string, | |
key: string, | |
value: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue, { ComponentOptions, CreateElement } from 'vue'; | |
import { VNodeData } from 'vue/types/vnode'; | |
import { AsyncComponentFactory, AsyncComponentPromise, FunctionalComponentOptions } from 'vue/types/options'; | |
import _ from 'lodash'; | |
import $ from 'jquery'; | |
export type TArrayOrPrimitive<T> = T extends Array<any> | ReadonlyArray<any> | |
? T | TArrayMember<T> | |
: Array<T> | T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx h */ | |
/// <reference no-default-lib="true"/> | |
/// <reference lib="dom" /> | |
/// <reference lib="dom.asynciterable" /> | |
/// <reference lib="deno.ns" /> | |
import { serve } from "https://deno.land/std@0.114.0/http/server.ts"; | |
import { h, ssr, tw } from "https://crux.land/nanossr@0.0.1"; | |
const ShowDate = (props) => ( | |
<div class={tw`bg-white flex h-screen`}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-unused-vars */ | |
import { Component, Prop, Vue } from 'vue-property-decorator'; | |
import { CreateElement } from 'vue'; | |
import _ from 'lodash'; | |
@Component | |
export default class VIfOrShow extends Vue { | |
/* Data START */ | |
/* Data END */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @typedef {{ status: 'fulfilled', value: *}} TPromiseAllSettledFulfilledResult | |
* @typedef {{ status: 'rejected', reason: (*|Error) }} TPromiseAllSettledRejectedResult | |
* @typedef {(TPromiseAllSettledFulfilledResult|TPromiseAllSettledRejectedResult)[]} TDeferAllSettledResult | |
*/ | |
/** | |
* Same as `Promise.allSettled`. | |
* Try hard to not to use `Promise`, all from JQuery. | |
* @param deferIterator {JQuery.Deferred[]|JQuery.jqXHR[]|Object<string, JQuery.Deferred>} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
name: "TeleportVariable", | |
inheritAttrs: false, // Must set as `false`. Or you will see your bindings existed on your slot DOM attributes, as data="[object Object]" | |
render () { | |
return this.$scopedSlots.default(this.$attrs); | |
} | |
}; |
NewerOlder