@xeplr/ui-schema-handler 1.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/LICENSE +21 -0
- package/package.json +30 -0
- package/src/DynamicForm.jsx +138 -0
- package/src/SchemaEditor.jsx +218 -0
- package/src/index.js +4 -0
- package/src/styles.css +87 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Xeplr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xeplr/ui-schema-handler",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "React components for @xeplr/schema-handler — DynamicForm, SchemaEditor, FieldEditor",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"src/"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"schema",
|
|
12
|
+
"form",
|
|
13
|
+
"react",
|
|
14
|
+
"dynamic-form",
|
|
15
|
+
"field-editor"
|
|
16
|
+
],
|
|
17
|
+
"author": "xeplr",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/Xeplr/xeplr-ui-schema-handler"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
28
|
+
"@xeplr/schema-handler": "^1.0.0"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Render form inputs from a schema array.
|
|
5
|
+
*
|
|
6
|
+
* Props:
|
|
7
|
+
* schema — [{name, type, required, default, description, order}]
|
|
8
|
+
* value — { [name]: value }
|
|
9
|
+
* onChange(nextValue) — full-form change (called with the new value object)
|
|
10
|
+
* errors — optional { [name]: 'error message' } for inline field errors
|
|
11
|
+
* disabled — optional boolean, disables all inputs
|
|
12
|
+
* labels — optional { [name]: 'Custom Label' } to override display labels
|
|
13
|
+
*/
|
|
14
|
+
export function DynamicForm({ schema = [], value = {}, onChange, errors = {}, disabled = false, labels = {} }) {
|
|
15
|
+
const fields = [...(schema || [])]
|
|
16
|
+
.filter(f => f && f.name)
|
|
17
|
+
.sort((a, b) => (a.order ?? 999) - (b.order ?? 999));
|
|
18
|
+
|
|
19
|
+
const setField = (name, next) => {
|
|
20
|
+
onChange && onChange({ ...value, [name]: next });
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div className="xeplr-shf-form">
|
|
25
|
+
{fields.map(field => (
|
|
26
|
+
<FieldRow
|
|
27
|
+
key={field.name}
|
|
28
|
+
field={field}
|
|
29
|
+
label={labels[field.name] ?? humanize(field.name)}
|
|
30
|
+
value={value[field.name]}
|
|
31
|
+
onChange={(v) => setField(field.name, v)}
|
|
32
|
+
error={errors[field.name]}
|
|
33
|
+
disabled={disabled}
|
|
34
|
+
/>
|
|
35
|
+
))}
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function FieldRow({ field, label, value, onChange, error, disabled }) {
|
|
41
|
+
return (
|
|
42
|
+
<label className={`xeplr-shf-field${error ? ' xeplr-shf-field--error' : ''}`}>
|
|
43
|
+
<span className="xeplr-shf-label">
|
|
44
|
+
{label}
|
|
45
|
+
{field.required && <span className="xeplr-shf-required" title="Required">*</span>}
|
|
46
|
+
<span className="xeplr-shf-type">{field.type || 'string'}</span>
|
|
47
|
+
</span>
|
|
48
|
+
{field.description && <span className="xeplr-shf-desc">{field.description}</span>}
|
|
49
|
+
<Input field={field} value={value} onChange={onChange} disabled={disabled} />
|
|
50
|
+
{error && <span className="xeplr-shf-err">{error}</span>}
|
|
51
|
+
</label>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function Input({ field, value, onChange, disabled }) {
|
|
56
|
+
const common = { disabled, className: 'xeplr-shf-input' };
|
|
57
|
+
const t = field.type || 'string';
|
|
58
|
+
const shown = value ?? field.default ?? '';
|
|
59
|
+
|
|
60
|
+
if (t === 'boolean') {
|
|
61
|
+
return (
|
|
62
|
+
<input
|
|
63
|
+
type="checkbox"
|
|
64
|
+
className="xeplr-shf-input xeplr-shf-input--check"
|
|
65
|
+
checked={!!value}
|
|
66
|
+
onChange={(e) => onChange(e.target.checked)}
|
|
67
|
+
disabled={disabled}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
if (t === 'number') {
|
|
72
|
+
return (
|
|
73
|
+
<input
|
|
74
|
+
type="number"
|
|
75
|
+
{...common}
|
|
76
|
+
value={value ?? ''}
|
|
77
|
+
onChange={(e) => onChange(e.target.value === '' ? undefined : Number(e.target.value))}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
if (t === 'date') {
|
|
82
|
+
// input type=date wants yyyy-mm-dd
|
|
83
|
+
const iso = value ? String(value).slice(0, 10) : '';
|
|
84
|
+
return <input type="date" {...common} value={iso} onChange={(e) => onChange(e.target.value)} />;
|
|
85
|
+
}
|
|
86
|
+
if (t === 'object' || t === 'array') {
|
|
87
|
+
// v1: JSON textarea. Nested sub-forms come later.
|
|
88
|
+
return <JsonInput common={common} value={value} onChange={onChange} kind={t} />;
|
|
89
|
+
}
|
|
90
|
+
// string (default)
|
|
91
|
+
return (
|
|
92
|
+
<input
|
|
93
|
+
type="text"
|
|
94
|
+
{...common}
|
|
95
|
+
value={shown ?? ''}
|
|
96
|
+
onChange={(e) => onChange(e.target.value)}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function JsonInput({ common, value, onChange, kind }) {
|
|
102
|
+
const [draft, setDraft] = React.useState(() => stringify(value));
|
|
103
|
+
const [err, setErr] = React.useState(null);
|
|
104
|
+
React.useEffect(() => { setDraft(stringify(value)); setErr(null); }, [value]);
|
|
105
|
+
const commit = (text) => {
|
|
106
|
+
setDraft(text);
|
|
107
|
+
if (text.trim() === '') { onChange(kind === 'array' ? [] : {}); setErr(null); return; }
|
|
108
|
+
try { onChange(JSON.parse(text)); setErr(null); }
|
|
109
|
+
catch (e) { setErr(e.message); }
|
|
110
|
+
};
|
|
111
|
+
return (
|
|
112
|
+
<div className="xeplr-shf-json">
|
|
113
|
+
<textarea
|
|
114
|
+
{...common}
|
|
115
|
+
className="xeplr-shf-input xeplr-shf-input--json"
|
|
116
|
+
rows={4}
|
|
117
|
+
value={draft}
|
|
118
|
+
onChange={(e) => commit(e.target.value)}
|
|
119
|
+
placeholder={kind === 'array' ? '[]' : '{}'}
|
|
120
|
+
/>
|
|
121
|
+
{err && <span className="xeplr-shf-err">Invalid JSON: {err}</span>}
|
|
122
|
+
</div>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function stringify(v) {
|
|
127
|
+
if (v === undefined || v === null) return '';
|
|
128
|
+
try { return JSON.stringify(v, null, 2); } catch { return ''; }
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function humanize(name) {
|
|
132
|
+
return String(name)
|
|
133
|
+
.replace(/([A-Z])/g, ' $1')
|
|
134
|
+
.replace(/[_-]/g, ' ')
|
|
135
|
+
.replace(/\s+/g, ' ')
|
|
136
|
+
.trim()
|
|
137
|
+
.replace(/^\w/, c => c.toUpperCase());
|
|
138
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TYPES } from '@xeplr/schema-handler';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Table-per-schema editor. One row = one field. Reorder via ↑/↓ arrows.
|
|
6
|
+
*
|
|
7
|
+
* Props:
|
|
8
|
+
* schema — array of field defs
|
|
9
|
+
* onChange(nextSchema)
|
|
10
|
+
* addLabel — button label; default "+ Add field"
|
|
11
|
+
*
|
|
12
|
+
* Field shape:
|
|
13
|
+
* { name, type, label?, required, default, description, order }
|
|
14
|
+
*/
|
|
15
|
+
export function SchemaEditor({ schema = [], onChange, addLabel = '+ Add field' }) {
|
|
16
|
+
const rows = React.useMemo(() => sortByOrder(schema), [schema]);
|
|
17
|
+
const emit = (next) => onChange && onChange(next);
|
|
18
|
+
|
|
19
|
+
const setAt = (idx, next) => {
|
|
20
|
+
const copy = rows.slice();
|
|
21
|
+
copy[idx] = next;
|
|
22
|
+
emit(reindexOrder(copy));
|
|
23
|
+
};
|
|
24
|
+
const removeAt = (idx) => {
|
|
25
|
+
const copy = rows.slice();
|
|
26
|
+
copy.splice(idx, 1);
|
|
27
|
+
emit(reindexOrder(copy));
|
|
28
|
+
};
|
|
29
|
+
const move = (idx, delta) => {
|
|
30
|
+
const target = idx + delta;
|
|
31
|
+
if (target < 0 || target >= rows.length) return;
|
|
32
|
+
const copy = rows.slice();
|
|
33
|
+
const [item] = copy.splice(idx, 1);
|
|
34
|
+
copy.splice(target, 0, item);
|
|
35
|
+
emit(reindexOrder(copy));
|
|
36
|
+
};
|
|
37
|
+
const add = () => {
|
|
38
|
+
const next = rows.concat([{ name: '', type: 'string' }]);
|
|
39
|
+
emit(reindexOrder(next));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div className="xeplr-shf-table-wrap">
|
|
44
|
+
<table className="xeplr-shf-table">
|
|
45
|
+
<thead>
|
|
46
|
+
<tr>
|
|
47
|
+
<th className="xeplr-shf-th-move"></th>
|
|
48
|
+
<th>Name</th>
|
|
49
|
+
<th>Type</th>
|
|
50
|
+
<th>Label</th>
|
|
51
|
+
<th>Default value</th>
|
|
52
|
+
<th className="xeplr-shf-th-center">Required</th>
|
|
53
|
+
<th>Description</th>
|
|
54
|
+
<th className="xeplr-shf-th-remove"></th>
|
|
55
|
+
</tr>
|
|
56
|
+
</thead>
|
|
57
|
+
<tbody>
|
|
58
|
+
{rows.length === 0 && (
|
|
59
|
+
<tr><td colSpan={8} className="xeplr-shf-empty-row">No fields yet.</td></tr>
|
|
60
|
+
)}
|
|
61
|
+
{rows.map((field, i) => (
|
|
62
|
+
<FieldRow
|
|
63
|
+
key={i}
|
|
64
|
+
field={field}
|
|
65
|
+
isFirst={i === 0}
|
|
66
|
+
isLast={i === rows.length - 1}
|
|
67
|
+
onChange={(next) => setAt(i, next)}
|
|
68
|
+
onRemove={() => removeAt(i)}
|
|
69
|
+
onMoveUp={() => move(i, -1)}
|
|
70
|
+
onMoveDown={() => move(i, 1)}
|
|
71
|
+
/>
|
|
72
|
+
))}
|
|
73
|
+
</tbody>
|
|
74
|
+
</table>
|
|
75
|
+
<button type="button" className="xeplr-shf-add-btn" onClick={add}>{addLabel}</button>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function FieldRow({ field, isFirst, isLast, onChange, onRemove, onMoveUp, onMoveDown }) {
|
|
81
|
+
const set = (k, v) => onChange({ ...field, [k]: v });
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<tr className="xeplr-shf-tr">
|
|
85
|
+
<td className="xeplr-shf-td-move">
|
|
86
|
+
<button type="button" className="xeplr-shf-move" onClick={onMoveUp} disabled={isFirst} title="Move up">↑</button>
|
|
87
|
+
<button type="button" className="xeplr-shf-move" onClick={onMoveDown} disabled={isLast} title="Move down">↓</button>
|
|
88
|
+
</td>
|
|
89
|
+
<td>
|
|
90
|
+
<input
|
|
91
|
+
type="text"
|
|
92
|
+
className="xeplr-shf-inp xeplr-shf-inp--code"
|
|
93
|
+
value={field.name || ''}
|
|
94
|
+
onChange={(e) => set('name', e.target.value)}
|
|
95
|
+
placeholder="fieldName"
|
|
96
|
+
/>
|
|
97
|
+
</td>
|
|
98
|
+
<td>
|
|
99
|
+
<select
|
|
100
|
+
className="xeplr-shf-inp xeplr-shf-inp--type"
|
|
101
|
+
value={field.type || 'string'}
|
|
102
|
+
onChange={(e) => set('type', e.target.value)}
|
|
103
|
+
>
|
|
104
|
+
{TYPES.map(t => <option key={t} value={t}>{t}</option>)}
|
|
105
|
+
</select>
|
|
106
|
+
</td>
|
|
107
|
+
<td>
|
|
108
|
+
<input
|
|
109
|
+
type="text"
|
|
110
|
+
className="xeplr-shf-inp xeplr-shf-inp--muted"
|
|
111
|
+
value={field.label || ''}
|
|
112
|
+
onChange={(e) => set('label', e.target.value)}
|
|
113
|
+
placeholder="optional"
|
|
114
|
+
/>
|
|
115
|
+
</td>
|
|
116
|
+
<td>
|
|
117
|
+
<DefaultInput field={field} onChange={(v) => set('default', v)} />
|
|
118
|
+
</td>
|
|
119
|
+
<td className="xeplr-shf-td-center">
|
|
120
|
+
<input
|
|
121
|
+
type="checkbox"
|
|
122
|
+
className="xeplr-shf-chk"
|
|
123
|
+
checked={!!field.required}
|
|
124
|
+
onChange={(e) => set('required', e.target.checked)}
|
|
125
|
+
/>
|
|
126
|
+
</td>
|
|
127
|
+
<td>
|
|
128
|
+
<input
|
|
129
|
+
type="text"
|
|
130
|
+
className="xeplr-shf-inp xeplr-shf-inp--muted"
|
|
131
|
+
value={field.description || ''}
|
|
132
|
+
onChange={(e) => set('description', e.target.value)}
|
|
133
|
+
placeholder="optional"
|
|
134
|
+
/>
|
|
135
|
+
</td>
|
|
136
|
+
<td className="xeplr-shf-td-remove">
|
|
137
|
+
<button type="button" className="xeplr-shf-x" onClick={onRemove} title="Remove field">×</button>
|
|
138
|
+
</td>
|
|
139
|
+
</tr>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Default-value input adapts to the field's type but always renders as a
|
|
145
|
+
* single-line control that fits the table row.
|
|
146
|
+
*/
|
|
147
|
+
function DefaultInput({ field, onChange }) {
|
|
148
|
+
const t = field.type || 'string';
|
|
149
|
+
const common = { className: 'xeplr-shf-inp xeplr-shf-inp--muted' };
|
|
150
|
+
|
|
151
|
+
if (t === 'boolean') {
|
|
152
|
+
return (
|
|
153
|
+
<select
|
|
154
|
+
{...common}
|
|
155
|
+
value={field.default === undefined ? '' : String(field.default)}
|
|
156
|
+
onChange={(e) => {
|
|
157
|
+
const v = e.target.value;
|
|
158
|
+
onChange(v === '' ? undefined : v === 'true');
|
|
159
|
+
}}
|
|
160
|
+
>
|
|
161
|
+
<option value="">blank → the step must supply it</option>
|
|
162
|
+
<option value="true">true</option>
|
|
163
|
+
<option value="false">false</option>
|
|
164
|
+
</select>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
if (t === 'number') {
|
|
168
|
+
return (
|
|
169
|
+
<input
|
|
170
|
+
type="number"
|
|
171
|
+
{...common}
|
|
172
|
+
value={field.default ?? ''}
|
|
173
|
+
onChange={(e) => onChange(e.target.value === '' ? undefined : Number(e.target.value))}
|
|
174
|
+
placeholder="blank → the step must supply it"
|
|
175
|
+
/>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
if (t === 'object' || t === 'array') {
|
|
179
|
+
// JSON one-liner. Wider forms should use a modal — keep the row compact.
|
|
180
|
+
return (
|
|
181
|
+
<input
|
|
182
|
+
type="text"
|
|
183
|
+
{...common}
|
|
184
|
+
value={field.default === undefined ? '' : safeStringify(field.default)}
|
|
185
|
+
onChange={(e) => {
|
|
186
|
+
const txt = e.target.value;
|
|
187
|
+
if (txt.trim() === '') { onChange(undefined); return; }
|
|
188
|
+
try { onChange(JSON.parse(txt)); }
|
|
189
|
+
catch { /* keep raw string in the input, don't commit invalid JSON */ }
|
|
190
|
+
}}
|
|
191
|
+
placeholder={t === 'array' ? '[] blank → the step must supply it' : '{} blank → the step must supply it'}
|
|
192
|
+
/>
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
// string, date
|
|
196
|
+
return (
|
|
197
|
+
<input
|
|
198
|
+
type="text"
|
|
199
|
+
{...common}
|
|
200
|
+
value={field.default ?? ''}
|
|
201
|
+
onChange={(e) => onChange(e.target.value === '' ? undefined : e.target.value)}
|
|
202
|
+
placeholder="blank → the step must supply it"
|
|
203
|
+
/>
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function sortByOrder(list) {
|
|
208
|
+
return [...(list || [])].sort((a, b) => (a.order ?? 999) - (b.order ?? 999));
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Renumber order 10, 20, 30... so a fresh add at the end always slots in.
|
|
212
|
+
function reindexOrder(list) {
|
|
213
|
+
return list.map((f, i) => ({ ...f, order: (i + 1) * 10 }));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function safeStringify(v) {
|
|
217
|
+
try { return JSON.stringify(v); } catch { return ''; }
|
|
218
|
+
}
|
package/src/index.js
ADDED
package/src/styles.css
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* Minimal, unopinionated defaults. All rules prefixed `xeplr-shf-*` so
|
|
2
|
+
consumers can restyle without conflict. Import optional. */
|
|
3
|
+
|
|
4
|
+
/* ─── DynamicForm ─── */
|
|
5
|
+
.xeplr-shf-form { display: flex; flex-direction: column; gap: 14px; }
|
|
6
|
+
.xeplr-shf-field {
|
|
7
|
+
display: flex; flex-direction: column; gap: 4px;
|
|
8
|
+
font: 13px/1.4 system-ui, sans-serif; color: #333;
|
|
9
|
+
}
|
|
10
|
+
.xeplr-shf-label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
|
|
11
|
+
.xeplr-shf-required { color: #c00; font-weight: 700; }
|
|
12
|
+
.xeplr-shf-type {
|
|
13
|
+
color: #888; font-weight: 400; font-size: 11px;
|
|
14
|
+
background: #f0f0f0; padding: 1px 6px; border-radius: 3px; margin-left: auto;
|
|
15
|
+
}
|
|
16
|
+
.xeplr-shf-desc { color: #666; font-size: 12px; }
|
|
17
|
+
.xeplr-shf-err { color: #c00; font-size: 12px; }
|
|
18
|
+
.xeplr-shf-input {
|
|
19
|
+
padding: 6px 10px; border: 1px solid #ccc; border-radius: 4px;
|
|
20
|
+
font: inherit; background: #fff;
|
|
21
|
+
}
|
|
22
|
+
.xeplr-shf-input:focus { outline: 2px solid #646cff; outline-offset: -1px; }
|
|
23
|
+
.xeplr-shf-input--check { width: auto; }
|
|
24
|
+
.xeplr-shf-input--json { font-family: ui-monospace, Consolas, monospace; font-size: 12px; resize: vertical; }
|
|
25
|
+
.xeplr-shf-field--error .xeplr-shf-input { border-color: #c00; }
|
|
26
|
+
|
|
27
|
+
/* ─── SchemaEditor (table) ─── */
|
|
28
|
+
.xeplr-shf-table-wrap { font-family: system-ui, sans-serif; color: #222; }
|
|
29
|
+
.xeplr-shf-table {
|
|
30
|
+
width: 100%; border-collapse: collapse; font-size: 13px;
|
|
31
|
+
border: 1px solid #e0e5ee; border-radius: 6px; overflow: hidden;
|
|
32
|
+
background: #fff;
|
|
33
|
+
}
|
|
34
|
+
.xeplr-shf-table thead th {
|
|
35
|
+
background: #eaf1fb;
|
|
36
|
+
text-align: left; font-weight: 600; text-transform: uppercase; font-size: 11px;
|
|
37
|
+
color: #4a5b78; letter-spacing: 0.5px;
|
|
38
|
+
padding: 10px 12px; border-bottom: 1px solid #d5deee;
|
|
39
|
+
}
|
|
40
|
+
.xeplr-shf-th-move,
|
|
41
|
+
.xeplr-shf-th-remove { width: 32px; padding: 10px 4px; }
|
|
42
|
+
.xeplr-shf-th-center { text-align: center !important; }
|
|
43
|
+
|
|
44
|
+
.xeplr-shf-tr td { padding: 6px 8px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
|
|
45
|
+
.xeplr-shf-tr:last-child td { border-bottom: none; }
|
|
46
|
+
.xeplr-shf-tr:hover td { background: #fafbfd; }
|
|
47
|
+
.xeplr-shf-empty-row { text-align: center; color: #999; font-style: italic; padding: 16px !important; }
|
|
48
|
+
|
|
49
|
+
.xeplr-shf-td-move { text-align: center; white-space: nowrap; padding: 0 !important; }
|
|
50
|
+
.xeplr-shf-td-center { text-align: center; }
|
|
51
|
+
.xeplr-shf-td-remove { text-align: center; width: 32px; }
|
|
52
|
+
|
|
53
|
+
.xeplr-shf-inp {
|
|
54
|
+
width: 100%; box-sizing: border-box;
|
|
55
|
+
padding: 6px 8px; border: 1px solid transparent; border-radius: 4px;
|
|
56
|
+
font: inherit; background: transparent;
|
|
57
|
+
}
|
|
58
|
+
.xeplr-shf-inp:hover { border-color: #e0e5ee; }
|
|
59
|
+
.xeplr-shf-inp:focus { outline: none; border-color: #646cff; background: #fff;
|
|
60
|
+
box-shadow: 0 0 0 2px rgba(100,108,255,0.15); }
|
|
61
|
+
.xeplr-shf-inp--code { font-family: ui-monospace, Consolas, monospace; font-weight: 500; }
|
|
62
|
+
.xeplr-shf-inp--type { padding-right: 20px; }
|
|
63
|
+
.xeplr-shf-inp--muted::placeholder { color: #aaa; font-style: italic; }
|
|
64
|
+
|
|
65
|
+
.xeplr-shf-chk { width: 16px; height: 16px; cursor: pointer; }
|
|
66
|
+
|
|
67
|
+
.xeplr-shf-move {
|
|
68
|
+
border: none; background: transparent; cursor: pointer;
|
|
69
|
+
color: #8a95a8; font-size: 14px; line-height: 1;
|
|
70
|
+
padding: 2px 6px; border-radius: 3px;
|
|
71
|
+
}
|
|
72
|
+
.xeplr-shf-move:hover:not(:disabled) { background: #eef2f7; color: #333; }
|
|
73
|
+
.xeplr-shf-move:disabled { opacity: 0.25; cursor: default; }
|
|
74
|
+
|
|
75
|
+
.xeplr-shf-x {
|
|
76
|
+
border: none; background: transparent; cursor: pointer;
|
|
77
|
+
color: #d04040; font-size: 18px; line-height: 1;
|
|
78
|
+
padding: 4px 8px; border-radius: 3px;
|
|
79
|
+
}
|
|
80
|
+
.xeplr-shf-x:hover { background: #fdecec; }
|
|
81
|
+
|
|
82
|
+
.xeplr-shf-add-btn {
|
|
83
|
+
margin-top: 10px; padding: 6px 12px;
|
|
84
|
+
border: 1px dashed #b6c0d1; background: transparent;
|
|
85
|
+
border-radius: 4px; cursor: pointer; color: #4a5b78; font: inherit; font-size: 13px;
|
|
86
|
+
}
|
|
87
|
+
.xeplr-shf-add-btn:hover { border-color: #646cff; color: #646cff; }
|