@loykin/filter-input 0.0.1-dev.4 → 0.0.2

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 CHANGED
@@ -38,6 +38,7 @@ function FiSelect({
38
38
  onOpen,
39
39
  onReload,
40
40
  className,
41
+ size,
41
42
  classNames
42
43
  }) {
43
44
  return /* @__PURE__ */ jsxs(
@@ -51,16 +52,16 @@ function FiSelect({
51
52
  },
52
53
  disabled,
53
54
  children: [
54
- /* @__PURE__ */ jsxs(Select.Trigger, { className: cn("fi-select-trigger", classNames?.trigger, className), children: [
55
- /* @__PURE__ */ jsx(Select.Value, { placeholder, className: "fi-select-value" }),
56
- /* @__PURE__ */ jsx(Select.Icon, { className: "fi-select-icon", children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })
55
+ /* @__PURE__ */ jsxs(Select.Trigger, { className: cn("filter-input-select-trigger", classNames?.trigger, className), "data-size": size, children: [
56
+ /* @__PURE__ */ jsx(Select.Value, { placeholder, className: "filter-input-select-value" }),
57
+ /* @__PURE__ */ jsx(Select.Icon, { className: "filter-input-select-icon", children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })
57
58
  ] }),
58
- /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, { sideOffset: 4, className: "fi-positioner", children: /* @__PURE__ */ jsxs(Select.Popup, { className: cn("fi-select-popup", classNames?.popup), children: [
59
- (searchable || onReload) && /* @__PURE__ */ jsxs("div", { className: "fi-popup-header", children: [
59
+ /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, { sideOffset: 4, className: "filter-input-positioner", children: /* @__PURE__ */ jsxs(Select.Popup, { className: cn("filter-input-select-popup", classNames?.popup), children: [
60
+ (searchable || onReload) && /* @__PURE__ */ jsxs("div", { className: "filter-input-popup-header", children: [
60
61
  searchable && /* @__PURE__ */ jsx(
61
62
  "input",
62
63
  {
63
- className: "fi-control",
64
+ className: "filter-input-control",
64
65
  value: query,
65
66
  placeholder: "Search...",
66
67
  autoFocus: true,
@@ -71,30 +72,30 @@ function FiSelect({
71
72
  }
72
73
  }
73
74
  ),
74
- onReload && /* @__PURE__ */ jsx("button", { type: "button", className: "fi-reload-button", onClick: onReload, disabled: loading, "aria-label": "Reload", children: /* @__PURE__ */ jsx(RefreshIcon, {}) })
75
+ onReload && /* @__PURE__ */ jsx("button", { type: "button", className: "filter-input-reload-button", onClick: onReload, disabled: loading, "aria-label": "Reload", children: /* @__PURE__ */ jsx(RefreshIcon, {}) })
75
76
  ] }),
76
- (loading || error) && /* @__PURE__ */ jsxs("div", { className: "fi-popup-status", children: [
77
- loading ? /* @__PURE__ */ jsx("span", { className: "fi-loading", children: "Loading\u2026" }) : /* @__PURE__ */ jsx("span", { className: "fi-error", children: error }),
78
- onReload && !loading && /* @__PURE__ */ jsx("button", { type: "button", className: "fi-reload-button", onClick: onReload, "aria-label": "Retry", children: /* @__PURE__ */ jsx(RefreshIcon, {}) })
77
+ (loading || error) && /* @__PURE__ */ jsxs("div", { className: "filter-input-popup-status", children: [
78
+ loading ? /* @__PURE__ */ jsx("span", { className: "filter-input-loading", children: "Loading\u2026" }) : /* @__PURE__ */ jsx("span", { className: "filter-input-error", children: error }),
79
+ onReload && !loading && /* @__PURE__ */ jsx("button", { type: "button", className: "filter-input-reload-button", onClick: onReload, "aria-label": "Retry", children: /* @__PURE__ */ jsx(RefreshIcon, {}) })
79
80
  ] }),
80
81
  /* @__PURE__ */ jsxs(Select.List, { children: [
81
- !loading && !error && !required && /* @__PURE__ */ jsx(Select.Item, { value: "", className: cn("fi-select-item", classNames?.item), children: /* @__PURE__ */ jsx(Select.ItemText, { className: "fi-select-item-text", children: placeholder }) }),
82
+ !loading && !error && !required && /* @__PURE__ */ jsx(Select.Item, { value: "", className: cn("filter-input-select-item", classNames?.item), children: /* @__PURE__ */ jsx(Select.ItemText, { className: "filter-input-select-item-text", children: placeholder }) }),
82
83
  !loading && !error && options.map((option) => /* @__PURE__ */ jsxs(
83
84
  Select.Item,
84
85
  {
85
86
  value: option.value,
86
87
  disabled: option.disabled,
87
- className: cn("fi-select-item", classNames?.item),
88
+ className: cn("filter-input-select-item", classNames?.item),
88
89
  children: [
89
- /* @__PURE__ */ jsx(Select.ItemText, { className: "fi-select-item-text", children: option.label }),
90
- /* @__PURE__ */ jsx(Select.ItemIndicator, { className: "fi-select-item-indicator", children: /* @__PURE__ */ jsx(CheckIcon, {}) })
90
+ /* @__PURE__ */ jsx(Select.ItemText, { className: "filter-input-select-item-text", children: option.label }),
91
+ /* @__PURE__ */ jsx(Select.ItemIndicator, { className: "filter-input-select-item-indicator", children: /* @__PURE__ */ jsx(CheckIcon, {}) })
91
92
  ]
92
93
  },
93
94
  option.value
94
95
  )),
95
- !loading && !error && !options.length && !required && /* @__PURE__ */ jsx("div", { className: "fi-popup-status", children: /* @__PURE__ */ jsx("span", { className: "fi-empty", children: "No options" }) })
96
+ !loading && !error && !options.length && !required && /* @__PURE__ */ jsx("div", { className: "filter-input-popup-status", children: /* @__PURE__ */ jsx("span", { className: "filter-input-empty", children: "No options" }) })
96
97
  ] }),
97
- onReload && !searchable && !loading && !error && /* @__PURE__ */ jsx("div", { className: "fi-popup-footer", children: /* @__PURE__ */ jsx("button", { type: "button", className: "fi-reload-button", onClick: onReload, "aria-label": "Reload", children: /* @__PURE__ */ jsx(RefreshIcon, {}) }) })
98
+ onReload && !searchable && !loading && !error && /* @__PURE__ */ jsx("div", { className: "filter-input-popup-footer", children: /* @__PURE__ */ jsx("button", { type: "button", className: "filter-input-reload-button", onClick: onReload, "aria-label": "Reload", children: /* @__PURE__ */ jsx(RefreshIcon, {}) }) })
98
99
  ] }) }) })
99
100
  ]
100
101
  }
@@ -129,20 +130,20 @@ function FiMultiSelect({
129
130
  /* @__PURE__ */ jsxs(
130
131
  Popover.Trigger,
131
132
  {
132
- className: cn("fi-multi-trigger", classNames?.trigger),
133
+ className: cn("filter-input-multi-trigger", classNames?.trigger),
133
134
  disabled,
134
135
  children: [
135
- /* @__PURE__ */ jsx("span", { className: "fi-multi-value", children: renderTriggerValue() }),
136
- /* @__PURE__ */ jsx("span", { className: "fi-chevron", children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })
136
+ /* @__PURE__ */ jsx("span", { className: "filter-input-multi-value", children: renderTriggerValue() }),
137
+ /* @__PURE__ */ jsx("span", { className: "filter-input-chevron", children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })
137
138
  ]
138
139
  }
139
140
  ),
140
- /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, { sideOffset: 4, align: "start", className: "fi-positioner", children: /* @__PURE__ */ jsxs(Popover.Popup, { className: cn("fi-multi-popup", classNames?.popup), children: [
141
- (searchable || onReload) && /* @__PURE__ */ jsxs("div", { className: "fi-popup-header", children: [
141
+ /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, { sideOffset: 4, align: "start", className: "filter-input-positioner", children: /* @__PURE__ */ jsxs(Popover.Popup, { className: cn("filter-input-multi-popup", classNames?.popup), children: [
142
+ (searchable || onReload) && /* @__PURE__ */ jsxs("div", { className: "filter-input-popup-header", children: [
142
143
  searchable && /* @__PURE__ */ jsx(
143
144
  "input",
144
145
  {
145
- className: "fi-control",
146
+ className: "filter-input-control",
146
147
  value: query,
147
148
  placeholder,
148
149
  onChange: (e) => onQueryChange(e.target.value)
@@ -152,7 +153,7 @@ function FiMultiSelect({
152
153
  "button",
153
154
  {
154
155
  type: "button",
155
- className: "fi-reload-button",
156
+ className: "filter-input-reload-button",
156
157
  onClick: onReload,
157
158
  disabled: loading,
158
159
  "aria-label": "Reload",
@@ -160,27 +161,27 @@ function FiMultiSelect({
160
161
  }
161
162
  )
162
163
  ] }),
163
- loading && /* @__PURE__ */ jsx("div", { className: "fi-popup-status", children: /* @__PURE__ */ jsx("span", { className: "fi-loading", children: "Loading\u2026" }) }),
164
- !loading && error && /* @__PURE__ */ jsx("div", { className: "fi-popup-status", children: /* @__PURE__ */ jsx("span", { className: "fi-error", children: error }) }),
164
+ loading && /* @__PURE__ */ jsx("div", { className: "filter-input-popup-status", children: /* @__PURE__ */ jsx("span", { className: "filter-input-loading", children: "Loading\u2026" }) }),
165
+ !loading && error && /* @__PURE__ */ jsx("div", { className: "filter-input-popup-status", children: /* @__PURE__ */ jsx("span", { className: "filter-input-error", children: error }) }),
165
166
  !loading && !error && options.map((option) => {
166
167
  const checked = value.some((item) => optionMatches(option, item));
167
168
  return /* @__PURE__ */ jsxs(
168
169
  "button",
169
170
  {
170
171
  type: "button",
171
- className: cn("fi-option", classNames?.item),
172
+ className: cn("filter-input-option", classNames?.item),
172
173
  disabled: option.disabled,
173
174
  onMouseDown: (e) => e.preventDefault(),
174
175
  onClick: () => onToggle(option),
175
176
  children: [
176
- /* @__PURE__ */ jsx("span", { className: "fi-option-check", "data-checked": checked || void 0, children: checked && /* @__PURE__ */ jsx(CheckIcon, {}) }),
177
- /* @__PURE__ */ jsx("span", { className: "fi-option-label", children: renderOption ? renderOption(option) : option.label })
177
+ /* @__PURE__ */ jsx("span", { className: "filter-input-option-check", "data-checked": checked || void 0, children: checked && /* @__PURE__ */ jsx(CheckIcon, {}) }),
178
+ /* @__PURE__ */ jsx("span", { className: "filter-input-option-label", children: renderOption ? renderOption(option) : option.label })
178
179
  ]
179
180
  },
180
181
  stringifyValue(option.value)
181
182
  );
182
183
  }),
183
- !loading && !error && !options.length && /* @__PURE__ */ jsx("div", { className: "fi-popup-status", children: /* @__PURE__ */ jsx("span", { className: "fi-empty", children: "No options" }) })
184
+ !loading && !error && !options.length && /* @__PURE__ */ jsx("div", { className: "filter-input-popup-status", children: /* @__PURE__ */ jsx("span", { className: "filter-input-empty", children: "No options" }) })
184
185
  ] }) }) })
185
186
  ] });
186
187
  }
@@ -299,16 +300,16 @@ function SelectedValueDisplay({
299
300
  const emptyText = display.emptyText ?? "No value";
300
301
  const variant = display.variant ?? (Array.isArray(value) ? "tags" : "text");
301
302
  if (!items.length) {
302
- return /* @__PURE__ */ jsx("span", { className: "fi-selected-empty", children: emptyText });
303
+ return /* @__PURE__ */ jsx("span", { className: "filter-input-selected-empty", children: emptyText });
303
304
  }
304
305
  if (variant === "count") {
305
- return /* @__PURE__ */ jsxs("span", { className: "fi-selected-count", children: [
306
+ return /* @__PURE__ */ jsxs("span", { className: "filter-input-selected-count", children: [
306
307
  items.length,
307
308
  " selected"
308
309
  ] });
309
310
  }
310
311
  if (variant === "summary") {
311
- return /* @__PURE__ */ jsxs("span", { className: "fi-selected-summary", children: [
312
+ return /* @__PURE__ */ jsxs("span", { className: "filter-input-selected-summary", children: [
312
313
  items.length,
313
314
  " ",
314
315
  display.summaryLabel ?? "selected"
@@ -318,25 +319,25 @@ function SelectedValueDisplay({
318
319
  const visible = items.slice(0, maxVisible);
319
320
  const hidden = Math.max(0, items.length - visible.length);
320
321
  if (variant === "text") {
321
- return /* @__PURE__ */ jsx("span", { className: "fi-selected-text", children: items.map((item) => display.formatLabel?.(item) ?? item.label).join(", ") });
322
+ return /* @__PURE__ */ jsx("span", { className: "filter-input-selected-text", children: items.map((item) => display.formatLabel?.(item) ?? item.label).join(", ") });
322
323
  }
323
- return /* @__PURE__ */ jsxs("div", { className: "fi-selected-list", children: [
324
+ return /* @__PURE__ */ jsxs("div", { className: "filter-input-selected-list", children: [
324
325
  visible.map((item) => {
325
326
  const label = display.formatLabel?.(item) ?? item.label;
326
327
  return /* @__PURE__ */ jsxs(
327
328
  "span",
328
329
  {
329
- className: "fi-tag",
330
+ className: "filter-input-tag",
330
331
  "data-size": display.size ?? "sm",
331
332
  title: label,
332
333
  style: display.colorBy !== "none" ? { borderColor: optionColor(item), color: optionColor(item) } : void 0,
333
334
  children: [
334
- /* @__PURE__ */ jsx("span", { className: "fi-tag-label", children: label }),
335
+ /* @__PURE__ */ jsx("span", { className: "filter-input-tag-label", children: label }),
335
336
  display.removable && onRemove && /* @__PURE__ */ jsx(
336
337
  "button",
337
338
  {
338
339
  type: "button",
339
- className: "fi-tag-remove",
340
+ className: "filter-input-tag-remove",
340
341
  "aria-label": `Remove ${label}`,
341
342
  onClick: () => onRemove(item.value),
342
343
  children: /* @__PURE__ */ jsx(XIcon, {})
@@ -350,7 +351,7 @@ function SelectedValueDisplay({
350
351
  hidden > 0 && display.overflow !== "collapse" && /* @__PURE__ */ jsxs(
351
352
  "span",
352
353
  {
353
- className: "fi-tag-overflow",
354
+ className: "filter-input-tag-overflow",
354
355
  title: display.overflow === "tooltip" ? items.slice(maxVisible).map((item) => item.label).join(", ") : void 0,
355
356
  children: [
356
357
  "+",
@@ -390,56 +391,77 @@ function FilterInput({
390
391
  "button",
391
392
  {
392
393
  type: "button",
393
- className: cn("fi-clear-button", classNames?.clearButton),
394
+ className: cn("filter-input-clear-button", classNames?.clearButton),
394
395
  disabled,
395
396
  onClick: () => emit(Array.isArray(value) ? [] : null),
396
397
  children: "Clear"
397
398
  }
398
399
  );
399
400
  const commonInputClass = cn(
400
- "fi-control",
401
+ "filter-input-control",
401
402
  classNames?.control,
402
403
  inputClassName
403
404
  );
405
+ const leadingIcon = display.leadingIcon;
406
+ const trailingIcon = display.trailingIcon;
407
+ const hasIcons = !!(leadingIcon || trailingIcon);
408
+ const iconAwareInputClass = cn(
409
+ commonInputClass,
410
+ leadingIcon && "filter-input-control-has-leading-icon",
411
+ trailingIcon && "filter-input-control-has-trailing-icon"
412
+ );
413
+ const withIconWrap = (inputEl) => {
414
+ if (!hasIcons) return inputEl;
415
+ return /* @__PURE__ */ jsxs("div", { className: cn("filter-input-control-wrap", classNames?.controlWrap), children: [
416
+ leadingIcon && /* @__PURE__ */ jsx("span", { className: "filter-input-control-icon filter-input-control-icon-leading", children: leadingIcon }),
417
+ inputEl,
418
+ trailingIcon && /* @__PURE__ */ jsx("span", { className: "filter-input-control-icon filter-input-control-icon-trailing", children: trailingIcon })
419
+ ] });
420
+ };
404
421
  const control = (() => {
405
422
  switch (config.type) {
406
423
  case "textarea":
407
424
  return /* @__PURE__ */ jsx(
408
425
  "textarea",
409
426
  {
410
- className: cn("fi-textarea", classNames?.control, inputClassName),
427
+ className: cn("filter-input-textarea", classNames?.control, inputClassName),
411
428
  value: normalizeText(value),
412
429
  placeholder: config.placeholder,
413
430
  disabled,
414
431
  required: behavior.required,
432
+ "data-size": display.size,
415
433
  onChange: (event) => emit(event.target.value)
416
434
  }
417
435
  );
418
436
  case "number":
419
- return /* @__PURE__ */ jsx(
420
- "input",
421
- {
422
- className: commonInputClass,
423
- type: "number",
424
- value: normalizeText(value),
425
- min: config.validation?.min,
426
- max: config.validation?.max,
427
- placeholder: config.placeholder,
428
- disabled,
429
- required: behavior.required,
430
- onKeyDown: (event) => {
431
- if (["e", "E", "+"].includes(event.key)) event.preventDefault();
432
- if (event.key === "-" && (config.validation?.min ?? Number.NEGATIVE_INFINITY) >= 0) event.preventDefault();
433
- },
434
- onChange: (event) => emit(event.target.value === "" ? null : Number(event.target.value))
435
- }
437
+ return withIconWrap(
438
+ /* @__PURE__ */ jsx(
439
+ "input",
440
+ {
441
+ className: iconAwareInputClass,
442
+ type: "number",
443
+ value: normalizeText(value),
444
+ min: config.validation?.min,
445
+ max: config.validation?.max,
446
+ placeholder: config.placeholder,
447
+ disabled,
448
+ required: behavior.required,
449
+ "data-size": display.size,
450
+ onKeyDown: (event) => {
451
+ if (["e", "E", "+"].includes(event.key)) event.preventDefault();
452
+ if (event.key === "-" && (config.validation?.min ?? Number.NEGATIVE_INFINITY) >= 0) event.preventDefault();
453
+ },
454
+ onChange: (event) => emit(event.target.value === "" ? null : Number(event.target.value))
455
+ }
456
+ )
436
457
  );
437
458
  case "boolean":
438
- return /* @__PURE__ */ jsxs("div", { className: cn("fi-row", classNames?.row), children: [
459
+ return /* @__PURE__ */ jsxs("div", { className: cn("filter-input-row", classNames?.row), children: [
439
460
  /* @__PURE__ */ jsx(
440
461
  FiSelect,
441
462
  {
442
- className: "fi-flex-1",
463
+ className: "filter-input-flex-1",
464
+ size: display.size,
443
465
  options: [
444
466
  { label: "True", value: "true" },
445
467
  { label: "False", value: "false" }
@@ -462,7 +484,7 @@ function FilterInput({
462
484
  const next = exists ? selected.filter((item) => !optionMatches2(option, item)) : [...selected, option.value];
463
485
  emit(next, option);
464
486
  };
465
- return /* @__PURE__ */ jsxs("div", { className: cn("fi-multi", classNames?.multi), children: [
487
+ return /* @__PURE__ */ jsxs("div", { className: cn("filter-input-multi", classNames?.multi), children: [
466
488
  /* @__PURE__ */ jsx(
467
489
  FiMultiSelect,
468
490
  {
@@ -493,15 +515,16 @@ function FilterInput({
493
515
  classNames: classNames ? { trigger: classNames.multiTrigger, popup: classNames.popover, item: classNames.option } : void 0
494
516
  }
495
517
  ),
496
- /* @__PURE__ */ jsx("div", { className: "fi-row", children: clearButton })
518
+ /* @__PURE__ */ jsx("div", { className: "filter-input-row", children: clearButton })
497
519
  ] });
498
520
  }
499
521
  case "select":
500
- return /* @__PURE__ */ jsxs("div", { className: cn("fi-row", classNames?.row), children: [
522
+ return /* @__PURE__ */ jsxs("div", { className: cn("filter-input-row", classNames?.row), children: [
501
523
  /* @__PURE__ */ jsx(
502
524
  FiSelect,
503
525
  {
504
- className: "fi-flex-1",
526
+ className: "filter-input-flex-1",
527
+ size: display.size,
505
528
  options: filteredOptions.map((o) => ({ label: o.label, value: stringifyValue2(o.value), disabled: o.disabled })),
506
529
  value: value === null || value === void 0 ? "" : normalizeText(value),
507
530
  placeholder: config.placeholder ?? "Select...",
@@ -527,36 +550,39 @@ function FilterInput({
527
550
  ] });
528
551
  case "autocomplete":
529
552
  case "combobox":
530
- return /* @__PURE__ */ jsxs("div", { className: cn("fi-stack", classNames?.stack), children: [
531
- /* @__PURE__ */ jsxs("div", { className: cn("fi-row", classNames?.row), children: [
532
- /* @__PURE__ */ jsx(
533
- "input",
534
- {
535
- className: commonInputClass,
536
- value: query,
537
- placeholder: config.placeholder ?? "Search...",
538
- disabled,
539
- onChange: (event) => {
540
- const nextQuery = event.target.value;
541
- setQuery(nextQuery);
542
- onSearch?.(nextQuery, { key: config.key });
543
- if (config.type === "combobox" && behavior.allowCustomValue) emit(nextQuery);
544
- },
545
- onBlur: () => {
546
- if (config.type === "combobox" && behavior.selectOnBlur && query) emit(query);
553
+ return /* @__PURE__ */ jsxs("div", { className: cn("filter-input-stack", classNames?.stack), children: [
554
+ /* @__PURE__ */ jsxs("div", { className: cn("filter-input-row", classNames?.row), children: [
555
+ withIconWrap(
556
+ /* @__PURE__ */ jsx(
557
+ "input",
558
+ {
559
+ className: iconAwareInputClass,
560
+ value: query,
561
+ placeholder: config.placeholder ?? "Search...",
562
+ disabled,
563
+ "data-size": display.size,
564
+ onChange: (event) => {
565
+ const nextQuery = event.target.value;
566
+ setQuery(nextQuery);
567
+ onSearch?.(nextQuery, { key: config.key });
568
+ if (config.type === "combobox" && behavior.allowCustomValue) emit(nextQuery);
569
+ },
570
+ onBlur: () => {
571
+ if (config.type === "combobox" && behavior.selectOnBlur && query) emit(query);
572
+ }
547
573
  }
548
- }
574
+ )
549
575
  ),
550
576
  clearButton
551
577
  ] }),
552
- (loading || error || filteredOptions.length > 0) && /* @__PURE__ */ jsxs("div", { className: cn("fi-popover", classNames?.popover), children: [
553
- loading && /* @__PURE__ */ jsx("div", { className: "fi-loading", children: "Loading..." }),
554
- error && /* @__PURE__ */ jsx("div", { className: "fi-error", children: error }),
578
+ (loading || error || filteredOptions.length > 0) && /* @__PURE__ */ jsxs("div", { className: cn("filter-input-popover", classNames?.popover), children: [
579
+ loading && /* @__PURE__ */ jsx("div", { className: "filter-input-loading", children: "Loading..." }),
580
+ error && /* @__PURE__ */ jsx("div", { className: "filter-input-error", children: error }),
555
581
  !loading && !error && filteredOptions.map((option) => /* @__PURE__ */ jsxs(
556
582
  "button",
557
583
  {
558
584
  type: "button",
559
- className: cn("fi-option", classNames?.option),
585
+ className: cn("filter-input-option", classNames?.option),
560
586
  disabled: disabled || option.disabled,
561
587
  onMouseDown: (event) => event.preventDefault(),
562
588
  onClick: () => {
@@ -564,8 +590,8 @@ function FilterInput({
564
590
  emit(option.value, option);
565
591
  },
566
592
  children: [
567
- /* @__PURE__ */ jsx("span", { className: cn("fi-option-label", classNames?.optionLabel), children: renderOption ? renderOption(option) : option.label }),
568
- optionMatches2(option, value) && /* @__PURE__ */ jsx("span", { className: "fi-selected-mark", children: "Selected" })
593
+ /* @__PURE__ */ jsx("span", { className: cn("filter-input-option-label", classNames?.optionLabel), children: renderOption ? renderOption(option) : option.label }),
594
+ optionMatches2(option, value) && /* @__PURE__ */ jsx("span", { className: "filter-input-selected-mark", children: "Selected" })
569
595
  ]
570
596
  },
571
597
  stringifyValue2(option.value)
@@ -584,6 +610,7 @@ function FilterInput({
584
610
  placeholder: config.placeholder,
585
611
  disabled,
586
612
  required: behavior.required,
613
+ "data-size": display.size,
587
614
  onChange: (event) => emit(event.target.value || null)
588
615
  }
589
616
  );
@@ -591,16 +618,16 @@ function FilterInput({
591
618
  case "datetime-range": {
592
619
  const range = getDateRange(value);
593
620
  const inputType = config.type === "date-range" ? "date" : "datetime-local";
594
- return /* @__PURE__ */ jsxs("div", { className: cn("fi-range", classNames?.range), children: [
595
- /* @__PURE__ */ jsx("input", { className: commonInputClass, type: inputType, value: range.from ?? "", disabled, onChange: (event) => emit({ ...range, from: event.target.value || void 0 }) }),
596
- /* @__PURE__ */ jsx("input", { className: commonInputClass, type: inputType, value: range.to ?? "", disabled, onChange: (event) => emit({ ...range, to: event.target.value || void 0 }) })
621
+ return /* @__PURE__ */ jsxs("div", { className: cn("filter-input-range", classNames?.range), children: [
622
+ /* @__PURE__ */ jsx("input", { className: commonInputClass, type: inputType, value: range.from ?? "", disabled, "data-size": display.size, onChange: (event) => emit({ ...range, from: event.target.value || void 0 }) }),
623
+ /* @__PURE__ */ jsx("input", { className: commonInputClass, type: inputType, value: range.to ?? "", disabled, "data-size": display.size, onChange: (event) => emit({ ...range, to: event.target.value || void 0 }) })
597
624
  ] });
598
625
  }
599
626
  case "range": {
600
627
  const range = getNumberRange(value);
601
- return /* @__PURE__ */ jsxs("div", { className: cn("fi-range", classNames?.range), children: [
602
- /* @__PURE__ */ jsx("input", { className: commonInputClass, type: "number", value: range.min ?? "", placeholder: "Min", disabled, min: config.validation?.min, max: config.validation?.max, onChange: (event) => emit({ ...range, min: event.target.value === "" ? void 0 : Number(event.target.value) }) }),
603
- /* @__PURE__ */ jsx("input", { className: commonInputClass, type: "number", value: range.max ?? "", placeholder: "Max", disabled, min: config.validation?.min, max: config.validation?.max, onChange: (event) => emit({ ...range, max: event.target.value === "" ? void 0 : Number(event.target.value) }) })
628
+ return /* @__PURE__ */ jsxs("div", { className: cn("filter-input-range", classNames?.range), children: [
629
+ /* @__PURE__ */ jsx("input", { className: commonInputClass, type: "number", value: range.min ?? "", placeholder: "Min", disabled, "data-size": display.size, min: config.validation?.min, max: config.validation?.max, onChange: (event) => emit({ ...range, min: event.target.value === "" ? void 0 : Number(event.target.value) }) }),
630
+ /* @__PURE__ */ jsx("input", { className: commonInputClass, type: "number", value: range.max ?? "", placeholder: "Max", disabled, "data-size": display.size, min: config.validation?.min, max: config.validation?.max, onChange: (event) => emit({ ...range, max: event.target.value === "" ? void 0 : Number(event.target.value) }) })
604
631
  ] });
605
632
  }
606
633
  case "tag": {
@@ -615,7 +642,7 @@ function FilterInput({
615
642
  "div",
616
643
  {
617
644
  className: cn(
618
- "fi-tag-input",
645
+ "filter-input-tag-input",
619
646
  classNames?.tagInput
620
647
  ),
621
648
  "data-disabled": disabled || void 0,
@@ -629,15 +656,15 @@ function FilterInput({
629
656
  tags.map((tag) => /* @__PURE__ */ jsxs(
630
657
  "span",
631
658
  {
632
- className: cn("fi-tag", classNames?.tag),
659
+ className: cn("filter-input-tag", classNames?.tag),
633
660
  title: tag,
634
661
  children: [
635
- /* @__PURE__ */ jsx("span", { className: cn("fi-tag-label", classNames?.tagLabel), children: tag }),
662
+ /* @__PURE__ */ jsx("span", { className: cn("filter-input-tag-label", classNames?.tagLabel), children: tag }),
636
663
  /* @__PURE__ */ jsx(
637
664
  "button",
638
665
  {
639
666
  type: "button",
640
- className: cn("fi-tag-remove", classNames?.tagRemove),
667
+ className: cn("filter-input-tag-remove", classNames?.tagRemove),
641
668
  "aria-label": `Remove ${tag}`,
642
669
  disabled,
643
670
  onClick: (event) => {
@@ -655,7 +682,7 @@ function FilterInput({
655
682
  "input",
656
683
  {
657
684
  id: `${config.key}-tag-input`,
658
- className: cn("fi-tag-text-input", classNames?.tagTextInput),
685
+ className: cn("filter-input-tag-text-input", classNames?.tagTextInput),
659
686
  value: query,
660
687
  placeholder: tags.length ? "" : config.placeholder ?? "Add tag...",
661
688
  disabled,
@@ -678,28 +705,31 @@ function FilterInput({
678
705
  }
679
706
  case "text":
680
707
  default:
681
- return /* @__PURE__ */ jsxs("div", { className: cn("fi-row", classNames?.row), children: [
682
- /* @__PURE__ */ jsx(
683
- "input",
684
- {
685
- className: commonInputClass,
686
- type: "text",
687
- value: normalizeText(value),
688
- pattern: config.validation?.pattern,
689
- placeholder: config.placeholder,
690
- disabled,
691
- required: behavior.required,
692
- onChange: (event) => emit(event.target.value)
693
- }
708
+ return /* @__PURE__ */ jsxs("div", { className: cn("filter-input-row", classNames?.row), children: [
709
+ withIconWrap(
710
+ /* @__PURE__ */ jsx(
711
+ "input",
712
+ {
713
+ className: iconAwareInputClass,
714
+ type: "text",
715
+ value: normalizeText(value),
716
+ pattern: config.validation?.pattern,
717
+ placeholder: config.placeholder,
718
+ disabled,
719
+ required: behavior.required,
720
+ "data-size": display.size,
721
+ onChange: (event) => emit(event.target.value)
722
+ }
723
+ )
694
724
  ),
695
725
  clearButton
696
726
  ] });
697
727
  }
698
728
  })();
699
- return /* @__PURE__ */ jsxs("div", { className: cn("fi-field", classNames?.root, className), children: [
700
- config.label && /* @__PURE__ */ jsxs("label", { className: cn("fi-field-label", classNames?.label), children: [
729
+ return /* @__PURE__ */ jsxs("div", { className: cn("filter-input-field", classNames?.root, className), children: [
730
+ config.label && /* @__PURE__ */ jsxs("label", { className: cn("filter-input-field-label", classNames?.label), children: [
701
731
  config.label,
702
- behavior.required && /* @__PURE__ */ jsx("span", { className: "fi-field-required", children: " *" })
732
+ behavior.required && /* @__PURE__ */ jsx("span", { className: "filter-input-field-required", children: " *" })
703
733
  ] }),
704
734
  control
705
735
  ] });
@@ -721,7 +751,7 @@ function FilterVariable({
721
751
  "div",
722
752
  {
723
753
  className: cn(
724
- "fi-variable",
754
+ "filter-input-variable",
725
755
  classNames?.root,
726
756
  className
727
757
  ),
@@ -731,14 +761,14 @@ function FilterVariable({
731
761
  "div",
732
762
  {
733
763
  className: cn(
734
- "fi-variable-label",
764
+ "filter-input-variable-label",
735
765
  classNames?.label,
736
766
  labelClassName
737
767
  ),
738
768
  children: label
739
769
  }
740
770
  ),
741
- /* @__PURE__ */ jsx("div", { className: cn("fi-variable-value", classNames?.value, valueClassName), children: /* @__PURE__ */ jsx(
771
+ /* @__PURE__ */ jsx("div", { className: cn("filter-input-variable-value", classNames?.value, valueClassName), children: /* @__PURE__ */ jsx(
742
772
  FilterInput,
743
773
  {
744
774
  config: valueConfig,