@tatamicks/select 0.0.2 → 0.1.0

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/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import ce, { useCallback as w, useId as ue, forwardRef as fe, useRef as de, useImperativeHandle as me, useMemo as A } from "react";
2
- import { HorizontalAlign as U, VerticalAlign as q, toPx as y, NoteMode as J, validationDefinition as pe, fontStyleDefinition as be, placeholderDefinition as _e, universalProperties as ve } from "@tatamicks/core";
3
- var P = { exports: {} }, N = {};
1
+ import ce, { useCallback as j, useId as ue, forwardRef as fe, useRef as de, useImperativeHandle as me, useMemo as P } from "react";
2
+ import { ColorPicker as be, HorizontalAlign as C, VerticalAlign as q, toPx as T, NoteMode as J, validationDefinition as pe, fontStyleDefinition as he, placeholderDefinition as _e, universalProperties as ve } from "@tatamicks/core";
3
+ var I = { exports: {} }, N = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.js
@@ -11,26 +11,26 @@ var P = { exports: {} }, N = {};
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
13
  var X;
14
- function he() {
14
+ function ge() {
15
15
  if (X) return N;
16
16
  X = 1;
17
- var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
18
- function v(l, i, _) {
17
+ var t = Symbol.for("react.transitional.element"), c = Symbol.for("react.fragment");
18
+ function _(l, i, h) {
19
19
  var g = null;
20
- if (_ !== void 0 && (g = "" + _), i.key !== void 0 && (g = "" + i.key), "key" in i) {
21
- _ = {};
22
- for (var h in i)
23
- h !== "key" && (_[h] = i[h]);
24
- } else _ = i;
25
- return i = _.ref, {
20
+ if (h !== void 0 && (g = "" + h), i.key !== void 0 && (g = "" + i.key), "key" in i) {
21
+ h = {};
22
+ for (var v in i)
23
+ v !== "key" && (h[v] = i[v]);
24
+ } else h = i;
25
+ return i = h.ref, {
26
26
  $$typeof: t,
27
27
  type: l,
28
28
  key: g,
29
29
  ref: i !== void 0 ? i : null,
30
- props: _
30
+ props: h
31
31
  };
32
32
  }
33
- return N.Fragment = s, N.jsx = v, N.jsxs = v, N;
33
+ return N.Fragment = c, N.jsx = _, N.jsxs = _, N;
34
34
  }
35
35
  var O = {};
36
36
  /**
@@ -43,7 +43,7 @@ var O = {};
43
43
  * LICENSE file in the root directory of this source tree.
44
44
  */
45
45
  var H;
46
- function ge() {
46
+ function Ee() {
47
47
  return H || (H = 1, process.env.NODE_ENV !== "production" && (function() {
48
48
  function t(e) {
49
49
  if (e == null) return null;
@@ -51,15 +51,15 @@ function ge() {
51
51
  return e.$$typeof === le ? null : e.displayName || e.name || null;
52
52
  if (typeof e == "string") return e;
53
53
  switch (e) {
54
- case d:
54
+ case f:
55
55
  return "Fragment";
56
- case T:
56
+ case k:
57
57
  return "Profiler";
58
58
  case R:
59
59
  return "StrictMode";
60
60
  case re:
61
61
  return "Suspense";
62
- case oe:
62
+ case ne:
63
63
  return "SuspenseList";
64
64
  case ae:
65
65
  return "Activity";
@@ -72,72 +72,72 @@ function ge() {
72
72
  return "Portal";
73
73
  case ee:
74
74
  return e.displayName || "Context";
75
- case I:
75
+ case D:
76
76
  return (e._context.displayName || "Context") + ".Consumer";
77
77
  case te:
78
- var o = e.render;
79
- return e = e.displayName, e || (e = o.displayName || o.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
80
- case ne:
81
- return o = e.displayName || null, o !== null ? o : t(e.type) || "Memo";
82
- case D:
83
- o = e._payload, e = e._init;
78
+ var n = e.render;
79
+ return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
80
+ case oe:
81
+ return n = e.displayName || null, n !== null ? n : t(e.type) || "Memo";
82
+ case $:
83
+ n = e._payload, e = e._init;
84
84
  try {
85
- return t(e(o));
85
+ return t(e(n));
86
86
  } catch {
87
87
  }
88
88
  }
89
89
  return null;
90
90
  }
91
- function s(e) {
91
+ function c(e) {
92
92
  return "" + e;
93
93
  }
94
- function v(e) {
94
+ function _(e) {
95
95
  try {
96
- s(e);
97
- var o = !1;
96
+ c(e);
97
+ var n = !1;
98
98
  } catch {
99
- o = !0;
99
+ n = !0;
100
100
  }
101
- if (o) {
102
- o = console;
103
- var u = o.error, m = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
101
+ if (n) {
102
+ n = console;
103
+ var u = n.error, d = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
104
104
  return u.call(
105
- o,
105
+ n,
106
106
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
- m
108
- ), s(e);
107
+ d
108
+ ), c(e);
109
109
  }
110
110
  }
111
111
  function l(e) {
112
- if (e === d) return "<>";
113
- if (typeof e == "object" && e !== null && e.$$typeof === D)
112
+ if (e === f) return "<>";
113
+ if (typeof e == "object" && e !== null && e.$$typeof === $)
114
114
  return "<...>";
115
115
  try {
116
- var o = t(e);
117
- return o ? "<" + o + ">" : "<...>";
116
+ var n = t(e);
117
+ return n ? "<" + n + ">" : "<...>";
118
118
  } catch {
119
119
  return "<...>";
120
120
  }
121
121
  }
122
122
  function i() {
123
- var e = $.A;
123
+ var e = L.A;
124
124
  return e === null ? null : e.getOwner();
125
125
  }
126
- function _() {
126
+ function h() {
127
127
  return Error("react-stack-top-frame");
128
128
  }
129
129
  function g(e) {
130
- if (B.call(e, "key")) {
131
- var o = Object.getOwnPropertyDescriptor(e, "key").get;
132
- if (o && o.isReactWarning) return !1;
130
+ if (M.call(e, "key")) {
131
+ var n = Object.getOwnPropertyDescriptor(e, "key").get;
132
+ if (n && n.isReactWarning) return !1;
133
133
  }
134
134
  return e.key !== void 0;
135
135
  }
136
- function h(e, o) {
136
+ function v(e, n) {
137
137
  function u() {
138
- z || (z = !0, console.error(
138
+ V || (V = !0, console.error(
139
139
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
140
- o
140
+ n
141
141
  ));
142
142
  }
143
143
  u.isReactWarning = !0, Object.defineProperty(e, "key", {
@@ -147,19 +147,19 @@ function ge() {
147
147
  }
148
148
  function E() {
149
149
  var e = t(this.type);
150
- return M[e] || (M[e] = !0, console.error(
150
+ return W[e] || (W[e] = !0, console.error(
151
151
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
152
152
  )), e = this.props.ref, e !== void 0 ? e : null;
153
153
  }
154
- function j(e, o, u, m, C, F) {
155
- var p = u.ref;
154
+ function S(e, n, u, d, A, F) {
155
+ var m = u.ref;
156
156
  return e = {
157
- $$typeof: f,
157
+ $$typeof: p,
158
158
  type: e,
159
- key: o,
159
+ key: n,
160
160
  props: u,
161
- _owner: m
162
- }, (p !== void 0 ? p : null) !== null ? Object.defineProperty(e, "ref", {
161
+ _owner: d
162
+ }, (m !== void 0 ? m : null) !== null ? Object.defineProperty(e, "ref", {
163
163
  enumerable: !1,
164
164
  get: E
165
165
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
@@ -176,7 +176,7 @@ function ge() {
176
176
  configurable: !1,
177
177
  enumerable: !1,
178
178
  writable: !0,
179
- value: C
179
+ value: A
180
180
  }), Object.defineProperty(e, "_debugTask", {
181
181
  configurable: !1,
182
182
  enumerable: !1,
@@ -184,280 +184,272 @@ function ge() {
184
184
  value: F
185
185
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
186
186
  }
187
- function k(e, o, u, m, C, F) {
188
- var p = o.children;
189
- if (p !== void 0)
190
- if (m)
191
- if (ie(p)) {
192
- for (m = 0; m < p.length; m++)
193
- x(p[m]);
194
- Object.freeze && Object.freeze(p);
187
+ function w(e, n, u, d, A, F) {
188
+ var m = n.children;
189
+ if (m !== void 0)
190
+ if (d)
191
+ if (ie(m)) {
192
+ for (d = 0; d < m.length; d++)
193
+ x(m[d]);
194
+ Object.freeze && Object.freeze(m);
195
195
  } else
196
196
  console.error(
197
197
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
198
198
  );
199
- else x(p);
200
- if (B.call(o, "key")) {
201
- p = t(e);
202
- var S = Object.keys(o).filter(function(se) {
199
+ else x(m);
200
+ if (M.call(n, "key")) {
201
+ m = t(e);
202
+ var y = Object.keys(n).filter(function(se) {
203
203
  return se !== "key";
204
204
  });
205
- m = 0 < S.length ? "{key: someKey, " + S.join(": ..., ") + ": ...}" : "{key: someKey}", G[p + m] || (S = 0 < S.length ? "{" + S.join(": ..., ") + ": ...}" : "{}", console.error(
205
+ d = 0 < y.length ? "{key: someKey, " + y.join(": ..., ") + ": ...}" : "{key: someKey}", U[m + d] || (y = 0 < y.length ? "{" + y.join(": ..., ") + ": ...}" : "{}", console.error(
206
206
  `A props object containing a "key" prop is being spread into JSX:
207
207
  let props = %s;
208
208
  <%s {...props} />
209
209
  React keys must be passed directly to JSX without using spread:
210
210
  let props = %s;
211
211
  <%s key={someKey} {...props} />`,
212
+ d,
212
213
  m,
213
- p,
214
- S,
215
- p
216
- ), G[p + m] = !0);
214
+ y,
215
+ m
216
+ ), U[m + d] = !0);
217
217
  }
218
- if (p = null, u !== void 0 && (v(u), p = "" + u), g(o) && (v(o.key), p = "" + o.key), "key" in o) {
218
+ if (m = null, u !== void 0 && (_(u), m = "" + u), g(n) && (_(n.key), m = "" + n.key), "key" in n) {
219
219
  u = {};
220
- for (var L in o)
221
- L !== "key" && (u[L] = o[L]);
222
- } else u = o;
223
- return p && h(
220
+ for (var z in n)
221
+ z !== "key" && (u[z] = n[z]);
222
+ } else u = n;
223
+ return m && v(
224
224
  u,
225
225
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
226
- ), j(
226
+ ), S(
227
227
  e,
228
- p,
228
+ m,
229
229
  u,
230
230
  i(),
231
- C,
231
+ A,
232
232
  F
233
233
  );
234
234
  }
235
235
  function x(e) {
236
- a(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === D && (e._payload.status === "fulfilled" ? a(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
236
+ a(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === $ && (e._payload.status === "fulfilled" ? a(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
237
237
  }
238
238
  function a(e) {
239
- return typeof e == "object" && e !== null && e.$$typeof === f;
239
+ return typeof e == "object" && e !== null && e.$$typeof === p;
240
240
  }
241
- var n = ce, f = Symbol.for("react.transitional.element"), r = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), I = Symbol.for("react.consumer"), ee = Symbol.for("react.context"), te = Symbol.for("react.forward_ref"), re = Symbol.for("react.suspense"), oe = Symbol.for("react.suspense_list"), ne = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), ae = Symbol.for("react.activity"), le = Symbol.for("react.client.reference"), $ = n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, ie = Array.isArray, Y = console.createTask ? console.createTask : function() {
241
+ var o = ce, p = Symbol.for("react.transitional.element"), r = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), D = Symbol.for("react.consumer"), ee = Symbol.for("react.context"), te = Symbol.for("react.forward_ref"), re = Symbol.for("react.suspense"), ne = Symbol.for("react.suspense_list"), oe = Symbol.for("react.memo"), $ = Symbol.for("react.lazy"), ae = Symbol.for("react.activity"), le = Symbol.for("react.client.reference"), L = o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, ie = Array.isArray, Y = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- n = {
244
+ o = {
245
245
  react_stack_bottom_frame: function(e) {
246
246
  return e();
247
247
  }
248
248
  };
249
- var z, M = {}, V = n.react_stack_bottom_frame.bind(
250
- n,
251
- _
252
- )(), W = Y(l(_)), G = {};
253
- O.Fragment = d, O.jsx = function(e, o, u) {
254
- var m = 1e4 > $.recentlyCreatedOwnerStacks++;
255
- return k(
249
+ var V, W = {}, B = o.react_stack_bottom_frame.bind(
250
+ o,
251
+ h
252
+ )(), G = Y(l(h)), U = {};
253
+ O.Fragment = f, O.jsx = function(e, n, u) {
254
+ var d = 1e4 > L.recentlyCreatedOwnerStacks++;
255
+ return w(
256
256
  e,
257
- o,
257
+ n,
258
258
  u,
259
259
  !1,
260
- m ? Error("react-stack-top-frame") : V,
261
- m ? Y(l(e)) : W
260
+ d ? Error("react-stack-top-frame") : B,
261
+ d ? Y(l(e)) : G
262
262
  );
263
- }, O.jsxs = function(e, o, u) {
264
- var m = 1e4 > $.recentlyCreatedOwnerStacks++;
265
- return k(
263
+ }, O.jsxs = function(e, n, u) {
264
+ var d = 1e4 > L.recentlyCreatedOwnerStacks++;
265
+ return w(
266
266
  e,
267
- o,
267
+ n,
268
268
  u,
269
269
  !0,
270
- m ? Error("react-stack-top-frame") : V,
271
- m ? Y(l(e)) : W
270
+ d ? Error("react-stack-top-frame") : B,
271
+ d ? Y(l(e)) : G
272
272
  );
273
273
  };
274
274
  })()), O;
275
275
  }
276
276
  var Z;
277
- function Ee() {
278
- return Z || (Z = 1, process.env.NODE_ENV === "production" ? P.exports = he() : P.exports = ge()), P.exports;
277
+ function Re() {
278
+ return Z || (Z = 1, process.env.NODE_ENV === "production" ? I.exports = ge() : I.exports = Ee()), I.exports;
279
279
  }
280
- var c = Ee();
281
- const Re = "_container_puorg_1", xe = "_defaultSection_puorg_15", je = "_optionsList_puorg_35", ke = "_optionItem_puorg_51", Te = "_inputGroup_puorg_71", Se = "_label_puorg_83", we = "_input_puorg_71", ye = "_colorInput_puorg_133", Ne = "_clearColorButton_puorg_163", Oe = "_removeButton_puorg_215", Ce = "_addButton_puorg_269", b = {
282
- container: Re,
283
- defaultSection: xe,
284
- optionsList: je,
285
- optionItem: ke,
286
- inputGroup: Te,
287
- label: Se,
288
- input: we,
289
- colorInput: ye,
290
- clearColorButton: Ne,
291
- removeButton: Oe,
292
- addButton: Ce
280
+ var s = Re();
281
+ const xe = "_container_y9aws_1", we = "_defaultSection_y9aws_8", ke = "_optionsList_y9aws_18", ye = "_optionItem_y9aws_26", je = "_header_y9aws_35", Te = "_headerLabel_y9aws_42", Se = "_inputGroup_y9aws_48", Ne = "_label_y9aws_54", Oe = "_input_y9aws_48", Ae = "_removeButton_y9aws_122", Pe = "_addButton_y9aws_145", b = {
282
+ container: xe,
283
+ defaultSection: we,
284
+ optionsList: ke,
285
+ optionItem: ye,
286
+ header: je,
287
+ headerLabel: Te,
288
+ inputGroup: Se,
289
+ label: Ne,
290
+ input: Oe,
291
+ removeButton: Ae,
292
+ addButton: Pe
293
293
  }, Q = ({
294
294
  value: t,
295
- onChange: s,
296
- readOnly: v = !1
295
+ onChange: c,
296
+ readOnly: _ = !1
297
297
  }) => {
298
- const { options: l, defaultOption: i } = t, _ = w(() => {
298
+ const { options: l, defaultOption: i } = t, h = j(() => {
299
299
  const a = {
300
300
  label: `選択肢${l.length + 1}`,
301
301
  value: `option${l.length + 1}`
302
302
  };
303
- s({ ...t, options: [...l, a] });
304
- }, [l, t, s]), g = w(
303
+ c({ ...t, options: [...l, a] });
304
+ }, [l, t, c]), g = j(
305
305
  (a) => {
306
- var d;
307
- const n = l.filter((R, T) => T !== a), f = (d = l[a]) == null ? void 0 : d.value;
308
- s({ options: n, defaultOption: f !== void 0 && i === f ? void 0 : i });
306
+ var f;
307
+ const o = l.filter((R, k) => k !== a), p = (f = l[a]) == null ? void 0 : f.value;
308
+ c({ options: o, defaultOption: p !== void 0 && i === p ? void 0 : i });
309
309
  },
310
- [l, i, s]
311
- ), h = w(
312
- (a, n) => {
313
- const f = l.map(
314
- (r, d) => d === a ? { ...r, label: n } : r
310
+ [l, i, c]
311
+ ), v = j(
312
+ (a, o) => {
313
+ const p = l.map(
314
+ (r, f) => f === a ? { ...r, label: o } : r
315
315
  );
316
- s({ ...t, options: f });
316
+ c({ ...t, options: p });
317
317
  },
318
- [l, t, s]
319
- ), E = w(
320
- (a, n) => {
318
+ [l, t, c]
319
+ ), E = j(
320
+ (a, o) => {
321
321
  var R;
322
- const f = (R = l[a]) == null ? void 0 : R.value, r = l.map(
323
- (T, I) => I === a ? { ...T, value: n } : T
322
+ const p = (R = l[a]) == null ? void 0 : R.value, r = l.map(
323
+ (k, D) => D === a ? { ...k, value: o } : k
324
324
  );
325
- s({ options: r, defaultOption: i === f ? n : i });
325
+ c({ options: r, defaultOption: i === p ? o : i });
326
326
  },
327
- [l, i, s]
328
- ), j = w(
329
- (a, n) => {
330
- const f = l.map(
331
- (r, d) => d === a ? { ...r, color: n || void 0 } : r
327
+ [l, i, c]
328
+ ), S = j(
329
+ (a, o) => {
330
+ const p = l.map(
331
+ (r, f) => f === a ? { ...r, color: o || void 0 } : r
332
332
  );
333
- s({ ...t, options: f });
333
+ c({ ...t, options: p });
334
334
  },
335
- [l, t, s]
336
- ), k = w(
335
+ [l, t, c]
336
+ ), w = j(
337
337
  (a) => {
338
- s({ ...t, defaultOption: a || void 0 });
338
+ c({ ...t, defaultOption: a || void 0 });
339
339
  },
340
- [t, s]
340
+ [t, c]
341
341
  ), x = ue();
342
- return /* @__PURE__ */ c.jsxs("div", { className: b.container, children: [
343
- /* @__PURE__ */ c.jsxs("div", { className: b.defaultSection, children: [
344
- /* @__PURE__ */ c.jsx("label", { className: b.label, htmlFor: x, children: "初期選択値:" }),
345
- /* @__PURE__ */ c.jsxs(
342
+ return /* @__PURE__ */ s.jsxs("div", { className: b.container, children: [
343
+ /* @__PURE__ */ s.jsxs("div", { className: b.defaultSection, children: [
344
+ /* @__PURE__ */ s.jsx("label", { className: b.label, htmlFor: x, children: "初期選択値:" }),
345
+ /* @__PURE__ */ s.jsxs(
346
346
  "select",
347
347
  {
348
348
  id: x,
349
349
  className: b.input,
350
350
  value: i || "",
351
- onChange: (a) => k(a.target.value),
352
- disabled: v,
351
+ onChange: (a) => w(a.target.value),
352
+ disabled: _,
353
353
  children: [
354
- /* @__PURE__ */ c.jsx("option", { value: "", children: "未選択" }),
355
- l.map((a, n) => (
356
- // biome-ignore lint/suspicious/noArrayIndexKey: 選択肢の順序は重要で、固有IDがないためindexを使用
357
- /* @__PURE__ */ c.jsx("option", { value: a.value, children: a.label }, n)
358
- ))
354
+ /* @__PURE__ */ s.jsx("option", { value: "", children: "placeholder" }),
355
+ l.map((a, o) => {
356
+ const p = `option-${o}`;
357
+ return /* @__PURE__ */ s.jsx("option", { value: a.value, children: a.label }, p);
358
+ })
359
359
  ]
360
360
  }
361
361
  )
362
362
  ] }),
363
- /* @__PURE__ */ c.jsx("div", { className: b.optionsList, children: l.map((a, n) => (
364
- // biome-ignore lint/suspicious/noArrayIndexKey: 選択肢の順序は重要で、固有IDがないためindexを使用
365
- /* @__PURE__ */ c.jsxs("div", { className: b.optionItem, children: [
366
- /* @__PURE__ */ c.jsxs("div", { className: b.inputGroup, children: [
367
- /* @__PURE__ */ c.jsx("label", { className: b.label, htmlFor: `label-${n}`, children: "ラベル:" }),
368
- /* @__PURE__ */ c.jsx(
363
+ /* @__PURE__ */ s.jsx("div", { className: b.optionsList, children: l.map((a, o) => {
364
+ const p = `option-${o}`;
365
+ return /* @__PURE__ */ s.jsxs("div", { className: b.optionItem, children: [
366
+ /* @__PURE__ */ s.jsxs("div", { className: b.header, children: [
367
+ /* @__PURE__ */ s.jsxs("span", { className: b.headerLabel, children: [
368
+ "オプション",
369
+ o + 1
370
+ ] }),
371
+ /* @__PURE__ */ s.jsx(
372
+ "button",
373
+ {
374
+ type: "button",
375
+ className: b.removeButton,
376
+ onClick: () => g(o),
377
+ disabled: _ || l.length === 1,
378
+ title: "削除",
379
+ children: "削除"
380
+ }
381
+ )
382
+ ] }),
383
+ /* @__PURE__ */ s.jsxs("div", { className: b.inputGroup, children: [
384
+ /* @__PURE__ */ s.jsx("label", { className: b.label, htmlFor: `label-${o}`, children: "ラベル" }),
385
+ /* @__PURE__ */ s.jsx(
369
386
  "input",
370
387
  {
371
388
  type: "text",
372
- id: `label-${n}`,
389
+ id: `label-${o}`,
373
390
  className: b.input,
374
391
  value: a.label,
375
- onChange: (f) => h(n, f.target.value),
376
- disabled: v,
392
+ onChange: (r) => v(o, r.target.value),
393
+ disabled: _,
377
394
  placeholder: "表示名"
378
395
  }
379
396
  )
380
397
  ] }),
381
- /* @__PURE__ */ c.jsxs("div", { className: b.inputGroup, children: [
382
- /* @__PURE__ */ c.jsx("label", { className: b.label, htmlFor: `value-${n}`, children: "値:" }),
383
- /* @__PURE__ */ c.jsx(
398
+ /* @__PURE__ */ s.jsxs("div", { className: b.inputGroup, children: [
399
+ /* @__PURE__ */ s.jsx("label", { className: b.label, htmlFor: `value-${o}`, children: "" }),
400
+ /* @__PURE__ */ s.jsx(
384
401
  "input",
385
402
  {
386
403
  type: "text",
387
- id: `value-${n}`,
404
+ id: `value-${o}`,
388
405
  className: b.input,
389
406
  value: a.value,
390
- onChange: (f) => E(n, f.target.value),
391
- disabled: v,
407
+ onChange: (r) => E(o, r.target.value),
408
+ disabled: _,
392
409
  placeholder: "内部値"
393
410
  }
394
411
  )
395
412
  ] }),
396
- /* @__PURE__ */ c.jsxs("div", { className: b.inputGroup, children: [
397
- /* @__PURE__ */ c.jsx("label", { className: b.label, htmlFor: `color-${n}`, children: "色:" }),
398
- /* @__PURE__ */ c.jsx(
399
- "input",
413
+ /* @__PURE__ */ s.jsxs("div", { className: b.inputGroup, children: [
414
+ /* @__PURE__ */ s.jsx("label", { className: b.label, htmlFor: `color-${o}`, children: "" }),
415
+ /* @__PURE__ */ s.jsx(
416
+ be,
400
417
  {
401
- type: "color",
402
- id: `color-${n}`,
403
- className: b.colorInput,
404
- value: a.color || "#ffffff",
405
- onChange: (f) => j(n, f.target.value),
406
- disabled: v,
407
- title: "背景色"
408
- }
409
- ),
410
- a.color && /* @__PURE__ */ c.jsx(
411
- "button",
412
- {
413
- type: "button",
414
- className: b.clearColorButton,
415
- onClick: () => j(n, ""),
416
- disabled: v,
417
- title: "色をクリア",
418
- children: "✕"
418
+ value: a.color,
419
+ onChange: (r) => S(o, r || ""),
420
+ allowUndefined: !0,
421
+ placeholder: "色を選択"
419
422
  }
420
423
  )
421
- ] }),
422
- /* @__PURE__ */ c.jsx(
423
- "button",
424
- {
425
- type: "button",
426
- className: b.removeButton,
427
- onClick: () => g(n),
428
- disabled: v || l.length === 1,
429
- title: "削除",
430
- children: "×"
431
- }
432
- )
433
- ] }, n)
434
- )) }),
435
- /* @__PURE__ */ c.jsx(
424
+ ] })
425
+ ] }, p);
426
+ }) }),
427
+ /* @__PURE__ */ s.jsx(
436
428
  "button",
437
429
  {
438
430
  type: "button",
439
431
  className: b.addButton,
440
- onClick: _,
441
- disabled: v,
432
+ onClick: h,
433
+ disabled: _,
442
434
  children: "+ 選択肢を追加"
443
435
  }
444
436
  )
445
437
  ] });
446
438
  };
447
439
  Q.displayName = "OptionsEditor";
448
- const K = fe(({ props: t, value: s, onChange: v, onBlur: l, readOnly: i, mode: _ }, g) => {
449
- const h = de(null);
440
+ const K = fe(({ props: t, value: c, onChange: _, onBlur: l, readOnly: i, mode: h }, g) => {
441
+ const v = de(null);
450
442
  me(
451
443
  g,
452
444
  () => ({
453
445
  focus: () => {
454
- var r, d, R;
455
- (r = h.current) == null || r.focus(), h.current && !i && ((R = (d = h.current).showPicker) == null || R.call(d));
446
+ var r, f, R;
447
+ (r = v.current) == null || r.focus(), v.current && !i && ((R = (f = v.current).showPicker) == null || R.call(f));
456
448
  }
457
449
  }),
458
450
  [i]
459
451
  );
460
- const E = A(() => s && t.selectConfig.options.find((r) => r.value === s) || null, [s, t.selectConfig.options]), j = A(() => {
452
+ const E = P(() => c && t.selectConfig.options.find((r) => r.value === c) || null, [c, t.selectConfig.options]), S = P(() => {
461
453
  const r = {
462
454
  width: "100%",
463
455
  height: "100%",
@@ -468,10 +460,10 @@ const K = fe(({ props: t, value: s, onChange: v, onBlur: l, readOnly: i, mode: _
468
460
  // 矢印アイコンの配置用
469
461
  };
470
462
  switch (t.justifyContent) {
471
- case U.center:
463
+ case C.center:
472
464
  r.justifyContent = "center";
473
465
  break;
474
- case U.right:
466
+ case C.right:
475
467
  r.justifyContent = "flex-end";
476
468
  break;
477
469
  default:
@@ -490,13 +482,13 @@ const K = fe(({ props: t, value: s, onChange: v, onBlur: l, readOnly: i, mode: _
490
482
  break;
491
483
  }
492
484
  if (t.isIndividual)
493
- t.top && (r.paddingTop = y.fromDim(t.top)), t.right && (r.paddingRight = y.fromDim(t.right)), t.bottom && (r.paddingBottom = y.fromDim(t.bottom)), t.left && (r.paddingLeft = y.fromDim(t.left));
485
+ t.top && (r.paddingTop = T.fromDim(t.top)), t.right && (r.paddingRight = T.fromDim(t.right)), t.bottom && (r.paddingBottom = T.fromDim(t.bottom)), t.left && (r.paddingLeft = T.fromDim(t.left));
494
486
  else if (t.all) {
495
- const d = y.fromDim(t.all);
496
- r.padding = `${d}px`;
487
+ const f = T.fromDim(t.all);
488
+ r.padding = `${f}px`;
497
489
  }
498
- return r;
499
- }, [t]), k = A(() => {
490
+ return c && (E != null && E.color) && (r.backgroundColor = E.color), r;
491
+ }, [t, c, E]), w = P(() => {
500
492
  const r = {
501
493
  appearance: "none",
502
494
  // ネイティブの矢印を消す
@@ -508,6 +500,7 @@ const K = fe(({ props: t, value: s, onChange: v, onBlur: l, readOnly: i, mode: _
508
500
  // 右側に矢印用のスペース
509
501
  margin: 0,
510
502
  width: "100%",
503
+ // ブロック全体の幅に合わせる
511
504
  height: "100%",
512
505
  // ブロック全体の高さに合わせる
513
506
  boxSizing: "border-box",
@@ -516,15 +509,25 @@ const K = fe(({ props: t, value: s, onChange: v, onBlur: l, readOnly: i, mode: _
516
509
  // readOnly時は操作を無効化(disabledを使わない)
517
510
  pointerEvents: i ? "none" : "auto"
518
511
  };
519
- return t.fontSize && (r.fontSize = y.fromDim(t.fontSize)), t.color && (r.color = t.color), t.fontWeight && (r.fontWeight = "bold"), t.italic && (r.fontStyle = "italic"), s && (E != null && E.color) ? r.backgroundColor = E.color : r.backgroundColor = "transparent", r;
512
+ switch (t.justifyContent) {
513
+ case C.center:
514
+ r.textAlign = "center";
515
+ break;
516
+ case C.right:
517
+ r.textAlign = "right";
518
+ break;
519
+ default:
520
+ r.textAlign = "left";
521
+ break;
522
+ }
523
+ return t.fontSize && (r.fontSize = T.fromDim(t.fontSize)), t.color && (r.color = t.color), t.fontWeight && (r.fontWeight = "bold"), t.italic && (r.fontStyle = "italic"), r;
520
524
  }, [
525
+ t.justifyContent,
521
526
  t.fontSize,
522
527
  t.color,
523
528
  t.fontWeight,
524
529
  t.italic,
525
- E,
526
- i,
527
- s
530
+ i
528
531
  ]), x = {
529
532
  position: "absolute",
530
533
  right: "8px",
@@ -537,24 +540,24 @@ const K = fe(({ props: t, value: s, onChange: v, onBlur: l, readOnly: i, mode: _
537
540
  borderRight: "4px solid transparent",
538
541
  borderTop: "5px solid",
539
542
  borderTopColor: t.color || "#6b7280"
540
- }, a = A(() => _ === J.FORM ? !0 : _ === J.EDIT ? !i : !1, [_, i]), n = (r) => {
541
- const d = r.target.value;
542
- v(d === "" ? null : d);
543
- }, f = () => {
544
- l && l(s);
543
+ }, a = P(() => h === J.FORM ? !0 : h === J.EDIT ? !i : !1, [h, i]), o = (r) => {
544
+ const f = r.target.value;
545
+ _(f === "" ? null : f);
546
+ }, p = () => {
547
+ l && l(c);
545
548
  };
546
- return /* @__PURE__ */ c.jsxs("div", { style: j, children: [
547
- /* @__PURE__ */ c.jsxs(
549
+ return /* @__PURE__ */ s.jsxs("div", { style: S, children: [
550
+ /* @__PURE__ */ s.jsxs(
548
551
  "select",
549
552
  {
550
- ref: h,
551
- value: s ?? "",
552
- onChange: n,
553
- onBlur: f,
554
- style: k,
553
+ ref: v,
554
+ value: c ?? "",
555
+ onChange: o,
556
+ onBlur: p,
557
+ style: w,
555
558
  children: [
556
- /* @__PURE__ */ c.jsx("option", { value: "", style: { backgroundColor: "#ffffff" }, children: "未選択" }),
557
- t.selectConfig.options.map((r) => /* @__PURE__ */ c.jsx(
559
+ /* @__PURE__ */ s.jsx("option", { value: "", style: { backgroundColor: "#ffffff" }, children: t.placeholder || "" }),
560
+ t.selectConfig.options.map((r) => /* @__PURE__ */ s.jsx(
558
561
  "option",
559
562
  {
560
563
  value: r.value,
@@ -566,11 +569,11 @@ const K = fe(({ props: t, value: s, onChange: v, onBlur: l, readOnly: i, mode: _
566
569
  ]
567
570
  }
568
571
  ),
569
- a && /* @__PURE__ */ c.jsx("div", { style: x })
572
+ a && /* @__PURE__ */ s.jsx("div", { style: x })
570
573
  ] });
571
574
  });
572
575
  K.displayName = "SelectRenderer";
573
- const Ie = {
576
+ const De = {
574
577
  kind: "select",
575
578
  meta: {
576
579
  displayName: "セレクトボックス",
@@ -582,7 +585,7 @@ const Ie = {
582
585
  ...ve,
583
586
  // alignment + padding
584
587
  ..._e,
585
- ...be,
588
+ ...he,
586
589
  ...pe,
587
590
  // Select固有プロパティ - 選択肢とデフォルト値を統合
588
591
  selectConfig: {
@@ -604,7 +607,7 @@ const Ie = {
604
607
  };
605
608
  export {
606
609
  Q as OptionsEditor,
607
- Ie as SelectPlugin,
610
+ De as SelectPlugin,
608
611
  K as SelectRenderer
609
612
  };
610
613
  //# sourceMappingURL=index.mjs.map