Premier commit déjà bien avancé
This commit is contained in:
19
frontend/node_modules/crelt/LICENSE
generated
vendored
Normal file
19
frontend/node_modules/crelt/LICENSE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (C) 2020 by Marijn Haverbeke <marijn@haverbeke.berlin>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
23
frontend/node_modules/crelt/README.md
generated
vendored
Normal file
23
frontend/node_modules/crelt/README.md
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
# CRELT
|
||||
|
||||
Tiny DOM-element creation utility. Exports a single (default) value,
|
||||
which is a function that you call with:
|
||||
|
||||
- A tag name string or DOM element.
|
||||
|
||||
- Optionally an attribute object mapping names to values. When the
|
||||
values are strings, they are added to the element with
|
||||
`setAttribute`. When they have another type, they are assigned as
|
||||
regular properties (mostly useful for event handlers via `onclick`
|
||||
and such). When an attribute's value is null or undefined, it is
|
||||
not assigned.
|
||||
|
||||
- Any number of children, which may be null (ignored), strings (added
|
||||
as text nodes), DOM nodes (added), or arrays (each element is added
|
||||
separately).
|
||||
|
||||
The function returns a DOM element.
|
||||
|
||||
## License
|
||||
|
||||
This software is licensed under an MIT license.
|
||||
31
frontend/node_modules/crelt/dist/index.cjs
generated
vendored
Normal file
31
frontend/node_modules/crelt/dist/index.cjs
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
function crelt() {
|
||||
var elt = arguments[0];
|
||||
if (typeof elt == "string") elt = document.createElement(elt);
|
||||
var i = 1, next = arguments[1];
|
||||
if (next && typeof next == "object" && next.nodeType == null && !Array.isArray(next)) {
|
||||
for (var name in next) if (Object.prototype.hasOwnProperty.call(next, name)) {
|
||||
var value = next[name];
|
||||
if (typeof value == "string") elt.setAttribute(name, value);
|
||||
else if (value != null) elt[name] = value;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
for (; i < arguments.length; i++) add(elt, arguments[i]);
|
||||
return elt
|
||||
}
|
||||
|
||||
function add(elt, child) {
|
||||
if (typeof child == "string") {
|
||||
elt.appendChild(document.createTextNode(child));
|
||||
} else if (child == null) ; else if (child.nodeType != null) {
|
||||
elt.appendChild(child);
|
||||
} else if (Array.isArray(child)) {
|
||||
for (var i = 0; i < child.length; i++) add(elt, child[i]);
|
||||
} else {
|
||||
throw new RangeError("Unsupported child node: " + child)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = crelt;
|
||||
4
frontend/node_modules/crelt/dist/index.d.cts
generated
vendored
Normal file
4
frontend/node_modules/crelt/dist/index.d.cts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
type Child = string | Node | null | undefined | readonly Child[]
|
||||
|
||||
export default function crelt(elt: string | HTMLElement, attrs: {[attr: string]: any}, ...children: Child[]): HTMLElement
|
||||
export default function crelt(elt: string | HTMLElement, ...children: Child[]): HTMLElement
|
||||
4
frontend/node_modules/crelt/index.d.ts
generated
vendored
Normal file
4
frontend/node_modules/crelt/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
type Child = string | Node | null | undefined | readonly Child[]
|
||||
|
||||
export default function crelt(elt: string | HTMLElement, attrs: {[attr: string]: any}, ...children: Child[]): HTMLElement
|
||||
export default function crelt(elt: string | HTMLElement, ...children: Child[]): HTMLElement
|
||||
28
frontend/node_modules/crelt/index.js
generated
vendored
Normal file
28
frontend/node_modules/crelt/index.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
export default function crelt() {
|
||||
var elt = arguments[0]
|
||||
if (typeof elt == "string") elt = document.createElement(elt)
|
||||
var i = 1, next = arguments[1]
|
||||
if (next && typeof next == "object" && next.nodeType == null && !Array.isArray(next)) {
|
||||
for (var name in next) if (Object.prototype.hasOwnProperty.call(next, name)) {
|
||||
var value = next[name]
|
||||
if (typeof value == "string") elt.setAttribute(name, value)
|
||||
else if (value != null) elt[name] = value
|
||||
}
|
||||
i++
|
||||
}
|
||||
for (; i < arguments.length; i++) add(elt, arguments[i])
|
||||
return elt
|
||||
}
|
||||
|
||||
function add(elt, child) {
|
||||
if (typeof child == "string") {
|
||||
elt.appendChild(document.createTextNode(child))
|
||||
} else if (child == null) {
|
||||
} else if (child.nodeType != null) {
|
||||
elt.appendChild(child)
|
||||
} else if (Array.isArray(child)) {
|
||||
for (var i = 0; i < child.length; i++) add(elt, child[i])
|
||||
} else {
|
||||
throw new RangeError("Unsupported child node: " + child)
|
||||
}
|
||||
}
|
||||
35
frontend/node_modules/crelt/package.json
generated
vendored
Normal file
35
frontend/node_modules/crelt/package.json
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "crelt",
|
||||
"version": "1.0.6",
|
||||
"description": "Tiny DOM-element-creation utility",
|
||||
"main": "dist/index.cjs",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"import": "./index.js",
|
||||
"require": "./dist/index.cjs"
|
||||
},
|
||||
"module": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"scripts": {
|
||||
"prepare": "rollup -c"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/marijnh/crelt.git"
|
||||
},
|
||||
"keywords": [
|
||||
"dom",
|
||||
"creation",
|
||||
"crel"
|
||||
],
|
||||
"author": "Marijn Haverbeke <marijn@haverbeke.berlin>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/marijnh/crelt/issues"
|
||||
},
|
||||
"homepage": "https://github.com/marijnh/crelt#readme",
|
||||
"devDependencies": {
|
||||
"rollup": "^2.0.5",
|
||||
"rollup-plugin-copy": "^3.4.0"
|
||||
}
|
||||
}
|
||||
13
frontend/node_modules/crelt/rollup.config.js
generated
vendored
Normal file
13
frontend/node_modules/crelt/rollup.config.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
import copy from "rollup-plugin-copy"
|
||||
|
||||
export default {
|
||||
input: "index.js",
|
||||
output: {
|
||||
file: "dist/index.cjs",
|
||||
format: "cjs",
|
||||
exports: "default"
|
||||
},
|
||||
plugins: [
|
||||
copy({targets: [{src: "index.d.ts", dest: "dist", rename: () => "index.d.cts"}]})
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user