@plastic-js/tsumiki 0.1.78 → 0.1.80

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.
@@ -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,20 @@ 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
+ e.preventDefault();
196
+ inputEl?.focus();
197
+ };
190
198
  const renderAffix = (content) => {
191
199
  if (content == null) return null;
192
200
  return () => {
193
201
  const _el0 = _tmpl.cloneNode(true);
194
202
  insert(_el0, () => content);
195
203
  setProp(_el0, "className", () => affixClass);
204
+ setProp(_el0, "onPointerDown", () => handleAffixPointerDown);
196
205
  return _el0;
197
206
  };
198
207
  };
@@ -206,8 +215,9 @@ var Input = (props = {}) => {
206
215
  if (p == null) return null;
207
216
  return renderAffix(p);
208
217
  }, _el1);
209
- insert(_el0, () => jsx(ark$1.input, mergeProps({ get ref() {
210
- return local.ref;
218
+ insert(_el0, () => jsx(ark$1.input, mergeProps({ ref: (el) => {
219
+ inputEl = el;
220
+ if (typeof local.ref === "function") local.ref(el);
211
221
  } }, () => field ? field.getInputProps() : {}, rest, {
212
222
  type: inputType,
213
223
  "aria-invalid": () => effectiveInvalid() ? "true" : "false",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plastic-js/tsumiki",
3
- "version": "0.1.78",
3
+ "version": "0.1.80",
4
4
  "description": "A UI component library for Plastic JS.",
5
5
  "license": "MIT",
6
6
  "author": "tigre",