@limetech/lime-elements 40.21.0 → 40.22.0
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/CHANGELOG.md +22 -0
- package/dist/cjs/language-s0bKUCvO.js +58 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-action-bar_3.cjs.entry.js +2 -2
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +2 -2
- package/dist/cjs/limel-badge_7.cjs.entry.js +12 -2
- package/dist/cjs/limel-callout.cjs.entry.js +2 -2
- package/dist/cjs/limel-chart.cjs.entry.js +524 -76
- package/dist/cjs/limel-chip-set.cjs.entry.js +2 -2
- package/dist/cjs/limel-chip_2.cjs.entry.js +2 -2
- package/dist/cjs/limel-code-diff.cjs.entry.js +2 -2
- package/dist/cjs/limel-code-editor.cjs.entry.js +2 -2
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -2
- package/dist/cjs/limel-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-dock.cjs.entry.js +2 -2
- package/dist/cjs/limel-drag-handle_2.cjs.entry.js +2 -2
- package/dist/cjs/limel-email-viewer.cjs.entry.js +2 -2
- package/dist/cjs/limel-file-viewer.cjs.entry.js +164 -2
- package/dist/cjs/limel-file.cjs.entry.js +2 -2
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +2 -2
- package/dist/cjs/limel-list-item.cjs.entry.js +2 -2
- package/dist/cjs/limel-pagination-jump.cjs.entry.js +2 -2
- package/dist/cjs/limel-pagination.cjs.entry.js +14 -26
- package/dist/cjs/limel-picker.cjs.entry.js +70 -27
- package/dist/cjs/limel-profile-picture.cjs.entry.js +2 -2
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +2 -2
- package/dist/cjs/limel-resize-handle.cjs.entry.js +2 -2
- package/dist/cjs/limel-side-panel.cjs.entry.js +2 -2
- package/dist/cjs/limel-slider.cjs.entry.js +2 -2
- package/dist/cjs/limel-snackbar.cjs.entry.js +2 -2
- package/dist/cjs/limel-table.cjs.entry.js +2 -2
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{translations-CqJEWcfw.js → translations-JLP5icQ9.js} +1 -1
- package/dist/collection/components/chart/chart.js +116 -45
- package/dist/collection/components/chart/format.js +302 -0
- package/dist/collection/components/chart/options.js +26 -14
- package/dist/collection/components/chart/scale.js +132 -19
- package/dist/collection/components/input-field/input-field.js +10 -0
- package/dist/collection/components/pagination/pagination.js +13 -25
- package/dist/collection/components/picker/picker.js +67 -24
- package/dist/collection/util/language.js +29 -0
- package/dist/esm/language-VamkUr90.js +55 -0
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-action-bar_3.entry.js +2 -2
- package/dist/esm/limel-ai-avatar.entry.js +2 -2
- package/dist/esm/limel-badge_7.entry.js +12 -2
- package/dist/esm/limel-callout.entry.js +2 -2
- package/dist/esm/limel-chart.entry.js +524 -76
- package/dist/esm/limel-chip-set.entry.js +2 -2
- package/dist/esm/limel-chip_2.entry.js +2 -2
- package/dist/esm/limel-code-diff.entry.js +2 -2
- package/dist/esm/limel-code-editor.entry.js +2 -2
- package/dist/esm/limel-collapsible-section.entry.js +2 -2
- package/dist/esm/limel-date-picker.entry.js +1 -1
- package/dist/esm/limel-dock.entry.js +2 -2
- package/dist/esm/limel-drag-handle_2.entry.js +2 -2
- package/dist/esm/limel-email-viewer.entry.js +2 -2
- package/dist/esm/limel-file-viewer.entry.js +164 -2
- package/dist/esm/limel-file.entry.js +2 -2
- package/dist/esm/limel-flatpickr-adapter.entry.js +2 -2
- package/dist/esm/limel-list-item.entry.js +2 -2
- package/dist/esm/limel-pagination-jump.entry.js +2 -2
- package/dist/esm/limel-pagination.entry.js +14 -26
- package/dist/esm/limel-picker.entry.js +71 -28
- package/dist/esm/limel-profile-picture.entry.js +2 -2
- package/dist/esm/limel-prosemirror-adapter.entry.js +2 -2
- package/dist/esm/limel-resize-handle.entry.js +2 -2
- package/dist/esm/limel-side-panel.entry.js +2 -2
- package/dist/esm/limel-slider.entry.js +2 -2
- package/dist/esm/limel-snackbar.entry.js +2 -2
- package/dist/esm/limel-table.entry.js +2 -2
- package/dist/esm/limel-text-editor-link-menu.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{translations-kct5Kybu.js → translations-D9ZGrMhe.js} +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-6e9eeb0a.entry.js → p-0a7cbdc3.entry.js} +1 -1
- package/dist/lime-elements/{p-d35d2859.entry.js → p-0f96e94d.entry.js} +1 -1
- package/dist/lime-elements/{p-a7be03e1.entry.js → p-1a0c5e45.entry.js} +1 -1
- package/dist/lime-elements/{p-5e408c27.entry.js → p-401d5c92.entry.js} +1 -1
- package/dist/lime-elements/{p-6d2d25b9.entry.js → p-430db3b9.entry.js} +1 -1
- package/dist/lime-elements/{p-a6c6a31b.entry.js → p-43b62587.entry.js} +1 -1
- package/dist/lime-elements/{p-958396b5.entry.js → p-48dccb83.entry.js} +1 -1
- package/dist/lime-elements/{p-814b4934.entry.js → p-5c918155.entry.js} +1 -1
- package/dist/lime-elements/{p-22e9e327.entry.js → p-66101ed6.entry.js} +1 -1
- package/dist/lime-elements/{p-d8559847.entry.js → p-7ab72b52.entry.js} +1 -1
- package/dist/lime-elements/{p-7ab726c2.entry.js → p-8d9a2a22.entry.js} +1 -1
- package/dist/lime-elements/{p-55fa19ae.entry.js → p-8de4f0f3.entry.js} +1 -1
- package/dist/lime-elements/p-8e80a884.entry.js +56 -0
- package/dist/lime-elements/{p-bffb5ed2.entry.js → p-99984c66.entry.js} +1 -1
- package/dist/lime-elements/{p-56e2fa48.entry.js → p-9d46f720.entry.js} +1 -1
- package/dist/lime-elements/p-9e2b426c.entry.js +1 -0
- package/dist/lime-elements/{p-Dzp8dXTo.js → p-C9dBa_Im.js} +1 -1
- package/dist/lime-elements/p-VamkUr90.js +1 -0
- package/dist/lime-elements/{p-3ac39bd5.entry.js → p-b1c7033b.entry.js} +2 -2
- package/dist/lime-elements/{p-47fe76a8.entry.js → p-b5451350.entry.js} +1 -1
- package/dist/lime-elements/{p-9edd79a8.entry.js → p-c75f3b0d.entry.js} +1 -1
- package/dist/lime-elements/{p-4c080cd9.entry.js → p-ca4247c4.entry.js} +1 -1
- package/dist/lime-elements/{p-1a7d1d2b.entry.js → p-d53421af.entry.js} +1 -1
- package/dist/lime-elements/{p-6d9b89db.entry.js → p-d8901e39.entry.js} +1 -1
- package/dist/lime-elements/{p-933ffaa8.entry.js → p-d89553b3.entry.js} +1 -1
- package/dist/lime-elements/{p-496b2437.entry.js → p-d93b8ce0.entry.js} +1 -1
- package/dist/lime-elements/{p-23067836.entry.js → p-e97340c4.entry.js} +1 -1
- package/dist/lime-elements/{p-7b87e547.entry.js → p-ec0c113d.entry.js} +1 -1
- package/dist/lime-elements/p-f197000b.entry.js +159 -0
- package/dist/lime-elements/{p-07f3565b.entry.js → p-f6bc6658.entry.js} +1 -1
- package/dist/lime-elements/{p-7fcd48c6.entry.js → p-fa1aa440.entry.js} +1 -1
- package/dist/types/components/chart/chart.d.ts +32 -7
- package/dist/types/components/chart/chart.types.d.ts +15 -1
- package/dist/types/components/chart/format.d.ts +54 -0
- package/dist/types/components/chart/options.d.ts +3 -4
- package/dist/types/components/chart/scale.d.ts +39 -7
- package/dist/types/components/input-field/input-field.d.ts +1 -0
- package/dist/types/components/pagination/pagination.d.ts +6 -12
- package/dist/types/components/picker/picker.d.ts +10 -2
- package/dist/types/components.d.ts +36 -8
- package/dist/types/util/language.d.ts +19 -0
- package/package.json +2 -2
- package/dist/cjs/language-v-MMS6ym.js +0 -28
- package/dist/esm/language-ChagAaNf.js +0 -26
- package/dist/lime-elements/p-7d6a12fe.entry.js +0 -56
- package/dist/lime-elements/p-ChagAaNf.js +0 -1
- package/dist/lime-elements/p-a807a45f.entry.js +0 -159
- package/dist/lime-elements/p-cd479c23.entry.js +0 -1
|
@@ -16,7 +16,7 @@ import { Button } from "./components/button/button.types";
|
|
|
16
16
|
import { CalloutType } from "./components/callout/callout.types";
|
|
17
17
|
import { Image } from "./global/shared-types/image.types";
|
|
18
18
|
import { ListSeparator as ListSeparator1 } from "./global/shared-types/separator.types";
|
|
19
|
-
import { ChartItem, ChartType } from "./components/chart/chart.types";
|
|
19
|
+
import { ChartItem, ChartType, ChartValueFormat } from "./components/chart/chart.types";
|
|
20
20
|
import { Label, LabelValue } from "./components/dynamic-label/label.types";
|
|
21
21
|
import { Link } from "./global/shared-types/link.types";
|
|
22
22
|
import { Chip, ChipType } from "./components/chip-set/chip.types";
|
|
@@ -68,7 +68,7 @@ export { Button } from "./components/button/button.types";
|
|
|
68
68
|
export { CalloutType } from "./components/callout/callout.types";
|
|
69
69
|
export { Image } from "./global/shared-types/image.types";
|
|
70
70
|
export { ListSeparator as ListSeparator1 } from "./global/shared-types/separator.types";
|
|
71
|
-
export { ChartItem, ChartType } from "./components/chart/chart.types";
|
|
71
|
+
export { ChartItem, ChartType, ChartValueFormat } from "./components/chart/chart.types";
|
|
72
72
|
export { Label, LabelValue } from "./components/dynamic-label/label.types";
|
|
73
73
|
export { Link } from "./global/shared-types/link.types";
|
|
74
74
|
export { Chip, ChipType } from "./components/chip-set/chip.types";
|
|
@@ -528,6 +528,8 @@ export namespace Components {
|
|
|
528
528
|
* @exampleComponent limel-example-chart-orientation
|
|
529
529
|
* @exampleComponent limel-example-chart-max-value
|
|
530
530
|
* @exampleComponent limel-example-chart-display-item-percentage
|
|
531
|
+
* @exampleComponent limel-example-chart-value-format
|
|
532
|
+
* @exampleComponent limel-example-chart-value-format-date
|
|
531
533
|
* @exampleComponent limel-example-chart-type-bar
|
|
532
534
|
* @exampleComponent limel-example-chart-type-dot
|
|
533
535
|
* @exampleComponent limel-example-chart-type-area
|
|
@@ -563,9 +565,13 @@ export namespace Components {
|
|
|
563
565
|
*/
|
|
564
566
|
"accessibleValuesLabel"?: string;
|
|
565
567
|
/**
|
|
566
|
-
* Sets the axis increment for `bar`, `dot`, `area`, and `line` charts. When it is not set, or not above zero, the chart works out a step from the values. It also does that when the step would divide the axis into more than 100 parts, so that it does not draw too many lines. Has no effect on other chart types.
|
|
568
|
+
* Sets the axis increment for `bar`, `dot`, `area`, and `line` charts. When it is not set, or not above zero, the chart works out a step from the values. It also does that when the step would divide the axis into more than 100 parts, so that it does not draw too many lines. Has no effect on other chart types, or when `valueFormat` is `date`, where the axis steps through days, weeks, months or years by itself.
|
|
567
569
|
*/
|
|
568
570
|
"axisIncrement"?: number;
|
|
571
|
+
/**
|
|
572
|
+
* The currency of the values when `valueFormat` is `currency`, as a three-letter code such as `SEK`. Without one, the values are written as numbers.
|
|
573
|
+
*/
|
|
574
|
+
"currency"?: string;
|
|
569
575
|
/**
|
|
570
576
|
* When set to true, renders visible labels for X and Y axes. Only affects chart types with X and Y axes, such as area, bar, and line charts.
|
|
571
577
|
* @default false
|
|
@@ -591,7 +597,7 @@ export namespace Components {
|
|
|
591
597
|
*/
|
|
592
598
|
"items": ChartItem[];
|
|
593
599
|
/**
|
|
594
|
-
* Defines the language for translations
|
|
600
|
+
* Defines the language for translations, and for the way values are written, such as `1 234,5` in Swedish.
|
|
595
601
|
* @default 'en'
|
|
596
602
|
*/
|
|
597
603
|
"language": Languages;
|
|
@@ -601,7 +607,7 @@ export namespace Components {
|
|
|
601
607
|
*/
|
|
602
608
|
"loading": boolean;
|
|
603
609
|
/**
|
|
604
|
-
* Sets the value used to scale item values. For `proportion-bar`, `pie`, `doughnut`, and `ring`, it is the denominator used as the whole. It defaults to the combined item values or range extents. The combined size can exceed `maxValue` and produce a total above 100%. For `bar`, `dot`, `area`, and `line`, it is the requested upper bound. The chart can round that bound up to the next `axisIncrement`. Has no effect on `nps` or `scatter`.
|
|
610
|
+
* Sets the value used to scale item values. For `proportion-bar`, `pie`, `doughnut`, and `ring`, it is the denominator used as the whole. It defaults to the combined item values or range extents. The combined size can exceed `maxValue` and produce a total above 100%. For `bar`, `dot`, `area`, and `line`, it is the requested upper bound. The chart can round that bound up to the next `axisIncrement`, or to the end of its day when `valueFormat` is `date`. Has no effect on `nps` or `scatter`.
|
|
605
611
|
*/
|
|
606
612
|
"maxValue"?: number;
|
|
607
613
|
/**
|
|
@@ -614,6 +620,11 @@ export namespace Components {
|
|
|
614
620
|
* @default 'proportion-bar'
|
|
615
621
|
*/
|
|
616
622
|
"type"?: ChartType;
|
|
623
|
+
/**
|
|
624
|
+
* Defines how values are written: as numbers, as percentages where `0.25` is `25 %`, as amounts of `currency`, or as dates. With `date`, each value is a date in milliseconds since 1970, and the value axis steps through days, weeks, months or years. The axes, the values shown with `displayItemValue`, the tooltips, and the screen reader table all follow it, in the chart's `language`. An item's `formattedValue` is shown as it is.
|
|
625
|
+
* @default 'number'
|
|
626
|
+
*/
|
|
627
|
+
"valueFormat": ChartValueFormat;
|
|
617
628
|
}
|
|
618
629
|
/**
|
|
619
630
|
* The Checkbox component is a classic and essential element in UI design that allows
|
|
@@ -4989,6 +5000,8 @@ declare global {
|
|
|
4989
5000
|
* @exampleComponent limel-example-chart-orientation
|
|
4990
5001
|
* @exampleComponent limel-example-chart-max-value
|
|
4991
5002
|
* @exampleComponent limel-example-chart-display-item-percentage
|
|
5003
|
+
* @exampleComponent limel-example-chart-value-format
|
|
5004
|
+
* @exampleComponent limel-example-chart-value-format-date
|
|
4992
5005
|
* @exampleComponent limel-example-chart-type-bar
|
|
4993
5006
|
* @exampleComponent limel-example-chart-type-dot
|
|
4994
5007
|
* @exampleComponent limel-example-chart-type-area
|
|
@@ -7762,6 +7775,8 @@ declare namespace LocalJSX {
|
|
|
7762
7775
|
* @exampleComponent limel-example-chart-orientation
|
|
7763
7776
|
* @exampleComponent limel-example-chart-max-value
|
|
7764
7777
|
* @exampleComponent limel-example-chart-display-item-percentage
|
|
7778
|
+
* @exampleComponent limel-example-chart-value-format
|
|
7779
|
+
* @exampleComponent limel-example-chart-value-format-date
|
|
7765
7780
|
* @exampleComponent limel-example-chart-type-bar
|
|
7766
7781
|
* @exampleComponent limel-example-chart-type-dot
|
|
7767
7782
|
* @exampleComponent limel-example-chart-type-area
|
|
@@ -7797,9 +7812,13 @@ declare namespace LocalJSX {
|
|
|
7797
7812
|
*/
|
|
7798
7813
|
"accessibleValuesLabel"?: string;
|
|
7799
7814
|
/**
|
|
7800
|
-
* Sets the axis increment for `bar`, `dot`, `area`, and `line` charts. When it is not set, or not above zero, the chart works out a step from the values. It also does that when the step would divide the axis into more than 100 parts, so that it does not draw too many lines. Has no effect on other chart types.
|
|
7815
|
+
* Sets the axis increment for `bar`, `dot`, `area`, and `line` charts. When it is not set, or not above zero, the chart works out a step from the values. It also does that when the step would divide the axis into more than 100 parts, so that it does not draw too many lines. Has no effect on other chart types, or when `valueFormat` is `date`, where the axis steps through days, weeks, months or years by itself.
|
|
7801
7816
|
*/
|
|
7802
7817
|
"axisIncrement"?: number;
|
|
7818
|
+
/**
|
|
7819
|
+
* The currency of the values when `valueFormat` is `currency`, as a three-letter code such as `SEK`. Without one, the values are written as numbers.
|
|
7820
|
+
*/
|
|
7821
|
+
"currency"?: string;
|
|
7803
7822
|
/**
|
|
7804
7823
|
* When set to true, renders visible labels for X and Y axes. Only affects chart types with X and Y axes, such as area, bar, and line charts.
|
|
7805
7824
|
* @default false
|
|
@@ -7825,7 +7844,7 @@ declare namespace LocalJSX {
|
|
|
7825
7844
|
*/
|
|
7826
7845
|
"items": ChartItem[];
|
|
7827
7846
|
/**
|
|
7828
|
-
* Defines the language for translations
|
|
7847
|
+
* Defines the language for translations, and for the way values are written, such as `1 234,5` in Swedish.
|
|
7829
7848
|
* @default 'en'
|
|
7830
7849
|
*/
|
|
7831
7850
|
"language"?: Languages;
|
|
@@ -7835,7 +7854,7 @@ declare namespace LocalJSX {
|
|
|
7835
7854
|
*/
|
|
7836
7855
|
"loading"?: boolean;
|
|
7837
7856
|
/**
|
|
7838
|
-
* Sets the value used to scale item values. For `proportion-bar`, `pie`, `doughnut`, and `ring`, it is the denominator used as the whole. It defaults to the combined item values or range extents. The combined size can exceed `maxValue` and produce a total above 100%. For `bar`, `dot`, `area`, and `line`, it is the requested upper bound. The chart can round that bound up to the next `axisIncrement`. Has no effect on `nps` or `scatter`.
|
|
7857
|
+
* Sets the value used to scale item values. For `proportion-bar`, `pie`, `doughnut`, and `ring`, it is the denominator used as the whole. It defaults to the combined item values or range extents. The combined size can exceed `maxValue` and produce a total above 100%. For `bar`, `dot`, `area`, and `line`, it is the requested upper bound. The chart can round that bound up to the next `axisIncrement`, or to the end of its day when `valueFormat` is `date`. Has no effect on `nps` or `scatter`.
|
|
7839
7858
|
*/
|
|
7840
7859
|
"maxValue"?: number;
|
|
7841
7860
|
/**
|
|
@@ -7852,6 +7871,11 @@ declare namespace LocalJSX {
|
|
|
7852
7871
|
* @default 'proportion-bar'
|
|
7853
7872
|
*/
|
|
7854
7873
|
"type"?: ChartType;
|
|
7874
|
+
/**
|
|
7875
|
+
* Defines how values are written: as numbers, as percentages where `0.25` is `25 %`, as amounts of `currency`, or as dates. With `date`, each value is a date in milliseconds since 1970, and the value axis steps through days, weeks, months or years. The axes, the values shown with `displayItemValue`, the tooltips, and the screen reader table all follow it, in the chart's `language`. An item's `formattedValue` is shown as it is.
|
|
7876
|
+
* @default 'number'
|
|
7877
|
+
*/
|
|
7878
|
+
"valueFormat"?: ChartValueFormat;
|
|
7855
7879
|
}
|
|
7856
7880
|
/**
|
|
7857
7881
|
* The Checkbox component is a classic and essential element in UI design that allows
|
|
@@ -12087,6 +12111,8 @@ declare namespace LocalJSX {
|
|
|
12087
12111
|
"orientation": 'landscape' | 'portrait';
|
|
12088
12112
|
"maxValue": number;
|
|
12089
12113
|
"axisIncrement": number;
|
|
12114
|
+
"valueFormat": ChartValueFormat;
|
|
12115
|
+
"currency": string;
|
|
12090
12116
|
"loading": boolean;
|
|
12091
12117
|
}
|
|
12092
12118
|
interface LimelCheckboxAttributes {
|
|
@@ -12969,6 +12995,8 @@ declare module "@stencil/core" {
|
|
|
12969
12995
|
* @exampleComponent limel-example-chart-orientation
|
|
12970
12996
|
* @exampleComponent limel-example-chart-max-value
|
|
12971
12997
|
* @exampleComponent limel-example-chart-display-item-percentage
|
|
12998
|
+
* @exampleComponent limel-example-chart-value-format
|
|
12999
|
+
* @exampleComponent limel-example-chart-value-format-date
|
|
12972
13000
|
* @exampleComponent limel-example-chart-type-bar
|
|
12973
13001
|
* @exampleComponent limel-example-chart-type-dot
|
|
12974
13002
|
* @exampleComponent limel-example-chart-type-area
|
|
@@ -17,4 +17,23 @@
|
|
|
17
17
|
* @returns the lower-cased primary subtag, or an empty string
|
|
18
18
|
*/
|
|
19
19
|
export declare function getPrimarySubtag(language: unknown): string;
|
|
20
|
+
/**
|
|
21
|
+
* The locale that `Intl` writes numbers and dates in for `language`, or
|
|
22
|
+
* `undefined` when it cannot write in that language. `Intl` throws on a
|
|
23
|
+
* tag it cannot read, such as `sv_SE`, and quietly uses the viewer's own
|
|
24
|
+
* locale for one it does not know, such as `zz`. A component that writes in
|
|
25
|
+
* its `language` while it renders checks it here, and falls back to English
|
|
26
|
+
* when this gives `undefined`.
|
|
27
|
+
*
|
|
28
|
+
* Examples:
|
|
29
|
+
* - "sv" => "sv"
|
|
30
|
+
* - "SV-se" => "sv-SE"
|
|
31
|
+
* - "sv_SE" => undefined
|
|
32
|
+
* - "zz" => undefined
|
|
33
|
+
* - undefined => undefined
|
|
34
|
+
*
|
|
35
|
+
* @param language - the language to write in
|
|
36
|
+
* @returns the locale, or `undefined`
|
|
37
|
+
*/
|
|
38
|
+
export declare function getSupportedLocale(language: unknown): string | undefined;
|
|
20
39
|
//# sourceMappingURL=language.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limetech/lime-elements",
|
|
3
|
-
"version": "40.
|
|
3
|
+
"version": "40.22.0",
|
|
4
4
|
"description": "Lime Elements",
|
|
5
5
|
"author": "Lime Technologies",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"morphdom": "^2.7.8",
|
|
95
95
|
"number-abbreviate": "^2.0.0",
|
|
96
96
|
"parse-css-color": "^0.2.1",
|
|
97
|
-
"postal-mime": "^4.
|
|
97
|
+
"postal-mime": "^4.2.0",
|
|
98
98
|
"prettier": "^3.9.10",
|
|
99
99
|
"prosemirror-example-setup": "^1.2.3",
|
|
100
100
|
"prosemirror-markdown": "^1.13.9",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Reduce a language to the primary subtag that our language maps are keyed by.
|
|
5
|
-
*
|
|
6
|
-
* A `language` prop is typed, but a custom element takes whatever string an
|
|
7
|
-
* attribute carries — commonly a full BCP 47 tag such as `nb-NO`, since a host
|
|
8
|
-
* application often derives the language from `document.documentElement.lang`.
|
|
9
|
-
* Anything that is not a string must resolve rather than throw, so that an
|
|
10
|
-
* unexpected value can never break a component's render.
|
|
11
|
-
*
|
|
12
|
-
* Examples:
|
|
13
|
-
* - "nb" => "nb"
|
|
14
|
-
* - "nb-NO" => "nb"
|
|
15
|
-
* - "SV-SE" => "sv"
|
|
16
|
-
* - undefined => ""
|
|
17
|
-
*
|
|
18
|
-
* @param language - the language to reduce
|
|
19
|
-
* @returns the lower-cased primary subtag, or an empty string
|
|
20
|
-
*/
|
|
21
|
-
function getPrimarySubtag(language) {
|
|
22
|
-
if (typeof language !== 'string') {
|
|
23
|
-
return '';
|
|
24
|
-
}
|
|
25
|
-
return language.toLowerCase().split('-', 1)[0];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
exports.getPrimarySubtag = getPrimarySubtag;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reduce a language to the primary subtag that our language maps are keyed by.
|
|
3
|
-
*
|
|
4
|
-
* A `language` prop is typed, but a custom element takes whatever string an
|
|
5
|
-
* attribute carries — commonly a full BCP 47 tag such as `nb-NO`, since a host
|
|
6
|
-
* application often derives the language from `document.documentElement.lang`.
|
|
7
|
-
* Anything that is not a string must resolve rather than throw, so that an
|
|
8
|
-
* unexpected value can never break a component's render.
|
|
9
|
-
*
|
|
10
|
-
* Examples:
|
|
11
|
-
* - "nb" => "nb"
|
|
12
|
-
* - "nb-NO" => "nb"
|
|
13
|
-
* - "SV-SE" => "sv"
|
|
14
|
-
* - undefined => ""
|
|
15
|
-
*
|
|
16
|
-
* @param language - the language to reduce
|
|
17
|
-
* @returns the lower-cased primary subtag, or an empty string
|
|
18
|
-
*/
|
|
19
|
-
function getPrimarySubtag(language) {
|
|
20
|
-
if (typeof language !== 'string') {
|
|
21
|
-
return '';
|
|
22
|
-
}
|
|
23
|
-
return language.toLowerCase().split('-', 1)[0];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { getPrimarySubtag as g };
|