bromcom-ui 2.8.1 → 2.9.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/{p-4899fba4.entry.js → p-0906c9b4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e7028542.entry.js → p-0ee4e283.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4dac52f8.entry.js → p-0fdbbbe8.entry.js} +1 -1
- package/dist/bromcom-ui/p-14378828.entry.js +5 -0
- package/dist/bromcom-ui/{p-251bfa4c.entry.js → p-15fa3329.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9c9babdd.entry.js → p-1c5a2111.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e0618f5d.entry.js → p-20ac20d4.entry.js} +1 -1
- package/dist/bromcom-ui/p-24aefda6.js +1 -1
- package/dist/bromcom-ui/p-2cb4a196.entry.js +5 -0
- package/dist/bromcom-ui/p-2ea24a6e.js +1 -1
- package/dist/bromcom-ui/{p-0ee1ff83.entry.js → p-344a4674.entry.js} +1 -1
- package/dist/bromcom-ui/p-3ad545f0.entry.js +5 -0
- package/dist/bromcom-ui/{p-90894817.entry.js → p-40a5e4fc.entry.js} +1 -1
- package/dist/bromcom-ui/p-440afdfa.entry.js +5 -0
- package/dist/bromcom-ui/{p-94293d46.entry.js → p-4b34b3f9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a3aa9b2a.entry.js → p-55001c80.entry.js} +1 -1
- package/dist/bromcom-ui/{p-625af6e2.entry.js → p-5f288af5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-274465b7.entry.js → p-70b428e8.entry.js} +1 -1
- package/dist/bromcom-ui/p-89b21290.entry.js +5 -0
- package/dist/bromcom-ui/p-8d0ca8c2.js +1 -1
- package/dist/bromcom-ui/{p-e82340a2.entry.js → p-9b10d955.entry.js} +1 -1
- package/dist/bromcom-ui/{p-47b69111.entry.js → p-9c7e9b5d.entry.js} +1 -1
- package/dist/bromcom-ui/p-a0a3fd94.entry.js +5 -0
- package/dist/bromcom-ui/{p-f4f4e410.entry.js → p-a2046742.entry.js} +1 -1
- package/dist/bromcom-ui/p-a429e85b.js +1 -1
- package/dist/bromcom-ui/p-a97ee69d.entry.js +19 -0
- package/dist/bromcom-ui/{p-2fc1ab9a.entry.js → p-ab55def1.entry.js} +1 -1
- package/dist/bromcom-ui/p-b60bcecf.js +1 -1
- package/dist/bromcom-ui/{p-a8a4460a.entry.js → p-c9b10de5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-160ef457.entry.js → p-cad8f786.entry.js} +1 -1
- package/dist/bromcom-ui/{p-140b10d1.entry.js → p-e008411a.entry.js} +1 -1
- package/dist/bromcom-ui/p-e0f440b4.js +1 -1
- package/dist/bromcom-ui/{p-c15e0e77.entry.js → p-e3cafc0d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0d693b8b.entry.js → p-e606c42b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-86b8672d.entry.js → p-e66821e5.entry.js} +1 -1
- package/dist/cjs/{bcm-634604e3.js → bcm-ab921827.js} +4 -4
- package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
- package/dist/cjs/{bcm-colorful_2.cjs.entry.js → bcm-avatar_15.cjs.entry.js} +6232 -149
- package/dist/cjs/bcm-button-group.cjs.entry.js +5 -5
- package/dist/cjs/bcm-card.cjs.entry.js +3 -3
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +416 -0
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +4 -4
- package/dist/cjs/bcm-checkbox_2.cjs.entry.js +193 -0
- package/dist/cjs/bcm-color-input.cjs.entry.js +2 -2
- package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +7 -7
- package/dist/cjs/bcm-drawer.cjs.entry.js +4 -4
- package/dist/cjs/bcm-dropdown.cjs.entry.js +4 -4
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +2 -2
- package/dist/cjs/bcm-form-2.cjs.entry.js +4 -3
- package/dist/cjs/bcm-item.cjs.entry.js +2 -2
- package/dist/cjs/bcm-items.cjs.entry.js +2 -2
- package/dist/cjs/bcm-link.cjs.entry.js +3 -3
- package/dist/cjs/bcm-menu.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +2 -2
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +2 -2
- package/dist/cjs/bcm-modal-2.cjs.entry.js +3 -3
- package/dist/cjs/bcm-modal.cjs.entry.js +5 -5
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +3 -3
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +3 -3
- package/dist/cjs/bcm-popover.cjs.entry.js +5 -5
- package/dist/cjs/bcm-progress.cjs.entry.js +2 -2
- package/dist/cjs/bcm-radio-group.cjs.entry.js +6 -6
- package/dist/cjs/bcm-radio.cjs.entry.js +9 -9
- package/dist/cjs/bcm-range.cjs.entry.js +4 -4
- package/dist/cjs/bcm-select.cjs.entry.js +2 -2
- package/dist/cjs/bcm-stepper.cjs.entry.js +4 -4
- package/dist/cjs/bcm-switch.cjs.entry.js +7 -7
- package/dist/cjs/bcm-tab-group.cjs.entry.js +3 -3
- package/dist/cjs/bcm-tab-item-header.cjs.entry.js +6 -6
- package/dist/cjs/bcm-tab-item.cjs.entry.js +2 -2
- package/dist/cjs/bcm-tag.cjs.entry.js +12 -12
- package/dist/cjs/bcm-text.cjs.entry.js +3 -3
- package/dist/cjs/bcm-textarea.cjs.entry.js +5 -5
- package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-toast.cjs.entry.js +9 -9
- package/dist/cjs/bromcom-ui.cjs.js +1 -1
- package/dist/cjs/{floating-ui-74eb26d6.js → floating-ui-c9fc2202.js} +2 -2
- package/dist/cjs/{input-template-4617f909.js → input-template-1441e468.js} +5 -5
- package/dist/cjs/{label-template-cc69bc21.js → label-template-4d5f99a5.js} +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +4 -4
- package/dist/cjs/old-bcm-popover.cjs.entry.js +3 -3
- package/dist/cjs/{popover-placement-3c8f3a72.js → popover-placement-ccb40073.js} +1 -1
- package/dist/cjs/{slot-template-3e59d7d8.js → slot-template-d70ea082.js} +1 -1
- package/dist/cjs/{string-helper-45cffee0.js → string-helper-d681e5c7.js} +2 -2
- package/dist/cjs/{tooltip-helper-2e8b879b.js → tooltip-helper-235b26ea.js} +6 -6
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/chip/chip-group.js +292 -0
- package/dist/collection/components/atoms/chip/chip.js +107 -26
- package/dist/collection/components/organism/form/form.js +1 -0
- package/dist/collection/components/organism/form-2/bcm-form-components.js +1 -0
- package/dist/collection/components/organism/list/list.css +3 -0
- package/dist/components/bcm-chip-group.d.ts +11 -0
- package/dist/components/bcm-chip-group.js +174 -0
- package/dist/components/bcm-chip.js +1 -100
- package/dist/components/bcm-form-2.js +1 -0
- package/dist/components/bcm-form.js +1 -0
- package/dist/components/bcm-list.js +1 -1702
- package/dist/{esm/bcm-chip.entry.js → components/chip.js} +110 -33
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/{esm/bcm-list.entry.js → components/list.js} +136 -31
- package/dist/esm/bcm-9f50af9c.js +1 -1
- package/dist/esm/{bcm-colorful_2.entry.js → bcm-avatar_15.entry.js} +6219 -149
- package/dist/esm/bcm-button-group.entry.js +1 -1
- package/dist/esm/bcm-checkbox-group.entry.js +412 -0
- package/dist/esm/bcm-checkbox-lite_9.entry.js +1 -1
- package/dist/esm/bcm-checkbox_2.entry.js +188 -0
- package/dist/esm/bcm-date-picker.entry.js +1 -1
- package/dist/esm/bcm-datetime-picker.entry.js +1 -1
- package/dist/esm/bcm-drawer.entry.js +1 -1
- package/dist/esm/bcm-dropdown.entry.js +1 -1
- package/dist/esm/bcm-form-2.entry.js +2 -1
- package/dist/esm/bcm-item.entry.js +1 -1
- package/dist/esm/bcm-link.entry.js +1 -1
- package/dist/esm/bcm-modal-2.entry.js +1 -1
- package/dist/esm/bcm-modal.entry.js +1 -1
- package/dist/esm/bcm-popconfirm.entry.js +1 -1
- package/dist/esm/bcm-popover.entry.js +1 -1
- package/dist/esm/bcm-progress.entry.js +1 -1
- package/dist/esm/bcm-radio-group.entry.js +1 -1
- package/dist/esm/bcm-radio.entry.js +1 -1
- package/dist/esm/bcm-range.entry.js +1 -1
- package/dist/esm/bcm-stepper.entry.js +1 -1
- package/dist/esm/bcm-switch.entry.js +1 -1
- package/dist/esm/bcm-tab-group.entry.js +1 -1
- package/dist/esm/bcm-tab-item-header.entry.js +1 -1
- package/dist/esm/bcm-tag.entry.js +1 -1
- package/dist/esm/bcm-textarea.entry.js +1 -1
- package/dist/esm/bcm-time-picker.entry.js +1 -1
- package/dist/esm/bcm-toast.entry.js +1 -1
- package/dist/esm/bromcom-ui.js +1 -1
- package/dist/esm/floating-ui-e7341329.js +1 -1
- package/dist/esm/input-template-e1df6efd.js +1 -1
- package/dist/esm/label-template-d74fe788.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/old-bcm-popover.entry.js +1 -1
- package/dist/esm/string-helper-6bd24967.js +1 -1
- package/dist/esm/tooltip-helper-10b64c23.js +1 -1
- package/dist/types/components/atoms/chip/chip-group.d.ts +22 -0
- package/dist/types/components/atoms/chip/chip.d.ts +18 -13
- package/dist/types/components.d.ts +47 -4
- package/package.json +1 -1
- package/dist/bromcom-ui/p-111c4b6a.entry.js +0 -5
- package/dist/bromcom-ui/p-121eca04.entry.js +0 -5
- package/dist/bromcom-ui/p-1eabd5dc.js +0 -10
- package/dist/bromcom-ui/p-55837df1.entry.js +0 -5
- package/dist/bromcom-ui/p-8c62e1ca.entry.js +0 -5
- package/dist/bromcom-ui/p-9d23288e.entry.js +0 -5
- package/dist/bromcom-ui/p-b4f40047.entry.js +0 -5
- package/dist/bromcom-ui/p-b5ba17a4.entry.js +0 -13
- package/dist/bromcom-ui/p-b85bdadc.entry.js +0 -5
- package/dist/bromcom-ui/p-cbb3c1f0.entry.js +0 -5
- package/dist/bromcom-ui/p-d155cf69.entry.js +0 -5
- package/dist/bromcom-ui/p-f3d550ed.entry.js +0 -5
- package/dist/bromcom-ui/p-fdc8effc.entry.js +0 -5
- package/dist/cjs/bcm-avatar_2.cjs.entry.js +0 -139
- package/dist/cjs/bcm-button_7.cjs.entry.js +0 -1521
- package/dist/cjs/bcm-chip.cjs.entry.js +0 -74
- package/dist/cjs/bcm-input.cjs.entry.js +0 -370
- package/dist/cjs/bcm-list.cjs.entry.js +0 -1607
- package/dist/cjs/bcm-rc-overflow_2.cjs.entry.js +0 -2443
- package/dist/cjs/bcm-typography.cjs.entry.js +0 -21
- package/dist/cjs/index-906fb4e5.js +0 -540
- package/dist/esm/bcm-avatar_2.entry.js +0 -134
- package/dist/esm/bcm-button_7.entry.js +0 -1511
- package/dist/esm/bcm-input.entry.js +0 -366
- package/dist/esm/bcm-rc-overflow_2.entry.js +0 -2438
- package/dist/esm/bcm-typography.entry.js +0 -17
- package/dist/esm/index-6310a048.js +0 -537
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-39133086.js';
|
|
6
|
-
import { G as Generate } from './generate-a39b1045.js';
|
|
7
|
-
import { N as NumberHelper } from './number-helper-fa8e8000.js';
|
|
8
|
-
import { S as StringHelper } from './string-helper-6bd24967.js';
|
|
9
|
-
import { V as Validators } from './validators-dd70be40.js';
|
|
10
|
-
import { B as Bcm } from './bcm-9f50af9c.js';
|
|
11
|
-
import { C as CaptionTemplate } from './caption-template-da16ba7b.js';
|
|
12
|
-
import { I as InputTemplate } from './input-template-e1df6efd.js';
|
|
13
|
-
import { c as classnames } from './index-ed9652af.js';
|
|
14
|
-
import { d as delay } from './utils-57652744.js';
|
|
15
|
-
import { I as IsLoad } from './is-load-decorator-bc14ec4b.js';
|
|
16
|
-
import './colors-44c95e7e.js';
|
|
17
|
-
import './_commonjsHelpers-3016b722.js';
|
|
18
|
-
import './types-6f06fa1a.js';
|
|
19
|
-
|
|
20
|
-
const inputCss = "@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\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{box-sizing:border-box}.bcm-caption-area{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-size:12px;line-height:calc(12px + 8px);color:var(--bcm-new-ds-color-slate-400);display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;flex-wrap:nowrap;margin-top:2px}.bcm-caption-area__text{color:var(--bcm-new-ds-color-slate-400)}.bcm-caption-area__text.default{color:var(--bcm-new-ds-color-slate-400)}.bcm-caption-area__text.info{color:var(--bcm-new-ds-color-blue-500)}.bcm-caption-area__text.success{color:var(--bcm-new-ds-color-emerald-500)}.bcm-caption-area__text.warning{color:var(--bcm-new-ds-color-amber-500)}.bcm-caption-area__text.error{color:var(--bcm-new-ds-color-red-500)}.bcm-caption-area__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-caption-area__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-caption-area__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 8px)}*{box-sizing:border-box}.bcm-label{display:inline-flex;align-items:flex-start;grid-gap:2px}.bcm-label__text{margin-bottom:2px;font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:inline-block;color:var(--bcm-new-ds-color-slate-600)}.bcm-label__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-label__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-label__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 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-input{display:inline-flex;flex-direction:column;width:100%;max-width:256px;margin-bottom:8px}.bcm-input.full-width{max-width:100%}.bcm-input.hidden{display:none}.bcm-input__container{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:flex;align-items:stretch;flex-direction:row;background-color:var(--bcm-new-ds-color-white);border:1px solid var(--bcm-new-ds-color-slate-300);border-radius:4px;box-sizing:border-box;cursor:text;padding:0 0 0 4px;position:relative;width:100%}.bcm-input__container.disabled{background-color:var(--bcm-new-ds-color-slate-50);cursor:not-allowed}.bcm-input__container.disabled .bcm-input-element{color:var(--bcm-new-ds-color-slate-500)}.bcm-input__container.readonly{background-color:var(--bcm-new-ds-color-slate-50);cursor:default}.bcm-input__container.readonly .bcm-input-element{color:var(--bcm-new-ds-color-slate-600)}.bcm-input__container:not(.disabled):hover .caret-container,.bcm-input__container:not(.disabled).focused .caret-container{opacity:1}.bcm-input__container:not(.disabled):hover .input-clear-button,.bcm-input__container:not(.disabled).focused .input-clear-button{opacity:1}.bcm-input__container:not(.disabled).focused{background-color:var(--bcm-new-ds-color-slate-50)}.bcm-input__container:not(.disabled):hover{border-color:var(--bcm-color-prime-blue-6)}.bcm-input__container.empty .input-clear-button{display:none}.bcm-input__container.invalid,.bcm-input__container.error{border-color:var(--bcm-new-ds-color-red-500)}.bcm-input__container .bcm-input-element{width:100%;color:var(--bcm-new-ds-color-slate-600);flex:1;border:none;background:transparent;box-shadow:unset;padding:0 4px;font-family:\"Inter\", sans-serif;cursor:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;overflow:hidden;text-overflow:ellipsis}.bcm-input__container .bcm-input-element::placeholder{font-family:\"Inter\", sans-serif;color:var(--bcm-new-ds-color-slate-300);user-select:none}.bcm-input__container .bcm-input-element::-webkit-search-decoration,.bcm-input__container .bcm-input-element::-webkit-search-cancel-button,.bcm-input__container .bcm-input-element::-webkit-search-results-button,.bcm-input__container .bcm-input-element::-webkit-search-results-decoration,.bcm-input__container .bcm-input-element::-webkit-calendar-picker-indicator,.bcm-input__container .bcm-input-element::-webkit-inner-spin-button,.bcm-input__container .bcm-input-element::-webkit-outer-spin-button{-webkit-appearance:none}.bcm-input__container .caret-container{width:30px;display:flex;flex-direction:column;justify-content:center;align-items:stretch;border-left:1px solid #D9D9D9;transition:0.2s opacity;user-select:none;box-sizing:border-box}.bcm-input__container .caret-container .bcm-input-caret{display:flex;align-items:center;justify-content:center;color:var(--bcm-color-grey-7);cursor:pointer;flex:1}.bcm-input__container .caret-container .bcm-input-caret bcm-icon{line-height:1}.bcm-input__container .caret-container .bcm-input-caret:hover{color:var(--bcm-color-prime-blue-6)}.bcm-input__container .caret-container .bcm-input-caret:active{background-color:var(--bcm-color-grey-3)}.bcm-input__container .caret-container .bcm-input-caret:last-child{border-top:1px solid #D9D9D9}.bcm-input__container .caret-container.disabled{background-color:var(--bcm-color-grey-3)}.bcm-input__container .caret-container.disabled .bcm-input-caret{cursor:not-allowed}.bcm-input__container .input-suffix-content{display:flex;align-items:center;justify-content:center}.bcm-input__container .input-prefix:not(:empty){padding-left:4px}.bcm-input__container .input-suffix:not(:empty){min-width:24px;padding-right:4px}.bcm-input__container .input-prefix:not(:empty),.bcm-input__container .input-suffix:not(:empty){display:flex;align-items:center;justify-content:center;cursor:default;color:#64748a}.bcm-input__container .input-prefix:not(:empty) .unit-prefix,.bcm-input__container .input-suffix:not(:empty) .unit-prefix{color:#64748a}.bcm-input__container .input-prefix-button:not(:empty),.bcm-input__container .input-suffix-button:not(:empty){cursor:pointer}.bcm-input__container .caret-container,.bcm-input__container .input-clear-button{opacity:0}.bcm-input__container--small{font-size:12px}.bcm-input__container--medium{font-size:14px}.bcm-input__container--large{font-size:16px}.bcm-input__textarea.clearable .bcm-input-element{padding-right:24px}.bcm-input__textarea .input-clear-button{position:absolute;top:4px;right:0}";
|
|
21
|
-
|
|
22
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
23
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
25
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
26
|
-
else
|
|
27
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
28
|
-
if (d = decorators[i])
|
|
29
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
30
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
31
|
-
};
|
|
32
|
-
const BcmInput = class {
|
|
33
|
-
constructor(hostRef) {
|
|
34
|
-
registerInstance(this, hostRef);
|
|
35
|
-
this.focus = createEvent(this, "bcm-focus", 7);
|
|
36
|
-
this.blur = createEvent(this, "bcm-blur", 7);
|
|
37
|
-
this.clear = createEvent(this, "bcm-clear", 7);
|
|
38
|
-
this.change = createEvent(this, "bcm-change", 7);
|
|
39
|
-
this.input = createEvent(this, "bcm-input", 7);
|
|
40
|
-
this.isBlur = false;
|
|
41
|
-
this._id = Generate.UID();
|
|
42
|
-
this._internal_id = Generate.UID();
|
|
43
|
-
this.value = '';
|
|
44
|
-
this.size = Bcm.Size.medium;
|
|
45
|
-
this.label = undefined;
|
|
46
|
-
this.pattern = undefined;
|
|
47
|
-
this.tooltip = undefined;
|
|
48
|
-
this.placeholder = undefined;
|
|
49
|
-
this.disabled = false;
|
|
50
|
-
this.readonly = false;
|
|
51
|
-
this.clearable = false;
|
|
52
|
-
this.autocomplete = false;
|
|
53
|
-
this.name = undefined;
|
|
54
|
-
this.type = Bcm.InputType.text;
|
|
55
|
-
this.hidden = false;
|
|
56
|
-
this.required = false;
|
|
57
|
-
this.fullWidth = false;
|
|
58
|
-
this.noDefaultIcon = undefined;
|
|
59
|
-
this.disableWatchValue = false // datetimepicker
|
|
60
|
-
;
|
|
61
|
-
this.passwordToggle = false // type password
|
|
62
|
-
;
|
|
63
|
-
this.maxLength = null;
|
|
64
|
-
this.unitPrefix = null;
|
|
65
|
-
this.unit = undefined;
|
|
66
|
-
this.decimal = true;
|
|
67
|
-
this.min = undefined;
|
|
68
|
-
this.max = undefined;
|
|
69
|
-
this.step = undefined;
|
|
70
|
-
this.caption = undefined;
|
|
71
|
-
this.noCaption = false;
|
|
72
|
-
this.captionType = Bcm.Status.default;
|
|
73
|
-
this.captionError = undefined;
|
|
74
|
-
this.customErrorMessage = undefined;
|
|
75
|
-
this._prefix = undefined;
|
|
76
|
-
this._suffix = undefined;
|
|
77
|
-
this.captionCache = undefined;
|
|
78
|
-
this.captionTypeCache = undefined;
|
|
79
|
-
this.inValid = false;
|
|
80
|
-
this.valueCache = '';
|
|
81
|
-
this.focused = false;
|
|
82
|
-
this.isPasswordVisible = false;
|
|
83
|
-
}
|
|
84
|
-
connectedCallback() {
|
|
85
|
-
this.valueCache = this.value;
|
|
86
|
-
this.captionCache = this.caption;
|
|
87
|
-
this.captionTypeCache = this.captionType;
|
|
88
|
-
}
|
|
89
|
-
componentWillRender() {
|
|
90
|
-
const { type, isBlur, value } = this;
|
|
91
|
-
if (value) {
|
|
92
|
-
this.value.length > 0 && (this.checkPattern());
|
|
93
|
-
switch (type) {
|
|
94
|
-
case "number":
|
|
95
|
-
{
|
|
96
|
-
!this.checkValid("number") && (this.validationRange());
|
|
97
|
-
}
|
|
98
|
-
break;
|
|
99
|
-
case "email":
|
|
100
|
-
{
|
|
101
|
-
isBlur && (this.checkValid("email"));
|
|
102
|
-
}
|
|
103
|
-
break;
|
|
104
|
-
case "tel":
|
|
105
|
-
{
|
|
106
|
-
isBlur && (this.checkValid("phone"));
|
|
107
|
-
}
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
!this.required && (this.resetCaption());
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
async onBcmFocus() {
|
|
116
|
-
this.inputElement.focus();
|
|
117
|
-
}
|
|
118
|
-
async onBcmBlur() {
|
|
119
|
-
this.inputElement.blur();
|
|
120
|
-
}
|
|
121
|
-
async onBcmSelect() {
|
|
122
|
-
this.inputElement.select();
|
|
123
|
-
}
|
|
124
|
-
async set(data) {
|
|
125
|
-
await this.setValue(data);
|
|
126
|
-
}
|
|
127
|
-
async get() {
|
|
128
|
-
return this.value || null;
|
|
129
|
-
}
|
|
130
|
-
async setValue(value) {
|
|
131
|
-
this.inputElement.value = value;
|
|
132
|
-
this.handleChange();
|
|
133
|
-
return value;
|
|
134
|
-
}
|
|
135
|
-
async setClear() {
|
|
136
|
-
this.inputElement.value = '';
|
|
137
|
-
this.value = '';
|
|
138
|
-
await delay(10);
|
|
139
|
-
return Promise.resolve();
|
|
140
|
-
}
|
|
141
|
-
async resetCaption() {
|
|
142
|
-
await delay(10);
|
|
143
|
-
this.caption = this.captionCache;
|
|
144
|
-
this.captionType = this.captionTypeCache;
|
|
145
|
-
this.captionError = null;
|
|
146
|
-
this.inValid = false;
|
|
147
|
-
await delay(10);
|
|
148
|
-
return Promise.resolve();
|
|
149
|
-
}
|
|
150
|
-
async getValue() {
|
|
151
|
-
return this.value;
|
|
152
|
-
}
|
|
153
|
-
watchValue(newValue) {
|
|
154
|
-
this.inputElement.value = newValue;
|
|
155
|
-
if (!this.disableWatchValue && this.type != "number") {
|
|
156
|
-
this.handleChange();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
listenKeyDown(e) {
|
|
160
|
-
if (!this.disabled && !this.readonly) {
|
|
161
|
-
this.onBcmFocus();
|
|
162
|
-
if (this.type == "number") {
|
|
163
|
-
var which = e.which || 0;
|
|
164
|
-
var key = e.key;
|
|
165
|
-
if (which == 38) { // up arrow
|
|
166
|
-
e.preventDefault(),
|
|
167
|
-
this.stepUpOrDown('up');
|
|
168
|
-
}
|
|
169
|
-
if (which == 40) { // down arrow
|
|
170
|
-
e.preventDefault(),
|
|
171
|
-
this.stepUpOrDown('down');
|
|
172
|
-
}
|
|
173
|
-
if ((which == 190 || which == 110 || key == ".") && this.value.indexOf(".") > -1) { //.
|
|
174
|
-
e.preventDefault();
|
|
175
|
-
}
|
|
176
|
-
if ((which == 189 || which == 109 || key == "-")) { //-
|
|
177
|
-
if (this.value.charAt(0) == '-' || this.value.indexOf("-") > -1) {
|
|
178
|
-
e.preventDefault();
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
handleFocus() {
|
|
185
|
-
this.focused = true;
|
|
186
|
-
this.focus.emit();
|
|
187
|
-
this.whatchHasFocus();
|
|
188
|
-
}
|
|
189
|
-
handleBlur() {
|
|
190
|
-
this.focused = false;
|
|
191
|
-
this.isBlur = true;
|
|
192
|
-
this.whatchHasFocus();
|
|
193
|
-
this.blur.emit();
|
|
194
|
-
}
|
|
195
|
-
handleChange() {
|
|
196
|
-
this.valueSync();
|
|
197
|
-
}
|
|
198
|
-
handleInput() {
|
|
199
|
-
if (this.type == "number" && this.maxLength) {
|
|
200
|
-
const inputValue = this.inputElement.value;
|
|
201
|
-
if (inputValue && inputValue.length > 0 && inputValue.length > this.maxLength) {
|
|
202
|
-
this.inputElement.value = inputValue.substring(0, this.maxLength);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
this.valueSync();
|
|
206
|
-
}
|
|
207
|
-
valueSync() {
|
|
208
|
-
if (this.value != this.inputElement.value) {
|
|
209
|
-
this.value = this.inputElement.value;
|
|
210
|
-
this.change.emit(this.value);
|
|
211
|
-
return true;
|
|
212
|
-
}
|
|
213
|
-
this.input.emit(this.value);
|
|
214
|
-
return false;
|
|
215
|
-
}
|
|
216
|
-
handleClear(e) {
|
|
217
|
-
this.inputElement.value = '';
|
|
218
|
-
this.value = '';
|
|
219
|
-
this.inputElement.focus();
|
|
220
|
-
this.clear.emit(e);
|
|
221
|
-
this.change.emit(this.value);
|
|
222
|
-
e.stopPropagation();
|
|
223
|
-
}
|
|
224
|
-
changePasswordVisibility() {
|
|
225
|
-
this.isPasswordVisible = !this.isPasswordVisible;
|
|
226
|
-
}
|
|
227
|
-
setCaption(caption = null, captionType = null) {
|
|
228
|
-
this.caption = caption || this.captionCache;
|
|
229
|
-
this.captionType = captionType || this.captionTypeCache;
|
|
230
|
-
this.captionError = captionType == "error" ? caption : null;
|
|
231
|
-
}
|
|
232
|
-
stepUpOrDown(type) {
|
|
233
|
-
if (!this.inValid && !this.disabled && !this.readonly) {
|
|
234
|
-
let step = +(this.step) || 1;
|
|
235
|
-
let val = +(this.value);
|
|
236
|
-
if (type == 'up') {
|
|
237
|
-
val = +(val + step);
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
val = +(val - step);
|
|
241
|
-
}
|
|
242
|
-
this.value = val.toString();
|
|
243
|
-
this.change.emit(this.value);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
validationRange() {
|
|
247
|
-
const { min, max, value } = this;
|
|
248
|
-
if (value) {
|
|
249
|
-
if (min && max) {
|
|
250
|
-
if (value < min || value > max) {
|
|
251
|
-
this.setCaption(StringHelper.getMessage('between', [min, max]), "error");
|
|
252
|
-
return false;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
else if (min) {
|
|
256
|
-
if (value < min) {
|
|
257
|
-
this.setCaption(StringHelper.getMessage('min', [min]), "error");
|
|
258
|
-
return false;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
else if (max) {
|
|
262
|
-
if (value > max) {
|
|
263
|
-
this.setCaption(StringHelper.getMessage('max', [max]), "error");
|
|
264
|
-
return false;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
this.setCaption();
|
|
269
|
-
return true;
|
|
270
|
-
}
|
|
271
|
-
checkPattern() {
|
|
272
|
-
const { pattern, value } = this;
|
|
273
|
-
if (pattern) {
|
|
274
|
-
if (Validators.pattern(value, pattern)) {
|
|
275
|
-
this.setCaption();
|
|
276
|
-
this.inValid = false;
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
this.setCaption(StringHelper.getMessage('pattern'), "error");
|
|
280
|
-
this.inValid = true;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
checkValid(type) {
|
|
285
|
-
const { value } = this;
|
|
286
|
-
if (Validators.isValidate(value, type)) {
|
|
287
|
-
this.setCaption();
|
|
288
|
-
this.inValid = false;
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
this.setCaption(StringHelper.getMessage(type), "error");
|
|
292
|
-
this.inValid = true;
|
|
293
|
-
}
|
|
294
|
-
return this.inValid;
|
|
295
|
-
}
|
|
296
|
-
whatchHasFocus() {
|
|
297
|
-
const { type, focused, valueCache, inValid } = this;
|
|
298
|
-
if (type == Bcm.InputType.number && inValid) {
|
|
299
|
-
console.log("whatchHasFocus");
|
|
300
|
-
if (focused) {
|
|
301
|
-
this.value = '';
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
if (!StringHelper.isNullOrEmpty(this.value)) {
|
|
305
|
-
this.value = this.value ? this.fixToNumber(this.value) : '';
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
this.value = valueCache;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
fixToNumber(val) {
|
|
314
|
-
if (val) {
|
|
315
|
-
const decLen = NumberHelper.getDecimalLength(this.step);
|
|
316
|
-
return decLen > 0 ? NumberHelper.parseFloatFixed(val, decLen) : val;
|
|
317
|
-
}
|
|
318
|
-
return val;
|
|
319
|
-
}
|
|
320
|
-
eyeDropper() {
|
|
321
|
-
const eyeDropper = new window.EyeDropper();
|
|
322
|
-
eyeDropper
|
|
323
|
-
.open()
|
|
324
|
-
.then((color) => {
|
|
325
|
-
console.log("color: ", color.sRGBHex);
|
|
326
|
-
this.setValue(color.sRGBHex);
|
|
327
|
-
})
|
|
328
|
-
.catch((error) => {
|
|
329
|
-
if (error.name === "NotAllowedError") {
|
|
330
|
-
console.log("Permission to access sensor was denied.");
|
|
331
|
-
}
|
|
332
|
-
else if (error.name === "NotSupportedError") {
|
|
333
|
-
console.log("Sensor not supported.");
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
isEyeDropperSupported() {
|
|
338
|
-
return typeof window !== "undefined" && "EyeDropper" in window;
|
|
339
|
-
}
|
|
340
|
-
toggleLinked() {
|
|
341
|
-
const linkedElement = document.getElementById(`${this._id}-linked`);
|
|
342
|
-
if (linkedElement) {
|
|
343
|
-
linkedElement.toggle();
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
render() {
|
|
347
|
-
const { value, size, label, type, captionType, caption, captionError, placeholder, fullWidth, disabled, readonly, clearable, passwordToggle, isPasswordVisible, noDefaultIcon, unit, inValid, focused, unitPrefix, noCaption, required, hidden, _id, autocomplete } = this;
|
|
348
|
-
const isActiveClearable = (value === null || value === void 0 ? void 0 : value.length) > 0 && clearable;
|
|
349
|
-
const hostClasses = classnames('bcm-input', `bcm-input__container--${size}`, {
|
|
350
|
-
hidden,
|
|
351
|
-
// 'no-margin': noMargin,
|
|
352
|
-
'full-width': fullWidth
|
|
353
|
-
});
|
|
354
|
-
return (h(Host, { onfocus: () => this.onBcmFocus(), class: hostClasses, onClick: () => this.onBcmFocus() }, label && h("bcm-label", { onClick: () => this.toggleLinked(), tooltip: this.tooltip, type: captionType, value: label, required: required, htmlFor: _id }), h(InputTemplate, { id: _id, type: type, value: value, pattern: this.pattern, placeholder: placeholder, disabled: disabled, readonly: readonly, clearable: isActiveClearable, passwordToggle: passwordToggle, isPasswordVisible: isPasswordVisible, noDefaultIcon: noDefaultIcon, focused: focused, inValid: inValid, unitPrefix: unitPrefix, maxLength: this.maxLength, internalId: this._internal_id, captionType: captionType, unit: unit, size: size, handleFocus: () => this.handleFocus(), handleBlur: () => this.handleBlur(), handleChange: () => this.handleChange(), handleInput: () => this.handleInput(), steps: (e) => this.stepUpOrDown(e), changePasswordVisibility: () => this.changePasswordVisibility(), handleClear: (e) => this.handleClear(e), eyeDropper: () => this.eyeDropper(), isEyeDropperSupported: () => this.isEyeDropperSupported(), ref: (el) => this.inputElement = el, _suffix: this._suffix, _prefix: this._prefix, autocomplete: autocomplete }), h(CaptionTemplate, { noCaption: noCaption, captionType: captionType, captionError: captionError, caption: caption, customErrorMessage: this.customErrorMessage }), type == Bcm.InputType.color &&
|
|
355
|
-
h("bcm-linked", { targetId: this._id + "-container", id: this._id + "-linked" }, h("bcm-colorful", { id: this._id + "-picker", color: this.value, onBcmChange: e => this.setValue(e.detail) }))));
|
|
356
|
-
}
|
|
357
|
-
static get watchers() { return {
|
|
358
|
-
"value": ["watchValue"]
|
|
359
|
-
}; }
|
|
360
|
-
};
|
|
361
|
-
__decorate([
|
|
362
|
-
IsLoad()
|
|
363
|
-
], BcmInput.prototype, "inputElement", void 0);
|
|
364
|
-
BcmInput.style = inputCss;
|
|
365
|
-
|
|
366
|
-
export { BcmInput as bcm_input };
|