bromcom-ui 2.11.1-rc.9-3 → 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-3cdfd8eb.entry.js → p-082b9695.entry.js} +1 -1
- package/dist/bromcom-ui/{p-14ed8029.entry.js → p-0da8ad9f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7fd22a35.entry.js → p-0ef4f5ec.entry.js} +1 -1
- package/dist/bromcom-ui/p-15199f10.entry.js +5 -0
- package/dist/bromcom-ui/{p-0eacfbb2.entry.js → p-198cccb5.entry.js} +1 -1
- package/dist/bromcom-ui/p-222203a4.entry.js +16 -0
- package/dist/bromcom-ui/{p-adcb30bc.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-db15dca3.entry.js → p-2c9f9889.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a018f340.entry.js → p-42d09898.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6f37a4d7.entry.js → p-471c7f34.entry.js} +1 -1
- package/dist/bromcom-ui/{p-35c215f2.entry.js → p-4d0680e1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8b31581f.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-e497cf5d.entry.js → p-5df2d3f1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-70253803.entry.js → p-5ee56cae.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e10780ed.entry.js → p-603efb90.entry.js} +1 -1
- package/dist/bromcom-ui/{p-178fa936.entry.js → p-64a8db1d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-61753299.js → p-6bea284a.js} +1 -1
- package/dist/bromcom-ui/{p-dc607ae4.entry.js → p-7230713c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fba1682e.entry.js → p-7d4f57be.entry.js} +1 -1
- package/dist/bromcom-ui/p-87e5fda5.entry.js +5 -0
- package/dist/bromcom-ui/{p-e93d6619.js → p-8f3ca5d9.js} +1 -1
- package/dist/bromcom-ui/p-9bbd341c.entry.js +5 -0
- package/dist/bromcom-ui/{p-bca0ff0a.entry.js → p-a292b41d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-90223f9f.entry.js → p-a933ac12.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5a22b74b.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-bbe8c777.entry.js +5 -0
- package/dist/bromcom-ui/{p-c10b07cc.entry.js → p-c157a7d4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ebeb9689.entry.js → p-c23d73fb.entry.js} +1 -1
- package/dist/bromcom-ui/p-c67a5e5f.entry.js +5 -0
- package/dist/bromcom-ui/p-c77541f4.js +10 -0
- package/dist/bromcom-ui/{p-abd2f9ff.entry.js → p-c89acfca.entry.js} +1 -1
- package/dist/bromcom-ui/p-d1298c40.js +5 -0
- package/dist/bromcom-ui/{p-5bf1657b.entry.js → p-e8bb9019.entry.js} +1 -1
- package/dist/bromcom-ui/{p-627c7769.entry.js → p-e9928d0c.entry.js} +1 -1
- package/dist/bromcom-ui/p-f478ad92.entry.js +5 -0
- package/dist/bromcom-ui/{p-5a391fcd.js → p-fcf70988.js} +1 -1
- package/dist/cjs/{bcm-accordion_46.cjs.entry.js → bcm-accordion_47.cjs.entry.js} +8764 -8633
- 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-f73a098d.js → generate-2f15ee94.js} +2 -2
- package/dist/cjs/{global-baf04c81.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-0543a62e.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-e717a31f.js → package-7b89373b.js} +1 -1
- package/dist/cjs/{validators-77768582.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/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 +0 -1
- 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-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_46.entry.js → bcm-accordion_47.entry.js} +8656 -8526
- 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-c2c0b02e.js → generate-df0f43b2.js} +2 -2
- package/dist/esm/{global-2473677b.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-75447fa6.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-28dc6847.js → package-40075eb9.js} +1 -1
- package/dist/esm/{validators-5a383988.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-3361f6c9.entry.js +0 -5
- package/dist/bromcom-ui/p-350dbff0.entry.js +0 -5
- package/dist/bromcom-ui/p-3a43bf45.js +0 -5
- package/dist/bromcom-ui/p-64f21481.entry.js +0 -20
- package/dist/bromcom-ui/p-930f3618.js +0 -5
- package/dist/bromcom-ui/p-a4b675ef.entry.js +0 -5
- package/dist/bromcom-ui/p-bb46d881.entry.js +0 -5
- package/dist/bromcom-ui/p-c7030364.entry.js +0 -5
- package/dist/bromcom-ui/p-de0b0192.entry.js +0 -5
- package/dist/bromcom-ui/p-ede82918.js +0 -5
- package/dist/cjs/bcm-link.cjs.entry.js +0 -51
- 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/types/components/molecules/number-input/number-input.style.d.ts +0 -200
|
@@ -2,104 +2,292 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import { r as registerInstance, h, H as Host } from './index-0615c2b8.js';
|
|
6
|
-
import './color-helper-
|
|
5
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-0615c2b8.js';
|
|
6
|
+
import './color-helper-74614f24.js';
|
|
7
7
|
import './datetime-helper-df25808a.js';
|
|
8
|
-
import { G as Generate } from './generate-
|
|
9
|
-
import './number-helper-
|
|
10
|
-
import './string-helper-3592bdc2.js';
|
|
11
|
-
import './validators-
|
|
8
|
+
import { G as Generate } from './generate-df0f43b2.js';
|
|
9
|
+
import './number-helper-b012c05f.js';
|
|
10
|
+
import { S as StringHelper } from './string-helper-3592bdc2.js';
|
|
11
|
+
import './validators-166e2a4e.js';
|
|
12
12
|
import './element-dragger-89bb52fd.js';
|
|
13
|
+
import { d as delay } from './utils-57652744.js';
|
|
13
14
|
import { B as Bcm } from './bcm-a50d55ba.js';
|
|
14
15
|
import { C as CaptionTemplate } from './caption-template-d7953d13.js';
|
|
15
|
-
import './index-f549811f.js';
|
|
16
|
+
import { c as classnames } from './index-f549811f.js';
|
|
16
17
|
import './types-6f06fa1a.js';
|
|
17
18
|
import './types-9493a7ed.js';
|
|
18
|
-
import {
|
|
19
|
+
import { i as inputStyle } from './input.style-e855c0f3.js';
|
|
19
20
|
import './colors-1d7854ea.js';
|
|
20
|
-
import './
|
|
21
|
-
import './colors-c530a5b8.js';
|
|
21
|
+
import './colors-dd598eea.js';
|
|
22
22
|
import './_commonjsHelpers-82aa9212.js';
|
|
23
|
-
import './package-
|
|
24
|
-
|
|
25
|
-
const numberInputStyle = ce({
|
|
26
|
-
slots: {
|
|
27
|
-
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",
|
|
28
|
-
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",
|
|
29
|
-
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",
|
|
30
|
-
input: "tw-outline-none tw-appearance-none tw-flex-1 tw-bg-transparent tw-text-slate-400 tw-text-inherit tw-font-normal",
|
|
31
|
-
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]",
|
|
32
|
-
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",
|
|
33
|
-
slotIcon: "tw-text-slate-500",
|
|
34
|
-
},
|
|
35
|
-
variants: {
|
|
36
|
-
size: {
|
|
37
|
-
small: {
|
|
38
|
-
host: "tw-gap-0.5 tw-text-xs",
|
|
39
|
-
slotIcon: "tw-text-[10px]",
|
|
40
|
-
inputContainer: "tw-py-[2px]",
|
|
41
|
-
caretIcon: "tw-text-[10px]",
|
|
42
|
-
},
|
|
43
|
-
medium: {
|
|
44
|
-
host: "tw-gap-1 tw-text-base",
|
|
45
|
-
slotIcon: "tw-text-xs",
|
|
46
|
-
inputContainer: "tw-py-[5px]",
|
|
47
|
-
},
|
|
48
|
-
large: {
|
|
49
|
-
host: "tw-gap-2 tw-text-base",
|
|
50
|
-
slotIcon: "tw-text-[14px]",
|
|
51
|
-
inputContainer: "tw-py-2",
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
focus: {
|
|
55
|
-
true: {
|
|
56
|
-
container: "tw-ring-1 tw-ring-blue-600",
|
|
57
|
-
input: "tw-text-slate-700",
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
defaultVariants: {
|
|
62
|
-
size: "medium",
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
const numberInputCss = "@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}";
|
|
23
|
+
import './package-40075eb9.js';
|
|
24
|
+
import './index-3bc8c6e3.js';
|
|
67
25
|
|
|
68
26
|
const NumberInput = class {
|
|
69
27
|
constructor(hostRef) {
|
|
70
28
|
registerInstance(this, hostRef);
|
|
71
|
-
this.
|
|
72
|
-
|
|
29
|
+
this.focus = createEvent(this, "bcm-focus", 3);
|
|
30
|
+
this.blur = createEvent(this, "bcm-blur", 3);
|
|
31
|
+
this.clear = createEvent(this, "bcm-clear", 3);
|
|
32
|
+
this.change = createEvent(this, "bcm-change", 7);
|
|
33
|
+
this.input = createEvent(this, "bcm-input", 3);
|
|
34
|
+
this.beforeClear = createEvent(this, "bcm-input-before-clear", 3);
|
|
35
|
+
this._onChange = createEvent(this, "bcm-onchange", 3);
|
|
36
|
+
this.inValid = false;
|
|
37
|
+
this.onInput = () => {
|
|
38
|
+
var _a;
|
|
39
|
+
(_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.addEventListener("input", (e) => {
|
|
40
|
+
this.input.emit(e);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
this.onChange = () => {
|
|
44
|
+
var _a;
|
|
45
|
+
(_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.addEventListener("change", (e) => {
|
|
46
|
+
this.change.emit(e);
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
this.onFocus = () => {
|
|
50
|
+
var _a;
|
|
51
|
+
(_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.addEventListener("focus", e => {
|
|
52
|
+
this.isFocus = true;
|
|
53
|
+
this.focus.emit(e);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
this.onBlur = () => {
|
|
57
|
+
var _a;
|
|
58
|
+
(_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.addEventListener("blur", e => {
|
|
59
|
+
this.isFocus = false;
|
|
60
|
+
this.blur.emit(e);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
this.onKeydown = () => {
|
|
64
|
+
var _a;
|
|
65
|
+
(_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.addEventListener("keydown", (e) => {
|
|
66
|
+
if (e.key === "ArrowUp") {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
this.up();
|
|
69
|
+
}
|
|
70
|
+
if (e.key === "ArrowDown") {
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
this.down();
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
this.listener = () => {
|
|
77
|
+
this.onInput();
|
|
78
|
+
this.onChange();
|
|
79
|
+
this.onFocus();
|
|
80
|
+
this.onBlur();
|
|
81
|
+
this.onKeydown();
|
|
73
82
|
};
|
|
74
83
|
this._id = Generate.UID();
|
|
75
|
-
this.
|
|
76
|
-
this.
|
|
77
|
-
this.
|
|
84
|
+
this.value = "";
|
|
85
|
+
this.defaultValue = undefined;
|
|
86
|
+
this._prefix = undefined;
|
|
87
|
+
this._suffix = undefined;
|
|
88
|
+
this.size = "medium";
|
|
89
|
+
this.min = undefined;
|
|
90
|
+
this.max = undefined;
|
|
78
91
|
this.step = 1;
|
|
79
|
-
this.placeholder = undefined;
|
|
80
92
|
this.label = undefined;
|
|
81
|
-
this.
|
|
82
|
-
this.
|
|
83
|
-
this.
|
|
93
|
+
this.name = undefined;
|
|
94
|
+
this.fullWidth = false;
|
|
95
|
+
this.clearable = false;
|
|
84
96
|
this.readonly = false;
|
|
97
|
+
this.disabled = false;
|
|
85
98
|
this.required = false;
|
|
86
|
-
this.
|
|
99
|
+
this.mode = "none";
|
|
100
|
+
this.placeholder = undefined;
|
|
101
|
+
this.thousandSeparator = false;
|
|
102
|
+
this.decimalSeparator = undefined;
|
|
103
|
+
this.decimalScale = undefined;
|
|
104
|
+
this.fixedDecimalScale = false;
|
|
105
|
+
this.allowNegative = false;
|
|
106
|
+
this.allowLeadingZeros = false;
|
|
107
|
+
this.unitPrefix = undefined;
|
|
108
|
+
this.unitSuffix = undefined;
|
|
87
109
|
this.caption = undefined;
|
|
88
110
|
this.noCaption = false;
|
|
89
111
|
this.captionType = Bcm.Status.default;
|
|
90
112
|
this.captionError = undefined;
|
|
91
113
|
this.customErrorMessage = undefined;
|
|
92
|
-
this.prefixIcon = undefined;
|
|
93
|
-
this.suffixIcon = undefined;
|
|
94
114
|
this.isFocus = false;
|
|
95
|
-
this.
|
|
115
|
+
this.captionCache = undefined;
|
|
116
|
+
this.captionTypeCache = undefined;
|
|
117
|
+
this.valueCache = "";
|
|
118
|
+
}
|
|
119
|
+
connectedCallback() {
|
|
120
|
+
if (this.defaultValue)
|
|
121
|
+
this.value = +this.defaultValue;
|
|
122
|
+
this.valueCache = this.value;
|
|
123
|
+
this.captionCache = this.caption;
|
|
124
|
+
this.captionTypeCache = this.captionType;
|
|
125
|
+
}
|
|
126
|
+
componentDidLoad() {
|
|
127
|
+
this.listener();
|
|
128
|
+
}
|
|
129
|
+
up() {
|
|
130
|
+
if (this.disabled)
|
|
131
|
+
return;
|
|
132
|
+
if (!this.value)
|
|
133
|
+
this.value = Number(0);
|
|
134
|
+
this.value = +this.value + +this.step;
|
|
135
|
+
if (this.mode === "strict") {
|
|
136
|
+
if (this.max && +this.value > +this.max) {
|
|
137
|
+
this.value = this.max;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
down() {
|
|
142
|
+
if (this.disabled)
|
|
143
|
+
return;
|
|
144
|
+
if (!this.value)
|
|
145
|
+
this.value = Number(0);
|
|
146
|
+
this.value = +this.value - +this.step;
|
|
147
|
+
if (this.mode === "strict") {
|
|
148
|
+
if (this.min && +this.value < +this.min) {
|
|
149
|
+
this.value = this.min;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
handleClear(e) {
|
|
154
|
+
if (this.disabled)
|
|
155
|
+
return;
|
|
156
|
+
const event = this.beforeClear.emit(e);
|
|
157
|
+
if (event.defaultPrevented)
|
|
158
|
+
return;
|
|
159
|
+
this.value = "";
|
|
160
|
+
this.clear.emit(e);
|
|
161
|
+
}
|
|
162
|
+
checkLength() {
|
|
163
|
+
const { min, max, value } = this;
|
|
164
|
+
const minLength = min;
|
|
165
|
+
const maxLength = max;
|
|
166
|
+
let valuePoint = value === null || value === void 0 ? void 0 : value.toString();
|
|
167
|
+
if (min && max) {
|
|
168
|
+
if (+valuePoint < +min || +valuePoint > +max) {
|
|
169
|
+
this.setCaption(StringHelper.getMessage("betweenlength", [minLength, maxLength]), "error");
|
|
170
|
+
this.inValid = true;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
this.setCaption();
|
|
174
|
+
this.inValid = false;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else if (minLength) {
|
|
178
|
+
if (+valuePoint < +minLength) {
|
|
179
|
+
this.setCaption(StringHelper.getMessage("minlength", [minLength]), "error");
|
|
180
|
+
this.inValid = true;
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
this.setCaption();
|
|
184
|
+
this.inValid = false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else if (maxLength) {
|
|
188
|
+
if (valuePoint > maxLength) {
|
|
189
|
+
this.setCaption(StringHelper.getMessage("maxlength", [maxLength]), "error");
|
|
190
|
+
this.inValid = true;
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
this.setCaption();
|
|
194
|
+
this.inValid = false;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
watchValue() {
|
|
199
|
+
this.checkLength();
|
|
200
|
+
}
|
|
201
|
+
async onBcmFocus() {
|
|
202
|
+
this.inputElement.focus();
|
|
203
|
+
}
|
|
204
|
+
async onBcmBlur() {
|
|
205
|
+
this.inputElement.blur();
|
|
206
|
+
}
|
|
207
|
+
async onBcmSelect() {
|
|
208
|
+
this.inputElement.select();
|
|
209
|
+
}
|
|
210
|
+
async set(data) {
|
|
211
|
+
await this.setValue(data);
|
|
212
|
+
}
|
|
213
|
+
async get() {
|
|
214
|
+
return this.value || null;
|
|
215
|
+
}
|
|
216
|
+
async setValue(value) {
|
|
217
|
+
this.value = value;
|
|
218
|
+
}
|
|
219
|
+
async setClear() {
|
|
220
|
+
this.value = null;
|
|
221
|
+
await delay(10);
|
|
222
|
+
return Promise.resolve();
|
|
223
|
+
}
|
|
224
|
+
async resetCaption() {
|
|
225
|
+
await delay(10);
|
|
226
|
+
this.caption = this.captionCache;
|
|
227
|
+
this.captionType = this.captionTypeCache;
|
|
228
|
+
this.captionError = null;
|
|
229
|
+
this.inValid = false;
|
|
230
|
+
await delay(10);
|
|
231
|
+
return Promise.resolve();
|
|
232
|
+
}
|
|
233
|
+
setCaption(caption = null, captionType = null) {
|
|
234
|
+
this.caption = caption || this.captionCache;
|
|
235
|
+
this.captionType = captionType || this.captionTypeCache;
|
|
236
|
+
this.captionError = captionType == "error" ? caption : null;
|
|
237
|
+
return Promise.resolve();
|
|
238
|
+
}
|
|
239
|
+
disconnectedCallback() {
|
|
240
|
+
var _a, _b, _c, _d, _e;
|
|
241
|
+
(_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.removeEventListener("input", this.onInput.bind(this));
|
|
242
|
+
(_b = this.inputElement) === null || _b === void 0 ? void 0 : _b.removeEventListener("change", this.onChange.bind(this));
|
|
243
|
+
(_c = this.inputElement) === null || _c === void 0 ? void 0 : _c.removeEventListener("focus", this.onFocus.bind(this));
|
|
244
|
+
(_d = this.inputElement) === null || _d === void 0 ? void 0 : _d.removeEventListener("blur", this.onBlur.bind(this));
|
|
245
|
+
(_e = this.inputElement) === null || _e === void 0 ? void 0 : _e.removeEventListener("keydown", this.onKeydown.bind(this));
|
|
96
246
|
}
|
|
97
247
|
render() {
|
|
98
|
-
const { _id, value,
|
|
99
|
-
const
|
|
100
|
-
|
|
248
|
+
const { _prefix, _suffix, noCaption, captionType, captionError, caption, required, _id, label, size, fullWidth, clearable, value, placeholder, thousandSeparator, decimalSeparator, decimalScale, fixedDecimalScale, allowNegative, allowLeadingZeros, unitPrefix, unitSuffix, min, max, step, defaultValue, disabled, mode, } = this;
|
|
249
|
+
const isActiveClearable = (value === null || value === void 0 ? void 0 : value.toString().length) > 0 && clearable;
|
|
250
|
+
const isInvalid = this.captionType == "error" || this.inValid;
|
|
251
|
+
const { host, inputContainer, slotClass, clearButton, controls, controlsBtn, controlsBtnDown, controlsBtnUp, controlsDivider, input } = inputStyle({
|
|
252
|
+
size,
|
|
253
|
+
fullWidth,
|
|
254
|
+
clearable: isActiveClearable,
|
|
255
|
+
disabled,
|
|
256
|
+
invalid: isInvalid,
|
|
257
|
+
});
|
|
258
|
+
const numericProps = {
|
|
259
|
+
placeholder,
|
|
260
|
+
thousandSeparator,
|
|
261
|
+
decimalSeparator,
|
|
262
|
+
decimalScale,
|
|
263
|
+
fixedDecimalScale,
|
|
264
|
+
allowNegative,
|
|
265
|
+
allowLeadingZeros,
|
|
266
|
+
prefix: unitPrefix,
|
|
267
|
+
suffix: unitSuffix,
|
|
268
|
+
};
|
|
269
|
+
/* input props */
|
|
270
|
+
const inputProps = {
|
|
271
|
+
min,
|
|
272
|
+
max,
|
|
273
|
+
step,
|
|
274
|
+
value,
|
|
275
|
+
defaultValue,
|
|
276
|
+
};
|
|
277
|
+
const generalProps = Object.assign(Object.assign(Object.assign({ "id": _id + "-base-input", "name": this.name, disabled,
|
|
278
|
+
mode, "aria-label": label, "aria-labelledby": _id + "-label", "getInputRef": el => {
|
|
279
|
+
this.inputElement = el;
|
|
280
|
+
}, "className": input() }, numericProps), inputProps), { "onValueChange": (e) => {
|
|
281
|
+
const { floatValue } = e;
|
|
282
|
+
this.value = floatValue;
|
|
283
|
+
this._onChange.emit(e);
|
|
284
|
+
} });
|
|
285
|
+
return (h(Host, { class: host() }, label && h("bcm-label", { size: size, type: captionType, value: label, required: required, htmlFor: _id + "-base-input", id: _id + "-label" }), h("div", { class: inputContainer() }, h("div", { class: slotClass() }, h("slot", { name: "prefix" }, _prefix && _prefix.length > 0 && h("span", { innerHTML: _prefix }))), h("bcm-react-number", { disabled: disabled, class: "tw-flex-1", options: generalProps }), h("div", { class: slotClass() }, !disabled && isActiveClearable && (h("button", { class: clearButton(), onClick: event => this.handleClear(event) }, h("i", { class: "far fa-times" }))), h("slot", { name: "suffix" }, _suffix && _suffix.length > 0 && h("span", { innerHTML: _suffix })), h("div", { class: controls() }, h("button", { type: "button", disabled: disabled, class: classnames(controlsBtn(), controlsBtnUp()), onClick: this.up.bind(this), "aria-label": "Increase value" }, h("i", { class: "fas fa-caret-up" })), h("div", { class: controlsDivider() }), h("button", { type: "button", disabled: disabled, class: classnames(controlsBtn(), controlsBtnDown()), onClick: this.down.bind(this), "aria-label": "Decrease value" }, h("i", { class: "fas fa-caret-down" }))))), h(CaptionTemplate, { noCaption: noCaption, captionType: captionType, captionError: captionError, caption: caption, customErrorMessage: this.customErrorMessage })));
|
|
101
286
|
}
|
|
287
|
+
get el() { return getElement(this); }
|
|
288
|
+
static get watchers() { return {
|
|
289
|
+
"value": ["watchValue"]
|
|
290
|
+
}; }
|
|
102
291
|
};
|
|
103
|
-
NumberInput.style = numberInputCss;
|
|
104
292
|
|
|
105
293
|
export { NumberInput as bcm_number_input };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { r as registerInstance, h, H as Host } from './index-0615c2b8.js';
|
|
6
6
|
import { c as classnames } from './index-f549811f.js';
|
|
7
|
-
import { c as colors } from './colors-
|
|
7
|
+
import { c as colors } from './colors-dd598eea.js';
|
|
8
8
|
import './_commonjsHelpers-82aa9212.js';
|
|
9
9
|
|
|
10
10
|
const BcmOverlay = class {
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
5
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-0615c2b8.js';
|
|
6
|
-
import { C as ColorHelper } from './color-helper-
|
|
6
|
+
import { C as ColorHelper } from './color-helper-74614f24.js';
|
|
7
7
|
import './datetime-helper-df25808a.js';
|
|
8
|
-
import { G as Generate } from './generate-
|
|
9
|
-
import './number-helper-
|
|
8
|
+
import { G as Generate } from './generate-df0f43b2.js';
|
|
9
|
+
import './number-helper-b012c05f.js';
|
|
10
10
|
import { S as StringHelper } from './string-helper-3592bdc2.js';
|
|
11
|
-
import './validators-
|
|
11
|
+
import './validators-166e2a4e.js';
|
|
12
12
|
import './element-dragger-89bb52fd.js';
|
|
13
13
|
import { B as Bcm } from './bcm-a50d55ba.js';
|
|
14
14
|
import { d as delay } from './utils-57652744.js';
|
|
15
15
|
import { F as FloatingUI } from './floating-ui-3f4394da.js';
|
|
16
16
|
import './colors-1d7854ea.js';
|
|
17
|
-
import './colors-
|
|
17
|
+
import './colors-dd598eea.js';
|
|
18
18
|
import './_commonjsHelpers-82aa9212.js';
|
|
19
|
-
import './package-
|
|
19
|
+
import './package-40075eb9.js';
|
|
20
20
|
|
|
21
21
|
class Popover {
|
|
22
22
|
constructor({ content, message, targetId, placement = "top", color = "slate-700", trigger = "none", openDelay = 0, closeDelay = 0, autoHide = false, emitShow = () => { }, emitHide = () => { } }) {
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-0615c2b8.js';
|
|
6
6
|
import { c as classnames } from './index-f549811f.js';
|
|
7
|
-
import { G as Generate } from './generate-
|
|
7
|
+
import { G as Generate } from './generate-df0f43b2.js';
|
|
8
8
|
import { a as Bcm } from './bcm-a50d55ba.js';
|
|
9
9
|
import { d as delay } from './utils-57652744.js';
|
|
10
10
|
import './_commonjsHelpers-82aa9212.js';
|
|
11
|
-
import './package-
|
|
12
|
-
import './colors-
|
|
11
|
+
import './package-40075eb9.js';
|
|
12
|
+
import './colors-dd598eea.js';
|
|
13
13
|
|
|
14
14
|
const rangeCss = "@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-range{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;width:100%;position:relative;display:block;margin:16px 0}.bcm-range input[type=range]{position:absolute;pointer-events:none;-webkit-appearance:none;z-index:4;height:30px;width:100%;top:-17px;opacity:0}.bcm-range input[type=range].single{display:none}.bcm-range input[type=range]::-webkit-slider-thumb{pointer-events:all;width:30px;height:30px;border-radius:0;border:0 none;background-color:red;-webkit-appearance:none;cursor:pointer}.bcm-range__container-bar{width:calc(100% - 24px);left:12px;position:relative}.bcm-range__container-bar-track{position:absolute;top:-2px;width:100%;height:4px;background-color:var(--bcm-new-ds-color-slate-300);z-index:1}.bcm-range__container-bar-range{position:absolute;top:-2px;left:22.22%;right:22.22%;height:4px;background-color:var(--bcm-new-ds-color-blue-500);z-index:2}.bcm-range__container-bar-thumb{position:absolute;top:0;width:16px;height:16px;background-color:var(--bcm-new-ds-color-blue-500);border-radius:50%;z-index:3;transition:box-shadow 0.2s ease-in-out;display:flex;align-items:center;justify-content:center}.bcm-range__container-bar-thumb>span{display:flex;width:100%;height:100%}.bcm-range__container-bar-thumb.hover{box-shadow:0px 2px 2px rgba(0, 0, 0, 0.1), 0px 3px 1px rgba(0, 0, 0, 0.05), 0px 1px 5px rgba(0, 0, 0, 0.1);cursor:pointer}.bcm-range__container-bar-thumb.hidden{display:none}.bcm-range__container-bar-thumb.left{left:22.22222%;transform:translate(-8px, -8px)}.bcm-range__container-bar-thumb.right{right:0%;transform:translate(8px, -8px)}.bcm-range .ticks{position:absolute;z-index:0;top:0;left:0;width:100%;display:flex;justify-content:space-between;padding:4px 0;user-select:none}.bcm-range .tick{position:relative;display:flex;justify-content:center;width:1px;color:var(--bcm-new-ds-color-slate-300);cursor:pointer;height:8px;line-height:32px;margin-bottom:8px;z-index:-1;transition:color 0.1s ease-in-out}.bcm-range .tick::before,.bcm-range .tick::after{content:\" \";position:absolute;width:1px;height:8px;background-color:var(--bcm-new-ds-color-slate-300);z-index:-1;transition:background-color 0.1s ease-in-out}.bcm-range .tick::before{top:-16px}.bcm-range .tick::after{top:0}.bcm-range .tick.hover{color:var(--bcm-new-ds-color-slate-400)}.bcm-range .tick.hover::before,.bcm-range .tick.hover::after{background-color:var(--bcm-new-ds-color-slate-400)}.bcm-range .touch{position:absolute;width:calc(100% + 48px);left:-24px;top:-17px;opacity:0;height:45px;z-index:2;background-color:transparent;display:flex;flex-direction:row;justify-content:space-between}.bcm-range .touch-point{cursor:pointer;flex:1;border:1px solid var(--bcm-new-ds-color-slate-300);box-sizing:border-box;background-color:var(--bcm-new-ds-color-slate-300)}.bcm-range .touch-point:hover{border-color:var(--bcm-new-ds-color-blue-500);background-color:var(--bcm-new-ds-color-blue-500)}.bcm-range .touch::after,.bcm-range .touch::before{content:\"\";position:absolute;width:24px;height:100%;top:0}.bcm-range .touch::before{left:0}.bcm-range .touch::after{right:0}.bcm-range.vertical{margin:0 16px;padding:12px 0}.bcm-range.vertical .touch{width:calc(100% + 12px);left:-6px;top:-17px}.bcm-range.vertical .touch::after,.bcm-range.vertical .touch::before{width:12px}.bcm-range.vertical .bcm-range__container{transform:rotate(270deg)}.bcm-range.vertical .bcm-range__container .ticks .tick-text{position:absolute;top:0px;width:100%;transform:rotate(90deg)}";
|
|
15
15
|
|