ish-ui 1.0.40 → 1.0.41

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.
@@ -2,4 +2,5 @@ import { SelectItemDefault } from '../../model';
2
2
  export declare const getHighlightedPartLabel: (label: string, highlighted: string, options?: any) => any;
3
3
  export declare const sortDefaultSelectItems: (a: SelectItemDefault, b: SelectItemDefault) => 1 | -1;
4
4
  export declare const mapSelectItems: (i: any) => SelectItemDefault;
5
+ export declare const stringArrayToSelectItems: (arr: string[]) => SelectItemDefault[];
5
6
  export * from './PhoneMasks';
@@ -9,4 +9,9 @@ export const getHighlightedPartLabel = (label, highlighted, options) => {
9
9
  };
10
10
  export const sortDefaultSelectItems = (a, b) => (a.label[0].toLowerCase() > b.label[0].toLowerCase() ? 1 : -1);
11
11
  export const mapSelectItems = (i) => ({ label: i, value: i });
12
+ export const stringArrayToSelectItems = (arr) => {
13
+ const mapped = arr.map(mapSelectItems);
14
+ mapped.sort(sortDefaultSelectItems);
15
+ return mapped;
16
+ };
12
17
  export * from './PhoneMasks';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ish-ui",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "UI elements for onCourse and other ish apps",
5
5
  "main": "main.ts",
6
6
  "devDependencies": {