bromcom-ui 2.3.54 → 2.3.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bromcom-ui/bromcom-ui.css +0 -0
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/index.esm.js +0 -0
- package/dist/bromcom-ui/p-12493dbc.entry.js +1 -0
- package/dist/bromcom-ui/{p-a18a0cc4.entry.js → p-13d038f5.entry.js} +1 -1
- package/dist/bromcom-ui/p-1429a2b4.js +1 -0
- package/dist/bromcom-ui/{p-4b7f14ed.entry.js → p-20d03fa1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-774ff4d9.entry.js → p-30c1cd7f.entry.js} +1 -1
- package/dist/bromcom-ui/p-37750343.entry.js +1 -0
- package/dist/bromcom-ui/p-3f797656.entry.js +1 -0
- package/dist/bromcom-ui/{p-4396ee3b.entry.js → p-4092f5f1.entry.js} +1 -1
- package/dist/bromcom-ui/p-4a41ef80.entry.js +1 -0
- package/dist/bromcom-ui/p-4cb268d2.js +1 -0
- package/dist/bromcom-ui/p-53e9b679.entry.js +1 -0
- package/dist/bromcom-ui/{p-09753e05.js → p-554d326a.js} +1 -1
- package/dist/bromcom-ui/p-68ff64de.js +1 -0
- package/dist/bromcom-ui/p-7238d22f.entry.js +1 -0
- package/dist/bromcom-ui/p-7f1cd976.entry.js +1 -0
- package/dist/bromcom-ui/p-811c24d7.entry.js +1 -0
- package/dist/bromcom-ui/p-8851e01e.entry.js +1 -0
- package/dist/bromcom-ui/{p-1a2724a0.entry.js → p-92e3e240.entry.js} +1 -1
- package/dist/bromcom-ui/p-9ffff762.entry.js +1 -0
- package/dist/bromcom-ui/p-a6ef098a.entry.js +1 -0
- package/dist/bromcom-ui/p-af7e4741.entry.js +1 -0
- package/dist/bromcom-ui/{p-0d336381.entry.js → p-afb68492.entry.js} +1 -1
- package/dist/bromcom-ui/p-bbf99620.entry.js +1 -0
- package/dist/bromcom-ui/p-bc50aa86.entry.js +1 -0
- package/dist/bromcom-ui/p-e21a8f2d.entry.js +1 -0
- package/dist/bromcom-ui/p-e450ebda.entry.js +1 -0
- package/dist/bromcom-ui/p-e8307da9.entry.js +1 -0
- package/dist/bromcom-ui/{p-26b3d5d0.entry.js → p-e8771d32.entry.js} +1 -1
- package/dist/bromcom-ui/p-f067821e.entry.js +1 -0
- package/dist/bromcom-ui/p-f12743d8.entry.js +1 -0
- package/dist/bromcom-ui/p-ff5e57d3.entry.js +1 -0
- package/dist/cjs/bcm-alert.cjs.entry.js +7 -26
- package/dist/cjs/bcm-badge.cjs.entry.js +50 -0
- package/dist/cjs/{bcm-badge_20.cjs.entry.js → bcm-button_11.cjs.entry.js} +1209 -2835
- package/dist/cjs/bcm-checkbox-lite_4.cjs.entry.js +291 -0
- package/dist/cjs/bcm-colorpicker.cjs.entry.js +3 -3
- package/dist/cjs/{bcm-datetime-picker_2.cjs.entry.js → bcm-datetime-picker.cjs.entry.js} +3 -137
- package/dist/cjs/bcm-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/bcm-list-item_2.cjs.entry.js +197 -0
- package/dist/cjs/bcm-list-select.cjs.entry.js +658 -0
- package/dist/cjs/bcm-list.cjs.entry.js +1204 -0
- package/dist/cjs/{bcm-empty_6.cjs.entry.js → bcm-listbox_5.cjs.entry.js} +10 -77
- package/dist/cjs/bcm-modal.cjs.entry.js +197 -0
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +1 -1
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -2
- package/dist/cjs/bcm-popover-box.cjs.entry.js +1 -1
- package/dist/cjs/bcm-popover.cjs.entry.js +2 -2
- package/dist/cjs/bcm-pulldown-group_2.cjs.entry.js +1 -1
- package/dist/cjs/bcm-pulldown.cjs.entry.js +1 -1
- package/dist/cjs/bcm-radio-group.cjs.entry.js +124 -0
- package/dist/cjs/bcm-radio.cjs.entry.js +104 -0
- package/dist/cjs/bcm-select.cjs.entry.js +68 -8
- package/dist/cjs/bcm-tab-pane.cjs.entry.js +51 -0
- package/dist/cjs/bcm-tab.cjs.entry.js +72 -0
- package/dist/cjs/bcm-tabs-content.cjs.entry.js +43 -0
- package/dist/cjs/bcm-tabs.cjs.entry.js +361 -0
- package/dist/cjs/bcm-text.cjs.entry.js +28 -0
- package/dist/cjs/bcm-upload.cjs.entry.js +1 -1
- package/dist/cjs/bromcom-ui.cjs.js +1 -1
- package/dist/cjs/{element-dragger-36fcb296.js → element-dragger-4a91c708.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/types-37c8ced6.js +16 -0
- package/dist/cjs/types-f53bc841.js +19 -0
- package/dist/cjs/{utils-43fda566.js → utils-60414768.js} +25 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/label/label.css +70 -0
- package/dist/collection/components/atoms/label/label.js +203 -0
- package/dist/collection/components/molecules/checkbox/group.js +19 -6
- package/dist/collection/components/molecules/input/input.js +39 -7
- package/dist/collection/components/molecules/list/list-item.css +1 -0
- package/dist/collection/components/molecules/list/list-select.css +10 -5
- package/dist/collection/components/molecules/list/list-select.js +232 -34
- package/dist/collection/components/molecules/list/list.css +24 -2
- package/dist/collection/components/molecules/list/list.js +391 -119
- package/dist/collection/components/molecules/popconfirm/popconfirm-box.css +1 -0
- package/dist/collection/components/molecules/popconfirm/popconfirm.css +1 -0
- package/dist/collection/components/molecules/popover/popover-box.css +1 -0
- package/dist/collection/components/molecules/popover/popover.css +1 -0
- package/dist/collection/components/molecules/radio/group.js +19 -6
- package/dist/collection/components/molecules/search/search.js +2 -2
- package/dist/collection/components/molecules/select/select.js +85 -12
- package/dist/collection/components/molecules/switch/switch.css +0 -1
- package/dist/collection/components/molecules/switch/switch.js +20 -7
- package/dist/collection/components/molecules/textarea/textarea.css +4 -1
- package/dist/collection/components/molecules/textarea/textarea.js +33 -17
- package/dist/collection/components/molecules/tooltip/tooltip-box.css +1 -0
- package/dist/collection/components/molecules/tooltip/tooltip.css +1 -0
- package/dist/collection/components/organism/colorpicker/colorpicker.js +19 -6
- package/dist/collection/components/organism/datetime-picker/datetime-picker.js +1 -1
- package/dist/collection/components/organism/form/form.js +5 -4
- package/dist/collection/components/organism/listbox/listbox.js +27 -17
- package/dist/collection/helper/color-helper.js +33 -0
- package/dist/collection/helper/generate.js +47 -0
- package/dist/collection/helper/number-helper.js +10 -0
- package/dist/collection/helper/string-helper.js +21 -0
- package/dist/collection/helper/validators.js +21 -0
- package/dist/collection/models/bcm-types.js +1 -0
- package/dist/collection/models/bcm.js +451 -0
- package/dist/collection/templates/caption-template.js +22 -0
- package/dist/collection/templates/label-template.js +16 -0
- package/dist/collection/templates/slot-template.js +6 -0
- package/dist/collection/utils/utils.js +24 -0
- package/dist/esm/bcm-alert.entry.js +1 -20
- package/dist/esm/bcm-badge.entry.js +46 -0
- package/dist/esm/{bcm-badge_20.entry.js → bcm-button_11.entry.js} +1204 -2821
- package/dist/esm/bcm-checkbox-lite_4.entry.js +284 -0
- package/dist/esm/bcm-colorpicker.entry.js +3 -3
- package/dist/esm/{bcm-datetime-picker_2.entry.js → bcm-datetime-picker.entry.js} +4 -137
- package/dist/esm/bcm-dropdown.entry.js +1 -1
- package/dist/esm/bcm-list-item_2.entry.js +192 -0
- package/dist/esm/bcm-list-select.entry.js +654 -0
- package/dist/esm/bcm-list.entry.js +1200 -0
- package/dist/esm/{bcm-empty_6.entry.js → bcm-listbox_5.entry.js} +12 -78
- package/dist/esm/bcm-modal.entry.js +193 -0
- package/dist/esm/bcm-popconfirm-box.entry.js +1 -1
- package/dist/esm/bcm-popconfirm.entry.js +2 -2
- package/dist/esm/bcm-popover-box.entry.js +1 -1
- package/dist/esm/bcm-popover.entry.js +2 -2
- package/dist/esm/bcm-pulldown-group_2.entry.js +1 -1
- package/dist/esm/bcm-pulldown.entry.js +1 -1
- package/dist/esm/bcm-radio-group.entry.js +120 -0
- package/dist/esm/bcm-radio.entry.js +100 -0
- package/dist/esm/bcm-select.entry.js +68 -8
- package/dist/esm/bcm-tab-pane.entry.js +47 -0
- package/dist/esm/bcm-tab.entry.js +68 -0
- package/dist/esm/bcm-tabs-content.entry.js +39 -0
- package/dist/esm/bcm-tabs.entry.js +357 -0
- package/dist/esm/bcm-text.entry.js +24 -0
- package/dist/esm/bcm-upload.entry.js +1 -1
- package/dist/esm/bromcom-ui.js +1 -1
- package/dist/esm/{element-dragger-03ac2a5e.js → element-dragger-97a8f373.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/polyfills/css-shim.js +0 -0
- package/dist/esm/types-4b11eac9.js +28 -0
- package/dist/esm/types-911a8837.js +21 -0
- package/dist/esm/{utils-b7fba7c4.js → utils-de9aee67.js} +25 -1
- package/dist/types/assets/icons/index.d.ts +0 -0
- package/dist/types/assets/icons/index.example.d.ts +0 -0
- package/dist/types/components/atoms/avatar/avatar.d.ts +0 -0
- package/dist/types/components/atoms/badge/badge.d.ts +0 -0
- package/dist/types/components/atoms/button/button.d.ts +0 -0
- package/dist/types/components/atoms/divider/divider.d.ts +0 -0
- package/dist/types/components/atoms/icon/icon.d.ts +0 -0
- package/dist/types/components/atoms/icon/types.d.ts +0 -0
- package/dist/types/components/atoms/label/label.d.ts +16 -0
- package/dist/types/components/atoms/tag/tag.d.ts +0 -0
- package/dist/types/components/atoms/text/text.d.ts +0 -0
- package/dist/types/components/molecules/card/card-footer.d.ts +0 -0
- package/dist/types/components/molecules/card/card-header.d.ts +0 -0
- package/dist/types/components/molecules/card/card.d.ts +0 -0
- package/dist/types/components/molecules/checkbox/checkbox.d.ts +0 -0
- package/dist/types/components/molecules/checkbox/group.d.ts +1 -0
- package/dist/types/components/molecules/input/input.d.ts +2 -0
- package/dist/types/components/molecules/list/list-select.d.ts +24 -4
- package/dist/types/components/molecules/list/list.d.ts +13 -3
- package/dist/types/components/molecules/radio/group.d.ts +1 -0
- package/dist/types/components/molecules/radio/radio.d.ts +0 -0
- package/dist/types/components/molecules/select/group.d.ts +0 -0
- package/dist/types/components/molecules/select/option.d.ts +0 -0
- package/dist/types/components/molecules/select/select.d.ts +1 -0
- package/dist/types/components/molecules/switch/switch.d.ts +1 -0
- package/dist/types/components/molecules/textarea/textarea.d.ts +3 -2
- package/dist/types/components/organism/colorpicker/colorpicker.d.ts +1 -0
- package/dist/types/components/organism/listbox/listbox.d.ts +1 -0
- package/dist/types/components.d.ts +95 -12
- package/dist/types/global/variables/colors.d.ts +0 -0
- package/dist/types/helper/color-helper.d.ts +9 -0
- package/dist/types/helper/generate.d.ts +10 -0
- package/dist/types/helper/number-helper.d.ts +9 -0
- package/dist/types/helper/string-helper.d.ts +20 -0
- package/dist/types/helper/validators.d.ts +8 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/models/bcm-types.d.ts +19 -0
- package/dist/types/models/bcm.d.ts +447 -0
- package/dist/types/stencil-public-runtime.d.ts +0 -0
- package/dist/types/templates/caption-template.d.ts +12 -0
- package/dist/types/templates/label-template.d.ts +12 -0
- package/dist/types/templates/slot-template.d.ts +8 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +0 -0
- package/loader/index.cjs.js +0 -0
- package/loader/index.d.ts +0 -0
- package/loader/index.es2017.js +0 -0
- package/loader/index.js +0 -0
- package/loader/package.json +0 -0
- package/package.json +1 -1
- package/dist/bromcom-ui/p-013b6f5d.entry.js +0 -1
- package/dist/bromcom-ui/p-0532e299.entry.js +0 -1
- package/dist/bromcom-ui/p-0aa53bdb.entry.js +0 -1
- package/dist/bromcom-ui/p-2c1ee381.entry.js +0 -1
- package/dist/bromcom-ui/p-607bc9b3.entry.js +0 -1
- package/dist/bromcom-ui/p-6355c903.entry.js +0 -1
- package/dist/bromcom-ui/p-6bd805f1.entry.js +0 -1
- package/dist/bromcom-ui/p-77a480ff.entry.js +0 -1
- package/dist/bromcom-ui/p-a88256f2.entry.js +0 -1
- package/dist/bromcom-ui/p-b92324e7.js +0 -1
- package/dist/bromcom-ui/p-ba219861.entry.js +0 -1
- package/dist/bromcom-ui/p-cdfd9ba0.entry.js +0 -1
- package/dist/bromcom-ui/p-cf6b0656.entry.js +0 -1
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +0 -273
- package/dist/cjs/bcm-checkbox.cjs.entry.js +0 -143
- package/dist/cjs/bcm-switch.cjs.entry.js +0 -86
- package/dist/cjs/bcm-textarea.cjs.entry.js +0 -136
- package/dist/cjs/bcm-tooltip-box.cjs.entry.js +0 -36
- package/dist/esm/bcm-checkbox-group.entry.js +0 -269
- package/dist/esm/bcm-checkbox.entry.js +0 -139
- package/dist/esm/bcm-switch.entry.js +0 -82
- package/dist/esm/bcm-textarea.entry.js +0 -132
- package/dist/esm/bcm-tooltip-box.entry.js +0 -32
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8fe7aea4.js';
|
|
2
|
+
import { c as classnames } from './index-e58a2d48.js';
|
|
3
|
+
import { C as ColorPalette } from './colors-7c7b35e9.js';
|
|
4
|
+
import { e as extractColor } from './utils-de9aee67.js';
|
|
5
|
+
|
|
6
|
+
const listItemCss = "@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}:host(.hidden){display:none}:host(.selected) .list-item{color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}:host(.selected) .list-item:hover:not(.disabled){color:var(--bcm-color-prime-blue-7);background-color:var(--bcm-color-prime-blue-1)}:host(.selected) .list-item.disabled{color:var(--bcm-color-grey-6);cursor:not-allowed}:host(.selected) .list-item .check{background-color:#333333}:host(.checkable) .list-item .check{display:inline-block}.list-item{padding:8px;color:var(--bcm-color-grey-8);background-color:var(--bcm-color-grey-1);cursor:pointer;display:flex;justify-content:flex-start;align-items:center;flex-direction:row;white-space:break-spaces;margin:0 8px}.list-item .check{display:none;background-color:#ededed;width:15px;height:15px}.list-item .highlight{background-color:var(--bcm-color-yellow-5)}.list-item:hover:not(.disabled),.list-item:active:not(.disabled){color:var(--bcm-color-grey-8);background-color:var(--bcm-color-prime-blue-1)}.list-item .check-content{display:flex;align-items:center;justify-content:flex-start;width:16px;min-width:16px;margin-right:8px;margin-bottom:2px}.checkbox{}.checkbox input{display:none}.checkbox .svg-icon{filter:brightness(0) invert(1);width:12px;height:12px}.checkbox label{display:flex;align-items:flex-start;font-size:14px;color:var(--bcm-color-grey-8);cursor:pointer}.checkbox label span.icon{display:flex;align-items:center;justify-content:center;min-width:16px;min-height:16px;border:1px solid #D9D9D9;margin-right:8px;border-radius:2px;margin-top:2px;background-color:var(--bcm-color-grey-1)}.checkbox.indeterminate label span.icon{position:relative}.checkbox.indeterminate label span.icon::after{content:\"\";position:absolute;top:50%;left:8px;width:10px;height:10px;background-color:var(--bcm-color-prime-blue-6);transform:translate(-50%, -50%);opacity:1;z-index:1}.checkbox.indeterminate label span.icon::before{content:\"\";position:absolute;top:-1px;left:-1px;width:16px;height:100%;border-radius:2px;background-color:var(--bcm-color-grey-1);border:1px solid var(--bcm-color-grey-5);opacity:1;z-index:1}.checkbox.indeterminate label span.icon:hover:not(.disabled):before{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}.checkbox input:checked+label span.icon{background-color:var(--bcm-color-prime-blue-6);border-color:transparent}.checkbox input:checked+label .icon-checked{display:block}.checkbox bcm-icon{filter:brightness(0) invert(1)}.checkbox input[disabled]+label{cursor:not-allowed}.checkbox input[disabled]+label span.icon{background-color:var(--bcm-color-grey-3);border-color:var(--bcm-color-grey-5)}.checkbox input[disabled]+label bcm-icon{filter:brightness(0);opacity:0.3}.checkbox input:not([disabled])+label:hover span.icon{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}.checkbox .caption-area{margin-bottom:8px;min-height:20px;display:block}.checkbox .input-caption{display:block}.checkbox .caption-default{color:#8C8C8C}.checkbox .caption-primary{color:#4293CF}.checkbox .caption-success{color:#52C41A}.checkbox .caption-warning{color:#FA8C16}.checkbox .caption-error{color:#F5222D}.checkbox .radio-button{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-grey-8);border:1px solid var(--bcm-color-grey-5);padding:0 16px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.checkbox .radio-button>span.icon{display:none}.checkbox .radio-button>span.slot{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;user-select:none}.checkbox .radio-button:hover:not(.disabled){color:var(--bcm-color-prime-blue-5)}.checkbox .radio-button:active:not(.disabled){color:var(--bcm-color-prime-blue-7)}.checkbox .radio-button.disabled{background-color:var(--bcm-color-grey-3);color:var(--bcm-color-grey-6);cursor:not-allowed}.checkbox .radio-button.checked.disabled{background-color:var(--bcm-color-grey-4);color:var(--bcm-color-grey-1);border-color:var(--bcm-color-grey-5)}.checkbox .radio-button.checked.solid{color:var(--bcm-color-grey-1);background-color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.checkbox .radio-button.checked.solid:hover{background-color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.checkbox .radio-button.checked.solid:active{background-color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.checkbox .radio-button.checked.outline{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.checkbox .radio-button.checked.outline:hover{color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.checkbox .radio-button.checked.outline:active{color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.checkbox .radio-button.large{height:40px}.checkbox .radio-button.medium{height:32px}.checkbox .radio-button.small{height:24px}";
|
|
7
|
+
|
|
8
|
+
const BcmListItem = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.listSelected = createEvent(this, "bcm-list-selected", 7);
|
|
12
|
+
this.listChecked = createEvent(this, "bcm-list-checked", 7);
|
|
13
|
+
this.size = 'medium';
|
|
14
|
+
this.hidden = false;
|
|
15
|
+
this.disabled = false;
|
|
16
|
+
this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
17
|
+
this.template = null;
|
|
18
|
+
this._uniq_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
19
|
+
// @Prop({ attribute: 'id', reflect: true }) id: string = (Math.random() * 4).toString(16).replace('.', '')
|
|
20
|
+
this._id = (Math.random() * 4).toString(16).replace('.', '');
|
|
21
|
+
this.itemObject = null;
|
|
22
|
+
this.selected = false;
|
|
23
|
+
this.multiSelect = false;
|
|
24
|
+
}
|
|
25
|
+
// @Event({ bubbles: true, composed: true }) loaded: EventEmitter<boolean>;
|
|
26
|
+
connectedCallback() { }
|
|
27
|
+
disconnectedCallback() { }
|
|
28
|
+
componentWillLoad() { }
|
|
29
|
+
componentDidLoad() {
|
|
30
|
+
this.itemObject = this.itemObject;
|
|
31
|
+
// setTimeout(() => {
|
|
32
|
+
// this.loaded.emit(true);
|
|
33
|
+
// }, 1000);
|
|
34
|
+
}
|
|
35
|
+
componentWillRender() { }
|
|
36
|
+
componentDidRender() { }
|
|
37
|
+
componentWillUpdate() { }
|
|
38
|
+
componentDidUpdate() { }
|
|
39
|
+
/**
|
|
40
|
+
* @desc
|
|
41
|
+
*/
|
|
42
|
+
async select() {
|
|
43
|
+
this.sendSelect();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @desc
|
|
47
|
+
*/
|
|
48
|
+
handleClick() {
|
|
49
|
+
this.sendSelect();
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @desc
|
|
53
|
+
*/
|
|
54
|
+
sendSelect() {
|
|
55
|
+
if (!this.disabled) {
|
|
56
|
+
var returnValue = null;
|
|
57
|
+
if (this.itemObject) {
|
|
58
|
+
typeof this.itemObject == 'string'
|
|
59
|
+
? returnValue = JSON.parse(this.itemObject)
|
|
60
|
+
: returnValue = this.itemObject;
|
|
61
|
+
// returnValue = this.itemObject
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
returnValue = this._id;
|
|
65
|
+
}
|
|
66
|
+
this.listSelected.emit(returnValue);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
handleCheckboxClick(e) {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
const { size, disabled, selected, hidden, multiSelect } = this;
|
|
74
|
+
const classes = classnames('list-item', size, {
|
|
75
|
+
'disabled': disabled,
|
|
76
|
+
'selected': selected,
|
|
77
|
+
'size-2': size === 'small' || size === 'medium',
|
|
78
|
+
'size-3': size === 'large',
|
|
79
|
+
});
|
|
80
|
+
const hostClasses = classnames(hidden ? 'hidden' : null, {
|
|
81
|
+
'disabled': disabled,
|
|
82
|
+
'selected': selected,
|
|
83
|
+
'checkable': multiSelect,
|
|
84
|
+
});
|
|
85
|
+
const checkboxClasses = classnames('checkbox', this.hidden ? 'hidden' : null, {
|
|
86
|
+
'indeterminate': false
|
|
87
|
+
});
|
|
88
|
+
const checkboxIconClasses = classnames('icon');
|
|
89
|
+
return (h(Host, { class: hostClasses, onClick: () => this.handleClick() }, h("div", { class: classes }, multiSelect && (h("div", { class: "check-content" }, h("div", { class: checkboxClasses, onClick: (e) => this.handleCheckboxClick(e) }, h("input", { id: 'check-' + this._id, type: "checkbox", name: 'check-' + this._id, checked: this.selected, disabled: this.disabled }), h("label", { htmlFor: 'check-' + this._id }, h("span", { class: checkboxIconClasses }, h("svg", { class: "svg-icon icon-checked", width: "11", height: "9", viewBox: "0 0 11 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M1.91308 4.03516H1.91326C1.99256 4.03525 2.07081 4.05331 2.14213 4.08798C2.21341 4.12262 2.27591 4.17295 2.32497 4.2352L1.91308 4.03516ZM1.91308 4.03516H1.09394C0.890308 4.03516 0.776602 4.26975 0.902321 4.4292L0.902371 4.42927L4.11214 8.49567L4.11218 8.49573C4.32247 8.76188 4.72568 8.76114 4.93667 8.49617L4.93708 8.49566L10.6597 1.24398C10.6598 1.24378 10.66 1.24358 10.6602 1.24338C10.7884 1.08295 10.6699 0.85 10.4689 0.85H9.6498C9.48941 0.85 9.33668 0.9235 9.2376 1.05044C9.23751 1.05055 9.23742 1.05066 9.23734 1.05077L4.52403 7.02157M1.91308 4.03516L4.52403 7.02157M4.52403 7.02157L2.32506 4.23531L4.52403 7.02157Z", fill: "#BFBFBF", stroke: "#BFBFBF", "stroke-width": "0.3" }))))))), h("span", { id: "text" }, this.text ? this.text : h("slot", null)))));
|
|
90
|
+
}
|
|
91
|
+
get el() { return getElement(this); }
|
|
92
|
+
};
|
|
93
|
+
BcmListItem.style = listItemCss;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 'color' prop predefined values
|
|
97
|
+
*/
|
|
98
|
+
var ColorProps;
|
|
99
|
+
(function (ColorProps) {
|
|
100
|
+
ColorProps["black"] = "black";
|
|
101
|
+
ColorProps["white"] = "white";
|
|
102
|
+
ColorProps["prime-blue"] = "prime-blue";
|
|
103
|
+
ColorProps["grey"] = "grey";
|
|
104
|
+
ColorProps["blue"] = "blue";
|
|
105
|
+
ColorProps["warmyellow"] = "warmyellow";
|
|
106
|
+
ColorProps["yellow"] = "yellow";
|
|
107
|
+
ColorProps["limegreen"] = "limegreen";
|
|
108
|
+
ColorProps["red"] = "red";
|
|
109
|
+
ColorProps["darkorange"] = "darkorange";
|
|
110
|
+
ColorProps["orange"] = "orange";
|
|
111
|
+
ColorProps["green"] = "green";
|
|
112
|
+
ColorProps["turquosie"] = "turquosie";
|
|
113
|
+
ColorProps["cobaltblue"] = "cobaltblue";
|
|
114
|
+
ColorProps["magenta"] = "magenta";
|
|
115
|
+
ColorProps["purple"] = "purple";
|
|
116
|
+
ColorProps["bc-red"] = "bc-red";
|
|
117
|
+
ColorProps["bc-blue"] = "bc-blue";
|
|
118
|
+
ColorProps["bc-green"] = "bc-green";
|
|
119
|
+
ColorProps["bc-orange"] = "bc-orange";
|
|
120
|
+
})(ColorProps || (ColorProps = {}));
|
|
121
|
+
|
|
122
|
+
const tagCss = "@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}.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:active{background-color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}";
|
|
123
|
+
|
|
124
|
+
const BcmTag = class {
|
|
125
|
+
constructor(hostRef) {
|
|
126
|
+
registerInstance(this, hostRef);
|
|
127
|
+
this.checkedChange = createEvent(this, "bcm-tag-checked-change", 7);
|
|
128
|
+
this.tagDissmisable = createEvent(this, "bcm-tag-dissmisable", 7);
|
|
129
|
+
this.type = 'basic';
|
|
130
|
+
this.size = 'size-1';
|
|
131
|
+
this.checked = false;
|
|
132
|
+
this.value = '';
|
|
133
|
+
this.hidden = false;
|
|
134
|
+
this._id = (Math.random() * 4).toString(16).replace('.', '');
|
|
135
|
+
this.maxWidth = false;
|
|
136
|
+
this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
137
|
+
}
|
|
138
|
+
handleClick() {
|
|
139
|
+
if (this.type === 'checkable') {
|
|
140
|
+
this.checked = !this.checked;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
onCheckedChange(newValue, oldValue) {
|
|
144
|
+
this.checkedChange.emit({ newValue, oldValue });
|
|
145
|
+
}
|
|
146
|
+
getColor(color) {
|
|
147
|
+
if ((this.type == 'basic' || this.type == 'dissmisable') && ColorProps[color])
|
|
148
|
+
return {
|
|
149
|
+
color: extractColor(ColorPalette, ColorProps[color] + '-6'),
|
|
150
|
+
borderColor: extractColor(ColorPalette, ColorProps[color] + '-3'),
|
|
151
|
+
backgroundColor: extractColor(ColorPalette, ColorProps[color] + '-1')
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
getSize(size, returnNumber = false) {
|
|
155
|
+
if (Number(size) == size) {
|
|
156
|
+
size = "size-" + size;
|
|
157
|
+
}
|
|
158
|
+
if (returnNumber) {
|
|
159
|
+
size = size.split("-");
|
|
160
|
+
size = size[size.length - 1];
|
|
161
|
+
var sizeList = { "1": "12", "2": "14", "3": "16", "4": "20", "5": "24", "6": "30", "7": "38", "8": "46", "9": "56" };
|
|
162
|
+
size = sizeList[size];
|
|
163
|
+
}
|
|
164
|
+
return size;
|
|
165
|
+
}
|
|
166
|
+
handleClose() {
|
|
167
|
+
this.tagDissmisable.emit(this.el);
|
|
168
|
+
// this.el.remove()
|
|
169
|
+
}
|
|
170
|
+
render() {
|
|
171
|
+
const { type, color, value, customStyle, size } = this;
|
|
172
|
+
const classes = classnames('tag', this.getSize(size), type);
|
|
173
|
+
const hostClasses = classnames(this.hidden ? 'hidden' : null, this.maxWidth ? 'maxwidth' : null);
|
|
174
|
+
if (type === 'add') {
|
|
175
|
+
return (h(Host, { class: hostClasses }, h("button", { class: classes }, h("span", { class: "left" }, h("bcm-icon", { icon: "plus", type: "outlined", color: "grey-8", size: (Number(this.getSize(size, true)) + 2) })), value)));
|
|
176
|
+
}
|
|
177
|
+
else if (type === 'dissmisable') {
|
|
178
|
+
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("bcm-icon", { id: "close", icon: "close", type: "outlined", size: (Number(this.getSize(size, true)) + 2) })))));
|
|
179
|
+
}
|
|
180
|
+
else if (type === 'checkable') {
|
|
181
|
+
return (h(Host, { class: hostClasses }, h("input", { type: "checkbox", checked: this.checked }), h("label", { class: classes }, value)));
|
|
182
|
+
}
|
|
183
|
+
return (h(Host, { class: hostClasses }, h("span", { class: classes, style: this.getColor(color) }, value)));
|
|
184
|
+
}
|
|
185
|
+
get el() { return getElement(this); }
|
|
186
|
+
static get watchers() { return {
|
|
187
|
+
"checked": ["onCheckedChange"]
|
|
188
|
+
}; }
|
|
189
|
+
};
|
|
190
|
+
BcmTag.style = tagCss;
|
|
191
|
+
|
|
192
|
+
export { BcmListItem as bcm_list_item, BcmTag as bcm_tag };
|