@tatamicks/select 0.0.1

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 ADDED
@@ -0,0 +1,961 @@
1
+ import $e, { useCallback as L, useId as yr, forwardRef as Rr, useRef as Er, useImperativeHandle as xr, useMemo as K } from "react";
2
+ import { HorizontalAlign as ke, VerticalAlign as De, toPx as Y, NoteMode as Ie, validationDefinition as Sr, fontStyleDefinition as jr, placeholderDefinition as Cr, universalProperties as wr } from "@tatamicks/core";
3
+ var H = { exports: {} }, M = {};
4
+ /**
5
+ * @license React
6
+ * react-jsx-runtime.production.min.js
7
+ *
8
+ * Copyright (c) Facebook, Inc. and its affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ var Fe;
14
+ function Tr() {
15
+ if (Fe) return M;
16
+ Fe = 1;
17
+ var n = $e, v = Symbol.for("react.element"), T = Symbol.for("react.fragment"), f = Object.prototype.hasOwnProperty, _ = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, D = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function I(j, b, k) {
19
+ var E, C = {}, s = null, u = null;
20
+ k !== void 0 && (s = "" + k), b.key !== void 0 && (s = "" + b.key), b.ref !== void 0 && (u = b.ref);
21
+ for (E in b) f.call(b, E) && !D.hasOwnProperty(E) && (C[E] = b[E]);
22
+ if (j && j.defaultProps) for (E in b = j.defaultProps, b) C[E] === void 0 && (C[E] = b[E]);
23
+ return { $$typeof: v, type: j, key: s, ref: u, props: C, _owner: _.current };
24
+ }
25
+ return M.Fragment = T, M.jsx = I, M.jsxs = I, M;
26
+ }
27
+ var U = {};
28
+ /**
29
+ * @license React
30
+ * react-jsx-runtime.development.js
31
+ *
32
+ * Copyright (c) Facebook, Inc. and its affiliates.
33
+ *
34
+ * This source code is licensed under the MIT license found in the
35
+ * LICENSE file in the root directory of this source tree.
36
+ */
37
+ var Ae;
38
+ function Or() {
39
+ return Ae || (Ae = 1, process.env.NODE_ENV !== "production" && (function() {
40
+ var n = $e, v = Symbol.for("react.element"), T = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), I = Symbol.for("react.provider"), j = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), s = Symbol.for("react.lazy"), u = Symbol.for("react.offscreen"), y = Symbol.iterator, a = "@@iterator";
41
+ function x(e) {
42
+ if (e === null || typeof e != "object")
43
+ return null;
44
+ var r = y && e[y] || e[a];
45
+ return typeof r == "function" ? r : null;
46
+ }
47
+ var O = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
+ function g(e) {
49
+ {
50
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++)
51
+ t[o - 1] = arguments[o];
52
+ X("error", e, t);
53
+ }
54
+ }
55
+ function X(e, r, t) {
56
+ {
57
+ var o = O.ReactDebugCurrentFrame, c = o.getStackAddendum();
58
+ c !== "" && (r += "%s", t = t.concat([c]));
59
+ var d = t.map(function(l) {
60
+ return String(l);
61
+ });
62
+ d.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, d);
63
+ }
64
+ }
65
+ var Ye = !1, Be = !1, Ve = !1, Me = !1, Ue = !1, ie;
66
+ ie = Symbol.for("react.module.reference");
67
+ function ze(e) {
68
+ return !!(typeof e == "string" || typeof e == "function" || e === f || e === D || Ue || e === _ || e === k || e === E || Me || e === u || Ye || Be || Ve || typeof e == "object" && e !== null && (e.$$typeof === s || e.$$typeof === C || e.$$typeof === I || e.$$typeof === j || e.$$typeof === b || // This needs to include all possible module reference object
69
+ // types supported by any Flight configuration anywhere since
70
+ // we don't know which Flight build this will end up being used
71
+ // with.
72
+ e.$$typeof === ie || e.getModuleId !== void 0));
73
+ }
74
+ function Ge(e, r, t) {
75
+ var o = e.displayName;
76
+ if (o)
77
+ return o;
78
+ var c = r.displayName || r.name || "";
79
+ return c !== "" ? t + "(" + c + ")" : t;
80
+ }
81
+ function le(e) {
82
+ return e.displayName || "Context";
83
+ }
84
+ function F(e) {
85
+ if (e == null)
86
+ return null;
87
+ if (typeof e.tag == "number" && g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
+ return e.displayName || e.name || null;
89
+ if (typeof e == "string")
90
+ return e;
91
+ switch (e) {
92
+ case f:
93
+ return "Fragment";
94
+ case T:
95
+ return "Portal";
96
+ case D:
97
+ return "Profiler";
98
+ case _:
99
+ return "StrictMode";
100
+ case k:
101
+ return "Suspense";
102
+ case E:
103
+ return "SuspenseList";
104
+ }
105
+ if (typeof e == "object")
106
+ switch (e.$$typeof) {
107
+ case j:
108
+ var r = e;
109
+ return le(r) + ".Consumer";
110
+ case I:
111
+ var t = e;
112
+ return le(t._context) + ".Provider";
113
+ case b:
114
+ return Ge(e, e.render, "ForwardRef");
115
+ case C:
116
+ var o = e.displayName || null;
117
+ return o !== null ? o : F(e.type) || "Memo";
118
+ case s: {
119
+ var c = e, d = c._payload, l = c._init;
120
+ try {
121
+ return F(l(d));
122
+ } catch {
123
+ return null;
124
+ }
125
+ }
126
+ }
127
+ return null;
128
+ }
129
+ var A = Object.assign, B = 0, se, ue, ce, fe, de, ve, pe;
130
+ function be() {
131
+ }
132
+ be.__reactDisabledLog = !0;
133
+ function Je() {
134
+ {
135
+ if (B === 0) {
136
+ se = console.log, ue = console.info, ce = console.warn, fe = console.error, de = console.group, ve = console.groupCollapsed, pe = console.groupEnd;
137
+ var e = {
138
+ configurable: !0,
139
+ enumerable: !0,
140
+ value: be,
141
+ writable: !0
142
+ };
143
+ Object.defineProperties(console, {
144
+ info: e,
145
+ log: e,
146
+ warn: e,
147
+ error: e,
148
+ group: e,
149
+ groupCollapsed: e,
150
+ groupEnd: e
151
+ });
152
+ }
153
+ B++;
154
+ }
155
+ }
156
+ function qe() {
157
+ {
158
+ if (B--, B === 0) {
159
+ var e = {
160
+ configurable: !0,
161
+ enumerable: !0,
162
+ writable: !0
163
+ };
164
+ Object.defineProperties(console, {
165
+ log: A({}, e, {
166
+ value: se
167
+ }),
168
+ info: A({}, e, {
169
+ value: ue
170
+ }),
171
+ warn: A({}, e, {
172
+ value: ce
173
+ }),
174
+ error: A({}, e, {
175
+ value: fe
176
+ }),
177
+ group: A({}, e, {
178
+ value: de
179
+ }),
180
+ groupCollapsed: A({}, e, {
181
+ value: ve
182
+ }),
183
+ groupEnd: A({}, e, {
184
+ value: pe
185
+ })
186
+ });
187
+ }
188
+ B < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
+ }
190
+ }
191
+ var Z = O.ReactCurrentDispatcher, Q;
192
+ function z(e, r, t) {
193
+ {
194
+ if (Q === void 0)
195
+ try {
196
+ throw Error();
197
+ } catch (c) {
198
+ var o = c.stack.trim().match(/\n( *(at )?)/);
199
+ Q = o && o[1] || "";
200
+ }
201
+ return `
202
+ ` + Q + e;
203
+ }
204
+ }
205
+ var ee = !1, G;
206
+ {
207
+ var Ke = typeof WeakMap == "function" ? WeakMap : Map;
208
+ G = new Ke();
209
+ }
210
+ function he(e, r) {
211
+ if (!e || ee)
212
+ return "";
213
+ {
214
+ var t = G.get(e);
215
+ if (t !== void 0)
216
+ return t;
217
+ }
218
+ var o;
219
+ ee = !0;
220
+ var c = Error.prepareStackTrace;
221
+ Error.prepareStackTrace = void 0;
222
+ var d;
223
+ d = Z.current, Z.current = null, Je();
224
+ try {
225
+ if (r) {
226
+ var l = function() {
227
+ throw Error();
228
+ };
229
+ if (Object.defineProperty(l.prototype, "props", {
230
+ set: function() {
231
+ throw Error();
232
+ }
233
+ }), typeof Reflect == "object" && Reflect.construct) {
234
+ try {
235
+ Reflect.construct(l, []);
236
+ } catch (w) {
237
+ o = w;
238
+ }
239
+ Reflect.construct(e, [], l);
240
+ } else {
241
+ try {
242
+ l.call();
243
+ } catch (w) {
244
+ o = w;
245
+ }
246
+ e.call(l.prototype);
247
+ }
248
+ } else {
249
+ try {
250
+ throw Error();
251
+ } catch (w) {
252
+ o = w;
253
+ }
254
+ e();
255
+ }
256
+ } catch (w) {
257
+ if (w && o && typeof w.stack == "string") {
258
+ for (var i = w.stack.split(`
259
+ `), S = o.stack.split(`
260
+ `), h = i.length - 1, m = S.length - 1; h >= 1 && m >= 0 && i[h] !== S[m]; )
261
+ m--;
262
+ for (; h >= 1 && m >= 0; h--, m--)
263
+ if (i[h] !== S[m]) {
264
+ if (h !== 1 || m !== 1)
265
+ do
266
+ if (h--, m--, m < 0 || i[h] !== S[m]) {
267
+ var P = `
268
+ ` + i[h].replace(" at new ", " at ");
269
+ return e.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, P), P;
270
+ }
271
+ while (h >= 1 && m >= 0);
272
+ break;
273
+ }
274
+ }
275
+ } finally {
276
+ ee = !1, Z.current = d, qe(), Error.prepareStackTrace = c;
277
+ }
278
+ var W = e ? e.displayName || e.name : "", N = W ? z(W) : "";
279
+ return typeof e == "function" && G.set(e, N), N;
280
+ }
281
+ function He(e, r, t) {
282
+ return he(e, !1);
283
+ }
284
+ function Xe(e) {
285
+ var r = e.prototype;
286
+ return !!(r && r.isReactComponent);
287
+ }
288
+ function J(e, r, t) {
289
+ if (e == null)
290
+ return "";
291
+ if (typeof e == "function")
292
+ return he(e, Xe(e));
293
+ if (typeof e == "string")
294
+ return z(e);
295
+ switch (e) {
296
+ case k:
297
+ return z("Suspense");
298
+ case E:
299
+ return z("SuspenseList");
300
+ }
301
+ if (typeof e == "object")
302
+ switch (e.$$typeof) {
303
+ case b:
304
+ return He(e.render);
305
+ case C:
306
+ return J(e.type, r, t);
307
+ case s: {
308
+ var o = e, c = o._payload, d = o._init;
309
+ try {
310
+ return J(d(c), r, t);
311
+ } catch {
312
+ }
313
+ }
314
+ }
315
+ return "";
316
+ }
317
+ var V = Object.prototype.hasOwnProperty, ge = {}, me = O.ReactDebugCurrentFrame;
318
+ function q(e) {
319
+ if (e) {
320
+ var r = e._owner, t = J(e.type, e._source, r ? r.type : null);
321
+ me.setExtraStackFrame(t);
322
+ } else
323
+ me.setExtraStackFrame(null);
324
+ }
325
+ function Ze(e, r, t, o, c) {
326
+ {
327
+ var d = Function.call.bind(V);
328
+ for (var l in e)
329
+ if (d(e, l)) {
330
+ var i = void 0;
331
+ try {
332
+ if (typeof e[l] != "function") {
333
+ var S = Error((o || "React class") + ": " + t + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
+ throw S.name = "Invariant Violation", S;
335
+ }
336
+ i = e[l](r, l, o, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
+ } catch (h) {
338
+ i = h;
339
+ }
340
+ i && !(i instanceof Error) && (q(c), g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", t, l, typeof i), q(null)), i instanceof Error && !(i.message in ge) && (ge[i.message] = !0, q(c), g("Failed %s type: %s", t, i.message), q(null));
341
+ }
342
+ }
343
+ }
344
+ var Qe = Array.isArray;
345
+ function re(e) {
346
+ return Qe(e);
347
+ }
348
+ function er(e) {
349
+ {
350
+ var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
+ return t;
352
+ }
353
+ }
354
+ function rr(e) {
355
+ try {
356
+ return _e(e), !1;
357
+ } catch {
358
+ return !0;
359
+ }
360
+ }
361
+ function _e(e) {
362
+ return "" + e;
363
+ }
364
+ function ye(e) {
365
+ if (rr(e))
366
+ return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), _e(e);
367
+ }
368
+ var Re = O.ReactCurrentOwner, tr = {
369
+ key: !0,
370
+ ref: !0,
371
+ __self: !0,
372
+ __source: !0
373
+ }, Ee, xe;
374
+ function nr(e) {
375
+ if (V.call(e, "ref")) {
376
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
377
+ if (r && r.isReactWarning)
378
+ return !1;
379
+ }
380
+ return e.ref !== void 0;
381
+ }
382
+ function or(e) {
383
+ if (V.call(e, "key")) {
384
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
385
+ if (r && r.isReactWarning)
386
+ return !1;
387
+ }
388
+ return e.key !== void 0;
389
+ }
390
+ function ar(e, r) {
391
+ typeof e.ref == "string" && Re.current;
392
+ }
393
+ function ir(e, r) {
394
+ {
395
+ var t = function() {
396
+ Ee || (Ee = !0, g("%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://reactjs.org/link/special-props)", r));
397
+ };
398
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
399
+ get: t,
400
+ configurable: !0
401
+ });
402
+ }
403
+ }
404
+ function lr(e, r) {
405
+ {
406
+ var t = function() {
407
+ xe || (xe = !0, g("%s: `ref` 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://reactjs.org/link/special-props)", r));
408
+ };
409
+ t.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
+ get: t,
411
+ configurable: !0
412
+ });
413
+ }
414
+ }
415
+ var sr = function(e, r, t, o, c, d, l) {
416
+ var i = {
417
+ // This tag allows us to uniquely identify this as a React Element
418
+ $$typeof: v,
419
+ // Built-in properties that belong on the element
420
+ type: e,
421
+ key: r,
422
+ ref: t,
423
+ props: l,
424
+ // Record the component responsible for creating this element.
425
+ _owner: d
426
+ };
427
+ return i._store = {}, Object.defineProperty(i._store, "validated", {
428
+ configurable: !1,
429
+ enumerable: !1,
430
+ writable: !0,
431
+ value: !1
432
+ }), Object.defineProperty(i, "_self", {
433
+ configurable: !1,
434
+ enumerable: !1,
435
+ writable: !1,
436
+ value: o
437
+ }), Object.defineProperty(i, "_source", {
438
+ configurable: !1,
439
+ enumerable: !1,
440
+ writable: !1,
441
+ value: c
442
+ }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
443
+ };
444
+ function ur(e, r, t, o, c) {
445
+ {
446
+ var d, l = {}, i = null, S = null;
447
+ t !== void 0 && (ye(t), i = "" + t), or(r) && (ye(r.key), i = "" + r.key), nr(r) && (S = r.ref, ar(r, c));
448
+ for (d in r)
449
+ V.call(r, d) && !tr.hasOwnProperty(d) && (l[d] = r[d]);
450
+ if (e && e.defaultProps) {
451
+ var h = e.defaultProps;
452
+ for (d in h)
453
+ l[d] === void 0 && (l[d] = h[d]);
454
+ }
455
+ if (i || S) {
456
+ var m = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
+ i && ir(l, m), S && lr(l, m);
458
+ }
459
+ return sr(e, i, S, c, o, Re.current, l);
460
+ }
461
+ }
462
+ var te = O.ReactCurrentOwner, Se = O.ReactDebugCurrentFrame;
463
+ function $(e) {
464
+ if (e) {
465
+ var r = e._owner, t = J(e.type, e._source, r ? r.type : null);
466
+ Se.setExtraStackFrame(t);
467
+ } else
468
+ Se.setExtraStackFrame(null);
469
+ }
470
+ var ne;
471
+ ne = !1;
472
+ function oe(e) {
473
+ return typeof e == "object" && e !== null && e.$$typeof === v;
474
+ }
475
+ function je() {
476
+ {
477
+ if (te.current) {
478
+ var e = F(te.current.type);
479
+ if (e)
480
+ return `
481
+
482
+ Check the render method of \`` + e + "`.";
483
+ }
484
+ return "";
485
+ }
486
+ }
487
+ function cr(e) {
488
+ return "";
489
+ }
490
+ var Ce = {};
491
+ function fr(e) {
492
+ {
493
+ var r = je();
494
+ if (!r) {
495
+ var t = typeof e == "string" ? e : e.displayName || e.name;
496
+ t && (r = `
497
+
498
+ Check the top-level render call using <` + t + ">.");
499
+ }
500
+ return r;
501
+ }
502
+ }
503
+ function we(e, r) {
504
+ {
505
+ if (!e._store || e._store.validated || e.key != null)
506
+ return;
507
+ e._store.validated = !0;
508
+ var t = fr(r);
509
+ if (Ce[t])
510
+ return;
511
+ Ce[t] = !0;
512
+ var o = "";
513
+ e && e._owner && e._owner !== te.current && (o = " It was passed a child from " + F(e._owner.type) + "."), $(e), g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, o), $(null);
514
+ }
515
+ }
516
+ function Te(e, r) {
517
+ {
518
+ if (typeof e != "object")
519
+ return;
520
+ if (re(e))
521
+ for (var t = 0; t < e.length; t++) {
522
+ var o = e[t];
523
+ oe(o) && we(o, r);
524
+ }
525
+ else if (oe(e))
526
+ e._store && (e._store.validated = !0);
527
+ else if (e) {
528
+ var c = x(e);
529
+ if (typeof c == "function" && c !== e.entries)
530
+ for (var d = c.call(e), l; !(l = d.next()).done; )
531
+ oe(l.value) && we(l.value, r);
532
+ }
533
+ }
534
+ }
535
+ function dr(e) {
536
+ {
537
+ var r = e.type;
538
+ if (r == null || typeof r == "string")
539
+ return;
540
+ var t;
541
+ if (typeof r == "function")
542
+ t = r.propTypes;
543
+ else if (typeof r == "object" && (r.$$typeof === b || // Note: Memo only checks outer props here.
544
+ // Inner props are checked in the reconciler.
545
+ r.$$typeof === C))
546
+ t = r.propTypes;
547
+ else
548
+ return;
549
+ if (t) {
550
+ var o = F(r);
551
+ Ze(t, e.props, "prop", o, e);
552
+ } else if (r.PropTypes !== void 0 && !ne) {
553
+ ne = !0;
554
+ var c = F(r);
555
+ g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", c || "Unknown");
556
+ }
557
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
+ }
559
+ }
560
+ function vr(e) {
561
+ {
562
+ for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
563
+ var o = r[t];
564
+ if (o !== "children" && o !== "key") {
565
+ $(e), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), $(null);
566
+ break;
567
+ }
568
+ }
569
+ e.ref !== null && ($(e), g("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
570
+ }
571
+ }
572
+ var Oe = {};
573
+ function Pe(e, r, t, o, c, d) {
574
+ {
575
+ var l = ze(e);
576
+ if (!l) {
577
+ var i = "";
578
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
+ var S = cr();
580
+ S ? i += S : i += je();
581
+ var h;
582
+ e === null ? h = "null" : re(e) ? h = "array" : e !== void 0 && e.$$typeof === v ? (h = "<" + (F(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : h = typeof e, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", h, i);
583
+ }
584
+ var m = ur(e, r, t, c, d);
585
+ if (m == null)
586
+ return m;
587
+ if (l) {
588
+ var P = r.children;
589
+ if (P !== void 0)
590
+ if (o)
591
+ if (re(P)) {
592
+ for (var W = 0; W < P.length; W++)
593
+ Te(P[W], e);
594
+ Object.freeze && Object.freeze(P);
595
+ } else
596
+ g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
+ else
598
+ Te(P, e);
599
+ }
600
+ if (V.call(r, "key")) {
601
+ var N = F(e), w = Object.keys(r).filter(function(_r) {
602
+ return _r !== "key";
603
+ }), ae = w.length > 0 ? "{key: someKey, " + w.join(": ..., ") + ": ...}" : "{key: someKey}";
604
+ if (!Oe[N + ae]) {
605
+ var mr = w.length > 0 ? "{" + w.join(": ..., ") + ": ...}" : "{}";
606
+ g(`A props object containing a "key" prop is being spread into JSX:
607
+ let props = %s;
608
+ <%s {...props} />
609
+ React keys must be passed directly to JSX without using spread:
610
+ let props = %s;
611
+ <%s key={someKey} {...props} />`, ae, N, mr, N), Oe[N + ae] = !0;
612
+ }
613
+ }
614
+ return e === f ? vr(m) : dr(m), m;
615
+ }
616
+ }
617
+ function pr(e, r, t) {
618
+ return Pe(e, r, t, !0);
619
+ }
620
+ function br(e, r, t) {
621
+ return Pe(e, r, t, !1);
622
+ }
623
+ var hr = br, gr = pr;
624
+ U.Fragment = f, U.jsx = hr, U.jsxs = gr;
625
+ })()), U;
626
+ }
627
+ var Ne;
628
+ function Pr() {
629
+ return Ne || (Ne = 1, process.env.NODE_ENV === "production" ? H.exports = Tr() : H.exports = Or()), H.exports;
630
+ }
631
+ var p = Pr();
632
+ const kr = "_container_puorg_1", Dr = "_defaultSection_puorg_15", Ir = "_optionsList_puorg_35", Fr = "_optionItem_puorg_51", Ar = "_inputGroup_puorg_71", Nr = "_label_puorg_83", $r = "_input_puorg_71", Wr = "_colorInput_puorg_133", Lr = "_clearColorButton_puorg_163", Yr = "_removeButton_puorg_215", Br = "_addButton_puorg_269", R = {
633
+ container: kr,
634
+ defaultSection: Dr,
635
+ optionsList: Ir,
636
+ optionItem: Fr,
637
+ inputGroup: Ar,
638
+ label: Nr,
639
+ input: $r,
640
+ colorInput: Wr,
641
+ clearColorButton: Lr,
642
+ removeButton: Yr,
643
+ addButton: Br
644
+ }, We = ({
645
+ value: n,
646
+ onChange: v,
647
+ readOnly: T = !1
648
+ }) => {
649
+ const { options: f, defaultOption: _ } = n, D = L(() => {
650
+ const s = {
651
+ label: `選択肢${f.length + 1}`,
652
+ value: `option${f.length + 1}`
653
+ };
654
+ v({ ...n, options: [...f, s] });
655
+ }, [f, n, v]), I = L(
656
+ (s) => {
657
+ var x;
658
+ const u = f.filter((O, g) => g !== s), y = (x = f[s]) == null ? void 0 : x.value;
659
+ v({ options: u, defaultOption: y !== void 0 && _ === y ? void 0 : _ });
660
+ },
661
+ [f, _, v]
662
+ ), j = L(
663
+ (s, u) => {
664
+ const y = f.map(
665
+ (a, x) => x === s ? { ...a, label: u } : a
666
+ );
667
+ v({ ...n, options: y });
668
+ },
669
+ [f, n, v]
670
+ ), b = L(
671
+ (s, u) => {
672
+ var O;
673
+ const y = (O = f[s]) == null ? void 0 : O.value, a = f.map(
674
+ (g, X) => X === s ? { ...g, value: u } : g
675
+ );
676
+ v({ options: a, defaultOption: _ === y ? u : _ });
677
+ },
678
+ [f, _, v]
679
+ ), k = L(
680
+ (s, u) => {
681
+ const y = f.map(
682
+ (a, x) => x === s ? { ...a, color: u || void 0 } : a
683
+ );
684
+ v({ ...n, options: y });
685
+ },
686
+ [f, n, v]
687
+ ), E = L(
688
+ (s) => {
689
+ v({ ...n, defaultOption: s || void 0 });
690
+ },
691
+ [n, v]
692
+ ), C = yr();
693
+ return /* @__PURE__ */ p.jsxs("div", { className: R.container, children: [
694
+ /* @__PURE__ */ p.jsxs("div", { className: R.defaultSection, children: [
695
+ /* @__PURE__ */ p.jsx("label", { className: R.label, htmlFor: C, children: "初期選択値:" }),
696
+ /* @__PURE__ */ p.jsxs(
697
+ "select",
698
+ {
699
+ id: C,
700
+ className: R.input,
701
+ value: _ || "",
702
+ onChange: (s) => E(s.target.value),
703
+ disabled: T,
704
+ children: [
705
+ /* @__PURE__ */ p.jsx("option", { value: "", children: "未選択" }),
706
+ f.map((s, u) => (
707
+ // biome-ignore lint/suspicious/noArrayIndexKey: 選択肢の順序は重要で、固有IDがないためindexを使用
708
+ /* @__PURE__ */ p.jsx("option", { value: s.value, children: s.label }, u)
709
+ ))
710
+ ]
711
+ }
712
+ )
713
+ ] }),
714
+ /* @__PURE__ */ p.jsx("div", { className: R.optionsList, children: f.map((s, u) => (
715
+ // biome-ignore lint/suspicious/noArrayIndexKey: 選択肢の順序は重要で、固有IDがないためindexを使用
716
+ /* @__PURE__ */ p.jsxs("div", { className: R.optionItem, children: [
717
+ /* @__PURE__ */ p.jsxs("div", { className: R.inputGroup, children: [
718
+ /* @__PURE__ */ p.jsx("label", { className: R.label, htmlFor: `label-${u}`, children: "ラベル:" }),
719
+ /* @__PURE__ */ p.jsx(
720
+ "input",
721
+ {
722
+ type: "text",
723
+ id: `label-${u}`,
724
+ className: R.input,
725
+ value: s.label,
726
+ onChange: (y) => j(u, y.target.value),
727
+ disabled: T,
728
+ placeholder: "表示名"
729
+ }
730
+ )
731
+ ] }),
732
+ /* @__PURE__ */ p.jsxs("div", { className: R.inputGroup, children: [
733
+ /* @__PURE__ */ p.jsx("label", { className: R.label, htmlFor: `value-${u}`, children: "値:" }),
734
+ /* @__PURE__ */ p.jsx(
735
+ "input",
736
+ {
737
+ type: "text",
738
+ id: `value-${u}`,
739
+ className: R.input,
740
+ value: s.value,
741
+ onChange: (y) => b(u, y.target.value),
742
+ disabled: T,
743
+ placeholder: "内部値"
744
+ }
745
+ )
746
+ ] }),
747
+ /* @__PURE__ */ p.jsxs("div", { className: R.inputGroup, children: [
748
+ /* @__PURE__ */ p.jsx("label", { className: R.label, htmlFor: `color-${u}`, children: "色:" }),
749
+ /* @__PURE__ */ p.jsx(
750
+ "input",
751
+ {
752
+ type: "color",
753
+ id: `color-${u}`,
754
+ className: R.colorInput,
755
+ value: s.color || "#ffffff",
756
+ onChange: (y) => k(u, y.target.value),
757
+ disabled: T,
758
+ title: "背景色"
759
+ }
760
+ ),
761
+ s.color && /* @__PURE__ */ p.jsx(
762
+ "button",
763
+ {
764
+ type: "button",
765
+ className: R.clearColorButton,
766
+ onClick: () => k(u, ""),
767
+ disabled: T,
768
+ title: "色をクリア",
769
+ children: "✕"
770
+ }
771
+ )
772
+ ] }),
773
+ /* @__PURE__ */ p.jsx(
774
+ "button",
775
+ {
776
+ type: "button",
777
+ className: R.removeButton,
778
+ onClick: () => I(u),
779
+ disabled: T || f.length === 1,
780
+ title: "削除",
781
+ children: "×"
782
+ }
783
+ )
784
+ ] }, u)
785
+ )) }),
786
+ /* @__PURE__ */ p.jsx(
787
+ "button",
788
+ {
789
+ type: "button",
790
+ className: R.addButton,
791
+ onClick: D,
792
+ disabled: T,
793
+ children: "+ 選択肢を追加"
794
+ }
795
+ )
796
+ ] });
797
+ };
798
+ We.displayName = "OptionsEditor";
799
+ const Le = Rr(({ props: n, value: v, onChange: T, onBlur: f, readOnly: _, mode: D }, I) => {
800
+ const j = Er(null);
801
+ xr(
802
+ I,
803
+ () => ({
804
+ focus: () => {
805
+ var a, x, O;
806
+ (a = j.current) == null || a.focus(), j.current && !_ && ((O = (x = j.current).showPicker) == null || O.call(x));
807
+ }
808
+ }),
809
+ [_]
810
+ );
811
+ const b = K(() => v && n.selectConfig.options.find((a) => a.value === v) || null, [v, n.selectConfig.options]), k = K(() => {
812
+ const a = {
813
+ width: "100%",
814
+ height: "100%",
815
+ display: "flex",
816
+ boxSizing: "border-box",
817
+ overflow: "hidden",
818
+ position: "relative"
819
+ // 矢印アイコンの配置用
820
+ };
821
+ switch (n.justifyContent) {
822
+ case ke.center:
823
+ a.justifyContent = "center";
824
+ break;
825
+ case ke.right:
826
+ a.justifyContent = "flex-end";
827
+ break;
828
+ default:
829
+ a.justifyContent = "flex-start";
830
+ break;
831
+ }
832
+ switch (n.alignItems) {
833
+ case De.top:
834
+ a.alignItems = "flex-start";
835
+ break;
836
+ case De.bottom:
837
+ a.alignItems = "flex-end";
838
+ break;
839
+ default:
840
+ a.alignItems = "center";
841
+ break;
842
+ }
843
+ if (n.isIndividual)
844
+ n.top && (a.paddingTop = Y.fromDim(n.top)), n.right && (a.paddingRight = Y.fromDim(n.right)), n.bottom && (a.paddingBottom = Y.fromDim(n.bottom)), n.left && (a.paddingLeft = Y.fromDim(n.left));
845
+ else if (n.all) {
846
+ const x = Y.fromDim(n.all);
847
+ a.padding = `${x}px`;
848
+ }
849
+ return a;
850
+ }, [n]), E = K(() => {
851
+ const a = {
852
+ appearance: "none",
853
+ // ネイティブの矢印を消す
854
+ background: "transparent",
855
+ border: "none",
856
+ // 枠線を削除
857
+ outline: "none",
858
+ padding: "4px 28px 4px 8px",
859
+ // 右側に矢印用のスペース
860
+ margin: 0,
861
+ width: "100%",
862
+ height: "100%",
863
+ // ブロック全体の高さに合わせる
864
+ boxSizing: "border-box",
865
+ fontFamily: "inherit",
866
+ cursor: "pointer",
867
+ // readOnly時は操作を無効化(disabledを使わない)
868
+ pointerEvents: _ ? "none" : "auto"
869
+ };
870
+ return n.fontSize && (a.fontSize = Y.fromDim(n.fontSize)), n.color && (a.color = n.color), n.fontWeight && (a.fontWeight = "bold"), n.italic && (a.fontStyle = "italic"), v && (b != null && b.color) ? a.backgroundColor = b.color : a.backgroundColor = "transparent", a;
871
+ }, [
872
+ n.fontSize,
873
+ n.color,
874
+ n.fontWeight,
875
+ n.italic,
876
+ b,
877
+ _,
878
+ v
879
+ ]), C = {
880
+ position: "absolute",
881
+ right: "8px",
882
+ top: "50%",
883
+ transform: "translateY(-50%)",
884
+ pointerEvents: "none",
885
+ width: "0",
886
+ height: "0",
887
+ borderLeft: "4px solid transparent",
888
+ borderRight: "4px solid transparent",
889
+ borderTop: "5px solid",
890
+ borderTopColor: n.color || "#6b7280"
891
+ }, s = K(() => D === Ie.FORM ? !0 : D === Ie.EDIT ? !_ : !1, [D, _]), u = (a) => {
892
+ const x = a.target.value;
893
+ T(x === "" ? null : x);
894
+ }, y = () => {
895
+ f && f(v);
896
+ };
897
+ return /* @__PURE__ */ p.jsxs("div", { style: k, children: [
898
+ /* @__PURE__ */ p.jsxs(
899
+ "select",
900
+ {
901
+ ref: j,
902
+ value: v ?? "",
903
+ onChange: u,
904
+ onBlur: y,
905
+ style: E,
906
+ children: [
907
+ /* @__PURE__ */ p.jsx("option", { value: "", style: { backgroundColor: "#ffffff" }, children: "未選択" }),
908
+ n.selectConfig.options.map((a) => /* @__PURE__ */ p.jsx(
909
+ "option",
910
+ {
911
+ value: a.value,
912
+ style: a.color ? { backgroundColor: a.color } : void 0,
913
+ children: a.label
914
+ },
915
+ a.value
916
+ ))
917
+ ]
918
+ }
919
+ ),
920
+ s && /* @__PURE__ */ p.jsx("div", { style: C })
921
+ ] });
922
+ });
923
+ Le.displayName = "SelectRenderer";
924
+ const Ur = {
925
+ kind: "select",
926
+ meta: {
927
+ displayName: "セレクトボックス",
928
+ description: "ドロップダウンから選択肢を選ぶ入力ブロック",
929
+ defaultSize: { w: 4, h: 2 }
930
+ },
931
+ Renderer: Le,
932
+ properties: {
933
+ ...wr,
934
+ // alignment + padding
935
+ ...Cr,
936
+ ...jr,
937
+ ...Sr,
938
+ // Select固有プロパティ - 選択肢とデフォルト値を統合
939
+ selectConfig: {
940
+ defaultValue: {
941
+ options: [
942
+ { label: "選択肢1", value: "option1" },
943
+ { label: "選択肢2", value: "option2" }
944
+ ],
945
+ defaultOption: void 0
946
+ },
947
+ label: "選択肢設定",
948
+ group: "セレクト",
949
+ Component: We,
950
+ disableInMultiSelection: !0
951
+ }
952
+ },
953
+ validateProps: (n) => n,
954
+ validateValue: (n) => typeof n == "string" ? n : null
955
+ };
956
+ export {
957
+ We as OptionsEditor,
958
+ Ur as SelectPlugin,
959
+ Le as SelectRenderer
960
+ };
961
+ //# sourceMappingURL=index.mjs.map