@gf-ui/components
Advanced tools
Comparing version 0.0.5 to 0.0.9
@@ -1,5 +0,1 @@ | ||
function getComponents(str) { | ||
return str; | ||
} | ||
export { getComponents }; | ||
function n(n){return n}export{n as getComponents} |
@@ -1,129 +0,1 @@ | ||
import { B as BUILD, c as consoleDevInfo, p as plt, w as win, H, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-60878e3f.js'; | ||
import { g as globalScripts } from './app-globals-0f993ce5.js'; | ||
/* | ||
Stencil Client Patch Browser v2.15.1 | MIT Licensed | https://stenciljs.com | ||
*/ | ||
const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`; | ||
const patchBrowser = () => { | ||
// NOTE!! This fn cannot use async/await! | ||
if (BUILD.isDev && !BUILD.isTesting) { | ||
consoleDevInfo('Running in development mode.'); | ||
} | ||
if (BUILD.cssVarShim) { | ||
// shim css vars | ||
plt.$cssShim$ = win.__cssshim; | ||
} | ||
if (BUILD.cloneNodeFix) { | ||
// opted-in to polyfill cloneNode() for slot polyfilled components | ||
patchCloneNodeFix(H.prototype); | ||
} | ||
if (BUILD.profile && !performance.mark) { | ||
// not all browsers support performance.mark/measure (Safari 10) | ||
// because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist, | ||
// simply stub the implementations out. | ||
// TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking) | ||
// @ts-ignore | ||
performance.mark = performance.measure = () => { | ||
/*noop*/ | ||
}; | ||
performance.getEntriesByName = () => []; | ||
} | ||
// @ts-ignore | ||
const scriptElm = BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim | ||
? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\/${NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) || | ||
s.getAttribute('data-stencil-namespace') === NAMESPACE) | ||
: null; | ||
const importMeta = import.meta.url; | ||
const opts = BUILD.scriptDataOpts ? scriptElm['data-opts'] || {} : {}; | ||
if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) { | ||
// Safari < v11 support: This IF is true if it's Safari below v11. | ||
// This fn cannot use async/await since Safari didn't support it until v11, | ||
// however, Safari 10 did support modules. Safari 10 also didn't support "nomodule", | ||
// so both the ESM file and nomodule file would get downloaded. Only Safari | ||
// has 'onbeforeload' in the script, and "history.scrollRestoration" was added | ||
// to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue. | ||
// IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds. | ||
return { | ||
then() { | ||
/* promise noop */ | ||
}, | ||
}; | ||
} | ||
if (!BUILD.safari10 && importMeta !== '') { | ||
opts.resourcesUrl = new URL('.', importMeta).href; | ||
} | ||
else if (BUILD.dynamicImportShim || BUILD.safari10) { | ||
opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href; | ||
if (BUILD.dynamicImportShim) { | ||
patchDynamicImport(opts.resourcesUrl, scriptElm); | ||
} | ||
if (BUILD.dynamicImportShim && !win.customElements) { | ||
// module support, but no custom elements support (Old Edge) | ||
// @ts-ignore | ||
return import(/* webpackChunkName: "polyfills-dom" */ './dom-1d32cb7b.js').then(() => opts); | ||
} | ||
} | ||
return promiseResolve(opts); | ||
}; | ||
const patchDynamicImport = (base, orgScriptElm) => { | ||
const importFunctionName = getDynamicImportFunction(NAMESPACE); | ||
try { | ||
// test if this browser supports dynamic imports | ||
// There is a caching issue in V8, that breaks using import() in Function | ||
// By generating a random string, we can workaround it | ||
// Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info | ||
win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`); | ||
} | ||
catch (e) { | ||
// this shim is specifically for browsers that do support "esm" imports | ||
// however, they do NOT support "dynamic" imports | ||
// basically this code is for old Edge, v18 and below | ||
const moduleMap = new Map(); | ||
win[importFunctionName] = (src) => { | ||
const url = new URL(src, base).href; | ||
let mod = moduleMap.get(url); | ||
if (!mod) { | ||
const script = doc.createElement('script'); | ||
script.type = 'module'; | ||
script.crossOrigin = orgScriptElm.crossOrigin; | ||
script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], { | ||
type: 'application/javascript', | ||
})); | ||
mod = new Promise((resolve) => { | ||
script.onload = () => { | ||
resolve(win[importFunctionName].m); | ||
script.remove(); | ||
}; | ||
}); | ||
moduleMap.set(url, mod); | ||
doc.head.appendChild(script); | ||
} | ||
return mod; | ||
}; | ||
} | ||
}; | ||
const patchCloneNodeFix = (HTMLElementPrototype) => { | ||
const nativeCloneNodeFn = HTMLElementPrototype.cloneNode; | ||
HTMLElementPrototype.cloneNode = function (deep) { | ||
if (this.nodeName === 'TEMPLATE') { | ||
return nativeCloneNodeFn.call(this, deep); | ||
} | ||
const clonedNode = nativeCloneNodeFn.call(this, false); | ||
const srcChildNodes = this.childNodes; | ||
if (deep) { | ||
for (let i = 0; i < srcChildNodes.length; i++) { | ||
// Node.ATTRIBUTE_NODE === 2, and checking because IE11 | ||
if (srcChildNodes[i].nodeType !== 2) { | ||
clonedNode.appendChild(srcChildNodes[i].cloneNode(true)); | ||
} | ||
} | ||
} | ||
return clonedNode; | ||
}; | ||
}; | ||
patchBrowser().then(options => { | ||
globalScripts(); | ||
return bootstrapLazy([["gf-button",[[4,"gf-button",{"color":[1],"disabled":[4],"textColor":[1,"text-color"],"classNames":[1,"class-names"],"plain":[4],"size":[1],"_internal":[64]}]]],["sten-button",[[1,"sten-button",{"name":[1],"num":[32],"show":[64]},[[9,"scroll","handleScroll"]]]]]], options); | ||
}); | ||
import{p as o,b as e}from"./p-cfc4cf92.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),o(t)})().then((o=>e([["p-281b2d69",[[4,"gf-button",{color:[1],disabled:[4],textColor:[1,"text-color"],classNames:[1,"class-names"],plain:[4],size:[1],circle:[4],nativeType:[1,"native-type"],_internal:[64]}]]],["p-3f8c90aa",[[4,"gf-button-group"]]],["p-e6a2f4c1",[[1,"gf-tag"]]],["p-02cd4267",[[1,"sten-button",{name:[1],num:[32],show:[64]},[[9,"scroll","handleScroll"]]]]],["p-d0630af3",[[4,"gf-input",{disabled:[4],clearable:[4],value:[1],type:[1],maxlength:[2],status:[1],iconFontSize:[2,"icon-font-size"],iconColor:[1,"icon-color"],placeholder:[1],autofocus:[4],resize:[1],minRows:[8,"min-rows"],maxRows:[8,"max-rows"],rows:[8],autosize:[4],curentValue:[32],calculateStyle:[32]}],[0,"gf-icon-clear",{size:[8],styles:[16],color:[1],rotate:[2],spin:[4],opacity:[8]}],[0,"gf-icon-info",{size:[8],styles:[16],color:[1],rotate:[2],spin:[4],opacity:[8]}],[0,"gf-icon-success-fill",{size:[8],styles:[16],color:[1],rotate:[2],spin:[4],opacity:[8]}]]]],o))); |
@@ -9,8 +9,11 @@ /* eslint-disable */ | ||
import { ButtonColor, ButtonSize } from "./types/gf-button"; | ||
import { status } from "./types/var"; | ||
export namespace Components { | ||
interface GfButton { | ||
"_internal": () => Promise<void>; | ||
"circle": boolean; | ||
"classNames": string; | ||
"color": ButtonColor; | ||
"disabled": boolean; | ||
"nativeType": string; | ||
"plain": boolean; | ||
@@ -20,2 +23,47 @@ "size": ButtonSize; | ||
} | ||
interface GfButtonGroup { | ||
} | ||
interface GfIconClear { | ||
"color"?: string; | ||
"opacity"?: number | string; | ||
"rotate"?: number; | ||
"size": number | string; | ||
"spin"?: boolean; | ||
"styles"?: object; | ||
} | ||
interface GfIconInfo { | ||
"color"?: string; | ||
"opacity"?: number | string; | ||
"rotate"?: number; | ||
"size": number | string; | ||
"spin"?: boolean; | ||
"styles"?: object; | ||
} | ||
interface GfIconSuccessFill { | ||
"color"?: string; | ||
"opacity"?: number | string; | ||
"rotate"?: number; | ||
"size": number | string; | ||
"spin"?: boolean; | ||
"styles"?: object; | ||
} | ||
interface GfInput { | ||
"autofocus": boolean; | ||
"autosize": boolean; | ||
"clearable": boolean; | ||
"disabled": boolean; | ||
"iconColor": string; | ||
"iconFontSize": number; | ||
"maxRows": number | string; | ||
"maxlength"?: number; | ||
"minRows": number | string; | ||
"placeholder": string; | ||
"resize": string; | ||
"rows": number | string; | ||
"status": status; | ||
"type": string; | ||
"value": string; | ||
} | ||
interface GfTag { | ||
} | ||
interface StenButton { | ||
@@ -36,2 +84,38 @@ /** | ||
}; | ||
interface HTMLGfButtonGroupElement extends Components.GfButtonGroup, HTMLStencilElement { | ||
} | ||
var HTMLGfButtonGroupElement: { | ||
prototype: HTMLGfButtonGroupElement; | ||
new (): HTMLGfButtonGroupElement; | ||
}; | ||
interface HTMLGfIconClearElement extends Components.GfIconClear, HTMLStencilElement { | ||
} | ||
var HTMLGfIconClearElement: { | ||
prototype: HTMLGfIconClearElement; | ||
new (): HTMLGfIconClearElement; | ||
}; | ||
interface HTMLGfIconInfoElement extends Components.GfIconInfo, HTMLStencilElement { | ||
} | ||
var HTMLGfIconInfoElement: { | ||
prototype: HTMLGfIconInfoElement; | ||
new (): HTMLGfIconInfoElement; | ||
}; | ||
interface HTMLGfIconSuccessFillElement extends Components.GfIconSuccessFill, HTMLStencilElement { | ||
} | ||
var HTMLGfIconSuccessFillElement: { | ||
prototype: HTMLGfIconSuccessFillElement; | ||
new (): HTMLGfIconSuccessFillElement; | ||
}; | ||
interface HTMLGfInputElement extends Components.GfInput, HTMLStencilElement { | ||
} | ||
var HTMLGfInputElement: { | ||
prototype: HTMLGfInputElement; | ||
new (): HTMLGfInputElement; | ||
}; | ||
interface HTMLGfTagElement extends Components.GfTag, HTMLStencilElement { | ||
} | ||
var HTMLGfTagElement: { | ||
prototype: HTMLGfTagElement; | ||
new (): HTMLGfTagElement; | ||
}; | ||
interface HTMLStenButtonElement extends Components.StenButton, HTMLStencilElement { | ||
@@ -45,2 +129,8 @@ } | ||
"gf-button": HTMLGfButtonElement; | ||
"gf-button-group": HTMLGfButtonGroupElement; | ||
"gf-icon-clear": HTMLGfIconClearElement; | ||
"gf-icon-info": HTMLGfIconInfoElement; | ||
"gf-icon-success-fill": HTMLGfIconSuccessFillElement; | ||
"gf-input": HTMLGfInputElement; | ||
"gf-tag": HTMLGfTagElement; | ||
"sten-button": HTMLStenButtonElement; | ||
@@ -51,5 +141,7 @@ } | ||
interface GfButton { | ||
"circle"?: boolean; | ||
"classNames"?: string; | ||
"color"?: ButtonColor; | ||
"disabled"?: boolean; | ||
"nativeType"?: string; | ||
"onOn-click"?: (event: CustomEvent<{ data: Object }>) => void; | ||
@@ -60,2 +152,52 @@ "plain"?: boolean; | ||
} | ||
interface GfButtonGroup { | ||
} | ||
interface GfIconClear { | ||
"color"?: string; | ||
"opacity"?: number | string; | ||
"rotate"?: number; | ||
"size"?: number | string; | ||
"spin"?: boolean; | ||
"styles"?: object; | ||
} | ||
interface GfIconInfo { | ||
"color"?: string; | ||
"opacity"?: number | string; | ||
"rotate"?: number; | ||
"size"?: number | string; | ||
"spin"?: boolean; | ||
"styles"?: object; | ||
} | ||
interface GfIconSuccessFill { | ||
"color"?: string; | ||
"opacity"?: number | string; | ||
"rotate"?: number; | ||
"size"?: number | string; | ||
"spin"?: boolean; | ||
"styles"?: object; | ||
} | ||
interface GfInput { | ||
"autofocus"?: boolean; | ||
"autosize"?: boolean; | ||
"clearable"?: boolean; | ||
"disabled"?: boolean; | ||
"iconColor"?: string; | ||
"iconFontSize"?: number; | ||
"maxRows"?: number | string; | ||
"maxlength"?: number; | ||
"minRows"?: number | string; | ||
"onEventBlur"?: (event: CustomEvent<HTMLAreaElement>) => void; | ||
"onEventChange"?: (event: CustomEvent<string>) => void; | ||
"onEventClear"?: (event: CustomEvent<string>) => void; | ||
"onEventFocus"?: (event: CustomEvent<FocusEvent>) => void; | ||
"onEventInput"?: (event: CustomEvent<string>) => void; | ||
"placeholder"?: string; | ||
"resize"?: string; | ||
"rows"?: number | string; | ||
"status"?: status; | ||
"type"?: string; | ||
"value"?: string; | ||
} | ||
interface GfTag { | ||
} | ||
interface StenButton { | ||
@@ -70,2 +212,8 @@ /** | ||
"gf-button": GfButton; | ||
"gf-button-group": GfButtonGroup; | ||
"gf-icon-clear": GfIconClear; | ||
"gf-icon-info": GfIconInfo; | ||
"gf-icon-success-fill": GfIconSuccessFill; | ||
"gf-input": GfInput; | ||
"gf-tag": GfTag; | ||
"sten-button": StenButton; | ||
@@ -79,2 +227,8 @@ } | ||
"gf-button": LocalJSX.GfButton & JSXBase.HTMLAttributes<HTMLGfButtonElement>; | ||
"gf-button-group": LocalJSX.GfButtonGroup & JSXBase.HTMLAttributes<HTMLGfButtonGroupElement>; | ||
"gf-icon-clear": LocalJSX.GfIconClear & JSXBase.HTMLAttributes<HTMLGfIconClearElement>; | ||
"gf-icon-info": LocalJSX.GfIconInfo & JSXBase.HTMLAttributes<HTMLGfIconInfoElement>; | ||
"gf-icon-success-fill": LocalJSX.GfIconSuccessFill & JSXBase.HTMLAttributes<HTMLGfIconSuccessFillElement>; | ||
"gf-input": LocalJSX.GfInput & JSXBase.HTMLAttributes<HTMLGfInputElement>; | ||
"gf-tag": LocalJSX.GfTag & JSXBase.HTMLAttributes<HTMLGfTagElement>; | ||
"sten-button": LocalJSX.StenButton & JSXBase.HTMLAttributes<HTMLStenButtonElement>; | ||
@@ -81,0 +235,0 @@ } |
@@ -10,2 +10,4 @@ import { EventEmitter } from '../../stencil-public-runtime'; | ||
size: ButtonSize; | ||
circle: boolean; | ||
nativeType: string; | ||
componentWillLoad(): void; | ||
@@ -12,0 +14,0 @@ changeDisabled(newValue: boolean, oldValue: boolean): void; |
@@ -7,1 +7,3 @@ /** | ||
export declare function setStyleSheet(v: string): void; | ||
export declare const on: (element: any, event: any, handler: any) => void; | ||
export declare const off: (element: any, event: any, handler: any) => void; |
export * from "./color"; | ||
export * from "./dom"; | ||
export * from "./shared"; |
{ | ||
"name": "@gf-ui/components", | ||
"version": "0.0.5", | ||
"version": "0.0.9", | ||
"description": "跨框架核心库", | ||
@@ -41,2 +41,3 @@ "main": "dist/index.cjs.js", | ||
"@types/jest": "^27.0.3", | ||
"classnames": "^2.3.1", | ||
"jest": "^27.4.5", | ||
@@ -47,3 +48,3 @@ "jest-cli": "^27.4.5", | ||
"license": "MIT", | ||
"gitHead": "bf40feffd3533424bf576407cfdaa50f9260c9df" | ||
"gitHead": "91839cf4e8b4249592a4d9a358e0fda22749dff5" | ||
} |
@@ -1,78 +0,1 @@ | ||
![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d&style=flat-square) | ||
# Stencil Component Starter | ||
This is a starter project for building a standalone Web Component using Stencil. | ||
Stencil is also great for building entire apps. For that, use the [stencil-app-starter](https://github.com/ionic-team/stencil-app-starter) instead. | ||
# Stencil | ||
Stencil is a compiler for building fast web apps using Web Components. | ||
Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec. | ||
Stencil components are just Web Components, so they work in any major framework or with no framework at all. | ||
## Getting Started | ||
To start building a new web component using Stencil, clone this repo to a new directory: | ||
```bash | ||
git clone https://github.com/ionic-team/stencil-component-starter.git my-component | ||
cd my-component | ||
git remote rm origin | ||
``` | ||
and run: | ||
```bash | ||
npm install | ||
npm start | ||
``` | ||
To build the component for production, run: | ||
```bash | ||
npm run build | ||
``` | ||
To run the unit tests for the components, run: | ||
```bash | ||
npm test | ||
``` | ||
Need help? Check out our docs [here](https://stenciljs.com/docs/my-first-component). | ||
## Naming Components | ||
When creating new component tags, we recommend _not_ using `stencil` in the component name (ex: `<stencil-datepicker>`). This is because the generated component has little to nothing to do with Stencil; it's just a web component! | ||
Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the Ionic generated web components use the prefix `ion`. | ||
## Using this component | ||
There are three strategies we recommend for using web components built with Stencil. | ||
The first step for all three of these strategies is to [publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages). | ||
### Script tag | ||
- Put a script tag similar to this `<script type='module' src='https://unpkg.com/my-component@0.0.1/dist/my-component.esm.js'></script>` in the head of your index.html | ||
- Then you can use the element anywhere in your template, JSX, html etc | ||
### Node Modules | ||
- Run `npm install my-component --save` | ||
- Put a script tag similar to this `<script type='module' src='node_modules/my-component/dist/my-component.esm.js'></script>` in the head of your index.html | ||
- Then you can use the element anywhere in your template, JSX, html etc | ||
### In a stencil-starter app | ||
- Run `npm install my-component --save` | ||
- Add an import to the npm packages `import my-component;` | ||
- Then you can use the element anywhere in your template, JSX, html etc | ||
### 这是一个垮框架性质的UI库 |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
611524
101
0
12229
5
1
1
3