bromcom-ui 2.10.1-rc.10 → 2.10.1-rc.11
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.esm.js +1 -1
- package/dist/bromcom-ui/p-01c19c5a.entry.js +5 -0
- package/dist/bromcom-ui/{p-16450a8b.entry.js → p-0985e7ba.entry.js} +1 -1
- package/dist/bromcom-ui/{p-424b7562.entry.js → p-10e70228.entry.js} +1 -1
- package/dist/bromcom-ui/{p-afde516e.entry.js → p-13c47eea.entry.js} +1 -1
- package/dist/bromcom-ui/p-140b6ce0.js +5 -0
- package/dist/bromcom-ui/{p-6153f889.entry.js → p-18020ef7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3f127ea5.entry.js → p-1b9bffba.entry.js} +1 -1
- package/dist/bromcom-ui/{p-18d28737.entry.js → p-30bfe3bd.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c977ed98.entry.js → p-372ffe04.entry.js} +1 -1
- package/dist/bromcom-ui/{p-643a09b4.entry.js → p-3c87fd88.entry.js} +1 -1
- package/dist/bromcom-ui/p-4597ee14.entry.js +5 -0
- package/dist/bromcom-ui/p-47682d2b.entry.js +21 -0
- package/dist/bromcom-ui/p-4bace961.entry.js +5 -0
- package/dist/bromcom-ui/{p-4e436468.entry.js → p-5f419e20.entry.js} +1 -1
- package/dist/bromcom-ui/p-6132700e.entry.js +5 -0
- package/dist/bromcom-ui/{p-a58b2664.js → p-62840867.js} +1 -1
- package/dist/bromcom-ui/p-629bcf93.entry.js +5 -0
- package/dist/bromcom-ui/{p-9da1d897.entry.js → p-6a02ed0b.entry.js} +1 -1
- package/dist/bromcom-ui/p-6bfed79a.entry.js +5 -0
- package/dist/bromcom-ui/{p-9ac757e9.entry.js → p-6d83c8f6.entry.js} +1 -1
- package/dist/bromcom-ui/p-6de1c6ea.entry.js +5 -0
- package/dist/bromcom-ui/p-71cbd6f6.entry.js +5 -0
- package/dist/bromcom-ui/{p-a835bff0.entry.js → p-73d4bd1c.entry.js} +1 -1
- package/dist/bromcom-ui/p-7ada3462.entry.js +5 -0
- package/dist/bromcom-ui/p-7c0a3a3d.js +5 -0
- package/dist/bromcom-ui/{p-aab72ea1.entry.js → p-7d1dd1b9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ec36f5a0.entry.js → p-82331114.entry.js} +1 -1
- package/dist/bromcom-ui/p-8301a465.entry.js +5 -0
- package/dist/bromcom-ui/p-85565afb.js +5 -0
- package/dist/bromcom-ui/{p-073d177e.entry.js → p-88c38780.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8c610886.js → p-8dc361a8.js} +1 -1
- package/dist/bromcom-ui/{p-79712823.entry.js → p-90510968.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e2aaaece.js → p-92d1a4c9.js} +1 -1
- package/dist/bromcom-ui/{p-edbdd7dd.js → p-9398df85.js} +1 -1
- package/dist/bromcom-ui/{p-841f2b60.entry.js → p-9ec71162.entry.js} +1 -1
- package/dist/bromcom-ui/{p-17eb0140.entry.js → p-9f954c08.entry.js} +1 -1
- package/dist/bromcom-ui/p-9fbc30a6.entry.js +5 -0
- package/dist/bromcom-ui/{p-fed84581.js → p-a40d4f27.js} +1 -1
- package/dist/bromcom-ui/p-a8d23b66.entry.js +5 -0
- package/dist/bromcom-ui/p-a953375b.entry.js +5 -0
- package/dist/bromcom-ui/p-a95b18f2.entry.js +5 -0
- package/dist/bromcom-ui/{p-f077a1d7.entry.js → p-a9c8b43c.entry.js} +1 -1
- package/dist/bromcom-ui/p-baf565be.entry.js +5 -0
- package/dist/bromcom-ui/{p-5fc49f6f.entry.js → p-bffc5f8c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-07e9b5e7.entry.js → p-c80014e3.entry.js} +1 -1
- package/dist/bromcom-ui/p-c852c8fe.entry.js +5 -0
- package/dist/bromcom-ui/{p-ec992ac3.entry.js → p-ca788dc4.entry.js} +1 -1
- package/dist/bromcom-ui/p-ca8a4fc8.entry.js +5 -0
- package/dist/bromcom-ui/p-cc6c6f9e.entry.js +5 -0
- package/dist/bromcom-ui/p-d283e83e.entry.js +5 -0
- package/dist/bromcom-ui/p-dbad3126.entry.js +5 -0
- package/dist/bromcom-ui/{p-a1477028.js → p-de2272c5.js} +1 -1
- package/dist/bromcom-ui/{p-60a12878.entry.js → p-df444847.entry.js} +1 -1
- package/dist/bromcom-ui/p-ee4845ac.entry.js +5 -0
- package/dist/bromcom-ui/{p-da5fdda2.entry.js → p-ef829d33.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7e2da99e.entry.js → p-f24b096b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8e772077.entry.js → p-f372306f.entry.js} +1 -1
- package/dist/bromcom-ui/p-f818d2a9.entry.js +5 -0
- package/dist/bromcom-ui/{p-5bf620b2.entry.js → p-f93bf6db.entry.js} +1 -1
- package/dist/bromcom-ui/{p-594953e7.entry.js → p-fc18af27.entry.js} +1 -1
- package/dist/cjs/bcm-accordion.cjs.entry.js +2 -2
- package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
- package/dist/cjs/bcm-attendance.cjs.entry.js +2 -2
- package/dist/cjs/bcm-avatar_2.cjs.entry.js +4 -5
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/bcm-button-group.cjs.entry.js +2 -2
- package/dist/cjs/{bcm-button_15.cjs.entry.js → bcm-button_18.cjs.entry.js} +1990 -18
- package/dist/cjs/bcm-caption.cjs.entry.js +4 -5
- package/dist/cjs/bcm-card.cjs.entry.js +2 -2
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +2 -2
- package/dist/cjs/bcm-chip-group.cjs.entry.js +4 -5
- package/dist/cjs/bcm-chip.cjs.entry.js +2 -2
- package/dist/cjs/bcm-collapse.cjs.entry.js +2 -2
- package/dist/cjs/bcm-color-input.cjs.entry.js +4 -5
- package/dist/cjs/bcm-default.cjs.entry.js +2 -2
- package/dist/cjs/bcm-drawer.cjs.entry.js +4 -5
- package/dist/cjs/bcm-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +2 -2
- package/dist/cjs/bcm-form-2.cjs.entry.js +2 -2
- package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -2
- package/dist/cjs/bcm-input-dropdown.cjs.entry.js +4 -5
- package/dist/cjs/bcm-item.cjs.entry.js +2 -2
- package/dist/cjs/bcm-items.cjs.entry.js +2 -2
- package/dist/cjs/bcm-menu.cjs.entry.js +5 -6
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +4 -5
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +4 -5
- package/dist/cjs/bcm-modal-2.cjs.entry.js +4 -5
- package/dist/cjs/bcm-modal.cjs.entry.js +2 -2
- package/dist/cjs/bcm-number-input.cjs.entry.js +4 -5
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +2 -2
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -2
- package/dist/cjs/bcm-popover.cjs.entry.js +4 -5
- package/dist/cjs/bcm-progress.cjs.entry.js +2 -2
- package/dist/cjs/bcm-radio-group.cjs.entry.js +4 -5
- package/dist/cjs/bcm-radio.cjs.entry.js +4 -5
- package/dist/cjs/bcm-range.cjs.entry.js +2 -2
- package/dist/cjs/bcm-shortcut.cjs.entry.js +4 -5
- package/dist/cjs/bcm-skeleton.cjs.entry.js +4 -5
- package/dist/cjs/bcm-step.cjs.entry.js +3 -3
- package/dist/cjs/bcm-stepper.cjs.entry.js +5 -6
- package/dist/cjs/bcm-tab-group.cjs.entry.js +4 -5
- package/dist/cjs/bcm-tab-item-header.cjs.entry.js +4 -5
- package/dist/cjs/bcm-tab-item.cjs.entry.js +4 -5
- package/dist/cjs/bcm-table.cjs.entry.js +4 -5
- package/dist/cjs/bcm-tag.cjs.entry.js +3 -3
- package/dist/cjs/bcm-textarea.cjs.entry.js +3 -3
- package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-toast.cjs.entry.js +2 -2
- package/dist/cjs/bromcom-ui.cjs.js +3 -3
- package/dist/cjs/{generate-c3a6c8c7.js → generate-8f2a5b22.js} +1 -1
- package/dist/cjs/{global-9e8b5009.js → global-6e3108be.js} +1 -1
- package/dist/cjs/{input-template-8eeb94e7.js → input-template-866a71d3.js} +1 -1
- package/dist/cjs/{json-parse-decarator-0932bec0.js → json-parse-decarator-f30bb239.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{number-helper-4e902d31.js → number-helper-57ea679e.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +3 -3
- package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -2
- package/dist/cjs/{package-b23f7b7f.js → package-9f43976f.js} +1 -1
- package/dist/cjs/{stepper-states-cb2339c3.js → stepper-states-1199c518.js} +1 -1
- package/dist/cjs/{tooltip-helper-4ddec3b4.js → tooltip-helper-f55fc832.js} +3 -4
- package/dist/cjs/{validators-e2155072.js → validators-463a67ba.js} +6 -1
- package/dist/collection/components/atoms/label/label.js +1 -1
- package/dist/collection/components/organism/datetime-picker/datetime-picker.css +47 -0
- package/dist/collection/components/other_deprecated/old-input/old-input.css +47 -0
- package/dist/components/datetime-picker.js +1 -1
- package/dist/components/generate.js +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/old-input.js +1 -1
- package/dist/esm/bcm-accordion.entry.js +2 -2
- package/dist/esm/bcm-alert.entry.js +2 -2
- package/dist/esm/bcm-attendance.entry.js +2 -2
- package/dist/esm/bcm-avatar_2.entry.js +4 -5
- package/dist/esm/bcm-breadcrumb.entry.js +2 -2
- package/dist/esm/bcm-button-group.entry.js +2 -2
- package/dist/esm/{bcm-button_15.entry.js → bcm-button_18.entry.js} +1989 -20
- package/dist/esm/bcm-caption.entry.js +4 -5
- package/dist/esm/bcm-card.entry.js +2 -2
- package/dist/esm/bcm-checkbox-group.entry.js +2 -2
- package/dist/esm/bcm-checkbox-lite_9.entry.js +2 -2
- package/dist/esm/bcm-chip-group.entry.js +4 -5
- package/dist/esm/bcm-chip.entry.js +2 -2
- package/dist/esm/bcm-collapse.entry.js +2 -2
- package/dist/esm/bcm-color-input.entry.js +4 -5
- package/dist/esm/bcm-default.entry.js +2 -2
- package/dist/esm/bcm-drawer.entry.js +4 -5
- package/dist/esm/bcm-dropdown.entry.js +3 -3
- package/dist/esm/bcm-expansion-panel.entry.js +2 -2
- package/dist/esm/bcm-form-2.entry.js +2 -2
- package/dist/esm/bcm-input-custom.entry.js +2 -2
- package/dist/esm/bcm-input-dropdown.entry.js +4 -5
- package/dist/esm/bcm-item.entry.js +2 -2
- package/dist/esm/bcm-items.entry.js +2 -2
- package/dist/esm/bcm-menu.entry.js +5 -6
- package/dist/esm/bcm-modal-2-footer.entry.js +4 -5
- package/dist/esm/bcm-modal-2-header.entry.js +4 -5
- package/dist/esm/bcm-modal-2.entry.js +4 -5
- package/dist/esm/bcm-modal.entry.js +2 -2
- package/dist/esm/bcm-number-input.entry.js +4 -5
- package/dist/esm/bcm-popconfirm-box.entry.js +2 -2
- package/dist/esm/bcm-popconfirm.entry.js +2 -2
- package/dist/esm/bcm-popover.entry.js +4 -5
- package/dist/esm/bcm-progress.entry.js +2 -2
- package/dist/esm/bcm-radio-group.entry.js +4 -5
- package/dist/esm/bcm-radio.entry.js +4 -5
- package/dist/esm/bcm-range.entry.js +2 -2
- package/dist/esm/bcm-shortcut.entry.js +4 -5
- package/dist/esm/bcm-skeleton.entry.js +4 -5
- package/dist/esm/bcm-step.entry.js +3 -3
- package/dist/esm/bcm-stepper.entry.js +5 -6
- package/dist/esm/bcm-tab-group.entry.js +4 -5
- package/dist/esm/bcm-tab-item-header.entry.js +4 -5
- package/dist/esm/bcm-tab-item.entry.js +4 -5
- package/dist/esm/bcm-table.entry.js +4 -5
- package/dist/esm/bcm-tag.entry.js +3 -3
- package/dist/esm/bcm-textarea.entry.js +3 -3
- package/dist/esm/bcm-time-picker.entry.js +2 -2
- package/dist/esm/bcm-toast.entry.js +2 -2
- package/dist/esm/bromcom-ui.js +3 -3
- package/dist/esm/{generate-80f589b2.js → generate-c1065765.js} +1 -1
- package/dist/esm/{global-9afe304c.js → global-6365ce83.js} +1 -1
- package/dist/esm/{input-template-a5d07ba6.js → input-template-74229cd2.js} +1 -1
- package/dist/esm/{json-parse-decarator-5195f510.js → json-parse-decarator-a301c8b7.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{number-helper-aeb5881f.js → number-helper-d42f27d5.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +3 -3
- package/dist/esm/old-bcm-popover.entry.js +2 -2
- package/dist/esm/{package-5e39e390.js → package-5c7049c1.js} +1 -1
- package/dist/esm/{stepper-states-97a648ff.js → stepper-states-39645921.js} +1 -1
- package/dist/esm/{tooltip-helper-d339c58a.js → tooltip-helper-61f3e8cb.js} +3 -4
- package/dist/esm/{validators-b5e106d5.js → validators-3881959b.js} +6 -2
- package/package.json +1 -1
- package/dist/bromcom-ui/p-0fc73cca.entry.js +0 -5
- package/dist/bromcom-ui/p-175eb1c7.entry.js +0 -5
- package/dist/bromcom-ui/p-17c0a72a.entry.js +0 -5
- package/dist/bromcom-ui/p-1f5ca41b.entry.js +0 -5
- package/dist/bromcom-ui/p-21cb3cfe.entry.js +0 -5
- package/dist/bromcom-ui/p-23eb79ac.entry.js +0 -5
- package/dist/bromcom-ui/p-2d965b60.entry.js +0 -5
- package/dist/bromcom-ui/p-32d93221.entry.js +0 -21
- package/dist/bromcom-ui/p-33513345.entry.js +0 -5
- package/dist/bromcom-ui/p-3b5c36e8.entry.js +0 -5
- package/dist/bromcom-ui/p-40b85b9b.entry.js +0 -5
- package/dist/bromcom-ui/p-43a1f84c.entry.js +0 -5
- package/dist/bromcom-ui/p-52b7fc24.js +0 -5
- package/dist/bromcom-ui/p-56187d14.entry.js +0 -5
- package/dist/bromcom-ui/p-58d5775f.entry.js +0 -5
- package/dist/bromcom-ui/p-5b96272e.entry.js +0 -5
- package/dist/bromcom-ui/p-61314a43.js +0 -5
- package/dist/bromcom-ui/p-626a65e9.js +0 -5
- package/dist/bromcom-ui/p-64999c43.entry.js +0 -5
- package/dist/bromcom-ui/p-8c3a6509.entry.js +0 -5
- package/dist/bromcom-ui/p-8fbdb72f.entry.js +0 -5
- package/dist/bromcom-ui/p-910c935f.entry.js +0 -5
- package/dist/bromcom-ui/p-9f1e6daa.entry.js +0 -5
- package/dist/bromcom-ui/p-a889681e.entry.js +0 -5
- package/dist/bromcom-ui/p-cfd52d5f.entry.js +0 -5
- package/dist/bromcom-ui/p-e19a8e73.entry.js +0 -5
- package/dist/bromcom-ui/p-e6faa2bb.entry.js +0 -5
- package/dist/bromcom-ui/p-ecd8d70f.entry.js +0 -5
- package/dist/bromcom-ui/p-f2776268.entry.js +0 -5
- package/dist/bromcom-ui/p-f83b3048.js +0 -5
- package/dist/cjs/bcm-date-picker.cjs.entry.js +0 -182
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +0 -1450
- package/dist/cjs/bcm-old-input.cjs.entry.js +0 -397
- package/dist/cjs/datetime-helper-eaf4fadb.js +0 -11
- package/dist/esm/bcm-date-picker.entry.js +0 -178
- package/dist/esm/bcm-datetime-picker.entry.js +0 -1446
- package/dist/esm/bcm-old-input.entry.js +0 -393
- package/dist/esm/datetime-helper-df25808a.js +0 -9
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import { h as h$2, r as registerInstance, c as createEvent, H as Host, g as getElement, a as getAssetPath } from './index-0615c2b8.js';
|
|
6
|
-
import { s as snq, G as Generate } from './generate-
|
|
5
|
+
import { h as h$2, r as registerInstance, c as createEvent, H as Host, g as getElement, f as forceUpdate, a as getAssetPath } from './index-0615c2b8.js';
|
|
6
|
+
import { s as snq, G as Generate } from './generate-c1065765.js';
|
|
7
7
|
import { B as Bcm, a as Bcm$1 } from './bcm-0f9cc27c.js';
|
|
8
8
|
import { c as classnames } from './index-00c8a8f7.js';
|
|
9
9
|
import { c as createStore } from './index-7e71bbc8.js';
|
|
@@ -13,20 +13,19 @@ import { C as CaptionTemplate } from './caption-template-0c32ce16.js';
|
|
|
13
13
|
import { d as delay, p as pluralize, g as getChildElements } from './utils-57652744.js';
|
|
14
14
|
import { I as IsLoad } from './is-load-decorator-8277e3b8.js';
|
|
15
15
|
import { c as createCommonjsModule, a as commonjsGlobal, g as getAugmentedNamespace, b as getDefaultExportFromCjs } from './_commonjsHelpers-7002e5de.js';
|
|
16
|
-
import './
|
|
17
|
-
import { N as NumberHelper } from './number-helper-
|
|
16
|
+
import { D as DateTimeHelper, V as Validators } from './validators-3881959b.js';
|
|
17
|
+
import { N as NumberHelper } from './number-helper-d42f27d5.js';
|
|
18
18
|
import { S as StringHelper } from './string-helper-8f5da9ec.js';
|
|
19
|
-
import {
|
|
20
|
-
import './element-dragger-89bb52fd.js';
|
|
19
|
+
import { D as DragDirections, E as ElementDragger } from './element-dragger-89bb52fd.js';
|
|
21
20
|
import './types-6f06fa1a.js';
|
|
22
21
|
import './types-9493a7ed.js';
|
|
23
|
-
import {
|
|
22
|
+
import { g as getPlacement, s as setPosition } from './popover-placement-279ce860.js';
|
|
24
23
|
import { L as LabelTemplate } from './label-template-ad2e8119.js';
|
|
24
|
+
import { I as InputTemplate } from './input-template-74229cd2.js';
|
|
25
25
|
import { F as FloatingUI } from './floating-ui-a4e67246.js';
|
|
26
|
-
import { J as JsonParse } from './json-parse-decarator-
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import './package-5e39e390.js';
|
|
26
|
+
import { J as JsonParse } from './json-parse-decarator-a301c8b7.js';
|
|
27
|
+
import { T as Tooltip } from './tooltip-helper-61f3e8cb.js';
|
|
28
|
+
import './package-5c7049c1.js';
|
|
30
29
|
import './colors-ebea297f.js';
|
|
31
30
|
import './colors-1d7854ea.js';
|
|
32
31
|
|
|
@@ -381,7 +380,7 @@ BcmButton.style = buttonCss;
|
|
|
381
380
|
|
|
382
381
|
const checkboxCss = "@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}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}.bcm-checkbox{outline:none;border:none;--bcm-checkbox-primary-color-default:var(--bcm-new-ds-color-blue-500);--bcm-checkbox-secondary-color-default:var(--bcm-new-ds-color-white);--bcm-checkbox-primary-color-hover:var(--bcm-new-ds-color-blue-600);--bcm-checkbox-secondary-color-hover:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-focus-visible:var(--bcm-new-ds-color-blue-800);--bcm-checkbox-secondary-color-focus-visible:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-active:var(--bcm-new-ds-color-blue-700);--bcm-checkbox-secondary-color-active:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-disabled:var(--bcm-new-ds-color-slate-300);--bcm-checkbox-secondary-color-disabled:var(--bcm-new-ds-color-slate-200);display:inline-flex;width:fit-content;flex-direction:column;margin-bottom:8px}.bcm-checkbox:focus,.bcm-checkbox:hover,.bcm-checkbox:active{outline:none;border:none}.bcm-checkbox *{box-sizing:border-box}.bcm-checkbox input[type=radio],.bcm-checkbox input[type=checkbox]{-webkit-appearance:none;appearance:none;background-color:#fff;margin:0;display:none}.bcm-checkbox__input{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap;padding-top:4px}.bcm-checkbox.hidden{display:none}.bcm-checkbox :hover{cursor:pointer}.bcm-checkbox[disabled] :hover,.bcm-checkbox.disabled :hover{cursor:not-allowed}.bcm-checkbox .slot{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-weight:500;color:var(--bcm-new-ds-color-slate-600)}.bcm-checkbox .slot:not(:empty){margin-left:8px;margin-right:8px}.bcm-checkbox-size-small .slot{font-size:12px;line-height:calc(12px + 8px);margin-top:-2.5px}.bcm-checkbox-size-small .bcm-checkbox__input{min-height:calc(24px - 4px)}.bcm-checkbox-size-small .bcm-checkbox__label-icon{width:14px;height:14px;min-width:14px;font-size:calc(10px - 2px)}.bcm-checkbox-size-medium .slot{font-size:calc(12px + 1px);line-height:calc(12px + 8px);margin-top:-1.5px}.bcm-checkbox-size-medium .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-medium .bcm-checkbox__label-icon{width:16px;height:16px;min-width:16px;font-size:10px}.bcm-checkbox-size-large .slot{font-size:16px;line-height:calc(16px + 8px);margin-top:-1.5px}.bcm-checkbox-size-large .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-large .bcm-checkbox__label-icon{width:18px;height:18px;min-width:18px;font-size:12px}.bcm-checkbox__label{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap}.bcm-checkbox__label-icon{display:flex;flex-direction:column;align-items:center;justify-content:center;flex-wrap:nowrap;border-width:1px;border-style:solid;border-radius:2px}.bcm-checkbox__label-icon-indeterminate{position:relative}.bcm-checkbox__label-icon-indeterminate:after{content:\"\";display:block;position:absolute;width:70%;height:1.5px;background:var(--bcm-new-ds-color-white)}.bcm-checkbox__label-icon.bcm-radio__icon{width:16px;height:16px;box-sizing:border-box;border-radius:100px}.bcm-checkbox__label-icon.bcm-radio__icon .bcm-radio__icon-inner{width:10px;height:10px;border-radius:100px;background-color:var(--bcm-new-ds-color-white)}.bcm-checkbox .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-default);color:var(--bcm-checkbox-secondary-color-default);border-color:var(--bcm-new-ds-color-slate-300)}.bcm-checkbox .bcm-checkbox__label-icon-checked,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-default);border-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-default);background-color:var(--bcm-checkbox-secondary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox:hover .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-hover);color:var(--bcm-checkbox-secondary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-hover);background-color:var(--bcm-checkbox-secondary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-focus-visible);color:var(--bcm-checkbox-secondary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-focus-visible);background-color:var(--bcm-checkbox-secondary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:active .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-active);color:var(--bcm-checkbox-secondary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-active);background-color:var(--bcm-checkbox-secondary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-disabled);color:var(--bcm-checkbox-secondary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-disabled);background-color:var(--bcm-checkbox-secondary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[no-margin] .bcm-checkbox__input{margin:0;min-height:0;padding:0}";
|
|
383
382
|
|
|
384
|
-
var __decorate$
|
|
383
|
+
var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
385
384
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
386
385
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
387
386
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -533,7 +532,7 @@ const BcmCheckbox = class {
|
|
|
533
532
|
"checked": ["watchChecked"]
|
|
534
533
|
}; }
|
|
535
534
|
};
|
|
536
|
-
__decorate$
|
|
535
|
+
__decorate$8([
|
|
537
536
|
IsLoad()
|
|
538
537
|
], BcmCheckbox.prototype, "el", void 0);
|
|
539
538
|
BcmCheckbox.style = checkboxCss;
|
|
@@ -769,8 +768,8 @@ var Wc={},Yc=new Map,Zc=new Map,$c=["abort","abort",Xb,"animationEnd",Yb,"animat
|
|
|
769
768
|
"seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",$b,"transitionEnd","waiting","waiting"];function ad(a,b){for(var c=0;c<a.length;c+=2){var d=a[c],e=a[c+1],f="on"+(e[0].toUpperCase()+e.slice(1));f={phasedRegistrationNames:{bubbled:f,captured:f+"Capture"},dependencies:[d],eventPriority:b};Zc.set(d,b);Yc.set(d,f);Wc[e]=f;}}
|
|
770
769
|
ad("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0);
|
|
771
770
|
ad("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1);ad($c,2);for(var bd="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),cd=0;cd<bd.length;cd++)Zc.set(bd[cd],0);
|
|
772
|
-
var dd=scheduler.unstable_UserBlockingPriority,ed=scheduler.unstable_runWithPriority,fd=!0;function F$1(a,b){vc(b,a,!1);}function vc(a,b,c){var d=Zc.get(b);switch(void 0===d?2:d){case 0:d=gd.bind(null,b,1,a);break;case 1:d=hd.bind(null,b,1,a);break;default:d=id.bind(null,b,1,a);}c?a.addEventListener(b,d,!0):a.addEventListener(b,d,!1);}function gd(a,b,c,d){Ja||Ha();var e=id,f=Ja;Ja=!0;try{Ga(e,a,b,c,d);}finally{(Ja=f)||La();}}function hd(a,b,c,d){ed(dd,id.bind(null,a,b,c,d));}
|
|
773
|
-
function id(a,b,c,d){if(fd)if(0<Ac.length&&-1<Hc.indexOf(a))a=Kc(null,a,b,c,d),Ac.push(a);else {var e=Rc(a,b,c,d);if(null===e)Lc(a,d);else if(-1<Hc.indexOf(a))a=Kc(e,a,b,c,d),Ac.push(a);else if(!Oc(e,a,b,c,d)){Lc(a,d);a=rc(a,d,null,b);try{Ma(sc,a);}finally{qc(a);}}}}
|
|
771
|
+
var dd=scheduler.unstable_UserBlockingPriority,ed=scheduler.unstable_runWithPriority,fd=!0;function F$1(a,b){vc(b,a,!1);}function vc(a,b,c){var d=Zc.get(b);switch(void 0===d?2:d){case 0:d=gd.bind(null,b,1,a);break;case 1:d=hd.bind(null,b,1,a);break;default:d=id$1.bind(null,b,1,a);}c?a.addEventListener(b,d,!0):a.addEventListener(b,d,!1);}function gd(a,b,c,d){Ja||Ha();var e=id$1,f=Ja;Ja=!0;try{Ga(e,a,b,c,d);}finally{(Ja=f)||La();}}function hd(a,b,c,d){ed(dd,id$1.bind(null,a,b,c,d));}
|
|
772
|
+
function id$1(a,b,c,d){if(fd)if(0<Ac.length&&-1<Hc.indexOf(a))a=Kc(null,a,b,c,d),Ac.push(a);else {var e=Rc(a,b,c,d);if(null===e)Lc(a,d);else if(-1<Hc.indexOf(a))a=Kc(e,a,b,c,d),Ac.push(a);else if(!Oc(e,a,b,c,d)){Lc(a,d);a=rc(a,d,null,b);try{Ma(sc,a);}finally{qc(a);}}}}
|
|
774
773
|
function Rc(a,b,c,d){c=nc(d);c=tc(c);if(null!==c){var e=dc(c);if(null===e)c=null;else {var f=e.tag;if(13===f){c=ec(e);if(null!==c)return c;c=null;}else if(3===f){if(e.stateNode.hydrate)return 3===e.tag?e.stateNode.containerInfo:null;c=null;}else e!==c&&(c=null);}}a=rc(a,d,c,b);try{Ma(sc,a);}finally{qc(a);}return null}
|
|
775
774
|
var jd={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,
|
|
776
775
|
floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},kd=["Webkit","ms","Moz","O"];Object.keys(jd).forEach(function(a){kd.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);jd[b]=jd[a];});});function ld(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||jd.hasOwnProperty(a)&&jd[a]?(""+b).trim():b+"px"}
|
|
@@ -988,7 +987,7 @@ function gk(a){return !(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!
|
|
|
988
987
|
function ik(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f._internalRoot;if("function"===typeof e){var h=e;e=function(){var a=ck(g);h.call(a);};}bk(b,g,a,e);}else {f=c._reactRootContainer=hk(c,d);g=f._internalRoot;if("function"===typeof e){var k=e;e=function(){var a=ck(g);k.call(a);};}Nj(function(){bk(b,g,a,e);});}return ck(g)}function jk(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return {$$typeof:$a,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}}
|
|
989
988
|
wc=function(a){if(13===a.tag){var b=hg(Gg(),150,100);Ig(a,b);ek(a,b);}};xc=function(a){13===a.tag&&(Ig(a,3),ek(a,3));};yc=function(a){if(13===a.tag){var b=Gg();b=Hg(b,a,null);Ig(a,b);ek(a,b);}};
|
|
990
989
|
za=function(a,b,c){switch(b){case "input":Cb(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=Qd(d);if(!e)throw Error(u$1(90));yb(d);Cb(d,e);}}}break;case "textarea":Kb(a,c);break;case "select":b=c.value,null!=b&&Hb(a,!!c.multiple,b,!1);}};Fa=Mj;
|
|
991
|
-
Ga=function(a,b,c,d,e){var f=W$1;W$1|=4;try{return cg(98,a.bind(null,b,c,d,e))}finally{W$1=f,W$1===V$1&&gg();}};Ha=function(){(W$1&(1|fj|gj))===V$1&&(Lj(),Dj());};Ia=function(a,b){var c=W$1;W$1|=2;try{return a(b)}finally{W$1=c,W$1===V$1&&gg();}};function kk(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!gk(b))throw Error(u$1(200));return jk(a,b,null,c)}var lk={Events:[Nc,Pd,Qd,xa,ta,Xd,function(a){jc(a,Wd);},Da,Ea,id,mc,Dj,{current:!1}]};
|
|
990
|
+
Ga=function(a,b,c,d,e){var f=W$1;W$1|=4;try{return cg(98,a.bind(null,b,c,d,e))}finally{W$1=f,W$1===V$1&&gg();}};Ha=function(){(W$1&(1|fj|gj))===V$1&&(Lj(),Dj());};Ia=function(a,b){var c=W$1;W$1|=2;try{return a(b)}finally{W$1=c,W$1===V$1&&gg();}};function kk(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!gk(b))throw Error(u$1(200));return jk(a,b,null,c)}var lk={Events:[Nc,Pd,Qd,xa,ta,Xd,function(a){jc(a,Wd);},Da,Ea,id$1,mc,Dj,{current:!1}]};
|
|
992
991
|
(function(a){var b=a.findFiberByHostInstance;return Yj(objectAssign({},a,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Wa.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=hc(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))})({findFiberByHostInstance:tc,bundleType:0,version:"16.14.0",
|
|
993
992
|
rendererPackageName:"react-dom"});var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lk;var createPortal=kk;var findDOMNode$1=function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;if(void 0===b){if("function"===typeof a.render)throw Error(u$1(188));throw Error(u$1(268,Object.keys(a)));}a=hc(b);a=null===a?null:a.stateNode;return a};
|
|
994
993
|
var flushSync=function(a,b){if((W$1&(fj|gj))!==V$1)throw Error(u$1(187));var c=W$1;W$1|=1;try{return cg(99,a.bind(null,b))}finally{W$1=c,gg();}};var hydrate=function(a,b,c){if(!gk(b))throw Error(u$1(200));return ik(null,a,b,!0,c)};var render=function(a,b,c){if(!gk(b))throw Error(u$1(200));return ik(null,a,b,!1,c)};
|
|
@@ -23042,7 +23041,7 @@ const moment$1 = /*#__PURE__*/Object.freeze({
|
|
|
23042
23041
|
'default': hooks
|
|
23043
23042
|
});
|
|
23044
23043
|
|
|
23045
|
-
var __decorate$
|
|
23044
|
+
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
23046
23045
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
23047
23046
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
23048
23047
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -23190,10 +23189,1598 @@ const BcmDate = class {
|
|
|
23190
23189
|
}
|
|
23191
23190
|
get el() { return getElement(this); }
|
|
23192
23191
|
};
|
|
23193
|
-
__decorate$
|
|
23192
|
+
__decorate$7([
|
|
23194
23193
|
IsLoad()
|
|
23195
23194
|
], BcmDate.prototype, "el", void 0);
|
|
23196
23195
|
|
|
23196
|
+
const datePickerCss = "@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:inline-flex;width:100%;max-width:256px}:host(.full-width){max-width:100%}:host(.hidden){display:none}:host(.linked-component){display:none}";
|
|
23197
|
+
|
|
23198
|
+
var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
23199
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
23200
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
23201
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
23202
|
+
else
|
|
23203
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
23204
|
+
if (d = decorators[i])
|
|
23205
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
23206
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23207
|
+
};
|
|
23208
|
+
const BcmDatePicker = class {
|
|
23209
|
+
constructor(hostRef) {
|
|
23210
|
+
registerInstance(this, hostRef);
|
|
23211
|
+
this._id = Generate.UID();
|
|
23212
|
+
this.date = new Date();
|
|
23213
|
+
this.value = undefined;
|
|
23214
|
+
this.endDate = null;
|
|
23215
|
+
this.range = false;
|
|
23216
|
+
this.hidden = false;
|
|
23217
|
+
this.name = undefined;
|
|
23218
|
+
this.fullWidth = false;
|
|
23219
|
+
this.required = false;
|
|
23220
|
+
this.label = undefined;
|
|
23221
|
+
this.placeholder = undefined;
|
|
23222
|
+
this.disabledDates = '';
|
|
23223
|
+
this.disabled = false;
|
|
23224
|
+
this.noMargin = false;
|
|
23225
|
+
this.noCaption = false;
|
|
23226
|
+
this.caption = '';
|
|
23227
|
+
this.captionError = undefined;
|
|
23228
|
+
this.captionType = 'default';
|
|
23229
|
+
this.alignment = undefined;
|
|
23230
|
+
this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
23231
|
+
this.placement = Bcm.Placement['bottom-start'];
|
|
23232
|
+
this.linkedComponent = undefined;
|
|
23233
|
+
this.clearable = false;
|
|
23234
|
+
this.stateStartDate = null;
|
|
23235
|
+
this.stateEndDate = null;
|
|
23236
|
+
}
|
|
23237
|
+
handleStartDateChange() {
|
|
23238
|
+
this.handleDate();
|
|
23239
|
+
}
|
|
23240
|
+
handleEndDateChange() {
|
|
23241
|
+
this.handleDate();
|
|
23242
|
+
}
|
|
23243
|
+
/**
|
|
23244
|
+
* @desc
|
|
23245
|
+
*/
|
|
23246
|
+
handlePickerLoad() {
|
|
23247
|
+
this.value = this.picker.value;
|
|
23248
|
+
}
|
|
23249
|
+
/**
|
|
23250
|
+
* @desc
|
|
23251
|
+
* @param event
|
|
23252
|
+
*/
|
|
23253
|
+
handlePickerChange(event) {
|
|
23254
|
+
this.value = event.detail;
|
|
23255
|
+
}
|
|
23256
|
+
/**
|
|
23257
|
+
* @desc
|
|
23258
|
+
* @param value
|
|
23259
|
+
*/
|
|
23260
|
+
async set(value) {
|
|
23261
|
+
return this.picker.set(value);
|
|
23262
|
+
}
|
|
23263
|
+
async get() {
|
|
23264
|
+
var _a;
|
|
23265
|
+
return ((_a = this.value) === null || _a === void 0 ? void 0 : _a.timestamp) || null;
|
|
23266
|
+
}
|
|
23267
|
+
/**
|
|
23268
|
+
* @desc
|
|
23269
|
+
* @param disabled
|
|
23270
|
+
*/
|
|
23271
|
+
async setDisabled(disabled) {
|
|
23272
|
+
this.disabled = disabled;
|
|
23273
|
+
}
|
|
23274
|
+
async setClear() {
|
|
23275
|
+
await this.picker.setClear();
|
|
23276
|
+
await delay(10);
|
|
23277
|
+
return Promise.resolve();
|
|
23278
|
+
}
|
|
23279
|
+
async setStartDate(dateOrTime) {
|
|
23280
|
+
if (dateOrTime) {
|
|
23281
|
+
dateOrTime = DateTimeHelper.convertTimeStampToDate(new Date(dateOrTime).getTime());
|
|
23282
|
+
this.stateStartDate = dateOrTime;
|
|
23283
|
+
}
|
|
23284
|
+
else {
|
|
23285
|
+
this.setClear();
|
|
23286
|
+
}
|
|
23287
|
+
}
|
|
23288
|
+
async setEndDate(dateOrTime) {
|
|
23289
|
+
if (dateOrTime) {
|
|
23290
|
+
dateOrTime = DateTimeHelper.convertTimeStampToDate(new Date(dateOrTime).getTime());
|
|
23291
|
+
this.stateEndDate = dateOrTime;
|
|
23292
|
+
}
|
|
23293
|
+
else {
|
|
23294
|
+
this.setClear();
|
|
23295
|
+
}
|
|
23296
|
+
}
|
|
23297
|
+
/* mp --- */
|
|
23298
|
+
handleDate() {
|
|
23299
|
+
if (this.range) {
|
|
23300
|
+
if (this.stateStartDate && this.stateEndDate) {
|
|
23301
|
+
this.set(this.stateStartDate + '-' + this.stateEndDate);
|
|
23302
|
+
}
|
|
23303
|
+
}
|
|
23304
|
+
else {
|
|
23305
|
+
this.set(this.stateStartDate);
|
|
23306
|
+
}
|
|
23307
|
+
}
|
|
23308
|
+
/**
|
|
23309
|
+
* @desc
|
|
23310
|
+
*/
|
|
23311
|
+
async getInput() {
|
|
23312
|
+
return await this.picker.getInput();
|
|
23313
|
+
}
|
|
23314
|
+
/**
|
|
23315
|
+
* @desc
|
|
23316
|
+
*/
|
|
23317
|
+
async open() {
|
|
23318
|
+
return await this.picker.open();
|
|
23319
|
+
}
|
|
23320
|
+
/**
|
|
23321
|
+
* @desc
|
|
23322
|
+
*/
|
|
23323
|
+
async getValue() {
|
|
23324
|
+
return this.value;
|
|
23325
|
+
}
|
|
23326
|
+
/**
|
|
23327
|
+
* @desc
|
|
23328
|
+
*/
|
|
23329
|
+
async isValid() {
|
|
23330
|
+
return await this.picker.isValid();
|
|
23331
|
+
}
|
|
23332
|
+
async resetCaption() {
|
|
23333
|
+
await delay(10);
|
|
23334
|
+
await this.picker.resetCaption();
|
|
23335
|
+
this.captionType = 'default';
|
|
23336
|
+
this.captionError = null;
|
|
23337
|
+
await delay(10);
|
|
23338
|
+
return Promise.resolve();
|
|
23339
|
+
}
|
|
23340
|
+
render() {
|
|
23341
|
+
const hostClasses = classnames(this.hidden ? 'hidden' : null, {
|
|
23342
|
+
'full-width': this.fullWidth,
|
|
23343
|
+
'linked-component': this.linkedComponent,
|
|
23344
|
+
});
|
|
23345
|
+
return (h$2(Host, { class: hostClasses }, h$2("bcm-datetime-picker", { "linked-component": this.linkedComponent, id: this._id, name: this.name, type: this.range ? 'range' : 'date', date: this.date, placeholder: this.placeholder, fullWidth: this.fullWidth, ref: el => (this.picker = el), required: this.required, clearable: this.clearable, label: this.label, "end-date": this.endDate, disabled: this.disabled, disabledDates: this.disabledDates, "on-bcm-load": () => this.handlePickerLoad(), "on-bcm-change": (e) => this.handlePickerChange(e), noCaption: this.noCaption, caption: this.caption, captionError: this.captionError, captionType: this.captionType, alignment: this.alignment, placement: this.placement, noMargin: this.noMargin })));
|
|
23346
|
+
}
|
|
23347
|
+
get el() { return getElement(this); }
|
|
23348
|
+
static get watchers() { return {
|
|
23349
|
+
"stateStartDate": ["handleStartDateChange"],
|
|
23350
|
+
"stateEndDate": ["handleEndDateChange"]
|
|
23351
|
+
}; }
|
|
23352
|
+
};
|
|
23353
|
+
__decorate$6([
|
|
23354
|
+
IsLoad()
|
|
23355
|
+
], BcmDatePicker.prototype, "el", void 0);
|
|
23356
|
+
BcmDatePicker.style = datePickerCss;
|
|
23357
|
+
|
|
23358
|
+
var Months;
|
|
23359
|
+
(function (Months) {
|
|
23360
|
+
Months["january"] = "january";
|
|
23361
|
+
Months["february"] = "february";
|
|
23362
|
+
Months["march"] = "march";
|
|
23363
|
+
Months["april"] = "april";
|
|
23364
|
+
Months["may"] = "may";
|
|
23365
|
+
Months["june"] = "june";
|
|
23366
|
+
Months["july"] = "july";
|
|
23367
|
+
Months["august"] = "august";
|
|
23368
|
+
Months["september"] = "september";
|
|
23369
|
+
Months["october"] = "october";
|
|
23370
|
+
Months["november"] = "november";
|
|
23371
|
+
Months["december"] = "december";
|
|
23372
|
+
})(Months || (Months = {}));
|
|
23373
|
+
var Days;
|
|
23374
|
+
(function (Days) {
|
|
23375
|
+
Days["sunday"] = "sunday";
|
|
23376
|
+
Days["monday"] = "monday";
|
|
23377
|
+
Days["tuesday"] = "tuesday";
|
|
23378
|
+
Days["wednesday"] = "wednesday";
|
|
23379
|
+
Days["thursday"] = "thursday";
|
|
23380
|
+
Days["friday"] = "friday";
|
|
23381
|
+
Days["saturday"] = "saturday";
|
|
23382
|
+
})(Days || (Days = {}));
|
|
23383
|
+
/**
|
|
23384
|
+
* 'type' prop predefined values
|
|
23385
|
+
*/
|
|
23386
|
+
var Types;
|
|
23387
|
+
(function (Types) {
|
|
23388
|
+
Types["datetime"] = "datetime";
|
|
23389
|
+
Types["range"] = "range";
|
|
23390
|
+
Types["date"] = "date";
|
|
23391
|
+
Types["time"] = "time";
|
|
23392
|
+
})(Types || (Types = {}));
|
|
23393
|
+
|
|
23394
|
+
const datetimePickerCss = "@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}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}:host{display:inline-flex;flex-direction:column;position:relative;width:100%;max-width:256px;margin:0;margin-bottom:8px}:host(.full-width){max-width:100%}:host(.no-margin){margin:0}:host(.hidden){display:none}:host(.linked-component){display:none}.toggle{cursor:pointer}.toggle.disabled{cursor:not-allowed}.modules{display:flex}.picker-label{user-select:none;line-height:1}.datetime-picker{position:absolute;top:-1000px;display:inline-flex;flex-direction:column;box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);opacity:0;visibility:hidden;transition:transform 0.2s ease, opacity 0.3s ease;transform:scale(0.8) translateY(-100px);background-color:#ffffff;min-height:356px;max-height:356px;box-sizing:border-box;z-index:-1000}.datetime-picker.alignment-left{left:0}.datetime-picker.alignment-right{right:0}.datetime-picker.open{top:calc(100% - 28px);z-index:10000;opacity:1;visibility:visible;transform:scale(1) translateY(0)}.datetime-picker.open.no-caption{top:100%}.actions{display:flex;align-items:center;justify-content:space-between;padding:8px;margin-top:auto;border-top:1px solid var(--bcm-color-grey-6)}.actions .current-date{font-size:14px;line-height:22px;color:var(--bcm-color-prime-blue-6);text-transform:capitalize}.date-container+.time-container{border-left:1px solid #cecece}.time-container{width:185px}.time-container .bcm-datetime-picker__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-height:60px;border-bottom:1px solid var(--bcm-color-grey-4)}.time-container .bcm-datetime-picker__header .now{font-size:14px;line-height:22px;cursor:pointer;color:var(--bcm-color-prime-blue-6);user-select:none}.time-container .bcm-datetime-picker__content{position:relative;display:flex}.time-container .hours,.time-container .minutes,.time-container .time-period{position:relative;flex:1 1 100%;max-width:100%;height:280px;overflow:hidden}.time-container .hours .items>span,.time-container .minutes .items>span,.time-container .time-period .items>span{font-size:14px;color:var(--bcm-color-grey-8)}.time-container .hours .items>span.selected,.time-container .minutes .items>span.selected,.time-container .time-period .items>span.selected{color:var(--bcm-color-prime-blue-6)}.date-container{width:364px;}.date-container .bcm-datetime-picker__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-height:60px;border-bottom:1px solid var(--bcm-color-grey-4)}.date-container .bcm-datetime-picker__header .month-year-wrapper{display:flex;align-items:center;justify-content:center;margin:0 4px;min-width:125px}.date-container .bcm-datetime-picker__header .month-year{font-size:16px;line-height:24px}.date-container .bcm-datetime-picker__header .month-year{display:flex;align-items:center}.date-container .bcm-datetime-picker__header .month-year button{display:flex;align-items:center;box-shadow:none;background:transparent;outline:none;appearance:none;border:none;color:var(--bcm-color-prime-blue-6);cursor:pointer}.date-container .bcm-datetime-picker__header .month{text-transform:capitalize}.date-container .bcm-datetime-picker__header .year{padding-left:4px}.date-container .bcm-datetime-picker__header .today{font-size:14px;line-height:22px;cursor:pointer;color:var(--bcm-color-prime-blue-6);user-select:none}.date-container .bcm-datetime-picker__content{display:flex}.date-container .years{position:relative;flex:0 0 70px;max-width:70px;height:280px;overflow:hidden;background-color:var(--bcm-color-grey-2)}.date-container .days{width:100%}.date-container .day-numbers,.date-container .day-labels{display:grid;grid-template-columns:repeat(7, 1fr)}.date-container .day-numbers{padding:24px 24px}.date-container .day-numbers>span,.date-container .day-labels span{text-align:center}.date-container .day-numbers>span{position:relative;padding-bottom:100%;cursor:pointer}.date-container .day-numbers>span.not-this-month{color:var(--bcm-color-grey-4)}.date-container .day-numbers>span.is-weekend{color:var(--bcm-color-prime-blue-3)}.date-container .day-numbers>span.is-disabled-date:not(.today){color:var(--bcm-color-grey-4);cursor:not-allowed}.date-container .day-numbers>span.is-disabled-date:not(.today):before{opacity:0 !important}.date-container .day-numbers>span.today{color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.today:before{opacity:1;background-color:var(--bcm-color-prime-blue-2);border:1px solid var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.selected-start{background:linear-gradient(90deg, white 50%, #8abde2 50%) !important}.date-container .day-numbers>span.selected-end{background:linear-gradient(90deg, #8abde2 50%, white 50%) !important}.date-container .day-numbers>span.range{background:#8abde2}.date-container .day-numbers>span.range:not(.today){color:#ffffff}.date-container .day-numbers>span.range:not(.today):before{background-color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.range.is-weekend:not(.today){color:var(--bcm-color-prime-blue-2)}.date-container .day-numbers>span.selected,.date-container .day-numbers>span.selected-end{color:#ffffff}.date-container .day-numbers>span.selected:before,.date-container .day-numbers>span.selected-end:before{opacity:1;background-color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers.start-1>span:first-child{grid-column:1}.date-container .day-numbers.start-2>span:first-child{grid-column:2}.date-container .day-numbers.start-3>span:first-child{grid-column:3}.date-container .day-numbers.start-4>span:first-child{grid-column:4}.date-container .day-numbers.start-5>span:first-child{grid-column:5}.date-container .day-numbers.start-6>span:first-child{grid-column:6}.date-container .day-numbers.start-7>span:first-child{grid-column:7}.date-container .day-numbers>span:before{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;background-color:var(--bcm-color-grey-4);opacity:0;box-sizing:border-box}.date-container .day-numbers>span:hover.not-this-month:not(.is-weekend){color:var(--bcm-color-grey-6)}.date-container .day-numbers>span:hover:before{opacity:1}.date-container .day-numbers .number{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.date-container .day-labels{padding:24px 40px 0 40px}.date-container .day-labels span{font-size:12px;color:var(--bcm-color-grey-6)}.date-container .day-labels span:nth-child(7n+6),.date-container .day-labels span:nth-child(7n+7){color:var(--bcm-color-prime-blue-3)}.years .items,.hours .items,.minutes .items,.time-period .items{position:relative;display:flex;flex-direction:column;z-index:0;transform:translateY(0);scroll-behavior:smooth}.years .items>span,.hours .items>span,.minutes .items>span,.time-period .items>span{text-align:center;font-size:12px;min-height:26px;max-height:26px;line-height:26px;color:var(--bcm-color-grey-8);user-select:none}.years:before,.years:after,.hours:before,.hours:after,.minutes:before,.minutes:after,.time-period:before,.time-period:after{content:\"\";position:absolute;left:0;width:100%;height:40px}.years:before,.hours:before,.minutes:before,.time-period:before{top:-40px;box-shadow:0 10px 100px 70px #ffffff;z-index:1}.years:after,.hours:after,.minutes:after,.time-period:after{bottom:-40px;box-shadow:0 -10px 100px 70px #ffffff;z-index:2}.select-strip{position:absolute;width:100%;top:50%;left:0;transform:translateY(-50%);min-height:26px;max-height:26px;border:1px solid var(--bcm-color-grey-5);border-left:0;border-right:0;pointer-events:none;box-sizing:border-box}.bcm-label{font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-bottom:4px;font-weight:500;color:#475569}.bcm-label.tw-text-1{font-size:10px;line-height:18px}.bcm-label.tw-text-2{font-size:12px;line-height:20px}.bcm-label.tw-text-3{font-size:14px;line-height:22px}.bcm-caption-area{color:#dc2626;font-weight:400;justify-content:space-between;align-items:flex-start;flex-direction:row;min-height:20px;display:flex;margin-top:4px;font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.bcm-caption-area.tw-text-1{font-size:10px;line-height:18px}.bcm-caption-area.tw-text-2{font-size:12px;line-height:20px}.bcm-caption-area.tw-text-3{font-size:14px;line-height:22px}.picker-input-container{display:flex;flex-direction:column;align-items:flex-start;justify-content:stretch}";
|
|
23395
|
+
|
|
23396
|
+
var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
23397
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
23398
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
23399
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
23400
|
+
else
|
|
23401
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
23402
|
+
if (d = decorators[i])
|
|
23403
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
23404
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23405
|
+
};
|
|
23406
|
+
const stringify = JSON.stringify;
|
|
23407
|
+
const BcmDatetimePicker = class {
|
|
23408
|
+
constructor(hostRef) {
|
|
23409
|
+
registerInstance(this, hostRef);
|
|
23410
|
+
this.load = createEvent(this, "bcm-load", 7);
|
|
23411
|
+
this.change = createEvent(this, "bcm-change", 7);
|
|
23412
|
+
this.bcmOpen = createEvent(this, "bcm-open", 7);
|
|
23413
|
+
this.inputId = null;
|
|
23414
|
+
this.emptyState = false;
|
|
23415
|
+
this.initialized = false;
|
|
23416
|
+
this.disabledDatesList = { min: null, max: null, dates: [] };
|
|
23417
|
+
this.dayNumbers = [];
|
|
23418
|
+
this.valueText = null;
|
|
23419
|
+
this.dataIsValid = false;
|
|
23420
|
+
this._id = Generate.UID();
|
|
23421
|
+
this.date = new Date();
|
|
23422
|
+
this.endDate = null;
|
|
23423
|
+
this.type = Types.datetime;
|
|
23424
|
+
this.disabled = false;
|
|
23425
|
+
this.disabledDates = '';
|
|
23426
|
+
this.value = null;
|
|
23427
|
+
this._open = false;
|
|
23428
|
+
this.hidden = false;
|
|
23429
|
+
this.name = undefined;
|
|
23430
|
+
this.fullWidth = false;
|
|
23431
|
+
this.required = false;
|
|
23432
|
+
this.label = undefined;
|
|
23433
|
+
this.placeholder = undefined;
|
|
23434
|
+
this.minYear = 1900;
|
|
23435
|
+
this.maxYear = 2200;
|
|
23436
|
+
this.noCaption = false;
|
|
23437
|
+
this.noMargin = false;
|
|
23438
|
+
this.captionError = undefined;
|
|
23439
|
+
this.caption = '';
|
|
23440
|
+
this.captionType = 'default';
|
|
23441
|
+
this.alignment = undefined;
|
|
23442
|
+
this.placement = Bcm.Placement['bottom-start'];
|
|
23443
|
+
this.linkedComponent = undefined;
|
|
23444
|
+
this.clearable = false;
|
|
23445
|
+
this.years = [];
|
|
23446
|
+
this.hours = [];
|
|
23447
|
+
this.minutes = [];
|
|
23448
|
+
this.hasDateModule = false;
|
|
23449
|
+
this.hasTimeModule = false;
|
|
23450
|
+
this.renderDate = undefined;
|
|
23451
|
+
this.selectedDate = undefined;
|
|
23452
|
+
this.selectedEndDate = undefined;
|
|
23453
|
+
this.error = false;
|
|
23454
|
+
this.errorText = '';
|
|
23455
|
+
this.tick = {};
|
|
23456
|
+
}
|
|
23457
|
+
markForCheck() {
|
|
23458
|
+
this.tick = Generate.UID();
|
|
23459
|
+
}
|
|
23460
|
+
openChanged() {
|
|
23461
|
+
this.bcmOpen.emit(this._open);
|
|
23462
|
+
}
|
|
23463
|
+
/**
|
|
23464
|
+
* @ComponentMethod
|
|
23465
|
+
*/
|
|
23466
|
+
componentWillLoad() {
|
|
23467
|
+
this.inputId = 'picker-input-' + this._id;
|
|
23468
|
+
this.hasDateModule = this.type === Types.datetime
|
|
23469
|
+
|| this.type === Types.date
|
|
23470
|
+
|| this.type === Types.range;
|
|
23471
|
+
this.hasTimeModule = this.type === Types.datetime
|
|
23472
|
+
|| this.type === Types.time;
|
|
23473
|
+
this.prepareDisabledDates();
|
|
23474
|
+
this.setData();
|
|
23475
|
+
// Generate year, hour, minute sequences
|
|
23476
|
+
// #
|
|
23477
|
+
if (!this.initialized) {
|
|
23478
|
+
for (let i = this.minYear; i <= this.maxYear; i++)
|
|
23479
|
+
this.years.push(i);
|
|
23480
|
+
for (let i = 0; i <= 23; i++)
|
|
23481
|
+
this.hours.push(i);
|
|
23482
|
+
for (let i = 0; i <= 59; i++)
|
|
23483
|
+
this.minutes.push(i);
|
|
23484
|
+
this.load.emit();
|
|
23485
|
+
}
|
|
23486
|
+
this.initialized = true;
|
|
23487
|
+
}
|
|
23488
|
+
/**
|
|
23489
|
+
* @ComponentMethod
|
|
23490
|
+
*/
|
|
23491
|
+
componentDidRender() {
|
|
23492
|
+
// Create years selection
|
|
23493
|
+
// #
|
|
23494
|
+
if (this.hasDateModule && !this.yearsDragger) {
|
|
23495
|
+
this.createDragSelection('years', this.yearsElement, this.yearsWrapperElement, this.yearsStripElement, DragDirections.y);
|
|
23496
|
+
this.createWheelChange('years', this.yearsWrapperElement, this.yearsStripElement);
|
|
23497
|
+
this.setDragSelection('years', this.currentDate.year);
|
|
23498
|
+
}
|
|
23499
|
+
// Create hours selection
|
|
23500
|
+
// #
|
|
23501
|
+
if (this.hasTimeModule && !this.hoursDragger) {
|
|
23502
|
+
this.createDragSelection('hours', this.hoursElement, this.hoursWrapperElement, this.timeStripElement, DragDirections.y);
|
|
23503
|
+
this.createWheelChange('hours', this.hoursWrapperElement, this.timeStripElement);
|
|
23504
|
+
this.setDragSelection('hours', this.currentDate.hour);
|
|
23505
|
+
}
|
|
23506
|
+
// Create minutes selection
|
|
23507
|
+
// #
|
|
23508
|
+
if (this.hasTimeModule && !this.minutesDragger) {
|
|
23509
|
+
this.createDragSelection('minutes', this.minutesElement, this.minutesWrapperElement, this.timeStripElement, DragDirections.y);
|
|
23510
|
+
this.createWheelChange('minutes', this.minutesWrapperElement, this.timeStripElement);
|
|
23511
|
+
this.setDragSelection('minutes', this.currentDate.minute);
|
|
23512
|
+
}
|
|
23513
|
+
}
|
|
23514
|
+
/**
|
|
23515
|
+
* @desc
|
|
23516
|
+
* @param newValue
|
|
23517
|
+
*/
|
|
23518
|
+
renderDateChange() {
|
|
23519
|
+
if (!this.initialized)
|
|
23520
|
+
return;
|
|
23521
|
+
this.setData();
|
|
23522
|
+
this.hasDateModule && this.setDragSelection('years', this.currentDate.year);
|
|
23523
|
+
}
|
|
23524
|
+
/**
|
|
23525
|
+
* @desc
|
|
23526
|
+
* @param newValue
|
|
23527
|
+
*/
|
|
23528
|
+
openChange(newValue) {
|
|
23529
|
+
if (newValue) {
|
|
23530
|
+
this.calculateLocation();
|
|
23531
|
+
// Create years selection
|
|
23532
|
+
// #
|
|
23533
|
+
if (this.hasDateModule) {
|
|
23534
|
+
this.createDragSelection('years', this.yearsElement, this.yearsWrapperElement, this.yearsStripElement, DragDirections.y);
|
|
23535
|
+
this.createWheelChange('years', this.yearsWrapperElement, this.yearsStripElement);
|
|
23536
|
+
this.setDragSelection('years', this.currentDate.year);
|
|
23537
|
+
}
|
|
23538
|
+
// Create hours selection
|
|
23539
|
+
// #
|
|
23540
|
+
if (this.hasTimeModule) {
|
|
23541
|
+
this.createDragSelection('hours', this.hoursElement, this.hoursWrapperElement, this.timeStripElement, DragDirections.y);
|
|
23542
|
+
this.createWheelChange('hours', this.hoursWrapperElement, this.timeStripElement);
|
|
23543
|
+
this.setDragSelection('hours', this.currentDate.hour, true);
|
|
23544
|
+
}
|
|
23545
|
+
// Create minutes selection
|
|
23546
|
+
// #
|
|
23547
|
+
if (this.hasTimeModule) {
|
|
23548
|
+
this.createDragSelection('minutes', this.minutesElement, this.minutesWrapperElement, this.timeStripElement, DragDirections.y);
|
|
23549
|
+
this.createWheelChange('minutes', this.minutesWrapperElement, this.timeStripElement);
|
|
23550
|
+
this.setDragSelection('minutes', this.currentDate.minute, true);
|
|
23551
|
+
}
|
|
23552
|
+
this.markForCheck();
|
|
23553
|
+
forceUpdate(this.el);
|
|
23554
|
+
}
|
|
23555
|
+
}
|
|
23556
|
+
/**
|
|
23557
|
+
* @desc
|
|
23558
|
+
* @param newValue
|
|
23559
|
+
*/
|
|
23560
|
+
valueChange(newValue, oldValue) {
|
|
23561
|
+
const errorObject1 = { isValid: false, value: this.valueText };
|
|
23562
|
+
const errorObject2 = { isValid: false, value: this.inputElement.value };
|
|
23563
|
+
if (!newValue) {
|
|
23564
|
+
this.change.emit();
|
|
23565
|
+
return;
|
|
23566
|
+
}
|
|
23567
|
+
if (this.type !== Types.range && this.error) {
|
|
23568
|
+
this.change.emit(errorObject2);
|
|
23569
|
+
return;
|
|
23570
|
+
}
|
|
23571
|
+
try {
|
|
23572
|
+
if ((oldValue && stringify(newValue.dateObject) !== stringify(oldValue.dateObject)) || (!oldValue && newValue)) {
|
|
23573
|
+
if (this.type === Types.date || this.type === Types.datetime) {
|
|
23574
|
+
this.change.emit(newValue);
|
|
23575
|
+
}
|
|
23576
|
+
if (this.type === Types.time) {
|
|
23577
|
+
this.change.emit(newValue);
|
|
23578
|
+
// this.change.emit({
|
|
23579
|
+
// time: newValue.time,
|
|
23580
|
+
// timeObject: newValue.dateObject
|
|
23581
|
+
// })
|
|
23582
|
+
}
|
|
23583
|
+
if (this.type === Types.range) {
|
|
23584
|
+
const dateObject = newValue.dateObject;
|
|
23585
|
+
if (dateObject.start.date && dateObject.end.date) {
|
|
23586
|
+
if (newValue.isValid) {
|
|
23587
|
+
this.change.emit({
|
|
23588
|
+
isValid: newValue.isValid,
|
|
23589
|
+
value: newValue.value,
|
|
23590
|
+
start: dateObject.start,
|
|
23591
|
+
end: dateObject.end
|
|
23592
|
+
});
|
|
23593
|
+
}
|
|
23594
|
+
}
|
|
23595
|
+
else {
|
|
23596
|
+
this.change.emit(errorObject1);
|
|
23597
|
+
}
|
|
23598
|
+
}
|
|
23599
|
+
}
|
|
23600
|
+
}
|
|
23601
|
+
catch (exception) { }
|
|
23602
|
+
}
|
|
23603
|
+
/**
|
|
23604
|
+
* @desc
|
|
23605
|
+
* @param newValue -
|
|
23606
|
+
*/
|
|
23607
|
+
disabledDatesChange(newValue) {
|
|
23608
|
+
if (newValue) {
|
|
23609
|
+
this.prepareDisabledDates();
|
|
23610
|
+
}
|
|
23611
|
+
}
|
|
23612
|
+
/**
|
|
23613
|
+
* @desc
|
|
23614
|
+
* @param date
|
|
23615
|
+
*/
|
|
23616
|
+
stringToDate(date) {
|
|
23617
|
+
const isDate = !!date.getMonth;
|
|
23618
|
+
if (!isDate) {
|
|
23619
|
+
return new Date(Date.parse(this.switchDDMM(date)));
|
|
23620
|
+
}
|
|
23621
|
+
return date;
|
|
23622
|
+
}
|
|
23623
|
+
/**
|
|
23624
|
+
* @desc
|
|
23625
|
+
* @param date
|
|
23626
|
+
*/
|
|
23627
|
+
dateToString(date) {
|
|
23628
|
+
if (!(date instanceof Date))
|
|
23629
|
+
return false;
|
|
23630
|
+
}
|
|
23631
|
+
/**
|
|
23632
|
+
*
|
|
23633
|
+
* @param str
|
|
23634
|
+
*/
|
|
23635
|
+
switchDDMM(str) {
|
|
23636
|
+
if (!str)
|
|
23637
|
+
return;
|
|
23638
|
+
const parts = str.split('/');
|
|
23639
|
+
if (str.indexOf('/') === -1 || parts.length !== 3)
|
|
23640
|
+
return str;
|
|
23641
|
+
return `${parts[1]}/${parts[0]}/${parts[2]}`;
|
|
23642
|
+
}
|
|
23643
|
+
/**
|
|
23644
|
+
* @desc
|
|
23645
|
+
*/
|
|
23646
|
+
setData() {
|
|
23647
|
+
this.date = this.stringToDate(this.date);
|
|
23648
|
+
if (!this.initialized && !this.renderDate) {
|
|
23649
|
+
this.renderDate = this.date && this.date || new Date();
|
|
23650
|
+
}
|
|
23651
|
+
if (!this.initialized && this.endDate) {
|
|
23652
|
+
this.selectedEndDate = this.stringToDate(this.endDate);
|
|
23653
|
+
//this.currentEndDate = this.createDateObject(this.selectedEndDate)
|
|
23654
|
+
}
|
|
23655
|
+
const date = this.renderDate;
|
|
23656
|
+
this.currentDate = this.createDateObject(date);
|
|
23657
|
+
// Calculate days in current
|
|
23658
|
+
// month
|
|
23659
|
+
this.dayNumbers = this.getMonthDayNumbers(date).map(day => {
|
|
23660
|
+
return {
|
|
23661
|
+
day,
|
|
23662
|
+
thisMonth: true,
|
|
23663
|
+
isWeekend: this.getDayIsWeekend(date, day),
|
|
23664
|
+
today: this.getIsCurrentDate(date, day),
|
|
23665
|
+
date: this.getTargetDayDate(date, day)
|
|
23666
|
+
};
|
|
23667
|
+
});
|
|
23668
|
+
// Add prev month days to
|
|
23669
|
+
// empty columns
|
|
23670
|
+
if (this.currentDate.year > this.minYear) {
|
|
23671
|
+
let targetMonth = new Date(new Date(date).setMonth(this.currentDate.month - 1, 1));
|
|
23672
|
+
let targetMonthDayNumbers = this.getMonthDayNumbers(targetMonth).reverse();
|
|
23673
|
+
let max = this.currentDate.monthFirstDay;
|
|
23674
|
+
for (let i = 1; i < (max === 0 ? 7 : max); i++) {
|
|
23675
|
+
const day = targetMonthDayNumbers[i - 1];
|
|
23676
|
+
this.dayNumbers.unshift({
|
|
23677
|
+
day,
|
|
23678
|
+
prevMonth: true,
|
|
23679
|
+
isWeekend: this.getDayIsWeekend(targetMonth, day),
|
|
23680
|
+
date: this.getTargetDayDate(targetMonth, day)
|
|
23681
|
+
});
|
|
23682
|
+
}
|
|
23683
|
+
}
|
|
23684
|
+
// Add next month days to
|
|
23685
|
+
// rest of columns
|
|
23686
|
+
if (this.currentDate.year < this.maxYear) {
|
|
23687
|
+
let targetMonth = new Date(new Date(date).setMonth(this.currentDate.month + 1));
|
|
23688
|
+
let targetMonthDayNumbers = this.getMonthDayNumbers(targetMonth);
|
|
23689
|
+
let max = 42 - this.dayNumbers.length;
|
|
23690
|
+
for (let i = 0; i < max; i++) {
|
|
23691
|
+
const day = targetMonthDayNumbers[i];
|
|
23692
|
+
this.dayNumbers.push({
|
|
23693
|
+
day,
|
|
23694
|
+
nextMonth: true,
|
|
23695
|
+
isWeekend: this.getDayIsWeekend(targetMonth, day),
|
|
23696
|
+
date: this.getTargetDayDate(targetMonth, day)
|
|
23697
|
+
});
|
|
23698
|
+
}
|
|
23699
|
+
}
|
|
23700
|
+
if (!this.emptyState) {
|
|
23701
|
+
this.valueText = this.getValueText();
|
|
23702
|
+
}
|
|
23703
|
+
forceUpdate(this.el);
|
|
23704
|
+
}
|
|
23705
|
+
/**
|
|
23706
|
+
* @desc
|
|
23707
|
+
*/
|
|
23708
|
+
prepareDisabledDates() {
|
|
23709
|
+
if (!this.disabledDates)
|
|
23710
|
+
return;
|
|
23711
|
+
let disabledDatesData = null;
|
|
23712
|
+
if (typeof this.disabledDates === 'string') {
|
|
23713
|
+
try {
|
|
23714
|
+
disabledDatesData = JSON.parse(this.disabledDates);
|
|
23715
|
+
}
|
|
23716
|
+
catch (e) {
|
|
23717
|
+
return;
|
|
23718
|
+
}
|
|
23719
|
+
}
|
|
23720
|
+
else
|
|
23721
|
+
disabledDatesData = this.disabledDates;
|
|
23722
|
+
// Convert dates to list
|
|
23723
|
+
// #
|
|
23724
|
+
if (disabledDatesData.dates && disabledDatesData.dates.length && !!disabledDatesData.dates.length) {
|
|
23725
|
+
const disabledDates = disabledDatesData.dates.map(date => {
|
|
23726
|
+
const tempDate = new Date(date);
|
|
23727
|
+
if (tempDate.toString().toLowerCase() === 'invalid date')
|
|
23728
|
+
return null;
|
|
23729
|
+
else
|
|
23730
|
+
return tempDate;
|
|
23731
|
+
}).filter(date => date);
|
|
23732
|
+
this.disabledDatesList.dates = disabledDates;
|
|
23733
|
+
}
|
|
23734
|
+
// Get min & max range
|
|
23735
|
+
// #
|
|
23736
|
+
if (disabledDatesData.min &&
|
|
23737
|
+
disabledDatesData.max && (disabledDatesData.min.getTime() > disabledDatesData.max.getTime() ||
|
|
23738
|
+
disabledDatesData.max.getTime() < disabledDatesData.min.getTime())) {
|
|
23739
|
+
return;
|
|
23740
|
+
}
|
|
23741
|
+
if (disabledDatesData.min && disabledDatesData.min instanceof Date) {
|
|
23742
|
+
this.disabledDatesList.min = new Date(disabledDatesData.min.toDateString());
|
|
23743
|
+
}
|
|
23744
|
+
else {
|
|
23745
|
+
delete this.disabledDatesList.min;
|
|
23746
|
+
}
|
|
23747
|
+
if (disabledDatesData.max && disabledDatesData.max instanceof Date) {
|
|
23748
|
+
this.disabledDatesList.max = new Date(disabledDatesData.max.toDateString());
|
|
23749
|
+
}
|
|
23750
|
+
else {
|
|
23751
|
+
delete this.disabledDatesList.max;
|
|
23752
|
+
}
|
|
23753
|
+
const value = this.inputElement && this.inputElement.value;
|
|
23754
|
+
value && this.setDataFromText(value);
|
|
23755
|
+
}
|
|
23756
|
+
/**
|
|
23757
|
+
*
|
|
23758
|
+
* @param target
|
|
23759
|
+
* @param wheelTriggerElement
|
|
23760
|
+
* @param strip
|
|
23761
|
+
*/
|
|
23762
|
+
createWheelChange(target, wheelTriggerElement, strip) {
|
|
23763
|
+
/**
|
|
23764
|
+
* [ Mouse Event: wheel ]
|
|
23765
|
+
*/
|
|
23766
|
+
wheelTriggerElement.addEventListener('wheel', (event) => {
|
|
23767
|
+
const moveDown = event.deltaY > 0;
|
|
23768
|
+
const dragger = this[target + 'Dragger'];
|
|
23769
|
+
const draggerOffsetY = dragger.getOffset().top;
|
|
23770
|
+
const childIdx = this.getTargetChildByDragPosition({ y: draggerOffsetY }, strip);
|
|
23771
|
+
let nextChild = moveDown ? childIdx + 1 : childIdx - 1;
|
|
23772
|
+
// Array bounds check
|
|
23773
|
+
// #
|
|
23774
|
+
nextChild < 0
|
|
23775
|
+
? (nextChild = 0) : typeof this[target][nextChild] === 'undefined'
|
|
23776
|
+
? (nextChild = this[target].length - 1) : nextChild;
|
|
23777
|
+
if (this.type == "time" && !this.selectedDate) {
|
|
23778
|
+
this.setTime();
|
|
23779
|
+
}
|
|
23780
|
+
this.setDragSelection(target, this[target][nextChild], true, true);
|
|
23781
|
+
});
|
|
23782
|
+
}
|
|
23783
|
+
/**
|
|
23784
|
+
* @desc
|
|
23785
|
+
*/
|
|
23786
|
+
createDragSelection(target, element, dragTriggerElement, strip, direction) {
|
|
23787
|
+
const dragger = target + 'Dragger';
|
|
23788
|
+
this[dragger] = new ElementDragger({
|
|
23789
|
+
target: element,
|
|
23790
|
+
trigger: dragTriggerElement,
|
|
23791
|
+
direction: direction,
|
|
23792
|
+
useTransform: true,
|
|
23793
|
+
limit: {
|
|
23794
|
+
y: {
|
|
23795
|
+
max: strip.offsetTop - (strip.offsetHeight / 2),
|
|
23796
|
+
min: (element.offsetHeight - (strip.offsetTop + strip.offsetHeight / 2)) * -1
|
|
23797
|
+
}
|
|
23798
|
+
}
|
|
23799
|
+
});
|
|
23800
|
+
/**
|
|
23801
|
+
* [ ElementDragger Event: end ]
|
|
23802
|
+
*/
|
|
23803
|
+
this[dragger].on('end', (pos) => {
|
|
23804
|
+
const childIdx = this.getTargetChildByDragPosition(pos, strip);
|
|
23805
|
+
// Select target child when dragging
|
|
23806
|
+
// end
|
|
23807
|
+
this.selectTargetChildByDragIdx(childIdx, strip, this[dragger]);
|
|
23808
|
+
// Set target value
|
|
23809
|
+
// #
|
|
23810
|
+
this.setDragSelection(target, this[target][childIdx], false);
|
|
23811
|
+
});
|
|
23812
|
+
}
|
|
23813
|
+
/**
|
|
23814
|
+
* @desc Calculates which child in center of strip
|
|
23815
|
+
* for drag areas
|
|
23816
|
+
*/
|
|
23817
|
+
getTargetChildByDragPosition({ y }, strip) {
|
|
23818
|
+
const stripHeight = strip.offsetHeight;
|
|
23819
|
+
const stripCenter = stripHeight / 2;
|
|
23820
|
+
const stripTriggerY = strip.offsetTop - (stripCenter);
|
|
23821
|
+
const childY = -(y - stripTriggerY - (stripCenter));
|
|
23822
|
+
return Math.floor(childY / stripHeight);
|
|
23823
|
+
}
|
|
23824
|
+
/**
|
|
23825
|
+
* @esc
|
|
23826
|
+
* @param target
|
|
23827
|
+
* @param childIdx
|
|
23828
|
+
*/
|
|
23829
|
+
selectTargetChildByDragIdx(childIdx, strip, dragger, anim = true) {
|
|
23830
|
+
const y = ((strip.offsetHeight / 2) + strip.offsetTop) - ((childIdx + 1) * (strip.offsetHeight));
|
|
23831
|
+
dragger.setPosition({ y, anim });
|
|
23832
|
+
}
|
|
23833
|
+
/**
|
|
23834
|
+
* @desc
|
|
23835
|
+
* @param year
|
|
23836
|
+
*/
|
|
23837
|
+
setDragSelection(target, value, scroll = true, anim = false) {
|
|
23838
|
+
// if (!value) return
|
|
23839
|
+
const childIdx = this[target].findIndex((itemValue) => itemValue === value);
|
|
23840
|
+
scroll && this.selectTargetChildByDragIdx(childIdx, this[target === 'years' ? target + 'StripElement' : 'timeStripElement'], this[target + 'Dragger'], anim);
|
|
23841
|
+
switch (target) {
|
|
23842
|
+
case 'years':
|
|
23843
|
+
this.date.setFullYear(value);
|
|
23844
|
+
break;
|
|
23845
|
+
case 'hours':
|
|
23846
|
+
this.date.setHours(value);
|
|
23847
|
+
break;
|
|
23848
|
+
case 'minutes':
|
|
23849
|
+
this.date.setMinutes(value);
|
|
23850
|
+
break;
|
|
23851
|
+
}
|
|
23852
|
+
this.renderDate = this.date;
|
|
23853
|
+
this.setData();
|
|
23854
|
+
if (this.selectedDate) {
|
|
23855
|
+
this.setValue();
|
|
23856
|
+
}
|
|
23857
|
+
}
|
|
23858
|
+
/**
|
|
23859
|
+
* @desc
|
|
23860
|
+
* @returns
|
|
23861
|
+
*/
|
|
23862
|
+
getHours12() {
|
|
23863
|
+
const hours = (this.date.getHours() + 24) % 12 || 12;
|
|
23864
|
+
return hours > 12 ? hours - 12 : hours;
|
|
23865
|
+
}
|
|
23866
|
+
/**
|
|
23867
|
+
* @desc
|
|
23868
|
+
* @param date
|
|
23869
|
+
* @param excludeTime -
|
|
23870
|
+
*/
|
|
23871
|
+
createDateObject(date, { excludeTime = false, exactMonthNumber = false } = {}) {
|
|
23872
|
+
const dateYear = date.getFullYear();
|
|
23873
|
+
const year = dateYear >= this.maxYear
|
|
23874
|
+
? this.maxYear : dateYear <= this.minYear
|
|
23875
|
+
? this.minYear : dateYear;
|
|
23876
|
+
return Object.assign(Object.assign({ year, day: date.getDate(), month: date.getMonth() + (exactMonthNumber ? 1 : 0), dayOfWeek: date.getDay(), monthFirstDay: new Date(new Date(date).setDate(1)).getDay() }, !excludeTime && { hour: date.getHours() }), !excludeTime && { minute: date.getMinutes() });
|
|
23877
|
+
}
|
|
23878
|
+
/**
|
|
23879
|
+
* @desc
|
|
23880
|
+
* @param max
|
|
23881
|
+
*/
|
|
23882
|
+
generateDaysArrayFromMax(max) {
|
|
23883
|
+
return Array.from(Array(max + 1).keys()).slice(1);
|
|
23884
|
+
}
|
|
23885
|
+
/**
|
|
23886
|
+
* @desc
|
|
23887
|
+
* @param date
|
|
23888
|
+
*/
|
|
23889
|
+
getMonthDayNumbers(date) {
|
|
23890
|
+
const totalDays = this.getDaysInMonth(date.getMonth(), date.getFullYear());
|
|
23891
|
+
return this.generateDaysArrayFromMax(totalDays);
|
|
23892
|
+
}
|
|
23893
|
+
/**
|
|
23894
|
+
* @desc
|
|
23895
|
+
* @param date
|
|
23896
|
+
* @param day
|
|
23897
|
+
*/
|
|
23898
|
+
getTargetDayDate(date, day) {
|
|
23899
|
+
return new Date(new Date(date).setDate(day));
|
|
23900
|
+
}
|
|
23901
|
+
/**
|
|
23902
|
+
* @desc
|
|
23903
|
+
* @param date
|
|
23904
|
+
* @param day
|
|
23905
|
+
*/
|
|
23906
|
+
getDayIsWeekend(date, day) {
|
|
23907
|
+
const dayOfWeek = new Date(new Date(date).setDate(day)).getDay();
|
|
23908
|
+
return (dayOfWeek === 6) || (dayOfWeek === 0);
|
|
23909
|
+
}
|
|
23910
|
+
/**
|
|
23911
|
+
* @desc
|
|
23912
|
+
* @param date
|
|
23913
|
+
*/
|
|
23914
|
+
getClock(date) {
|
|
23915
|
+
date = date || new Date();
|
|
23916
|
+
const hours = date.getHours();
|
|
23917
|
+
const minutes = date.getMinutes();
|
|
23918
|
+
const seconds = date.getSeconds();
|
|
23919
|
+
const milis = date.getMilliseconds();
|
|
23920
|
+
return { hours, minutes, seconds, milis };
|
|
23921
|
+
}
|
|
23922
|
+
/**
|
|
23923
|
+
* @desc
|
|
23924
|
+
*/
|
|
23925
|
+
setValue(reset) {
|
|
23926
|
+
var _a, _b, _c;
|
|
23927
|
+
const date = new Date(this.date.setHours(Number(this.currentDate.hour), Number(this.currentDate.minute)));
|
|
23928
|
+
if (reset) {
|
|
23929
|
+
this.value = null;
|
|
23930
|
+
return;
|
|
23931
|
+
}
|
|
23932
|
+
this.dataIsValid = true;
|
|
23933
|
+
if (this.type === Types.datetime) {
|
|
23934
|
+
const dateObject = Object.assign({}, this.currentDate);
|
|
23935
|
+
dateObject.month += 1;
|
|
23936
|
+
if (((_a = this.value) === null || _a === void 0 ? void 0 : _a.value) != this.valueText) {
|
|
23937
|
+
this.value = {
|
|
23938
|
+
isValid: this.dataIsValid,
|
|
23939
|
+
date: date,
|
|
23940
|
+
timestamp: date.getTime(),
|
|
23941
|
+
dateObject,
|
|
23942
|
+
value: this.valueText
|
|
23943
|
+
};
|
|
23944
|
+
}
|
|
23945
|
+
}
|
|
23946
|
+
if (this.type === Types.date) {
|
|
23947
|
+
const dateObject = Object.assign({}, this.currentDate);
|
|
23948
|
+
delete dateObject.hour;
|
|
23949
|
+
delete dateObject.minute;
|
|
23950
|
+
dateObject.month += 1;
|
|
23951
|
+
if (((_b = this.value) === null || _b === void 0 ? void 0 : _b.value) != this.valueText) {
|
|
23952
|
+
this.value = {
|
|
23953
|
+
isValid: this.dataIsValid,
|
|
23954
|
+
date,
|
|
23955
|
+
timestamp: date.getTime(),
|
|
23956
|
+
dateObject,
|
|
23957
|
+
value: this.valueText
|
|
23958
|
+
};
|
|
23959
|
+
}
|
|
23960
|
+
}
|
|
23961
|
+
if (this.type === Types.time) {
|
|
23962
|
+
const getTimeText = this.getTimeText();
|
|
23963
|
+
const dateObject = Object.assign({}, this.currentDate);
|
|
23964
|
+
dateObject.month += 1;
|
|
23965
|
+
this.value = {
|
|
23966
|
+
isValid: this.dataIsValid,
|
|
23967
|
+
date: date,
|
|
23968
|
+
timestamp: date.getTime(),
|
|
23969
|
+
time: getTimeText,
|
|
23970
|
+
dateObject,
|
|
23971
|
+
timeObject: {
|
|
23972
|
+
hours: this.currentDate.hour,
|
|
23973
|
+
minutes: this.currentDate.minute
|
|
23974
|
+
},
|
|
23975
|
+
value: getTimeText
|
|
23976
|
+
};
|
|
23977
|
+
this.inputElement.value = getTimeText;
|
|
23978
|
+
}
|
|
23979
|
+
if (this.type === Types.range) {
|
|
23980
|
+
if (((_c = this.value) === null || _c === void 0 ? void 0 : _c.value) != this.valueText) {
|
|
23981
|
+
this.value = {
|
|
23982
|
+
isValid: this.dataIsValid,
|
|
23983
|
+
dateObject: {
|
|
23984
|
+
start: Object.assign({}, this.selectedDate && {
|
|
23985
|
+
date: this.selectedDate,
|
|
23986
|
+
timestamp: this.selectedDate.getTime(),
|
|
23987
|
+
detail: this.createDateObject(this.selectedDate, {
|
|
23988
|
+
excludeTime: true,
|
|
23989
|
+
exactMonthNumber: true
|
|
23990
|
+
})
|
|
23991
|
+
}),
|
|
23992
|
+
end: Object.assign({}, this.selectedEndDate && {
|
|
23993
|
+
date: this.selectedEndDate,
|
|
23994
|
+
timestamp: this.selectedEndDate.getTime(),
|
|
23995
|
+
detail: this.createDateObject(this.selectedEndDate, {
|
|
23996
|
+
excludeTime: true,
|
|
23997
|
+
exactMonthNumber: true
|
|
23998
|
+
})
|
|
23999
|
+
})
|
|
24000
|
+
},
|
|
24001
|
+
value: this.valueText
|
|
24002
|
+
};
|
|
24003
|
+
}
|
|
24004
|
+
}
|
|
24005
|
+
}
|
|
24006
|
+
/**
|
|
24007
|
+
* @desc
|
|
24008
|
+
* @param month
|
|
24009
|
+
*/
|
|
24010
|
+
setMonth(month) {
|
|
24011
|
+
this.renderDate.setDate(1);
|
|
24012
|
+
this.renderDate = new Date(this.renderDate.setMonth(month));
|
|
24013
|
+
this.setDragSelection('years', this.currentDate.year);
|
|
24014
|
+
}
|
|
24015
|
+
/**
|
|
24016
|
+
* @desc
|
|
24017
|
+
* @param popupClosing -
|
|
24018
|
+
*/
|
|
24019
|
+
checkRangeValidation({ popupClosing = false } = {}) {
|
|
24020
|
+
if (this.type !== Types.range)
|
|
24021
|
+
return true;
|
|
24022
|
+
const errorText = 'date range invalid';
|
|
24023
|
+
if (popupClosing && (!this.selectedDate || this.selectedDate && !this.selectedEndDate)) {
|
|
24024
|
+
this.setError(true, errorText);
|
|
24025
|
+
return false;
|
|
24026
|
+
}
|
|
24027
|
+
if (!popupClosing) {
|
|
24028
|
+
this.setError(false);
|
|
24029
|
+
return true;
|
|
24030
|
+
}
|
|
24031
|
+
return true;
|
|
24032
|
+
}
|
|
24033
|
+
/**
|
|
24034
|
+
* @desc
|
|
24035
|
+
* @param value
|
|
24036
|
+
* @param max
|
|
24037
|
+
* @returns
|
|
24038
|
+
*/
|
|
24039
|
+
pad(value, max) {
|
|
24040
|
+
return value < max ? '0' : '';
|
|
24041
|
+
}
|
|
24042
|
+
/**
|
|
24043
|
+
* @desc
|
|
24044
|
+
* @returns
|
|
24045
|
+
*/
|
|
24046
|
+
isInputClearable() {
|
|
24047
|
+
if (this.inputElement && this.inputElement.value) {
|
|
24048
|
+
return true;
|
|
24049
|
+
}
|
|
24050
|
+
return false;
|
|
24051
|
+
}
|
|
24052
|
+
/**
|
|
24053
|
+
* @desc
|
|
24054
|
+
* @param date
|
|
24055
|
+
*/
|
|
24056
|
+
isDisabledDate(date) {
|
|
24057
|
+
if (!!this.disabledDatesList.dates.map(d => this.isSameDate(d, date)).filter(d => d).length)
|
|
24058
|
+
return true;
|
|
24059
|
+
if (this.disabledDatesList.min) {
|
|
24060
|
+
const minDate = new Date(this.disabledDatesList.min);
|
|
24061
|
+
if (minDate && minDate.getTime() > date.getTime())
|
|
24062
|
+
return true;
|
|
24063
|
+
}
|
|
24064
|
+
if (this.disabledDatesList.max) {
|
|
24065
|
+
const maxDate = new Date(this.disabledDatesList.max);
|
|
24066
|
+
if (maxDate && new Date(maxDate.setDate(maxDate.getDate() + 1)).getTime() < date.getTime())
|
|
24067
|
+
return true;
|
|
24068
|
+
}
|
|
24069
|
+
}
|
|
24070
|
+
/**
|
|
24071
|
+
* @desc
|
|
24072
|
+
* @param date
|
|
24073
|
+
*/
|
|
24074
|
+
setDate(date, isUserSelect, notClosePicker = false) {
|
|
24075
|
+
const isRange = this.type === Types.range;
|
|
24076
|
+
const isEndSelect = !!this.selectedEndDate;
|
|
24077
|
+
// Check disabled date
|
|
24078
|
+
// #
|
|
24079
|
+
if ((this.type === Types.date || this.type === Types.datetime) && this.isDisabledDate(date)) {
|
|
24080
|
+
return;
|
|
24081
|
+
}
|
|
24082
|
+
this.emptyState = false;
|
|
24083
|
+
if (!isRange || (isRange && !isEndSelect)) {
|
|
24084
|
+
this.date = new Date(date.setHours(this.currentDate.hour, this.currentDate.minute));
|
|
24085
|
+
}
|
|
24086
|
+
isRange && this.checkRangeValidation();
|
|
24087
|
+
if (isRange && this.selectedDate && this.selectedEndDate) {
|
|
24088
|
+
this.selectedDate = null;
|
|
24089
|
+
this.selectedEndDate = null;
|
|
24090
|
+
}
|
|
24091
|
+
if (isUserSelect) {
|
|
24092
|
+
const newDate = new Date(date);
|
|
24093
|
+
!isRange
|
|
24094
|
+
? this.selectedDate = newDate
|
|
24095
|
+
: !this.selectedDate
|
|
24096
|
+
? this.selectedDate = newDate
|
|
24097
|
+
: this.selectedDate.getTime() > newDate.getTime()
|
|
24098
|
+
? (this.selectedEndDate = this.selectedDate) && (this.selectedDate = newDate)
|
|
24099
|
+
: this.selectedEndDate = newDate;
|
|
24100
|
+
!isRange && (this._open = notClosePicker);
|
|
24101
|
+
this.renderDate = this.date;
|
|
24102
|
+
this.valueText = this.getValueText();
|
|
24103
|
+
this.setValue();
|
|
24104
|
+
const splitText = this.valueText.split('/');
|
|
24105
|
+
const newValue = this.valueText ? this.changeFormat(new Date(splitText[1] + "/" + splitText[0] + "/" + splitText[2])) : '';
|
|
24106
|
+
this.inputElement.value = newValue;
|
|
24107
|
+
}
|
|
24108
|
+
}
|
|
24109
|
+
setDataFromText(text, updateData = false, openPicker = true) {
|
|
24110
|
+
let update = false;
|
|
24111
|
+
let errorState = '';
|
|
24112
|
+
const parsed = this.parse(text);
|
|
24113
|
+
if ((this.type === Types.date || this.type === Types.datetime) && this.isDisabledDate(parsed.date)) {
|
|
24114
|
+
parsed.dateIsValid = false;
|
|
24115
|
+
errorState = 'disabled-date';
|
|
24116
|
+
}
|
|
24117
|
+
// Check mode datetime
|
|
24118
|
+
// #
|
|
24119
|
+
if (this.type === Types.datetime && parsed.dateIsValid && parsed.timeIsValid) {
|
|
24120
|
+
updateData && this.setDate(parsed.date, true, openPicker);
|
|
24121
|
+
updateData && this.setTime(parsed.timeSections[0], parsed.timeSections[1]);
|
|
24122
|
+
update = true;
|
|
24123
|
+
}
|
|
24124
|
+
// Check mode date
|
|
24125
|
+
// #
|
|
24126
|
+
if (this.type === Types.date && parsed.dateIsValid) {
|
|
24127
|
+
updateData && this.setDate(parsed.date, true, openPicker);
|
|
24128
|
+
update = true;
|
|
24129
|
+
}
|
|
24130
|
+
// Check mode time
|
|
24131
|
+
// #
|
|
24132
|
+
if (this.type === Types.time && parsed.timeIsValid) {
|
|
24133
|
+
updateData && this.setTime(parsed.timeSections[0], parsed.timeSections[1]);
|
|
24134
|
+
update = true;
|
|
24135
|
+
}
|
|
24136
|
+
// Check mode range
|
|
24137
|
+
// #
|
|
24138
|
+
if (this.type === Types.range) {
|
|
24139
|
+
if (parsed.dateIsValid && !this.selectedDate) {
|
|
24140
|
+
updateData && this.setDate(parsed.date, true, openPicker);
|
|
24141
|
+
update = true;
|
|
24142
|
+
}
|
|
24143
|
+
if (parsed.date2IsValid && !this.selectedEndDate) {
|
|
24144
|
+
updateData && this.setDate(parsed.date2, true, openPicker);
|
|
24145
|
+
update = true;
|
|
24146
|
+
}
|
|
24147
|
+
if (this.selectedDate && this.selectedEndDate && parsed.rangeIsValid) {
|
|
24148
|
+
if (this.isSameDate(parsed.date2, this.selectedEndDate) && !this.isSameDate(parsed.date, this.selectedDate)) {
|
|
24149
|
+
this.selectedDate = null;
|
|
24150
|
+
updateData && this.setDate(parsed.date, true, openPicker);
|
|
24151
|
+
update = true;
|
|
24152
|
+
}
|
|
24153
|
+
if (this.isSameDate(parsed.date, this.selectedDate) && !this.isSameDate(parsed.date2, this.selectedEndDate)) {
|
|
24154
|
+
this.selectedEndDate = null;
|
|
24155
|
+
updateData && this.setDate(parsed.date2, true, openPicker);
|
|
24156
|
+
update = true;
|
|
24157
|
+
}
|
|
24158
|
+
}
|
|
24159
|
+
if (this.selectedDate && this.selectedEndDate && !parsed.rangeIsValid && updateData) {
|
|
24160
|
+
this.selectedDate = null;
|
|
24161
|
+
this.selectedEndDate = null;
|
|
24162
|
+
}
|
|
24163
|
+
}
|
|
24164
|
+
// Fix: render warning
|
|
24165
|
+
if (update) {
|
|
24166
|
+
if (updateData) {
|
|
24167
|
+
this.renderDate = this.date;
|
|
24168
|
+
}
|
|
24169
|
+
this.setError(false);
|
|
24170
|
+
}
|
|
24171
|
+
else {
|
|
24172
|
+
if (this.type === Types.range && this.selectedDate && this.selectedEndDate && parsed.rangeIsValid) {
|
|
24173
|
+
this.setError(false);
|
|
24174
|
+
}
|
|
24175
|
+
else {
|
|
24176
|
+
if (errorState) {
|
|
24177
|
+
this.setError(true, (errorState === 'disabled-date' && 'selected date is not allowed'));
|
|
24178
|
+
}
|
|
24179
|
+
else {
|
|
24180
|
+
if (text) {
|
|
24181
|
+
this.setError(true, (this.type === Types.datetime && 'invalid date or time') ||
|
|
24182
|
+
(this.type === Types.range && 'invalid date range') ||
|
|
24183
|
+
(this.type === Types.date && 'The selected date is not allowed.') ||
|
|
24184
|
+
(this.type === Types.time && 'invalid time'));
|
|
24185
|
+
}
|
|
24186
|
+
this.setValue(true);
|
|
24187
|
+
}
|
|
24188
|
+
}
|
|
24189
|
+
const splitText = text.split('/');
|
|
24190
|
+
const newValue = text && !this.error ? this.changeFormat(new Date(splitText[1] + "/" + splitText[0] + "/" + splitText[2])) : '';
|
|
24191
|
+
this.inputElement.value = newValue;
|
|
24192
|
+
}
|
|
24193
|
+
}
|
|
24194
|
+
/**
|
|
24195
|
+
* @desc
|
|
24196
|
+
*/
|
|
24197
|
+
setDateToday() {
|
|
24198
|
+
const date = new Date();
|
|
24199
|
+
if (this.type === Types.range) {
|
|
24200
|
+
this.selectedDate = null;
|
|
24201
|
+
this.selectedEndDate = null;
|
|
24202
|
+
}
|
|
24203
|
+
this.setDate(date, true, false);
|
|
24204
|
+
}
|
|
24205
|
+
HourContentDblClick(e) {
|
|
24206
|
+
const getPath = Generate.findEventPathWithNodeName(e, 'SPAN');
|
|
24207
|
+
if (getPath && getPath.classList.contains('selected')) {
|
|
24208
|
+
this.setValue();
|
|
24209
|
+
this._open = false;
|
|
24210
|
+
}
|
|
24211
|
+
}
|
|
24212
|
+
/**
|
|
24213
|
+
* @desc
|
|
24214
|
+
*/
|
|
24215
|
+
setTime(hours, minutes) {
|
|
24216
|
+
this.renderDate = new Date(this.date.setHours(Number(hours || this.getClock().hours), Number(minutes || this.getClock().minutes)));
|
|
24217
|
+
if (this.type === Types.time) {
|
|
24218
|
+
this.selectedDate = this.date;
|
|
24219
|
+
}
|
|
24220
|
+
const hour = this.currentDate.hour || new Date().getHours();
|
|
24221
|
+
const minute = this.currentDate.minute || new Date().getMinutes();
|
|
24222
|
+
this.setDragSelection('hours', hour, true, true);
|
|
24223
|
+
this.setDragSelection('minutes', minute, true, true);
|
|
24224
|
+
}
|
|
24225
|
+
/**
|
|
24226
|
+
* @desc
|
|
24227
|
+
* @param state
|
|
24228
|
+
* @param error
|
|
24229
|
+
*/
|
|
24230
|
+
setError(state = false, error = '') {
|
|
24231
|
+
this.error = state;
|
|
24232
|
+
this.errorText = !state ? '' : error;
|
|
24233
|
+
}
|
|
24234
|
+
/**
|
|
24235
|
+
* @desc
|
|
24236
|
+
*/
|
|
24237
|
+
getError() {
|
|
24238
|
+
const { error, errorText } = this;
|
|
24239
|
+
return { valid: !error, error, errorText };
|
|
24240
|
+
}
|
|
24241
|
+
/**
|
|
24242
|
+
* @desc
|
|
24243
|
+
* @param month
|
|
24244
|
+
* @param year
|
|
24245
|
+
*/
|
|
24246
|
+
getDaysInMonth(month, year) {
|
|
24247
|
+
return new Date(year, month + 1, 0).getDate();
|
|
24248
|
+
}
|
|
24249
|
+
/**
|
|
24250
|
+
* @desc
|
|
24251
|
+
* @param date
|
|
24252
|
+
* @param day
|
|
24253
|
+
* @returns
|
|
24254
|
+
*/
|
|
24255
|
+
getIsCurrentDate(date, day) {
|
|
24256
|
+
const today = new Date();
|
|
24257
|
+
return today.getDate() === day
|
|
24258
|
+
&& today.getMonth() === date.getMonth()
|
|
24259
|
+
&& today.getFullYear() === date.getFullYear();
|
|
24260
|
+
}
|
|
24261
|
+
/**
|
|
24262
|
+
* @desc
|
|
24263
|
+
* @param date1
|
|
24264
|
+
* @param date2
|
|
24265
|
+
*/
|
|
24266
|
+
isSameDate(date1, date2) {
|
|
24267
|
+
return (date1.getFullYear() === date2.getFullYear() &&
|
|
24268
|
+
date1.getMonth() === date2.getMonth() &&
|
|
24269
|
+
date1.getDate() === date2.getDate());
|
|
24270
|
+
}
|
|
24271
|
+
/**
|
|
24272
|
+
* @desc
|
|
24273
|
+
* @param date
|
|
24274
|
+
* @returns
|
|
24275
|
+
*/
|
|
24276
|
+
getSelected(date, endDate = false) {
|
|
24277
|
+
const selectPart = endDate ? 'EndDate' : 'Date';
|
|
24278
|
+
const targetDate = new Date(this['selected' + selectPart]);
|
|
24279
|
+
const year = targetDate.getFullYear();
|
|
24280
|
+
const month = targetDate.getMonth();
|
|
24281
|
+
const day = targetDate.getDate();
|
|
24282
|
+
const isSelected = date.getDate() === day
|
|
24283
|
+
&& date.getMonth() === month
|
|
24284
|
+
&& date.getFullYear() === year;
|
|
24285
|
+
return isSelected;
|
|
24286
|
+
}
|
|
24287
|
+
/**
|
|
24288
|
+
* @desc
|
|
24289
|
+
* @param date
|
|
24290
|
+
*/
|
|
24291
|
+
getDateIsInRange(date) {
|
|
24292
|
+
if (this.type !== Types.range || (!this.selectedDate || !this.selectedEndDate))
|
|
24293
|
+
return;
|
|
24294
|
+
const current = date.getTime();
|
|
24295
|
+
const start = this.selectedDate.getTime();
|
|
24296
|
+
const end = this.selectedEndDate.getTime();
|
|
24297
|
+
return current > start && current < end;
|
|
24298
|
+
}
|
|
24299
|
+
/**
|
|
24300
|
+
* @desc
|
|
24301
|
+
*/
|
|
24302
|
+
getMonthText() {
|
|
24303
|
+
return Object.values(Months)[this.renderDate.getMonth()];
|
|
24304
|
+
}
|
|
24305
|
+
/**
|
|
24306
|
+
* @desc
|
|
24307
|
+
*/
|
|
24308
|
+
getCurrentDateText() {
|
|
24309
|
+
const dayText = Object.values(Days)[this.currentDate.dayOfWeek];
|
|
24310
|
+
const monthText = Object.values(Months)[this.currentDate.month];
|
|
24311
|
+
const text = `${dayText}, ${this.currentDate.day}th ${monthText} ${this.currentDate.year}`;
|
|
24312
|
+
return text;
|
|
24313
|
+
}
|
|
24314
|
+
/**
|
|
24315
|
+
* @desc
|
|
24316
|
+
* @returns
|
|
24317
|
+
*/
|
|
24318
|
+
getTimeText() {
|
|
24319
|
+
const { hour, minute } = this.currentDate;
|
|
24320
|
+
return `${hour < 10 ? '0' + hour : hour}:${minute < 10 ? '0' + minute : minute}`;
|
|
24321
|
+
}
|
|
24322
|
+
/**
|
|
24323
|
+
*
|
|
24324
|
+
*/
|
|
24325
|
+
getValueText() {
|
|
24326
|
+
if (!this.selectedDate)
|
|
24327
|
+
return '';
|
|
24328
|
+
const selectedDate = this.selectedDate;
|
|
24329
|
+
const year = selectedDate.getFullYear();
|
|
24330
|
+
const day = selectedDate.getDate();
|
|
24331
|
+
const baseMonth = selectedDate.getMonth();
|
|
24332
|
+
const month = baseMonth + 1;
|
|
24333
|
+
let text = '';
|
|
24334
|
+
if (this.type === Types.date || this.type === Types.datetime) {
|
|
24335
|
+
text = `${day < 10 ? '0' + day : day}/${month < 10 ? '0' + month : month}/${year}`;
|
|
24336
|
+
}
|
|
24337
|
+
if (this.type === Types.time) {
|
|
24338
|
+
text = this.getTimeText();
|
|
24339
|
+
}
|
|
24340
|
+
if (this.type === Types.datetime) {
|
|
24341
|
+
text = `${text} ${this.getTimeText()}`;
|
|
24342
|
+
}
|
|
24343
|
+
if (this.type === Types.range) {
|
|
24344
|
+
text = `${day < 10 ? '0' + day : day}/${month < 10 ? '0' + month : month}/${year}`;
|
|
24345
|
+
}
|
|
24346
|
+
if (this.type === Types.range && this.selectedEndDate) {
|
|
24347
|
+
const endDate = this.selectedEndDate;
|
|
24348
|
+
const endYear = endDate.getFullYear();
|
|
24349
|
+
const endDay = endDate.getDate();
|
|
24350
|
+
const endBaseMonth = endDate.getMonth();
|
|
24351
|
+
const endMonth = endBaseMonth + 1;
|
|
24352
|
+
text += `-${endDay < 10 ? '0' + endDay : endDay}/${endMonth < 10 ? '0' + endMonth : endMonth}/${endYear}`;
|
|
24353
|
+
}
|
|
24354
|
+
this.setDataFromText(text);
|
|
24355
|
+
return text;
|
|
24356
|
+
}
|
|
24357
|
+
parseDate(input) {
|
|
24358
|
+
var parts = input.split('/');
|
|
24359
|
+
var day = parseInt(parts[0], 10);
|
|
24360
|
+
var month = parseInt(parts[1], 10) - 1;
|
|
24361
|
+
var year = parseInt(parts[2], 10);
|
|
24362
|
+
if (isNaN(day) || isNaN(month) || isNaN(year)) {
|
|
24363
|
+
return 'invalid date';
|
|
24364
|
+
}
|
|
24365
|
+
var date = new Date(year, month, day);
|
|
24366
|
+
if (date.getDate() !== day || date.getMonth() !== month || date.getFullYear() !== year) {
|
|
24367
|
+
return 'invalid date';
|
|
24368
|
+
}
|
|
24369
|
+
return date;
|
|
24370
|
+
}
|
|
24371
|
+
/**
|
|
24372
|
+
* @desc
|
|
24373
|
+
* @param dateStr
|
|
24374
|
+
*/
|
|
24375
|
+
parse(dateStr) {
|
|
24376
|
+
const sections = dateStr.split(this.type === Types.range ? '-' : ' ');
|
|
24377
|
+
// const sections: Array<string> = dateStr.split("-")
|
|
24378
|
+
const sectionDate = this.switchDDMM(sections[0]);
|
|
24379
|
+
const sectionDate2 = this.switchDDMM(sections[1]);
|
|
24380
|
+
const sectionTime = this.type === Types.datetime ? sections[1] : sections[0];
|
|
24381
|
+
const date = new Date(sectionDate);
|
|
24382
|
+
const date2 = new Date(sectionDate2);
|
|
24383
|
+
const dateCheck = date.toString().toLowerCase() !== 'invalid date' && this.parseDate(dateStr) !== 'invalid date';
|
|
24384
|
+
const dateCheck2 = date2.toString().toLowerCase() !== 'invalid date';
|
|
24385
|
+
const regDate = /^((0?[1-9]|1[0-2])(-|\/)(0?[1-9]|[12]\d|3[01])(-|\/)[12]\d{3})$/;
|
|
24386
|
+
const regDateCheck = regDate.test(sectionDate);
|
|
24387
|
+
const regDateCheck2 = regDate.test(sectionDate2);
|
|
24388
|
+
const regTime = /\b([01][0-9]|2[0-3]):([0-5][0-9])\b/;
|
|
24389
|
+
const regTimeCheck = regTime.test(sectionTime);
|
|
24390
|
+
const dateIsValid = dateCheck && regDateCheck;
|
|
24391
|
+
const date2IsValid = dateCheck2 && regDateCheck2;
|
|
24392
|
+
const timeSections = regTimeCheck ? sectionTime.split(':') : '';
|
|
24393
|
+
return {
|
|
24394
|
+
date,
|
|
24395
|
+
date2,
|
|
24396
|
+
timeSections,
|
|
24397
|
+
dateIsValid,
|
|
24398
|
+
date2IsValid,
|
|
24399
|
+
rangeIsValid: dateIsValid && date2IsValid,
|
|
24400
|
+
timeIsValid: regTimeCheck
|
|
24401
|
+
};
|
|
24402
|
+
}
|
|
24403
|
+
/**
|
|
24404
|
+
* @desc
|
|
24405
|
+
*/
|
|
24406
|
+
getPrevMonth() {
|
|
24407
|
+
this.setMonth(this.renderDate.getMonth() - 1);
|
|
24408
|
+
}
|
|
24409
|
+
/**
|
|
24410
|
+
* @desc
|
|
24411
|
+
*/
|
|
24412
|
+
getNextMonth() {
|
|
24413
|
+
this.setMonth(this.renderDate.getMonth() + 1);
|
|
24414
|
+
}
|
|
24415
|
+
/**
|
|
24416
|
+
* @desc
|
|
24417
|
+
* @param idx
|
|
24418
|
+
*/
|
|
24419
|
+
yearClick(idx) {
|
|
24420
|
+
if (this.yearsDragger.busy)
|
|
24421
|
+
return;
|
|
24422
|
+
this.setDragSelection('years', this.years[idx], true, true);
|
|
24423
|
+
}
|
|
24424
|
+
/**
|
|
24425
|
+
* @desc
|
|
24426
|
+
* @param idx
|
|
24427
|
+
*/
|
|
24428
|
+
hourClick(idx) {
|
|
24429
|
+
if (this.hoursDragger.busy)
|
|
24430
|
+
return;
|
|
24431
|
+
if (!this.selectedDate) {
|
|
24432
|
+
this.setTime();
|
|
24433
|
+
}
|
|
24434
|
+
this.setDragSelection('hours', this.hours[idx], true, true);
|
|
24435
|
+
}
|
|
24436
|
+
/**
|
|
24437
|
+
* @desc
|
|
24438
|
+
* @param idx
|
|
24439
|
+
*/
|
|
24440
|
+
minuteClick(idx) {
|
|
24441
|
+
if (this.minutesDragger.busy)
|
|
24442
|
+
return;
|
|
24443
|
+
if (!this.selectedDate) {
|
|
24444
|
+
this.setTime();
|
|
24445
|
+
}
|
|
24446
|
+
this.setDragSelection('minutes', this.minutes[idx], true, true);
|
|
24447
|
+
}
|
|
24448
|
+
/**
|
|
24449
|
+
* @desc
|
|
24450
|
+
*/
|
|
24451
|
+
openPicker() {
|
|
24452
|
+
if (this.disabled)
|
|
24453
|
+
return;
|
|
24454
|
+
!this._open && (this._open = true);
|
|
24455
|
+
}
|
|
24456
|
+
/**
|
|
24457
|
+
* @desc
|
|
24458
|
+
* @param date
|
|
24459
|
+
*/
|
|
24460
|
+
handleDayNumber(date) {
|
|
24461
|
+
if (this.type === Types.range
|
|
24462
|
+
&& this.selectedDate
|
|
24463
|
+
&& !this.selectedEndDate
|
|
24464
|
+
&& this.isSameDate(this.selectedDate, date))
|
|
24465
|
+
return;
|
|
24466
|
+
this.setDate(date, true);
|
|
24467
|
+
}
|
|
24468
|
+
/**
|
|
24469
|
+
* @desc
|
|
24470
|
+
* @param value
|
|
24471
|
+
*/
|
|
24472
|
+
handleInputInput(value) {
|
|
24473
|
+
this.setDataFromText(value, true);
|
|
24474
|
+
}
|
|
24475
|
+
/**
|
|
24476
|
+
* @desc
|
|
24477
|
+
* @param event -
|
|
24478
|
+
*/
|
|
24479
|
+
handleInputChange(event) {
|
|
24480
|
+
this.setDataFromText(this.inputElement.value, true, false);
|
|
24481
|
+
event.stopPropagation();
|
|
24482
|
+
}
|
|
24483
|
+
/**
|
|
24484
|
+
* @desc
|
|
24485
|
+
*/
|
|
24486
|
+
async handleInputClear() {
|
|
24487
|
+
this.selectedDate = null;
|
|
24488
|
+
this.selectedEndDate = null;
|
|
24489
|
+
this.emptyState = true;
|
|
24490
|
+
this.renderDate = new Date();
|
|
24491
|
+
this._open = false;
|
|
24492
|
+
this.setValue(true);
|
|
24493
|
+
this.setError();
|
|
24494
|
+
this.getValueText();
|
|
24495
|
+
await this.inputElement.setClear();
|
|
24496
|
+
await delay(10);
|
|
24497
|
+
return Promise.resolve();
|
|
24498
|
+
}
|
|
24499
|
+
/**
|
|
24500
|
+
* @desc
|
|
24501
|
+
* @param event
|
|
24502
|
+
*/
|
|
24503
|
+
handleWheel(event) {
|
|
24504
|
+
event.preventDefault();
|
|
24505
|
+
}
|
|
24506
|
+
/**
|
|
24507
|
+
* @desc
|
|
24508
|
+
* @param event
|
|
24509
|
+
*/
|
|
24510
|
+
handleWindowClick(event) {
|
|
24511
|
+
if (this._open) {
|
|
24512
|
+
const list = document.getElementById(`picker-vp-${this._id}`);
|
|
24513
|
+
const isClickInside = Generate.findEventPath(event, this.el);
|
|
24514
|
+
const isClickList = list ? (Generate.findEventPath(event, list)) : false;
|
|
24515
|
+
if (!isClickInside && !isClickList) {
|
|
24516
|
+
this._open = false;
|
|
24517
|
+
}
|
|
24518
|
+
}
|
|
24519
|
+
}
|
|
24520
|
+
openToggle() {
|
|
24521
|
+
if (this.disabled)
|
|
24522
|
+
return;
|
|
24523
|
+
this._open = !this._open;
|
|
24524
|
+
}
|
|
24525
|
+
/**
|
|
24526
|
+
* @desc
|
|
24527
|
+
*/
|
|
24528
|
+
async open() {
|
|
24529
|
+
await delay(50);
|
|
24530
|
+
this.openToggle();
|
|
24531
|
+
}
|
|
24532
|
+
/**
|
|
24533
|
+
* @desc
|
|
24534
|
+
*/
|
|
24535
|
+
async close() {
|
|
24536
|
+
this._open = false;
|
|
24537
|
+
}
|
|
24538
|
+
/**
|
|
24539
|
+
* @desc
|
|
24540
|
+
*/
|
|
24541
|
+
async getValue() {
|
|
24542
|
+
return this.value;
|
|
24543
|
+
}
|
|
24544
|
+
/**
|
|
24545
|
+
* @param
|
|
24546
|
+
* @param disabled
|
|
24547
|
+
*/
|
|
24548
|
+
async setDisabled(disabled) {
|
|
24549
|
+
this.disabled = disabled;
|
|
24550
|
+
}
|
|
24551
|
+
changeFormat(date, reverseDay = false) {
|
|
24552
|
+
if (!date)
|
|
24553
|
+
return;
|
|
24554
|
+
const pad = (n) => n < 10 ? `0${n}` : n;
|
|
24555
|
+
const day = pad(new Date(date).getDate());
|
|
24556
|
+
const month = pad(new Date(date).getMonth() + 1);
|
|
24557
|
+
const year = new Date(date).getFullYear();
|
|
24558
|
+
const hours = pad(new Date(date).getHours());
|
|
24559
|
+
const minutes = pad(new Date(date).getMinutes());
|
|
24560
|
+
if (this.type == "range" || this.type == "date") {
|
|
24561
|
+
return reverseDay ? `${month}/${day}/${year}` : `${day}/${month}/${year}`;
|
|
24562
|
+
}
|
|
24563
|
+
return reverseDay ? `${month}/${day}/${year} ${hours}:${minutes}` : `${day}/${month}/${year} ${hours}:${minutes}`;
|
|
24564
|
+
}
|
|
24565
|
+
isTime(value) {
|
|
24566
|
+
return /^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$/.test(value);
|
|
24567
|
+
}
|
|
24568
|
+
getHHMM(date) {
|
|
24569
|
+
if (!date)
|
|
24570
|
+
return;
|
|
24571
|
+
const pad = (n) => n < 10 ? `0${n}` : n;
|
|
24572
|
+
const hours = pad(new Date(date).getHours());
|
|
24573
|
+
const minutes = pad(new Date(date).getMinutes());
|
|
24574
|
+
return `${hours}:${minutes}`;
|
|
24575
|
+
}
|
|
24576
|
+
/**
|
|
24577
|
+
* @desc
|
|
24578
|
+
* @param dateOrTime
|
|
24579
|
+
*/
|
|
24580
|
+
async set(dateOrTime) {
|
|
24581
|
+
if (dateOrTime) {
|
|
24582
|
+
if (typeof dateOrTime === "number") {
|
|
24583
|
+
dateOrTime = new Date(dateOrTime);
|
|
24584
|
+
}
|
|
24585
|
+
if (this.type == "time") {
|
|
24586
|
+
let time = dateOrTime;
|
|
24587
|
+
if (!this.isTime(dateOrTime)) {
|
|
24588
|
+
time = this.getHHMM(dateOrTime);
|
|
24589
|
+
}
|
|
24590
|
+
this.setDataFromText(time, true, false);
|
|
24591
|
+
}
|
|
24592
|
+
else {
|
|
24593
|
+
const split = dateOrTime.toString().split('-');
|
|
24594
|
+
const parseDate0 = Date.parse(split[0]);
|
|
24595
|
+
if (split[0] && !isNaN(parseDate0)) {
|
|
24596
|
+
var date = this.changeFormat(DateTimeHelper.convertTimeStampToDate(new Date(split[0]).getTime()));
|
|
24597
|
+
if (split[1] && !isNaN(Date.parse(split[1]))) {
|
|
24598
|
+
var date2 = this.changeFormat(DateTimeHelper.convertTimeStampToDate(new Date(split[1]).getTime()));
|
|
24599
|
+
date = date + "-" + date2;
|
|
24600
|
+
}
|
|
24601
|
+
this.setDataFromText(date, true, false);
|
|
24602
|
+
}
|
|
24603
|
+
else {
|
|
24604
|
+
this.setDataFromText('', true, false);
|
|
24605
|
+
}
|
|
24606
|
+
}
|
|
24607
|
+
}
|
|
24608
|
+
else {
|
|
24609
|
+
this.setClear();
|
|
24610
|
+
}
|
|
24611
|
+
}
|
|
24612
|
+
async get() {
|
|
24613
|
+
var _a;
|
|
24614
|
+
return ((_a = this.value) === null || _a === void 0 ? void 0 : _a.timestamp) || null;
|
|
24615
|
+
}
|
|
24616
|
+
async setClear() {
|
|
24617
|
+
await this.handleInputClear();
|
|
24618
|
+
return Promise.resolve();
|
|
24619
|
+
}
|
|
24620
|
+
/**
|
|
24621
|
+
* @desc
|
|
24622
|
+
*/
|
|
24623
|
+
async getInput() {
|
|
24624
|
+
return this.inputElement;
|
|
24625
|
+
}
|
|
24626
|
+
/**
|
|
24627
|
+
* @desc
|
|
24628
|
+
* @returns
|
|
24629
|
+
*/
|
|
24630
|
+
async isValid() {
|
|
24631
|
+
return this.getError();
|
|
24632
|
+
}
|
|
24633
|
+
async resetCaption() {
|
|
24634
|
+
await delay(10);
|
|
24635
|
+
await this.inputElement.resetCaption();
|
|
24636
|
+
this.captionType = 'default';
|
|
24637
|
+
this.captionError = null;
|
|
24638
|
+
await delay(10);
|
|
24639
|
+
return Promise.resolve();
|
|
24640
|
+
}
|
|
24641
|
+
addZeroBefore(n) {
|
|
24642
|
+
return (n < 10 ? '0' : '') + n;
|
|
24643
|
+
}
|
|
24644
|
+
formatDate(date, format) {
|
|
24645
|
+
const map = {
|
|
24646
|
+
mm: this.addZeroBefore(date.getMonth() + 1),
|
|
24647
|
+
dd: this.addZeroBefore(date.getDate()),
|
|
24648
|
+
yyyy: this.addZeroBefore(date.getFullYear()),
|
|
24649
|
+
hh: this.addZeroBefore(date.getHours()),
|
|
24650
|
+
mi: this.addZeroBefore(date.getMinutes()),
|
|
24651
|
+
};
|
|
24652
|
+
return format.replace(/mm|dd|yyyy|hh|mi/gi, matched => map[matched]);
|
|
24653
|
+
}
|
|
24654
|
+
handleResize() {
|
|
24655
|
+
this.calculateLocation();
|
|
24656
|
+
}
|
|
24657
|
+
handleWheels(event) {
|
|
24658
|
+
if (this._open) {
|
|
24659
|
+
const list = document.querySelector(`#picker-vp-${this._id}`);
|
|
24660
|
+
const isClickInside = list && Generate.findEventPath(event, list);
|
|
24661
|
+
if (isClickInside) {
|
|
24662
|
+
this.calculateLocation();
|
|
24663
|
+
}
|
|
24664
|
+
else {
|
|
24665
|
+
this._open = false;
|
|
24666
|
+
}
|
|
24667
|
+
}
|
|
24668
|
+
}
|
|
24669
|
+
componentDidLoad() {
|
|
24670
|
+
const picker = this.el.shadowRoot.querySelector(`#picker-vp-${this._id}`);
|
|
24671
|
+
//move to body
|
|
24672
|
+
if (picker) {
|
|
24673
|
+
document.body.appendChild(picker);
|
|
24674
|
+
this.calculateLocation();
|
|
24675
|
+
}
|
|
24676
|
+
}
|
|
24677
|
+
disconnectedCallback() {
|
|
24678
|
+
this.el.innerHTML = '';
|
|
24679
|
+
const pickerBox = document.getElementById(`picker-vp-${this._id}`);
|
|
24680
|
+
if (pickerBox) {
|
|
24681
|
+
pickerBox.remove();
|
|
24682
|
+
}
|
|
24683
|
+
}
|
|
24684
|
+
async calculateLocation() {
|
|
24685
|
+
const pickerBox = document.getElementById(`picker-vp-${this._id}`);
|
|
24686
|
+
const placementArray = this.placement.split('-');
|
|
24687
|
+
if (this.alignment) {
|
|
24688
|
+
this.placement = placementArray[0] + (this.alignment == "right" ? "-end" : "-start");
|
|
24689
|
+
}
|
|
24690
|
+
var placement = this.placement;
|
|
24691
|
+
const targetElementId = this.linkedComponent ? this.linkedComponent : this._id;
|
|
24692
|
+
const target = document.getElementById(targetElementId);
|
|
24693
|
+
if (target) {
|
|
24694
|
+
const targetElement = this.linkedComponent ? target : target.shadowRoot.querySelector(`#picker-input-${this._id}`) || target.shadowRoot.querySelector("bcm-datetime-picker").shadowRoot.querySelector(`#picker-input-${this._id}`);
|
|
24695
|
+
if (pickerBox && targetElement) {
|
|
24696
|
+
getPlacement(pickerBox, targetElement, placement, (place) => (placement = place));
|
|
24697
|
+
await delay(10);
|
|
24698
|
+
let pos = setPosition(placement, targetElement);
|
|
24699
|
+
let captionAreaHeight = this.noCaption ? 0 : 20;
|
|
24700
|
+
let labelAreaHeight = 0;
|
|
24701
|
+
// if (this.fullWidth) {
|
|
24702
|
+
// pickerBox.style.width = targetElement.offsetWidth + 'px';
|
|
24703
|
+
// }
|
|
24704
|
+
getPlacement(pickerBox, targetElement, placement, (place) => (placement = place));
|
|
24705
|
+
await delay(10);
|
|
24706
|
+
pos = setPosition(placement, targetElement);
|
|
24707
|
+
if (this.linkedComponent) {
|
|
24708
|
+
pickerBox.style.top = (placement.split('-')[0] == 'top' ? pos[0] - pickerBox.offsetHeight : pos[0]) + 'px';
|
|
24709
|
+
}
|
|
24710
|
+
else {
|
|
24711
|
+
pickerBox.style.top = (placement.split('-')[0] == 'top' ? pos[0] - pickerBox.offsetHeight + labelAreaHeight : pos[0] - captionAreaHeight) + 'px';
|
|
24712
|
+
}
|
|
24713
|
+
switch (placement.split('-')[1]) {
|
|
24714
|
+
case "start":
|
|
24715
|
+
pickerBox.style.left = pos[1] + 'px';
|
|
24716
|
+
break;
|
|
24717
|
+
case "center":
|
|
24718
|
+
pickerBox.style.left = pos[1] - pickerBox.offsetWidth / 2 + 'px';
|
|
24719
|
+
break;
|
|
24720
|
+
case "end":
|
|
24721
|
+
pickerBox.style.left = pos[1] - pickerBox.offsetWidth + 'px';
|
|
24722
|
+
break;
|
|
24723
|
+
}
|
|
24724
|
+
pickerBox.classList.toggle('bcm-list--top', placement.split('-')[0] == 'top');
|
|
24725
|
+
}
|
|
24726
|
+
}
|
|
24727
|
+
}
|
|
24728
|
+
handleKeyDown(ev) {
|
|
24729
|
+
const keycode = ev.keyCode || ev.which;
|
|
24730
|
+
if (keycode === Bcm.KeyCode.escape) {
|
|
24731
|
+
if (this._open) {
|
|
24732
|
+
this._open = false;
|
|
24733
|
+
ev.preventDefault();
|
|
24734
|
+
ev.stopPropagation();
|
|
24735
|
+
ev.stopImmediatePropagation();
|
|
24736
|
+
this.markForCheck();
|
|
24737
|
+
}
|
|
24738
|
+
}
|
|
24739
|
+
}
|
|
24740
|
+
render() {
|
|
24741
|
+
const dayNumbersClasses = classnames('day-numbers');
|
|
24742
|
+
const datetimePickerClasses = classnames('datetime-picker', 'datetime-picker-wrapper', {
|
|
24743
|
+
'open': this._open,
|
|
24744
|
+
'no-caption': this.noCaption,
|
|
24745
|
+
});
|
|
24746
|
+
const hostClasses = classnames(this.hidden ? 'hidden' : null, {
|
|
24747
|
+
'full-width': this.fullWidth,
|
|
24748
|
+
'linked-component': this.linkedComponent,
|
|
24749
|
+
'no-margin': this.noMargin,
|
|
24750
|
+
});
|
|
24751
|
+
const toggleClasses = classnames('toggle', {
|
|
24752
|
+
disabled: this.disabled
|
|
24753
|
+
});
|
|
24754
|
+
const clockIcon = `<svg style="fill: #595959; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm61.8-104.4l-84.9-61.7c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v141.7l66.8 48.6c5.4 3.9 6.5 11.4 2.6 16.8L334.6 349c-3.9 5.3-11.4 6.5-16.8 2.6z"/></svg>`;
|
|
24755
|
+
const calendarIcon = `<svg style="fill: #595959; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"/></svg>`;
|
|
24756
|
+
const errorIcon = `<svg style="fill: #ef4444; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm42-104c0 23.2-18.8 42-42 42s-42-18.8-42-42 18.8-42 42-42 42 18.8 42 42zm-81.4-211.4l6.8 136c.3 6.4 5.6 11.4 12 11.4h41.2c6.4 0 11.7-5.1 12-11.4l6.8-136c.3-6.9-5.1-12.6-12-12.6h-54.8c-6.9 0-12.4 5.7-12 12.6z"/></svg>`;
|
|
24757
|
+
const inputIcon = this.type == "time" ? clockIcon : calendarIcon;
|
|
24758
|
+
return (h$2(Host, { class: hostClasses, "bcm-internal-id": this.inputId }, this.label && (h$2("div", { class: "picker-label", onClick: () => this.openToggle() }, h$2(LabelTemplate, { size: "medium", type: this.captionType, value: this.label, required: this.required, htmlFor: this._id }))), h$2("bcm-old-input", { ref: el => (this.inputElement = el), placeholder: this.placeholder || 'Select ' + (this.type === Types.datetime ? 'date and time' : '') + (this.type === Types.date ? 'date' : '') + (this.type === Types.time ? 'time' : '') + (this.type === Types.range ? 'date range' : ''), value: this.valueText, required: this.required, fullWidth: this.fullWidth, disabled: this.disabled, name: this.name, id: this.inputId, clearable: this.clearable, onClick: () => this.openPicker(), "no-margin": true, disableWatchValue: true, "on-bcm-clear": () => this.handleInputClear(), "on-bcm-change": (e) => this.handleInputChange(e),
|
|
24759
|
+
// on-bcm-input={(e: CustomEvent) => this.handleInputInput(e.detail)}
|
|
24760
|
+
noCaption: this.noCaption, captionError: this.captionError, caption: this.caption, captionType: this.captionType }, this.error && (h$2("span", { slot: "suffix" }, h$2("span", { id: "error-icon", class: toggleClasses, innerHTML: errorIcon, title: this.errorText }))), h$2("span", { slot: "suffix", onClick: () => this.openPicker() }, h$2("span", { id: "calender-icon", class: toggleClasses, innerHTML: inputIcon }))), h$2("div", { id: "picker-vp-" + this._id, class: datetimePickerClasses, onWheel: (e) => this.handleWheel(e) }, h$2("div", { class: "modules" }, this.hasDateModule && (h$2("div", { class: "date-container" }, h$2("div", { class: "bcm-datetime-picker__header" }, h$2("span", null), h$2("div", { class: "month-year" }, h$2("button", { onClick: () => this.getPrevMonth() }, h$2("bcm-icon", { icon: "far fa-chevron-left" })), h$2("div", { class: "month-year-wrapper" }, h$2("span", { class: "month" }, this.getMonthText()), ",", h$2("span", { class: "year" }, this.date.getFullYear())), h$2("button", { onClick: () => this.getNextMonth() }, h$2("bcm-icon", { icon: "far fa-chevron-right" }))), h$2("span", { class: "today", onClick: () => this.setDateToday() }, "Today")), h$2("div", { class: "bcm-datetime-picker__content" }, h$2("div", { class: "years", ref: el => (this.yearsWrapperElement = el) }, h$2("div", { class: "items", ref: el => (this.yearsElement = el) }, this.years.map((year, idx) => h$2("span", { onClick: () => this.yearClick(idx) }, year))), h$2("div", { class: "select-strip", ref: el => (this.yearsStripElement = el) })), h$2("div", { class: "days" }, h$2("div", { class: "day-labels" }, h$2("span", null, "Mo"), h$2("span", null, "Tu"), h$2("span", null, "We"), h$2("span", null, "Th"), h$2("span", null, "Fr"), h$2("span", null, "Sa"), h$2("span", null, "Su")), h$2("div", { class: dayNumbersClasses }, this.dayNumbers.map(day => (h$2("span", { class: {
|
|
24761
|
+
'is-disabled-date': (this.type === Types.date || this.type === Types.datetime) && this.isDisabledDate(day.date),
|
|
24762
|
+
'not-this-month': !day.thisMonth,
|
|
24763
|
+
'is-weekend': day.isWeekend,
|
|
24764
|
+
'today': day.today,
|
|
24765
|
+
'selected': this.getSelected(day.date),
|
|
24766
|
+
'selected-start': this.getSelected(day.date) && this.selectedEndDate && this.type === Types.range,
|
|
24767
|
+
'selected-end': this.getSelected(day.date, true) && this.type === Types.range,
|
|
24768
|
+
'range': this.getDateIsInRange(day.date) && this.type === Types.range
|
|
24769
|
+
}, onClick: () => this.handleDayNumber(day.date) }, h$2("span", { class: "number" }, day.day))))))))), this.hasTimeModule && (h$2("div", { class: "time-container" }, h$2("div", { class: "bcm-datetime-picker__header" }, h$2("div", { class: "month-year" }, h$2("span", { class: "month" }, this.getTimeText())), h$2("span", { class: "now", onClick: () => { this.setTime(), this.type == "time" && (this._open = false); } }, "Now")), h$2("div", { class: "bcm-datetime-picker__content", onDblClick: (e) => { this.HourContentDblClick(e); } }, h$2("div", { class: "hours", ref: el => (this.hoursWrapperElement = el) }, h$2("div", { class: "items", ref: el => (this.hoursElement = el) }, this.hours.map((hour, idx) => h$2("span", { class: this.currentDate.hour === hour ? 'selected' : '', onClick: () => this.hourClick(idx) }, (hour < 10 && '0') + hour)))), h$2("div", { class: "minutes", ref: el => (this.minutesWrapperElement = el) }, h$2("div", { class: "items", ref: el => (this.minutesElement = el) }, this.minutes.map((minute, idx) => h$2("span", { class: this.currentDate.minute === minute ? 'selected' : '', onClick: () => this.minuteClick(idx) }, (minute < 10 && '0') + minute)))), h$2("div", { class: "select-strip", ref: el => (this.timeStripElement = el) }))))))));
|
|
24770
|
+
}
|
|
24771
|
+
get el() { return getElement(this); }
|
|
24772
|
+
static get watchers() { return {
|
|
24773
|
+
"_open": ["openChanged", "openChange"],
|
|
24774
|
+
"renderDate": ["renderDateChange"],
|
|
24775
|
+
"value": ["valueChange"],
|
|
24776
|
+
"disabledDates": ["disabledDatesChange"]
|
|
24777
|
+
}; }
|
|
24778
|
+
};
|
|
24779
|
+
__decorate$5([
|
|
24780
|
+
IsLoad()
|
|
24781
|
+
], BcmDatetimePicker.prototype, "el", void 0);
|
|
24782
|
+
BcmDatetimePicker.style = datetimePickerCss;
|
|
24783
|
+
|
|
23197
24784
|
const formCss = "@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;margin-bottom:8px}:host(.hidden){display:none}";
|
|
23198
24785
|
|
|
23199
24786
|
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -24059,7 +25646,7 @@ const BcmLabel = class {
|
|
|
24059
25646
|
}
|
|
24060
25647
|
render() {
|
|
24061
25648
|
const { required, value, label, size, form, htmlFor, type, tooltip } = this;
|
|
24062
|
-
return (h$2(Host, { class: "tw-inline-block" }, h$2(LabelTemplate, { form: form, htmlFor: htmlFor, value: value || label, size: size, type: type, required: required, tooltip: tooltip })));
|
|
25649
|
+
return (h$2(Host, { class: "tw-inline-block tw-leading-none" }, h$2(LabelTemplate, { form: form, htmlFor: htmlFor, value: value || label, size: size, type: type, required: required, tooltip: tooltip })));
|
|
24063
25650
|
}
|
|
24064
25651
|
get el() { return getElement(this); }
|
|
24065
25652
|
};
|
|
@@ -25760,6 +27347,388 @@ __decorate$1([
|
|
|
25760
27347
|
], BcmList.prototype, "dataChanged", null);
|
|
25761
27348
|
BcmList.style = listCss;
|
|
25762
27349
|
|
|
27350
|
+
const oldInputCss = "@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}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}.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}:host{display:inline-block;width:100%;margin:0 0 8px 0}:host(.hidden){display:none}:host(.no-margin){margin:0}.input-container{display:flex;flex-direction:column;width:100%;max-width:256px}.input-container.full-width{max-width:100%}.input-base{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;flex:1 1 auto;display:inline-flex;align-items:stretch;justify-content:start;position:relative;background-color:var(--bcm-new-ds-color-white);border:1px solid var(--bcm-new-ds-color-slate-300);border-radius:4px;vertical-align:middle;overflow:hidden;padding:0 4px;cursor:text}.input-base.disabled{background-color:var(--bcm-new-ds-color-slate-50);cursor:not-allowed}.input-base.disabled .bcm-input-element{color:var(--bcm-new-ds-color-slate-300)}.input-base.readonly{background-color:var(--bcm-new-ds-color-slate-50);cursor:default}.input-base.readonly .bcm-input-element{color:var(--bcm-new-ds-color-slate-600)}.input-base:not(.disabled):hover .caret-container,.input-base:not(.disabled).focused .caret-container{opacity:1}.input-base:not(.disabled):hover .input-clear-button,.input-base:not(.disabled).focused .input-clear-button{opacity:1}.input-base:not(.disabled).focused{background-color:var(--bcm-new-ds-color-slate-50)}.input-base:not(.disabled):hover{border-color:var(--bcm-color-prime-blue-6)}.input-base.focused:not(.disabled) .caret-container{opacity:1}.input-base.focused:not(.disabled) .input-clear-button{opacity:1}.input-base:hover:not(.disabled) .caret-container{opacity:1}.input-base:hover:not(.disabled) .input-clear-button{opacity:1}.input-base.disabled{cursor:not-allowed}.input-base.readonly{cursor:default}.input-base.empty .input-clear-button{display:none}.input-base.invalid,.input-base.error{border-color:var(--bcm-new-ds-color-red-500)}.error .label{color:var(--bcm-new-ds-color-red-500) !important}.error .input-base{border-color:var(--bcm-new-ds-color-red-500) !important}.input-base input{color:var(--bcm-new-ds-color-slate-600);flex:1 1 auto;width:0%;border:none;border-radius:2px;background:none;box-shadow:none;padding:0;margin:0 4px;font-family:\"Inter\", sans-serif;cursor:inherit;-webkit-appearance:none;appearance:none}.input-base input::-webkit-search-decoration,.input-base input::-webkit-search-cancel-button,.input-base input::-webkit-search-results-button,.input-base input::-webkit-search-results-decoration{-webkit-appearance:none}.input-base input::placeholder{font-family:\"Inter\", sans-serif;color:var(--bcm-new-ds-color-slate-300);user-select:none}.input-base input:focus{outline:none}input::-webkit-calendar-picker-indicator{-webkit-appearance:none;display:none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}input[type=number]{-moz-appearance:textfield}.input-prefix,.input-suffix{display:inline-flex;align-items:center;justify-content:center;cursor:default;color:var(--bcm-new-ds-color-slate-500)}.input-prefix ::slotted(*),.input-prefix>span{line-height:1;margin-left:4px}.input-suffix ::slotted(*),.input-suffix>span{line-height:1;margin-right:4px}.input-clear-button,.input-password-toggle{display:inline-flex;align-items:center;border:none;background:none;padding:0;cursor:pointer;margin-right:4px;transition:0.2s opacity}.input-clear-button:last-child,.input-clear-button:last-of-type,.input-password-toggle:last-child,.input-password-toggle:last-of-type{margin-right:8px}.input-clear-button:focus,.input-password-toggle:focus{outline:none}.input-clear-button{opacity:0}.label{display:flex;flex-direction:column;font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;color:var(--bcm-new-ds-color-slate-600);margin-bottom:4px}.caption-area{min-height:20px}.input-caption{display:block}.unit.input-suffix{width:24px}.unit-prefix{display:inline-flex;flex:0 0 auto;align-items:center;cursor:default;color:var(--bcm-color-grey-8)}.caret-container{opacity:0;width:30px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-left:1px solid #D9D9D9;border-right:1px solid #D9D9D9;transition:0.2s opacity;user-select:none;box-sizing:border-box;margin-right:4px}.caret-container:last-of-type{margin-right:-space(\"xxxs\");border-right:none}.caret-container .caret{display:inline-flex;height:50%;width:100%;align-items:center;justify-content:center;color:var(--bcm-color-grey-7);cursor:pointer}.caret-container .caret:hover{color:var(--bcm-color-prime-blue-6)}.caret-container .caret:active{background-color:var(--bcm-color-grey-3)}.caret-container .caret:last-child{border-top:1px solid #D9D9D9}.caret-container.disabled{background-color:var(--bcm-color-grey-3)}.caret-container.disabled .caret{cursor:not-allowed}.default-icon{margin-right:8px}.input-large{height:40px}.input-medium{height:32px}.input-small{height:24px}.bcm-label{font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-bottom:4px;font-weight:500;color:#475569}.bcm-label.tw-text-1{font-size:10px;line-height:18px}.bcm-label.tw-text-2{font-size:12px;line-height:20px}.bcm-label.tw-text-3{font-size:14px;line-height:22px}.bcm-caption-area{color:#dc2626;font-weight:400;justify-content:space-between;align-items:flex-start;flex-direction:row;min-height:20px;display:flex;margin-top:4px;font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.bcm-caption-area.tw-text-1{font-size:10px;line-height:18px}.bcm-caption-area.tw-text-2{font-size:12px;line-height:20px}.bcm-caption-area.tw-text-3{font-size:14px;line-height:22px}";
|
|
27351
|
+
|
|
27352
|
+
let id = 0;
|
|
27353
|
+
const defaultIcons = {
|
|
27354
|
+
email: '<svg style="fill: #595959; width: 14px; height: 14px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm0 48v40.805c-22.422 18.259-58.168 46.651-134.587 106.49-16.841 13.247-50.201 45.072-73.413 44.701-23.208.375-56.579-31.459-73.413-44.701C106.18 199.465 70.425 171.067 48 152.805V112h416zM48 400V214.398c22.914 18.251 55.409 43.862 104.938 82.646 21.857 17.205 60.134 55.186 103.062 54.955 42.717.231 80.509-37.199 103.053-54.947 49.528-38.783 82.032-64.401 104.947-82.653V400H48z"/></svg>',
|
|
27355
|
+
tel: '<svg style="fill: #595959; width: 14px; height: 14px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M476.5 22.9L382.3 1.2c-21.6-5-43.6 6.2-52.3 26.6l-43.5 101.5c-8 18.6-2.6 40.6 13.1 53.4l40 32.7C311 267.8 267.8 311 215.4 339.5l-32.7-40c-12.8-15.7-34.8-21.1-53.4-13.1L27.7 329.9c-20.4 8.7-31.5 30.7-26.6 52.3l21.7 94.2c4.8 20.9 23.2 35.5 44.6 35.5C312.3 512 512 313.7 512 67.5c0-21.4-14.6-39.8-35.5-44.6zM69.3 464l-20.9-90.7 98.2-42.1 55.7 68.1c98.8-46.4 150.6-98 197-197l-68.1-55.7 42.1-98.2L464 69.3C463 286.9 286.9 463 69.3 464z"/></svg>',
|
|
27356
|
+
search: '<svg style="fill: #595959; width: 14px; height: 14px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M508.5 468.9L387.1 347.5c-2.3-2.3-5.3-3.5-8.5-3.5h-13.2c31.5-36.5 50.6-84 50.6-136C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c52 0 99.5-19.1 136-50.6v13.2c0 3.2 1.3 6.2 3.5 8.5l121.4 121.4c4.7 4.7 12.3 4.7 17 0l22.6-22.6c4.7-4.7 4.7-12.3 0-17zM208 368c-88.4 0-160-71.6-160-160S119.6 48 208 48s160 71.6 160 160-71.6 160-160 160z"/></svg>',
|
|
27357
|
+
url: '<svg style="fill: #595959; width: 14px; height: 14px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M314.222 197.78c51.091 51.091 54.377 132.287 9.75 187.16-6.242 7.73-2.784 3.865-84.94 86.02-54.696 54.696-143.266 54.745-197.99 0-54.711-54.69-54.734-143.255 0-197.99 32.773-32.773 51.835-51.899 63.409-63.457 7.463-7.452 20.331-2.354 20.486 8.192a173.31 173.31 0 0 0 4.746 37.828c.966 4.029-.272 8.269-3.202 11.198L80.632 312.57c-32.755 32.775-32.887 85.892 0 118.8 32.775 32.755 85.892 32.887 118.8 0l75.19-75.2c32.718-32.725 32.777-86.013 0-118.79a83.722 83.722 0 0 0-22.814-16.229c-4.623-2.233-7.182-7.25-6.561-12.346 1.356-11.122 6.296-21.885 14.815-30.405l4.375-4.375c3.625-3.626 9.177-4.594 13.76-2.294 12.999 6.524 25.187 15.211 36.025 26.049zM470.958 41.04c-54.724-54.745-143.294-54.696-197.99 0-82.156 82.156-78.698 78.29-84.94 86.02-44.627 54.873-41.341 136.069 9.75 187.16 10.838 10.838 23.026 19.525 36.025 26.049 4.582 2.3 10.134 1.331 13.76-2.294l4.375-4.375c8.52-8.519 13.459-19.283 14.815-30.405.621-5.096-1.938-10.113-6.561-12.346a83.706 83.706 0 0 1-22.814-16.229c-32.777-32.777-32.718-86.065 0-118.79l75.19-75.2c32.908-32.887 86.025-32.755 118.8 0 32.887 32.908 32.755 86.025 0 118.8l-45.848 45.84c-2.93 2.929-4.168 7.169-3.202 11.198a173.31 173.31 0 0 1 4.746 37.828c.155 10.546 13.023 15.644 20.486 8.192 11.574-11.558 30.636-30.684 63.409-63.457 54.733-54.735 54.71-143.3-.001-197.991z"/></svg>'
|
|
27358
|
+
};
|
|
27359
|
+
const BcmOldInput = class {
|
|
27360
|
+
constructor(hostRef) {
|
|
27361
|
+
registerInstance(this, hostRef);
|
|
27362
|
+
this.focus = createEvent(this, "bcm-focus", 7);
|
|
27363
|
+
this.blur = createEvent(this, "bcm-blur", 7);
|
|
27364
|
+
this.clear = createEvent(this, "bcm-clear", 7);
|
|
27365
|
+
this.change = createEvent(this, "bcm-change", 7);
|
|
27366
|
+
this.input = createEvent(this, "bcm-input", 7);
|
|
27367
|
+
this.inputId = `input-${++id}`;
|
|
27368
|
+
this.isBlur = false;
|
|
27369
|
+
this.type = 'text';
|
|
27370
|
+
this.value = '';
|
|
27371
|
+
this.size = "medium";
|
|
27372
|
+
this.label = undefined;
|
|
27373
|
+
this.noCaption = false;
|
|
27374
|
+
this.noMargin = false;
|
|
27375
|
+
this.captionError = undefined;
|
|
27376
|
+
this.caption = undefined;
|
|
27377
|
+
this.captionType = 'default';
|
|
27378
|
+
this.placeholder = undefined;
|
|
27379
|
+
this.fullWidth = false;
|
|
27380
|
+
this.disabled = false;
|
|
27381
|
+
this.readonly = false;
|
|
27382
|
+
this.clearable = false;
|
|
27383
|
+
this.passwordToggle = undefined;
|
|
27384
|
+
this.noDefaultIcon = undefined;
|
|
27385
|
+
this._id = undefined;
|
|
27386
|
+
this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
27387
|
+
this.name = undefined;
|
|
27388
|
+
this.unit = null;
|
|
27389
|
+
this.unitPrefix = null;
|
|
27390
|
+
this.decimal = undefined;
|
|
27391
|
+
this.min = null;
|
|
27392
|
+
this.max = null;
|
|
27393
|
+
this.step = null;
|
|
27394
|
+
this.hidden = false;
|
|
27395
|
+
this.required = false;
|
|
27396
|
+
this.disableWatchValue = false;
|
|
27397
|
+
this.maxLength = null;
|
|
27398
|
+
this.tooltip = undefined;
|
|
27399
|
+
this.inValid = false;
|
|
27400
|
+
this.valueCache = undefined;
|
|
27401
|
+
this.captionCache = undefined;
|
|
27402
|
+
this.captionTypeCache = undefined;
|
|
27403
|
+
this.hasFocus = false;
|
|
27404
|
+
this.isPasswordVisible = false;
|
|
27405
|
+
}
|
|
27406
|
+
async setFocus() {
|
|
27407
|
+
this.inputElement.focus();
|
|
27408
|
+
}
|
|
27409
|
+
async removeFocus() {
|
|
27410
|
+
this.inputElement.blur();
|
|
27411
|
+
}
|
|
27412
|
+
async select() {
|
|
27413
|
+
return this.inputElement.select();
|
|
27414
|
+
}
|
|
27415
|
+
async setValue(value) {
|
|
27416
|
+
this.inputElement.value = value;
|
|
27417
|
+
this.value = value;
|
|
27418
|
+
this.handleChange();
|
|
27419
|
+
return value;
|
|
27420
|
+
}
|
|
27421
|
+
async setClear() {
|
|
27422
|
+
this.inputElement.value = '';
|
|
27423
|
+
this.value = '';
|
|
27424
|
+
await delay(10);
|
|
27425
|
+
return Promise.resolve();
|
|
27426
|
+
}
|
|
27427
|
+
async resetCaption() {
|
|
27428
|
+
await delay(10);
|
|
27429
|
+
this.caption = this.captionCache;
|
|
27430
|
+
this.captionType = this.captionTypeCache;
|
|
27431
|
+
this.captionError = null;
|
|
27432
|
+
await delay(10);
|
|
27433
|
+
return Promise.resolve();
|
|
27434
|
+
}
|
|
27435
|
+
async getValue() {
|
|
27436
|
+
return this.value;
|
|
27437
|
+
}
|
|
27438
|
+
handleFocus() {
|
|
27439
|
+
this.hasFocus = true;
|
|
27440
|
+
this.focus.emit();
|
|
27441
|
+
}
|
|
27442
|
+
handleBlur() {
|
|
27443
|
+
this.hasFocus = false;
|
|
27444
|
+
this.isBlur = true;
|
|
27445
|
+
if (this.type == "email") {
|
|
27446
|
+
this.isEmailValid();
|
|
27447
|
+
}
|
|
27448
|
+
if (this.type == "tel") {
|
|
27449
|
+
this.isTelValid();
|
|
27450
|
+
}
|
|
27451
|
+
this.blur.emit();
|
|
27452
|
+
}
|
|
27453
|
+
handleChange() {
|
|
27454
|
+
this.value = this.inputElement.value;
|
|
27455
|
+
this.change.emit(this.value);
|
|
27456
|
+
}
|
|
27457
|
+
handleInput() {
|
|
27458
|
+
if (this.type == "number") {
|
|
27459
|
+
if (this.decimal == "false") {
|
|
27460
|
+
this.inputElement.value = this.inputElement.value.replace(/[^0-9-]/g, '');
|
|
27461
|
+
}
|
|
27462
|
+
else {
|
|
27463
|
+
this.inputElement.value = this.inputElement.value.replace(/[^0-9.,-]/g, '');
|
|
27464
|
+
}
|
|
27465
|
+
this.inputElement.value = this.inputElement.value.replace(/(\..*)\./g, '$1').replace(/(\-.*)\-/g, '$1');
|
|
27466
|
+
}
|
|
27467
|
+
this.value = this.inputElement.value;
|
|
27468
|
+
this.input.emit(this.value);
|
|
27469
|
+
}
|
|
27470
|
+
handleClear(e) {
|
|
27471
|
+
this.inputElement.value = '';
|
|
27472
|
+
this.value = '';
|
|
27473
|
+
this.inputElement.focus();
|
|
27474
|
+
this.change.emit(this.value);
|
|
27475
|
+
this.clear.emit(e);
|
|
27476
|
+
e.stopPropagation();
|
|
27477
|
+
}
|
|
27478
|
+
changePasswordVisibility() {
|
|
27479
|
+
this.isPasswordVisible = !this.isPasswordVisible;
|
|
27480
|
+
}
|
|
27481
|
+
incrementNumber() {
|
|
27482
|
+
if (!this.inValid && !this.disabled && !this.readonly) {
|
|
27483
|
+
let step = this.getNumberStep();
|
|
27484
|
+
let val = Number(this.value) + Number(step);
|
|
27485
|
+
this.value = this.numberDecimal(val);
|
|
27486
|
+
}
|
|
27487
|
+
}
|
|
27488
|
+
decrementNumber() {
|
|
27489
|
+
if (!this.inValid && !this.disabled && !this.readonly) {
|
|
27490
|
+
let step = this.getNumberStep();
|
|
27491
|
+
let val = Number(this.value) - Number(step);
|
|
27492
|
+
this.value = this.numberDecimal(val);
|
|
27493
|
+
}
|
|
27494
|
+
}
|
|
27495
|
+
getNumberStep(step = Number(this.step)) {
|
|
27496
|
+
let returnStep = 1;
|
|
27497
|
+
if (step && Number(step) == step)
|
|
27498
|
+
returnStep = step;
|
|
27499
|
+
return Number(returnStep);
|
|
27500
|
+
}
|
|
27501
|
+
connectedCallback() {
|
|
27502
|
+
this.changePasswordVisibility = this.changePasswordVisibility.bind(this);
|
|
27503
|
+
this.handleChange = this.handleChange.bind(this);
|
|
27504
|
+
this.handleBlur = this.handleBlur.bind(this);
|
|
27505
|
+
this.handleFocus = this.handleFocus.bind(this);
|
|
27506
|
+
this.handleInput = this.handleInput.bind(this);
|
|
27507
|
+
this.handleClear = this.handleClear.bind(this);
|
|
27508
|
+
this.incrementNumber = this.incrementNumber.bind(this);
|
|
27509
|
+
this.decrementNumber = this.decrementNumber.bind(this);
|
|
27510
|
+
this.valueCache = this.value;
|
|
27511
|
+
this.captionCache = this.caption;
|
|
27512
|
+
this.captionTypeCache = this.captionType;
|
|
27513
|
+
}
|
|
27514
|
+
validationRange(val = JSON.stringify({
|
|
27515
|
+
"value": this.value,
|
|
27516
|
+
"min": this.min,
|
|
27517
|
+
"max": this.max
|
|
27518
|
+
})) {
|
|
27519
|
+
let cap = null;
|
|
27520
|
+
let capType = null;
|
|
27521
|
+
let returnValidation = true;
|
|
27522
|
+
let item = JSON.parse(val);
|
|
27523
|
+
let { length, value, min, max } = item;
|
|
27524
|
+
length = parseFloat(length);
|
|
27525
|
+
value = parseFloat(value);
|
|
27526
|
+
min = parseFloat(min);
|
|
27527
|
+
max = parseFloat(max);
|
|
27528
|
+
length !== 0 && (value && (min && max && ((value < min || value > max) && (cap = "Please enter a value between " + min + " and " + max + ".",
|
|
27529
|
+
capType = "error",
|
|
27530
|
+
returnValidation = false)) || min && !max && (value < min && (cap = "Please enter a value greater than or equal to " + min + ".",
|
|
27531
|
+
capType = "error",
|
|
27532
|
+
returnValidation = false)) || !min && max && (value > max && (cap = "Please enter a value less than or equal to " + max + ".",
|
|
27533
|
+
capType = "error",
|
|
27534
|
+
returnValidation = false))));
|
|
27535
|
+
this.setCaption(cap, capType);
|
|
27536
|
+
return returnValidation;
|
|
27537
|
+
}
|
|
27538
|
+
setCaption(caption = null, captionType = null) {
|
|
27539
|
+
this.caption = caption ? caption : this.captionCache;
|
|
27540
|
+
this.captionType = captionType ? captionType : this.captionTypeCache;
|
|
27541
|
+
this.captionError = captionType == "error" ? caption : null;
|
|
27542
|
+
}
|
|
27543
|
+
isEmailValid() {
|
|
27544
|
+
const { value } = this;
|
|
27545
|
+
const regexp = new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
|
|
27546
|
+
let cap = null;
|
|
27547
|
+
let capType = null;
|
|
27548
|
+
if (value && !regexp.test(value)) {
|
|
27549
|
+
cap = "Please enter a valid email address.",
|
|
27550
|
+
capType = "error",
|
|
27551
|
+
this.inValid = true;
|
|
27552
|
+
}
|
|
27553
|
+
else {
|
|
27554
|
+
this.inValid = false;
|
|
27555
|
+
}
|
|
27556
|
+
this.setCaption(cap, capType);
|
|
27557
|
+
return this.inValid;
|
|
27558
|
+
}
|
|
27559
|
+
isTelValid() {
|
|
27560
|
+
const { value } = this;
|
|
27561
|
+
const regexp = new RegExp(/^(?=.*[0-9])[- +()0-9]+$/);
|
|
27562
|
+
let cap = null;
|
|
27563
|
+
let capType = null;
|
|
27564
|
+
if (value && !regexp.test(value)) {
|
|
27565
|
+
cap = "Please enter a valid phone number.",
|
|
27566
|
+
capType = "error",
|
|
27567
|
+
this.inValid = true;
|
|
27568
|
+
}
|
|
27569
|
+
else {
|
|
27570
|
+
this.inValid = false;
|
|
27571
|
+
}
|
|
27572
|
+
this.setCaption(cap, capType);
|
|
27573
|
+
return this.inValid;
|
|
27574
|
+
}
|
|
27575
|
+
isNumberValid(caption = "Invalid number", captionType = "error") {
|
|
27576
|
+
const { value } = this;
|
|
27577
|
+
if (value && Number(value) != value) {
|
|
27578
|
+
this.inValid = true;
|
|
27579
|
+
this.setCaption(caption, captionType);
|
|
27580
|
+
return true;
|
|
27581
|
+
}
|
|
27582
|
+
this.inValid = false;
|
|
27583
|
+
return false;
|
|
27584
|
+
}
|
|
27585
|
+
setNumberUnit() {
|
|
27586
|
+
const { value, unit } = this;
|
|
27587
|
+
if (Number(value) == value && (unit === null || unit === void 0 ? void 0 : unit.length) > 0 && !value)
|
|
27588
|
+
this.value = 0;
|
|
27589
|
+
}
|
|
27590
|
+
numberDecimal(val = '') {
|
|
27591
|
+
let decLen = this.getDecimalLength();
|
|
27592
|
+
if (val && decLen)
|
|
27593
|
+
return parseFloat(val).toFixed(decLen);
|
|
27594
|
+
return val;
|
|
27595
|
+
}
|
|
27596
|
+
numberNotDecimal(val = 0) {
|
|
27597
|
+
return Math.trunc(val);
|
|
27598
|
+
}
|
|
27599
|
+
getDecimalLength() {
|
|
27600
|
+
const { step } = this;
|
|
27601
|
+
let returnDecimalLength = 0, splitted, splitDec;
|
|
27602
|
+
if (step && Number(step) == step) {
|
|
27603
|
+
if (String(step).includes(".")) {
|
|
27604
|
+
splitted = String(step).split('.');
|
|
27605
|
+
splitDec = splitted[splitted.length - 1].length;
|
|
27606
|
+
}
|
|
27607
|
+
else {
|
|
27608
|
+
splitDec = 0;
|
|
27609
|
+
}
|
|
27610
|
+
returnDecimalLength = splitDec;
|
|
27611
|
+
}
|
|
27612
|
+
return Number(returnDecimalLength);
|
|
27613
|
+
}
|
|
27614
|
+
componentWillRender() {
|
|
27615
|
+
const { type } = this;
|
|
27616
|
+
if (type == "number" && this.value) {
|
|
27617
|
+
if (!this.isNumberValid()) {
|
|
27618
|
+
this.validationRange();
|
|
27619
|
+
}
|
|
27620
|
+
}
|
|
27621
|
+
if (this.isBlur) {
|
|
27622
|
+
if (type == "email" && this.value) {
|
|
27623
|
+
this.isEmailValid();
|
|
27624
|
+
}
|
|
27625
|
+
if (type == "tel" && this.value) {
|
|
27626
|
+
this.isTelValid();
|
|
27627
|
+
}
|
|
27628
|
+
}
|
|
27629
|
+
}
|
|
27630
|
+
componentWillLoad() {
|
|
27631
|
+
const { type, value } = this;
|
|
27632
|
+
if (type == "number" && Number(value) == value) {
|
|
27633
|
+
this.value = this.numberDecimal(value);
|
|
27634
|
+
}
|
|
27635
|
+
}
|
|
27636
|
+
numberControl(e) {
|
|
27637
|
+
if (!this.disabled && !this.readonly) {
|
|
27638
|
+
if (this.type == "number") {
|
|
27639
|
+
var which = e.which || 0;
|
|
27640
|
+
var key = e.key;
|
|
27641
|
+
which == 38 && ( // up arrow
|
|
27642
|
+
e.preventDefault(),
|
|
27643
|
+
this.incrementNumber());
|
|
27644
|
+
which == 40 && ( // down arrow
|
|
27645
|
+
e.preventDefault(),
|
|
27646
|
+
this.decrementNumber());
|
|
27647
|
+
key == "." && String(this.value).includes(".") && ( // dot: shouldn't be more than one
|
|
27648
|
+
e.preventDefault());
|
|
27649
|
+
if (which == 8 || //backspace / delete
|
|
27650
|
+
which == 9 || //tab
|
|
27651
|
+
which == 13 || //enter
|
|
27652
|
+
which == 16 || //shift
|
|
27653
|
+
which == 17 || //ctrl
|
|
27654
|
+
which == 18 || //alt
|
|
27655
|
+
which == 46 || //delete
|
|
27656
|
+
(which == 110 && (this.type == 'number' && this.decimal != false)) || //decimal point
|
|
27657
|
+
// (which == 188 && key == ",") || //comma
|
|
27658
|
+
(which == 190 && key == "." && (this.type == 'number' && this.decimal != false)) || //period
|
|
27659
|
+
(which == 189 && this.inputElement.value.length == 0) || //-
|
|
27660
|
+
(which == 109 && this.inputElement.value.length == 0) || //-
|
|
27661
|
+
(which >= 35 && which <= 40) || //end, home, left arrow, up arrow, right arrow, down arrow
|
|
27662
|
+
(which >= 48 && which <= 57) || //0-9
|
|
27663
|
+
(which >= 96 && which <= 105) //0-9(numpad)
|
|
27664
|
+
)
|
|
27665
|
+
return true;
|
|
27666
|
+
e.preventDefault();
|
|
27667
|
+
if (this.decimal == true) {
|
|
27668
|
+
this.value = this.numberDecimal(this.value);
|
|
27669
|
+
}
|
|
27670
|
+
else if (this.decimal == false) {
|
|
27671
|
+
this.value = this.numberNotDecimal(this.value);
|
|
27672
|
+
}
|
|
27673
|
+
}
|
|
27674
|
+
}
|
|
27675
|
+
}
|
|
27676
|
+
whatchHasFocus() {
|
|
27677
|
+
const { type, hasFocus, value, valueCache, inValid } = this;
|
|
27678
|
+
if (type == "number") {
|
|
27679
|
+
this.isNumberValid();
|
|
27680
|
+
let inValidState = false;
|
|
27681
|
+
if (hasFocus == true) {
|
|
27682
|
+
if (inValid == true) {
|
|
27683
|
+
this.value = '';
|
|
27684
|
+
inValidState = true;
|
|
27685
|
+
}
|
|
27686
|
+
}
|
|
27687
|
+
else {
|
|
27688
|
+
if (this.value == '' && inValid == false) {
|
|
27689
|
+
this.value = valueCache;
|
|
27690
|
+
inValidState = true;
|
|
27691
|
+
}
|
|
27692
|
+
if (value != valueCache && inValid == false && inValidState == false) {
|
|
27693
|
+
this.value = value ? this.numberDecimal(value) : '';
|
|
27694
|
+
}
|
|
27695
|
+
}
|
|
27696
|
+
}
|
|
27697
|
+
}
|
|
27698
|
+
watchValue() {
|
|
27699
|
+
if (!this.disableWatchValue && this.type != 'number') {
|
|
27700
|
+
this.handleChange();
|
|
27701
|
+
}
|
|
27702
|
+
}
|
|
27703
|
+
render() {
|
|
27704
|
+
const { value, size, label, type, captionType, caption, captionError, placeholder, fullWidth, disabled, readonly, clearable, passwordToggle, isPasswordVisible, noDefaultIcon, unit, inValid, hasFocus, unitPrefix, noCaption, required } = this;
|
|
27705
|
+
const containerClasses = classnames('input-container', {
|
|
27706
|
+
'full-width': fullWidth,
|
|
27707
|
+
'error': captionType == 'error' ? true : false
|
|
27708
|
+
});
|
|
27709
|
+
const baseClasses = classnames('input-base', 'input-' + size, {
|
|
27710
|
+
'invalid': inValid,
|
|
27711
|
+
'unit': (unit === null || unit === void 0 ? void 0 : unit.length) > 0,
|
|
27712
|
+
'focused': hasFocus,
|
|
27713
|
+
'disabled': disabled,
|
|
27714
|
+
'readonly': readonly,
|
|
27715
|
+
'empty': (value === null || value === void 0 ? void 0 : value.length) < 1
|
|
27716
|
+
});
|
|
27717
|
+
const inputClass = size === 'large' ? 'size-3' : 'size-2';
|
|
27718
|
+
const hostClasses = classnames(this.hidden ? 'hidden' : null, this.noMargin ? 'no-margin' : null);
|
|
27719
|
+
return (h$2(Host, { class: hostClasses }, h$2("div", { class: containerClasses }, label && h$2("div", null, h$2("bcm-label", { tooltip: this.tooltip, type: captionType, value: label, required: required, htmlFor: this.inputId })), h$2("div", { class: baseClasses }, h$2("span", { class: "input-prefix" }, h$2("slot", { name: "prefix" }), unitPrefix && h$2("span", { class: classnames(inputClass, 'unit-prefix') }, unitPrefix)), h$2("input", { "bcm-internal-id": this._id, id: this.inputId, class: inputClass, ref: el => (this.inputElement = el), onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onInput: this.handleInput, maxLength: this.maxLength, type: type === 'password' && isPasswordVisible ? 'text' :
|
|
27720
|
+
type === 'number' ? 'text' : type, placeholder: placeholder, value: type === 'number' && !this.hasFocus
|
|
27721
|
+
? value + (value && (unit === null || unit === void 0 ? void 0 : unit.length) > 0 ? ' ' + unit : '')
|
|
27722
|
+
: value, disabled: this.disabled, readonly: this.readonly }), clearable && !this.disabled && (h$2("button", { class: "input-clear-button", onClick: this.handleClear }, h$2("svg", { style: { "fill": "#595959", "width": "14px", "height": "14px" }, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512" }, h$2("path", { d: "M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z" })))), type === 'password' && passwordToggle && (h$2("button", { class: "input-password-toggle", onClick: this.changePasswordVisibility }, h$2("bcm-icon", { icon: isPasswordVisible ? "far fa-eye-invisible" : "far fa-eye" }))), Object.keys(defaultIcons).includes(type) && !noDefaultIcon && (h$2("span", { class: "input-suffix default-icon", innerHTML: defaultIcons[type] })), type === 'number' && (h$2("div", { class: classnames('caret-container', { 'unit': (unit === null || unit === void 0 ? void 0 : unit.length) > 0 }, { 'disabled': inValid }, { 'disabled': readonly }) }, h$2("span", { class: "caret", onClick: inValid == false && this.incrementNumber }, h$2("bcm-icon", { icon: "far fa-caret-up" })), h$2("span", { class: "caret", onClick: inValid == false && this.decrementNumber }, h$2("bcm-icon", { icon: "far fa-caret-down" })))), type !== 'number' && (h$2("span", { class: "input-suffix" }, h$2("slot", { name: "suffix" })))), h$2(CaptionTemplate, { noCaption: noCaption, captionType: captionType, captionError: captionError, caption: caption }))));
|
|
27723
|
+
}
|
|
27724
|
+
get el() { return getElement(this); }
|
|
27725
|
+
static get watchers() { return {
|
|
27726
|
+
"hasFocus": ["whatchHasFocus"],
|
|
27727
|
+
"value": ["watchValue"]
|
|
27728
|
+
}; }
|
|
27729
|
+
};
|
|
27730
|
+
BcmOldInput.style = oldInputCss;
|
|
27731
|
+
|
|
25763
27732
|
function _extends$4() {
|
|
25764
27733
|
_extends$4 = Object.assign ? Object.assign.bind() : function (target) {
|
|
25765
27734
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -37811,4 +39780,4 @@ const BcmTooltip = class {
|
|
|
37811
39780
|
get el() { return getElement(this); }
|
|
37812
39781
|
};
|
|
37813
39782
|
|
|
37814
|
-
export { BcmButton as bcm_button, BcmCheckbox as bcm_checkbox, BcmColorful as bcm_colorful, BcmDate as bcm_date, BcmForm as bcm_form, BcmIcon as bcm_icon, BcmInput as bcm_input, BcmLabel as bcm_label, BcmLinked as bcm_linked, BcmList as bcm_list, BcmRcOverflow as bcm_rc_overflow, BcmRcPicker as bcm_rc_picker, BcmSearch as bcm_search, BcmSwitch as bcm_switch, BcmTooltip as bcm_tooltip };
|
|
39783
|
+
export { BcmButton as bcm_button, BcmCheckbox as bcm_checkbox, BcmColorful as bcm_colorful, BcmDate as bcm_date, BcmDatePicker as bcm_date_picker, BcmDatetimePicker as bcm_datetime_picker, BcmForm as bcm_form, BcmIcon as bcm_icon, BcmInput as bcm_input, BcmLabel as bcm_label, BcmLinked as bcm_linked, BcmList as bcm_list, BcmOldInput as bcm_old_input, BcmRcOverflow as bcm_rc_overflow, BcmRcPicker as bcm_rc_picker, BcmSearch as bcm_search, BcmSwitch as bcm_switch, BcmTooltip as bcm_tooltip };
|