bromcom-ui 2.11.1-rc.9-5 → 2.11.1-rc.9-7
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-053dc717.entry.js +5 -0
- package/dist/bromcom-ui/{p-51ba5764.entry.js → p-070c3309.entry.js} +1 -1
- package/dist/bromcom-ui/{p-62d2c650.entry.js → p-0b276355.entry.js} +1 -1
- package/dist/bromcom-ui/{p-beaec5b8.js → p-0bda558d.js} +1 -1
- package/dist/bromcom-ui/{p-77ef609e.entry.js → p-1c801d0c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a486613b.entry.js → p-1c9314bd.entry.js} +1 -1
- package/dist/bromcom-ui/p-228b5376.entry.js +16 -0
- package/dist/bromcom-ui/{p-9b2e26f6.entry.js → p-23c24cf7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d59d9687.entry.js → p-2aaeb247.entry.js} +1 -1
- package/dist/bromcom-ui/{p-788d1fb1.entry.js → p-30875843.entry.js} +1 -1
- package/dist/bromcom-ui/p-3238bf36.js +5 -0
- package/dist/bromcom-ui/p-33b063f9.entry.js +5 -0
- package/dist/bromcom-ui/{p-b0dc804a.entry.js → p-34d17092.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a0d6d680.js → p-35f2e15a.js} +1 -1
- package/dist/bromcom-ui/{p-0745c696.js → p-39c6ede5.js} +1 -1
- package/dist/bromcom-ui/{p-0fa6d3a8.entry.js → p-3e7f3bd6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-eca0acda.js → p-43c578cf.js} +1 -1
- package/dist/bromcom-ui/{p-6bea284a.js → p-499d8454.js} +1 -1
- package/dist/bromcom-ui/{p-c75b2352.entry.js → p-49c6a987.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cb56a1d9.entry.js → p-4c57d895.entry.js} +1 -1
- package/dist/bromcom-ui/{p-dce99e4d.entry.js → p-4cc727ff.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c77541f4.js → p-4d2bf0e7.js} +2 -2
- package/dist/bromcom-ui/{p-5d670fd7.entry.js → p-594a57c3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a0f44b56.entry.js → p-5dea2654.entry.js} +1 -1
- package/dist/bromcom-ui/{p-57678987.entry.js → p-6220fb40.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a6aa173f.entry.js → p-626b805d.entry.js} +1 -1
- package/dist/bromcom-ui/p-64496819.entry.js +5 -0
- package/dist/bromcom-ui/{p-5dcc28c3.entry.js → p-64d9f96b.entry.js} +1 -1
- package/dist/bromcom-ui/p-64fad38b.js +11 -0
- package/dist/bromcom-ui/{p-c49b6287.entry.js → p-69260d36.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b51e5b06.js → p-6d1bc914.js} +1 -1
- package/dist/bromcom-ui/{p-8c018ae0.js → p-6f2e4c9b.js} +1 -1
- package/dist/bromcom-ui/{p-7e44e6b5.js → p-6f861fed.js} +1 -1
- package/dist/bromcom-ui/{p-e8eaa3bb.entry.js → p-7d18ce0e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a2864264.js → p-7f776577.js} +1 -1
- package/dist/bromcom-ui/{p-201b04e8.entry.js → p-8153e18d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6657830f.js → p-85eedabc.js} +1 -1
- package/dist/bromcom-ui/{p-8e972c24.entry.js → p-87f4460b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2cd6cdee.js → p-8e683b32.js} +1 -1
- package/dist/bromcom-ui/{p-4b44c0ea.entry.js → p-90ce383c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d3b38aff.entry.js → p-91f04eca.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4342cdf8.entry.js → p-9ddea72c.entry.js} +1 -1
- package/dist/bromcom-ui/p-9e16b47a.entry.js +5 -0
- package/dist/bromcom-ui/{p-aeb4be41.js → p-a2df6c19.js} +1 -1
- package/dist/bromcom-ui/{p-160fba10.entry.js → p-a3d0c1f4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8bb0fe5d.js → p-aa6ff189.js} +1 -1
- package/dist/bromcom-ui/{p-856dac72.entry.js → p-ab37f4bf.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0e3e8cc2.entry.js → p-b0a85220.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9586997f.js → p-b25f9130.js} +1 -1
- package/dist/bromcom-ui/{p-59f7fa84.entry.js → p-ba9eff2a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9b59c689.entry.js → p-bdc78a44.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5bd4ba44.entry.js → p-cd0f94a1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-32c55505.entry.js → p-d551a51d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-33f3c5c5.entry.js → p-da1af01e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-29263575.entry.js → p-e1894ee9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1b558b0f.entry.js → p-ece578ef.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2b42d77e.entry.js → p-f0e30624.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2e9c0070.entry.js → p-fb784bcd.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2d9b633e.entry.js → p-ffbd4d1e.entry.js} +1 -1
- package/dist/cjs/{bcm-accordion_47.cjs.entry.js → bcm-accordion_63.cjs.entry.js} +41891 -20022
- package/dist/cjs/bcm-alert.cjs.entry.js +3 -3
- package/dist/cjs/bcm-attendance-actions-comment.cjs.entry.js +5 -5
- package/dist/cjs/bcm-attendance-actions-dropdown.cjs.entry.js +5 -5
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/bcm-caption.cjs.entry.js +5 -5
- package/dist/cjs/bcm-card.cjs.entry.js +4 -4
- package/dist/cjs/bcm-chip-group.cjs.entry.js +5 -5
- package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +4 -4
- package/dist/cjs/bcm-default.cjs.entry.js +2 -2
- package/dist/cjs/bcm-form-2.cjs.entry.js +3 -3
- package/dist/cjs/bcm-input-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 +5 -5
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +5 -5
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +5 -5
- package/dist/cjs/bcm-modal-2.cjs.entry.js +5 -5
- package/dist/cjs/bcm-number-input.cjs.entry.js +5 -5
- package/dist/cjs/bcm-popover.cjs.entry.js +5 -5
- package/dist/cjs/bcm-range.cjs.entry.js +2 -2
- package/dist/cjs/bcm-skeleton.cjs.entry.js +5 -5
- package/dist/cjs/bcm-table.cjs.entry.js +5 -5
- package/dist/cjs/bcm-tag.cjs.entry.js +3 -3
- package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-toast.cjs.entry.js +3 -3
- package/dist/cjs/bromcom-ui.cjs.js +3 -3
- package/dist/cjs/{generate-e4106db0.js → generate-0e132127.js} +1 -1
- package/dist/cjs/{global-c0174398.js → global-da1b03a6.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{number-helper-0846aefe.js → number-helper-1de01e62.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +5 -5
- package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -2
- package/dist/cjs/{package-822a0e3f.js → package-1aa89f41.js} +1 -1
- package/dist/cjs/{popover-placement-02e6101b.js → popover-placement-d1aa81f0.js} +1 -1
- package/dist/cjs/{slot-template-df7b5b59.js → slot-template-29229e8f.js} +1 -1
- package/dist/cjs/{string-helper-9cdfb273.js → string-helper-1ee6dc21.js} +4 -2
- package/dist/cjs/{validators-0fadce56.js → validators-b7892533.js} +1 -1
- package/dist/collection/components/organism/list/list.js +2 -2
- package/dist/collection/components/other_deprecated/select/select.js +1 -1
- package/dist/collection/components/other_deprecated/tabs/tab.css +15 -15
- package/dist/collection/helper/string-helper.js +4 -2
- package/dist/components/bcm-select.js +1 -1
- package/dist/components/bcm-tab.js +1 -1
- package/dist/components/generate.js +1 -1
- package/dist/components/list.js +2 -2
- package/dist/components/string-helper.js +4 -2
- package/dist/esm/{_commonjsHelpers-82aa9212.js → _commonjsHelpers-7002e5de.js} +1 -1
- package/dist/esm/{bcm-accordion_47.entry.js → bcm-accordion_63.entry.js} +41922 -20069
- package/dist/esm/bcm-alert.entry.js +6 -6
- package/dist/esm/bcm-attendance-actions-comment.entry.js +10 -10
- package/dist/esm/bcm-attendance-actions-dropdown.entry.js +11 -11
- package/dist/esm/bcm-autocomplete.entry.js +2 -2
- package/dist/esm/bcm-breadcrumb.entry.js +5 -5
- package/dist/esm/bcm-caption.entry.js +12 -12
- package/dist/esm/bcm-card.entry.js +9 -9
- package/dist/esm/bcm-chip-group.entry.js +13 -13
- package/dist/esm/bcm-colorpicker.entry.js +4 -4
- package/dist/esm/bcm-date-picker.entry.js +6 -6
- package/dist/esm/bcm-datetime-picker.entry.js +10 -10
- package/dist/esm/bcm-default.entry.js +4 -4
- package/dist/esm/bcm-error-layout.entry.js +2 -2
- package/dist/esm/bcm-form-2.entry.js +5 -5
- package/dist/esm/bcm-input-2.entry.js +6 -6
- package/dist/esm/bcm-input-custom.entry.js +5 -5
- package/dist/esm/bcm-input-dropdown.entry.js +12 -12
- package/dist/esm/bcm-message.entry.js +2 -2
- package/dist/esm/bcm-modal-2-footer.entry.js +11 -11
- package/dist/esm/bcm-modal-2-header.entry.js +10 -10
- package/dist/esm/bcm-modal-2.entry.js +11 -11
- package/dist/esm/bcm-notification.entry.js +2 -2
- package/dist/esm/bcm-number-input.entry.js +12 -12
- package/dist/esm/bcm-overlay_2.entry.js +3 -3
- package/dist/esm/bcm-popover.entry.js +10 -10
- package/dist/esm/bcm-range.entry.js +6 -6
- package/dist/esm/bcm-react-number.entry.js +2 -2
- package/dist/esm/bcm-result.entry.js +2 -2
- package/dist/esm/bcm-select-group.entry.js +2 -2
- package/dist/esm/bcm-select-option.entry.js +2 -2
- package/dist/esm/bcm-skeleton.entry.js +10 -10
- package/dist/esm/bcm-tab-pane.entry.js +2 -2
- package/dist/esm/bcm-table.entry.js +11 -11
- package/dist/esm/bcm-tabs-content.entry.js +3 -3
- package/dist/esm/bcm-tag.entry.js +7 -7
- package/dist/esm/bcm-time-picker.entry.js +6 -6
- package/dist/esm/bcm-timeline-item.entry.js +2 -2
- package/dist/esm/bcm-timeline.entry.js +2 -2
- package/dist/esm/bcm-toast.entry.js +7 -7
- package/dist/esm/bromcom-ui.js +3 -3
- package/dist/esm/{caption-template-d7953d13.js → caption-template-3cd42c3b.js} +1 -1
- package/dist/esm/{color-helper-74614f24.js → color-helper-ba15b0d8.js} +2 -2
- package/dist/esm/{colors-dd598eea.js → colors-ed4e7579.js} +1 -1
- package/dist/esm/{element-dragger-89bb52fd.js → element-dragger-b75266e6.js} +1 -1
- package/dist/esm/{generate-dbe68f53.js → generate-7657b903.js} +2 -2
- package/dist/esm/{global-0bea93f1.js → global-45ed375c.js} +1 -1
- package/dist/esm/{index-f549811f.js → index-00c8a8f7.js} +1 -1
- package/dist/esm/{index-036974d7.js → index-0d3a56ec.js} +1 -1
- package/dist/esm/{label-template-a26f76c0.js → label-template-ef97aadb.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{number-helper-4a35e676.js → number-helper-6a1c621e.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +10 -10
- package/dist/esm/old-bcm-popover.entry.js +5 -5
- package/dist/esm/{package-c9093920.js → package-b7d0ee8c.js} +1 -1
- package/dist/esm/{popover-placement-d12fec40.js → popover-placement-1b15cc99.js} +1 -1
- package/dist/esm/{slot-template-2a19b2db.js → slot-template-0d958dcc.js} +1 -1
- package/dist/esm/{string-helper-3592bdc2.js → string-helper-b4602002.js} +5 -3
- package/dist/esm/{utils-57652744.js → utils-7727d09e.js} +1 -1
- package/dist/esm/{validators-0d9bab98.js → validators-4ce708f9.js} +1 -1
- package/package.json +1 -1
- package/dist/bromcom-ui/p-1345d51b.entry.js +0 -5
- package/dist/bromcom-ui/p-270e1b24.entry.js +0 -5
- package/dist/bromcom-ui/p-376a20ed.js +0 -5
- package/dist/bromcom-ui/p-4393b33e.entry.js +0 -5
- package/dist/bromcom-ui/p-59327403.entry.js +0 -5
- package/dist/bromcom-ui/p-5f345ad2.entry.js +0 -5
- package/dist/bromcom-ui/p-6ddd9d7e.entry.js +0 -5
- package/dist/bromcom-ui/p-77b1dbdd.entry.js +0 -5
- package/dist/bromcom-ui/p-8b6d3a37.js +0 -5
- package/dist/bromcom-ui/p-93c016f1.entry.js +0 -5
- package/dist/bromcom-ui/p-9b8fcf49.entry.js +0 -16
- package/dist/bromcom-ui/p-a1d44a10.entry.js +0 -5
- package/dist/bromcom-ui/p-c1a992e7.entry.js +0 -5
- package/dist/bromcom-ui/p-d6cee6ba.entry.js +0 -5
- package/dist/bromcom-ui/p-e0ab7b38.js +0 -11
- package/dist/bromcom-ui/p-fc787048.entry.js +0 -5
- package/dist/cjs/bcm-checkbox-lite_8.cjs.entry.js +0 -2509
- package/dist/cjs/bcm-collapse-group.cjs.entry.js +0 -43
- package/dist/cjs/bcm-collapse.cjs.entry.js +0 -62
- package/dist/cjs/bcm-old-input.cjs.entry.js +0 -397
- package/dist/cjs/bcm-old-tag_2.cjs.entry.js +0 -145
- package/dist/cjs/bcm-select.cjs.entry.js +0 -1195
- package/dist/cjs/bcm-tab.cjs.entry.js +0 -72
- package/dist/cjs/bcm-tabs.cjs.entry.js +0 -370
- package/dist/cjs/lodash-917168d7.js +0 -17199
- package/dist/esm/bcm-checkbox-lite_8.entry.js +0 -2498
- package/dist/esm/bcm-collapse-group.entry.js +0 -39
- package/dist/esm/bcm-collapse.entry.js +0 -58
- package/dist/esm/bcm-old-input.entry.js +0 -393
- package/dist/esm/bcm-old-tag_2.entry.js +0 -140
- package/dist/esm/bcm-select.entry.js +0 -1191
- package/dist/esm/bcm-tab.entry.js +0 -68
- package/dist/esm/bcm-tabs.entry.js +0 -366
- package/dist/esm/lodash-4197be99.js +0 -17197
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-0615c2b8.js';
|
|
6
|
-
import { g as getChildElements } from './utils-57652744.js';
|
|
7
|
-
|
|
8
|
-
const BcmCollapseGroup = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
registerInstance(this, hostRef);
|
|
11
|
-
this.borderless = false;
|
|
12
|
-
this.open = false;
|
|
13
|
-
this.multiple = false;
|
|
14
|
-
this.hidden = false;
|
|
15
|
-
}
|
|
16
|
-
handleOpen({ target, detail }) {
|
|
17
|
-
if (!this.multiple && this.el === target.parentElement) {
|
|
18
|
-
this.qs().forEach(child => {
|
|
19
|
-
child.open = child.id === detail;
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
componentDidLoad() {
|
|
24
|
-
this.qs().forEach((child, index) => {
|
|
25
|
-
!child.borderless && (child.borderless = this.borderless);
|
|
26
|
-
this.qs().length == index + 1 && (child.noBorder = true);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
qs() {
|
|
30
|
-
return getChildElements(this.el, 'bcm-collapse');
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
const { hidden } = this;
|
|
34
|
-
return (h(Host, { class: { hidden } }, h("slot", null)));
|
|
35
|
-
}
|
|
36
|
-
get el() { return getElement(this); }
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export { BcmCollapseGroup as bcm_collapse_group };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-0615c2b8.js';
|
|
6
|
-
import { c as classnames } from './index-f549811f.js';
|
|
7
|
-
import { l as lodash } from './lodash-4197be99.js';
|
|
8
|
-
import { G as Generate } from './generate-dbe68f53.js';
|
|
9
|
-
import './_commonjsHelpers-82aa9212.js';
|
|
10
|
-
import './package-c9093920.js';
|
|
11
|
-
import './colors-dd598eea.js';
|
|
12
|
-
|
|
13
|
-
const collapseCss = "@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}.bcm-collapse{display:block;border:1px solid var(--bcm-color-grey-5)}.bcm-collapse ::-webkit-details-marker{display:none}.bcm-collapse__header{display:flex;align-items:center;color:var(--bcm-color-grey-9);padding:16px;background-color:var(--bcm-color-grey-2);border-bottom:1px solid var(--bcm-color-grey-5);cursor:default;user-select:none}.bcm-collapse__header:focus{outline:none}.bcm-collapse__header .collapse-icon{margin-right:8px;display:flex;align-items:center;justify-content:center}.bcm-collapse__body{padding:16px;background-color:var(--bcm-color-grey-1);color:var(--bcm-color-grey-8);margin-top:-1px}.bcm-collapse--borderless{border:none}.bcm-collapse--borderless:not(.bcm-collapse--no-border){border-bottom:1px solid var(--bcm-color-grey-5)}.bcm-collapse--borderless .bcm-collapse__header{border-bottom:none}.bcm-collapse--borderless .bcm-collapse__body{background-color:var(--bcm-color-grey-2);padding:0 40px 16px}.bcm-collapse:not(.bcm-collapse--open) .bcm-collapse__header{border-bottom:none}.bcm-collapse:not(:first-child) .collapse{border-top:none}.bcm-collapse.hidden{display:none}.bcm-collapse--no-padding .bcm-collapse__body{padding:0}";
|
|
14
|
-
|
|
15
|
-
const BcmCollapse = class {
|
|
16
|
-
constructor(hostRef) {
|
|
17
|
-
registerInstance(this, hostRef);
|
|
18
|
-
this.bcmCollapseOpen = createEvent(this, "bcm-collapse-open", 7);
|
|
19
|
-
this._id = Generate.UID();
|
|
20
|
-
this.borderless = false;
|
|
21
|
-
this.open = false;
|
|
22
|
-
this.noBorder = false;
|
|
23
|
-
this.noPadding = false;
|
|
24
|
-
this.hidden = false;
|
|
25
|
-
}
|
|
26
|
-
componentDidRender() {
|
|
27
|
-
this.open && this.bcmCollapseOpen.emit(this._id);
|
|
28
|
-
}
|
|
29
|
-
componentDidLoad() {
|
|
30
|
-
this.checkSlotEmpty();
|
|
31
|
-
}
|
|
32
|
-
checkSlotEmpty() {
|
|
33
|
-
var _a;
|
|
34
|
-
const textContent = (_a = this.el.querySelector('[slot="body"]')) === null || _a === void 0 ? void 0 : _a.textContent;
|
|
35
|
-
if (lodash.trim(textContent) !== "") {
|
|
36
|
-
this.el.removeAttribute("data-slot-empty");
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
this.el.setAttribute("data-slot-empty", "true");
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
render() {
|
|
43
|
-
const { hidden, borderless, open, noBorder, _id, noPadding } = this;
|
|
44
|
-
const classes = classnames("bcm-collapse", {
|
|
45
|
-
"bcm-collapse--borderless": borderless,
|
|
46
|
-
"bcm-collapse--open": open,
|
|
47
|
-
"bcm-collapse--no-border": noBorder,
|
|
48
|
-
"bcm-collapse--no-padding": noPadding,
|
|
49
|
-
});
|
|
50
|
-
const caretDown = '<svg style="fill: #595959; width: 14px; height: 14px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"/></svg>';
|
|
51
|
-
const caretRight = '<svg style="fill: #595959; width: 14px; height: 14px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512"><path d="M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"/></svg>';
|
|
52
|
-
return (h(Host, { class: { hidden }, id: _id }, h("details", { class: classes, open: open }, h("summary", { class: "bcm-collapse__header size-2", onClick: () => (this.open = !open) }, h("span", { class: "collapse-icon", innerHTML: open ? caretDown : caretRight }), h("slot", { name: "title" })), h("div", { class: "bcm-collapse__body" }, h("slot", { name: "body", onSlotchange: () => this.checkSlotEmpty() })))));
|
|
53
|
-
}
|
|
54
|
-
get el() { return getElement(this); }
|
|
55
|
-
};
|
|
56
|
-
BcmCollapse.style = collapseCss;
|
|
57
|
-
|
|
58
|
-
export { BcmCollapse as bcm_collapse };
|
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-0615c2b8.js';
|
|
6
|
-
import { c as classnames } from './index-f549811f.js';
|
|
7
|
-
import { C as CaptionTemplate } from './caption-template-d7953d13.js';
|
|
8
|
-
import { d as delay } from './utils-57652744.js';
|
|
9
|
-
import './_commonjsHelpers-82aa9212.js';
|
|
10
|
-
|
|
11
|
-
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}";
|
|
12
|
-
|
|
13
|
-
let id = 0;
|
|
14
|
-
const defaultIcons = {
|
|
15
|
-
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>',
|
|
16
|
-
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>',
|
|
17
|
-
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>',
|
|
18
|
-
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>'
|
|
19
|
-
};
|
|
20
|
-
const BcmOldInput = class {
|
|
21
|
-
constructor(hostRef) {
|
|
22
|
-
registerInstance(this, hostRef);
|
|
23
|
-
this.focus = createEvent(this, "bcm-focus", 7);
|
|
24
|
-
this.blur = createEvent(this, "bcm-blur", 7);
|
|
25
|
-
this.clear = createEvent(this, "bcm-clear", 7);
|
|
26
|
-
this.change = createEvent(this, "bcm-change", 7);
|
|
27
|
-
this.input = createEvent(this, "bcm-input", 7);
|
|
28
|
-
this.inputId = `input-${++id}`;
|
|
29
|
-
this.isBlur = false;
|
|
30
|
-
this.type = 'text';
|
|
31
|
-
this.value = '';
|
|
32
|
-
this.size = "medium";
|
|
33
|
-
this.label = undefined;
|
|
34
|
-
this.noCaption = false;
|
|
35
|
-
this.noMargin = false;
|
|
36
|
-
this.captionError = undefined;
|
|
37
|
-
this.caption = undefined;
|
|
38
|
-
this.captionType = 'default';
|
|
39
|
-
this.placeholder = undefined;
|
|
40
|
-
this.fullWidth = false;
|
|
41
|
-
this.disabled = false;
|
|
42
|
-
this.readonly = false;
|
|
43
|
-
this.clearable = false;
|
|
44
|
-
this.passwordToggle = undefined;
|
|
45
|
-
this.noDefaultIcon = undefined;
|
|
46
|
-
this._id = undefined;
|
|
47
|
-
this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
48
|
-
this.name = undefined;
|
|
49
|
-
this.unit = null;
|
|
50
|
-
this.unitPrefix = null;
|
|
51
|
-
this.decimal = undefined;
|
|
52
|
-
this.min = null;
|
|
53
|
-
this.max = null;
|
|
54
|
-
this.step = null;
|
|
55
|
-
this.hidden = false;
|
|
56
|
-
this.required = false;
|
|
57
|
-
this.disableWatchValue = false;
|
|
58
|
-
this.maxLength = null;
|
|
59
|
-
this.tooltip = undefined;
|
|
60
|
-
this.inValid = false;
|
|
61
|
-
this.valueCache = undefined;
|
|
62
|
-
this.captionCache = undefined;
|
|
63
|
-
this.captionTypeCache = undefined;
|
|
64
|
-
this.hasFocus = false;
|
|
65
|
-
this.isPasswordVisible = false;
|
|
66
|
-
}
|
|
67
|
-
async setFocus() {
|
|
68
|
-
this.inputElement.focus();
|
|
69
|
-
}
|
|
70
|
-
async removeFocus() {
|
|
71
|
-
this.inputElement.blur();
|
|
72
|
-
}
|
|
73
|
-
async select() {
|
|
74
|
-
return this.inputElement.select();
|
|
75
|
-
}
|
|
76
|
-
async setValue(value) {
|
|
77
|
-
this.inputElement.value = value;
|
|
78
|
-
this.value = value;
|
|
79
|
-
this.handleChange();
|
|
80
|
-
return value;
|
|
81
|
-
}
|
|
82
|
-
async setClear() {
|
|
83
|
-
this.inputElement.value = '';
|
|
84
|
-
this.value = '';
|
|
85
|
-
await delay(10);
|
|
86
|
-
return Promise.resolve();
|
|
87
|
-
}
|
|
88
|
-
async resetCaption() {
|
|
89
|
-
await delay(10);
|
|
90
|
-
this.caption = this.captionCache;
|
|
91
|
-
this.captionType = this.captionTypeCache;
|
|
92
|
-
this.captionError = null;
|
|
93
|
-
await delay(10);
|
|
94
|
-
return Promise.resolve();
|
|
95
|
-
}
|
|
96
|
-
async getValue() {
|
|
97
|
-
return this.value;
|
|
98
|
-
}
|
|
99
|
-
handleFocus() {
|
|
100
|
-
this.hasFocus = true;
|
|
101
|
-
this.focus.emit();
|
|
102
|
-
}
|
|
103
|
-
handleBlur() {
|
|
104
|
-
this.hasFocus = false;
|
|
105
|
-
this.isBlur = true;
|
|
106
|
-
if (this.type == "email") {
|
|
107
|
-
this.isEmailValid();
|
|
108
|
-
}
|
|
109
|
-
if (this.type == "tel") {
|
|
110
|
-
this.isTelValid();
|
|
111
|
-
}
|
|
112
|
-
this.blur.emit();
|
|
113
|
-
}
|
|
114
|
-
handleChange() {
|
|
115
|
-
this.value = this.inputElement.value;
|
|
116
|
-
this.change.emit(this.value);
|
|
117
|
-
}
|
|
118
|
-
handleInput() {
|
|
119
|
-
if (this.type == "number") {
|
|
120
|
-
if (this.decimal == "false") {
|
|
121
|
-
this.inputElement.value = this.inputElement.value.replace(/[^0-9-]/g, '');
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
this.inputElement.value = this.inputElement.value.replace(/[^0-9.,-]/g, '');
|
|
125
|
-
}
|
|
126
|
-
this.inputElement.value = this.inputElement.value.replace(/(\..*)\./g, '$1').replace(/(\-.*)\-/g, '$1');
|
|
127
|
-
}
|
|
128
|
-
this.value = this.inputElement.value;
|
|
129
|
-
this.input.emit(this.value);
|
|
130
|
-
}
|
|
131
|
-
handleClear(e) {
|
|
132
|
-
this.inputElement.value = '';
|
|
133
|
-
this.value = '';
|
|
134
|
-
this.inputElement.focus();
|
|
135
|
-
this.change.emit(this.value);
|
|
136
|
-
this.clear.emit(e);
|
|
137
|
-
e.stopPropagation();
|
|
138
|
-
}
|
|
139
|
-
changePasswordVisibility() {
|
|
140
|
-
this.isPasswordVisible = !this.isPasswordVisible;
|
|
141
|
-
}
|
|
142
|
-
incrementNumber() {
|
|
143
|
-
if (!this.inValid && !this.disabled && !this.readonly) {
|
|
144
|
-
let step = this.getNumberStep();
|
|
145
|
-
let val = Number(this.value) + Number(step);
|
|
146
|
-
this.value = this.numberDecimal(val);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
decrementNumber() {
|
|
150
|
-
if (!this.inValid && !this.disabled && !this.readonly) {
|
|
151
|
-
let step = this.getNumberStep();
|
|
152
|
-
let val = Number(this.value) - Number(step);
|
|
153
|
-
this.value = this.numberDecimal(val);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
getNumberStep(step = Number(this.step)) {
|
|
157
|
-
let returnStep = 1;
|
|
158
|
-
if (step && Number(step) == step)
|
|
159
|
-
returnStep = step;
|
|
160
|
-
return Number(returnStep);
|
|
161
|
-
}
|
|
162
|
-
connectedCallback() {
|
|
163
|
-
this.changePasswordVisibility = this.changePasswordVisibility.bind(this);
|
|
164
|
-
this.handleChange = this.handleChange.bind(this);
|
|
165
|
-
this.handleBlur = this.handleBlur.bind(this);
|
|
166
|
-
this.handleFocus = this.handleFocus.bind(this);
|
|
167
|
-
this.handleInput = this.handleInput.bind(this);
|
|
168
|
-
this.handleClear = this.handleClear.bind(this);
|
|
169
|
-
this.incrementNumber = this.incrementNumber.bind(this);
|
|
170
|
-
this.decrementNumber = this.decrementNumber.bind(this);
|
|
171
|
-
this.valueCache = this.value;
|
|
172
|
-
this.captionCache = this.caption;
|
|
173
|
-
this.captionTypeCache = this.captionType;
|
|
174
|
-
}
|
|
175
|
-
validationRange(val = JSON.stringify({
|
|
176
|
-
"value": this.value,
|
|
177
|
-
"min": this.min,
|
|
178
|
-
"max": this.max
|
|
179
|
-
})) {
|
|
180
|
-
let cap = null;
|
|
181
|
-
let capType = null;
|
|
182
|
-
let returnValidation = true;
|
|
183
|
-
let item = JSON.parse(val);
|
|
184
|
-
let { length, value, min, max } = item;
|
|
185
|
-
length = parseFloat(length);
|
|
186
|
-
value = parseFloat(value);
|
|
187
|
-
min = parseFloat(min);
|
|
188
|
-
max = parseFloat(max);
|
|
189
|
-
length !== 0 && (value && (min && max && ((value < min || value > max) && (cap = "Please enter a value between " + min + " and " + max + ".",
|
|
190
|
-
capType = "error",
|
|
191
|
-
returnValidation = false)) || min && !max && (value < min && (cap = "Please enter a value greater than or equal to " + min + ".",
|
|
192
|
-
capType = "error",
|
|
193
|
-
returnValidation = false)) || !min && max && (value > max && (cap = "Please enter a value less than or equal to " + max + ".",
|
|
194
|
-
capType = "error",
|
|
195
|
-
returnValidation = false))));
|
|
196
|
-
this.setCaption(cap, capType);
|
|
197
|
-
return returnValidation;
|
|
198
|
-
}
|
|
199
|
-
setCaption(caption = null, captionType = null) {
|
|
200
|
-
this.caption = caption ? caption : this.captionCache;
|
|
201
|
-
this.captionType = captionType ? captionType : this.captionTypeCache;
|
|
202
|
-
this.captionError = captionType == "error" ? caption : null;
|
|
203
|
-
}
|
|
204
|
-
isEmailValid() {
|
|
205
|
-
const { value } = this;
|
|
206
|
-
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,}))$/);
|
|
207
|
-
let cap = null;
|
|
208
|
-
let capType = null;
|
|
209
|
-
if (value && !regexp.test(value)) {
|
|
210
|
-
cap = "Please enter a valid email address.",
|
|
211
|
-
capType = "error",
|
|
212
|
-
this.inValid = true;
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
this.inValid = false;
|
|
216
|
-
}
|
|
217
|
-
this.setCaption(cap, capType);
|
|
218
|
-
return this.inValid;
|
|
219
|
-
}
|
|
220
|
-
isTelValid() {
|
|
221
|
-
const { value } = this;
|
|
222
|
-
const regexp = new RegExp(/^(?=.*[0-9])[- +()0-9]+$/);
|
|
223
|
-
let cap = null;
|
|
224
|
-
let capType = null;
|
|
225
|
-
if (value && !regexp.test(value)) {
|
|
226
|
-
cap = "Please enter a valid phone number.",
|
|
227
|
-
capType = "error",
|
|
228
|
-
this.inValid = true;
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
this.inValid = false;
|
|
232
|
-
}
|
|
233
|
-
this.setCaption(cap, capType);
|
|
234
|
-
return this.inValid;
|
|
235
|
-
}
|
|
236
|
-
isNumberValid(caption = "Invalid number", captionType = "error") {
|
|
237
|
-
const { value } = this;
|
|
238
|
-
if (value && Number(value) != value) {
|
|
239
|
-
this.inValid = true;
|
|
240
|
-
this.setCaption(caption, captionType);
|
|
241
|
-
return true;
|
|
242
|
-
}
|
|
243
|
-
this.inValid = false;
|
|
244
|
-
return false;
|
|
245
|
-
}
|
|
246
|
-
setNumberUnit() {
|
|
247
|
-
const { value, unit } = this;
|
|
248
|
-
if (Number(value) == value && (unit === null || unit === void 0 ? void 0 : unit.length) > 0 && !value)
|
|
249
|
-
this.value = 0;
|
|
250
|
-
}
|
|
251
|
-
numberDecimal(val = '') {
|
|
252
|
-
let decLen = this.getDecimalLength();
|
|
253
|
-
if (val && decLen)
|
|
254
|
-
return parseFloat(val).toFixed(decLen);
|
|
255
|
-
return val;
|
|
256
|
-
}
|
|
257
|
-
numberNotDecimal(val = 0) {
|
|
258
|
-
return Math.trunc(val);
|
|
259
|
-
}
|
|
260
|
-
getDecimalLength() {
|
|
261
|
-
const { step } = this;
|
|
262
|
-
let returnDecimalLength = 0, splitted, splitDec;
|
|
263
|
-
if (step && Number(step) == step) {
|
|
264
|
-
if (String(step).includes(".")) {
|
|
265
|
-
splitted = String(step).split('.');
|
|
266
|
-
splitDec = splitted[splitted.length - 1].length;
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
splitDec = 0;
|
|
270
|
-
}
|
|
271
|
-
returnDecimalLength = splitDec;
|
|
272
|
-
}
|
|
273
|
-
return Number(returnDecimalLength);
|
|
274
|
-
}
|
|
275
|
-
componentWillRender() {
|
|
276
|
-
const { type } = this;
|
|
277
|
-
if (type == "number" && this.value) {
|
|
278
|
-
if (!this.isNumberValid()) {
|
|
279
|
-
this.validationRange();
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
if (this.isBlur) {
|
|
283
|
-
if (type == "email" && this.value) {
|
|
284
|
-
this.isEmailValid();
|
|
285
|
-
}
|
|
286
|
-
if (type == "tel" && this.value) {
|
|
287
|
-
this.isTelValid();
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
componentWillLoad() {
|
|
292
|
-
const { type, value } = this;
|
|
293
|
-
if (type == "number" && Number(value) == value) {
|
|
294
|
-
this.value = this.numberDecimal(value);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
numberControl(e) {
|
|
298
|
-
if (!this.disabled && !this.readonly) {
|
|
299
|
-
if (this.type == "number") {
|
|
300
|
-
var which = e.which || 0;
|
|
301
|
-
var key = e.key;
|
|
302
|
-
which == 38 && ( // up arrow
|
|
303
|
-
e.preventDefault(),
|
|
304
|
-
this.incrementNumber());
|
|
305
|
-
which == 40 && ( // down arrow
|
|
306
|
-
e.preventDefault(),
|
|
307
|
-
this.decrementNumber());
|
|
308
|
-
key == "." && String(this.value).includes(".") && ( // dot: shouldn't be more than one
|
|
309
|
-
e.preventDefault());
|
|
310
|
-
if (which == 8 || //backspace / delete
|
|
311
|
-
which == 9 || //tab
|
|
312
|
-
which == 13 || //enter
|
|
313
|
-
which == 16 || //shift
|
|
314
|
-
which == 17 || //ctrl
|
|
315
|
-
which == 18 || //alt
|
|
316
|
-
which == 46 || //delete
|
|
317
|
-
(which == 110 && (this.type == 'number' && this.decimal != false)) || //decimal point
|
|
318
|
-
// (which == 188 && key == ",") || //comma
|
|
319
|
-
(which == 190 && key == "." && (this.type == 'number' && this.decimal != false)) || //period
|
|
320
|
-
(which == 189 && this.inputElement.value.length == 0) || //-
|
|
321
|
-
(which == 109 && this.inputElement.value.length == 0) || //-
|
|
322
|
-
(which >= 35 && which <= 40) || //end, home, left arrow, up arrow, right arrow, down arrow
|
|
323
|
-
(which >= 48 && which <= 57) || //0-9
|
|
324
|
-
(which >= 96 && which <= 105) //0-9(numpad)
|
|
325
|
-
)
|
|
326
|
-
return true;
|
|
327
|
-
e.preventDefault();
|
|
328
|
-
if (this.decimal == true) {
|
|
329
|
-
this.value = this.numberDecimal(this.value);
|
|
330
|
-
}
|
|
331
|
-
else if (this.decimal == false) {
|
|
332
|
-
this.value = this.numberNotDecimal(this.value);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
whatchHasFocus() {
|
|
338
|
-
const { type, hasFocus, value, valueCache, inValid } = this;
|
|
339
|
-
if (type == "number") {
|
|
340
|
-
this.isNumberValid();
|
|
341
|
-
let inValidState = false;
|
|
342
|
-
if (hasFocus == true) {
|
|
343
|
-
if (inValid == true) {
|
|
344
|
-
this.value = '';
|
|
345
|
-
inValidState = true;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
else {
|
|
349
|
-
if (this.value == '' && inValid == false) {
|
|
350
|
-
this.value = valueCache;
|
|
351
|
-
inValidState = true;
|
|
352
|
-
}
|
|
353
|
-
if (value != valueCache && inValid == false && inValidState == false) {
|
|
354
|
-
this.value = value ? this.numberDecimal(value) : '';
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
watchValue() {
|
|
360
|
-
if (!this.disableWatchValue && this.type != 'number') {
|
|
361
|
-
this.handleChange();
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
render() {
|
|
365
|
-
const { value, size, label, type, captionType, caption, captionError, placeholder, fullWidth, disabled, readonly, clearable, passwordToggle, isPasswordVisible, noDefaultIcon, unit, inValid, hasFocus, unitPrefix, noCaption, required } = this;
|
|
366
|
-
const containerClasses = classnames('input-container', {
|
|
367
|
-
'full-width': fullWidth,
|
|
368
|
-
'error': captionType == 'error' ? true : false
|
|
369
|
-
});
|
|
370
|
-
const baseClasses = classnames('input-base', 'input-' + size, {
|
|
371
|
-
'invalid': inValid,
|
|
372
|
-
'unit': (unit === null || unit === void 0 ? void 0 : unit.length) > 0,
|
|
373
|
-
'focused': hasFocus,
|
|
374
|
-
'disabled': disabled,
|
|
375
|
-
'readonly': readonly,
|
|
376
|
-
'empty': (value === null || value === void 0 ? void 0 : value.length) < 1
|
|
377
|
-
});
|
|
378
|
-
const inputClass = size === 'large' ? 'size-3' : 'size-2';
|
|
379
|
-
const hostClasses = classnames(this.hidden ? 'hidden' : null, this.noMargin ? 'no-margin' : null);
|
|
380
|
-
return (h(Host, { class: hostClasses }, h("div", { class: containerClasses }, label && h("div", null, h("bcm-label", { tooltip: this.tooltip, type: captionType, value: label, required: required, htmlFor: this.inputId })), h("div", { class: baseClasses }, h("span", { class: "input-prefix" }, h("slot", { name: "prefix" }), unitPrefix && h("span", { class: classnames(inputClass, 'unit-prefix') }, unitPrefix)), h("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' :
|
|
381
|
-
type === 'number' ? 'text' : type, placeholder: placeholder, value: type === 'number' && !this.hasFocus
|
|
382
|
-
? value + (value && (unit === null || unit === void 0 ? void 0 : unit.length) > 0 ? ' ' + unit : '')
|
|
383
|
-
: value, disabled: this.disabled, readonly: this.readonly }), clearable && !this.disabled && (h("button", { class: "input-clear-button", onClick: this.handleClear }, h("svg", { style: { "fill": "#595959", "width": "14px", "height": "14px" }, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512" }, h("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("button", { class: "input-password-toggle", onClick: this.changePasswordVisibility }, h("bcm-icon", { icon: isPasswordVisible ? "far fa-eye-invisible" : "far fa-eye" }))), Object.keys(defaultIcons).includes(type) && !noDefaultIcon && (h("span", { class: "input-suffix default-icon", innerHTML: defaultIcons[type] })), type === 'number' && (h("div", { class: classnames('caret-container', { 'unit': (unit === null || unit === void 0 ? void 0 : unit.length) > 0 }, { 'disabled': inValid }, { 'disabled': readonly }) }, h("span", { class: "caret", onClick: inValid == false && this.incrementNumber }, h("bcm-icon", { icon: "far fa-caret-up" })), h("span", { class: "caret", onClick: inValid == false && this.decrementNumber }, h("bcm-icon", { icon: "far fa-caret-down" })))), type !== 'number' && (h("span", { class: "input-suffix" }, h("slot", { name: "suffix" })))), h(CaptionTemplate, { noCaption: noCaption, captionType: captionType, captionError: captionError, caption: caption }))));
|
|
384
|
-
}
|
|
385
|
-
get el() { return getElement(this); }
|
|
386
|
-
static get watchers() { return {
|
|
387
|
-
"hasFocus": ["whatchHasFocus"],
|
|
388
|
-
"value": ["watchValue"]
|
|
389
|
-
}; }
|
|
390
|
-
};
|
|
391
|
-
BcmOldInput.style = oldInputCss;
|
|
392
|
-
|
|
393
|
-
export { BcmOldInput as bcm_old_input };
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-0615c2b8.js';
|
|
6
|
-
import { c as classnames } from './index-f549811f.js';
|
|
7
|
-
import { C as ColorPalette } from './colors-1d7854ea.js';
|
|
8
|
-
import { e as extractColor } from './utils-57652744.js';
|
|
9
|
-
import './_commonjsHelpers-82aa9212.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* 'color' prop predefined values
|
|
13
|
-
*/
|
|
14
|
-
var ColorProps;
|
|
15
|
-
(function (ColorProps) {
|
|
16
|
-
ColorProps["black"] = "black";
|
|
17
|
-
ColorProps["white"] = "white";
|
|
18
|
-
ColorProps["prime-blue"] = "prime-blue";
|
|
19
|
-
ColorProps["grey"] = "grey";
|
|
20
|
-
ColorProps["blue"] = "blue";
|
|
21
|
-
ColorProps["warmyellow"] = "warmyellow";
|
|
22
|
-
ColorProps["yellow"] = "yellow";
|
|
23
|
-
ColorProps["limegreen"] = "limegreen";
|
|
24
|
-
ColorProps["red"] = "red";
|
|
25
|
-
ColorProps["darkorange"] = "darkorange";
|
|
26
|
-
ColorProps["orange"] = "orange";
|
|
27
|
-
ColorProps["green"] = "green";
|
|
28
|
-
ColorProps["turquosie"] = "turquosie";
|
|
29
|
-
ColorProps["cobaltblue"] = "cobaltblue";
|
|
30
|
-
ColorProps["magenta"] = "magenta";
|
|
31
|
-
ColorProps["purple"] = "purple";
|
|
32
|
-
ColorProps["bc-red"] = "bc-red";
|
|
33
|
-
ColorProps["bc-blue"] = "bc-blue";
|
|
34
|
-
ColorProps["bc-green"] = "bc-green";
|
|
35
|
-
ColorProps["bc-orange"] = "bc-orange";
|
|
36
|
-
})(ColorProps || (ColorProps = {}));
|
|
37
|
-
|
|
38
|
-
const oldTagCss = "@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}.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:fit-content}:host(.hidden){display:none}:host(.maxwidth){max-width:100px}.tag{display:flex;align-items:center;justify-content:center;padding:0 8px;cursor:default;border-radius:48px;border:1px solid var(--bcm-color-grey-5);user-select:none;min-width:10px;min-height:20px}.tag.size-1{padding:calc(8px - 8px) 8px}.tag.size-2{padding:calc(9px - 8px) 9px}.tag.size-3{padding:calc(10px - 8px) 10px}.tag.size-4{padding:calc(11px - 8px) 11px}.tag.size-5{padding:calc(12px - 8px) 12px}.tag.size-6{padding:calc(13px - 8px) 13px}.tag.size-7{padding:calc(14px - 8px) 14px}.tag.size-8{padding:calc(15px - 8px) 15px}.tag.size-9{padding:calc(16px - 8px) 16px}.tag.basic,.tag.closeable,.tag.add,.tag.dissmisable{background-color:var(--bcm-color-grey-3);color:var(--bcm-color-grey-8)}.tag.basic:hover,.tag.closeable:hover,.tag.add:hover,.tag.dissmisable:hover{opacity:0.85}.tag.dissmisable{color:var(--bcm-color-grey-10)}.tag.dissmisable .close-button{width:14px;cursor:pointer}.tag.dissmisable .close-button bcm-icon{color:var(--bcm-color-grey-7)}.tag.dissmisable .close-button:hover bcm-icon{color:var(--bcm-color-grey-10)}.tag.add{border-style:dashed;background-color:var(--bcm-color-grey-1)}.tag.checkable{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-grey-8);border-color:var(--bcm-color-grey-1)}.tag.checkable:hover{color:var(--bcm-color-prime-blue-5);cursor:pointer}.tag span{display:inline-flex}.tag span.left{margin-right:4px}.tag span.right{margin-left:4px}.tag:before,.tag:after{content:\"\"}button{border:none;outline:0;cursor:pointer !important;margin:0}input[type=checkbox]{margin:0;width:0;height:0;visibility:hidden;position:absolute}input[type=checkbox]:checked+label{background-color:var(--bcm-color-prime-blue-6);color:var(--bcm-color-grey-1);border-color:var(--bcm-color-prime-blue-6)}input[type=checkbox]:checked+label:hover{background-color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}input[type=checkbox]:checked+label.checkable:hover{color:var(--bcm-color-grey-1)}input[type=checkbox]:checked+label:active{background-color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}";
|
|
39
|
-
|
|
40
|
-
const BcmOldTag = class {
|
|
41
|
-
constructor(hostRef) {
|
|
42
|
-
registerInstance(this, hostRef);
|
|
43
|
-
this.checkedChange = createEvent(this, "bcm-old-tag-checked-change", 7);
|
|
44
|
-
this.tagDissmisable = createEvent(this, "bcm-old-tag-dissmisable", 7);
|
|
45
|
-
this.type = 'basic';
|
|
46
|
-
this.size = 'size-1';
|
|
47
|
-
this.checked = false;
|
|
48
|
-
this.color = undefined;
|
|
49
|
-
this.value = '';
|
|
50
|
-
this.hidden = false;
|
|
51
|
-
this._id = (Math.random() * 4).toString(16).replace('.', '');
|
|
52
|
-
this.maxWidth = false;
|
|
53
|
-
this.customStyle = undefined;
|
|
54
|
-
this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
55
|
-
}
|
|
56
|
-
handleClick() {
|
|
57
|
-
if (this.type === 'checkable') {
|
|
58
|
-
this.checked = !this.checked;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
onCheckedChange(newValue, oldValue) {
|
|
62
|
-
this.checkedChange.emit({ newValue, oldValue });
|
|
63
|
-
}
|
|
64
|
-
getColor(color) {
|
|
65
|
-
if ((this.type == 'basic' || this.type == 'dissmisable') && ColorProps[color])
|
|
66
|
-
return {
|
|
67
|
-
color: extractColor(ColorPalette, ColorProps[color] + '-6'),
|
|
68
|
-
borderColor: extractColor(ColorPalette, ColorProps[color] + '-3'),
|
|
69
|
-
backgroundColor: extractColor(ColorPalette, ColorProps[color] + '-1')
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
getSize(size, returnNumber = false) {
|
|
73
|
-
if (Number(size) == size) {
|
|
74
|
-
size = "size-" + size;
|
|
75
|
-
}
|
|
76
|
-
if (returnNumber) {
|
|
77
|
-
size = size.split("-");
|
|
78
|
-
size = size[size.length - 1];
|
|
79
|
-
var sizeList = { "1": "12", "2": "14", "3": "16", "4": "20", "5": "24", "6": "30", "7": "38", "8": "46", "9": "56" };
|
|
80
|
-
size = sizeList[size];
|
|
81
|
-
}
|
|
82
|
-
return size;
|
|
83
|
-
}
|
|
84
|
-
handleClose() {
|
|
85
|
-
this.tagDissmisable.emit(this.el);
|
|
86
|
-
// this.el.remove()
|
|
87
|
-
}
|
|
88
|
-
render() {
|
|
89
|
-
const { type, color, value, customStyle, size } = this;
|
|
90
|
-
const classes = classnames('tag', this.getSize(size), type);
|
|
91
|
-
const hostClasses = classnames(this.hidden ? 'hidden' : null, this.maxWidth ? 'maxwidth' : null);
|
|
92
|
-
if (type === 'add') {
|
|
93
|
-
return (h(Host, { class: hostClasses }, h("button", { class: classes }, h("span", { class: "left" }, h("bcm-icon", { icon: "far fa-plus" })), value)));
|
|
94
|
-
}
|
|
95
|
-
else if (type === 'dissmisable') {
|
|
96
|
-
return (h(Host, { class: hostClasses }, h("span", { class: classes, style: this.getColor(color) }, h("span", { class: "value", style: customStyle }, value), h("span", { class: "right close-button", onClick: () => this.handleClose(), style: { 'width': (Number(this.getSize(size, true)) + 2) + "px" } }, h("svg", { id: "close", style: { "fill": "#595959", "width": "14px", "height": "14px" }, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512" }, h("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" }))))));
|
|
97
|
-
}
|
|
98
|
-
else if (type === 'checkable') {
|
|
99
|
-
return (h(Host, { class: hostClasses }, h("input", { type: "checkbox", checked: this.checked }), h("label", { class: classes }, value)));
|
|
100
|
-
}
|
|
101
|
-
return (h(Host, { class: hostClasses }, h("span", { class: classes, style: this.getColor(color) }, value)));
|
|
102
|
-
}
|
|
103
|
-
get el() { return getElement(this); }
|
|
104
|
-
static get watchers() { return {
|
|
105
|
-
"checked": ["onCheckedChange"]
|
|
106
|
-
}; }
|
|
107
|
-
};
|
|
108
|
-
BcmOldTag.style = oldTagCss;
|
|
109
|
-
|
|
110
|
-
const selectBoxCss = "@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}.select-box{flex:1}:host{z-index:-999;position:absolute;opacity:0;top:-10000;left:-10000;visibility:hidden !important;box-shadow:0px 2px 8px rgba(0, 0, 0, 0.15)}:host(.show){opacity:1;z-index:100000;visibility:visible !important}";
|
|
111
|
-
|
|
112
|
-
const BcmSelectBox = class {
|
|
113
|
-
constructor(hostRef) {
|
|
114
|
-
registerInstance(this, hostRef);
|
|
115
|
-
this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
116
|
-
this.hidden = false;
|
|
117
|
-
this.isShow = false;
|
|
118
|
-
}
|
|
119
|
-
disconnectedCallback() { }
|
|
120
|
-
componentWillLoad() { }
|
|
121
|
-
componentDidLoad() { }
|
|
122
|
-
componentWillRender() { }
|
|
123
|
-
componentDidRender() { }
|
|
124
|
-
componentWillUpdate() { }
|
|
125
|
-
componentDidUpdate() { }
|
|
126
|
-
handleChangeEvent(event) {
|
|
127
|
-
event.stopPropagation();
|
|
128
|
-
}
|
|
129
|
-
render() {
|
|
130
|
-
const classes = classnames('select-box');
|
|
131
|
-
const hostClasses = classnames(this.hidden ? 'hidden' : null, {
|
|
132
|
-
'show': this.isShow,
|
|
133
|
-
});
|
|
134
|
-
return (h(Host, { class: hostClasses }, h("div", { class: classes }, h("bcm-listbox", { id: "listbox-box" + this._internal_id, class: "listbox-box", _internal_id: this._internal_id, "inner-component": true, "no-caption": true, fullWidth: true, _flex: "true" }))));
|
|
135
|
-
}
|
|
136
|
-
get el() { return getElement(this); }
|
|
137
|
-
};
|
|
138
|
-
BcmSelectBox.style = selectBoxCss;
|
|
139
|
-
|
|
140
|
-
export { BcmOldTag as bcm_old_tag, BcmSelectBox as bcm_select_box };
|