@caspeco/casper-ui-library 11.3.0 → 12.0.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/dist/components/accordion/accordion-item.js +10 -10
- package/dist/components/accordion/accordion-panel.js +4 -4
- package/dist/components/accordion/accordion.js +4 -4
- package/dist/components/alert/alert.js +10 -10
- package/dist/components/badge/badge.js +18 -18
- package/dist/components/box/box.js +3 -3
- package/dist/components/breadcrumbs/breadcrumb-item.d.ts.map +1 -1
- package/dist/components/breadcrumbs/breadcrumb-item.js +5 -4
- package/dist/components/breadcrumbs/breadcrumb-link.js +3 -3
- package/dist/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.js +23 -23
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +5 -5
- package/dist/components/checkbox/checkbox-icon.js +3 -3
- package/dist/components/checkbox/checkbox.js +7 -7
- package/dist/components/checkbox-group/checkbox-group.js +3 -3
- package/dist/components/collapsible/collapsible.d.ts +1 -1
- package/dist/components/collapsible/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible/collapsible.js +30 -29
- package/dist/components/collapsible/collapsible.translations.d.ts +6 -0
- package/dist/components/collapsible/collapsible.translations.d.ts.map +1 -0
- package/dist/components/collapsible/collapsible.translations.js +54 -0
- package/dist/components/collapsible/types.d.ts +0 -6
- package/dist/components/collapsible/types.d.ts.map +1 -1
- package/dist/components/combobox/combobox-button.d.ts +1 -1
- package/dist/components/combobox/combobox-button.d.ts.map +1 -1
- package/dist/components/combobox/combobox-button.js +66 -64
- package/dist/components/combobox/combobox-item.js +8 -8
- package/dist/components/combobox/combobox-menu.d.ts.map +1 -1
- package/dist/components/combobox/combobox-menu.js +95 -94
- package/dist/components/combobox/combobox.d.ts +1 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +91 -91
- package/dist/components/combobox/combobox.translations.d.ts +10 -0
- package/dist/components/combobox/combobox.translations.d.ts.map +1 -0
- package/dist/components/combobox/combobox.translations.js +102 -0
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.d.ts.map +1 -1
- package/dist/components/combobox/types.d.ts +0 -15
- package/dist/components/combobox/types.d.ts.map +1 -1
- package/dist/components/date-picker/base-date-picker.d.ts +1 -1
- package/dist/components/date-picker/base-date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/base-date-picker.js +163 -162
- package/dist/components/date-picker/date-multi-picker.d.ts +1 -1
- package/dist/components/date-picker/date-multi-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-multi-picker.js +20 -21
- package/dist/components/date-picker/date-picker-date-cell.js +27 -27
- package/dist/components/date-picker/date-picker-header.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-header.js +84 -116
- package/dist/components/date-picker/date-picker-week-cell.js +4 -4
- package/dist/components/date-picker/date-picker.composition.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.js +20 -21
- package/dist/components/date-picker/date-picker.translations.d.ts +6 -0
- package/dist/components/date-picker/date-picker.translations.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.translations.js +54 -0
- package/dist/components/date-picker/date-range-picker.d.ts +1 -1
- package/dist/components/date-picker/date-range-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-range-picker.js +15 -16
- package/dist/components/date-picker/date-week-picker.d.ts +1 -1
- package/dist/components/date-picker/date-week-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-week-picker.js +13 -14
- package/dist/components/date-picker/types.d.ts +4 -10
- package/dist/components/date-picker/types.d.ts.map +1 -1
- package/dist/components/divider/divider.js +3 -3
- package/dist/components/drawer/drawer.js +6 -6
- package/dist/components/drawer/inline-drawer.js +4 -4
- package/dist/components/fieldset/fieldset-error-text.js +3 -3
- package/dist/components/fieldset/fieldset-helper-text.js +3 -3
- package/dist/components/fieldset/fieldset-legend.js +3 -3
- package/dist/components/fieldset/fieldset.js +3 -3
- package/dist/components/flex/flex.js +3 -3
- package/dist/components/form-control/form-control.js +3 -3
- package/dist/components/form-control/form-error-message.js +3 -3
- package/dist/components/form-control/form-helper-text.js +3 -3
- package/dist/components/form-control/form-label.js +5 -5
- package/dist/components/grid/grid-item.js +3 -3
- package/dist/components/grid/grid.js +3 -3
- package/dist/components/heading/heading.js +3 -3
- package/dist/components/highlight/highlight.js +3 -3
- package/dist/components/icon/create-icon.js +7 -7
- package/dist/components/icon-button/icon-button.js +4 -4
- package/dist/components/image/image.js +3 -3
- package/dist/components/image-upload/image-upload-dropzone.d.ts +1 -3
- package/dist/components/image-upload/image-upload-dropzone.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload-dropzone.js +75 -74
- package/dist/components/image-upload/image-upload-icons.js +11 -11
- package/dist/components/image-upload/image-upload-modal.d.ts +2 -3
- package/dist/components/image-upload/image-upload-modal.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload-modal.js +69 -69
- package/dist/components/image-upload/image-upload.d.ts +1 -1
- package/dist/components/image-upload/image-upload.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload.js +43 -44
- package/dist/components/image-upload/image-upload.translations.d.ts +12 -0
- package/dist/components/image-upload/image-upload.translations.d.ts.map +1 -0
- package/dist/components/image-upload/image-upload.translations.js +126 -0
- package/dist/components/image-upload/types.d.ts +0 -3
- package/dist/components/image-upload/types.d.ts.map +1 -1
- package/dist/components/input/input.d.ts +1 -1
- package/dist/components/input/input.js +5 -5
- package/dist/components/link/link.js +3 -3
- package/dist/components/list/list-item.js +3 -3
- package/dist/components/list/list.js +3 -3
- package/dist/components/menu/menu-box-button.js +4 -4
- package/dist/components/menu/menu-button.js +4 -4
- package/dist/components/menu/menu-group.js +11 -11
- package/dist/components/menu/menu-icon-button.js +4 -4
- package/dist/components/menu/menu-item.js +7 -7
- package/dist/components/menu/menu-list.js +3 -3
- package/dist/components/menu/menu.js +4 -4
- package/dist/components/message/message.js +8 -8
- package/dist/components/modal/modal-body.js +3 -3
- package/dist/components/modal/modal-close-button.js +5 -5
- package/dist/components/modal/modal-footer.js +3 -3
- package/dist/components/modal/modal-header.js +3 -3
- package/dist/components/modal/modal.js +8 -8
- package/dist/components/navigation-list/navigation-list-item.js +10 -10
- package/dist/components/navigation-list/navigation-list.js +4 -4
- package/dist/components/paginator/paginator.composition.d.ts.map +1 -1
- package/dist/components/paginator/paginator.d.ts +1 -4
- package/dist/components/paginator/paginator.d.ts.map +1 -1
- package/dist/components/paginator/paginator.js +31 -30
- package/dist/components/paginator/paginator.translations.d.ts +7 -0
- package/dist/components/paginator/paginator.translations.d.ts.map +1 -0
- package/dist/components/paginator/paginator.translations.js +66 -0
- package/dist/components/phone-input/country-data.d.ts +2 -2
- package/dist/components/phone-input/country-data.d.ts.map +1 -1
- package/dist/components/phone-input/country-list.js +6 -6
- package/dist/components/phone-input/country-selector.d.ts +1 -4
- package/dist/components/phone-input/country-selector.d.ts.map +1 -1
- package/dist/components/phone-input/country-selector.js +86 -84
- package/dist/components/phone-input/phone-input-helpers.d.ts +4 -5
- package/dist/components/phone-input/phone-input-helpers.d.ts.map +1 -1
- package/dist/components/phone-input/phone-input-helpers.js +33 -34
- package/dist/components/phone-input/phone-input.d.ts +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/phone-input/phone-input.js +38 -38
- package/dist/components/phone-input/phone-input.translations.d.ts +10 -0
- package/dist/components/phone-input/phone-input.translations.d.ts.map +1 -0
- package/dist/components/phone-input/phone-input.translations.js +102 -0
- package/dist/components/phone-input/types.d.ts +0 -3
- package/dist/components/phone-input/types.d.ts.map +1 -1
- package/dist/components/phone-input/use-phone-input.d.ts +0 -3
- package/dist/components/phone-input/use-phone-input.d.ts.map +1 -1
- package/dist/components/phone-input/use-phone-input.js +82 -81
- package/dist/components/quantity-button/quantity-button.js +12 -12
- package/dist/components/radio/radio-group.js +4 -4
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +14 -14
- package/dist/components/radio-card/radio-card-group.js +3 -3
- package/dist/components/radio-card/radio-card.d.ts +1 -1
- package/dist/components/radio-card/radio-card.js +7 -7
- package/dist/components/rich-text-editor/index.d.ts +1 -1
- package/dist/components/rich-text-editor/index.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor-context.d.ts +0 -2
- package/dist/components/rich-text-editor/rich-text-editor-context.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor-control.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor-control.js +129 -128
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.js +22 -25
- package/dist/components/rich-text-editor/{translations.d.ts → rich-text-editor.translations.d.ts} +3 -5
- package/dist/components/rich-text-editor/rich-text-editor.translations.d.ts.map +1 -0
- package/dist/components/rich-text-editor/rich-text-editor.translations.js +234 -0
- package/dist/components/rich-text-editor/rich-text-renderer.js +4 -4
- package/dist/components/rich-text-editor/types.d.ts +0 -2
- package/dist/components/rich-text-editor/types.d.ts.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +5 -5
- package/dist/components/select/select.js +5 -5
- package/dist/components/skeleton/skeleton-text.js +3 -3
- package/dist/components/skeleton/skeleton.js +3 -3
- package/dist/components/spinner/spinner.js +5 -5
- package/dist/components/stack/stack.d.ts +1 -1
- package/dist/components/stack/stack.js +3 -3
- package/dist/components/stepper/step.js +25 -25
- package/dist/components/stepper/stepper.js +8 -8
- package/dist/components/switch/switch.js +6 -6
- package/dist/components/table/table-cell.d.ts +1 -3
- package/dist/components/table/table-cell.d.ts.map +1 -1
- package/dist/components/table/table-cell.js +43 -46
- package/dist/components/table/table-column-resize-handle.d.ts.map +1 -1
- package/dist/components/table/table-column-resize-handle.js +22 -21
- package/dist/components/table/table-content.d.ts.map +1 -1
- package/dist/components/table/table-content.js +81 -79
- package/dist/components/table/table-context-provider.d.ts +1 -4
- package/dist/components/table/table-context-provider.d.ts.map +1 -1
- package/dist/components/table/table-context-provider.js +137 -140
- package/dist/components/table/table-drag-accessibility.d.ts +3 -3
- package/dist/components/table/table-drag-accessibility.d.ts.map +1 -1
- package/dist/components/table/table-drag-accessibility.js +10 -14
- package/dist/components/table/table-filter.d.ts.map +1 -1
- package/dist/components/table/table-filter.js +59 -59
- package/dist/components/table/table-header-dropdown.d.ts +0 -2
- package/dist/components/table/table-header-dropdown.d.ts.map +1 -1
- package/dist/components/table/table-header-dropdown.js +28 -27
- package/dist/components/table/table-header-row.d.ts.map +1 -1
- package/dist/components/table/table-header-row.js +53 -56
- package/dist/components/table/table-row-drag-handle.d.ts +1 -3
- package/dist/components/table/table-row-drag-handle.d.ts.map +1 -1
- package/dist/components/table/table-row-drag-handle.js +10 -9
- package/dist/components/table/table-row-expand-toggle-button.d.ts +1 -3
- package/dist/components/table/table-row-expand-toggle-button.d.ts.map +1 -1
- package/dist/components/table/table-row-expand-toggle-button.js +9 -8
- package/dist/components/table/table-row.d.ts.map +1 -1
- package/dist/components/table/table-row.js +5 -6
- package/dist/components/table/table-sorted-reorder-prompt.d.ts +1 -3
- package/dist/components/table/table-sorted-reorder-prompt.d.ts.map +1 -1
- package/dist/components/table/table-sorted-reorder-prompt.js +26 -25
- package/dist/components/table/table-toolbar-actions.d.ts.map +1 -1
- package/dist/components/table/table-toolbar-actions.js +4 -4
- package/dist/components/table/table-toolbar-add-button.d.ts.map +1 -1
- package/dist/components/table/table-toolbar-add-button.js +4 -4
- package/dist/components/table/table-toolbar-settings.d.ts.map +1 -1
- package/dist/components/table/table-toolbar-settings.js +110 -108
- package/dist/components/table/table-toolbar.js +11 -11
- package/dist/components/table/table.composition.d.ts.map +1 -1
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +31 -32
- package/dist/components/table/table.translations.d.ts +45 -0
- package/dist/components/table/table.translations.d.ts.map +1 -0
- package/dist/components/table/table.translations.js +522 -0
- package/dist/components/table/types.d.ts +0 -5
- package/dist/components/table/types.d.ts.map +1 -1
- package/dist/components/tabs/tab-list.js +3 -3
- package/dist/components/tabs/tab-panel.js +3 -3
- package/dist/components/tabs/tab-panels.js +3 -3
- package/dist/components/tabs/tab-with-image.js +10 -10
- package/dist/components/tabs/tab.js +4 -4
- package/dist/components/tabs/tabs.js +3 -3
- package/dist/components/tag/tag.js +28 -28
- package/dist/components/text/text.js +3 -3
- package/dist/components/textarea/textarea.js +3 -3
- package/dist/components/toaster/toaster.js +9 -9
- package/dist/components/toggle-button/toggle-button.js +3 -3
- package/dist/components/toggle-button/use-button-children.js +10 -10
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/tooltip/tooltip.js +8 -8
- package/dist/index.js +404 -402
- package/dist/node_modules/libphonenumber-js/metadata.mobile.json.js +13 -19
- package/dist/test-utils/render-with-theme.d.ts +5 -1
- package/dist/test-utils/render-with-theme.d.ts.map +1 -1
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/locale-provider.d.ts +9 -0
- package/dist/theme/locale-provider.d.ts.map +1 -0
- package/dist/theme/locale-provider.js +14 -0
- package/dist/theme/locale-provider.spec.d.ts +2 -0
- package/dist/theme/locale-provider.spec.d.ts.map +1 -0
- package/dist/theme/theme-locale.d.ts +7 -0
- package/dist/theme/theme-locale.d.ts.map +1 -0
- package/dist/theme/theme-locale.js +8 -0
- package/dist/theme/theme-provider.d.ts +4 -1
- package/dist/theme/theme-provider.d.ts.map +1 -1
- package/dist/theme/theme-provider.js +30 -25
- package/dist/theme/translations.d.ts +14 -0
- package/dist/theme/translations.d.ts.map +1 -0
- package/dist/theme/translations.js +10 -0
- package/dist/theme/translations.spec.d.ts +2 -0
- package/dist/theme/translations.spec.d.ts.map +1 -0
- package/package.json +5 -5
- package/dist/components/collapsible/translations.d.ts +0 -32
- package/dist/components/collapsible/translations.d.ts.map +0 -1
- package/dist/components/collapsible/translations.js +0 -30
- package/dist/components/combobox/translations.d.ts +0 -9
- package/dist/components/combobox/translations.d.ts.map +0 -1
- package/dist/components/combobox/translations.js +0 -57
- package/dist/components/image-upload/translations.d.ts +0 -73
- package/dist/components/image-upload/translations.d.ts.map +0 -1
- package/dist/components/image-upload/translations.js +0 -66
- package/dist/components/paginator/translations.d.ts +0 -9
- package/dist/components/paginator/translations.d.ts.map +0 -1
- package/dist/components/paginator/translations.js +0 -36
- package/dist/components/phone-input/translations.d.ts +0 -60
- package/dist/components/phone-input/translations.d.ts.map +0 -1
- package/dist/components/phone-input/translations.js +0 -54
- package/dist/components/rich-text-editor/translations.d.ts.map +0 -1
- package/dist/components/rich-text-editor/translations.js +0 -120
- package/dist/components/table/translations.d.ts +0 -308
- package/dist/components/table/translations.d.ts.map +0 -1
- package/dist/components/table/translations.js +0 -267
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
import { require_compiler_runtime as e } from "../../node_modules/react/compiler-runtime.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useLocale as t } from "../../theme/theme-locale.js";
|
|
3
|
+
import { ThemeColorVariable as n, ThemeFontSizeVariable as r, ThemeSpaceVariable as i } from "../../theme/theme-types.js";
|
|
3
4
|
import { ModuleWebIcon as ee } from "../icon/icons/module-web-icon.js";
|
|
4
|
-
import { SearchIcon as
|
|
5
|
-
import { SelectIcon as
|
|
6
|
-
import { Text as
|
|
7
|
-
import { Box as
|
|
5
|
+
import { SearchIcon as a } from "../icon/icons/search-icon.js";
|
|
6
|
+
import { SelectIcon as o } from "../icon/icons/select-icon.js";
|
|
7
|
+
import { Text as s } from "../text/text.js";
|
|
8
|
+
import { Box as c } from "../box/box.js";
|
|
8
9
|
import { Menu as te } from "../menu/menu.js";
|
|
9
10
|
import { MenuBoxButton as ne } from "../menu/menu-box-button.js";
|
|
10
11
|
import { Flex as re } from "../flex/flex.js";
|
|
11
|
-
import { MenuIconButton as
|
|
12
|
-
import { MenuList as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { MenuIconButton as ie } from "../menu/menu-icon-button.js";
|
|
13
|
+
import { MenuList as ae } from "../menu/menu-list.js";
|
|
14
|
+
import { useComponentTranslations as oe } from "../../theme/translations.js";
|
|
15
|
+
import { Divider as se } from "../divider/divider.js";
|
|
16
|
+
import { FormControl as ce } from "../form-control/form-control.js";
|
|
17
|
+
import { Input as le } from "../input/input.js";
|
|
16
18
|
import l from "../../node_modules/country-flag-icons/modules/hasFlag.js";
|
|
17
19
|
import { _3x2_exports as u } from "../../node_modules/country-flag-icons/react/3x2/index.js";
|
|
18
|
-
import { getLocalizedCountries as
|
|
19
|
-
import { CountryList as
|
|
20
|
-
import {
|
|
21
|
-
import { useId as
|
|
20
|
+
import { getLocalizedCountries as ue, normalizeForSearch as de } from "./country-data.js";
|
|
21
|
+
import { CountryList as fe } from "./country-list.js";
|
|
22
|
+
import { phoneInputTranslations as pe } from "./phone-input.translations.js";
|
|
23
|
+
import { useId as me, useState as he } from "react";
|
|
22
24
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
23
25
|
//#region lib/components/phone-input/country-selector.tsx
|
|
24
|
-
var
|
|
25
|
-
function
|
|
26
|
-
let
|
|
27
|
-
if (!l(
|
|
28
|
-
let r = u[
|
|
26
|
+
var ge = e();
|
|
27
|
+
function _e(e) {
|
|
28
|
+
let t = e.code;
|
|
29
|
+
if (!l(t)) return null;
|
|
30
|
+
let r = u[t];
|
|
29
31
|
return r ? /* @__PURE__ */ d(r, {
|
|
30
32
|
"aria-label": e.name,
|
|
31
33
|
height: 16,
|
|
32
34
|
width: 24,
|
|
33
35
|
style: {
|
|
34
36
|
flexShrink: 0,
|
|
35
|
-
boxShadow: `0 0 0 1px ${
|
|
37
|
+
boxShadow: `0 0 0 1px ${n.OnSurfaceBorder}`
|
|
36
38
|
}
|
|
37
39
|
}) : null;
|
|
38
40
|
}
|
|
39
|
-
var
|
|
41
|
+
var ve = {
|
|
40
42
|
xs: 12,
|
|
41
43
|
sm: 12,
|
|
42
44
|
md: 16,
|
|
@@ -44,88 +46,88 @@ var ge = {
|
|
|
44
46
|
xl: 24
|
|
45
47
|
};
|
|
46
48
|
function p(e) {
|
|
47
|
-
let l = (0,
|
|
48
|
-
if (l[0] !==
|
|
49
|
-
let e =
|
|
49
|
+
let l = (0, ge.c)(87), { value: u, onChange: p, placeholder: xe, isReadOnly: Se, size: Ce, menuPlacement: m, isDisabled: we } = e, Te = Se !== void 0 && Se, Ee = Ce === void 0 ? "md" : Ce, h = we !== void 0 && we, [g, De] = he(""), _ = me(), v = t(), y = oe(pe), Oe = Ee === "sm" ? "xs" : "sm", b = ve[Ee], x, S, C, w, T, E, D, O, k, A, j, M, N, P, F, I, L, R, z, B, V, H, U;
|
|
50
|
+
if (l[0] !== h || l[1] !== v || l[2] !== b || l[3] !== m || l[4] !== p || l[5] !== g || l[6] !== u) {
|
|
51
|
+
let e = ue(v), t = de(g.trim());
|
|
50
52
|
E = t ? e.filter((e) => e.searchText.includes(t)) : e;
|
|
51
53
|
let n = u ? E.find((e) => e.code === u) : void 0;
|
|
52
54
|
T = n ? [n, ...E.filter((e) => e.code !== u)] : E;
|
|
53
|
-
let
|
|
54
|
-
l[30] === u ?
|
|
55
|
-
let a = e.find(
|
|
55
|
+
let r;
|
|
56
|
+
l[30] === u ? r = l[31] : (r = (e) => e.code === u, l[30] = u, l[31] = r);
|
|
57
|
+
let a = e.find(r), o;
|
|
56
58
|
l[32] === p ? o = l[33] : (o = (e) => {
|
|
57
|
-
p(e),
|
|
59
|
+
p(e), De("");
|
|
58
60
|
}, l[32] = p, l[33] = o);
|
|
59
61
|
let s = o, c;
|
|
60
62
|
l[34] === Symbol.for("react.memo_cache_sentinel") ? (c = (e) => {
|
|
61
|
-
|
|
62
|
-
}, l[34] = c) : c = l[34], D = c, w =
|
|
63
|
+
De(e.target.value);
|
|
64
|
+
}, l[34] = c) : c = l[34], D = c, w = be, C = te, l[35] === s ? M = l[36] : (M = (e) => {
|
|
63
65
|
s(e.value);
|
|
64
|
-
}, l[35] = s, l[36] =
|
|
66
|
+
}, l[35] = s, l[36] = M), N = !0, P = m, F = !0, I = "unmount", l[37] === b ? L = l[38] : (L = [-8, b], l[37] = b, l[38] = L), S = re, k = "center", A = i.XSmall, j = "center", x = ne, R = "flex", z = h, B = h ? "disabled" : "pointer", V = -1, H = !0, l[39] === Symbol.for("react.memo_cache_sentinel") ? (U = { outline: "none" }, l[39] = U) : U = l[39], O = a ? _e(a) : /* @__PURE__ */ d(ee, {}), l[0] = h, l[1] = v, l[2] = b, l[3] = m, l[4] = p, l[5] = g, l[6] = u, l[7] = x, l[8] = S, l[9] = C, l[10] = w, l[11] = T, l[12] = E, l[13] = D, l[14] = O, l[15] = k, l[16] = A, l[17] = j, l[18] = M, l[19] = N, l[20] = P, l[21] = F, l[22] = I, l[23] = L, l[24] = R, l[25] = z, l[26] = B, l[27] = V, l[28] = H, l[29] = U;
|
|
65
67
|
} else x = l[7], S = l[8], C = l[9], w = l[10], T = l[11], E = l[12], D = l[13], O = l[14], k = l[15], A = l[16], j = l[17], M = l[18], N = l[19], P = l[20], F = l[21], I = l[22], L = l[23], R = l[24], z = l[25], B = l[26], V = l[27], H = l[28], U = l[29];
|
|
66
68
|
let W;
|
|
67
|
-
l[40] !== x || l[41] !== O || l[42] !==
|
|
68
|
-
display:
|
|
69
|
-
isDisabled:
|
|
70
|
-
cursor:
|
|
71
|
-
tabIndex:
|
|
72
|
-
"aria-hidden":
|
|
73
|
-
_focus:
|
|
74
|
-
children:
|
|
75
|
-
}), l[40] = x, l[41] = O, l[42] =
|
|
69
|
+
l[40] !== x || l[41] !== O || l[42] !== R || l[43] !== z || l[44] !== B || l[45] !== V || l[46] !== H || l[47] !== U ? (W = /* @__PURE__ */ d(x, {
|
|
70
|
+
display: R,
|
|
71
|
+
isDisabled: z,
|
|
72
|
+
cursor: B,
|
|
73
|
+
tabIndex: V,
|
|
74
|
+
"aria-hidden": H,
|
|
75
|
+
_focus: U,
|
|
76
|
+
children: O
|
|
77
|
+
}), l[40] = x, l[41] = O, l[42] = R, l[43] = z, l[44] = B, l[45] = V, l[46] = H, l[47] = U, l[48] = W) : W = l[48];
|
|
76
78
|
let G;
|
|
77
|
-
l[49] !==
|
|
78
|
-
size:
|
|
79
|
+
l[49] !== Oe || l[50] !== h || l[51] !== y.openCountrySelector ? (G = /* @__PURE__ */ d(ie, {
|
|
80
|
+
size: Oe,
|
|
79
81
|
variant: "ghost",
|
|
80
|
-
icon:
|
|
81
|
-
isDisabled:
|
|
82
|
+
icon: o,
|
|
83
|
+
isDisabled: h,
|
|
82
84
|
"aria-label": y.openCountrySelector
|
|
83
|
-
}), l[49] =
|
|
85
|
+
}), l[49] = Oe, l[50] = h, l[51] = y.openCountrySelector, l[52] = G) : G = l[52];
|
|
84
86
|
let K;
|
|
85
|
-
l[53] !== S || l[54] !==
|
|
86
|
-
align:
|
|
87
|
-
gap:
|
|
88
|
-
justify:
|
|
87
|
+
l[53] !== S || l[54] !== k || l[55] !== A || l[56] !== j || l[57] !== W || l[58] !== G ? (K = /* @__PURE__ */ f(S, {
|
|
88
|
+
align: k,
|
|
89
|
+
gap: A,
|
|
90
|
+
justify: j,
|
|
89
91
|
children: [W, G]
|
|
90
|
-
}), l[53] = S, l[54] =
|
|
91
|
-
let q =
|
|
92
|
-
l[60] === Symbol.for("react.memo_cache_sentinel") ? (J = /* @__PURE__ */ d(
|
|
92
|
+
}), l[53] = S, l[54] = k, l[55] = A, l[56] = j, l[57] = W, l[58] = G, l[59] = K) : K = l[59];
|
|
93
|
+
let q = xe ?? y.searchCountryPlaceholder, J;
|
|
94
|
+
l[60] === Symbol.for("react.memo_cache_sentinel") ? (J = /* @__PURE__ */ d(a, {}), l[60] = J) : J = l[60];
|
|
93
95
|
let Y;
|
|
94
|
-
l[61] !== D || l[62] !==
|
|
95
|
-
onClick:
|
|
96
|
-
children: /* @__PURE__ */ d(
|
|
96
|
+
l[61] !== D || l[62] !== _ || l[63] !== g || l[64] !== q ? (Y = /* @__PURE__ */ d(c, {
|
|
97
|
+
onClick: ye,
|
|
98
|
+
children: /* @__PURE__ */ d(ce, {
|
|
97
99
|
isInvalid: !1,
|
|
98
|
-
children: /* @__PURE__ */ d(
|
|
99
|
-
id:
|
|
100
|
+
children: /* @__PURE__ */ d(le, {
|
|
101
|
+
id: _,
|
|
100
102
|
placeholder: q,
|
|
101
103
|
size: "md",
|
|
102
|
-
value:
|
|
104
|
+
value: g,
|
|
103
105
|
onChange: D,
|
|
104
106
|
variant: "ghost",
|
|
105
107
|
leftElement: J
|
|
106
108
|
})
|
|
107
109
|
})
|
|
108
|
-
}), l[61] = D, l[62] =
|
|
110
|
+
}), l[61] = D, l[62] = _, l[63] = g, l[64] = q, l[65] = Y) : Y = l[65];
|
|
109
111
|
let X;
|
|
110
|
-
l[66] === Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ d(
|
|
112
|
+
l[66] === Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ d(se, { mb: "3px" }), l[66] = X) : X = l[66];
|
|
111
113
|
let Z;
|
|
112
|
-
l[67] !== w || l[68] !== T || l[69] !== E.length || l[70] !==
|
|
114
|
+
l[67] !== w || l[68] !== T || l[69] !== E.length || l[70] !== Te || l[71] !== y.noCountriesFound || l[72] !== u ? (Z = E.length > 0 ? /* @__PURE__ */ d(fe, {
|
|
113
115
|
items: T,
|
|
114
116
|
renderItem: w,
|
|
115
|
-
isReadOnly:
|
|
117
|
+
isReadOnly: Te,
|
|
116
118
|
selectedCode: u
|
|
117
|
-
}) : /* @__PURE__ */ d(
|
|
118
|
-
padding:
|
|
119
|
-
paddingBottom:
|
|
120
|
-
fontSize:
|
|
121
|
-
color:
|
|
119
|
+
}) : /* @__PURE__ */ d(s, {
|
|
120
|
+
padding: i.Medium,
|
|
121
|
+
paddingBottom: i.X2Large,
|
|
122
|
+
fontSize: r.Large,
|
|
123
|
+
color: n.OnBackgroundHeader,
|
|
122
124
|
fontWeight: "500",
|
|
123
125
|
textAlign: "center",
|
|
124
126
|
width: "300px",
|
|
125
127
|
children: y.noCountriesFound
|
|
126
|
-
}), l[67] = w, l[68] = T, l[69] = E.length, l[70] =
|
|
128
|
+
}), l[67] = w, l[68] = T, l[69] = E.length, l[70] = Te, l[71] = y.noCountriesFound, l[72] = u, l[73] = Z) : Z = l[73];
|
|
127
129
|
let Q;
|
|
128
|
-
l[74] !== Y || l[75] !== Z ? (Q = /* @__PURE__ */ f(
|
|
130
|
+
l[74] !== Y || l[75] !== Z ? (Q = /* @__PURE__ */ f(ae, {
|
|
129
131
|
overflow: "unset",
|
|
130
132
|
overflowY: "unset",
|
|
131
133
|
paddingTop: 0,
|
|
@@ -136,33 +138,33 @@ function p(e) {
|
|
|
136
138
|
]
|
|
137
139
|
}), l[74] = Y, l[75] = Z, l[76] = Q) : Q = l[76];
|
|
138
140
|
let $;
|
|
139
|
-
return l[77] !== C || l[78] !==
|
|
140
|
-
onSelect:
|
|
141
|
-
closeOnSelect:
|
|
142
|
-
placement:
|
|
143
|
-
isLazy:
|
|
144
|
-
lazyBehavior:
|
|
145
|
-
offset:
|
|
141
|
+
return l[77] !== C || l[78] !== M || l[79] !== N || l[80] !== P || l[81] !== F || l[82] !== I || l[83] !== L || l[84] !== K || l[85] !== Q ? ($ = /* @__PURE__ */ f(C, {
|
|
142
|
+
onSelect: M,
|
|
143
|
+
closeOnSelect: N,
|
|
144
|
+
placement: P,
|
|
145
|
+
isLazy: F,
|
|
146
|
+
lazyBehavior: I,
|
|
147
|
+
offset: L,
|
|
146
148
|
children: [K, Q]
|
|
147
|
-
}), l[77] = C, l[78] =
|
|
149
|
+
}), l[77] = C, l[78] = M, l[79] = N, l[80] = P, l[81] = F, l[82] = I, l[83] = L, l[84] = K, l[85] = Q, l[86] = $) : $ = l[86], $;
|
|
148
150
|
}
|
|
149
|
-
function
|
|
151
|
+
function ye(e) {
|
|
150
152
|
return e.stopPropagation();
|
|
151
153
|
}
|
|
152
|
-
function
|
|
154
|
+
function be(e) {
|
|
153
155
|
return /* @__PURE__ */ f(re, {
|
|
154
156
|
direction: "row",
|
|
155
|
-
gap:
|
|
157
|
+
gap: i.Small,
|
|
156
158
|
alignItems: "center",
|
|
157
|
-
children: [
|
|
158
|
-
/* @__PURE__ */ d(
|
|
159
|
+
children: [_e(e), /* @__PURE__ */ f(c, { children: [
|
|
160
|
+
/* @__PURE__ */ d(s, {
|
|
159
161
|
display: "inline",
|
|
160
162
|
children: e.name
|
|
161
163
|
}),
|
|
162
164
|
" ",
|
|
163
|
-
/* @__PURE__ */ d(
|
|
165
|
+
/* @__PURE__ */ d(s, {
|
|
164
166
|
display: "inline",
|
|
165
|
-
color:
|
|
167
|
+
color: n.OnSurfaceSubdued,
|
|
166
168
|
children: `(+${e.callingCode})`
|
|
167
169
|
})
|
|
168
170
|
] })]
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { CountryCode } from 'libphonenumber-js/mobile/es6';
|
|
2
|
-
import {
|
|
2
|
+
import { AppLocale } from '../../theme/index.js';
|
|
3
|
+
import { PhoneInputTranslation } from './phone-input.translations.js';
|
|
3
4
|
import { PhoneValidationResult } from './types.js';
|
|
4
5
|
export type ValidatePhoneNumberOptions = {
|
|
5
6
|
/** Field is required (drives the empty-value error once feedback is revealed). */
|
|
6
7
|
isRequired?: boolean;
|
|
7
8
|
/** Whether to surface error feedback (revealed on blur/validate, cleared when fixed). */
|
|
8
9
|
showValidation?: boolean;
|
|
9
|
-
/** Locale for error messages. */
|
|
10
|
-
locale?: Locales;
|
|
11
10
|
};
|
|
12
11
|
/**
|
|
13
12
|
* Validate a phone number for a country. `isValid` is always reported; `errorMessage` is set only
|
|
14
13
|
* when `showValidation` is true and the number fails (required+empty, or content not yet valid).
|
|
15
14
|
*/
|
|
16
|
-
export declare function validatePhoneNumber(value: string, country: CountryCode, options?: ValidatePhoneNumberOptions): PhoneValidationResult;
|
|
15
|
+
export declare function validatePhoneNumber(value: string, country: CountryCode, translation: PhoneInputTranslation, options?: ValidatePhoneNumberOptions): PhoneValidationResult;
|
|
17
16
|
/** Format to international format, or return the original value if it can't be parsed. */
|
|
18
17
|
export declare function formatPhoneNumber(value: string, country: CountryCode): string;
|
|
19
18
|
/**
|
|
@@ -43,5 +42,5 @@ export declare function detectCountryChange(value: string, currentCountry: Count
|
|
|
43
42
|
*/
|
|
44
43
|
export declare function isUnknownCallingCode(value: string): boolean;
|
|
45
44
|
/** Resolve the initial country: explicit prop → device locale → locale-prop region → "SE". */
|
|
46
|
-
export declare function resolveInitialCountry(country: CountryCode | undefined, locale:
|
|
45
|
+
export declare function resolveInitialCountry(country: CountryCode | undefined, locale: AppLocale): CountryCode;
|
|
47
46
|
//# sourceMappingURL=phone-input-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-input-helpers.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/phone-input-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,KAAK,WAAW,EAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"phone-input-helpers.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/phone-input-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,KAAK,WAAW,EAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,MAAM,MAAM,0BAA0B,GAAG;IACxC,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,yFAAyF;IACzF,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,qBAAqB,EAClC,OAAO,GAAE,0BAA+B,GACtC,qBAAqB,CAkBvB;AAED,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAE7E;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAalE;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAQjF;AASD,gHAAgH;AAChH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAE/E;AAED,4FAA4F;AAC5F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAEpF;AA+BD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CA6B7E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS,CAUvG;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAgB3D;AA+BD,8FAA8F;AAC9F,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,WAAW,CAKtG"}
|
|
@@ -3,45 +3,44 @@ import { isValidPhoneNumber as t } from "../../node_modules/libphonenumber-js/mo
|
|
|
3
3
|
import { isSupportedCountry as n } from "../../node_modules/libphonenumber-js/mobile/es6/exports/isSupportedCountry.js";
|
|
4
4
|
import { getCountries as r } from "../../node_modules/libphonenumber-js/mobile/es6/exports/getCountries.js";
|
|
5
5
|
import { getCountryCallingCode as i } from "../../node_modules/libphonenumber-js/mobile/es6/exports/getCountryCallingCode.js";
|
|
6
|
-
import { translations as a } from "./translations.js";
|
|
7
6
|
//#region lib/components/phone-input/phone-input-helpers.ts
|
|
8
|
-
function
|
|
9
|
-
let { isRequired:
|
|
10
|
-
return
|
|
7
|
+
function a(e, n, r, i = {}) {
|
|
8
|
+
let { isRequired: a = !1, showValidation: o = !1 } = i, s = u(e, n);
|
|
9
|
+
return s && t(e, n) ? { isValid: !0 } : o ? s ? {
|
|
11
10
|
isValid: !1,
|
|
12
|
-
errorMessage:
|
|
11
|
+
errorMessage: r.numberLooksIncomplete
|
|
13
12
|
} : {
|
|
14
13
|
isValid: !1,
|
|
15
|
-
errorMessage:
|
|
14
|
+
errorMessage: a ? r.requiredFieldEmpty : void 0
|
|
16
15
|
} : {
|
|
17
16
|
isValid: !1,
|
|
18
17
|
errorMessage: void 0
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
function
|
|
20
|
+
function o(t, n) {
|
|
22
21
|
return e(t, n)?.formatInternational() ?? t;
|
|
23
22
|
}
|
|
24
|
-
function
|
|
23
|
+
function s(t, n) {
|
|
25
24
|
let r = e(t, n);
|
|
26
25
|
if (r) return r.format("E.164");
|
|
27
26
|
let i = t.trim().startsWith("+"), a = t.replace(/\D/g, "");
|
|
28
27
|
return a ? i ? `+${a}` : a : "";
|
|
29
28
|
}
|
|
30
|
-
function
|
|
29
|
+
function c(t, n) {
|
|
31
30
|
let r = e(t, n);
|
|
32
|
-
return r ? r.nationalNumber?.toString() ?? "" :
|
|
31
|
+
return r ? r.nationalNumber?.toString() ?? "" : l(t, n);
|
|
33
32
|
}
|
|
34
|
-
function
|
|
33
|
+
function l(e, t) {
|
|
35
34
|
let n = i(t), r = e.replace(/\D/g, "");
|
|
36
35
|
return r.startsWith(n) ? r.slice(n.length) : r;
|
|
37
36
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
37
|
+
function u(e, t) {
|
|
38
|
+
return l(e, t).length > 0;
|
|
40
39
|
}
|
|
41
|
-
function
|
|
42
|
-
return
|
|
40
|
+
function d(e, n) {
|
|
41
|
+
return u(e, n) && !t(e, n);
|
|
43
42
|
}
|
|
44
|
-
var
|
|
43
|
+
var f = {
|
|
45
44
|
1: "US",
|
|
46
45
|
7: "RU",
|
|
47
46
|
39: "IT",
|
|
@@ -54,36 +53,36 @@ var p = {
|
|
|
54
53
|
358: "FI",
|
|
55
54
|
590: "GP",
|
|
56
55
|
599: "CW"
|
|
57
|
-
},
|
|
58
|
-
function
|
|
59
|
-
return
|
|
56
|
+
}, p = null;
|
|
57
|
+
function m() {
|
|
58
|
+
return p ||= new Set(r().map((e) => i(e).toString())), p;
|
|
60
59
|
}
|
|
61
|
-
function
|
|
60
|
+
function h(e, t) {
|
|
62
61
|
return e.replace(/^\+/, "").replace(/\D/g, "").slice(0, t);
|
|
63
62
|
}
|
|
64
|
-
function
|
|
63
|
+
function g(t) {
|
|
65
64
|
if (!t.trim().startsWith("+")) return;
|
|
66
|
-
let n =
|
|
65
|
+
let n = m(), a = h(t, 3);
|
|
67
66
|
for (let o = 3; o >= 1; o--) {
|
|
68
67
|
let s = a.slice(0, o);
|
|
69
68
|
if (s.length !== o || !n.has(s)) continue;
|
|
70
|
-
if (
|
|
69
|
+
if (f[s]) return f[s];
|
|
71
70
|
let c = e(t);
|
|
72
71
|
return c?.country && i(c.country) === s ? c.country : r().find((e) => i(e) === s);
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
|
-
function
|
|
76
|
-
let n =
|
|
74
|
+
function _(e, t) {
|
|
75
|
+
let n = g(e);
|
|
77
76
|
if (n && n !== t && i(n) !== i(t)) return n;
|
|
78
77
|
}
|
|
79
|
-
function
|
|
78
|
+
function v(e) {
|
|
80
79
|
if (!e.trim().startsWith("+")) return !1;
|
|
81
|
-
let t =
|
|
80
|
+
let t = h(e, 3);
|
|
82
81
|
if (!t) return !1;
|
|
83
|
-
for (let e of
|
|
82
|
+
for (let e of m()) if (e.startsWith(t) || t.startsWith(e)) return !1;
|
|
84
83
|
return !0;
|
|
85
84
|
}
|
|
86
|
-
function
|
|
85
|
+
function y(e) {
|
|
87
86
|
if (e) try {
|
|
88
87
|
let t = new Intl.Locale(e), r = t.region ?? t.maximize().region;
|
|
89
88
|
return r && n(r) ? r : void 0;
|
|
@@ -91,16 +90,16 @@ function b(e) {
|
|
|
91
90
|
return;
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
|
-
function
|
|
93
|
+
function b() {
|
|
95
94
|
if (typeof navigator > "u") return;
|
|
96
95
|
let e = navigator.languages?.length ? navigator.languages : [navigator.language];
|
|
97
96
|
for (let t of e) {
|
|
98
|
-
let e =
|
|
97
|
+
let e = y(t);
|
|
99
98
|
if (e) return e;
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
|
-
function
|
|
103
|
-
return e || (
|
|
101
|
+
function x(e, t) {
|
|
102
|
+
return e || (b() ?? y(t) ?? "SE");
|
|
104
103
|
}
|
|
105
104
|
//#endregion
|
|
106
|
-
export {
|
|
105
|
+
export { _ as detectCountryChange, g as detectCountryFromInput, c as extractNationalNumber, o as formatPhoneNumber, u as hasNationalContent, d as isIncompletePhoneNumber, v as isUnknownCallingCode, x as resolveInitialCountry, s as toE164, a as validatePhoneNumber };
|
|
@@ -18,5 +18,5 @@ import { PhoneInputProps } from './types.js';
|
|
|
18
18
|
*
|
|
19
19
|
* @see Docs https://caspeco.github.io/casper-ui-library/components/phone-input
|
|
20
20
|
*/
|
|
21
|
-
export declare function PhoneInput({ ref, value, onChange, onBlur, country, onCountryChange, unknownPrefix, errorMessage,
|
|
21
|
+
export declare function PhoneInput({ ref, value, onChange, onBlur, country, onCountryChange, unknownPrefix, errorMessage, size, variant, placeholder, isDisabled: isDisabledProp, isReadOnly: isReadOnlyProp, ...rest }: PhoneInputProps): import('react').JSX.Element;
|
|
22
22
|
//# sourceMappingURL=phone-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-input.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/phone-input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"phone-input.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/phone-input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,EAC1B,GAAG,EACH,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAO,EACP,eAAe,EACf,aAAa,EACb,YAAY,EACZ,IAAW,EACX,OAAmB,EACnB,WAAW,EACX,UAAU,EAAE,cAAc,EAC1B,UAAU,EAAE,cAAc,EAC1B,GAAG,IAAI,EACP,EAAE,eAAe,+BAqCjB"}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { require_compiler_runtime as e } from "../../node_modules/react/compiler-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { useComponentTranslations as t } from "../../theme/translations.js";
|
|
3
|
+
import { FormErrorMessage as n } from "../form-control/form-error-message.js";
|
|
4
|
+
import { Input as r } from "../input/input.js";
|
|
5
|
+
import { phoneInputTranslations as i } from "./phone-input.translations.js";
|
|
6
|
+
import { CountrySelector as a } from "./country-selector.js";
|
|
7
7
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
import { useFieldContext as l } from "@chakra-ui/react";
|
|
8
9
|
//#region lib/components/phone-input/phone-input.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
let E =
|
|
14
|
-
|
|
15
|
-
value:
|
|
16
|
-
onChange:
|
|
17
|
-
size:
|
|
10
|
+
var u = e();
|
|
11
|
+
function d(e) {
|
|
12
|
+
let d = (0, u.c)(38), f, p, m, h, g, _, v, y, b, x, S, C, w, T;
|
|
13
|
+
d[0] === e ? (f = d[1], p = d[2], m = d[3], h = d[4], g = d[5], _ = d[6], v = d[7], y = d[8], b = d[9], x = d[10], S = d[11], C = d[12], w = d[13], T = d[14]) : ({ref: b, value: T, onChange: _, onBlur: g, country: f, onCountryChange: v, unknownPrefix: w, errorMessage: p, size: S, variant: C, placeholder: y, isDisabled: m, isReadOnly: h, ...x} = e, d[0] = e, d[1] = f, d[2] = p, d[3] = m, d[4] = h, d[5] = g, d[6] = _, d[7] = v, d[8] = y, d[9] = b, d[10] = x, d[11] = S, d[12] = C, d[13] = w, d[14] = T);
|
|
14
|
+
let E = S === void 0 ? "md" : S, D = C === void 0 ? "outline" : C, O = t(i), k = l(), A = m ?? k?.disabled ?? !1, j = h ?? k?.readOnly ?? !1, M = y ?? O.enterPhoneNumberPlaceholder, N = w ? void 0 : f, P;
|
|
15
|
+
d[15] !== A || d[16] !== v || d[17] !== j || d[18] !== E || d[19] !== N ? (P = /* @__PURE__ */ s(a, {
|
|
16
|
+
value: N,
|
|
17
|
+
onChange: v,
|
|
18
|
+
size: E,
|
|
18
19
|
menuPlacement: "bottom-start",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
ref: y,
|
|
20
|
+
isDisabled: A,
|
|
21
|
+
isReadOnly: j
|
|
22
|
+
}), d[15] = A, d[16] = v, d[17] = j, d[18] = E, d[19] = N, d[20] = P) : P = d[20];
|
|
23
|
+
let F;
|
|
24
|
+
d[21] !== A || d[22] !== g || d[23] !== _ || d[24] !== j || d[25] !== b || d[26] !== x || d[27] !== E || d[28] !== M || d[29] !== P || d[30] !== T || d[31] !== D ? (F = /* @__PURE__ */ s(r, {
|
|
25
|
+
ref: b,
|
|
26
26
|
type: "tel",
|
|
27
27
|
inputMode: "tel",
|
|
28
|
-
placeholder:
|
|
28
|
+
placeholder: M,
|
|
29
29
|
value: T,
|
|
30
|
-
size:
|
|
31
|
-
variant:
|
|
32
|
-
isDisabled:
|
|
33
|
-
isReadOnly:
|
|
34
|
-
onChange:
|
|
35
|
-
onBlur:
|
|
36
|
-
leftElement:
|
|
37
|
-
...
|
|
38
|
-
}),
|
|
39
|
-
let
|
|
40
|
-
|
|
30
|
+
size: E,
|
|
31
|
+
variant: D,
|
|
32
|
+
isDisabled: A,
|
|
33
|
+
isReadOnly: j,
|
|
34
|
+
onChange: _,
|
|
35
|
+
onBlur: g,
|
|
36
|
+
leftElement: P,
|
|
37
|
+
...x
|
|
38
|
+
}), d[21] = A, d[22] = g, d[23] = _, d[24] = j, d[25] = b, d[26] = x, d[27] = E, d[28] = M, d[29] = P, d[30] = T, d[31] = D, d[32] = F) : F = d[32];
|
|
39
|
+
let I;
|
|
40
|
+
d[33] === p ? I = d[34] : (I = p && /* @__PURE__ */ s(n, {
|
|
41
41
|
wordBreak: "break-word",
|
|
42
|
-
children:
|
|
43
|
-
}),
|
|
44
|
-
let
|
|
45
|
-
return
|
|
42
|
+
children: p
|
|
43
|
+
}), d[33] = p, d[34] = I);
|
|
44
|
+
let L;
|
|
45
|
+
return d[35] !== F || d[36] !== I ? (L = /* @__PURE__ */ c(o, { children: [F, I] }), d[35] = F, d[36] = I, d[37] = L) : L = d[37], L;
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
|
-
export {
|
|
48
|
+
export { d as PhoneInput };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type PhoneInputTranslation = {
|
|
2
|
+
searchCountryPlaceholder: string;
|
|
3
|
+
noCountriesFound: string;
|
|
4
|
+
enterPhoneNumberPlaceholder: string;
|
|
5
|
+
numberLooksIncomplete: string;
|
|
6
|
+
requiredFieldEmpty: string;
|
|
7
|
+
openCountrySelector: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const phoneInputTranslations: import('../../theme/translations.js').ComponentTranslations<PhoneInputTranslation>;
|
|
10
|
+
//# sourceMappingURL=phone-input.translations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone-input.translations.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/phone-input.translations.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAAG;IACnC,wBAAwB,EAAE,MAAM,CAAC;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,2BAA2B,EAAE,MAAM,CAAC;IACpC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,sBAAsB,6EAiGjC,CAAC"}
|