Skip to content

Commit

Permalink
Lit-HTML Tree, Branch and Leaf components
Browse files Browse the repository at this point in the history
  • Loading branch information
otus-learning committed Nov 6, 2023
1 parent e4c3b74 commit b429164
Show file tree
Hide file tree
Showing 24 changed files with 7,153 additions and 14,763 deletions.
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules
/dist
/cache
/coverage
/.github
/.husky
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ module.exports = {
rules: {
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-explicit-any": 0,
"no-import-assign": 0,
indent: ["error", 2],
// indent: ["error", 2],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
Expand Down
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules
/coverage
/.github
/.husky
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# JS-Proffessional-03-2023
# JS-Proffessional-03-2023
3 changes: 3 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
35 changes: 35 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lit-HTML tree/leaf component example</title>
<link rel="stylesheet" href="./src/index.css" />
<script type="module" src="/src/my-leaf.ts"></script>
<script type="module" src="/src/my-branch.ts"></script>
<script type="module" src="/src/my-tree.ts"></script>
<script type="module" src="/src/my-settings.ts"></script>
<script type="module" src="/src/my-app.ts"></script>
</head>
<body>
<my-app>
<my-settings></my-settings>
<div style="display: flex">
<my-tree
str='{"id": "1", "items": [{"id": "2", "items": [{ "id": "3" }, { "id": "4" }, { "id": "5", "items": [{"id" : "10"}, {"id" : "12"}, {"id" : "14", "items" : [{"id" : "15"}]}]}, {"id": "13"}]}, {"id": "6", "items": [{ "id": "7" }, { "id": "8" }, { "id": "9" }]}, { "id": "11" }] }'
>
</my-tree>

<my-tree
str='{"id": "A", "items": [{"id": "B", "items": [{ "id": "C" }, { "id": "D" }, { "id": "O" }, { "id": "P" }, { "id": "Q" }]}, { "id": "R" }, { "id": "F" }, { "id": "E" } ]}'
>
</my-tree>

<my-tree
str='{"id": "A1", "items": [{"id": "B2", "items": [{ "id": "C3" }, { "id": "D4" }]}, {"id": "E5"}, {"id": "F6"}, {"id": "J13"}, {"id": "K6", "items": [{ "id": "L7" }, { "id": "M8" }, { "id": "N9" }]}, { "id": "O11" }] }'
>
</my-tree>
</div>
</my-app>
</body>
</html>
192 changes: 0 additions & 192 deletions jest.config.js

This file was deleted.

17 changes: 17 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "jsdom",
transformIgnorePatterns: [
"node_modules/(?!(lit-html|lit-element|lit|@lit)/)",
],
transform: {
"^.+\\.(ts|tsx)?$": "ts-jest",
"^.+\\.(js|jsx)$": [
"babel-jest",
{
presets: ["@babel/preset-env"],
plugins: [["@babel/transform-runtime"]],
},
],
},
};
Loading

0 comments on commit b429164

Please sign in to comment.