@woodger/antd 0.1.3 → 0.1.4
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/auto-complete/AutoComplete.svelte +76 -30
- package/dist/cascader/CascaderCore.svelte +108 -44
- package/dist/input/TextArea.svelte +97 -63
- package/dist/input/textarea-value.svelte.d.ts +14 -0
- package/dist/input/textarea-value.svelte.js +48 -0
- package/dist/input/textarea.dom.d.ts +2 -0
- package/dist/input/textarea.dom.js +17 -0
- package/dist/mentions/Mentions.svelte +71 -52
- package/dist/mentions/mentions.dom.d.ts +0 -2
- package/dist/mentions/mentions.dom.js +0 -54
- package/dist/picker/RangePicker.svelte +3 -1
- package/dist/picker/RangePickerCore.svelte +206 -67
- package/dist/picker/SinglePicker.svelte +191 -77
- package/dist/picker/date-picker.types.d.ts +6 -0
- package/dist/picker/picker-components.types.d.ts +2 -2
- package/dist/picker/picker-editor.model.svelte.d.ts +13 -0
- package/dist/picker/picker-editor.model.svelte.js +40 -0
- package/dist/picker/picker-mask-input.model.svelte.js +2 -1
- package/dist/picker/picker-popup.dom.js +2 -0
- package/dist/picker/picker-popup.model.svelte.d.ts +3 -0
- package/dist/picker/picker-popup.model.svelte.js +35 -2
- package/dist/picker/time-picker.types.d.ts +2 -1
- package/dist/select/Select.svelte +112 -44
- package/dist/tree-select/TreeSelectControl.svelte +180 -69
- package/package.json +1 -1
- package/readme.md +15 -15
|
@@ -273,9 +273,11 @@
|
|
|
273
273
|
? String(maxTagPlaceholder) : undefined);
|
|
274
274
|
let tagContent = $state<HTMLDivElement>();
|
|
275
275
|
const tagElements = new Map<TreeSelectRawValue, HTMLElement>();
|
|
276
|
-
let pendingClose: MessageChannel | undefined;
|
|
276
|
+
let pendingClose: { channel: MessageChannel; source?: 'clear'; } | undefined;
|
|
277
277
|
let selectorMouseDown: MessageChannel | undefined;
|
|
278
278
|
let componentDestroyed = false;
|
|
279
|
+
let clearingSelection = false;
|
|
280
|
+
let clearCloseOnRemoval = false;
|
|
279
281
|
let internalSearch = $state('');
|
|
280
282
|
let composing = false;
|
|
281
283
|
let pastedText: string | undefined;
|
|
@@ -348,6 +350,22 @@
|
|
|
348
350
|
let root = $derived(rootSlot ? customRoot && rootNode(customRoot.registration) : defaultRoot);
|
|
349
351
|
let editor = $derived(rootSlot ? undefined : inputSlot
|
|
350
352
|
? customInput && inputNode(customInput.registration) : defaultEditor);
|
|
353
|
+
let committedControl: ReturnType<typeof readControlState> | undefined;
|
|
354
|
+
let committedClear: ReturnType<typeof readChangeState> | undefined;
|
|
355
|
+
|
|
356
|
+
// Native blur can run while Svelte is detaching the field. Read the last committed props.
|
|
357
|
+
$effect(() => { committedControl = readControlState(); });
|
|
358
|
+
$effect(() => {
|
|
359
|
+
if (!onChange) {
|
|
360
|
+
committedClear = undefined;
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Only an effective negative limit rejects the empty selection.
|
|
365
|
+
const rejectsClear = maxCount !== undefined && maxCount < 0 && limit.changeMaxCount !== undefined;
|
|
366
|
+
committedClear = rejectsClear ? undefined : readChangeState();
|
|
367
|
+
});
|
|
368
|
+
|
|
351
369
|
let editorAutoFocus = $derived(selectEditorAutofocus(
|
|
352
370
|
autoFocus, attributes.autofocus != null, inputOwnProps
|
|
353
371
|
));
|
|
@@ -476,6 +494,7 @@
|
|
|
476
494
|
let handledSearchOpen: boolean | undefined;
|
|
477
495
|
$effect(() => () => {
|
|
478
496
|
componentDestroyed = true;
|
|
497
|
+
clearCloseOnRemoval = clearingSelection && pendingClose?.source === 'clear';
|
|
479
498
|
cancelClose();
|
|
480
499
|
selectorMouseDown?.port1.close();
|
|
481
500
|
selectorMouseDown?.port2.close();
|
|
@@ -601,7 +620,7 @@
|
|
|
601
620
|
untrack(() => {
|
|
602
621
|
if (!isMultiple) searchInput('', false, false);
|
|
603
622
|
// Mount cleanup has already handled the synchronous owner update within the React batch.
|
|
604
|
-
handledSearchOpen = rawOpen;
|
|
623
|
+
if (!componentDestroyed) handledSearchOpen = rawOpen;
|
|
605
624
|
});
|
|
606
625
|
}
|
|
607
626
|
});
|
|
@@ -812,9 +831,6 @@
|
|
|
812
831
|
return Array.isArray(label) ? label.map(text).join('')
|
|
813
832
|
: typeof label === 'function' || typeof label === 'boolean' || label == null ? '' : String(label);
|
|
814
833
|
}
|
|
815
|
-
function renderedLabel(node: Data, fallback: TreeSelectLabel): TreeSelectLabel {
|
|
816
|
-
return treeTitleRender ? labelCache.forChange(treeTitleRender, node, fallback) : fallback;
|
|
817
|
-
}
|
|
818
834
|
function tagText(item: TreeSelectLabeledValue): string {
|
|
819
835
|
return text(labelCache.original(item.label) ?? item.value);
|
|
820
836
|
}
|
|
@@ -850,12 +866,22 @@
|
|
|
850
866
|
if (event.target instanceof Node && popup?.contains(event.target)) {
|
|
851
867
|
return;
|
|
852
868
|
}
|
|
853
|
-
|
|
854
|
-
|
|
869
|
+
|
|
870
|
+
const state = committedControl ?? (componentDestroyed ? undefined : readControlState());
|
|
871
|
+
if (!state) {
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
if (state.customSelector || event.relatedTarget instanceof Node && popup?.contains(event.relatedTarget)) {
|
|
876
|
+
focused = false;
|
|
877
|
+
}
|
|
878
|
+
if (state.customSelector && state.multiple && state.query && !clearingSelection) {
|
|
855
879
|
internalSearch = '';
|
|
856
|
-
searchConfig.onSearch?.('');
|
|
880
|
+
state.searchConfig.onSearch?.('');
|
|
857
881
|
}
|
|
858
|
-
|
|
882
|
+
|
|
883
|
+
const notify = state.onBlur;
|
|
884
|
+
if (!state.blocked) notify?.(event);
|
|
859
885
|
blurWithin(event);
|
|
860
886
|
}
|
|
861
887
|
function customRootClick(event: MouseEvent & { currentTarget: EventTarget & RootElement; }) {
|
|
@@ -919,6 +945,18 @@
|
|
|
919
945
|
pastedText = undefined;
|
|
920
946
|
searchInput(next);
|
|
921
947
|
}
|
|
948
|
+
function defaultBeforeInput(event: InputEvent & { currentTarget: EventTarget & HTMLInputElement; }) {
|
|
949
|
+
const input = event.currentTarget;
|
|
950
|
+
attributes.onbeforeinput?.call(input, event);
|
|
951
|
+
if (event.defaultPrevented || componentDestroyed || isMultiple || visible || !canSearch
|
|
952
|
+
|| !event.inputType?.startsWith('insert')) {
|
|
953
|
+
return;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
// The closed native editor displays the selection. An insertion starts a separate query.
|
|
957
|
+
const label = inputValue;
|
|
958
|
+
if (label && input.value === label) input.setSelectionRange(0, label.length);
|
|
959
|
+
}
|
|
922
960
|
function editorFocus(event: FocusEvent & { currentTarget: EventTarget & (EditorElement | HTMLInputElement); }) {
|
|
923
961
|
focused = true;
|
|
924
962
|
editorFocused = true;
|
|
@@ -927,7 +965,8 @@
|
|
|
927
965
|
function editorBlur(event: FocusEvent & { currentTarget: EventTarget & (EditorElement | HTMLInputElement); }) {
|
|
928
966
|
editorFocused = false;
|
|
929
967
|
enterLocked = false;
|
|
930
|
-
onblur
|
|
968
|
+
const notify = committedControl ? committedControl.onblur : componentDestroyed ? undefined : onblur;
|
|
969
|
+
notify?.(event);
|
|
931
970
|
}
|
|
932
971
|
function componentInputContext(): TreeSelectInputContext<EditorElement> {
|
|
933
972
|
const attrs: TreeSelectInputContext<EditorElement>['attributes'] = {};
|
|
@@ -978,19 +1017,37 @@
|
|
|
978
1017
|
internalOpen = next;
|
|
979
1018
|
onOpenChange?.(next);
|
|
980
1019
|
}
|
|
981
|
-
function
|
|
982
|
-
|
|
1020
|
+
function readControlState() {
|
|
1021
|
+
return {
|
|
1022
|
+
visible, blocked, multiple: isMultiple, customSelector: Boolean(rootSlot || inputSlot),
|
|
1023
|
+
customInput: Boolean(inputSlot), root, query: search, searchConfig,
|
|
1024
|
+
onBlur, onblur, onOpenChange, onKeyDown
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
function readSearchState() {
|
|
1028
|
+
return { previousSearch: search, separators: tokenSeparators, config: searchConfig };
|
|
1029
|
+
}
|
|
1030
|
+
function searchInput(
|
|
1031
|
+
next: string,
|
|
1032
|
+
isComposing = composing,
|
|
1033
|
+
fromTyping = true,
|
|
1034
|
+
state = readSearchState()
|
|
1035
|
+
) {
|
|
1036
|
+
const input = fromTyping ? editor : undefined;
|
|
983
1037
|
const decision = treeSelectTokenSearch(next, {
|
|
984
|
-
previousSearch:
|
|
1038
|
+
previousSearch: state.previousSearch, separators: state.separators, composing: isComposing, fromTyping
|
|
985
1039
|
});
|
|
986
|
-
internalSearch = decision.search;
|
|
987
|
-
if (decision.open === false) scheduleClose();
|
|
988
|
-
if (decision.notifySearch) searchConfig.onSearch?.(decision.search);
|
|
989
|
-
if (decision.open === true) requestOpen(true, Boolean(inputSlot));
|
|
990
1040
|
|
|
991
|
-
if (
|
|
1041
|
+
if (!componentDestroyed) {
|
|
1042
|
+
internalSearch = decision.search;
|
|
1043
|
+
if (decision.open === false) scheduleClose();
|
|
1044
|
+
}
|
|
1045
|
+
if (decision.notifySearch) state.config.onSearch?.(decision.search);
|
|
1046
|
+
if (decision.open === true) openFromSearch();
|
|
1047
|
+
|
|
1048
|
+
if (!componentDestroyed && input && (decision.split || inputSlot || searchConfig.searchValue !== undefined)) {
|
|
992
1049
|
void tick().then(() => {
|
|
993
|
-
if (!input.isConnected || input !== editor) {
|
|
1050
|
+
if (componentDestroyed || !input.isConnected || input !== editor) {
|
|
994
1051
|
return;
|
|
995
1052
|
}
|
|
996
1053
|
if (inputSlot) {
|
|
@@ -1003,18 +1060,39 @@
|
|
|
1003
1060
|
});
|
|
1004
1061
|
}
|
|
1005
1062
|
}
|
|
1063
|
+
function openFromSearch() {
|
|
1064
|
+
if (!componentDestroyed) {
|
|
1065
|
+
requestOpen(true, Boolean(inputSlot));
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
const state = committedControl;
|
|
1070
|
+
if (state && !state.visible && (!state.blocked || state.customInput)) {
|
|
1071
|
+
const notify = state.onOpenChange;
|
|
1072
|
+
notify?.(true);
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
function readChangeState(previous = items) {
|
|
1076
|
+
return {
|
|
1077
|
+
previous, index, labelProp: treeNodeLabelProp, titleRender: treeTitleRender,
|
|
1078
|
+
strict: treeCheckStrictly, labeled, multiple: isMultiple, onChange
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1006
1081
|
function publish(raw: TreeSelectRawValue[], triggerValue?: TreeSelectRawValue) {
|
|
1007
1082
|
const formatted = treeSelectStrategy(raw, strategy, index);
|
|
1008
|
-
|
|
1083
|
+
const maxForChange = limit.changeMaxCount;
|
|
1084
|
+
if (maxForChange && formatted.length > maxForChange) {
|
|
1009
1085
|
return;
|
|
1010
1086
|
}
|
|
1087
|
+
|
|
1011
1088
|
const before = items;
|
|
1089
|
+
const render = treeTitleRender;
|
|
1012
1090
|
const nextItems = treeSelectLabels(
|
|
1013
1091
|
raw.map(value => ({ value })),
|
|
1014
1092
|
index,
|
|
1015
1093
|
treeNodeLabelProp,
|
|
1016
1094
|
before,
|
|
1017
|
-
|
|
1095
|
+
render ? (node, fallback) => labelCache.forChange(render, node, fallback) : undefined
|
|
1018
1096
|
);
|
|
1019
1097
|
internalValue = nextItems;
|
|
1020
1098
|
if (autoClear)
|
|
@@ -1023,22 +1101,31 @@
|
|
|
1023
1101
|
return;
|
|
1024
1102
|
}
|
|
1025
1103
|
const values = conduction ? formatted : raw;
|
|
1104
|
+
notifyChange(values, readChangeState(before), triggerValue);
|
|
1105
|
+
}
|
|
1106
|
+
function notifyChange(
|
|
1107
|
+
values: TreeSelectRawValue[],
|
|
1108
|
+
state: ReturnType<typeof readChangeState>,
|
|
1109
|
+
triggerValue?: TreeSelectRawValue
|
|
1110
|
+
) {
|
|
1111
|
+
const { onChange: notify, previous, titleRender } = state;
|
|
1112
|
+
if (!notify) {
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
const selected = values.map(value => ({ value }));
|
|
1117
|
+
const halfChecked = state.strict
|
|
1118
|
+
? previous.filter(item => item.halfChecked && !values.includes(item.value))
|
|
1119
|
+
: [];
|
|
1120
|
+
const records = [...selected, ...halfChecked];
|
|
1026
1121
|
const returnItems = treeSelectLabels(
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
...treeCheckStrictly
|
|
1030
|
-
? before.filter(item => item.halfChecked && !values.includes(item.value))
|
|
1031
|
-
: []
|
|
1032
|
-
],
|
|
1033
|
-
index,
|
|
1034
|
-
treeNodeLabelProp,
|
|
1035
|
-
before,
|
|
1036
|
-
renderedLabel
|
|
1122
|
+
records, state.index, state.labelProp, previous,
|
|
1123
|
+
titleRender ? (node, fallback) => labelCache.forChange(titleRender, node, fallback) : undefined
|
|
1037
1124
|
);
|
|
1038
|
-
const returnValue = labeled ? returnItems : returnItems.map(item => item.value);
|
|
1039
|
-
|
|
1040
|
-
(
|
|
1041
|
-
labeled ? null : returnItems.map(item => item.label
|
|
1125
|
+
const returnValue = state.labeled ? returnItems : returnItems.map(item => item.value);
|
|
1126
|
+
notify(
|
|
1127
|
+
(state.multiple ? returnValue : returnValue[0]) as ValueType,
|
|
1128
|
+
state.labeled ? null : returnItems.map(item => item.label),
|
|
1042
1129
|
{ triggerValue }
|
|
1043
1130
|
);
|
|
1044
1131
|
}
|
|
@@ -1103,7 +1190,7 @@
|
|
|
1103
1190
|
}
|
|
1104
1191
|
function clearMouseDown(event: MouseEvent) {
|
|
1105
1192
|
event.preventDefault();
|
|
1106
|
-
if (!isMultiple && visible) scheduleClose();
|
|
1193
|
+
if (!isMultiple && visible) scheduleClose('clear');
|
|
1107
1194
|
}
|
|
1108
1195
|
function isPopupEvent(event: Event) {
|
|
1109
1196
|
// The dispatch path survives a synchronous detach during option selection.
|
|
@@ -1151,13 +1238,14 @@
|
|
|
1151
1238
|
}
|
|
1152
1239
|
}
|
|
1153
1240
|
}
|
|
1154
|
-
function scheduleClose() {
|
|
1241
|
+
function scheduleClose(source?: 'clear') {
|
|
1155
1242
|
cancelClose();
|
|
1156
1243
|
// rc-select useOpen defers false through MessageChannel until after click and close callbacks.
|
|
1157
1244
|
const channel = new MessageChannel();
|
|
1158
|
-
|
|
1245
|
+
const request = { channel, source };
|
|
1246
|
+
pendingClose = request;
|
|
1159
1247
|
channel.port1.onmessage = () => {
|
|
1160
|
-
if (pendingClose !==
|
|
1248
|
+
if (pendingClose !== request) {
|
|
1161
1249
|
return;
|
|
1162
1250
|
}
|
|
1163
1251
|
requestOpen(false);
|
|
@@ -1165,8 +1253,8 @@
|
|
|
1165
1253
|
channel.port2.postMessage(null);
|
|
1166
1254
|
}
|
|
1167
1255
|
function cancelClose() {
|
|
1168
|
-
pendingClose?.port1.close();
|
|
1169
|
-
pendingClose?.port2.close();
|
|
1256
|
+
pendingClose?.channel.port1.close();
|
|
1257
|
+
pendingClose?.channel.port2.close();
|
|
1170
1258
|
pendingClose = undefined;
|
|
1171
1259
|
}
|
|
1172
1260
|
function markSelectorMouseDown() {
|
|
@@ -1189,13 +1277,41 @@
|
|
|
1189
1277
|
if (blocked) {
|
|
1190
1278
|
return;
|
|
1191
1279
|
}
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1280
|
+
|
|
1281
|
+
const searchState = readSearchState();
|
|
1282
|
+
const previousClear = clearingSelection;
|
|
1283
|
+
clearingSelection = true;
|
|
1284
|
+
try {
|
|
1285
|
+
onClear?.();
|
|
1286
|
+
if (!componentDestroyed) editor?.focus();
|
|
1287
|
+
publishClear();
|
|
1288
|
+
searchInput('', false, false, searchState);
|
|
1289
|
+
completeClearClose();
|
|
1290
|
+
}
|
|
1291
|
+
finally {
|
|
1292
|
+
clearingSelection = previousClear;
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
function publishClear() {
|
|
1296
|
+
// Clear publishes the selection through the current TreeSelect handler after onClear and focus.
|
|
1297
|
+
if (!componentDestroyed) {
|
|
1298
|
+
publish([]);
|
|
1299
|
+
}
|
|
1300
|
+
else if (committedClear) {
|
|
1301
|
+
notifyChange([], committedClear);
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
function completeClearClose() {
|
|
1305
|
+
if (!clearCloseOnRemoval) {
|
|
1306
|
+
return;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
// Finish the active pointer clear without retaining its delayed close task after removal.
|
|
1310
|
+
clearCloseOnRemoval = false;
|
|
1311
|
+
const state = committedControl;
|
|
1312
|
+
if (state?.visible) {
|
|
1313
|
+
const notify = state.onOpenChange;
|
|
1314
|
+
notify?.(false);
|
|
1199
1315
|
}
|
|
1200
1316
|
}
|
|
1201
1317
|
function panelSelect(node: TreeEventNode) {
|
|
@@ -1251,10 +1367,14 @@
|
|
|
1251
1367
|
popupMouseDownTimer = setTimeout(() => { popupMouseDownTimer = undefined; }, 0);
|
|
1252
1368
|
}
|
|
1253
1369
|
function blurWithin(event: FocusEvent) {
|
|
1254
|
-
|
|
1370
|
+
if (componentDestroyed) {
|
|
1371
|
+
return;
|
|
1372
|
+
}
|
|
1373
|
+
const element = committedControl ? committedControl.root : root;
|
|
1255
1374
|
if (!element) {
|
|
1256
1375
|
return;
|
|
1257
1376
|
}
|
|
1377
|
+
|
|
1258
1378
|
if (event.relatedTarget instanceof Node
|
|
1259
1379
|
&& (element.contains(event.relatedTarget)
|
|
1260
1380
|
|| popup?.contains(
|
|
@@ -1264,7 +1384,7 @@
|
|
|
1264
1384
|
}
|
|
1265
1385
|
const mouseDownInPopup = popupMouseDownTimer !== undefined || selectorMouseDown !== undefined;
|
|
1266
1386
|
queueMicrotask(() => {
|
|
1267
|
-
if (!element.isConnected || root !== element) {
|
|
1387
|
+
if (componentDestroyed || !element.isConnected || root !== element) {
|
|
1268
1388
|
return;
|
|
1269
1389
|
}
|
|
1270
1390
|
const target = getPopupActiveElement(element);
|
|
@@ -1275,11 +1395,11 @@
|
|
|
1275
1395
|
}
|
|
1276
1396
|
focused = false;
|
|
1277
1397
|
field?.onBlur();
|
|
1278
|
-
if (mouseDownInPopup) {
|
|
1398
|
+
if (componentDestroyed || mouseDownInPopup) {
|
|
1279
1399
|
return;
|
|
1280
1400
|
}
|
|
1281
1401
|
requestOpen(false);
|
|
1282
|
-
if (autoClear && isMultiple && !rootSlot && !inputSlot)
|
|
1402
|
+
if (!componentDestroyed && autoClear && isMultiple && !rootSlot && !inputSlot)
|
|
1283
1403
|
internalSearch = '';
|
|
1284
1404
|
});
|
|
1285
1405
|
}
|
|
@@ -1314,11 +1434,13 @@
|
|
|
1314
1434
|
if (forwardedKeys.has(event)) {
|
|
1315
1435
|
return;
|
|
1316
1436
|
}
|
|
1317
|
-
if (event.target === editor && !cancelledKeys.has(event)
|
|
1437
|
+
if (!componentDestroyed && event.target === editor && !cancelledKeys.has(event)
|
|
1438
|
+
&& !event.isComposing && (!blocked || inputSlot)) {
|
|
1318
1439
|
if (inputSlot && openingKeys.has(event) && visible && (event.key === 'Enter' || event.key === ' ')) onOpenChange?.(true);
|
|
1319
|
-
handleKeyboard(event, visible && !openingKeys.has(event));
|
|
1440
|
+
if (!componentDestroyed) handleKeyboard(event, visible && !openingKeys.has(event));
|
|
1320
1441
|
}
|
|
1321
|
-
onKeyDown
|
|
1442
|
+
const notify = componentDestroyed ? committedControl?.onKeyDown : onKeyDown;
|
|
1443
|
+
notify?.(event);
|
|
1322
1444
|
}
|
|
1323
1445
|
function handleKeyboard(event: KeyboardEvent, wasOpen: boolean) {
|
|
1324
1446
|
if (event.key === 'Escape') {
|
|
@@ -1722,11 +1844,8 @@
|
|
|
1722
1844
|
.join(
|
|
1723
1845
|
' '
|
|
1724
1846
|
)
|
|
1725
|
-
|| undefined} aria-required={attributes.required ?? field?.required} aria-busy={loading || undefined} autocomplete="off" disabled={blocked} readonly={!canSearch} placeholder={display.length ? '' : placeholderText} value={inputValue}
|
|
1726
|
-
|
|
1727
|
-
pastedText = undefined;
|
|
1728
|
-
searchInput(next);
|
|
1729
|
-
}} onpaste={event => {
|
|
1847
|
+
|| undefined} aria-required={attributes.required ?? field?.required} aria-busy={loading || undefined} autocomplete="off" disabled={blocked} readonly={!canSearch} placeholder={display.length ? '' : placeholderText} value={inputValue}
|
|
1848
|
+
onbeforeinput={defaultBeforeInput} oninput={editorInput} onpaste={event => {
|
|
1730
1849
|
pastedText = event.clipboardData?.getData('text');
|
|
1731
1850
|
attributes.onpaste?.(event);
|
|
1732
1851
|
}} oncompositionstart={event => {
|
|
@@ -1736,15 +1855,7 @@
|
|
|
1736
1855
|
composing = false;
|
|
1737
1856
|
searchInput(event.currentTarget.value, false);
|
|
1738
1857
|
attributes.oncompositionend?.(event);
|
|
1739
|
-
}} onkeydown={inputKeyboard} onfocus={
|
|
1740
|
-
focused = true;
|
|
1741
|
-
editorFocused = true;
|
|
1742
|
-
onfocus?.(event);
|
|
1743
|
-
}} onblur={event => {
|
|
1744
|
-
editorFocused = false;
|
|
1745
|
-
enterLocked = false;
|
|
1746
|
-
onblur?.(event);
|
|
1747
|
-
}} />
|
|
1858
|
+
}} onkeydown={inputKeyboard} onfocus={editorFocus} onblur={editorBlur} />
|
|
1748
1859
|
{/if}
|
|
1749
1860
|
</div>
|
|
1750
1861
|
{#if suffix != null ? suffix : showArrow}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://svelte.dev/)
|
|
4
4
|
[](https://www.typescriptlang.org/)
|
|
5
|
-
[](
|
|
5
|
+
[](https://github.com/woodger/antd/blob/refs/heads/main/LICENSE)
|
|
6
6
|
|
|
7
7
|
An [Ant Design](https://ant.design/) component library for Svelte and TypeScript with UI components,
|
|
8
8
|
form models, themes, and localization.
|
|
@@ -59,25 +59,25 @@ import '@woodger/antd/styles.css';
|
|
|
59
59
|
|
|
60
60
|
### Using the library
|
|
61
61
|
|
|
62
|
-
- Components, examples, and limitations. [Component catalog](docs/reference/components/README.md)
|
|
63
|
-
- Models, fields, validation rules, and submission. [Forms and validation](docs/reference/forms.md)
|
|
64
|
-
- Appearance, sizes, and interface language. [Themes and localization](docs/reference/themes.md)
|
|
65
|
-
- Theme inheritance, component settings, and `theme.useToken()`. [Theme context](docs/reference/theme-context.md)
|
|
66
|
-
- Colors, sizes, and spacing from `theme.getDesignToken()`. [Static design tokens](docs/reference/design-tokens.md)
|
|
67
|
-
- Local sizes and provider defaults. [Component sizes](docs/reference/current-size-observation.md)
|
|
68
|
-
- Field appearance in `ConfigProvider` and `Form`. [Control variants](docs/reference/control-variants.md)
|
|
69
|
-
- Setting `renderEmpty` in ConfigProvider. [Empty states](docs/reference/render-empty.md)
|
|
70
|
-
- Popup containers, placement, and list width. [Popup settings](docs/reference/popup-settings.md)
|
|
71
|
-
- Configuring the press effect. [Wave effect](docs/reference/wave.md)
|
|
72
|
-
- Keyboard interaction and accessibility. [Keyboard and focus](docs/reference/keyboard.md)
|
|
73
|
-
- Implemented features and differences from Ant Design. [Porting coverage](docs/reference/ant-design-porting/status.md)
|
|
62
|
+
- Components, examples, and limitations. [Component catalog](https://github.com/woodger/antd/blob/refs/heads/main/docs/reference/components/README.md)
|
|
63
|
+
- Models, fields, validation rules, and submission. [Forms and validation](https://github.com/woodger/antd/blob/refs/heads/main/docs/reference/forms.md)
|
|
64
|
+
- Appearance, sizes, and interface language. [Themes and localization](https://github.com/woodger/antd/blob/refs/heads/main/docs/reference/themes.md)
|
|
65
|
+
- Theme inheritance, component settings, and `theme.useToken()`. [Theme context](https://github.com/woodger/antd/blob/refs/heads/main/docs/reference/theme-context.md)
|
|
66
|
+
- Colors, sizes, and spacing from `theme.getDesignToken()`. [Static design tokens](https://github.com/woodger/antd/blob/refs/heads/main/docs/reference/design-tokens.md)
|
|
67
|
+
- Local sizes and provider defaults. [Component sizes](https://github.com/woodger/antd/blob/refs/heads/main/docs/reference/current-size-observation.md)
|
|
68
|
+
- Field appearance in `ConfigProvider` and `Form`. [Control variants](https://github.com/woodger/antd/blob/refs/heads/main/docs/reference/control-variants.md)
|
|
69
|
+
- Setting `renderEmpty` in ConfigProvider. [Empty states](https://github.com/woodger/antd/blob/refs/heads/main/docs/reference/render-empty.md)
|
|
70
|
+
- Popup containers, placement, and list width. [Popup settings](https://github.com/woodger/antd/blob/refs/heads/main/docs/reference/popup-settings.md)
|
|
71
|
+
- Configuring the press effect. [Wave effect](https://github.com/woodger/antd/blob/refs/heads/main/docs/reference/wave.md)
|
|
72
|
+
- Keyboard interaction and accessibility. [Keyboard and focus](https://github.com/woodger/antd/blob/refs/heads/main/docs/reference/keyboard.md)
|
|
73
|
+
- Implemented features and differences from Ant Design. [Porting coverage](https://github.com/woodger/antd/blob/refs/heads/main/docs/reference/ant-design-porting/status.md)
|
|
74
74
|
|
|
75
75
|
## Developer guide
|
|
76
76
|
|
|
77
77
|
Install dependencies, build the package, and run checks with the instructions in the
|
|
78
|
-
[developer guide](docs/development.md). Shared rules are in the
|
|
78
|
+
[developer guide](https://github.com/woodger/antd/blob/refs/heads/main/docs/development.md). Shared rules are in the
|
|
79
79
|
[development policies](https://woodger.org/development).
|
|
80
80
|
|
|
81
81
|
## License
|
|
82
82
|
|
|
83
|
-
The project is distributed under the [MIT license](LICENSE).
|
|
83
|
+
The project is distributed under the [MIT license](https://github.com/woodger/antd/blob/refs/heads/main/LICENSE).
|