@updog/data-editor-wc 0.1.87 → 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
@@ -409,6 +409,8 @@ declare var export_default = {
409
409
  validation: {
410
410
  alreadyExists: "Already exists in your database",
411
411
  endDateBeforeStart: "End date must be after start date",
412
+ invalidCountry: "Invalid country",
413
+ invalidCurrency: "Invalid currency",
412
414
  invalidDate: "Invalid date",
413
415
  invalidEmail: "Invalid email address",
414
416
  invalidFormat: "Invalid format",
@@ -535,6 +537,8 @@ declare var export_default = {
535
537
  showAll: "Show all",
536
538
  showMatched: "Show matched",
537
539
  allMatched: "All values are matched",
540
+ corrected: "Corrected",
541
+ possibleMatch: "Possible match",
538
542
  tooManyValues: "Showing first {{shown}} of {{total}} values",
539
543
  unmatchedWarning:
540
544
  "Unmatched values won't be imported. Match this value to keep the data. You can edit values after importing.",
@@ -698,6 +702,47 @@ type MultiSelectEditorCell = {
698
702
  /** Splits a raw imported cell and joins on export. Omitted: import auto-detects, export joins with `", "`. */
699
703
  delimiter?: string;
700
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
+ };
701
746
  /** Number input cell with locale-aware formatting. Bounds and decimal digits come from the column's `{ type: "number" }` validator. */
702
747
  type NumberEditorCell = {
703
748
  type: "number";
@@ -714,9 +759,11 @@ type NumberEditorCell = {
714
759
  * - `"time"` — plain text input for a time of day; the column is checked against `{ type: "time" }`.
715
760
  * - `"select"` — dropdown with a fixed list of options.
716
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.
717
764
  * - `"number"` — number input with locale-aware formatting.
718
765
  */
719
- type CellEditor = TextEditorCell | DateEditorCell | TimeEditorCell | SelectEditorCell | MultiSelectEditorCell | NumberEditorCell;
766
+ type CellEditor = TextEditorCell | DateEditorCell | TimeEditorCell | SelectEditorCell | MultiSelectEditorCell | CountryEditorCell | CurrencyEditorCell | NumberEditorCell;
720
767
  /** Dropdown filter shown in the sidebar Filters panel. */
721
768
  type SelectColumnFilter = {
722
769
  type: "select";
@@ -847,6 +894,16 @@ type BuiltInValidator = {
847
894
  type: "oneOf";
848
895
  values: string[];
849
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;
850
907
  } | {
851
908
  type: "number";
852
909
  /** Inclusive lower bound. */