nodality 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animator.cjs.js +1 -0
- package/dist/animator.esm.js +1 -0
- package/dist/audionew.cjs.js +1 -0
- package/dist/audionew.esm.js +1 -0
- package/dist/base.cjs.js +1 -0
- package/dist/base.esm.js +1 -0
- package/dist/betaDesktopBar.esm.js +1 -0
- package/dist/betaMobileBar.esm.js +1 -0
- package/dist/bundle.umd.js +1 -0
- package/dist/button.cjs.js +1 -0
- package/dist/button.esm.js +1 -0
- package/dist/cardGetter.cjs.js +1 -0
- package/dist/cardGetter.esm.js +1 -0
- package/dist/center.cjs.js +1 -0
- package/dist/center.esm.js +1 -0
- package/dist/checkbox.cjs.js +1 -0
- package/dist/checkbox.esm.js +1 -0
- package/dist/code.cjs.js +1 -0
- package/dist/code.esm.js +1 -0
- package/dist/container.cjs.js +1 -0
- package/dist/container.esm.js +1 -0
- package/dist/datalist.cjs.js +1 -0
- package/dist/datalist.esm.js +1 -0
- package/dist/designer.cjs.js +1 -0
- package/dist/designer.esm.js +1 -0
- package/dist/dropdown.cjs.js +1 -0
- package/dist/dropdown.esm.js +1 -0
- package/dist/elementMapper.cjs.js +1 -0
- package/dist/elementMapper.esm.js +1 -0
- package/dist/finalresult.esm.js +1 -0
- package/dist/flexCard.cjs.js +1 -0
- package/dist/flexCard.esm.js +1 -0
- package/dist/flexGrid.cjs.js +1 -0
- package/dist/flexGrid.esm.js +1 -0
- package/dist/flexRow.cjs.js +1 -0
- package/dist/flexRow.esm.js +1 -0
- package/dist/floatingInput.cjs.js +1 -0
- package/dist/floatingInput.esm.js +1 -0
- package/dist/free.cjs.js +1 -0
- package/dist/free.esm.js +1 -0
- package/dist/horizontalScroller.esm.js +1 -0
- package/dist/image.cjs.js +1 -0
- package/dist/image.esm.js +1 -0
- package/dist/imagePicker.cjs.js +1 -0
- package/dist/imagePicker.esm.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.esm.js +1 -0
- package/dist/link.cjs.js +1 -0
- package/dist/link.esm.js +1 -0
- package/dist/linkGetter.cjs.js +1 -0
- package/dist/linkGetter.esm.js +1 -0
- package/dist/metaAdder.cjs.js +1 -0
- package/dist/metaAdder.esm.js +1 -0
- package/dist/modal2025.cjs.js +1 -0
- package/dist/modal2025.esm.js +1 -0
- package/dist/multiswitchers.esm.js +1 -0
- package/dist/newNavBar.cjs.js +1 -0
- package/dist/newNavBar.esm.js +1 -0
- package/dist/picker.cjs.js +1 -0
- package/dist/picker.esm.js +1 -0
- package/dist/progress.cjs.js +1 -0
- package/dist/progress.esm.js +1 -0
- package/dist/radio.cjs.js +1 -0
- package/dist/radio.esm.js +1 -0
- package/dist/range.cjs.js +1 -0
- package/dist/range.esm.js +1 -0
- package/dist/sideBar.cjs.js +1 -0
- package/dist/sideBar.esm.js +1 -0
- package/dist/sideNavBar.cjs.js +1 -0
- package/dist/sideNavBar.esm.js +1 -0
- package/dist/simpleBar.cjs.js +1 -0
- package/dist/simpleBar.esm.js +1 -0
- package/dist/stack.cjs.js +1 -0
- package/dist/stack.esm.js +1 -0
- package/dist/table.cjs.js +1 -0
- package/dist/table.esm.js +1 -0
- package/dist/text.cjs.js +1 -0
- package/dist/text.esm.js +1 -0
- package/dist/textField.cjs.js +1 -0
- package/dist/textField.esm.js +1 -0
- package/dist/wrap.cjs.js +1 -0
- package/dist/wrap.esm.js +1 -0
- package/dist/zoomCard.cjs.js +1 -0
- package/dist/zoomCard.esm.js +1 -0
- package/layout/<head> +59 -0
- package/layout/DEADJOE +49 -0
- package/layout/DEPRECATED-PARAGRAPH.js +103 -0
- package/layout/animator.js +1915 -0
- package/layout/audio.js +145 -0
- package/layout/audionew.js +70 -0
- package/layout/base-2.js +92 -0
- package/layout/base.js +161 -0
- package/layout/betaDesktopBar.js +126 -0
- package/layout/betaMobileBar.js +293 -0
- package/layout/box.js +29 -0
- package/layout/button.js +516 -0
- package/layout/cards.js +136 -0
- package/layout/center.js +143 -0
- package/layout/checkbox.js +183 -0
- package/layout/cleanRow.js +775 -0
- package/layout/code.js +60 -0
- package/layout/container.js +1005 -0
- package/layout/custom.js +289 -0
- package/layout/divImage.js +209 -0
- package/layout/dropdown.js +154 -0
- package/layout/dropdown2025.js +152 -0
- package/layout/edit.sh +39 -0
- package/layout/emptyElement.js +21 -0
- package/layout/externalStylesheet.js +19 -0
- package/layout/flexCard.js +220 -0
- package/layout/flexGrid.js +192 -0
- package/layout/flexrow.js +866 -0
- package/layout/footer.js +83 -0
- package/layout/formComponents/custom.js +0 -0
- package/layout/formComponents/dataList.js +183 -0
- package/layout/formComponents/edit.sh +39 -0
- package/layout/formComponents/floatingInput.js +163 -0
- package/layout/formComponents/form-all.js +161 -0
- package/layout/formComponents/form.js +76 -0
- package/layout/formComponents/imagePicker.js +266 -0
- package/layout/formComponents/picker.js +208 -0
- package/layout/formComponents/radio.js +231 -0
- package/layout/formComponents/radiogroup.js +231 -0
- package/layout/formComponents/range.js +158 -0
- package/layout/free.js +232 -0
- package/layout/grid-new.js +299 -0
- package/layout/grid.js +190 -0
- package/layout/gridSwitcher.js +188 -0
- package/layout/group.js +163 -0
- package/layout/header.js +175 -0
- package/layout/hello.html +126 -0
- package/layout/horizontalScroller.js +222 -0
- package/layout/image-old.js +487 -0
- package/layout/image.js +1039 -0
- package/layout/index.js +183 -0
- package/layout/label.js +50 -0
- package/layout/link.js +1085 -0
- package/layout/list-OLD.js +0 -0
- package/layout/list.js +127 -0
- package/layout/metaAdder.js +17 -0
- package/layout/modal2025.js +142 -0
- package/layout/modernwrap.js +92 -0
- package/layout/multiswitcher.js +224 -0
- package/layout/multiswitcherBeta.js +63 -0
- package/layout/navBar-OLD.js +261 -0
- package/layout/navBar.js +371 -0
- package/layout/navFactor/customDiv.js +60 -0
- package/layout/navFactor/edit.sh +39 -0
- package/layout/newFlatAdder.js +41 -0
- package/layout/newNavBar copy 2.js +915 -0
- package/layout/newNavBar copy.js +774 -0
- package/layout/newNavBar.js +925 -0
- package/layout/offsetContainer.js +395 -0
- package/layout/progress.js +111 -0
- package/layout/remWin.sh +20 -0
- package/layout/row.js +208 -0
- package/layout/savedNewNavBar.js +437 -0
- package/layout/scrollvideo.js +120 -0
- package/layout/sideBar.js +183 -0
- package/layout/sideNavBar.js +313 -0
- package/layout/simpleBar.js +25 -0
- package/layout/slider2025.js +198 -0
- package/layout/spacer.js +44 -0
- package/layout/stack.js +76 -0
- package/layout/styler.js +113 -0
- package/layout/switcher.js +102 -0
- package/layout/table.js +155 -0
- package/layout/text.js +1685 -0
- package/layout/textField.js +282 -0
- package/layout/ulist.js +147 -0
- package/layout/video.js +70 -0
- package/layout/withoutNew.js +60 -0
- package/layout/wrap.js +140 -0
- package/layout/zoomCard.js +219 -0
- package/lib/cardGetter.js +80 -0
- package/lib/designer.js +875 -0
- package/lib/elementMapper.js +1428 -0
- package/lib/linkGetter.js +202 -0
- package/package.json +33 -0
package/layout/center.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import {Animator} from "./animator.js";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Center {
|
|
5
|
+
constructor(id){
|
|
6
|
+
// alert("RENAME CONTAINER IN CENTER.js");
|
|
7
|
+
this.setup(id);
|
|
8
|
+
}
|
|
9
|
+
setup(id){
|
|
10
|
+
let el = document.createElement("div");
|
|
11
|
+
|
|
12
|
+
if (id){
|
|
13
|
+
el.setAttribute("id", id);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
el.style.display = "flex";
|
|
17
|
+
el.style.flexDirection = "column";
|
|
18
|
+
el.style.justifyContent = "center";
|
|
19
|
+
el.style.alignItems = "center";
|
|
20
|
+
el.style.width = "100%";
|
|
21
|
+
el.style.height = "auto";
|
|
22
|
+
el.style.margin = 0;
|
|
23
|
+
el.style.padding = 0;
|
|
24
|
+
this.res = el;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
toCode(){
|
|
28
|
+
return [""]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
items(els){
|
|
33
|
+
for (var i = 0; i < els.length; i++){
|
|
34
|
+
let item = els[i].render();//.render();
|
|
35
|
+
this.res.appendChild(item);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
itemWidth(w){
|
|
42
|
+
for (var i = 0; i < this.res.childNodes.length; i++){
|
|
43
|
+
let el = this.res.childNodes[i];
|
|
44
|
+
el.style.width = w;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
margin(L, T, R, B) {
|
|
52
|
+
if (L || T || R || B){ // CAUGHT MYSELF
|
|
53
|
+
this.res.style.marginLeft = L;
|
|
54
|
+
this.res.style.marginTop = T;
|
|
55
|
+
this.res.style.marginRight = R;
|
|
56
|
+
this.res.style.marginBottom = B;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (!T && !R && !B){
|
|
60
|
+
alert("j")
|
|
61
|
+
this.res.style.margin = L;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
arrayPadding(arr, value) {
|
|
68
|
+
if (arr.includes("left")){
|
|
69
|
+
this.res.style.paddingLeft = value;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (arr.includes("right")){
|
|
73
|
+
this.res.style.paddingRight = value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (arr.includes("top")){
|
|
77
|
+
this.res.style.paddingTop = value;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (arr.includes("bottom")){
|
|
81
|
+
this.res.style.paddingBottom = value;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
itemWidth(w){
|
|
89
|
+
for (var i = 0; i < this.res.childNodes.length; i++){
|
|
90
|
+
let el = this.res.childNodes[i];
|
|
91
|
+
el.style.width = w;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return this;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
margin(L, T, R, B) {
|
|
99
|
+
if (L || T || R || B){ // CAUGHT MYSELF
|
|
100
|
+
this.res.style.marginLeft = L;
|
|
101
|
+
this.res.style.marginTop = T;
|
|
102
|
+
this.res.style.marginRight = R;
|
|
103
|
+
this.res.style.marginBottom = B;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (!T && !R && !B){
|
|
107
|
+
alert("j")
|
|
108
|
+
this.res.style.margin = L;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/*arrayPadding(arr, value) {
|
|
115
|
+
if (arr.includes("left")){
|
|
116
|
+
this.res.style.paddingLeft = value;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (arr.includes("right")){
|
|
120
|
+
this.res.style.paddingRight = value;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (arr.includes("top")){
|
|
124
|
+
this.res.style.paddingTop = value;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (arr.includes("bottom")){
|
|
128
|
+
this.res.style.paddingBottom = value;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
return this;
|
|
133
|
+
}*/
|
|
134
|
+
|
|
135
|
+
render(el) {
|
|
136
|
+
if (el) {
|
|
137
|
+
document.querySelector(el).appendChild(this.res);
|
|
138
|
+
} else {
|
|
139
|
+
return this.res;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
export { Center };
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { Animator } from "./animator.js";
|
|
2
|
+
|
|
3
|
+
class Checkbox extends Animator {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.el = null;
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
set(obj) {
|
|
12
|
+
this.options = obj;
|
|
13
|
+
|
|
14
|
+
// Set default clipPath if not provided
|
|
15
|
+
//this.options.clipPath =
|
|
16
|
+
// this.options.clipPath; //|| "polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%)";
|
|
17
|
+
|
|
18
|
+
// Create the container div
|
|
19
|
+
const div = document.createElement("div");
|
|
20
|
+
div.style.display = "flex";
|
|
21
|
+
div.style.alignItems = "center";
|
|
22
|
+
|
|
23
|
+
// Create the checkbox input
|
|
24
|
+
const input = document.createElement("input");
|
|
25
|
+
input.type = "checkbox";
|
|
26
|
+
input.style.position = "relative";
|
|
27
|
+
input.style.marginRight = "0.5rem";
|
|
28
|
+
|
|
29
|
+
// Set size and custom appearance
|
|
30
|
+
const size = obj.size || "24px";
|
|
31
|
+
input.style.width = size;
|
|
32
|
+
input.style.height = size;
|
|
33
|
+
|
|
34
|
+
if (obj.customStyle){
|
|
35
|
+
input.style.appearance = "none";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
input.style.border = "2px solid #ccc";
|
|
39
|
+
input.style.borderRadius = "4px";
|
|
40
|
+
input.style.backgroundColor = obj.backgroundColor || "white";
|
|
41
|
+
input.style.cursor = "pointer";
|
|
42
|
+
input.style.transition = "background-color 0.2s ease, border-color 0.2s ease";
|
|
43
|
+
|
|
44
|
+
// Custom checkmark via ::after
|
|
45
|
+
input.style.display = "inline-block";
|
|
46
|
+
input.style.setProperty("--checked-bg-color", obj.checkedBackgroundColor || "#4CAF50");
|
|
47
|
+
input.style.setProperty("--checkmark-color", "white");
|
|
48
|
+
input.style.setProperty("--checkmark-clip-path", this.options.clipPath ?? "polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%)");
|
|
49
|
+
|
|
50
|
+
const style = document.createElement("style");
|
|
51
|
+
style.textContent = `
|
|
52
|
+
input[type="checkbox"] {
|
|
53
|
+
appearance: none;
|
|
54
|
+
-webkit-appearance: none; /* For Safari */
|
|
55
|
+
width: var(--size, 24px);
|
|
56
|
+
height: var(--size, 24px);
|
|
57
|
+
border: 2px solid #ccc;
|
|
58
|
+
border-radius: 4px;
|
|
59
|
+
background-color: white;
|
|
60
|
+
position: relative;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
transition: background-color 0.2s ease, border-color 0.2s ease;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
input[type="checkbox"]:checked {
|
|
66
|
+
background-color: var(--checked-bg-color, #4CAF50);
|
|
67
|
+
border-color: var(--checked-bg-color, #4CAF50);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
input[type="checkbox"]::after {
|
|
71
|
+
content: '';
|
|
72
|
+
position: absolute;
|
|
73
|
+
width: 50%;
|
|
74
|
+
height: 50%;
|
|
75
|
+
top: 25%;
|
|
76
|
+
left: 25%;
|
|
77
|
+
transform: scale(0);
|
|
78
|
+
background-color: var(--checkmark-color, white);
|
|
79
|
+
clip-path: var(--checkmark-clip-path);
|
|
80
|
+
-webkit-clip-path: var(--checkmark-clip-path);
|
|
81
|
+
transition: transform 0.2s ease;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
input[type="checkbox"]:checked::after {
|
|
85
|
+
transform: scale(1);
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
if (obj.customStyle){
|
|
90
|
+
document.head.appendChild(style);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
obj.mar && this.mar(obj.mar);
|
|
94
|
+
obj.pad && this.pad(obj.pad);
|
|
95
|
+
obj.respad && this.respad(obj.respad);
|
|
96
|
+
obj.resmar && this.resmar(obj.resmar);
|
|
97
|
+
|
|
98
|
+
// Event to toggle background and border
|
|
99
|
+
input.addEventListener("change", () => {
|
|
100
|
+
if (input.checked) {
|
|
101
|
+
input.style.backgroundColor = obj.checkedBackgroundColor || "#4CAF50";
|
|
102
|
+
input.style.borderColor = obj.checkedBackgroundColor || "#4CAF50";
|
|
103
|
+
} else {
|
|
104
|
+
input.style.backgroundColor = obj.backgroundColor || "white";
|
|
105
|
+
input.style.borderColor = "#ccc";
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// Set name attribute if provided
|
|
110
|
+
if (obj.name) {
|
|
111
|
+
input.setAttribute("name", obj.name);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
div.appendChild(input);
|
|
115
|
+
|
|
116
|
+
// Add label
|
|
117
|
+
const labelDiv = document.createElement("div");
|
|
118
|
+
|
|
119
|
+
if (typeof obj.label?.render === "function") {
|
|
120
|
+
labelDiv.appendChild(obj.label.render());
|
|
121
|
+
} else {
|
|
122
|
+
const labelText = document.createTextNode(obj.title || "Label");
|
|
123
|
+
labelDiv.appendChild(labelText);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Apply label styles
|
|
127
|
+
labelDiv.style.opacity = 0.8;
|
|
128
|
+
labelDiv.style.transition = "opacity ease 0.2s, transform ease 0.2s";
|
|
129
|
+
|
|
130
|
+
div.appendChild(labelDiv);
|
|
131
|
+
|
|
132
|
+
this.el = div;
|
|
133
|
+
return this;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
getValue() {
|
|
137
|
+
return this.el.children[0].checked;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
toCode() {
|
|
141
|
+
/* let objString = JSON.stringify(this.options, null, 4);
|
|
142
|
+
objString = objString.replace(/"(\w+)"(?=\s*:)/g, '$1');
|
|
143
|
+
return [`new Checkbox().set(${objString})`];*/
|
|
144
|
+
|
|
145
|
+
const entries = Object.entries(this.options)
|
|
146
|
+
.map(([key, value]) => {
|
|
147
|
+
if (typeof value === "string") {
|
|
148
|
+
return `${key}: "${value}"`; // Wrap strings in quotes
|
|
149
|
+
} else if (typeof value === "object" && value !== null) {
|
|
150
|
+
if (typeof value.toCode === "function") {
|
|
151
|
+
// Call the object's toCode method if available
|
|
152
|
+
return `${key}: ${value.toCode()[0]}`;
|
|
153
|
+
} else {
|
|
154
|
+
// Fallback for plain objects
|
|
155
|
+
return `${key}: ${JSON.stringify(value, null, 4)}`;
|
|
156
|
+
}
|
|
157
|
+
} else {
|
|
158
|
+
return `${key}: ${value}`; // Handle numbers, booleans, etc.
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
.join(",\n ");
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
return [`new Checkbox().set({\n ${entries}\n})`];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
margin(amount) {
|
|
168
|
+
this.el.style.margin = amount;
|
|
169
|
+
return this;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
render(div) {
|
|
173
|
+
if (div) {
|
|
174
|
+
document.querySelector(div).appendChild(this.el);
|
|
175
|
+
} else {
|
|
176
|
+
return this.el;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Export the class
|
|
182
|
+
window.Checkbox = Checkbox;
|
|
183
|
+
export { Checkbox };
|