@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.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +249 -246
- package/dist/index.mjs.map +1 -1
- package/dist/select.css +1 -1
- package/dist/src/OptionsEditor.d.ts.map +1 -1
- package/dist/src/SelectRenderer.d.ts.map +1 -1
- package/package.json +66 -63
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ce, { useCallback as
|
|
2
|
-
import { HorizontalAlign as
|
|
3
|
-
var
|
|
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
|
|
14
|
+
function ge() {
|
|
15
15
|
if (X) return N;
|
|
16
16
|
X = 1;
|
|
17
|
-
var t = Symbol.for("react.transitional.element"),
|
|
18
|
-
function
|
|
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 (
|
|
21
|
-
|
|
22
|
-
for (var
|
|
23
|
-
|
|
24
|
-
} else
|
|
25
|
-
return i =
|
|
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 =
|
|
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
|
|
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
|
|
54
|
+
case f:
|
|
55
55
|
return "Fragment";
|
|
56
|
-
case
|
|
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
|
|
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
|
|
75
|
+
case D:
|
|
76
76
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
77
77
|
case te:
|
|
78
|
-
var
|
|
79
|
-
return e = e.displayName, e || (e =
|
|
80
|
-
case
|
|
81
|
-
return
|
|
82
|
-
case
|
|
83
|
-
|
|
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(
|
|
85
|
+
return t(e(n));
|
|
86
86
|
} catch {
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
return null;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function c(e) {
|
|
92
92
|
return "" + e;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function _(e) {
|
|
95
95
|
try {
|
|
96
|
-
|
|
97
|
-
var
|
|
96
|
+
c(e);
|
|
97
|
+
var n = !1;
|
|
98
98
|
} catch {
|
|
99
|
-
|
|
99
|
+
n = !0;
|
|
100
100
|
}
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
var u =
|
|
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
|
-
|
|
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
|
-
|
|
108
|
-
),
|
|
107
|
+
d
|
|
108
|
+
), c(e);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
function l(e) {
|
|
112
|
-
if (e ===
|
|
113
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
112
|
+
if (e === f) return "<>";
|
|
113
|
+
if (typeof e == "object" && e !== null && e.$$typeof === $)
|
|
114
114
|
return "<...>";
|
|
115
115
|
try {
|
|
116
|
-
var
|
|
117
|
-
return
|
|
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 =
|
|
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 (
|
|
131
|
-
var
|
|
132
|
-
if (
|
|
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
|
|
136
|
+
function v(e, n) {
|
|
137
137
|
function u() {
|
|
138
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
155
|
-
var
|
|
154
|
+
function S(e, n, u, d, A, F) {
|
|
155
|
+
var m = u.ref;
|
|
156
156
|
return e = {
|
|
157
|
-
$$typeof:
|
|
157
|
+
$$typeof: p,
|
|
158
158
|
type: e,
|
|
159
|
-
key:
|
|
159
|
+
key: n,
|
|
160
160
|
props: u,
|
|
161
|
-
_owner:
|
|
162
|
-
}, (
|
|
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:
|
|
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
|
|
188
|
-
var
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
if (ie(
|
|
192
|
-
for (
|
|
193
|
-
x(
|
|
194
|
-
Object.freeze && Object.freeze(
|
|
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(
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
var
|
|
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
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
), G[p + m] = !0);
|
|
214
|
+
y,
|
|
215
|
+
m
|
|
216
|
+
), U[m + d] = !0);
|
|
217
217
|
}
|
|
218
|
-
if (
|
|
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
|
|
221
|
-
|
|
222
|
-
} else u =
|
|
223
|
-
return
|
|
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
|
-
),
|
|
226
|
+
), S(
|
|
227
227
|
e,
|
|
228
|
-
|
|
228
|
+
m,
|
|
229
229
|
u,
|
|
230
230
|
i(),
|
|
231
|
-
|
|
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 ===
|
|
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 ===
|
|
239
|
+
return typeof e == "object" && e !== null && e.$$typeof === p;
|
|
240
240
|
}
|
|
241
|
-
var
|
|
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
|
-
|
|
244
|
+
o = {
|
|
245
245
|
react_stack_bottom_frame: function(e) {
|
|
246
246
|
return e();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
)(),
|
|
253
|
-
O.Fragment =
|
|
254
|
-
var
|
|
255
|
-
return
|
|
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
|
-
|
|
257
|
+
n,
|
|
258
258
|
u,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
d ? Error("react-stack-top-frame") : B,
|
|
261
|
+
d ? Y(l(e)) : G
|
|
262
262
|
);
|
|
263
|
-
}, O.jsxs = function(e,
|
|
264
|
-
var
|
|
265
|
-
return
|
|
263
|
+
}, O.jsxs = function(e, n, u) {
|
|
264
|
+
var d = 1e4 > L.recentlyCreatedOwnerStacks++;
|
|
265
|
+
return w(
|
|
266
266
|
e,
|
|
267
|
-
|
|
267
|
+
n,
|
|
268
268
|
u,
|
|
269
269
|
!0,
|
|
270
|
-
|
|
271
|
-
|
|
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
|
|
278
|
-
return Z || (Z = 1, process.env.NODE_ENV === "production" ?
|
|
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
|
|
281
|
-
const
|
|
282
|
-
container:
|
|
283
|
-
defaultSection:
|
|
284
|
-
optionsList:
|
|
285
|
-
optionItem:
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
removeButton:
|
|
292
|
-
addButton:
|
|
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:
|
|
296
|
-
readOnly:
|
|
295
|
+
onChange: c,
|
|
296
|
+
readOnly: _ = !1
|
|
297
297
|
}) => {
|
|
298
|
-
const { options: l, defaultOption: i } = t,
|
|
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
|
-
|
|
304
|
-
}, [l, t,
|
|
303
|
+
c({ ...t, options: [...l, a] });
|
|
304
|
+
}, [l, t, c]), g = j(
|
|
305
305
|
(a) => {
|
|
306
|
-
var
|
|
307
|
-
const
|
|
308
|
-
|
|
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,
|
|
311
|
-
),
|
|
312
|
-
(a,
|
|
313
|
-
const
|
|
314
|
-
(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
|
-
|
|
316
|
+
c({ ...t, options: p });
|
|
317
317
|
},
|
|
318
|
-
[l, t,
|
|
319
|
-
), E =
|
|
320
|
-
(a,
|
|
318
|
+
[l, t, c]
|
|
319
|
+
), E = j(
|
|
320
|
+
(a, o) => {
|
|
321
321
|
var R;
|
|
322
|
-
const
|
|
323
|
-
(
|
|
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
|
-
|
|
325
|
+
c({ options: r, defaultOption: i === p ? o : i });
|
|
326
326
|
},
|
|
327
|
-
[l, i,
|
|
328
|
-
),
|
|
329
|
-
(a,
|
|
330
|
-
const
|
|
331
|
-
(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
|
-
|
|
333
|
+
c({ ...t, options: p });
|
|
334
334
|
},
|
|
335
|
-
[l, t,
|
|
336
|
-
),
|
|
335
|
+
[l, t, c]
|
|
336
|
+
), w = j(
|
|
337
337
|
(a) => {
|
|
338
|
-
|
|
338
|
+
c({ ...t, defaultOption: a || void 0 });
|
|
339
339
|
},
|
|
340
|
-
[t,
|
|
340
|
+
[t, c]
|
|
341
341
|
), x = ue();
|
|
342
|
-
return /* @__PURE__ */
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
/* @__PURE__ */
|
|
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) =>
|
|
352
|
-
disabled:
|
|
351
|
+
onChange: (a) => w(a.target.value),
|
|
352
|
+
disabled: _,
|
|
353
353
|
children: [
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
l.map((a,
|
|
356
|
-
|
|
357
|
-
/* @__PURE__ */
|
|
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__ */
|
|
364
|
-
|
|
365
|
-
/* @__PURE__ */
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
|
|
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-${
|
|
389
|
+
id: `label-${o}`,
|
|
373
390
|
className: b.input,
|
|
374
391
|
value: a.label,
|
|
375
|
-
onChange: (
|
|
376
|
-
disabled:
|
|
392
|
+
onChange: (r) => v(o, r.target.value),
|
|
393
|
+
disabled: _,
|
|
377
394
|
placeholder: "表示名"
|
|
378
395
|
}
|
|
379
396
|
)
|
|
380
397
|
] }),
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
/* @__PURE__ */
|
|
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-${
|
|
404
|
+
id: `value-${o}`,
|
|
388
405
|
className: b.input,
|
|
389
406
|
value: a.value,
|
|
390
|
-
onChange: (
|
|
391
|
-
disabled:
|
|
407
|
+
onChange: (r) => E(o, r.target.value),
|
|
408
|
+
disabled: _,
|
|
392
409
|
placeholder: "内部値"
|
|
393
410
|
}
|
|
394
411
|
)
|
|
395
412
|
] }),
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
|
|
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
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
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
|
-
|
|
423
|
-
|
|
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:
|
|
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:
|
|
449
|
-
const
|
|
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,
|
|
455
|
-
(r =
|
|
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 =
|
|
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
|
|
463
|
+
case C.center:
|
|
472
464
|
r.justifyContent = "center";
|
|
473
465
|
break;
|
|
474
|
-
case
|
|
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 =
|
|
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
|
|
496
|
-
r.padding = `${
|
|
487
|
+
const f = T.fromDim(t.all);
|
|
488
|
+
r.padding = `${f}px`;
|
|
497
489
|
}
|
|
498
|
-
return r;
|
|
499
|
-
}, [t]),
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
},
|
|
544
|
-
l && l(
|
|
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__ */
|
|
547
|
-
/* @__PURE__ */
|
|
549
|
+
return /* @__PURE__ */ s.jsxs("div", { style: S, children: [
|
|
550
|
+
/* @__PURE__ */ s.jsxs(
|
|
548
551
|
"select",
|
|
549
552
|
{
|
|
550
|
-
ref:
|
|
551
|
-
value:
|
|
552
|
-
onChange:
|
|
553
|
-
onBlur:
|
|
554
|
-
style:
|
|
553
|
+
ref: v,
|
|
554
|
+
value: c ?? "",
|
|
555
|
+
onChange: o,
|
|
556
|
+
onBlur: p,
|
|
557
|
+
style: w,
|
|
555
558
|
children: [
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
t.selectConfig.options.map((r) => /* @__PURE__ */
|
|
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__ */
|
|
572
|
+
a && /* @__PURE__ */ s.jsx("div", { style: x })
|
|
570
573
|
] });
|
|
571
574
|
});
|
|
572
575
|
K.displayName = "SelectRenderer";
|
|
573
|
-
const
|
|
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
|
-
...
|
|
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
|
-
|
|
610
|
+
De as SelectPlugin,
|
|
608
611
|
K as SelectRenderer
|
|
609
612
|
};
|
|
610
613
|
//# sourceMappingURL=index.mjs.map
|