juxscript 1.1.308 → 1.1.310
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/lib/components/input.d.ts +13 -0
- package/dist/lib/components/input.d.ts.map +1 -1
- package/dist/lib/components/input.js +47 -0
- package/dist/lib/index.d.ts +14 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +14 -1
- package/dist/lib/state/pageState.d.ts.map +1 -1
- package/dist/lib/state/pageState.js +10 -0
- package/package.json +1 -1
|
@@ -41,5 +41,18 @@ declare class Input {
|
|
|
41
41
|
render(target?: string | HTMLElement): this;
|
|
42
42
|
}
|
|
43
43
|
export declare function input(id: string, options?: InputOptions): Input;
|
|
44
|
+
export declare function email(id: string, options?: InputOptions): Input;
|
|
45
|
+
export declare function password(id: string, options?: InputOptions): Input;
|
|
46
|
+
export declare function number(id: string, options?: InputOptions): Input;
|
|
47
|
+
export declare function tel(id: string, options?: InputOptions): Input;
|
|
48
|
+
export declare function url(id: string, options?: InputOptions): Input;
|
|
49
|
+
export declare function search(id: string, options?: InputOptions): Input;
|
|
50
|
+
export declare function date(id: string, options?: InputOptions): Input;
|
|
51
|
+
export declare function time(id: string, options?: InputOptions): Input;
|
|
52
|
+
export declare function datetime(id: string, options?: InputOptions): Input;
|
|
53
|
+
export declare function color(id: string, options?: InputOptions): Input;
|
|
54
|
+
export declare function range(id: string, options?: InputOptions): Input;
|
|
55
|
+
export declare function file(id: string, options?: InputOptions): Input;
|
|
56
|
+
export declare function hidden(id: string, options?: InputOptions): Input;
|
|
44
57
|
export { Input, InputOptions };
|
|
45
58
|
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../lib/components/input.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../lib/components/input.ts"],"names":[],"mappings":"AAIA,KAAK,S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IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,KAAK,CAElE;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,KAAK,CAElE;AAED,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,KAAK,CAEtE;AAED,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,KAAK,CAEnE;AAED,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,KAAK,CAEnE;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,KAAK,CAElE;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,KAAK,CAEpE;AAED,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import generateId from '../utils/idgen.js';
|
|
2
|
+
import niceName from '../utils/niceName.js';
|
|
2
3
|
import { pageState } from '../state/pageState.js';
|
|
3
4
|
class Input {
|
|
4
5
|
constructor(id, options = {}) {
|
|
@@ -10,6 +11,10 @@ class Input {
|
|
|
10
11
|
type: 'text',
|
|
11
12
|
...options
|
|
12
13
|
};
|
|
14
|
+
// Auto-generate label from ID if not provided
|
|
15
|
+
if (!this.options.label && this.id) {
|
|
16
|
+
this.options.label = niceName(this.id);
|
|
17
|
+
}
|
|
13
18
|
}
|
|
14
19
|
// Fluent API
|
|
15
20
|
type(value) { this.options.type = value; return this; }
|
|
@@ -111,4 +116,46 @@ export function input(id, options = {}) {
|
|
|
111
116
|
pageState.__register(inp);
|
|
112
117
|
return inp;
|
|
113
118
|
}
|
|
119
|
+
// ═══════════════════════════════════════════════════════════════
|
|
120
|
+
// TYPE-SPECIFIC FACTORY METHODS
|
|
121
|
+
// ═══════════════════════════════════════════════════════════════
|
|
122
|
+
export function email(id, options = {}) {
|
|
123
|
+
return input(id, { placeholder: 'name@example.com', autocomplete: 'email', ...options, type: 'email' });
|
|
124
|
+
}
|
|
125
|
+
export function password(id, options = {}) {
|
|
126
|
+
return input(id, { placeholder: '••••••••', autocomplete: 'current-password', ...options, type: 'password' });
|
|
127
|
+
}
|
|
128
|
+
export function number(id, options = {}) {
|
|
129
|
+
return input(id, { placeholder: '0', ...options, type: 'number' });
|
|
130
|
+
}
|
|
131
|
+
export function tel(id, options = {}) {
|
|
132
|
+
return input(id, { placeholder: '+1 (555) 000-0000', autocomplete: 'tel', ...options, type: 'tel' });
|
|
133
|
+
}
|
|
134
|
+
export function url(id, options = {}) {
|
|
135
|
+
return input(id, { placeholder: 'https://', autocomplete: 'url', ...options, type: 'url' });
|
|
136
|
+
}
|
|
137
|
+
export function search(id, options = {}) {
|
|
138
|
+
return input(id, { placeholder: 'Search...', ...options, type: 'search' });
|
|
139
|
+
}
|
|
140
|
+
export function date(id, options = {}) {
|
|
141
|
+
return input(id, { ...options, type: 'date' });
|
|
142
|
+
}
|
|
143
|
+
export function time(id, options = {}) {
|
|
144
|
+
return input(id, { ...options, type: 'time' });
|
|
145
|
+
}
|
|
146
|
+
export function datetime(id, options = {}) {
|
|
147
|
+
return input(id, { ...options, type: 'datetime-local' });
|
|
148
|
+
}
|
|
149
|
+
export function color(id, options = {}) {
|
|
150
|
+
return input(id, { ...options, type: 'color' });
|
|
151
|
+
}
|
|
152
|
+
export function range(id, options = {}) {
|
|
153
|
+
return input(id, { min: '0', max: '100', ...options, type: 'range' });
|
|
154
|
+
}
|
|
155
|
+
export function file(id, options = {}) {
|
|
156
|
+
return input(id, { ...options, type: 'file' });
|
|
157
|
+
}
|
|
158
|
+
export function hidden(id, options = {}) {
|
|
159
|
+
return input(id, { ...options, type: 'hidden' });
|
|
160
|
+
}
|
|
114
161
|
export { Input };
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tag, div, h1, h2, h3, h4, h5, h6, p, span, pre, code } from "./components/tag.js";
|
|
2
2
|
import { include } from "./components/include.js";
|
|
3
|
-
import { input } from "./components/input.js";
|
|
3
|
+
import { input, email, password, number, tel, url, search, date, time, datetime, color, range, file, hidden } from "./components/input.js";
|
|
4
4
|
import { select } from "./components/select.js";
|
|
5
5
|
import { radio } from "./components/radio.js";
|
|
6
6
|
import { checkbox, checkboxGroup } from "./components/checkbox.js";
|
|
@@ -31,6 +31,19 @@ export declare const jux: {
|
|
|
31
31
|
code: typeof code;
|
|
32
32
|
include: typeof include;
|
|
33
33
|
input: typeof input;
|
|
34
|
+
email: typeof email;
|
|
35
|
+
password: typeof password;
|
|
36
|
+
number: typeof number;
|
|
37
|
+
tel: typeof tel;
|
|
38
|
+
url: typeof url;
|
|
39
|
+
search: typeof search;
|
|
40
|
+
date: typeof date;
|
|
41
|
+
time: typeof time;
|
|
42
|
+
datetime: typeof datetime;
|
|
43
|
+
color: typeof color;
|
|
44
|
+
range: typeof range;
|
|
45
|
+
file: typeof file;
|
|
46
|
+
hidden: typeof hidden;
|
|
34
47
|
select: typeof select;
|
|
35
48
|
radio: typeof radio;
|
|
36
49
|
checkbox: typeof checkbox;
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+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CAAC,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCf,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tag, div, h1, h2, h3, h4, h5, h6, p, span, pre, code } from "./components/tag.js";
|
|
2
2
|
import { include } from "./components/include.js";
|
|
3
|
-
import { input } from "./components/input.js";
|
|
3
|
+
import { input, email, password, number, tel, url, search, date, time, datetime, color, range, file, hidden } from "./components/input.js";
|
|
4
4
|
import { select } from "./components/select.js";
|
|
5
5
|
import { radio } from "./components/radio.js";
|
|
6
6
|
import { checkbox, checkboxGroup } from "./components/checkbox.js";
|
|
@@ -26,6 +26,19 @@ export const jux = {
|
|
|
26
26
|
code,
|
|
27
27
|
include,
|
|
28
28
|
input,
|
|
29
|
+
email,
|
|
30
|
+
password,
|
|
31
|
+
number,
|
|
32
|
+
tel,
|
|
33
|
+
url,
|
|
34
|
+
search,
|
|
35
|
+
date,
|
|
36
|
+
time,
|
|
37
|
+
datetime,
|
|
38
|
+
color,
|
|
39
|
+
range,
|
|
40
|
+
file,
|
|
41
|
+
hidden,
|
|
29
42
|
select,
|
|
30
43
|
radio,
|
|
31
44
|
checkbox,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageState.d.ts","sourceRoot":"","sources":["../../../lib/state/pageState.ts"],"names":[],"mappings":"AAeA,cAAM,SAAS;IACX,OAAO,CAAC,SAAS,CAA0C;IAC3D,OAAO,CAAC,MAAM,CAAsB;IAEpC,MAAM,CAAC,QAAQ,CAAC,WAAW,mKAQhB;;IA+BX,OAAO,CAAC,qBAAqB;
|
|
1
|
+
{"version":3,"file":"pageState.d.ts","sourceRoot":"","sources":["../../../lib/state/pageState.ts"],"names":[],"mappings":"AAeA,cAAM,SAAS;IACX,OAAO,CAAC,SAAS,CAA0C;IAC3D,OAAO,CAAC,MAAM,CAAsB;IAEpC,MAAM,CAAC,QAAQ,CAAC,WAAW,mKAQhB;;IA+BX,OAAO,CAAC,qBAAqB;IAkH7B,OAAO,CAAC,SAAS;IAkEjB,OAAO,CAAC,UAAU;IAgClB,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,cAAc;IAuBtB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,OAAO;IA2Cf,OAAO,CAAC,MAAM;IAmBd,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGlC;AAID,eAAO,MAAM,SAAS,qBAAuB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -123,6 +123,14 @@ class PageState {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
+
else if (prop === 'visible') {
|
|
127
|
+
const el = this._findElement(comp);
|
|
128
|
+
// For wrapped components, toggle the wrapper
|
|
129
|
+
const target = comp._wrapper instanceof HTMLElement ? comp._wrapper : el;
|
|
130
|
+
if (target) {
|
|
131
|
+
target.style.display = value ? '' : 'none';
|
|
132
|
+
}
|
|
133
|
+
}
|
|
126
134
|
// Update tracked props
|
|
127
135
|
entry.props[prop] = value;
|
|
128
136
|
// Notify listeners
|
|
@@ -161,6 +169,8 @@ class PageState {
|
|
|
161
169
|
entry.props.content = component.getContent();
|
|
162
170
|
if (component.getValues)
|
|
163
171
|
entry.props.values = component.getValues();
|
|
172
|
+
// Seed visibility — default true
|
|
173
|
+
entry.props.visible = true;
|
|
164
174
|
if (component.opts || component.options) {
|
|
165
175
|
const opts = component.opts || component.options;
|
|
166
176
|
if ('disabled' in opts)
|