@longline/aqua-ui 1.0.221 → 1.0.222

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.
@@ -13,7 +13,7 @@ interface ICountryFormatterProps {
13
13
  type?: 'flag' | 'name' | 'both';
14
14
  }
15
15
  /**
16
- * The `Country` formatter takes a country code or name and produces either
16
+ * The `CountryFormatter` takes a country code or name and produces either
17
17
  * an emoji flag, the country name, or both, depending on the `type` prop.
18
18
  */
19
19
  declare const CountryFormatter: {
@@ -6,7 +6,7 @@ import * as React from 'react';
6
6
  import styled from 'styled-components';
7
7
  import { CountryUtil } from './CountryUtil';
8
8
  /**
9
- * The `Country` formatter takes a country code or name and produces either
9
+ * The `CountryFormatter` takes a country code or name and produces either
10
10
  * an emoji flag, the country name, or both, depending on the `type` prop.
11
11
  */
12
12
  var CountryFormatter = function (_a) {
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ interface IDivisionFormatterProps {
3
+ /**
4
+ * The division code (e.g. "CA-NS") to format.
5
+ */
6
+ value: string;
7
+ }
8
+ /**
9
+ * The `DivisionFormatter` takes a country code or name and produces either
10
+ * an emoji flag, the country name, or both, depending on the `type` prop.
11
+ */
12
+ declare const DivisionFormatter: ({ value }: IDivisionFormatterProps) => React.JSX.Element;
13
+ export { DivisionFormatter };
@@ -0,0 +1,18 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import * as React from 'react';
6
+ import styled from 'styled-components';
7
+ import { DivisionUtil } from './DivisionUtil';
8
+ /**
9
+ * The `DivisionFormatter` takes a country code or name and produces either
10
+ * an emoji flag, the country name, or both, depending on the `type` prop.
11
+ */
12
+ var DivisionFormatter = function (_a) {
13
+ var value = _a.value;
14
+ return React.createElement(Name, null, DivisionUtil.getDivisionName(value));
15
+ };
16
+ var Name = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n text-overflow: ellipsis;\n overflow: hidden; \n"], ["\n text-overflow: ellipsis;\n overflow: hidden; \n"])));
17
+ export { DivisionFormatter };
18
+ var templateObject_1;
@@ -0,0 +1,21 @@
1
+ interface IIsoDivisionsMap {
2
+ [key: string]: string;
3
+ }
4
+ declare class DivisionUtil {
5
+ private static data;
6
+ /**
7
+ * Get all country codes.
8
+ * @returns List of ISO country codes.
9
+ */
10
+ static getCountries: () => string[];
11
+ /**
12
+ * Given a country code (e.g. `NL`) return its divisions.
13
+ * @param countryCode e.g. `NL`
14
+ * @returns Object with mapping key->name of divisions
15
+ */
16
+ static getDivisions: (countryCode: string) => IIsoDivisionsMap;
17
+ static getCountryName: (countryCode: string) => string;
18
+ private static divisionDict;
19
+ static getDivisionName: (divisionCode: string) => string;
20
+ }
21
+ export { DivisionUtil };