@poirazis/supercomponents-shared 1.2.15 → 1.2.18

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.
Files changed (37) hide show
  1. package/dist/index.js +17704 -22252
  2. package/dist/index.umd.cjs +19 -18
  3. package/package.json +11 -11
  4. package/src/lib/SuperButton/SuperButton.svelte +65 -35
  5. package/src/lib/SuperField/SuperField.svelte +8 -11
  6. package/src/lib/SuperForm/InnerForm.svelte +14 -8
  7. package/src/lib/SuperForm/SuperForm.svelte +5 -5
  8. package/src/lib/SuperPopover/SuperPopover.svelte +1 -1
  9. package/src/lib/SuperTable/SuperTable.css +13 -6
  10. package/src/lib/SuperTable/SuperTable.svelte +28 -19
  11. package/src/lib/SuperTable/constants.js +1 -1
  12. package/src/lib/SuperTable/controls/RowButtonsColumn.svelte +33 -17
  13. package/src/lib/SuperTable/controls/SelectionColumn.svelte +2 -2
  14. package/src/lib/SuperTableCells/CellBoolean.svelte +52 -45
  15. package/src/lib/SuperTableCells/CellCommon.css +97 -35
  16. package/src/lib/SuperTableCells/CellDatetime.svelte +267 -120
  17. package/src/lib/SuperTableCells/CellLink.svelte +22 -13
  18. package/src/lib/SuperTableCells/CellLinkPickerSelect.svelte +28 -24
  19. package/src/lib/SuperTableCells/CellLinkPickerTree.svelte +22 -20
  20. package/src/lib/SuperTableCells/CellNumber.svelte +55 -53
  21. package/src/lib/SuperTableCells/CellOptions.svelte +356 -246
  22. package/src/lib/SuperTableCells/CellOptionsAdvanced.svelte +199 -180
  23. package/src/lib/SuperTableCells/CellSQLLink.svelte +32 -32
  24. package/src/lib/SuperTableCells/CellSQLLinkPicker.svelte +2 -7
  25. package/src/lib/SuperTableCells/CellSkeleton.svelte +1 -1
  26. package/src/lib/SuperTableCells/CellString.svelte +62 -80
  27. package/src/lib/SuperTableCells/CellStringMask.svelte +41 -40
  28. package/src/lib/SuperTableCells/CellStringSimple.svelte +1 -4
  29. package/src/lib/SuperTableColumn/SuperTableColumn.svelte +3 -1
  30. package/src/lib/SuperTableColumn/parts/SuperColumnBody.svelte +3 -0
  31. package/src/lib/SuperTableColumn/parts/SuperColumnHeader.svelte +44 -42
  32. package/src/lib/SuperTableColumn/parts/SuperColumnRow.svelte +2 -4
  33. package/src/lib/SuperTabs/SuperTabs.svelte +33 -17
  34. package/src/lib/UI/elements/Checkbox.svelte +68 -10
  35. package/src/lib/UI/elements/Switch.svelte +162 -0
  36. package/src/lib/UI/elements/Tooltip.svelte +15 -43
  37. package/src/lib/SuperTableCells/JSDOC_GUIDE.md +0 -869
@@ -4,16 +4,17 @@
4
4
  import SuperPopover from "../SuperPopover/SuperPopover.svelte";
5
5
  import SuperList from "../SuperList/SuperList.svelte";
6
6
  import CellSkeleton from "./CellSkeleton.svelte";
7
+ import Switch from "../UI/elements/Switch.svelte";
7
8
  import "./CellCommon.css";
8
9
  const dispatch = createEventDispatcher();
9
- const { API, QueryUtils, fetchData, memo, derivedMemo } = getContext("sdk");
10
+ const { API, QueryUtils, fetchData, memo, derivedMemo, builderStore } =
11
+ getContext("sdk");
10
12
 
11
13
  export let cellOptions;
12
14
  export let value;
13
15
  export let fieldSchema;
14
16
  export let multi = true;
15
17
  export let autofocus;
16
- export let label;
17
18
 
18
19
  let anchor;
19
20
  let editor;
@@ -72,11 +73,14 @@
72
73
  role,
73
74
  readonly,
74
75
  disabled,
76
+ direction,
75
77
  error,
76
78
  color,
77
79
  background,
78
80
  } = cellOptions);
79
81
 
82
+ $: inBuilder = $builderStore.inBuilder;
83
+
80
84
  // Handle Options from Data Source
81
85
  const dataSourceStore = memo(cellOptions?.datasource ?? {});
82
86
  $: dataSourceStore.set(cellOptions.datasource);
@@ -84,17 +88,19 @@
84
88
  filteredOptions.length == localValue.length && filteredOptions.length > 0;
85
89
 
86
90
  // React to property changes
87
- $: cellState.refresh(
88
- fieldSchema,
89
- optionsSource,
90
- labelColumn,
91
- valueColumn,
92
- iconColumn,
93
- colorColumn,
94
- $dataSourceStore,
95
- );
91
+ $: if (inBuilder)
92
+ cellState.refresh(
93
+ fieldSchema,
94
+ optionsSource,
95
+ customOptions,
96
+ labelColumn,
97
+ valueColumn,
98
+ iconColumn,
99
+ colorColumn,
100
+ );
96
101
 
97
102
  $: cellState.syncFetch($fetch);
103
+ $: cellState.refresh($dataSourceStore);
98
104
 
99
105
  // We always keep an internal value as an array
100
106
  $: localValue = Array.isArray(value) ? value : value ? [value] : [];
@@ -103,6 +109,7 @@
103
109
  $: radios = controlType == "radio";
104
110
  $: isButtons = controlType == "buttons";
105
111
  $: allSelected = filteredOptions.length == localValue.length;
112
+ $: loading = $cellState == "Loading";
106
113
 
107
114
  const createFetch = (datasource) => {
108
115
  return fetchData({
@@ -126,9 +133,15 @@
126
133
  $options = [];
127
134
  return "Loading";
128
135
  },
136
+ loadOptions() {
137
+ if (optionsSource == "schema") this.loadSchemaOptions();
138
+ else if (optionsSource == "data") this.loadDataOptions($fetch?.rows);
139
+ else if (optionsSource == "custom") this.loadCustomOptions();
140
+ },
129
141
  loadSchemaOptions() {
130
142
  optionColors = fieldSchema?.optionColors || {};
131
143
  $options = fieldSchema?.constraints?.inclusion || [];
144
+ filteredOptions = $options;
132
145
  },
133
146
  loadDataOptions(rows) {
134
147
  if (rows && rows.length) {
@@ -141,6 +154,7 @@
141
154
  });
142
155
  }
143
156
  $options = $options;
157
+ filteredOptions = $options;
144
158
  },
145
159
  loadCustomOptions() {
146
160
  if (customOptions?.length) {
@@ -164,16 +178,10 @@
164
178
  }
165
179
  },
166
180
  _exit() {
167
- if (optionsSource == "custom") this.loadCustomOptions();
168
- else this.loadSchemaOptions();
169
-
170
- filteredOptions = $options;
181
+ this.loadOptions();
171
182
  },
172
183
  syncFetch(fetch) {
173
- console.log("syncFetch", fetch.loaded);
174
- if (fetch.loaded) {
175
- this.loadDataOptions(fetch.rows);
176
- console.log("loaded options from data", $options);
184
+ if (fetch?.loaded) {
177
185
  return cellOptions.initialState || "View";
178
186
  }
179
187
  },
@@ -363,147 +371,141 @@
363
371
  bind:this={anchor}
364
372
  class="superCell multirow"
365
373
  tabindex={cellOptions?.disabled ? -1 : 0}
366
- class:inEdit={inEdit && controlType != "buttons"}
374
+ class:inEdit={inEdit && !isButtons}
367
375
  class:isDirty={isDirty && cellOptions.showDirty}
368
376
  class:disabled
369
377
  class:readonly
370
378
  class:error
371
379
  style:color
372
380
  style:background
373
- style:font-weight={cellOptions.fontWeight}
374
381
  class:inline={role == "inlineInput"}
375
382
  class:tableCell={role == "tableCell"}
376
383
  class:formInput={role == "formInput"}
377
- class:naked-field={controlType == "buttons"}
384
+ class:naked-field={isButtons || role == "inlineInput"}
378
385
  on:focusin={cellState.focus}
379
386
  on:focusout={cellState.focusout}
380
387
  on:keydown={editorState.handleKeyboard}
381
388
  >
382
- {#if $cellState == "Loading"}
383
- <CellSkeleton>Initializing ..</CellSkeleton>
384
- {:else if controlType == "list"}
385
- <SuperList
386
- items={localValue}
387
- itemsColors={$colors}
388
- itemsLabels={labels}
389
- showColors={cellOptions.optionsViewMode != "text"}
390
- reorderOnly={cellOptions.reorderOnly}
391
- placeholder={cellOptions.placeholder}
392
- readonly={cellOptions.readonly || cellOptions.disabled}
393
- {editorState}
394
- {cellState}
395
- {fullSelection}
396
- bind:inactive
397
- on:togglePicker={editorState.toggle}
398
- on:clear={() => {
399
- localValue = [];
400
- editorState.close();
401
- anchor.focus();
402
- }}
403
- on:change={(e) => {
404
- localValue = [...e.detail];
405
- anchor.focus();
406
- }}
407
- />
408
- {:else if controlType == "radio" || controlType == "buttons"}
409
- {#if isButtons}
410
- <div class="buttons">
411
- {#each $options as option, idx (idx)}
389
+ {#key loading}
390
+ {#if loading}
391
+ <CellSkeleton />
392
+ {:else}
393
+ {#key controlType}
394
+ {#if controlType == "list"}
395
+ <SuperList
396
+ items={localValue}
397
+ itemsColors={$colors}
398
+ itemsLabels={labels}
399
+ showColors={cellOptions.optionsViewMode != "text"}
400
+ reorderOnly={cellOptions.reorderOnly}
401
+ placeholder={cellOptions.placeholder}
402
+ readonly={cellOptions.readonly || cellOptions.disabled}
403
+ {editorState}
404
+ {cellState}
405
+ {fullSelection}
406
+ bind:inactive
407
+ on:togglePicker={editorState.toggle}
408
+ on:clear={() => {
409
+ localValue = [];
410
+ editorState.close();
411
+ anchor.focus();
412
+ }}
413
+ on:change={(e) => {
414
+ localValue = [...e.detail];
415
+ anchor.focus();
416
+ }}
417
+ />
418
+ {:else if radios == true}
412
419
  <div
413
- class="button"
414
- class:selected={localValue?.includes(option)}
415
- style:--option-color={$colors[option]}
416
- on:click={() => editorState.toggleOption(idx)}
420
+ class="radios"
421
+ class:inline={role == "inlineInput"}
422
+ class:column={direction == "column"}
423
+ on:mouseleave={() => (focusedOptionIdx = -1)}
417
424
  >
418
- {labels[option] || option}
425
+ {#each $options as option, idx}
426
+ <div
427
+ class="radio"
428
+ class:selected={localValue?.includes(option)}
429
+ class:focused={focusedOptionIdx === idx}
430
+ on:mousedown={(e) => editorState.toggleOption(idx)}
431
+ on:mouseenter={() => (focusedOptionIdx = idx)}
432
+ >
433
+ <i
434
+ style:color={$colors[option]}
435
+ class={radios && localValue.includes(option)
436
+ ? "ph-fill ph-radio-button"
437
+ : radios
438
+ ? "ph ph-circle"
439
+ : localValue.includes(option)
440
+ ? "ph-fill ph-check-square"
441
+ : "ph ph-square"}
442
+ ></i>
443
+ {labels[option] || option}
444
+ </div>
445
+ {/each}
419
446
  </div>
420
- {/each}
421
- </div>
422
- {:else if radios}
423
- <div
424
- class="radios"
425
- class:column={cellOptions.direction == "column"}
426
- on:mouseleave={() => (focusedOptionIdx = -1)}
427
- >
428
- {#each $options as option, idx (idx)}
447
+ {:else if isButtons == true}
448
+ <div class="buttons">
449
+ {#each $options as option, idx}
450
+ <div
451
+ class="button"
452
+ class:selected={localValue?.includes(option)}
453
+ style:--option-color={$colors[option]}
454
+ on:click={() => editorState.toggleOption(idx)}
455
+ >
456
+ {labels[option] || option}
457
+ </div>
458
+ {/each}
459
+ </div>
460
+ {:else if controlType == "switch"}
429
461
  <div
430
- class="radio"
431
- class:selected={localValue?.includes(option)}
432
- class:focused={focusedOptionIdx === idx}
433
- style:--option-color={$colors[option]}
434
- on:mousedown={(e) => editorState.toggleOption(idx)}
435
- on:mouseenter={() => (focusedOptionIdx = idx)}
462
+ class="switches"
463
+ class:inline={role == "inlineInput"}
464
+ class:column={cellOptions.direction == "column"}
465
+ on:mouseleave={() => (focusedOptionIdx = -1)}
436
466
  >
437
- <i
438
- style:color={$colors[option]}
439
- class={radios && localValue.includes(option)
440
- ? "ph-fill ph-radio-button"
441
- : radios
442
- ? "ph ph-circle"
443
- : localValue.includes(option)
444
- ? "ph-fill ph-check-square"
445
- : "ph ph-square"}
446
- ></i>
447
- {labels[option] || option}
467
+ {#if cellOptions.toggleAll}
468
+ <div
469
+ class="switch toggle-all"
470
+ on:mouseenter={() => (focusedOptionIdx = -1)}
471
+ >
472
+ <div class="text">All</div>
473
+ {#if !(readonly || disabled)}
474
+ <Switch
475
+ checked={allSelected}
476
+ disabled={readonly || disabled}
477
+ size="small"
478
+ on:change={() => editorState.toggleAll()}
479
+ />
480
+ {/if}
481
+ </div>
482
+ {/if}
483
+ {#each $options as option, idx (idx)}
484
+ <div
485
+ class="switch"
486
+ class:selected={localValue.includes(option)}
487
+ class:focused={focusedOptionIdx === idx}
488
+ style:--option-color={$colors[option]}
489
+ on:mouseenter={() => (focusedOptionIdx = idx)}
490
+ on:click|stopPropagation={() => editorState.toggleOption(idx)}
491
+ >
492
+ <i class={optionIcons[option] || "no-icon"}></i>
493
+ <div class="text">
494
+ {labels[option] || option}
495
+ </div>
496
+ <Switch
497
+ checked={localValue.includes(option)}
498
+ disabled={readonly || disabled}
499
+ size="small"
500
+ on:change={() => editorState.toggleOption(idx)}
501
+ />
502
+ </div>
503
+ {/each}
448
504
  </div>
449
- {/each}
450
- </div>
505
+ {/if}
506
+ {/key}
451
507
  {/if}
452
-
453
- View
454
- {:else if controlType == "switch"}
455
- <div
456
- class="radios"
457
- class:formInput={role == "formInput"}
458
- class:inlineInput={role == "inlineInput"}
459
- class:column={cellOptions.direction == "column"}
460
- on:mouseleave={() => (focusedOptionIdx = -1)}
461
- >
462
- {#if label || cellOptions.toggleAll}
463
- <div
464
- class="switch toggleAll"
465
- on:click={cellOptions.toggleAll ? editorState.toggleAll : undefined}
466
- on:mouseenter
467
- >
468
- <div class="text title">{label ?? "Toggle All"}</div>
469
- {#if cellOptions.toggleAll && !(readonly || disabled)}
470
- <div class="spectrum-Switch spectrum-Switch--emphasized">
471
- <input
472
- checked={allSelected}
473
- type="checkbox"
474
- class="spectrum-Switch-input"
475
- />
476
- <span class="spectrum-Switch-switch"></span>
477
- </div>
478
- {/if}
479
- </div>
480
- {/if}
481
- {#each $options as option, idx (idx)}
482
- <div
483
- class="switch"
484
- class:selected={localValue.includes(option)}
485
- class:focused={focusedOptionIdx === idx}
486
- style:--option-color={$colors[option]}
487
- on:click={(e) => editorState.toggleOption(idx)}
488
- on:mouseenter={() => (focusedOptionIdx = idx)}
489
- >
490
- <i class={optionIcons[option] || "no-icon"}></i>
491
- <div class="text">{labels[option] || option}</div>
492
- <div class="spectrum-Switch spectrum-Switch--emphasized">
493
- <input
494
- checked={localValue.includes(option)}
495
- type="checkbox"
496
- class="spectrum-Switch-input"
497
- id={idx}
498
- />
499
- <span class="spectrum-Switch-switch small"> </span>
500
- </div>
501
- </div>
502
- {/each}
503
- </div>
504
- {/if}
505
-
506
- {$cellState}
508
+ {/key}
507
509
  </div>
508
510
 
509
511
  <!-- svelte-ignore a11y-no-static-element-interactions -->
@@ -600,7 +602,7 @@
600
602
  flex: auto;
601
603
  display: flex;
602
604
  flex-wrap: wrap;
603
- gap: 0.5rem;
605
+ gap: 0.25rem;
604
606
  justify-items: flex-start;
605
607
  }
606
608
 
@@ -608,34 +610,40 @@
608
610
  flex-direction: column;
609
611
  gap: 0.25rem;
610
612
  }
611
- .buttons .button {
613
+ .buttons > .button {
612
614
  flex: none;
613
615
  display: flex;
614
616
  align-items: center;
615
617
  justify-content: center;
616
618
  padding: 0.25rem 0.75rem;
617
- border: 1px solid var(--spectrum-global-color-gray-300);
618
- border-radius: 4px;
619
- background-color: var(--spectrum-global-color-gray-75);
619
+ border: 1px solid var(--spectrum-global-color-gray-400);
620
+ border-radius: 0.5rem;
621
+ background-color: var(--spectrum-global-color-gray-100);
620
622
  color: var(--spectrum-global-color-gray-600);
621
623
  cursor: pointer;
622
624
  user-select: none;
623
- font-size: 12px;
624
- font-weight: 500;
625
+ font-weight: 400;
625
626
  transition: all 0.15s ease-in-out;
626
627
  white-space: nowrap;
627
628
  text-overflow: ellipsis;
628
629
  overflow: hidden;
629
630
  max-width: 100%;
630
631
  gap: 0.35rem;
632
+ max-height: 1.75rem;
631
633
  }
632
634
 
633
635
  .button:hover {
634
- background-color: var(--spectrum-global-color-gray-100);
636
+ background-color: var(--spectrum-global-color-gray-300);
635
637
  border-color: var(--spectrum-global-color-gray-300);
636
- color: var(--spectrum-global-color-gray-700);
638
+ color: var(--spectrum-global-color-gray-800);
637
639
  cursor: pointer;
638
640
  }
641
+
642
+ .button:active {
643
+ border-color: var(--spectrum-global-color-gray-500);
644
+ color: var(--spectrum-global-color-gray-800);
645
+ }
646
+
639
647
  .button.selected {
640
648
  background-color: var(
641
649
  --option-color,
@@ -651,26 +659,15 @@
651
659
  display: flex;
652
660
  flex-wrap: wrap;
653
661
  justify-items: flex-start;
654
- color: var(--spectrum-global-color-gray-700);
655
- font-size: 13px;
656
-
657
- &.formInput {
658
- & > .switch {
659
- padding: 0 0.5rem;
660
- }
661
- }
662
+ padding: 0.25rem 0.25rem;
663
+ }
662
664
 
663
- &.inlineInput {
664
- & > .switch {
665
- padding: 0rem 0.25rem;
666
- &.toggleAll {
667
- margin-bottom: 0.25rem;
668
- padding-bottom: 0.25rem;
669
- border-bottom: 1px solid var(--spectrum-global-color-gray-300);
670
- }
671
- }
672
- }
665
+ .radios.inline {
666
+ border: 1px solid var(--spectrum-global-color-gray-300);
667
+ border-radius: 4px;
668
+ padding: 0.25rem 0.25rem;
673
669
  }
670
+
674
671
  .radios.column {
675
672
  gap: 0rem;
676
673
  flex-direction: column;
@@ -683,25 +680,50 @@
683
680
  align-items: center;
684
681
  cursor: pointer;
685
682
  padding: 0 0.5rem;
683
+ opacity: 0.75;
684
+ border-radius: 0.25rem;
686
685
  &.focused {
687
686
  background-color: var(--spectrum-global-color-gray-200) !important;
688
687
  color: var(--spectrum-global-color-gray-800);
689
688
  }
690
689
 
690
+ &:hover > i {
691
+ color: var(--option-color, var(--spectrum-global-color-gray-700));
692
+ opacity: 1;
693
+ }
694
+
691
695
  &.selected {
692
696
  color: var(--spectrum-global-color-gray-800);
693
- background-color: var(--spectrum-global-color-gray-100);
694
- font-weight: 600;
697
+ opacity: 1;
695
698
  }
696
699
  }
697
700
 
701
+ .switches {
702
+ flex: 1;
703
+ display: flex;
704
+ flex-direction: column;
705
+ padding: 0.25rem 0.25rem;
706
+ overflow-y: auto;
707
+ }
708
+
709
+ .switches.inline {
710
+ padding: 0rem;
711
+ }
712
+
713
+ .switches.inline > .switch {
714
+ padding: 0.25rem 0.5rem;
715
+ }
716
+
698
717
  .switch {
699
718
  width: 100%;
700
719
  display: flex;
701
720
  gap: 0.35rem;
702
721
  align-items: center;
722
+ justify-content: space-between;
703
723
  cursor: pointer;
704
724
  height: 1.75rem;
725
+ padding: 0.25rem 0.5rem;
726
+ color: var(--spectrum-global-color-gray-700);
705
727
 
706
728
  & > i {
707
729
  color: var(--spectrum-global-color-gray-600);
@@ -717,17 +739,6 @@
717
739
  text-overflow: ellipsis;
718
740
  overflow: hidden;
719
741
  white-space: nowrap;
720
- opacity: 0.95;
721
-
722
- &.title {
723
- font-size: 14px;
724
- font-weight: 600;
725
- }
726
- }
727
-
728
- &.toggleAll {
729
- border-bottom: 1px solid var(--spectrum-global-color-gray-200);
730
- height: 2rem;
731
742
  }
732
743
  &.focused {
733
744
  background-color: var(--spectrum-global-color-gray-200) !important;
@@ -747,8 +758,16 @@
747
758
  }
748
759
  }
749
760
 
761
+ .switch.toggle-all .text {
762
+ font-weight: 600;
763
+ color: var(--spectrum-global-color-gray-600);
764
+ }
765
+
750
766
  .switch > .spectrum-Switch {
751
767
  margin-right: unset !important;
768
+ --spectrum-switch-m-handle-border-color: var(
769
+ --spectrum-global-color-gray-500
770
+ ) !important;
752
771
  }
753
772
 
754
773
  .radio > i {
@@ -108,9 +108,7 @@
108
108
  $: pills = cellOptions.relViewMode == "pills";
109
109
  $: ownId = ownId || cellOptions?.ownId;
110
110
 
111
- $: if (!isLoading) {
112
- localValue = enrichValue(value);
113
- }
111
+ $: localValue = enrichValue(value);
114
112
 
115
113
  $: inEdit = $cellState == "Editing";
116
114
  $: isDirty = inEdit && originalValue != JSON.stringify(localValue);
@@ -246,36 +244,38 @@
246
244
  {/if}
247
245
 
248
246
  <div class="value" class:placeholder={localValue?.length < 1}>
249
- {#if localValue?.length < 1}
250
- <span> {placeholder} </span>
251
- {:else if pills}
252
- <div
253
- class="items"
254
- class:pills
255
- class:withCount={localValue.length > 5}
256
- class:inEdit
257
- >
258
- {#each localValue as val, idx}
259
- {#if idx < 5}
260
- <div class="item">
261
- <span>{val.primaryDisplay}</span>
262
- </div>
247
+ {#key localValue}
248
+ {#if localValue?.length < 1}
249
+ <span> {placeholder} </span>
250
+ {:else if pills}
251
+ <div
252
+ class="items"
253
+ class:pills
254
+ class:withCount={localValue.length > 5}
255
+ class:inEdit
256
+ >
257
+ {#each localValue as val, idx}
258
+ {#if idx < 5}
259
+ <div class="item">
260
+ <span>{val.primaryDisplay}</span>
261
+ </div>
262
+ {/if}
263
+ {/each}
264
+ {#if localValue.length > 5}
265
+ <span class="count">
266
+ (+ {localValue.length - 5})
267
+ </span>
263
268
  {/if}
264
- {/each}
265
- {#if localValue.length > 5}
266
- <span class="count">
267
- (+ {localValue.length - 5})
268
- </span>
269
- {/if}
270
- </div>
271
- {:else}
272
- <span>
273
- {#if cellOptions.role == "formInput" && localValue.length > 1}
274
- ({localValue.length})
275
- {/if}
276
- {localValue.map((v) => v.primaryDisplay).join(", ")}
277
- </span>
278
- {/if}
269
+ </div>
270
+ {:else}
271
+ <span>
272
+ {#if cellOptions.role == "formInput" && localValue.length > 1}
273
+ ({localValue.length})
274
+ {/if}
275
+ {localValue.map((v) => v.primaryDisplay).join(", ")}
276
+ </span>
277
+ {/if}
278
+ {/key}
279
279
  </div>
280
280
  {#if !readonly && (cellOptions.role == "formInput" || inEdit)}
281
281
  <i class="ph ph-caret-down control-icon"></i>
@@ -348,7 +348,7 @@
348
348
  </div>
349
349
  {/each}
350
350
 
351
- {#if $optionsFetch && $optionsFetch.loaded}
351
+ {#if $optionsFetch}
352
352
  <!-- Unselected rows -->
353
353
  {#key localValue.length}
354
354
  {#each $optionsFetch.rows as row, idx (row[relatedField])}
@@ -370,14 +370,9 @@
370
370
  {#if $optionsFetch?.loading}
371
371
  <div class="option loading">
372
372
  <i class="ri-loader-2-line rotating"></i>
373
- Loading more...
373
+ Loading...
374
374
  </div>
375
375
  {/if}
376
- {:else if $optionsFetch?.loading && !$optionsFetch.loaded}
377
- <div class="option loading">
378
- <i class="ri-loader-2-line rotating"></i>
379
- Loading...
380
- </div>
381
376
  {:else}
382
377
  <div class="option">No Results Found</div>
383
378
  {/if}
@@ -3,7 +3,7 @@
3
3
  export let minHeight = "2rem";
4
4
  </script>
5
5
 
6
- {#if active}
6
+ {#if active == true}
7
7
  <div class="skeleton" style:min-height={minHeight}>
8
8
  <div class="children"></div>
9
9
  </div>