bromcom-ui 2.11.1-rc.9-1 → 2.11.1-rc.9-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bromcom-ui/bromcom-ui.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/{p-65119762.entry.js → p-0eacfbb2.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c661de9e.entry.js → p-14ed8029.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6a82a1c6.entry.js → p-178fa936.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3a290e0d.entry.js → p-3361f6c9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7a590e30.entry.js → p-350dbff0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5f4a7e27.entry.js → p-35c215f2.entry.js} +1 -1
- package/dist/bromcom-ui/p-3a43bf45.js +5 -0
- package/dist/bromcom-ui/{p-54788d6e.entry.js → p-3cdfd8eb.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2bdf78f5.entry.js → p-5a22b74b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f990f4c3.js → p-5a391fcd.js} +1 -1
- package/dist/bromcom-ui/{p-ce917a87.entry.js → p-5bf1657b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6bea284a.js → p-61753299.js} +1 -1
- package/dist/bromcom-ui/{p-cbbadc43.entry.js → p-627c7769.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4cc25225.entry.js → p-64f21481.entry.js} +3 -3
- package/dist/bromcom-ui/{p-7d0d6073.entry.js → p-6f37a4d7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1d81a0a4.entry.js → p-70253803.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5b63bfc6.entry.js → p-7fd22a35.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4d55ba21.js → p-8b31581f.js} +1 -1
- package/dist/bromcom-ui/{p-e98016f3.entry.js → p-90223f9f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0d0e3903.js → p-930f3618.js} +1 -1
- package/dist/bromcom-ui/{p-5d670fd7.entry.js → p-9589f69c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b72147fd.entry.js → p-a018f340.entry.js} +1 -1
- package/dist/bromcom-ui/p-a4b675ef.entry.js +5 -0
- package/dist/bromcom-ui/{p-a32b4186.entry.js → p-abd2f9ff.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d5251ffe.entry.js → p-adcb30bc.entry.js} +1 -1
- package/dist/bromcom-ui/p-bb46d881.entry.js +5 -0
- package/dist/bromcom-ui/{p-959bd503.entry.js → p-bca0ff0a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9668c853.entry.js → p-c10b07cc.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a9759941.entry.js → p-c7030364.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cb7003f0.entry.js → p-db15dca3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a20ac74f.entry.js → p-dc607ae4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ea062405.entry.js → p-e10780ed.entry.js} +1 -1
- package/dist/bromcom-ui/p-e497cf5d.entry.js +5 -0
- package/dist/bromcom-ui/{p-2c4435e2.js → p-e93d6619.js} +1 -1
- package/dist/bromcom-ui/{p-cf119021.entry.js → p-ebeb9689.entry.js} +1 -1
- package/dist/bromcom-ui/{p-46cc4f0c.js → p-ede82918.js} +1 -1
- package/dist/bromcom-ui/{p-e72cd4e5.entry.js → p-fba1682e.entry.js} +1 -1
- package/dist/cjs/{bcm-accordion_45.cjs.entry.js → bcm-accordion_46.cjs.entry.js} +146 -7
- package/dist/cjs/bcm-alert.cjs.entry.js +3 -3
- package/dist/cjs/bcm-attendance-actions-comment.cjs.entry.js +6 -6
- package/dist/cjs/bcm-attendance-actions-dropdown.cjs.entry.js +6 -6
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/bcm-caption.cjs.entry.js +6 -6
- package/dist/cjs/bcm-card.cjs.entry.js +4 -4
- package/dist/cjs/bcm-checkbox-lite_8.cjs.entry.js +3 -3
- package/dist/cjs/bcm-chip-group.cjs.entry.js +6 -6
- package/dist/cjs/bcm-collapse.cjs.entry.js +3 -3
- package/dist/cjs/bcm-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +3 -3
- package/dist/cjs/bcm-default.cjs.entry.js +3 -3
- package/dist/cjs/bcm-form-2.cjs.entry.js +3 -3
- package/dist/cjs/bcm-input-custom.cjs.entry.js +3 -3
- package/dist/cjs/bcm-input-dropdown.cjs.entry.js +6 -6
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +6 -6
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +6 -6
- package/dist/cjs/bcm-modal-2.cjs.entry.js +6 -6
- package/dist/cjs/bcm-number-input.cjs.entry.js +6 -6
- package/dist/cjs/bcm-overlay_2.cjs.entry.js +1 -1
- package/dist/cjs/bcm-popover.cjs.entry.js +6 -6
- package/dist/cjs/bcm-range.cjs.entry.js +3 -3
- package/dist/cjs/bcm-skeleton.cjs.entry.js +6 -6
- package/dist/cjs/bcm-table.cjs.entry.js +6 -6
- package/dist/cjs/bcm-tag.cjs.entry.js +4 -4
- package/dist/cjs/bcm-time-picker.cjs.entry.js +3 -3
- package/dist/cjs/bcm-toast.cjs.entry.js +3 -3
- package/dist/cjs/bromcom-ui.cjs.js +3 -3
- package/dist/cjs/{color-helper-dc98a2ca.js → color-helper-c3a819ea.js} +1 -1
- package/dist/cjs/{colors-250d0982.js → colors-078851ec.js} +7 -13
- package/dist/cjs/{generate-c4e28fef.js → generate-f73a098d.js} +2 -2
- package/dist/cjs/{global-32a72f23.js → global-baf04c81.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{number-helper-40bfb2fc.js → number-helper-0543a62e.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +4 -4
- package/dist/cjs/old-bcm-popover.cjs.entry.js +3 -3
- package/dist/cjs/{package-4a28cfe9.js → package-e717a31f.js} +1 -1
- package/dist/cjs/{validators-0f4f7438.js → validators-77768582.js} +1 -1
- package/dist/collection/components/molecules/modal/modal.css +1 -1
- package/dist/collection/components/organism/list/list.css +2 -2
- package/dist/components/bcm-modal.js +1 -1
- package/dist/components/colors2.js +7 -13
- package/dist/components/generate.js +1 -1
- package/dist/components/list.js +1 -1
- package/dist/esm/{bcm-accordion_45.entry.js → bcm-accordion_46.entry.js} +146 -8
- package/dist/esm/bcm-alert.entry.js +3 -3
- package/dist/esm/bcm-attendance-actions-comment.entry.js +6 -6
- package/dist/esm/bcm-attendance-actions-dropdown.entry.js +6 -6
- package/dist/esm/bcm-breadcrumb.entry.js +3 -3
- package/dist/esm/bcm-caption.entry.js +6 -6
- package/dist/esm/bcm-card.entry.js +4 -4
- package/dist/esm/bcm-checkbox-lite_8.entry.js +3 -3
- package/dist/esm/bcm-chip-group.entry.js +6 -6
- package/dist/esm/bcm-collapse.entry.js +3 -3
- package/dist/esm/bcm-date-picker.entry.js +3 -3
- package/dist/esm/bcm-datetime-picker.entry.js +3 -3
- package/dist/esm/bcm-default.entry.js +3 -3
- package/dist/esm/bcm-form-2.entry.js +3 -3
- package/dist/esm/bcm-input-custom.entry.js +3 -3
- package/dist/esm/bcm-input-dropdown.entry.js +6 -6
- package/dist/esm/bcm-modal-2-footer.entry.js +6 -6
- package/dist/esm/bcm-modal-2-header.entry.js +6 -6
- package/dist/esm/bcm-modal-2.entry.js +6 -6
- package/dist/esm/bcm-number-input.entry.js +6 -6
- package/dist/esm/bcm-overlay_2.entry.js +1 -1
- package/dist/esm/bcm-popover.entry.js +6 -6
- package/dist/esm/bcm-range.entry.js +3 -3
- package/dist/esm/bcm-skeleton.entry.js +6 -6
- package/dist/esm/bcm-table.entry.js +6 -6
- package/dist/esm/bcm-tag.entry.js +4 -4
- package/dist/esm/bcm-time-picker.entry.js +3 -3
- package/dist/esm/bcm-toast.entry.js +3 -3
- package/dist/esm/bromcom-ui.js +3 -3
- package/dist/esm/{color-helper-74614f24.js → color-helper-3b528349.js} +1 -1
- package/dist/esm/{colors-dd598eea.js → colors-c530a5b8.js} +7 -13
- package/dist/esm/{generate-7f921cea.js → generate-c2c0b02e.js} +2 -2
- package/dist/esm/{global-e270bb55.js → global-2473677b.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{number-helper-48abae7a.js → number-helper-75447fa6.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +4 -4
- package/dist/esm/old-bcm-popover.entry.js +3 -3
- package/dist/esm/{package-52b93905.js → package-28dc6847.js} +1 -1
- package/dist/esm/{validators-2bf0eca1.js → validators-5a383988.js} +1 -1
- package/package.json +1 -1
- package/dist/bromcom-ui/p-5be80cce.entry.js +0 -5
- package/dist/bromcom-ui/p-991f374c.entry.js +0 -5
- package/dist/bromcom-ui/p-aeb4be41.js +0 -5
- package/dist/bromcom-ui/p-b703f03f.entry.js +0 -5
- package/dist/bromcom-ui/p-ee0bfc38.entry.js +0 -5
- package/dist/cjs/bcm-modal.cjs.entry.js +0 -157
- package/dist/esm/bcm-modal.entry.js +0 -153
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
|
-
|
|
9
|
-
const index = require('./index-c591ecec.js');
|
|
10
|
-
const index$1 = require('./index-95ae50d0.js');
|
|
11
|
-
const bcm = require('./bcm-1d1fcf21.js');
|
|
12
|
-
const stringHelper = require('./string-helper-9cdfb273.js');
|
|
13
|
-
const slotTemplate = require('./slot-template-df7b5b59.js');
|
|
14
|
-
const generate = require('./generate-c4e28fef.js');
|
|
15
|
-
require('./_commonjsHelpers-ed84c3ca.js');
|
|
16
|
-
require('./package-4a28cfe9.js');
|
|
17
|
-
require('./colors-250d0982.js');
|
|
18
|
-
|
|
19
|
-
const modalCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{box-sizing:border-box}.bcm-modal{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;flex-wrap:nowrap;width:100%;height:100%;position:fixed;z-index:-1;opacity:0;top:0;left:0;visibility:hidden;overflow:auto;padding:24px;transition:opacity 0.5s ease, visibility 0.4s ease-in-out, 0.3s z-index}.bcm-modal__show{opacity:1;z-index:10500;visibility:visible;transition:opacity 0.2s ease, visibility 0.4s ease-in-out, 0.3s z-index}.bcm-modal__show .bcm-modal__container{transition:opacity 0.2s ease-in-out, transform 0.2s ease-in-out;transform:translateY(0)}.bcm-modal .overlay{position:fixed;width:100vw;height:100vh;z-index:1;top:0;left:0;opacity:0.6;background-color:var(--bcm-new-ds-color-slate-900)}.bcm-modal__container{display:flex;flex-direction:column;width:100%;box-shadow:0 2px 6px 1px rgba(17, 24, 38, 0.1);border-radius:8px;background-color:var(--bcm-new-ds-color-white);z-index:2;transform:translateY(-50px);transition:opacity 0.2s ease-in-out, transform 0.2s ease-in-out}.bcm-modal__container.portrait{max-width:312px}.bcm-modal__container.landscape{max-width:475px}.bcm-modal__container.small{max-width:576px}.bcm-modal__container.medium{max-width:768px}.bcm-modal__container.large{max-width:992px}.bcm-modal__container.xlarge{max-width:1024px}.bcm-modal__container.xxlarge{max-width:1200px}.bcm-modal__container.xxxlarge{max-width:1700px}.bcm-modal__container.full-width{width:100%;max-width:100%}.bcm-modal__container.custom-size main{overflow:auto;height:100%;width:100%}.bcm-modal__container-main{color:var(--bcm-color-grey-8);padding:0}.bcm-modal__container-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:nowrap;padding:12px 24px;font-size:16px;line-height:calc(16px + 8px);font-weight:500;color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-slate-100);position:relative}.bcm-modal__container-header span.full-width{width:100%}.bcm-modal__container-header-close{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:nowrap;padding:8px;cursor:pointer;color:var(--bcm-new-ds-color-slate-500);transition:color 0.1s ease-in-out}.bcm-modal__container-header-close:hover{color:var(--bcm-new-ds-color-slate-600)}.bcm-modal__container-header-close:active{color:var(--bcm-new-ds-color-slate-700)}.bcm-modal__container-header-close:focus-visible{color:var(--bcm-new-ds-color-slate-800)}.bcm-modal__container-header:after{border-radius:8px 8px 0 0;content:\"\";display:block;width:100%;height:4px;background-color:var(--bcm-color-primary-400);position:absolute;top:-4px;left:0}.bcm-modal__container-footer-content{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-end;flex-wrap:nowrap;padding:12px 24px 24px;grid-gap:8px}";
|
|
20
|
-
|
|
21
|
-
const BcmModal = class {
|
|
22
|
-
constructor(hostRef) {
|
|
23
|
-
index.registerInstance(this, hostRef);
|
|
24
|
-
this.close = index.createEvent(this, "bcm-close", 3);
|
|
25
|
-
this.modalClose = index.createEvent(this, "bcm-modal-close", 3);
|
|
26
|
-
this.modalBeforeClose = index.createEvent(this, "bcm-modal-before-close", 3);
|
|
27
|
-
this.modalBeforeOpen = index.createEvent(this, "bcm-modal-before-open", 3);
|
|
28
|
-
this.modalSlots = {};
|
|
29
|
-
this._id = generate.Generate.UID();
|
|
30
|
-
this.isShow = false;
|
|
31
|
-
this.hidden = false;
|
|
32
|
-
this.size = bcm.Bcm$1.Size.medium;
|
|
33
|
-
this.backdrop = true;
|
|
34
|
-
this.width = undefined;
|
|
35
|
-
this.height = undefined;
|
|
36
|
-
this.fullWidth = false;
|
|
37
|
-
}
|
|
38
|
-
connectedCallback() {
|
|
39
|
-
const bcmSlots = this.el.querySelectorAll('bcm-modal-header, bcm-modal-footer');
|
|
40
|
-
if (bcmSlots) {
|
|
41
|
-
bcmSlots.forEach(el => {
|
|
42
|
-
let slotName = stringHelper.StringHelper.lowercase(stringHelper.StringHelper.split(el.nodeName, '-').pop());
|
|
43
|
-
el.slot = slotName;
|
|
44
|
-
el.classList.add(`bcm-modal__container-${slotName}-content`);
|
|
45
|
-
this.modalSlots[slotName] = el;
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
const disableScrollClass = `bcm-modal--disable-scroll-${this._id}`;
|
|
49
|
-
const styleId = `bcm-modal-style-${this._id}`;
|
|
50
|
-
let style = document.getElementById(styleId);
|
|
51
|
-
if (!style) {
|
|
52
|
-
style = document.createElement('style');
|
|
53
|
-
style.id = styleId;
|
|
54
|
-
style.innerHTML = `.${disableScrollClass} { overflow: hidden; }`;
|
|
55
|
-
document.head.appendChild(style);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
componentWillLoad() {
|
|
59
|
-
// document.body.appendChild(this.el);
|
|
60
|
-
}
|
|
61
|
-
handleSubmit(e) {
|
|
62
|
-
const button = generate.Generate.findEventPathWithNodeName(e, stringHelper.StringHelper.uppercase('bcm-button'));
|
|
63
|
-
if (button && button.dataDismiss) {
|
|
64
|
-
this.hide();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
handleBackdrop() {
|
|
68
|
-
if (this.backdrop == true) {
|
|
69
|
-
this.hide();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
async hide(obj = { force: false }) {
|
|
73
|
-
if (obj === null || obj === void 0 ? void 0 : obj.force) {
|
|
74
|
-
this.isShow = false;
|
|
75
|
-
this.close.emit(); // Deprecated
|
|
76
|
-
this.modalClose.emit();
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
this.modalBeforeClose.emit(this.el);
|
|
80
|
-
}
|
|
81
|
-
async show(obj = { force: false }) {
|
|
82
|
-
if (obj === null || obj === void 0 ? void 0 : obj.force) {
|
|
83
|
-
this.isShow = true;
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
this.modalBeforeOpen.emit(this.el);
|
|
87
|
-
}
|
|
88
|
-
keyboardNavigation(e) {
|
|
89
|
-
if (this.backdrop == true) {
|
|
90
|
-
const keyCode = e.keyCode || 0;
|
|
91
|
-
if (keyCode == bcm.Bcm$1.KeyCode.escape) {
|
|
92
|
-
e.preventDefault();
|
|
93
|
-
this.hide();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
async showModal(e) {
|
|
98
|
-
if (e.defaultPrevented) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
if (e.target === this.el) {
|
|
102
|
-
this.isShow = true;
|
|
103
|
-
// document.body.appendChild(this.el); A solution must be found for this.
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
async hideModal(e) {
|
|
107
|
-
if (e.defaultPrevented) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
if (e.target === this.el) {
|
|
111
|
-
this.isShow = false;
|
|
112
|
-
this.close.emit(); // Deprecated
|
|
113
|
-
this.modalClose.emit();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
_openHandler() {
|
|
117
|
-
const disableScrollClass = `bcm-modal--disable-scroll-${this._id}`;
|
|
118
|
-
if (this.isShow) {
|
|
119
|
-
document.body.classList.add(disableScrollClass);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
document.body.classList.remove(disableScrollClass);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
disconnectedCallback() {
|
|
126
|
-
const disableScrollClass = `bcm-modal--disable-scroll-${this._id}`;
|
|
127
|
-
document.body.classList.remove(disableScrollClass);
|
|
128
|
-
}
|
|
129
|
-
render() {
|
|
130
|
-
const { isShow, size, fullWidth, hidden, width, height } = this;
|
|
131
|
-
const bcmModalContainer = index$1.classnames('bcm-modal__container', size, {
|
|
132
|
-
'custom-size': width || height,
|
|
133
|
-
'full-width': fullWidth,
|
|
134
|
-
'bcm-modal__show': isShow,
|
|
135
|
-
});
|
|
136
|
-
const bcmModalHostClasses = index$1.classnames('bcm-modal', {
|
|
137
|
-
hidden,
|
|
138
|
-
'bcm-modal__show': isShow,
|
|
139
|
-
});
|
|
140
|
-
const mainClasses = index$1.classnames('bcm-modal__container-main', 'size-2');
|
|
141
|
-
const FooterTemplate = () => {
|
|
142
|
-
return (this.modalSlots['footer'] && (index.h("footer", { class: "bcm-modal__container-footer" }, index.h("slot", { name: "footer" }))));
|
|
143
|
-
};
|
|
144
|
-
const HeaderTemplate = () => {
|
|
145
|
-
return (this.modalSlots['header'] && (index.h("header", { class: "bcm-modal__container-header" }, index.h(slotTemplate.SlotTemplate, { name: "header", className: 'full-width' }), index.h("div", { class: "bcm-modal__container-header-close", onClick: () => this.hide() }, index.h("bcm-icon", { icon: "far fa-times" })))));
|
|
146
|
-
};
|
|
147
|
-
const customStyle = Object.assign(Object.assign({}, (width && { width: width })), (height && { height: height }));
|
|
148
|
-
return (index.h(index.Host, { class: `tw-overscroll-contain ${bcmModalHostClasses}` }, index.h("div", { class: "overlay", onClick: () => this.handleBackdrop() }), index.h("div", { class: bcmModalContainer, style: customStyle }, index.h(HeaderTemplate, null), index.h("main", { class: mainClasses }, index.h("article", null, index.h(slotTemplate.SlotTemplate, null))), index.h(FooterTemplate, null))));
|
|
149
|
-
}
|
|
150
|
-
get el() { return index.getElement(this); }
|
|
151
|
-
static get watchers() { return {
|
|
152
|
-
"isShow": ["_openHandler"]
|
|
153
|
-
}; }
|
|
154
|
-
};
|
|
155
|
-
BcmModal.style = modalCss;
|
|
156
|
-
|
|
157
|
-
exports.bcm_modal = BcmModal;
|
|
@@ -1,153 +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 { a as Bcm } from './bcm-a50d55ba.js';
|
|
8
|
-
import { S as StringHelper } from './string-helper-3592bdc2.js';
|
|
9
|
-
import { S as SlotTemplate } from './slot-template-2a19b2db.js';
|
|
10
|
-
import { G as Generate } from './generate-7f921cea.js';
|
|
11
|
-
import './_commonjsHelpers-82aa9212.js';
|
|
12
|
-
import './package-52b93905.js';
|
|
13
|
-
import './colors-dd598eea.js';
|
|
14
|
-
|
|
15
|
-
const modalCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{box-sizing:border-box}.bcm-modal{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;flex-wrap:nowrap;width:100%;height:100%;position:fixed;z-index:-1;opacity:0;top:0;left:0;visibility:hidden;overflow:auto;padding:24px;transition:opacity 0.5s ease, visibility 0.4s ease-in-out, 0.3s z-index}.bcm-modal__show{opacity:1;z-index:10500;visibility:visible;transition:opacity 0.2s ease, visibility 0.4s ease-in-out, 0.3s z-index}.bcm-modal__show .bcm-modal__container{transition:opacity 0.2s ease-in-out, transform 0.2s ease-in-out;transform:translateY(0)}.bcm-modal .overlay{position:fixed;width:100vw;height:100vh;z-index:1;top:0;left:0;opacity:0.6;background-color:var(--bcm-new-ds-color-slate-900)}.bcm-modal__container{display:flex;flex-direction:column;width:100%;box-shadow:0 2px 6px 1px rgba(17, 24, 38, 0.1);border-radius:8px;background-color:var(--bcm-new-ds-color-white);z-index:2;transform:translateY(-50px);transition:opacity 0.2s ease-in-out, transform 0.2s ease-in-out}.bcm-modal__container.portrait{max-width:312px}.bcm-modal__container.landscape{max-width:475px}.bcm-modal__container.small{max-width:576px}.bcm-modal__container.medium{max-width:768px}.bcm-modal__container.large{max-width:992px}.bcm-modal__container.xlarge{max-width:1024px}.bcm-modal__container.xxlarge{max-width:1200px}.bcm-modal__container.xxxlarge{max-width:1700px}.bcm-modal__container.full-width{width:100%;max-width:100%}.bcm-modal__container.custom-size main{overflow:auto;height:100%;width:100%}.bcm-modal__container-main{color:var(--bcm-color-grey-8);padding:0}.bcm-modal__container-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:nowrap;padding:12px 24px;font-size:16px;line-height:calc(16px + 8px);font-weight:500;color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-slate-100);position:relative}.bcm-modal__container-header span.full-width{width:100%}.bcm-modal__container-header-close{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:nowrap;padding:8px;cursor:pointer;color:var(--bcm-new-ds-color-slate-500);transition:color 0.1s ease-in-out}.bcm-modal__container-header-close:hover{color:var(--bcm-new-ds-color-slate-600)}.bcm-modal__container-header-close:active{color:var(--bcm-new-ds-color-slate-700)}.bcm-modal__container-header-close:focus-visible{color:var(--bcm-new-ds-color-slate-800)}.bcm-modal__container-header:after{border-radius:8px 8px 0 0;content:\"\";display:block;width:100%;height:4px;background-color:var(--bcm-color-primary-400);position:absolute;top:-4px;left:0}.bcm-modal__container-footer-content{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-end;flex-wrap:nowrap;padding:12px 24px 24px;grid-gap:8px}";
|
|
16
|
-
|
|
17
|
-
const BcmModal = class {
|
|
18
|
-
constructor(hostRef) {
|
|
19
|
-
registerInstance(this, hostRef);
|
|
20
|
-
this.close = createEvent(this, "bcm-close", 3);
|
|
21
|
-
this.modalClose = createEvent(this, "bcm-modal-close", 3);
|
|
22
|
-
this.modalBeforeClose = createEvent(this, "bcm-modal-before-close", 3);
|
|
23
|
-
this.modalBeforeOpen = createEvent(this, "bcm-modal-before-open", 3);
|
|
24
|
-
this.modalSlots = {};
|
|
25
|
-
this._id = Generate.UID();
|
|
26
|
-
this.isShow = false;
|
|
27
|
-
this.hidden = false;
|
|
28
|
-
this.size = Bcm.Size.medium;
|
|
29
|
-
this.backdrop = true;
|
|
30
|
-
this.width = undefined;
|
|
31
|
-
this.height = undefined;
|
|
32
|
-
this.fullWidth = false;
|
|
33
|
-
}
|
|
34
|
-
connectedCallback() {
|
|
35
|
-
const bcmSlots = this.el.querySelectorAll('bcm-modal-header, bcm-modal-footer');
|
|
36
|
-
if (bcmSlots) {
|
|
37
|
-
bcmSlots.forEach(el => {
|
|
38
|
-
let slotName = StringHelper.lowercase(StringHelper.split(el.nodeName, '-').pop());
|
|
39
|
-
el.slot = slotName;
|
|
40
|
-
el.classList.add(`bcm-modal__container-${slotName}-content`);
|
|
41
|
-
this.modalSlots[slotName] = el;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
const disableScrollClass = `bcm-modal--disable-scroll-${this._id}`;
|
|
45
|
-
const styleId = `bcm-modal-style-${this._id}`;
|
|
46
|
-
let style = document.getElementById(styleId);
|
|
47
|
-
if (!style) {
|
|
48
|
-
style = document.createElement('style');
|
|
49
|
-
style.id = styleId;
|
|
50
|
-
style.innerHTML = `.${disableScrollClass} { overflow: hidden; }`;
|
|
51
|
-
document.head.appendChild(style);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
componentWillLoad() {
|
|
55
|
-
// document.body.appendChild(this.el);
|
|
56
|
-
}
|
|
57
|
-
handleSubmit(e) {
|
|
58
|
-
const button = Generate.findEventPathWithNodeName(e, StringHelper.uppercase('bcm-button'));
|
|
59
|
-
if (button && button.dataDismiss) {
|
|
60
|
-
this.hide();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
handleBackdrop() {
|
|
64
|
-
if (this.backdrop == true) {
|
|
65
|
-
this.hide();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
async hide(obj = { force: false }) {
|
|
69
|
-
if (obj === null || obj === void 0 ? void 0 : obj.force) {
|
|
70
|
-
this.isShow = false;
|
|
71
|
-
this.close.emit(); // Deprecated
|
|
72
|
-
this.modalClose.emit();
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
this.modalBeforeClose.emit(this.el);
|
|
76
|
-
}
|
|
77
|
-
async show(obj = { force: false }) {
|
|
78
|
-
if (obj === null || obj === void 0 ? void 0 : obj.force) {
|
|
79
|
-
this.isShow = true;
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
this.modalBeforeOpen.emit(this.el);
|
|
83
|
-
}
|
|
84
|
-
keyboardNavigation(e) {
|
|
85
|
-
if (this.backdrop == true) {
|
|
86
|
-
const keyCode = e.keyCode || 0;
|
|
87
|
-
if (keyCode == Bcm.KeyCode.escape) {
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
this.hide();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
async showModal(e) {
|
|
94
|
-
if (e.defaultPrevented) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
if (e.target === this.el) {
|
|
98
|
-
this.isShow = true;
|
|
99
|
-
// document.body.appendChild(this.el); A solution must be found for this.
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
async hideModal(e) {
|
|
103
|
-
if (e.defaultPrevented) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
if (e.target === this.el) {
|
|
107
|
-
this.isShow = false;
|
|
108
|
-
this.close.emit(); // Deprecated
|
|
109
|
-
this.modalClose.emit();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
_openHandler() {
|
|
113
|
-
const disableScrollClass = `bcm-modal--disable-scroll-${this._id}`;
|
|
114
|
-
if (this.isShow) {
|
|
115
|
-
document.body.classList.add(disableScrollClass);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
document.body.classList.remove(disableScrollClass);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
disconnectedCallback() {
|
|
122
|
-
const disableScrollClass = `bcm-modal--disable-scroll-${this._id}`;
|
|
123
|
-
document.body.classList.remove(disableScrollClass);
|
|
124
|
-
}
|
|
125
|
-
render() {
|
|
126
|
-
const { isShow, size, fullWidth, hidden, width, height } = this;
|
|
127
|
-
const bcmModalContainer = classnames('bcm-modal__container', size, {
|
|
128
|
-
'custom-size': width || height,
|
|
129
|
-
'full-width': fullWidth,
|
|
130
|
-
'bcm-modal__show': isShow,
|
|
131
|
-
});
|
|
132
|
-
const bcmModalHostClasses = classnames('bcm-modal', {
|
|
133
|
-
hidden,
|
|
134
|
-
'bcm-modal__show': isShow,
|
|
135
|
-
});
|
|
136
|
-
const mainClasses = classnames('bcm-modal__container-main', 'size-2');
|
|
137
|
-
const FooterTemplate = () => {
|
|
138
|
-
return (this.modalSlots['footer'] && (h("footer", { class: "bcm-modal__container-footer" }, h("slot", { name: "footer" }))));
|
|
139
|
-
};
|
|
140
|
-
const HeaderTemplate = () => {
|
|
141
|
-
return (this.modalSlots['header'] && (h("header", { class: "bcm-modal__container-header" }, h(SlotTemplate, { name: "header", className: 'full-width' }), h("div", { class: "bcm-modal__container-header-close", onClick: () => this.hide() }, h("bcm-icon", { icon: "far fa-times" })))));
|
|
142
|
-
};
|
|
143
|
-
const customStyle = Object.assign(Object.assign({}, (width && { width: width })), (height && { height: height }));
|
|
144
|
-
return (h(Host, { class: `tw-overscroll-contain ${bcmModalHostClasses}` }, h("div", { class: "overlay", onClick: () => this.handleBackdrop() }), h("div", { class: bcmModalContainer, style: customStyle }, h(HeaderTemplate, null), h("main", { class: mainClasses }, h("article", null, h(SlotTemplate, null))), h(FooterTemplate, null))));
|
|
145
|
-
}
|
|
146
|
-
get el() { return getElement(this); }
|
|
147
|
-
static get watchers() { return {
|
|
148
|
-
"isShow": ["_openHandler"]
|
|
149
|
-
}; }
|
|
150
|
-
};
|
|
151
|
-
BcmModal.style = modalCss;
|
|
152
|
-
|
|
153
|
-
export { BcmModal as bcm_modal };
|