@tachui/primitives 0.8.0-alpha → 0.8.5-alpha
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/{BasicInput-CWFHw9rL.js → BasicInput-BHfrSdoi.js} +46 -33
- package/dist/{Picker-DrZ7ibdt.js → Picker-DKphYduj.js} +243 -244
- package/dist/ScrollView-CBqSqatM.js +704 -0
- package/dist/Text-D0CYYD-Q.js +170 -0
- package/dist/controls/Button.d.ts +19 -28
- package/dist/controls/Button.d.ts.map +1 -1
- package/dist/controls/index.js +1 -1
- package/dist/display/HTML.d.ts +13 -13
- package/dist/display/Image.d.ts +8 -8
- package/dist/display/Image.d.ts.map +1 -1
- package/dist/display/ScrollView.d.ts +216 -0
- package/dist/display/ScrollView.d.ts.map +1 -0
- package/dist/display/Text.d.ts +37 -44
- package/dist/display/Text.d.ts.map +1 -1
- package/dist/display/index.d.ts +1 -0
- package/dist/display/index.d.ts.map +1 -1
- package/dist/display/index.js +20 -17
- package/dist/forms/BasicForm.d.ts +5 -1
- package/dist/forms/BasicForm.d.ts.map +1 -1
- package/dist/forms/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +66 -59
- package/dist/layout/Divider.d.ts +9 -3
- package/dist/layout/Divider.d.ts.map +1 -1
- package/dist/layout/Spacer.d.ts +8 -2
- package/dist/layout/Spacer.d.ts.map +1 -1
- package/dist/layout/Stack.d.ts +19 -69
- package/dist/layout/Stack.d.ts.map +1 -1
- package/dist/layout/index.js +267 -13
- package/dist/version.d.ts +14 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +6 -4
- package/dist/Divider-DWgDKavU.js +0 -474
- package/dist/HTML-aWcvQ0VC.js +0 -321
- package/dist/Text-DYyFBJ6i.js +0 -165
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { withModifiers as
|
|
2
|
-
var
|
|
3
|
-
class
|
|
1
|
+
import { withModifiers as v, createSignal as g, createEffect as c, h as p, text as y, clonePropsPreservingReactivity as x, resetLifecycleState as E, ComponentWithCSSClasses as F, isSignal as h } from "@tachui/core";
|
|
2
|
+
var C = Object.defineProperty, w = (t, e, s) => e in t ? C(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, o = (t, e, s) => w(t, typeof e != "symbol" ? e + "" : e, s);
|
|
3
|
+
class u {
|
|
4
4
|
constructor(e) {
|
|
5
5
|
this.props = e, o(this, "type", "component"), o(this, "id"), o(this, "mounted", !1), o(this, "cleanup", []), o(this, "formElement", null), o(this, "validationErrors"), o(this, "setValidationErrors"), o(this, "setIsValid"), o(this, "handleSubmit", async (n) => {
|
|
6
6
|
if (n.preventDefault(), this.props.validateOnSubmit !== !1) {
|
|
@@ -18,8 +18,8 @@ class F {
|
|
|
18
18
|
this.setValidationErrors(n);
|
|
19
19
|
}
|
|
20
20
|
}), this.id = `form-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
21
|
-
const [s, r] =
|
|
22
|
-
this.validationErrors = s, this.setValidationErrors = r, this.setIsValid = i,
|
|
21
|
+
const [s, r] = g([]), [, i] = g(!0);
|
|
22
|
+
this.validationErrors = s, this.setValidationErrors = r, this.setIsValid = i, c(() => {
|
|
23
23
|
const n = this.validationErrors(), a = n.length === 0;
|
|
24
24
|
this.setIsValid(a), this.props.onValidationChange && this.props.onValidationChange(a, n);
|
|
25
25
|
});
|
|
@@ -118,7 +118,7 @@ class F {
|
|
|
118
118
|
marginBottom: "8px"
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
|
-
|
|
121
|
+
y("Please fix the following errors:")
|
|
122
122
|
),
|
|
123
123
|
p(
|
|
124
124
|
"ul",
|
|
@@ -131,7 +131,7 @@ class F {
|
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
133
|
...e.map(
|
|
134
|
-
(s) => p("li", { key: s.field },
|
|
134
|
+
(s) => p("li", { key: s.field }, y(s.message))
|
|
135
135
|
)
|
|
136
136
|
)
|
|
137
137
|
);
|
|
@@ -162,12 +162,25 @@ class F {
|
|
|
162
162
|
)
|
|
163
163
|
];
|
|
164
164
|
}
|
|
165
|
+
clone(e = {}) {
|
|
166
|
+
return e.deep ? this.deepClone() : this.shallowClone();
|
|
167
|
+
}
|
|
168
|
+
shallowClone() {
|
|
169
|
+
const e = x(this.props), s = new u(e);
|
|
170
|
+
return E(s), s;
|
|
171
|
+
}
|
|
172
|
+
deepClone() {
|
|
173
|
+
const e = x(this.props, {
|
|
174
|
+
deep: !0
|
|
175
|
+
}), s = new u(e);
|
|
176
|
+
return E(s), s;
|
|
177
|
+
}
|
|
165
178
|
}
|
|
166
179
|
function d(t, e = {}) {
|
|
167
|
-
const s = { ...e, children: t }, r = new
|
|
168
|
-
return
|
|
180
|
+
const s = { ...e, children: t }, r = new u(s);
|
|
181
|
+
return v(r);
|
|
169
182
|
}
|
|
170
|
-
const
|
|
183
|
+
const I = {
|
|
171
184
|
/**
|
|
172
185
|
* Automatic form styling (default)
|
|
173
186
|
*/
|
|
@@ -192,7 +205,7 @@ const B = {
|
|
|
192
205
|
Plain(t, e = {}) {
|
|
193
206
|
return d(t, { ...e, style: "plain" });
|
|
194
207
|
}
|
|
195
|
-
},
|
|
208
|
+
}, P = {
|
|
196
209
|
/**
|
|
197
210
|
* Common validation rules
|
|
198
211
|
*/
|
|
@@ -225,7 +238,7 @@ const B = {
|
|
|
225
238
|
}
|
|
226
239
|
};
|
|
227
240
|
var V = Object.defineProperty, T = (t, e, s) => e in t ? V(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, l = (t, e, s) => T(t, typeof e != "symbol" ? e + "" : e, s);
|
|
228
|
-
const
|
|
241
|
+
const m = {
|
|
229
242
|
colors: {
|
|
230
243
|
background: "#FFFFFF",
|
|
231
244
|
border: "#D1D1D6",
|
|
@@ -244,9 +257,9 @@ const c = {
|
|
|
244
257
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
245
258
|
transition: "border-color 0.2s ease, background-color 0.2s ease"
|
|
246
259
|
};
|
|
247
|
-
class
|
|
260
|
+
class B extends F {
|
|
248
261
|
constructor(e) {
|
|
249
|
-
super(), l(this, "type", "component"), l(this, "id"), l(this, "props"), l(this, "theme",
|
|
262
|
+
super(), l(this, "type", "component"), l(this, "id"), l(this, "props"), l(this, "theme", m), l(this, "inputElement", null), l(this, "handleInput", (s) => {
|
|
250
263
|
const i = s.target.value;
|
|
251
264
|
this.setText(i), this.props.onChange && this.props.onChange(i);
|
|
252
265
|
}), l(this, "handleKeyDown", (s) => {
|
|
@@ -295,9 +308,9 @@ class C extends E {
|
|
|
295
308
|
};
|
|
296
309
|
}
|
|
297
310
|
render() {
|
|
298
|
-
const e = this.getText(), s = this.getPlaceholder(), r = this.getInputType(), i = this.isDisabled(), n = this.isReadonly(), a = ["tachui-basic-input"],
|
|
311
|
+
const e = this.getText(), s = this.getPlaceholder(), r = this.getInputType(), i = this.isDisabled(), n = this.isReadonly(), a = ["tachui-basic-input"], S = this.createClassString(this.props, a), f = p("input", {
|
|
299
312
|
id: this.id,
|
|
300
|
-
className:
|
|
313
|
+
className: S,
|
|
301
314
|
type: r,
|
|
302
315
|
value: e,
|
|
303
316
|
placeholder: s,
|
|
@@ -311,20 +324,20 @@ class C extends E {
|
|
|
311
324
|
onfocus: this.handleFocus,
|
|
312
325
|
onblur: this.handleBlur
|
|
313
326
|
});
|
|
314
|
-
return this.inputElement =
|
|
327
|
+
return this.inputElement = f.element, c(() => {
|
|
315
328
|
if (this.inputElement && h(this.props.text)) {
|
|
316
|
-
const
|
|
317
|
-
this.inputElement.value !==
|
|
329
|
+
const b = this.getText();
|
|
330
|
+
this.inputElement.value !== b && (this.inputElement.value = b);
|
|
318
331
|
}
|
|
319
|
-
}),
|
|
332
|
+
}), c(() => {
|
|
320
333
|
this.inputElement && (h(this.props.placeholder) || h(this.props.inputType) || h(this.props.disabled)) && (h(this.props.placeholder) && (this.inputElement.placeholder = this.getPlaceholder()), h(this.props.inputType) && (this.inputElement.type = this.getInputType()), h(this.props.disabled) && (this.inputElement.disabled = this.isDisabled()));
|
|
321
|
-
}), [
|
|
334
|
+
}), [f];
|
|
322
335
|
}
|
|
323
336
|
}
|
|
324
|
-
function
|
|
325
|
-
return
|
|
337
|
+
function $(t) {
|
|
338
|
+
return v(new B(t));
|
|
326
339
|
}
|
|
327
|
-
const
|
|
340
|
+
const L = {
|
|
328
341
|
/**
|
|
329
342
|
* Create a search input
|
|
330
343
|
*/
|
|
@@ -370,21 +383,21 @@ const $ = {
|
|
|
370
383
|
placeholder: "Enter phone number"
|
|
371
384
|
};
|
|
372
385
|
}
|
|
373
|
-
},
|
|
374
|
-
theme:
|
|
386
|
+
}, R = {
|
|
387
|
+
theme: m,
|
|
375
388
|
/**
|
|
376
389
|
* Create a custom theme
|
|
377
390
|
*/
|
|
378
391
|
createTheme(t) {
|
|
379
|
-
return { ...
|
|
392
|
+
return { ...m, ...t };
|
|
380
393
|
}
|
|
381
394
|
};
|
|
382
395
|
export {
|
|
383
396
|
d as B,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
397
|
+
u as a,
|
|
398
|
+
I as b,
|
|
399
|
+
P as c,
|
|
400
|
+
$ as d,
|
|
401
|
+
R as e,
|
|
402
|
+
L as f
|
|
390
403
|
};
|