bromcom-ui 2.11.1-rc.9-2 → 2.11.1-rc.9-4
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/bromcom-ui/bromcom-ui.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/{p-b2ba36fa.entry.js → p-082b9695.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a97531d3.entry.js → p-0da8ad9f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8375c8c4.entry.js → p-0ef4f5ec.entry.js} +1 -1
- package/dist/bromcom-ui/p-15199f10.entry.js +5 -0
- package/dist/bromcom-ui/{p-8120dcc7.entry.js → p-198cccb5.entry.js} +1 -1
- package/dist/bromcom-ui/p-222203a4.entry.js +16 -0
- package/dist/bromcom-ui/{p-3f84d1c5.entry.js → p-2ab3e5cb.entry.js} +1 -1
- package/dist/bromcom-ui/p-2addde9e.js +5 -0
- package/dist/bromcom-ui/p-2b42d77e.entry.js +5 -0
- package/dist/bromcom-ui/{p-4035fdf1.entry.js → p-2c9f9889.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a1b05d8a.entry.js → p-42d09898.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4ef9abca.entry.js → p-471c7f34.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d4535e9b.entry.js → p-4d0680e1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-59a92a47.js → p-5cb99e9e.js} +1 -1
- package/dist/bromcom-ui/{p-9589f69c.entry.js → p-5d670fd7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6c152c86.entry.js → p-5df2d3f1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2f92042f.entry.js → p-5ee56cae.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1b21310e.entry.js → p-603efb90.entry.js} +1 -1
- package/dist/bromcom-ui/p-64a8db1d.entry.js +5 -0
- package/dist/bromcom-ui/{p-61753299.js → p-6bea284a.js} +1 -1
- package/dist/bromcom-ui/{p-1a9cd62d.entry.js → p-7230713c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b6e2c3cb.entry.js → p-7d4f57be.entry.js} +1 -1
- package/dist/bromcom-ui/p-87e5fda5.entry.js +5 -0
- package/dist/bromcom-ui/{p-ca33b8ba.js → p-8f3ca5d9.js} +1 -1
- package/dist/bromcom-ui/{p-db66b04a.entry.js → p-9bbd341c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-52cce799.entry.js → p-a292b41d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ccc6f14e.entry.js → p-a933ac12.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e439b584.entry.js → p-adb21984.entry.js} +1 -1
- package/dist/bromcom-ui/p-aeb4be41.js +5 -0
- package/dist/bromcom-ui/p-b847cbea.js +5 -0
- package/dist/bromcom-ui/{p-5d9a5c33.entry.js → p-bbe8c777.entry.js} +1 -1
- package/dist/bromcom-ui/{p-677c5742.entry.js → p-c157a7d4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3a220693.entry.js → p-c23d73fb.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5bb77b86.entry.js → p-c67a5e5f.entry.js} +1 -1
- package/dist/bromcom-ui/p-c77541f4.js +10 -0
- package/dist/bromcom-ui/{p-d90fbea6.entry.js → p-c89acfca.entry.js} +1 -1
- package/dist/bromcom-ui/p-d1298c40.js +5 -0
- package/dist/bromcom-ui/{p-a9fb78a2.entry.js → p-e8bb9019.entry.js} +1 -1
- package/dist/bromcom-ui/p-e9928d0c.entry.js +5 -0
- package/dist/bromcom-ui/p-f478ad92.entry.js +5 -0
- package/dist/bromcom-ui/{p-b92f3501.js → p-fcf70988.js} +1 -1
- package/dist/cjs/{bcm-accordion_45.cjs.entry.js → bcm-accordion_47.cjs.entry.js} +8890 -8620
- package/dist/cjs/bcm-alert.cjs.entry.js +3 -3
- package/dist/cjs/bcm-attendance-actions-comment.cjs.entry.js +6 -6
- package/dist/cjs/bcm-attendance-actions-dropdown.cjs.entry.js +6 -6
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/bcm-caption.cjs.entry.js +6 -6
- package/dist/cjs/bcm-card.cjs.entry.js +4 -4
- package/dist/cjs/bcm-checkbox-lite_8.cjs.entry.js +3 -3
- package/dist/cjs/bcm-chip-group.cjs.entry.js +6 -6
- package/dist/cjs/bcm-collapse.cjs.entry.js +3 -3
- package/dist/cjs/bcm-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +3 -3
- package/dist/cjs/bcm-default.cjs.entry.js +3 -3
- package/dist/cjs/bcm-form-2.cjs.entry.js +5 -4
- package/dist/cjs/bcm-input-2.cjs.entry.js +153 -0
- package/dist/cjs/bcm-input-custom.cjs.entry.js +3 -3
- package/dist/cjs/bcm-input-dropdown.cjs.entry.js +6 -6
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +6 -6
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +6 -6
- package/dist/cjs/bcm-modal-2.cjs.entry.js +6 -6
- package/dist/cjs/bcm-number-input.cjs.entry.js +260 -72
- package/dist/cjs/bcm-overlay_2.cjs.entry.js +1 -1
- package/dist/cjs/bcm-popover.cjs.entry.js +6 -6
- package/dist/cjs/bcm-range.cjs.entry.js +3 -3
- package/dist/cjs/bcm-react-number.cjs.entry.js +1230 -0
- package/dist/cjs/bcm-skeleton.cjs.entry.js +6 -6
- package/dist/cjs/bcm-table.cjs.entry.js +6 -6
- package/dist/cjs/bcm-tag.cjs.entry.js +4 -4
- package/dist/cjs/bcm-time-picker.cjs.entry.js +3 -3
- package/dist/cjs/bcm-toast.cjs.entry.js +3 -3
- package/dist/cjs/bromcom-ui.cjs.js +3 -3
- package/dist/cjs/{color-helper-c3a819ea.js → color-helper-dc98a2ca.js} +1 -1
- package/dist/cjs/{colors-078851ec.js → colors-250d0982.js} +13 -7
- package/dist/cjs/{generate-f4bfa0a4.js → generate-2f15ee94.js} +2 -2
- package/dist/cjs/{global-34b7d357.js → global-da78178f.js} +1 -1
- package/dist/cjs/index-e05a7c6f.js +545 -0
- package/dist/cjs/input.style-b5676e6a.js +122 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{number-helper-8b2bc297.js → number-helper-9b0b5976.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +4 -4
- package/dist/cjs/old-bcm-popover.cjs.entry.js +3 -3
- package/dist/cjs/{package-b728c16f.js → package-7b89373b.js} +1 -1
- package/dist/cjs/{validators-816514ff.js → validators-082184cd.js} +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/atoms/link/link.css +9 -3
- package/dist/collection/components/molecules/input/input.style.js +117 -0
- package/dist/collection/components/molecules/input/input2.js +918 -0
- package/dist/collection/components/molecules/modal/modal.css +1 -1
- package/dist/collection/components/molecules/number-input/number-input.js +776 -95
- package/dist/collection/components/molecules/number-input/react-input.js +96 -0
- package/dist/collection/components/molecules/radio/radio.js +1 -1
- package/dist/collection/components/organism/form/form.js +2 -2
- package/dist/collection/components/organism/form-2/bcm-form-components.js +2 -1
- package/dist/collection/components/organism/list/list.css +2 -3
- package/dist/collection/components/third-parts/rc-picker/date.js +1 -1
- package/dist/collection/components/third-parts/rc-picker/rc-picker.css +40 -5
- package/dist/collection/components/third-parts/rc-picker/rc-picker.js +11 -2
- package/dist/components/{raf.js → Overflow.js} +692 -69
- package/dist/components/bcm-date.js +1 -1
- package/dist/components/bcm-form-2.js +2 -1
- package/dist/components/bcm-input-2.d.ts +11 -0
- package/dist/components/bcm-input-2.js +225 -0
- package/dist/components/bcm-modal.js +1 -1
- package/dist/components/bcm-number-input.js +295 -79
- package/dist/components/bcm-react-number.d.ts +11 -0
- package/dist/components/bcm-react-number.js +10 -0
- package/dist/components/colors2.js +13 -7
- package/dist/components/form.js +2 -2
- package/dist/components/generate.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/input.style.js +120 -0
- package/dist/components/link.js +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/rc-overflow.js +1 -593
- package/dist/components/rc-picker.js +8620 -8025
- package/dist/components/react-input.js +1242 -0
- package/dist/esm/{bcm-accordion_45.entry.js → bcm-accordion_47.entry.js} +8782 -8514
- package/dist/esm/bcm-alert.entry.js +3 -3
- package/dist/esm/bcm-attendance-actions-comment.entry.js +6 -6
- package/dist/esm/bcm-attendance-actions-dropdown.entry.js +6 -6
- package/dist/esm/bcm-breadcrumb.entry.js +3 -3
- package/dist/esm/bcm-caption.entry.js +6 -6
- package/dist/esm/bcm-card.entry.js +4 -4
- package/dist/esm/bcm-checkbox-lite_8.entry.js +3 -3
- package/dist/esm/bcm-chip-group.entry.js +6 -6
- package/dist/esm/bcm-collapse.entry.js +3 -3
- package/dist/esm/bcm-date-picker.entry.js +3 -3
- package/dist/esm/bcm-datetime-picker.entry.js +3 -3
- package/dist/esm/bcm-default.entry.js +3 -3
- package/dist/esm/bcm-form-2.entry.js +5 -4
- package/dist/esm/bcm-input-2.entry.js +149 -0
- package/dist/esm/bcm-input-custom.entry.js +3 -3
- package/dist/esm/bcm-input-dropdown.entry.js +6 -6
- package/dist/esm/bcm-modal-2-footer.entry.js +6 -6
- package/dist/esm/bcm-modal-2-header.entry.js +6 -6
- package/dist/esm/bcm-modal-2.entry.js +6 -6
- package/dist/esm/bcm-number-input.entry.js +259 -71
- package/dist/esm/bcm-overlay_2.entry.js +1 -1
- package/dist/esm/bcm-popover.entry.js +6 -6
- package/dist/esm/bcm-range.entry.js +3 -3
- package/dist/esm/bcm-react-number.entry.js +1226 -0
- package/dist/esm/bcm-skeleton.entry.js +6 -6
- package/dist/esm/bcm-table.entry.js +6 -6
- package/dist/esm/bcm-tag.entry.js +4 -4
- package/dist/esm/bcm-time-picker.entry.js +3 -3
- package/dist/esm/bcm-toast.entry.js +3 -3
- package/dist/esm/bromcom-ui.js +3 -3
- package/dist/esm/{color-helper-3b528349.js → color-helper-74614f24.js} +1 -1
- package/dist/esm/{colors-c530a5b8.js → colors-dd598eea.js} +13 -7
- package/dist/esm/{generate-44c39402.js → generate-df0f43b2.js} +2 -2
- package/dist/esm/{global-8534a386.js → global-72a67caf.js} +1 -1
- package/dist/esm/index-036974d7.js +541 -0
- package/dist/esm/input.style-e855c0f3.js +120 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{number-helper-ce0f20fe.js → number-helper-b012c05f.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +4 -4
- package/dist/esm/old-bcm-popover.entry.js +3 -3
- package/dist/esm/{package-b2db00f1.js → package-40075eb9.js} +1 -1
- package/dist/esm/{validators-f9bc23cc.js → validators-166e2a4e.js} +1 -1
- package/dist/types/components/molecules/input/input.style.d.ts +576 -0
- package/dist/types/components/molecules/input/input2.d.ts +64 -0
- package/dist/types/components/molecules/number-input/number-input.d.ts +66 -17
- package/dist/types/components/molecules/number-input/react-input.d.ts +16 -0
- package/dist/types/components.d.ts +203 -19
- package/package.json +4 -3
- package/dist/bromcom-ui/p-08501d86.entry.js +0 -5
- package/dist/bromcom-ui/p-3556d078.js +0 -5
- package/dist/bromcom-ui/p-36544f78.entry.js +0 -5
- package/dist/bromcom-ui/p-3a43bf45.js +0 -5
- package/dist/bromcom-ui/p-4d308bb7.entry.js +0 -5
- package/dist/bromcom-ui/p-528c5152.entry.js +0 -5
- package/dist/bromcom-ui/p-6a87d06d.entry.js +0 -5
- package/dist/bromcom-ui/p-77ede2fc.entry.js +0 -20
- package/dist/bromcom-ui/p-d00ca988.js +0 -5
- package/dist/bromcom-ui/p-de0b0192.entry.js +0 -5
- package/dist/cjs/bcm-link.cjs.entry.js +0 -51
- package/dist/cjs/bcm-modal.cjs.entry.js +0 -157
- package/dist/collection/components/molecules/number-input/number-input.css +0 -137
- package/dist/collection/components/molecules/number-input/number-input.style.js +0 -45
- package/dist/esm/bcm-link.entry.js +0 -47
- package/dist/esm/bcm-modal.entry.js +0 -153
- package/dist/types/components/molecules/number-input/number-input.style.d.ts +0 -200
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentInterface } from "../../../stencil-public-runtime";
|
|
2
|
+
import { NumberFormatValues, NumericFormatProps } from "react-number-format";
|
|
3
|
+
type ExtendedNumericPropsType = NumericFormatProps & {
|
|
4
|
+
mode: "strict" | "none";
|
|
5
|
+
onValueChange?: (e: NumberFormatValues) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare class BcmReactNumber implements ComponentInterface {
|
|
8
|
+
el: HTMLElement;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
options: ExtendedNumericPropsType;
|
|
11
|
+
private isRange;
|
|
12
|
+
componentWillRender(): void | Promise<void>;
|
|
13
|
+
componentDidLoad(): void;
|
|
14
|
+
private init;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -618,6 +618,49 @@ export namespace Components {
|
|
|
618
618
|
"unitPrefix": string;
|
|
619
619
|
"value": any;
|
|
620
620
|
}
|
|
621
|
+
interface BcmInput2 {
|
|
622
|
+
/**
|
|
623
|
+
* Props *
|
|
624
|
+
*/
|
|
625
|
+
"_id": string;
|
|
626
|
+
"_internal_id": string;
|
|
627
|
+
"_prefix": string;
|
|
628
|
+
"_suffix": string;
|
|
629
|
+
"autocomplete": boolean;
|
|
630
|
+
"caption": string;
|
|
631
|
+
"captionError": string;
|
|
632
|
+
"captionType": StatusTypes1;
|
|
633
|
+
"clearable": boolean;
|
|
634
|
+
"customErrorMessage": string;
|
|
635
|
+
"decimal": boolean;
|
|
636
|
+
"disableWatchValue": boolean;
|
|
637
|
+
"disabled": boolean;
|
|
638
|
+
"fullWidth": boolean;
|
|
639
|
+
"hidden": boolean;
|
|
640
|
+
"label": string;
|
|
641
|
+
"max": number;
|
|
642
|
+
"maxLength": number;
|
|
643
|
+
"min": number;
|
|
644
|
+
"minLength": number;
|
|
645
|
+
"name": string;
|
|
646
|
+
"noCaption": boolean;
|
|
647
|
+
"noDefaultIcon": boolean;
|
|
648
|
+
"onBcmBlur": () => Promise<void>;
|
|
649
|
+
"onBcmFocus": () => Promise<void>;
|
|
650
|
+
"onBcmSelect": () => Promise<void>;
|
|
651
|
+
"passwordToggle": boolean;
|
|
652
|
+
"pattern": string;
|
|
653
|
+
"placeholder": string;
|
|
654
|
+
"readonly": boolean;
|
|
655
|
+
"required": boolean;
|
|
656
|
+
"size": SizeTypes1;
|
|
657
|
+
"step": any;
|
|
658
|
+
"tooltip": string;
|
|
659
|
+
"type": InputTypes;
|
|
660
|
+
"unit": string;
|
|
661
|
+
"unitPrefix": string;
|
|
662
|
+
"value": any;
|
|
663
|
+
}
|
|
621
664
|
interface BcmInputCustom {
|
|
622
665
|
"_id": string;
|
|
623
666
|
"disabled": boolean;
|
|
@@ -931,25 +974,54 @@ export namespace Components {
|
|
|
931
974
|
}
|
|
932
975
|
interface BcmNumberInput {
|
|
933
976
|
"_id": string;
|
|
977
|
+
"_prefix"?: string;
|
|
978
|
+
"_suffix"?: string;
|
|
979
|
+
"allowLeadingZeros"?: boolean;
|
|
980
|
+
"allowNegative"?: boolean;
|
|
981
|
+
/**
|
|
982
|
+
* Caption Props
|
|
983
|
+
*/
|
|
934
984
|
"caption": string;
|
|
935
985
|
"captionError": string;
|
|
936
986
|
"captionType": StatusTypes;
|
|
987
|
+
"clearable": boolean;
|
|
937
988
|
"customErrorMessage": string;
|
|
938
|
-
"
|
|
989
|
+
"decimalScale"?: number;
|
|
990
|
+
"decimalSeparator"?: string;
|
|
991
|
+
"defaultValue"?: number | string;
|
|
992
|
+
"disabled"?: boolean;
|
|
993
|
+
"fixedDecimalScale"?: boolean;
|
|
994
|
+
"fullWidth": boolean;
|
|
995
|
+
"get": () => Promise<string | number>;
|
|
939
996
|
"label": string;
|
|
940
|
-
"max"
|
|
941
|
-
"min"
|
|
997
|
+
"max"?: number | string;
|
|
998
|
+
"min"?: number | string;
|
|
999
|
+
/**
|
|
1000
|
+
* Number Input Props
|
|
1001
|
+
*/
|
|
1002
|
+
"mode": "strict" | "none";
|
|
1003
|
+
"name": string;
|
|
942
1004
|
"noCaption": boolean;
|
|
943
|
-
"
|
|
1005
|
+
"onBcmBlur": () => Promise<void>;
|
|
1006
|
+
"onBcmFocus": () => Promise<void>;
|
|
1007
|
+
"onBcmSelect": () => Promise<void>;
|
|
944
1008
|
"placeholder": string;
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
"
|
|
949
|
-
"
|
|
950
|
-
"
|
|
951
|
-
"
|
|
952
|
-
"
|
|
1009
|
+
/**
|
|
1010
|
+
* Input states
|
|
1011
|
+
*/
|
|
1012
|
+
"readonly"?: boolean;
|
|
1013
|
+
"required"?: boolean;
|
|
1014
|
+
"resetCaption": () => Promise<void>;
|
|
1015
|
+
"set": (data: any) => Promise<void>;
|
|
1016
|
+
"setCaption": (caption?: any, captionType?: any) => Promise<void>;
|
|
1017
|
+
"setClear": () => Promise<void>;
|
|
1018
|
+
"setValue": (value: any) => Promise<void>;
|
|
1019
|
+
"size"?: SizeTypes;
|
|
1020
|
+
"step"?: number;
|
|
1021
|
+
"thousandSeparator"?: string | boolean;
|
|
1022
|
+
"unitPrefix"?: string;
|
|
1023
|
+
"unitSuffix"?: string;
|
|
1024
|
+
"value"?: number | string;
|
|
953
1025
|
}
|
|
954
1026
|
interface BcmOldInput {
|
|
955
1027
|
"_id": string;
|
|
@@ -1161,6 +1233,10 @@ export namespace Components {
|
|
|
1161
1233
|
"type": "time" | "date" | "week" | "month" | "year" | "datetime";
|
|
1162
1234
|
"use12Hours": boolean;
|
|
1163
1235
|
}
|
|
1236
|
+
interface BcmReactNumber {
|
|
1237
|
+
"disabled": boolean;
|
|
1238
|
+
"options": ExtendedNumericPropsType;
|
|
1239
|
+
}
|
|
1164
1240
|
interface BcmResult {
|
|
1165
1241
|
"description": string;
|
|
1166
1242
|
"heading": string;
|
|
@@ -1764,6 +1840,10 @@ export interface BcmInputCustomEvent<T> extends CustomEvent<T> {
|
|
|
1764
1840
|
detail: T;
|
|
1765
1841
|
target: HTMLBcmInputElement;
|
|
1766
1842
|
}
|
|
1843
|
+
export interface BcmInput2CustomEvent<T> extends CustomEvent<T> {
|
|
1844
|
+
detail: T;
|
|
1845
|
+
target: HTMLBcmInput2Element;
|
|
1846
|
+
}
|
|
1767
1847
|
export interface BcmInputDropdownCustomEvent<T> extends CustomEvent<T> {
|
|
1768
1848
|
detail: T;
|
|
1769
1849
|
target: HTMLBcmInputDropdownElement;
|
|
@@ -1804,6 +1884,10 @@ export interface BcmNotificationCustomEvent<T> extends CustomEvent<T> {
|
|
|
1804
1884
|
detail: T;
|
|
1805
1885
|
target: HTMLBcmNotificationElement;
|
|
1806
1886
|
}
|
|
1887
|
+
export interface BcmNumberInputCustomEvent<T> extends CustomEvent<T> {
|
|
1888
|
+
detail: T;
|
|
1889
|
+
target: HTMLBcmNumberInputElement;
|
|
1890
|
+
}
|
|
1807
1891
|
export interface BcmOldInputCustomEvent<T> extends CustomEvent<T> {
|
|
1808
1892
|
detail: T;
|
|
1809
1893
|
target: HTMLBcmOldInputElement;
|
|
@@ -2155,6 +2239,12 @@ declare global {
|
|
|
2155
2239
|
prototype: HTMLBcmInputElement;
|
|
2156
2240
|
new (): HTMLBcmInputElement;
|
|
2157
2241
|
};
|
|
2242
|
+
interface HTMLBcmInput2Element extends Components.BcmInput2, HTMLStencilElement {
|
|
2243
|
+
}
|
|
2244
|
+
var HTMLBcmInput2Element: {
|
|
2245
|
+
prototype: HTMLBcmInput2Element;
|
|
2246
|
+
new (): HTMLBcmInput2Element;
|
|
2247
|
+
};
|
|
2158
2248
|
interface HTMLBcmInputCustomElement extends Components.BcmInputCustom, HTMLStencilElement {
|
|
2159
2249
|
}
|
|
2160
2250
|
var HTMLBcmInputCustomElement: {
|
|
@@ -2347,6 +2437,12 @@ declare global {
|
|
|
2347
2437
|
prototype: HTMLBcmRcPickerElement;
|
|
2348
2438
|
new (): HTMLBcmRcPickerElement;
|
|
2349
2439
|
};
|
|
2440
|
+
interface HTMLBcmReactNumberElement extends Components.BcmReactNumber, HTMLStencilElement {
|
|
2441
|
+
}
|
|
2442
|
+
var HTMLBcmReactNumberElement: {
|
|
2443
|
+
prototype: HTMLBcmReactNumberElement;
|
|
2444
|
+
new (): HTMLBcmReactNumberElement;
|
|
2445
|
+
};
|
|
2350
2446
|
interface HTMLBcmResultElement extends Components.BcmResult, HTMLStencilElement {
|
|
2351
2447
|
}
|
|
2352
2448
|
var HTMLBcmResultElement: {
|
|
@@ -2593,6 +2689,7 @@ declare global {
|
|
|
2593
2689
|
"bcm-form-group": HTMLBcmFormGroupElement;
|
|
2594
2690
|
"bcm-icon": HTMLBcmIconElement;
|
|
2595
2691
|
"bcm-input": HTMLBcmInputElement;
|
|
2692
|
+
"bcm-input-2": HTMLBcmInput2Element;
|
|
2596
2693
|
"bcm-input-custom": HTMLBcmInputCustomElement;
|
|
2597
2694
|
"bcm-input-dropdown": HTMLBcmInputDropdownElement;
|
|
2598
2695
|
"bcm-item": HTMLBcmItemElement;
|
|
@@ -2625,6 +2722,7 @@ declare global {
|
|
|
2625
2722
|
"bcm-range": HTMLBcmRangeElement;
|
|
2626
2723
|
"bcm-rc-overflow": HTMLBcmRcOverflowElement;
|
|
2627
2724
|
"bcm-rc-picker": HTMLBcmRcPickerElement;
|
|
2725
|
+
"bcm-react-number": HTMLBcmReactNumberElement;
|
|
2628
2726
|
"bcm-result": HTMLBcmResultElement;
|
|
2629
2727
|
"bcm-scroll-area": HTMLBcmScrollAreaElement;
|
|
2630
2728
|
"bcm-search": HTMLBcmSearchElement;
|
|
@@ -3181,6 +3279,54 @@ declare namespace LocalJSX {
|
|
|
3181
3279
|
"unitPrefix"?: string;
|
|
3182
3280
|
"value"?: any;
|
|
3183
3281
|
}
|
|
3282
|
+
interface BcmInput2 {
|
|
3283
|
+
/**
|
|
3284
|
+
* Props *
|
|
3285
|
+
*/
|
|
3286
|
+
"_id"?: string;
|
|
3287
|
+
"_internal_id"?: string;
|
|
3288
|
+
"_prefix"?: string;
|
|
3289
|
+
"_suffix"?: string;
|
|
3290
|
+
"autocomplete"?: boolean;
|
|
3291
|
+
"caption"?: string;
|
|
3292
|
+
"captionError"?: string;
|
|
3293
|
+
"captionType"?: StatusTypes1;
|
|
3294
|
+
"clearable"?: boolean;
|
|
3295
|
+
"customErrorMessage"?: string;
|
|
3296
|
+
"decimal"?: boolean;
|
|
3297
|
+
"disableWatchValue"?: boolean;
|
|
3298
|
+
"disabled"?: boolean;
|
|
3299
|
+
"fullWidth"?: boolean;
|
|
3300
|
+
"hidden"?: boolean;
|
|
3301
|
+
"label"?: string;
|
|
3302
|
+
"max"?: number;
|
|
3303
|
+
"maxLength"?: number;
|
|
3304
|
+
"min"?: number;
|
|
3305
|
+
"minLength"?: number;
|
|
3306
|
+
"name"?: string;
|
|
3307
|
+
"noCaption"?: boolean;
|
|
3308
|
+
"noDefaultIcon"?: boolean;
|
|
3309
|
+
"onBcm-blur"?: (event: BcmInput2CustomEvent<any>) => void;
|
|
3310
|
+
"onBcm-change"?: (event: BcmInput2CustomEvent<any>) => void;
|
|
3311
|
+
"onBcm-clear"?: (event: BcmInput2CustomEvent<any>) => void;
|
|
3312
|
+
/**
|
|
3313
|
+
* Events *
|
|
3314
|
+
*/
|
|
3315
|
+
"onBcm-focus"?: (event: BcmInput2CustomEvent<any>) => void;
|
|
3316
|
+
"onBcm-input"?: (event: BcmInput2CustomEvent<any>) => void;
|
|
3317
|
+
"passwordToggle"?: boolean;
|
|
3318
|
+
"pattern"?: string;
|
|
3319
|
+
"placeholder"?: string;
|
|
3320
|
+
"readonly"?: boolean;
|
|
3321
|
+
"required"?: boolean;
|
|
3322
|
+
"size"?: SizeTypes1;
|
|
3323
|
+
"step"?: any;
|
|
3324
|
+
"tooltip"?: string;
|
|
3325
|
+
"type"?: InputTypes;
|
|
3326
|
+
"unit"?: string;
|
|
3327
|
+
"unitPrefix"?: string;
|
|
3328
|
+
"value"?: any;
|
|
3329
|
+
}
|
|
3184
3330
|
interface BcmInputCustom {
|
|
3185
3331
|
"_id"?: string;
|
|
3186
3332
|
"disabled"?: boolean;
|
|
@@ -3483,25 +3629,55 @@ declare namespace LocalJSX {
|
|
|
3483
3629
|
}
|
|
3484
3630
|
interface BcmNumberInput {
|
|
3485
3631
|
"_id"?: string;
|
|
3632
|
+
"_prefix"?: string;
|
|
3633
|
+
"_suffix"?: string;
|
|
3634
|
+
"allowLeadingZeros"?: boolean;
|
|
3635
|
+
"allowNegative"?: boolean;
|
|
3636
|
+
/**
|
|
3637
|
+
* Caption Props
|
|
3638
|
+
*/
|
|
3486
3639
|
"caption"?: string;
|
|
3487
3640
|
"captionError"?: string;
|
|
3488
3641
|
"captionType"?: StatusTypes;
|
|
3642
|
+
"clearable"?: boolean;
|
|
3489
3643
|
"customErrorMessage"?: string;
|
|
3644
|
+
"decimalScale"?: number;
|
|
3645
|
+
"decimalSeparator"?: string;
|
|
3646
|
+
"defaultValue"?: number | string;
|
|
3490
3647
|
"disabled"?: boolean;
|
|
3648
|
+
"fixedDecimalScale"?: boolean;
|
|
3649
|
+
"fullWidth"?: boolean;
|
|
3491
3650
|
"label"?: string;
|
|
3492
|
-
"max"?: number;
|
|
3493
|
-
"min"?: number;
|
|
3651
|
+
"max"?: number | string;
|
|
3652
|
+
"min"?: number | string;
|
|
3653
|
+
/**
|
|
3654
|
+
* Number Input Props
|
|
3655
|
+
*/
|
|
3656
|
+
"mode"?: "strict" | "none";
|
|
3657
|
+
"name"?: string;
|
|
3494
3658
|
"noCaption"?: boolean;
|
|
3495
|
-
"
|
|
3659
|
+
"onBcm-blur"?: (event: BcmNumberInputCustomEvent<any>) => void;
|
|
3660
|
+
"onBcm-change"?: (event: BcmNumberInputCustomEvent<any>) => void;
|
|
3661
|
+
"onBcm-clear"?: (event: BcmNumberInputCustomEvent<any>) => void;
|
|
3662
|
+
/**
|
|
3663
|
+
* Events *
|
|
3664
|
+
*/
|
|
3665
|
+
"onBcm-focus"?: (event: BcmNumberInputCustomEvent<any>) => void;
|
|
3666
|
+
"onBcm-input"?: (event: BcmNumberInputCustomEvent<any>) => void;
|
|
3667
|
+
"onBcm-input-before-clear"?: (event: BcmNumberInputCustomEvent<any>) => void;
|
|
3668
|
+
"onBcm-onchange"?: (event: BcmNumberInputCustomEvent<any>) => void;
|
|
3496
3669
|
"placeholder"?: string;
|
|
3497
|
-
|
|
3670
|
+
/**
|
|
3671
|
+
* Input states
|
|
3672
|
+
*/
|
|
3498
3673
|
"readonly"?: boolean;
|
|
3499
3674
|
"required"?: boolean;
|
|
3500
3675
|
"size"?: SizeTypes;
|
|
3501
3676
|
"step"?: number;
|
|
3502
|
-
"
|
|
3503
|
-
"
|
|
3504
|
-
"
|
|
3677
|
+
"thousandSeparator"?: string | boolean;
|
|
3678
|
+
"unitPrefix"?: string;
|
|
3679
|
+
"unitSuffix"?: string;
|
|
3680
|
+
"value"?: number | string;
|
|
3505
3681
|
}
|
|
3506
3682
|
interface BcmOldInput {
|
|
3507
3683
|
"_id"?: string;
|
|
@@ -3708,6 +3884,10 @@ declare namespace LocalJSX {
|
|
|
3708
3884
|
"type"?: "time" | "date" | "week" | "month" | "year" | "datetime";
|
|
3709
3885
|
"use12Hours"?: boolean;
|
|
3710
3886
|
}
|
|
3887
|
+
interface BcmReactNumber {
|
|
3888
|
+
"disabled"?: boolean;
|
|
3889
|
+
"options"?: ExtendedNumericPropsType;
|
|
3890
|
+
}
|
|
3711
3891
|
interface BcmResult {
|
|
3712
3892
|
"description"?: string;
|
|
3713
3893
|
"heading"?: string;
|
|
@@ -4223,6 +4403,7 @@ declare namespace LocalJSX {
|
|
|
4223
4403
|
"bcm-form-group": BcmFormGroup;
|
|
4224
4404
|
"bcm-icon": BcmIcon;
|
|
4225
4405
|
"bcm-input": BcmInput;
|
|
4406
|
+
"bcm-input-2": BcmInput2;
|
|
4226
4407
|
"bcm-input-custom": BcmInputCustom;
|
|
4227
4408
|
"bcm-input-dropdown": BcmInputDropdown;
|
|
4228
4409
|
"bcm-item": BcmItem;
|
|
@@ -4255,6 +4436,7 @@ declare namespace LocalJSX {
|
|
|
4255
4436
|
"bcm-range": BcmRange;
|
|
4256
4437
|
"bcm-rc-overflow": BcmRcOverflow;
|
|
4257
4438
|
"bcm-rc-picker": BcmRcPicker;
|
|
4439
|
+
"bcm-react-number": BcmReactNumber;
|
|
4258
4440
|
"bcm-result": BcmResult;
|
|
4259
4441
|
"bcm-scroll-area": BcmScrollArea;
|
|
4260
4442
|
"bcm-search": BcmSearch;
|
|
@@ -4336,6 +4518,7 @@ declare module "@stencil/core" {
|
|
|
4336
4518
|
"bcm-form-group": LocalJSX.BcmFormGroup & JSXBase.HTMLAttributes<HTMLBcmFormGroupElement>;
|
|
4337
4519
|
"bcm-icon": LocalJSX.BcmIcon & JSXBase.HTMLAttributes<HTMLBcmIconElement>;
|
|
4338
4520
|
"bcm-input": LocalJSX.BcmInput & JSXBase.HTMLAttributes<HTMLBcmInputElement>;
|
|
4521
|
+
"bcm-input-2": LocalJSX.BcmInput2 & JSXBase.HTMLAttributes<HTMLBcmInput2Element>;
|
|
4339
4522
|
"bcm-input-custom": LocalJSX.BcmInputCustom & JSXBase.HTMLAttributes<HTMLBcmInputCustomElement>;
|
|
4340
4523
|
"bcm-input-dropdown": LocalJSX.BcmInputDropdown & JSXBase.HTMLAttributes<HTMLBcmInputDropdownElement>;
|
|
4341
4524
|
"bcm-item": LocalJSX.BcmItem & JSXBase.HTMLAttributes<HTMLBcmItemElement>;
|
|
@@ -4368,6 +4551,7 @@ declare module "@stencil/core" {
|
|
|
4368
4551
|
"bcm-range": LocalJSX.BcmRange & JSXBase.HTMLAttributes<HTMLBcmRangeElement>;
|
|
4369
4552
|
"bcm-rc-overflow": LocalJSX.BcmRcOverflow & JSXBase.HTMLAttributes<HTMLBcmRcOverflowElement>;
|
|
4370
4553
|
"bcm-rc-picker": LocalJSX.BcmRcPicker & JSXBase.HTMLAttributes<HTMLBcmRcPickerElement>;
|
|
4554
|
+
"bcm-react-number": LocalJSX.BcmReactNumber & JSXBase.HTMLAttributes<HTMLBcmReactNumberElement>;
|
|
4371
4555
|
"bcm-result": LocalJSX.BcmResult & JSXBase.HTMLAttributes<HTMLBcmResultElement>;
|
|
4372
4556
|
"bcm-scroll-area": LocalJSX.BcmScrollArea & JSXBase.HTMLAttributes<HTMLBcmScrollAreaElement>;
|
|
4373
4557
|
"bcm-search": LocalJSX.BcmSearch & JSXBase.HTMLAttributes<HTMLBcmSearchElement>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bromcom-ui",
|
|
3
|
-
"version": "2.11.1-rc.9-
|
|
3
|
+
"version": "2.11.1-rc.9-4",
|
|
4
4
|
"description": "Bromcom UI is a collection of web components built with StencilJS",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -81,12 +81,13 @@
|
|
|
81
81
|
"react": "^16.14.0",
|
|
82
82
|
"react-colorful": "^5.6.1",
|
|
83
83
|
"react-dom": "^16.14.0",
|
|
84
|
+
"react-number-format": "^5.3.1",
|
|
84
85
|
"rollup": "^2.58.0",
|
|
85
86
|
"rollup-plugin-dotenv": "latest",
|
|
86
87
|
"slugify": "^1.6.5",
|
|
87
88
|
"snq": "^1.0.3",
|
|
88
89
|
"storybook-fetch-addon": "^1.2.1",
|
|
89
|
-
"tailwindcss": "^3.1
|
|
90
|
+
"tailwindcss": "^3.4.1",
|
|
90
91
|
"ts-dedent": "^2.2.0",
|
|
91
92
|
"tsc-alias": "^1.7.0"
|
|
92
93
|
},
|
|
@@ -121,7 +122,7 @@
|
|
|
121
122
|
},
|
|
122
123
|
"dependencies": {
|
|
123
124
|
"moment": "^2.24.0",
|
|
124
|
-
"rc-picker": "^
|
|
125
|
+
"rc-picker": "^4.1.4",
|
|
125
126
|
"tailwind-variants": "^0.1.14"
|
|
126
127
|
},
|
|
127
128
|
"resolutions": {
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{r as t,h as n,H as e}from"./p-170cf07d.js";import"./p-61753299.js";import"./p-626a65e9.js";import{G as i}from"./p-3556d078.js";import"./p-d00ca988.js";import"./p-a0d6d680.js";import"./p-ca33b8ba.js";import"./p-7e44e6b5.js";import{B as s}from"./p-a313fba6.js";import{C as a}from"./p-2cd6cdee.js";import"./p-e0ab7b38.js";import"./p-3fac58f7.js";import"./p-2e73d572.js";import{c as p}from"./p-08c75801.js";import"./p-436364c8.js";import"./p-8c018ae0.js";import"./p-3a43bf45.js";import"./p-6657830f.js";import"./p-59a92a47.js";const r=p({slots:{host:"bcm-number-input bcm-ui-element tw-flex tw-flex-col tw-items-start tw-justify-start tw-max-w-[256px] tw-w-full",container:"tw-flex tw-flex-row tw-items-center tw-justify-between tw-rounded tw-border tw-border-solid tw-border-slate-300 tw-w-full tw-min-h-full hover:tw-bg-slate-50",inputContainer:"tw-flex tw-min-h-fit tw-w-full tw-flex-row tw-items-center tw-justify-center tw-gap-2 tw-px-3",input:"tw-outline-none tw-appearance-none tw-flex-1 tw-bg-transparent tw-text-slate-400 tw-text-inherit tw-font-normal",caretContainer:"tw-flex tw-flex-col tw-min-h-full tw-border-l tw-items-stretch tw-self-stretch tw-justify-center tw-border-l-slate-300 tw-select-none tw-w-[30px]",caretIcon:"tw-flex tw-items-center tw-text-slate-500 tw-justify-center tw-h-full tw-cursor-pointer active:tw-bg-slate-400 last:tw-border-t last:tw-border-t-slate-300",slotIcon:"tw-text-slate-500"},variants:{size:{small:{host:"tw-gap-0.5 tw-text-xs",slotIcon:"tw-text-[10px]",inputContainer:"tw-py-[2px]",caretIcon:"tw-text-[10px]"},medium:{host:"tw-gap-1 tw-text-base",slotIcon:"tw-text-xs",inputContainer:"tw-py-[5px]"},large:{host:"tw-gap-2 tw-text-base",slotIcon:"tw-text-[14px]",inputContainer:"tw-py-2"}},focus:{true:{container:"tw-ring-1 tw-ring-blue-600",input:"tw-text-slate-700"}}},defaultVariants:{size:"medium"}}),o=class{constructor(n){t(this,n),this.blockInvalidChar=t=>["e","E","+","-"].includes(t.key)&&t.preventDefault(),this._id=i.UID(),this.size=s.Size.medium,this.min=0,this.max=100,this.step=1,this.placeholder=void 0,this.label=void 0,this.tooltip=void 0,this.value=0,this.disabled=!1,this.readonly=!1,this.required=!1,this.pattern=void 0,this.caption=void 0,this.noCaption=!1,this.captionType=s.Status.default,this.captionError=void 0,this.customErrorMessage=void 0,this.prefixIcon=void 0,this.suffixIcon=void 0,this.isFocus=!1,this.isError=!1}render(){const{_id:t,value:i,min:s,max:p,step:o,tooltip:l,disabled:c,size:x,label:m,caption:h,captionType:u,required:w,noCaption:d,captionError:g,customErrorMessage:f,prefixIcon:b,suffixIcon:z,pattern:j}=this,{host:v,input:y,container:C,inputContainer:I,caretContainer:E,caretIcon:k,slotIcon:_}=r({size:x,focus:this.isFocus});return n(e,{class:v(),onClick:()=>!c&&this.nativeInput.focus()},m&&n("bcm-label",{tooltip:l,"no-margin":!0,type:u,value:m,required:w,htmlFor:t}),n("div",{class:C()},n("div",{class:I()},b&&n("span",{class:_()},n("i",{class:b})),n("input",{type:"number",class:y(),min:s,max:p,step:o,value:i,inputmode:"numeric",pattern:j,ref:t=>this.nativeInput=t,onKeyPress:this.blockInvalidChar,onFocus:()=>this.isFocus=!0,onBlur:()=>this.isFocus=!1,onError:t=>console.log(t),onErrorCapture:t=>console.log(t)}),z&&n("span",{class:_()},n("i",{class:z}))),n("div",{class:E()},n("span",{class:k()},n("i",{class:"fas fa-caret-up"})),n("span",{class:k()},n("i",{class:"fas fa-caret-down"})))),n(a,{noCaption:d,captionType:u,captionError:g,caption:h,customErrorMessage:f}))}};o.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");\n.size-1 {\n font-size: 12px;\n line-height: 20px;\n}\n\n.size-2 {\n font-size: 14px;\n line-height: 22px;\n}\n\n.size-3 {\n font-size: 16px;\n line-height: 24px;\n}\n\n.size-4 {\n font-size: 20px;\n line-height: 28px;\n}\n\n.size-5 {\n font-size: 24px;\n line-height: 32px;\n}\n\n.size-6 {\n font-size: 30px;\n line-height: 38px;\n}\n\n.size-7 {\n font-size: 38px;\n line-height: 46px;\n}\n\n.size-8 {\n font-size: 46px;\n line-height: 54px;\n}\n\n.size-9 {\n font-size: 56px;\n line-height: 64px;\n}\n\n.weight-regular {\n font-weight: 400;\n}\n\n.weight-semibold {\n font-weight: 500;\n}\n\n/**\n * Generator\n */\n.input-size-large {\n height: 40px;\n}\n\n.input-size-medium {\n height: 32px;\n}\n\n.input-size-small {\n height: 24px;\n}\n\n.resize-none textarea {\n resize: none;\n}\n\n.resize-vertical textarea {\n resize: vertical;\n}\n\n.resize-auto textarea {\n height: auto;\n resize: none;\n}\n\n.textarea-size-large {\n padding: 4px 0 0 4px;\n min-height: 40px;\n}\n.textarea-size-large .bcm-input-element {\n min-height: calc((40px - 8px) + 2px);\n}\n.textarea-size-large .input-clear-button {\n height: calc( 40px - 16px );\n top: 8px;\n padding: 0;\n margin-right: 8px;\n}\n\n.textarea-size-medium {\n padding: 4px 0 0 4px;\n min-height: 32px;\n}\n.textarea-size-medium .bcm-input-element {\n min-height: calc((32px - 8px) + 2px);\n}\n.textarea-size-medium .input-clear-button {\n height: calc( 32px - 16px );\n top: 8px;\n padding: 0;\n margin-right: 8px;\n}\n\n.textarea-size-small {\n padding: 0px 0 0 4px;\n min-height: 24px;\n}\n.textarea-size-small .bcm-input-element {\n min-height: calc((24px - 8px) + 2px);\n}\n.textarea-size-small .input-clear-button {\n height: calc( 24px - 16px );\n top: 8px;\n padding: 0;\n margin-right: 8px;\n}\n\n@layer base {\n .bcm-number-input input[type=number]::-webkit-outer-spin-button,\n.bcm-number-input input[type=number]::-webkit-inner-spin-button,\n.bcm-number-input input[type=number] {\n -webkit-appearance: none;\n padding: 0px;\n margin: 0px;\n outline: none;\n border: 0px;\n vertical-align: baseline;\n -moz-appearance: textfield !important;\n }\n}';export{o as bcm_number_input}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{v as r}from"./p-59a92a47.js";import{c as t}from"./p-3a43bf45.js";var n,e;function o(r,t){try{var n=r();return void 0===n?t:n}catch(r){if(r instanceof TypeError)return t;throw r}}!function(r){r.info="info",r.error="error",r.warning="warning",r.success="success",r.default="default"}(n||(n={})),function(r){r.banner="banner",r.basic="basic"}(e||(e={}));const c=["localhost","beta-regression.bromcomcloud.com","beta-scrum.bromcomcloud.com","beta-kanban.bromcomcloud.com"];(()=>{const r=window.location.hostname;return c.includes(r)})()&&console.log(`%cbromcom ui%c version: ${r}-p `,"color: white; background:#1890FF; font-weight: 300; font-size:10px; padding:2px 6px; border-radius: 5px","font-size:10px;"),function(){const r=document.querySelector("body");let t=localStorage.getItem("bcm-theme");!r.classList.contains("bcm-theme-*")&&t&&r.classList.add(`bcm-theme-${t}`)}(),function(){const r=document.querySelector("body");let t=document.querySelector("#bcm-overlay-container");t||(t=document.createElement("div"),t.id="bcm-overlay-container",t.classList.add("bcm-overlay-container"),r.appendChild(t))}();class i{static prettify(r){const t={};for(const n in r)r.hasOwnProperty(n)&&(t[n]=r[n]);return t}static getTwColor(r){const{color:n,variable:e,tones:o}=r=Object.assign({variable:"--bcm-color-default",defaultTone:"600",tones:{50:{},100:{},200:{},300:{},400:{},500:{},600:{},700:{},800:{},900:{},950:{}}},r);if(!n||!t[n])return!1;const c={};return"string"==typeof t[n]?(c[e]=t[n],c):((Array.isArray(o)?o:Object.keys(o)).forEach((r=>{t[n][r]&&(Array.isArray(o[r])?o[r].forEach((o=>{c[`${e}-${o}`]=t[n][r]})):c[`${e}-${r}`]=t[n][r])})),c)}}i.UID=(r="bcm")=>`${r}${Math.random().toString(36).substr(2,9)}`,i.getIconAttrWithStatusType=(r,t=!1)=>{if(t)return{icon:"far fa-spinner-third fa-spin"};switch(r){case n.info:return{icon:"far fa-info-circle"};case n.error:return{icon:"far fa-times-circle"};case n.warning:return{icon:"far fa-exclamation-circle"};case n.success:return{icon:"far fa-check-circle"}}},i.domParser=r=>(new DOMParser).parseFromString(r,"text/html").body.innerText,i.createComponent=(r,t)=>{let n=document.getElementById(t.id);return n||(n=document.createElement(r)),Object.keys(t).forEach((r=>{n[r]=t[r]})),document.getElementById("bcm-overlay-container").appendChild(n),n},i.createElement=(r="div",t)=>{let n=document.getElementById(t.id);return n||(n=document.createElement(r)),Object.keys(t).forEach((r=>{"innerHTML"==r?n[r]=t[r]:n.setAttribute(r,t[r])})),document.body.appendChild(n),n},i.debounceInput=(r,t,n,e)=>{let o;return function(){let c=this,i=arguments;e&&e.apply(c,i);let u=function(){o=null,n||r.apply(c,i)},a=n&&!o;clearTimeout(o),o=setTimeout(u,t),a&&r.apply(c,i)}},i.flatArray=r=>r.reduce(((r,t)=>r.concat(Array.isArray(t)?i.flatArray(t):t)),[]),i.reverseNodeList=r=>{let t=[];for(let n=r.length-1;n>=0;n--)t.push(r[n]);return t},i.findEventPathWithKey=(r,t,n)=>{n=Array.isArray(n)?n:[n];let e=r.composedPath()||r.path;if(e)return void 0!==e.filter((r=>n.includes(r[t])))[0]},i.findEventPathHasAttribute=(r,t)=>{let n=r.composedPath()||r.path;if(n)return o((()=>!!n.find((r=>r.hasAttribute(t)))),!1)},i.findEventTarget=(r,t)=>{t=Array.isArray(t)?t:[t];let n=r.target||r.srcElement;if(n)return t.includes(n)},i.findEventPathWithNodeName=(r,t)=>{let n=r.composedPath()||r.path;if(n)return n.filter((r=>r.nodeName===t))[0]},i.findEventPath=(r,t)=>{t=Array.isArray(t)?t:[t];let n=r.composedPath()||r.path;if(n)return void 0!==n.filter((r=>t.includes(r)))[0]},i.objectIsEmpty=r=>0===Object.keys(r).length&&r.constructor===Object,i.convertIdsToNestedData=(r,t)=>{let n=[],e=[];return t.forEach((t=>{r&&r.indexOf(t.id.toString())>-1?n.push(t):t.items&&(e=i.convertIdsToNestedData(r,t.items),e.length>0&&(t.items=e,n.push(t)))})),n},i.nodeListToArray=r=>Array.prototype.slice.call(r),i.setAttributes=(r,t)=>{Object.keys(t).forEach((n=>{r.setAttribute(n,t[n])}))},i.computedStyle=(r,t)=>window.getComputedStyle(r,null).getPropertyValue(t),i.getAncestor=(r,t)=>{for(;(r=r.parentElement)&&!r.matches(t););return r},i.findParentElement=(r,t)=>{const n=t.charAt(0);if("*"===t)return r.parentElement;if("."===n){const n=t.slice(1);return function(r,t){for(;null!==r;){if(r.classList.contains(t))return r;r=r.parentElement}return null}(r.parentElement,n)}if("#"===n){const n=t.slice(1);return function(r,t){for(;null!==r;){if(r.id===t)return r;r=r.parentElement}return null}(r.parentElement,n)}if("["===n){const n=t.indexOf("]"),e=t.slice(1,n),o=t.slice(n+2,-1);return function(r,t,n){for(;null!==r;){if(r.hasAttribute(t)&&(void 0===n||r.getAttribute(t)===n))return r;r=r.parentElement}return null}(r.parentElement,e,o)}{const n=t.toLowerCase();return function(r,t){for(;null!==r;){if(r.tagName.toLowerCase()===t.toLowerCase())return r;r=r.parentElement}return null}(r.parentElement,n)}};export{i as G,n as S,e as T,o as s}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{r as e,c as i,h as t,H as o,g as a}from"./p-170cf07d.js";import{c as s}from"./p-e0ab7b38.js";import{a as n}from"./p-a313fba6.js";import{S as l}from"./p-a0d6d680.js";import{S as r}from"./p-376a20ed.js";import{G as c}from"./p-3556d078.js";import"./p-6657830f.js";import"./p-59a92a47.js";import"./p-3a43bf45.js";const d=class{constructor(t){e(this,t),this.close=i(this,"bcm-close",3),this.modalClose=i(this,"bcm-modal-close",3),this.modalBeforeClose=i(this,"bcm-modal-before-close",3),this.modalBeforeOpen=i(this,"bcm-modal-before-open",3),this.modalSlots={},this._id=c.UID(),this.isShow=!1,this.hidden=!1,this.size=n.Size.medium,this.backdrop=!0,this.width=void 0,this.height=void 0,this.fullWidth=!1}connectedCallback(){const e=this.el.querySelectorAll("bcm-modal-header, bcm-modal-footer");e&&e.forEach((e=>{let i=l.lowercase(l.split(e.nodeName,"-").pop());e.slot=i,e.classList.add(`bcm-modal__container-${i}-content`),this.modalSlots[i]=e}));const i=`bcm-modal--disable-scroll-${this._id}`,t=`bcm-modal-style-${this._id}`;let o=document.getElementById(t);o||(o=document.createElement("style"),o.id=t,o.innerHTML=`.${i} { overflow: hidden; }`,document.head.appendChild(o))}componentWillLoad(){}handleSubmit(e){const i=c.findEventPathWithNodeName(e,l.uppercase("bcm-button"));i&&i.dataDismiss&&this.hide()}handleBackdrop(){1==this.backdrop&&this.hide()}async hide(e={force:!1}){if(null==e?void 0:e.force)return this.isShow=!1,this.close.emit(),void this.modalClose.emit();this.modalBeforeClose.emit(this.el)}async show(e={force:!1}){(null==e?void 0:e.force)?this.isShow=!0:this.modalBeforeOpen.emit(this.el)}keyboardNavigation(e){1==this.backdrop&&(e.keyCode||0)==n.KeyCode.escape&&(e.preventDefault(),this.hide())}async showModal(e){e.defaultPrevented||e.target===this.el&&(this.isShow=!0)}async hideModal(e){e.defaultPrevented||e.target===this.el&&(this.isShow=!1,this.close.emit(),this.modalClose.emit())}_openHandler(){const e=`bcm-modal--disable-scroll-${this._id}`;this.isShow?document.body.classList.add(e):document.body.classList.remove(e)}disconnectedCallback(){document.body.classList.remove(`bcm-modal--disable-scroll-${this._id}`)}render(){const{isShow:e,size:i,fullWidth:a,hidden:n,width:l,height:c}=this,d=s("bcm-modal__container",i,{"custom-size":l||c,"full-width":a,"bcm-modal__show":e}),m=s("bcm-modal",{hidden:n,"bcm-modal__show":e}),h=s("bcm-modal__container-main","size-2"),p=Object.assign(Object.assign({},l&&{width:l}),c&&{height:c});return t(o,{class:`tw-overscroll-contain ${m}`},t("div",{class:"overlay",onClick:()=>this.handleBackdrop()}),t("div",{class:d,style:p},t((()=>this.modalSlots.header&&t("header",{class:"bcm-modal__container-header"},t(r,{name:"header",className:"full-width"}),t("div",{class:"bcm-modal__container-header-close",onClick:()=>this.hide()},t("bcm-icon",{icon:"far fa-times"})))),null),t("main",{class:h},t("article",null,t(r,null))),t((()=>this.modalSlots.footer&&t("footer",{class:"bcm-modal__container-footer"},t("slot",{name:"footer"}))),null)))}get el(){return a(this)}static get watchers(){return{isShow:["_openHandler"]}}};d.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{box-sizing:border-box}.bcm-modal{font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;flex-wrap:nowrap;width:100%;height:100%;position:fixed;z-index:-1;opacity:0;top:0;left:0;visibility:hidden;overflow:auto;padding:24px;transition:opacity 0.5s ease, visibility 0.4s ease-in-out, 0.3s z-index}.bcm-modal__show{opacity:1;z-index:10500;visibility:visible;transition:opacity 0.2s ease, visibility 0.4s ease-in-out, 0.3s z-index}.bcm-modal__show .bcm-modal__container{transition:opacity 0.2s ease-in-out, transform 0.2s ease-in-out;transform:translateY(0)}.bcm-modal .overlay{position:fixed;width:100vw;height:100vh;z-index:1;top:0;left:0;opacity:0.6;background-color:var(--bcm-new-ds-color-slate-900)}.bcm-modal__container{display:flex;flex-direction:column;width:100%;box-shadow:0 2px 6px 1px rgba(17, 24, 38, 0.1);border-radius:8px;background-color:var(--bcm-new-ds-color-white);z-index:2;transform:translateY(-50px);transition:opacity 0.2s ease-in-out, transform 0.2s ease-in-out}.bcm-modal__container.portrait{max-width:312px}.bcm-modal__container.landscape{max-width:475px}.bcm-modal__container.small{max-width:576px}.bcm-modal__container.medium{max-width:768px}.bcm-modal__container.large{max-width:992px}.bcm-modal__container.xlarge{max-width:1024px}.bcm-modal__container.xxlarge{max-width:1200px}.bcm-modal__container.xxxlarge{max-width:1700px}.bcm-modal__container.full-width{width:100%;max-width:100%}.bcm-modal__container.custom-size main{overflow:auto;height:100%;width:100%}.bcm-modal__container-main{color:var(--bcm-color-grey-8);padding:0}.bcm-modal__container-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:nowrap;padding:12px 24px;font-size:16px;line-height:calc(16px + 8px);font-weight:500;color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-slate-100);position:relative}.bcm-modal__container-header span.full-width{width:100%}.bcm-modal__container-header-close{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:nowrap;padding:8px;cursor:pointer;color:var(--bcm-new-ds-color-slate-500);transition:color 0.1s ease-in-out}.bcm-modal__container-header-close:hover{color:var(--bcm-new-ds-color-slate-600)}.bcm-modal__container-header-close:active{color:var(--bcm-new-ds-color-slate-700)}.bcm-modal__container-header-close:focus-visible{color:var(--bcm-new-ds-color-slate-800)}.bcm-modal__container-header:after{border-radius:8px 8px 0 0;content:"";display:block;width:100%;height:4px;background-color:var(--bcm-color-primary-400);position:absolute;top:-4px;left:0}.bcm-modal__container-footer-content{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-end;flex-wrap:nowrap;padding:12px 24px 24px;grid-gap:8px}';export{d as bcm_modal}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{c as e,a as f}from"./p-6657830f.js";var a=String,d=function(){return{isColorSupported:!1,reset:a,bold:a,dim:a,italic:a,underline:a,inverse:a,hidden:a,strikethrough:a,black:a,red:a,green:a,yellow:a,blue:a,magenta:a,cyan:a,white:a,gray:a,bgBlack:a,bgRed:a,bgGreen:a,bgYellow:a,bgBlue:a,bgMagenta:a,bgCyan:a,bgWhite:a}},c=d();c.createColors=d;var r=e((function(e,f){Object.defineProperty(f,"__esModule",{value:!0}),function(e,f){for(var a in f)Object.defineProperty(e,a,{enumerable:!0,get:f[a]})}(f,{dim:()=>n,default:()=>b});const a=d(c);function d(e){return e&&e.__esModule?e:{default:e}}let r=new Set;function t(e,f,a){"undefined"!=typeof process&&process.env.JEST_WORKER_ID||a&&r.has(a)||(a&&r.add(a),console.warn(""),f.forEach((f=>console.warn(e,"-",f))))}function n(e){return a.default.dim(e)}const b={info(e,f){t(a.default.bold(a.default.cyan("info")),...Array.isArray(e)?[e]:[f,e])},warn(e,f){t(a.default.bold(a.default.yellow("warn")),...Array.isArray(e)?[e]:[f,e])},risk(e,f){t(a.default.bold(a.default.magenta("risk")),...Array.isArray(e)?[e]:[f,e])}}})),t=e((function(e,f){Object.defineProperty(f,"__esModule",{value:!0}),Object.defineProperty(f,"default",{enumerable:!0,get:()=>t});const a=d(r);function d(e){return e&&e.__esModule?e:{default:e}}function c({version:e,from:f,to:d}){a.default.warn(`${f}-color-renamed`,[`As of Tailwind CSS ${e}, \`${f}\` has been renamed to \`${d}\`.`,"Update your configuration file to silence this warning."])}const t={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return c({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return c({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return c({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return c({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return c({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}));const n=f(e((function(e){e.exports=(t.__esModule?t:{default:t}).default})));export{n as c}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{r as t,h as p,H as s,g as r}from"./p-170cf07d.js";import"./p-61753299.js";import"./p-626a65e9.js";import{G as o}from"./p-3556d078.js";import"./p-d00ca988.js";import"./p-a0d6d680.js";import"./p-ca33b8ba.js";import"./p-7e44e6b5.js";import"./p-a313fba6.js";import{c as a}from"./p-e0ab7b38.js";import"./p-436364c8.js";import"./p-8c018ae0.js";import"./p-3a43bf45.js";import"./p-6657830f.js";import"./p-59a92a47.js";const i=class{constructor(p){t(this,p),this._id=o.UID(),this.el.slot="footer"}render(){return p(s,{class:a("tw-flex tw-flex-row tw-items-center tw-justify-end tw-gap-2 tw-px-6 tw-pb-6 tw-pt-2")},p("slot",null))}get el(){return r(this)}};export{i as bcm_modal_2_footer}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{r as t,h as s,H as e,g as r}from"./p-170cf07d.js";import"./p-61753299.js";import"./p-626a65e9.js";import{G as a}from"./p-3556d078.js";import"./p-d00ca988.js";import"./p-a0d6d680.js";import"./p-ca33b8ba.js";import"./p-7e44e6b5.js";import"./p-a313fba6.js";import"./p-436364c8.js";import"./p-8c018ae0.js";import"./p-3a43bf45.js";import"./p-6657830f.js";import"./p-59a92a47.js";const o=class{constructor(s){t(this,s),this._id=a.UID(),this.el.slot="header"}render(){return s(e,{class:"tw-w-full tw-flex-none tw-overflow-hidden tw-rounded-t-lg tw-bg-primary-400 tw-pt-1"},s("div",{class:"tw-flex tw-w-full tw-items-center tw-justify-between tw-bg-primary-50 tw-px-4 tw-py-3 tw-text-4 tw-font-medium tw-text-slate-600"},s("span",null,s("slot",null)),s("button",{type:"button",class:"tw-focus:tw-outline-none tw-flex tw-h-8 tw-w-8 tw-cursor-pointer tw-items-center tw-justify-center tw-bg-transparent tw-text-5 tw-text-slate-700 tw-transition tw-duration-150 tw-ease-in-out hover:tw-text-slate-900","data-dismiss":!0},s("i",{class:"far fa-times"}))))}get el(){return r(this)}};export{o as bcm_modal_2_header}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{r as t,c as e,f as i,h as s,H as a,g as o}from"./p-170cf07d.js";import{I as n}from"./p-9850cbce.js";import{G as r,s as h}from"./p-3556d078.js";import{S as p}from"./p-a0d6d680.js";import{a as l}from"./p-a313fba6.js";import"./p-59a92a47.js";import"./p-3a43bf45.js";import"./p-6657830f.js";const c=["BCM-INPUT","BCM-TEXTAREA","BCM-SWITCH","BCM-CHECKBOX","BCM-RADIO-GROUP","BCM-CHECKBOX-GROUP","BCM-RANGE","BCM-FORM","BCM-FORM-GROUP","BCM-LIST","BCM-COLORPICKER","BCM-DATE","BCM-DATE-PICKER","BCM-TIME-PICKER","BCM-DATETIME-PICKER","BCM-SELECT","BCM-LISTBOX","BCM-CHIP-GROUP","BCM-INPUT-DROPDOWN"];const m=class{constructor(i){t(this,i),this.bcmForm=e(this,"bcm-form",7),this.isLoad=!1,this.formData={},this.formObj=new Map,this._id=r.UID(),this.validation=!1}componentDidLoad(){this.isLoad=!0,i(this)}componentIsValid(t){if(!t.hidden){this.checkIsGroup(t);const e=["bcm-checkbox","bcm-switch"].includes(p.lowercase(t.tagName))?0==t.value:p.isNullOrEmpty(t.value);t.required&&(e?(t.captionError=l.FormErrorMessages.required,t.captionType="error",this.formObj.set(t.id,{name:t.name,valid:!1,errorDetails:t.captionError})):(t.captionError=null,t.captionType="default",this.formObj.delete(t.id)))}}isGroup(t){return["bcm-checkbox-group"].includes(p.lowercase(t.tagName))}checkIsGroup(t){if(this.isGroup(t))for(let e of Array.from(t.querySelectorAll("bcm-checkbox")))e&&this.componentIsValid(e)}changeCheckboxGroup(t){const e=t.target,{changed:i}=t.detail,s=Array.from(e.querySelectorAll("bcm-checkbox"));for(let t of s)t.id==i.element.id&&(t.value=i.event.value,this.componentIsValid(t))}bcmComponentList(){return h((()=>Array.from(this.el.querySelectorAll("*")).filter((t=>c.includes(t.tagName)&&(!t["s-hn"]||"BCM-FORM-2"==t["s-hn"]))).filter(Boolean)),[])}formResponse(){const t={formData:this.formData,isValid:0==this.formObj.size,errorDetails:Object.assign({},this.formObj.size>0&&Array.from(this.formObj).map((([t,e])=>({[e.name]:e.errorDetails})))),message:0==this.formObj.size?"":"Please fill in all inputs"};return this.bcmForm.emit(t),t}async setMethodType(t){const{isLoad:e,validation:i}=this;if(e)for(const e of this.bcmComponentList())try{await e[t](),"setClear"==t&&i&&this.componentIsValid(e)}catch(i){console.error(e.nodeName,t,i)}return Promise.resolve()}async submit(){const{isLoad:t,validation:e}=this;if(t)for(const t of this.bcmComponentList()){const{name:i,value:s}=t;this.formData[i]=p.isNullOrEmpty(s)?null:s,e&&this.componentIsValid(t)}return Promise.resolve(this.formResponse())}async set(t){var e,i,s;if(this.isLoad&&t&&(null===(e=this.bcmComponentList())||void 0===e?void 0:e.length)>0)for(let e of Object.keys(t)){const a=null!==(s=null===(i=this.bcmComponentList())||void 0===i?void 0:i.find((t=>t.name==e)))&&void 0!==s?s:{};if(a)try{await a.set(t[e]),this.componentIsValid(a)}catch(t){console.warn("set: ",e,a.nodeName)}}}async get(){var t;let e={};if((null===(t=this.bcmComponentList())||void 0===t?void 0:t.length)>0)for(let t of this.bcmComponentList()){const i=await t.get();e=Object.assign(Object.assign({},e),{[t.name]:p.isNullOrEmpty(i)?null:i})}return Promise.resolve(e)}async resetCaption(){return Promise.resolve(await this.setMethodType("resetCaption"))}async setClear(){return this.formData={},this.formObj=new Map,Promise.resolve(await this.setMethodType("setClear"))}onChange(t){const{isLoad:e,validation:i}=this;if(e){const e=t.target,s=e&&e.tagName.toLowerCase().startsWith("bcm-");if(i&&s){if(this.isGroup(e))return this.changeCheckboxGroup(t);this.componentIsValid(e)}}}render(){return s(a,null,s("slot",null))}get el(){return o(this)}};(function(t,e,i,s){var a,o=arguments.length,n=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(o<3?a(n):o>3?a(e,i,n):a(e,i))||n);o>3&&n&&Object.defineProperty(e,i,n)})([n()],m.prototype,"el",void 0),m.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}:host{display:block}';export{m as bcm_form_2}
|