@plastic-js/tsumiki 0.1.77 → 0.1.79
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.
|
@@ -7,7 +7,7 @@ import { Either, createEffect, createSignal, onCleanup } from "@plastic-js/plast
|
|
|
7
7
|
//#region src/components/DialogSheet.jsx
|
|
8
8
|
var _tmpl4 = template("<div></div>");
|
|
9
9
|
var _tmpl3 = template("<div data-scope=\"dialog\" data-part=\"header\"><div><!><!></div></div>");
|
|
10
|
-
var _tmpl2 = template("<div role=\"dialog\" aria-modal=\"true\" data-scope=\"dialog\" data-part=\"sheet\"><!><div data-scope=\"dialog\" data-part=\"body\"></div><div data-scope=\"dialog\" data-part=\"footer\"></div
|
|
10
|
+
var _tmpl2 = template("<div role=\"dialog\" aria-modal=\"true\" data-scope=\"dialog\" data-part=\"sheet\"><!><div data-scope=\"dialog\" data-part=\"body\"></div><div data-scope=\"dialog\" data-part=\"footer\"></div></div>");
|
|
11
11
|
var _tmpl = template("<button type=\"button\" aria-label=\"Dismiss\"></button>");
|
|
12
12
|
var sheetBackdropClass = css({
|
|
13
13
|
position: "fixed",
|
|
@@ -41,6 +41,7 @@ var sheetPanelClass = css({
|
|
|
41
41
|
flexDirection: "column",
|
|
42
42
|
color: "var(--tsu-fg)",
|
|
43
43
|
boxShadow: "var(--tsu-shadow-lg)",
|
|
44
|
+
paddingBottom: "max(var(--tsu-container-padding-lg), env(safe-area-inset-bottom, 0px))",
|
|
44
45
|
transform: "translateY(100%)",
|
|
45
46
|
pointerEvents: "none",
|
|
46
47
|
transition: "transform var(--tsu-transition-overlay-exit)",
|
|
@@ -54,10 +55,7 @@ var sheetPanelClass = css({
|
|
|
54
55
|
})} var(--tsu-duration-overlay-enter) var(--tsu-ease-out)`
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
|
-
var
|
|
58
|
-
flexShrink: 0,
|
|
59
|
-
paddingBottom: "env(safe-area-inset-bottom, 0px)"
|
|
60
|
-
});
|
|
58
|
+
var sheetFooterClass = css({ paddingBottom: 0 });
|
|
61
59
|
var read = (v) => typeof v === "function" ? v() : v;
|
|
62
60
|
var DEFAULT_EXIT_MS = 200;
|
|
63
61
|
var toMs = (s) => {
|
|
@@ -161,7 +159,6 @@ var DialogSheet = (props) => {
|
|
|
161
159
|
const _el1 = _el0.firstChild;
|
|
162
160
|
const _el2 = _el0.firstChild.nextSibling;
|
|
163
161
|
const _el3 = _el0.firstChild.nextSibling.nextSibling;
|
|
164
|
-
const _el4 = _el0.firstChild.nextSibling.nextSibling.nextSibling;
|
|
165
162
|
insert(_el0, () => (title || props.icon) && (() => {
|
|
166
163
|
const _el0 = _tmpl3.cloneNode(true);
|
|
167
164
|
const _el1 = _el0.firstChild;
|
|
@@ -188,8 +185,7 @@ var DialogSheet = (props) => {
|
|
|
188
185
|
insert(_el2, () => props.children);
|
|
189
186
|
setProp(_el2, "className", () => bodyClass);
|
|
190
187
|
insert(_el3, () => props.footer);
|
|
191
|
-
setProp(_el3, "className", () => footerClass);
|
|
192
|
-
setProp(_el4, "className", () => sheetBottomPadClass);
|
|
188
|
+
setProp(_el3, "className", () => `${footerClass} ${sheetFooterClass}`);
|
|
193
189
|
setProp(_el0, "ref", (el) => {
|
|
194
190
|
sheetEl = el;
|
|
195
191
|
});
|
package/dist/components/Input.js
CHANGED
|
@@ -160,6 +160,7 @@ var Input = (props = {}) => {
|
|
|
160
160
|
]);
|
|
161
161
|
const showPassword = createSignal(false);
|
|
162
162
|
const isPassword = read(local.type) === "password";
|
|
163
|
+
let inputEl = null;
|
|
163
164
|
const hasPrefix = () => read(local.prefix) != null;
|
|
164
165
|
const hasSuffix = () => read(local.suffix) != null || isPassword;
|
|
165
166
|
const field = useFieldContext();
|
|
@@ -187,12 +188,19 @@ var Input = (props = {}) => {
|
|
|
187
188
|
if (!isPassword) return read(local.type);
|
|
188
189
|
return showPassword() ? "text" : "password";
|
|
189
190
|
};
|
|
191
|
+
const handleAffixPointerDown = (e) => {
|
|
192
|
+
if (effectiveDisabled()) return;
|
|
193
|
+
const target = e.target;
|
|
194
|
+
if (target && target.closest && target.closest("button, a, input, select, textarea, label, [contenteditable]")) return;
|
|
195
|
+
inputEl?.focus();
|
|
196
|
+
};
|
|
190
197
|
const renderAffix = (content) => {
|
|
191
198
|
if (content == null) return null;
|
|
192
199
|
return () => {
|
|
193
200
|
const _el0 = _tmpl.cloneNode(true);
|
|
194
201
|
insert(_el0, () => content);
|
|
195
202
|
setProp(_el0, "className", () => affixClass);
|
|
203
|
+
setProp(_el0, "onPointerDown", () => handleAffixPointerDown);
|
|
196
204
|
return _el0;
|
|
197
205
|
};
|
|
198
206
|
};
|
|
@@ -206,8 +214,9 @@ var Input = (props = {}) => {
|
|
|
206
214
|
if (p == null) return null;
|
|
207
215
|
return renderAffix(p);
|
|
208
216
|
}, _el1);
|
|
209
|
-
insert(_el0, () => jsx(ark$1.input, mergeProps({
|
|
210
|
-
|
|
217
|
+
insert(_el0, () => jsx(ark$1.input, mergeProps({ ref: (el) => {
|
|
218
|
+
inputEl = el;
|
|
219
|
+
if (typeof local.ref === "function") local.ref(el);
|
|
211
220
|
} }, () => field ? field.getInputProps() : {}, rest, {
|
|
212
221
|
type: inputType,
|
|
213
222
|
"aria-invalid": () => effectiveInvalid() ? "true" : "false",
|