@updog/data-editor-wc 0.1.86 → 0.1.88

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/index.d.ts CHANGED
@@ -65,6 +65,8 @@ declare var export_default = {
65
65
  clearField: "Clear field",
66
66
  showPassword: "Show password",
67
67
  hidePassword: "Hide password",
68
+ switchToAm: "Switch to AM",
69
+ switchToPm: "Switch to PM",
68
70
  },
69
71
  select: {
70
72
  noResults: "No results",
@@ -407,15 +409,19 @@ declare var export_default = {
407
409
  validation: {
408
410
  alreadyExists: "Already exists in your database",
409
411
  endDateBeforeStart: "End date must be after start date",
412
+ invalidCountry: "Invalid country",
413
+ invalidCurrency: "Invalid currency",
410
414
  invalidDate: "Invalid date",
411
415
  invalidEmail: "Invalid email address",
412
416
  invalidFormat: "Invalid format",
413
417
  invalidNumber: "Invalid number",
414
418
  invalidOption: "Invalid option",
419
+ invalidTime: "Invalid time",
415
420
  outOfRange: "Out of range",
416
421
  required: "This field is required",
417
422
  structuralMismatch: "This might be in the wrong column.",
418
423
  tooManyDecimals: "Too many decimal places",
424
+ tooPreciseTime: "Too precise for this column",
419
425
  valueMustBeUnique: "Value must be unique",
420
426
  },
421
427
  license: {
@@ -531,6 +537,8 @@ declare var export_default = {
531
537
  showAll: "Show all",
532
538
  showMatched: "Show matched",
533
539
  allMatched: "All values are matched",
540
+ corrected: "Corrected",
541
+ possibleMatch: "Possible match",
534
542
  tooManyValues: "Showing first {{shown}} of {{total}} values",
535
543
  unmatchedWarning:
536
544
  "Unmatched values won't be imported. Match this value to keep the data. You can edit values after importing.",
@@ -663,6 +671,16 @@ type TextEditorCell = {
663
671
  type DateEditorCell = {
664
672
  type: "date";
665
673
  };
674
+ /** Time-of-day cell. Bounds come from the column's `{ type: "time" }` validator. */
675
+ type TimeEditorCell = {
676
+ type: "time";
677
+ /**
678
+ * The clock the cell draws, `h23` for `18:00` and `h12` for `6:00 PM`.
679
+ * Defaults to the clock the reader's own browser uses. Whichever is drawn,
680
+ * both forms stay readable when the person types.
681
+ */
682
+ hourCycle?: "h12" | "h23";
683
+ };
666
684
  /** Dropdown select cell. The user picks from a fixed list of options. */
667
685
  type SelectEditorCell = {
668
686
  type: "select";
@@ -684,6 +702,47 @@ type MultiSelectEditorCell = {
684
702
  /** Splits a raw imported cell and joins on export. Omitted: import auto-detects, export joins with `", "`. */
685
703
  delimiter?: string;
686
704
  };
705
+ /**
706
+ * Country cell. Stores the ISO 3166-1 alpha-2 code in upper case; the screen
707
+ * shows the country name in the interface language. The list is the 249
708
+ * assigned ISO codes plus `XK` for Kosovo, which ISO does not assign.
709
+ */
710
+ type CountryEditorCell = {
711
+ type: "country";
712
+ /** Pick zero or more countries; the stored value becomes `string[]`. */
713
+ multiple?: boolean;
714
+ /**
715
+ * Let users add a value the list has not got. Defaults to **false** — the
716
+ * country list is closed until the client opens it. A created value reaches
717
+ * `onComplete` next to `DE` and `FR` with no code of its own.
718
+ */
719
+ enableCustomValue?: boolean;
720
+ /** Splits a raw imported cell and joins on export, when `multiple`. Omitted:
721
+ * import auto-detects, export joins with `", "`. */
722
+ delimiter?: string;
723
+ /**
724
+ * The codes the column takes, alpha-2, in the order the dropdown shows them
725
+ * under `currency` and before the name sort under `country`. A code the ISO
726
+ * list has not got is dropped with a warning. Omitted: the whole list.
727
+ */
728
+ only?: string[];
729
+ };
730
+ /**
731
+ * Currency cell. Stores the ISO 4217 code in upper case and shows it as is;
732
+ * the list is the 178 codes of the current ISO list. Reads codes, numeric
733
+ * codes, names in 26 languages, ISO names and symbols on the way in.
734
+ */
735
+ type CurrencyEditorCell = {
736
+ type: "currency";
737
+ /**
738
+ * Let users add a value the list has not got. Defaults to **false** — the
739
+ * currency list is closed until the client opens it. A created value reaches
740
+ * `onComplete` next to `USD` and `EUR` with no code of its own.
741
+ */
742
+ enableCustomValue?: boolean;
743
+ /** The ISO 4217 codes the column takes, in the order the dropdown shows them. */
744
+ only?: string[];
745
+ };
687
746
  /** Number input cell with locale-aware formatting. Bounds and decimal digits come from the column's `{ type: "number" }` validator. */
688
747
  type NumberEditorCell = {
689
748
  type: "number";
@@ -697,11 +756,14 @@ type NumberEditorCell = {
697
756
  *
698
757
  * - `"text"` — plain text input (default).
699
758
  * - `"date"` — date picker; the calendar honours the column's date validator bounds.
759
+ * - `"time"` — plain text input for a time of day; the column is checked against `{ type: "time" }`.
700
760
  * - `"select"` — dropdown with a fixed list of options.
701
761
  * - `"multiselect"` — dropdown allowing zero or more options; stored as `string[]`.
762
+ * - `"country"` — dropdown over the ISO country list; stores the alpha-2 code, shows the name.
763
+ * - `"currency"` — dropdown over the ISO 4217 list; stores and shows the three-letter code.
702
764
  * - `"number"` — number input with locale-aware formatting.
703
765
  */
704
- type CellEditor = TextEditorCell | DateEditorCell | SelectEditorCell | MultiSelectEditorCell | NumberEditorCell;
766
+ type CellEditor = TextEditorCell | DateEditorCell | TimeEditorCell | SelectEditorCell | MultiSelectEditorCell | CountryEditorCell | CurrencyEditorCell | NumberEditorCell;
705
767
  /** Dropdown filter shown in the sidebar Filters panel. */
706
768
  type SelectColumnFilter = {
707
769
  type: "select";
@@ -726,14 +788,21 @@ type DateRangeColumnFilter = {
726
788
  /** Label displayed above the filter. */
727
789
  label?: string;
728
790
  };
791
+ /** Time-of-day min/max range filter shown in the sidebar Filters panel. */
792
+ type TimeRangeColumnFilter = {
793
+ type: "time-range";
794
+ /** Label displayed above the filter. */
795
+ label?: string;
796
+ };
729
797
  /**
730
798
  * Filter control shown in the sidebar Filters panel for a column.
731
799
  *
732
800
  * - `"select"` — dropdown to pick one or more values.
733
801
  * - `"number-range"` — two inputs for min and max number.
734
802
  * - `"date-range"` — two date pickers for start and end date.
803
+ * - `"time-range"` — two time fields for the earliest and latest time of day.
735
804
  */
736
- type ColumnFilter = SelectColumnFilter | NumberRangeColumnFilter | DateRangeColumnFilter;
805
+ type ColumnFilter = SelectColumnFilter | NumberRangeColumnFilter | DateRangeColumnFilter | TimeRangeColumnFilter;
737
806
  /** Lock mode for a column. `"all"` locks for every row; `"default"` locks only default-source rows. */
738
807
  type ColumnLockMode = "all" | "default";
739
808
  /**
@@ -808,6 +877,8 @@ type DataEditorColumn = {
808
877
  locked?: boolean | ColumnLockMode;
809
878
  };
810
879
 
880
+ /** How precisely a time-of-day column is written. */
881
+ type TimePrecision = "minutes" | "seconds" | "milliseconds";
811
882
  /**
812
883
  * A built-in declarative validator — a declarative object the SDK interprets.
813
884
  */
@@ -823,6 +894,16 @@ type BuiltInValidator = {
823
894
  type: "oneOf";
824
895
  values: string[];
825
896
  message?: string;
897
+ }
898
+ /** The cell holds a code from the country list. Implicit on every country column. */
899
+ | {
900
+ type: "country";
901
+ message?: string;
902
+ }
903
+ /** The cell holds a code from the currency list. Implicit on every currency column. */
904
+ | {
905
+ type: "currency";
906
+ message?: string;
826
907
  } | {
827
908
  type: "number";
828
909
  /** Inclusive lower bound. */
@@ -840,6 +921,15 @@ type BuiltInValidator = {
840
921
  min?: string;
841
922
  max?: string;
842
923
  message?: string;
924
+ } | {
925
+ type: "time";
926
+ /** Inclusive lower bound, canonical, any of the three precisions. */
927
+ min?: string;
928
+ /** Inclusive upper bound, canonical, any of the three precisions. */
929
+ max?: string;
930
+ /** The finest the column is written. A value carrying more is flagged, never trimmed. */
931
+ precision?: TimePrecision;
932
+ message?: string;
843
933
  } | {
844
934
  type: "unique";
845
935
  message?: string;