-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to main from @ hellof2e/quark-design@fd8285b 🚀
- Loading branch information
Showing
125 changed files
with
57,842 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { L as Locale, d as defineComponent } from "./mobile.d5f0d4bc.js"; | ||
const isFunction = (val) => typeof val === "function"; | ||
const getPropByPath = (obj, keyPath) => { | ||
try { | ||
return keyPath.split(".").reduce((prev, curr) => prev[curr], obj); | ||
} catch (error) { | ||
return ""; | ||
} | ||
}; | ||
function createComponent(name) { | ||
const componentName = "quark-" + name; | ||
return { | ||
componentName, | ||
translate(keyPath, ...args) { | ||
const languages = Locale.languages(); | ||
const text = getPropByPath(languages, `${name.replace("-", "")}.${keyPath}`) || getPropByPath(languages, keyPath); | ||
return isFunction(text) ? text(...args) : text; | ||
}, | ||
createDemo: function(_component) { | ||
_component.baseName = name; | ||
_component.name = "demo-" + name; | ||
return defineComponent(_component); | ||
} | ||
}; | ||
} | ||
export { createComponent as c }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.