builder-settings-types 0.0.10 → 0.0.11
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class r{constructor(t){this.title=t.title,this.settings=t.settings,Object.assign(this,t.settings)}}const o=Object.freeze(Object.defineProperty({__proto__:null,SettingGroup:r},Symbol.toStringTag,{value:"Module"}));class l{constructor(t={}){this.props=t,this.title=t.title||"Setting",this.value=t.defaultValue}defaultDraw(){const t=document.createElement("div"),e=document.createElement("label");e.textContent=this.title??"";const s=document.createElement("input");return s.type=this.inputType,s.placeholder=this.props.placeholder||`Enter ${this.title}`,s.value=this.value!==void 0?String(this.value):"",t.appendChild(e),t.appendChild(s),t}}class i extends l{constructor(t={}){super(t),this.props=t,this.inputType="number"}draw(){const t=super.defaultDraw(),e=t.querySelector("input");return this.props.minValue!==void 0&&(e.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(e.max=String(this.props.maxValue)),this.props.className&&e.classList.add(this.props.className),t}}const a=Object.freeze(Object.defineProperty({__proto__:null,NumberSetting:i},Symbol.toStringTag,{value:"Module"}));class g extends r{constructor(){super({title:"Margin",settings:{margin:new i({title:"Margin All"}),marginTop:new i({title:"Margin Top"}),marginRight:new i({title:"Margin Right"}),marginBottom:new i({title:"Margin Bottom"}),marginLeft:new i({title:"Margin Left"})}})}getCssCode(){return`
|
|
2
2
|
margin-botton: ${this.settings.marginBottom.value}px;
|
|
3
3
|
margin-top: ${this.settings.marginTop.value}px;
|
|
4
4
|
margin-right: ${this.settings.marginRight.value}px;
|
|
5
5
|
margin-left: ${this.settings.marginLeft.value}px;
|
|
6
|
-
`}}const
|
|
6
|
+
`}}const u=Object.freeze(Object.defineProperty({__proto__:null,MarginSetting:g},Symbol.toStringTag,{value:"Module"}));class p extends l{constructor(t={}){super(t),this.inputType="text"}draw(){return super.defaultDraw()}}const c=Object.freeze(Object.defineProperty({__proto__:null,StringSetting:p},Symbol.toStringTag,{value:"Module"}));function m(){console.log("logg yes fixed")}const d={SettingGroup:r,settingsGroup:o,marginSettings:u,numberSettings:a,stringSettings:c};exports.default=d;exports.logger=m;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
class r {
|
|
2
|
+
constructor(t) {
|
|
3
|
+
this.title = t.title, this.settings = t.settings, Object.assign(this, t.settings);
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
const o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7
|
+
__proto__: null,
|
|
8
|
+
SettingGroup: r
|
|
9
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
10
|
+
class l {
|
|
2
11
|
constructor(t = {}) {
|
|
3
12
|
this.props = t, this.title = t.title || "Setting", this.value = t.defaultValue;
|
|
4
13
|
}
|
|
@@ -9,20 +18,7 @@ class r {
|
|
|
9
18
|
return s.type = this.inputType, s.placeholder = this.props.placeholder || `Enter ${this.title}`, s.value = this.value !== void 0 ? String(this.value) : "", t.appendChild(e), t.appendChild(s), t;
|
|
10
19
|
}
|
|
11
20
|
}
|
|
12
|
-
|
|
13
|
-
__proto__: null,
|
|
14
|
-
Setting: r
|
|
15
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
16
|
-
class l {
|
|
17
|
-
constructor(t) {
|
|
18
|
-
this.title = t.title, this.settings = t.settings, Object.assign(this, t.settings);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
22
|
-
__proto__: null,
|
|
23
|
-
SettingGroup: l
|
|
24
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
25
|
-
class i extends r {
|
|
21
|
+
class i extends l {
|
|
26
22
|
constructor(t = {}) {
|
|
27
23
|
super(t), this.props = t, this.inputType = "number";
|
|
28
24
|
}
|
|
@@ -31,11 +27,11 @@ class i extends r {
|
|
|
31
27
|
return this.props.minValue !== void 0 && (e.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (e.max = String(this.props.maxValue)), this.props.className && e.classList.add(this.props.className), t;
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
|
-
const
|
|
30
|
+
const a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
35
31
|
__proto__: null,
|
|
36
32
|
NumberSetting: i
|
|
37
33
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
38
|
-
class
|
|
34
|
+
class g extends r {
|
|
39
35
|
constructor() {
|
|
40
36
|
super({
|
|
41
37
|
title: "Margin",
|
|
@@ -57,11 +53,11 @@ class u extends l {
|
|
|
57
53
|
`;
|
|
58
54
|
}
|
|
59
55
|
}
|
|
60
|
-
const
|
|
56
|
+
const u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
61
57
|
__proto__: null,
|
|
62
|
-
MarginSetting:
|
|
58
|
+
MarginSetting: g
|
|
63
59
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
64
|
-
class
|
|
60
|
+
class p extends l {
|
|
65
61
|
constructor(t = {}) {
|
|
66
62
|
super(t), this.inputType = "text";
|
|
67
63
|
}
|
|
@@ -69,21 +65,21 @@ class c extends r {
|
|
|
69
65
|
return super.defaultDraw();
|
|
70
66
|
}
|
|
71
67
|
}
|
|
72
|
-
const
|
|
68
|
+
const c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
73
69
|
__proto__: null,
|
|
74
|
-
StringSetting:
|
|
70
|
+
StringSetting: p
|
|
75
71
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
76
|
-
function
|
|
72
|
+
function m() {
|
|
77
73
|
console.log("logg yes fixed");
|
|
78
74
|
}
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
settingsGroup:
|
|
82
|
-
marginSettings:
|
|
83
|
-
numberSettings:
|
|
84
|
-
stringSettings:
|
|
75
|
+
const d = {
|
|
76
|
+
SettingGroup: r,
|
|
77
|
+
settingsGroup: o,
|
|
78
|
+
marginSettings: u,
|
|
79
|
+
numberSettings: a,
|
|
80
|
+
stringSettings: c
|
|
85
81
|
};
|
|
86
82
|
export {
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
d as default,
|
|
84
|
+
m as logger
|
|
89
85
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
|
|
2
|
+
SettingGroup: typeof settingsGroup.SettingGroup;
|
|
3
3
|
settingsGroup: typeof settingsGroup;
|
|
4
4
|
marginSettings: typeof marginSettings;
|
|
5
5
|
numberSettings: typeof numberSettings;
|
|
@@ -56,13 +56,6 @@ declare abstract class Setting<T> {
|
|
|
56
56
|
defaultDraw(): HTMLElement;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
declare namespace setting {
|
|
60
|
-
export {
|
|
61
|
-
SettingProps,
|
|
62
|
-
Setting
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
59
|
declare class SettingGroup<T extends Record<string, Setting<any> | SettingGroup<any>>> {
|
|
67
60
|
title: string;
|
|
68
61
|
settings: T;
|
package/package.json
CHANGED