bromcom-ui 3.0.0-alpha.3 → 3.0.0-alpha.4
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-dc8b7bd5.entry.js → p-0b7de283.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ff8adde6.entry.js → p-0e75f6ba.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3a6e9576.entry.js → p-112b9a62.entry.js} +1 -1
- package/dist/bromcom-ui/{p-be96827e.js → p-1535f9b1.js} +1 -1
- package/dist/bromcom-ui/{p-ef839034.entry.js → p-32ce6cf6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-33d97b3f.entry.js → p-33b2ed75.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e115af8a.entry.js → p-4545a13d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f1de8ed5.entry.js → p-5532696c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f6e710ff.entry.js → p-69adb859.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d0647951.js → p-6ce02d0a.js} +1 -1
- package/dist/bromcom-ui/p-7c08789d.entry.js +5 -0
- package/dist/bromcom-ui/{p-b7f449ff.entry.js → p-803739bc.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3b988ad1.entry.js → p-8390dd02.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d0aa71e1.entry.js → p-8e7274e4.entry.js} +1 -1
- package/dist/bromcom-ui/p-91197b04.js +5 -0
- package/dist/bromcom-ui/{p-16b8a312.entry.js → p-9e0dd503.entry.js} +2 -2
- package/dist/bromcom-ui/{p-be8aa3b8.entry.js → p-a320cde8.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b9b9d753.entry.js → p-a80e6310.entry.js} +1 -1
- package/dist/bromcom-ui/{p-91aa21af.entry.js → p-acab07ec.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a53c3682.entry.js → p-b333a3d7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b386e9c9.entry.js → p-b7787c11.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2e7ffc5a.entry.js → p-b7c56cbe.entry.js} +1 -1
- package/dist/bromcom-ui/{p-221095a9.entry.js → p-c36a7889.entry.js} +1 -1
- package/dist/bromcom-ui/p-ce0ab4e3.entry.js +5 -0
- package/dist/bromcom-ui/{p-ee75cd00.js → p-d3cf91a9.js} +1 -1
- package/dist/bromcom-ui/{p-bd77f532.entry.js → p-d7a619c5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-baa4193d.entry.js → p-e36b6b08.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6c7fdf95.entry.js → p-f15c1d3d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8001040c.js → p-fc29c94d.js} +1 -1
- package/dist/cjs/bcm-accordion_69.cjs.entry.js +18 -35
- package/dist/cjs/bcm-attendance-actions-comment.cjs.entry.js +4 -4
- package/dist/cjs/bcm-attendance-actions-dropdown.cjs.entry.js +4 -4
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/bcm-caption.cjs.entry.js +4 -4
- package/dist/cjs/bcm-card.cjs.entry.js +2 -2
- package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-default.cjs.entry.js +2 -2
- package/dist/cjs/bcm-form-2.cjs.entry.js +2 -2
- 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 +4 -4
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-number-input.cjs.entry.js +4 -4
- package/dist/cjs/bcm-skeleton.cjs.entry.js +4 -4
- package/dist/cjs/bcm-table.cjs.entry.js +4 -4
- 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 +17 -11
- package/dist/cjs/bromcom-ui.cjs.js +2 -2
- package/dist/cjs/{generate-554f54dc.js → generate-9d1bf6b3.js} +1 -1
- package/dist/cjs/{global-90b5dbce.js → global-d69a64ec.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{number-helper-677e9c02.js → number-helper-ae28b255.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +3 -3
- package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -2
- package/dist/cjs/{package-8445ccd4.js → package-6de220be.js} +1 -1
- package/dist/cjs/{validators-92f2f1ef.js → validators-3381bee2.js} +1 -1
- package/dist/collection/components/molecules/color-input/color-input.js +5 -22
- package/dist/collection/components/molecules/color-palette/color-palette.js +4 -4
- package/dist/collection/components/organism/list/list.js +1 -1
- package/dist/collection/components/other/toast/toast.js +15 -9
- package/dist/collection/templates/list-item-template.js +4 -4
- package/dist/collection/templates/list-template.js +2 -2
- package/dist/components/bcm-color-input.js +5 -22
- package/dist/components/bcm-toast.js +15 -9
- package/dist/components/color-palette.js +2 -2
- package/dist/components/generate.js +1 -1
- package/dist/components/list.js +8 -8
- package/dist/esm/bcm-accordion_69.entry.js +18 -35
- package/dist/esm/bcm-attendance-actions-comment.entry.js +4 -4
- package/dist/esm/bcm-attendance-actions-dropdown.entry.js +4 -4
- package/dist/esm/bcm-breadcrumb.entry.js +2 -2
- package/dist/esm/bcm-caption.entry.js +4 -4
- package/dist/esm/bcm-card.entry.js +2 -2
- package/dist/esm/bcm-date-picker.entry.js +2 -2
- package/dist/esm/bcm-datetime-picker.entry.js +2 -2
- package/dist/esm/bcm-default.entry.js +2 -2
- package/dist/esm/bcm-form-2.entry.js +2 -2
- package/dist/esm/bcm-input-2.entry.js +2 -2
- package/dist/esm/bcm-input-custom.entry.js +2 -2
- package/dist/esm/bcm-input-dropdown.entry.js +4 -4
- package/dist/esm/bcm-modal-2-footer.entry.js +4 -4
- package/dist/esm/bcm-modal-2-header.entry.js +4 -4
- package/dist/esm/bcm-modal-2.entry.js +4 -4
- package/dist/esm/bcm-number-input.entry.js +4 -4
- package/dist/esm/bcm-skeleton.entry.js +4 -4
- package/dist/esm/bcm-table.entry.js +4 -4
- package/dist/esm/bcm-tag.entry.js +3 -3
- package/dist/esm/bcm-time-picker.entry.js +2 -2
- package/dist/esm/bcm-toast.entry.js +17 -11
- package/dist/esm/bromcom-ui.js +2 -2
- package/dist/esm/{generate-8a394b83.js → generate-56d49b70.js} +1 -1
- package/dist/esm/{global-7919f57f.js → global-97c42a5f.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{number-helper-a86adc72.js → number-helper-455ab41e.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +3 -3
- package/dist/esm/old-bcm-popover.entry.js +2 -2
- package/dist/esm/{package-278e08d9.js → package-edee14d5.js} +1 -1
- package/dist/esm/{validators-89e791a1.js → validators-cc882165.js} +1 -1
- package/dist/types/components/molecules/color-input/color-input.d.ts +1 -4
- package/dist/types/components/other/toast/toast.d.ts +1 -0
- package/dist/types/templates/list-item-template.d.ts +2 -0
- package/dist/types/templates/list-template.d.ts +2 -0
- package/package.json +1 -1
- package/dist/bromcom-ui/p-839b6fd5.entry.js +0 -5
- package/dist/bromcom-ui/p-df92d838.js +0 -5
- package/dist/bromcom-ui/p-dfd73f7c.entry.js +0 -5
|
@@ -8,12 +8,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
8
8
|
|
|
9
9
|
const index = require('./index-c591ecec.js');
|
|
10
10
|
const index$1 = require('./index-95ae50d0.js');
|
|
11
|
-
const generate = require('./generate-
|
|
12
|
-
const stringHelper = require('./string-helper-9cdfb273.js');
|
|
11
|
+
const generate = require('./generate-9d1bf6b3.js');
|
|
13
12
|
const bcm = require('./bcm-1d1fcf21.js');
|
|
14
13
|
const utils = require('./utils-fc077139.js');
|
|
15
14
|
require('./_commonjsHelpers-ed84c3ca.js');
|
|
16
|
-
require('./package-
|
|
15
|
+
require('./package-6de220be.js');
|
|
17
16
|
require('./colors-250d0982.js');
|
|
18
17
|
|
|
19
18
|
const BcmToast = class {
|
|
@@ -35,6 +34,13 @@ const BcmToast = class {
|
|
|
35
34
|
this.visible = false;
|
|
36
35
|
this.visibleContainer = false;
|
|
37
36
|
}
|
|
37
|
+
renderMultiline(text) {
|
|
38
|
+
if (!text) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const lines = text.split("\n");
|
|
42
|
+
return lines.map((line, index$1) => [index$1 > 0 && index.h("br", null), line]);
|
|
43
|
+
}
|
|
38
44
|
async show() {
|
|
39
45
|
const toast = document.getElementById(this._id + "-container");
|
|
40
46
|
if (toast) {
|
|
@@ -90,7 +96,7 @@ const BcmToast = class {
|
|
|
90
96
|
return container;
|
|
91
97
|
}
|
|
92
98
|
render() {
|
|
93
|
-
return (index.h(index.Host, { class: "tw-hidden" }, index.h("div", { class: index$1.classnames({ "tw-hidden": !this.visible }), id: this._id + "-container", onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, index.h("div", { class: index$1.classnames("tw-pointer-events-auto tw-transform tw-transition tw-duration-300 tw-ease-in-out", "tw-flex tw-min-w-[256px] tw-max-w-[420px] tw-flex-col tw-gap-2 tw-rounded-lg tw-border tw-font-sans tw-font-normal tw-shadow-2", "tw-border-
|
|
99
|
+
return (index.h(index.Host, { class: "tw-hidden" }, index.h("div", { class: index$1.classnames({ "tw-hidden": !this.visible }), id: this._id + "-container", onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, index.h("div", { class: index$1.classnames("tw-pointer-events-auto tw-transform tw-transition tw-duration-300 tw-ease-in-out", "tw-flex tw-min-w-[256px] tw-max-w-[420px] tw-flex-col tw-gap-2 tw-rounded-lg tw-border tw-font-sans tw-font-normal tw-shadow-2", "tw-border-gray-300 tw-bg-white tw-text-slate-600", {
|
|
94
100
|
"tw-p-4": !this.description,
|
|
95
101
|
"tw-p-6": this.description,
|
|
96
102
|
}, "tw-transform tw-transition tw-duration-300 tw-ease-in-out ", {
|
|
@@ -98,11 +104,11 @@ const BcmToast = class {
|
|
|
98
104
|
"tw-opacity-0": !this.visibleContainer,
|
|
99
105
|
"tw-translate-y-[-100%]": !this.visibleContainer && this.position.split("-")[0] === "top",
|
|
100
106
|
"tw-translate-y-[100%]": !this.visibleContainer && this.position.split("-")[0] === "bottom",
|
|
101
|
-
}) }, index.h("div", { class: "tw-flex tw-items-
|
|
102
|
-
"tw-text-
|
|
103
|
-
"tw-text-
|
|
104
|
-
"tw-text-
|
|
105
|
-
"tw-text-
|
|
107
|
+
}) }, index.h("div", { class: "tw-flex tw-items-start tw-justify-between tw-gap-5" }, index.h("div", { class: "tw-flex tw-items-start tw-gap-3 " }, this.status && (index.h("i", { class: index$1.classnames("tw-text-6 tw-pt-0.5", this.messageIcon ? this.messageIcon : "far", {
|
|
108
|
+
"tw-text-emerald-500": this.status === "success",
|
|
109
|
+
"tw-text-red-500": this.status === "error",
|
|
110
|
+
"tw-text-amber-500": this.status === "warning",
|
|
111
|
+
"tw-text-blue-500": this.status === "info",
|
|
106
112
|
}, {
|
|
107
113
|
"fa-check-circle": !this.messageIcon && this.status === "success",
|
|
108
114
|
"fa-exclamation-circle": !this.messageIcon && this.status === "error",
|
|
@@ -111,9 +117,9 @@ const BcmToast = class {
|
|
|
111
117
|
}) })), index.h("span", { class: index$1.classnames({
|
|
112
118
|
"tw-text-4": !this.description,
|
|
113
119
|
"tw-text-6 tw-font-medium": this.description,
|
|
114
|
-
}) },
|
|
120
|
+
}) }, this.renderMultiline(this.message))), index.h("div", { class: "tw-flex tw-items-baseline tw-gap-2" }, this.viewButton && (index.h("button", { onClick: () => this.bcmToastView.emit(), title: "View details", class: index$1.classnames("tw-cursor-pointer tw-rounded tw-bg-transparent tw-p-0 tw-px-1 tw-text-4 tw-text-inherit", "hover:tw-bg-gray-100 hover:tw-text-slate-800", "active:tw-bg-gray-200", "tw-transition tw-duration-300 tw-ease-in-out", {
|
|
115
121
|
"tw-font-medium": this.description,
|
|
116
|
-
}) }, "View")), this.closeButton && (index.h("button", { title: "Close", onClick: () => this.hide(), class: index$1.classnames("tw-
|
|
122
|
+
}) }, "View")), this.closeButton && (index.h("button", { title: "Close", onClick: () => this.hide(), class: index$1.classnames("tw-rounded tw-bg-transparent tw-p-0", "tw-flex tw-h-6 tw-w-6 tw-cursor-pointer tw-items-center tw-justify-center tw-text-3 tw-text-inherit", "hover:tw-bg-gray-100 hover:tw-text-slate-800", "active:tw-bg-gray-200") }, index.h("i", { class: "fal fa-times" }))))), this.description && index.h("div", { class: "tw-text-3 " }, this.renderMultiline(this.description)), index.h("slot", null)))));
|
|
117
123
|
}
|
|
118
124
|
get el() { return index.getElement(this); }
|
|
119
125
|
};
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
8
|
|
|
9
9
|
const index = require('./index-c591ecec.js');
|
|
10
|
-
require('./global-
|
|
11
|
-
require('./package-
|
|
10
|
+
require('./global-d69a64ec.js');
|
|
11
|
+
require('./package-6de220be.js');
|
|
12
12
|
require('./watermark-2c23c8f1.js');
|
|
13
13
|
|
|
14
14
|
/*
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
8
|
|
|
9
9
|
const index = require('./index-c591ecec.js');
|
|
10
|
-
require('./global-
|
|
11
|
-
require('./package-
|
|
10
|
+
require('./global-d69a64ec.js');
|
|
11
|
+
require('./package-6de220be.js');
|
|
12
12
|
require('./watermark-2c23c8f1.js');
|
|
13
13
|
|
|
14
14
|
/*
|
|
@@ -11,13 +11,13 @@ require('./element-dragger-a8562f82.js');
|
|
|
11
11
|
const popoverPlacement = require('./popover-placement-02e6101b.js');
|
|
12
12
|
const floatingUi = require('./floating-ui-5b396838.js');
|
|
13
13
|
const index$1 = require('./index-95ae50d0.js');
|
|
14
|
-
const generate = require('./generate-
|
|
15
|
-
const numberHelper = require('./number-helper-
|
|
14
|
+
const generate = require('./generate-9d1bf6b3.js');
|
|
15
|
+
const numberHelper = require('./number-helper-ae28b255.js');
|
|
16
16
|
const stringHelper = require('./string-helper-9cdfb273.js');
|
|
17
17
|
require('./utils-fc077139.js');
|
|
18
18
|
require('./bcm-1d1fcf21.js');
|
|
19
19
|
require('./_commonjsHelpers-ed84c3ca.js');
|
|
20
|
-
require('./package-
|
|
20
|
+
require('./package-6de220be.js');
|
|
21
21
|
require('./colors-250d0982.js');
|
|
22
22
|
|
|
23
23
|
const oldPopoverBoxCss = "@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-popover-box{display:none;position:absolute;transition:transform 0.2s ease-in-out;}.bcm-popover-box .bcm-pop-box{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-size:10px;line-height:calc(10px + 8px);box-shadow:0 4px 12px 2px rgba(17, 24, 38, 0.1);border-radius:4px;position:absolute;box-sizing:border-box;background-color:#FFFFFF;border:1px solid #FFFFFF;z-index:-99999;overflow:hidden;visibility:hidden;width:fit-content;position:absolute;display:block;overflow:hidden;visibility:hidden;z-index:-99999;filter:drop-shadow(0px 1px 6px rgba(0, 0, 0, 0.25))}.bcm-popover-box .bcm-pop-box.bcm-pop-open{overflow:unset;visibility:visible;height:unset}.bcm-popover-box .bcm-pop-box .bcm-pop-heading,.bcm-popover-box .bcm-pop-box .bcm-pop-content{display:block}.bcm-popover-box .bcm-pop-box .bcm-pop-heading:not(:empty){padding:4px 16px;border-bottom:1px solid #D9D9D9;color:var(--bcm-color-grey-9)}.bcm-popover-box .bcm-pop-box .bcm-pop-content:not(:empty){padding:8px 16px;color:var(--bcm-color-grey-8)}.bcm-popover-box::after{content:\"\";position:absolute;display:none;border:6px solid;z-index:10900;pointer-events:none}.bcm-popover-box.bcm-pop-open{display:block;z-index:10900}.bcm-popover-box.bcm-pop-open .bcm-pop-box{z-index:10900;overflow:unset;visibility:unset}.bcm-popover-box.bcm-pop-open::after{display:block}.bcm-popover-box.top .bcm-pop-box{bottom:100%;margin-bottom:16px}.bcm-popover-box.top::after{bottom:100%;margin-bottom:4px;border-color:#FFFFFF transparent transparent transparent}.bcm-popover-box.bottom .bcm-pop-box{top:100%;margin-top:16px}.bcm-popover-box.bottom::after{top:100%;margin-top:4px;border-color:transparent transparent #FFFFFF transparent}.bcm-popover-box.left .bcm-pop-box{right:100%;margin-right:16px}.bcm-popover-box.left::after{right:100%;margin-right:4px;border-color:transparent transparent transparent #FFFFFF}.bcm-popover-box.right .bcm-pop-box{left:100%;margin-left:16px}.bcm-popover-box.right::after{left:100%;margin-left:4px;border-color:transparent #FFFFFF transparent transparent}.bcm-popover-box.top.center .bcm-pop-box,.bcm-popover-box.bottom.center .bcm-pop-box{left:50%;transform:translateX(-50%)}.bcm-popover-box.top.center::after,.bcm-popover-box.bottom.center::after{left:50%;transform:translateX(-50%)}.bcm-popover-box.top.start .bcm-pop-box,.bcm-popover-box.bottom.start .bcm-pop-box{left:0}.bcm-popover-box.top.start::after,.bcm-popover-box.bottom.start::after{left:16px}.bcm-popover-box.top.end .bcm-pop-box,.bcm-popover-box.bottom.end .bcm-pop-box{right:0}.bcm-popover-box.top.end::after,.bcm-popover-box.bottom.end::after{right:16px}.bcm-popover-box.left.center .bcm-pop-box,.bcm-popover-box.right.center .bcm-pop-box{top:50%;transform:translateY(-50%)}.bcm-popover-box.left.center::after,.bcm-popover-box.right.center::after{top:50%;transform:translateY(-50%)}.bcm-popover-box.left.start .bcm-pop-box,.bcm-popover-box.right.start .bcm-pop-box{top:0}.bcm-popover-box.left.start::after,.bcm-popover-box.right.start::after{top:12px}.bcm-popover-box.left.end .bcm-pop-box,.bcm-popover-box.right.end .bcm-pop-box{bottom:0}.bcm-popover-box.left.end::after,.bcm-popover-box.right.end::after{bottom:12px}.bcm-popover-box.top{transform:translateY(1px)}.bcm-popover-box.bottom{transform:translateY(-1px)}.bcm-popover-box.left{transform:translateX(1px)}.bcm-popover-box.right{transform:translateX(-1px)}.bcm-popover-box.top.bcm-pop-open,.bcm-popover-box.bottom.bcm-pop-open{transform:translateY(0)}.bcm-popover-box.left.bcm-pop-open,.bcm-popover-box.right.bcm-pop-open{transform:translateX(0)}.bcm-popover-box.bcm-pop-linked.top .bcm-pop-box{margin:0 0 2px 0}.bcm-popover-box.bcm-pop-linked.bottom .bcm-pop-box{margin:2px 0 0 0}.bcm-popover-box.bcm-pop-linked.left .bcm-pop-box{margin:0 2px 0 0}.bcm-popover-box.bcm-pop-linked.right .bcm-pop-box{margin:0 0 0 2px}.bcm-popover-box.bcm-pop-linked .bcm-pop-box{filter:unset;border-radius:8px;box-shadow:0 2px 6px 1px rgba(17, 24, 38, 0.1)}.bcm-popover-box.bcm-pop-linked::after{display:none}";
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
9
9
|
const index = require('./index-c591ecec.js');
|
|
10
10
|
const index$1 = require('./index-95ae50d0.js');
|
|
11
11
|
const bcm = require('./bcm-1d1fcf21.js');
|
|
12
|
-
const generate = require('./generate-
|
|
12
|
+
const generate = require('./generate-9d1bf6b3.js');
|
|
13
13
|
require('./_commonjsHelpers-ed84c3ca.js');
|
|
14
|
-
require('./package-
|
|
14
|
+
require('./package-6de220be.js');
|
|
15
15
|
require('./colors-250d0982.js');
|
|
16
16
|
|
|
17
17
|
const oldPopoverCss = "@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-popover{display:inline-flex}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
5
|
import { Generate } from "@bcm/helpers";
|
|
6
|
-
import { Host,
|
|
6
|
+
import { Host, h } from "@stencil/core";
|
|
7
7
|
export class BcmColorInput {
|
|
8
8
|
constructor() {
|
|
9
9
|
this._id = Generate.UID();
|
|
@@ -18,26 +18,9 @@ export class BcmColorInput {
|
|
|
18
18
|
}
|
|
19
19
|
handleChange(color) {
|
|
20
20
|
this.value = color;
|
|
21
|
-
this.getInputElement().setValue(color);
|
|
22
|
-
forceUpdate(this.el);
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
getPickerElement() {
|
|
28
|
-
return document.querySelector("#" + this._id + "-picker");
|
|
29
|
-
}
|
|
30
|
-
handleInputChanged(e) {
|
|
31
|
-
this.value = e.detail;
|
|
32
|
-
const picker = this.getPickerElement();
|
|
33
|
-
if (picker) {
|
|
34
|
-
if (this.type === "palette") {
|
|
35
|
-
picker.value = e.detail;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
picker.color = e.detail;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
22
|
+
handleInputChanged(value) {
|
|
23
|
+
this.value = value;
|
|
41
24
|
}
|
|
42
25
|
eyeDropper() {
|
|
43
26
|
const eyeDropper = new window.EyeDropper();
|
|
@@ -59,9 +42,9 @@ export class BcmColorInput {
|
|
|
59
42
|
return typeof window !== "undefined" && "EyeDropper" in window;
|
|
60
43
|
}
|
|
61
44
|
render() {
|
|
62
|
-
return (h(Host, { class: "tw-block" }, h("bcm-input", { id: this._id + "-color", fullWidth: this.fullWidth, label: this.label, placeholder: this.placeholder, type: "text", disabled: this.disabled, readonly: this.readonly, "onBcm-change":
|
|
45
|
+
return (h(Host, { class: "tw-block" }, h("bcm-input", { id: this._id + "-color", fullWidth: this.fullWidth, label: this.label, placeholder: this.placeholder, type: "text", disabled: this.disabled, readonly: this.readonly, "onBcm-change": ({ detail }) => this.handleInputChanged(detail), value: this.value }, h("i", { slot: "prefix", class: "tw-flex tw-h-4 tw-w-4 tw-items-center tw-justify-center tw-rounded-full tw-border tw-border-solid tw-border-color-default", style: {
|
|
63
46
|
backgroundColor: this.value,
|
|
64
|
-
} }), this.isEyeDropperSupported() && h("i", { slot: "suffix", class: "far fa-eye-dropper", onClick: () => this.eyeDropper() })), h("bcm-linked", { targetId: this._id + "-color" }, this.type === 'palette' ? (h("bcm-color-palette", { id: this._id + "-picker", value: this.value, "onBcm-change":
|
|
47
|
+
} }), this.isEyeDropperSupported() && h("i", { slot: "suffix", class: "far fa-eye-dropper", onClick: () => this.eyeDropper() })), h("bcm-linked", { targetId: this._id + "-color-container" }, this.type === 'palette' ? (h("bcm-color-palette", { id: this._id + "-picker", value: this.value, "onBcm-change": ({ detail }) => this.handleChange(detail) })) : (h("bcm-colorful", { id: this._id + "-picker", color: this.value, onBcmChange: ({ detail }) => this.handleChange(detail) })))));
|
|
65
48
|
}
|
|
66
49
|
static get is() { return "bcm-color-input"; }
|
|
67
50
|
static get originalStyleUrls() {
|
|
@@ -27,8 +27,8 @@ export class BcmColorPalette {
|
|
|
27
27
|
this.bcmChange.emit(hex);
|
|
28
28
|
};
|
|
29
29
|
this.value = undefined;
|
|
30
|
-
this.paletteKeys = ["orange", "yellow", "lime", "green", "teal", "cyan", "sky", "indigo", "violet", "purple", "fuchsia", "pink"];
|
|
31
|
-
this.shades = [900, 800, 700, 600,
|
|
30
|
+
this.paletteKeys = ["orange", "yellow", "lime", "green", "teal", "cyan", "sky", "indigo", "violet", "purple", "fuchsia", "pink", "rose", "stone", "slate"];
|
|
31
|
+
this.shades = [950, 900, 800, 700, 600, 400, 300, 200, 100, 50];
|
|
32
32
|
}
|
|
33
33
|
render() {
|
|
34
34
|
const { host, column, box } = colorPaletteStyle();
|
|
@@ -73,7 +73,7 @@ export class BcmColorPalette {
|
|
|
73
73
|
"tags": [],
|
|
74
74
|
"text": "List of tailwind color keys to display"
|
|
75
75
|
},
|
|
76
|
-
"defaultValue": "[\"orange\", \"yellow\", \"lime\", \"green\", \"teal\", \"cyan\", \"sky\", \"indigo\", \"violet\", \"purple\", \"fuchsia\", \"pink\"]"
|
|
76
|
+
"defaultValue": "[\"orange\", \"yellow\", \"lime\", \"green\", \"teal\", \"cyan\", \"sky\", \"indigo\", \"violet\", \"purple\", \"fuchsia\", \"pink\", \"rose\", \"stone\", \"slate\"]"
|
|
77
77
|
},
|
|
78
78
|
"shades": {
|
|
79
79
|
"type": "unknown",
|
|
@@ -89,7 +89,7 @@ export class BcmColorPalette {
|
|
|
89
89
|
"tags": [],
|
|
90
90
|
"text": "List of shades to display"
|
|
91
91
|
},
|
|
92
|
-
"defaultValue": "[900, 800, 700, 600,
|
|
92
|
+
"defaultValue": "[950, 900, 800, 700, 600, 400, 300, 200, 100, 50]"
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
}
|
|
@@ -838,7 +838,7 @@ export class BcmList {
|
|
|
838
838
|
"--min-height": openedType ? "inherit" : this.minHeight,
|
|
839
839
|
} }, h("div", { id: `bcm-list-label-${this._id}`, class: "bcm-list__label" }, label && (h("div", null, h("bcm-label", { tooltip: this.tooltip, size: this.size, type: this.captionType, value: label, required: required, htmlFor: this._id })))), this.type == "select" && (h("div", { id: `bcm-list-input-${this._id}`, class: bcmListInput }, h("span", { class: cs("bcm-list__input-container", { "type-single": !checkboxes, "value-empty": !this.value }) }, this.checkboxes ? (this.value && this.value.length > 0 ? (h("bcm-rc-overflow", { data: this.tagData, maxCount: this.tagCount })) : (h("span", { class: "bcm-list__input-placeholder" }, this.placeholder))) : this.value ? (this.inputText) : (h("span", { class: "bcm-list__input-placeholder" }, this.placeholder))), h("span", { class: cs("bcm-list__input-buttons", {
|
|
840
840
|
disabled: disabled,
|
|
841
|
-
}) }, this.clearable && this.value && (h("div", { class: "bcm-list__input-buttons-button" }, h("bcm-icon", { icon: "fal fa-times", onClick: e => !disabled && this.setClear(e) }))), h("div", { class: `bcm-list__input-buttons-button caret-is ${this.isOpen && this.calculatedViewport && "caret-is-open"}` }, h("bcm-icon", { icon: `far fa-angle-down` }))))), this.type === "autocomplete" && (h("div", { id: `bcm-list-input-${this._id}`, class: cs(bcmListInput, { "bcm-list__input-autocomplete": this.type == "autocomplete" }) }, h("span", { class: "bcm-list__input-container", id: `bcm-list-input-tag-container-${this._id}` }, this.checkboxes && h("span", { class: "bcm-list__input-tag-container", id: `bcm-list-input-tag-container-${this._id}-autocomplete` }), h("bcm-search", { id: `bcm-list-input-tag-container-${this._id}-autocomplete-input`, class: "bcm-list__autocomplete", data: this.data, clearable: true, "full-width": true, "no-caption": true, placeholder: this.placeholder })))), h(ListTemplate, { type: this.type, highlight: this.highlightText, searchable: this.type == "autocomplete" ? false : searchable, bcmListContainer: bcmListContainer, checkboxes: checkboxes, treeview: treeview, infoFooter: this.infoFooter, value: this.value, totalData: this.totalData, searchFound: this.searchFound, variableText: this.variableText, searchPlaceholder: this.searchPlaceholder, minSearchLength: this.minSearchLength, searchIsOnlyChilds: this.searchIsOnlyChilds, _id: this._id, tempId: this.tempId, checkAll: this.checkAll, data: this.getItems(), width: this.width, height: this.height, size: this.size, selectAllItem: this.selectAllItem, onScrollEvent: e => this.dataScrollEvent(e), items: this.getLimitedItems(this.searchGetParents), selectedItem: itemId => this.selectedItem(itemId), checkedItem: itemId => this.checkedItem(itemId), openGroup: parentId => this.openGroup(parentId), focusItem: itemId => this.focusItem(itemId), emptyText: this.emptyText, emptyIcon: this.emptyIcon, handleTransitionEnd: e => this.handleTransitionEnd(e) }), h(CaptionTemplate, { noCaption: this.noCaption, captionType: this.captionType, captionError: this.captionError, caption: this.caption })));
|
|
841
|
+
}) }, this.clearable && this.value && (h("div", { class: "bcm-list__input-buttons-button" }, h("bcm-icon", { icon: "fal fa-times", onClick: e => !disabled && this.setClear(e) }))), h("div", { class: `bcm-list__input-buttons-button caret-is ${this.isOpen && this.calculatedViewport && "caret-is-open"}` }, h("bcm-icon", { icon: `far fa-angle-down` }))))), this.type === "autocomplete" && (h("div", { id: `bcm-list-input-${this._id}`, class: cs(bcmListInput, { "bcm-list__input-autocomplete": this.type == "autocomplete" }) }, h("span", { class: "bcm-list__input-container", id: `bcm-list-input-tag-container-${this._id}` }, this.checkboxes && h("span", { class: "bcm-list__input-tag-container", id: `bcm-list-input-tag-container-${this._id}-autocomplete` }), h("bcm-search", { id: `bcm-list-input-tag-container-${this._id}-autocomplete-input`, class: "bcm-list__autocomplete", data: this.data, clearable: true, "full-width": true, "no-caption": true, placeholder: this.placeholder })))), h(ListTemplate, { type: this.type, highlight: this.highlightText, searchable: this.type == "autocomplete" ? false : searchable, bcmListContainer: bcmListContainer, checkboxes: checkboxes, treeview: treeview, infoFooter: this.infoFooter, value: this.value, totalData: this.totalData, searchFound: this.searchFound, variableText: this.variableText, searchPlaceholder: this.searchPlaceholder, minSearchLength: this.minSearchLength, searchIsOnlyChilds: this.searchIsOnlyChilds, _id: this._id, tempId: this.tempId, checkAll: this.checkAll, data: this.getItems(), width: this.width, height: this.height, size: this.size, selectAllItem: this.selectAllItem, onScrollEvent: e => this.dataScrollEvent(e), items: this.getLimitedItems(this.searchGetParents), selectedItem: itemId => this.selectedItem(itemId), checkedItem: itemId => this.checkedItem(itemId), openGroup: parentId => this.openGroup(parentId), focusItem: itemId => this.focusItem(itemId), emptyText: this.emptyText, emptyIcon: this.emptyIcon, handleTransitionEnd: e => this.handleTransitionEnd(e), disabled: disabled, readonly: readonly }), h(CaptionTemplate, { noCaption: this.noCaption, captionType: this.captionType, captionError: this.captionError, caption: this.caption })));
|
|
842
842
|
}
|
|
843
843
|
static get is() { return "bcm-list"; }
|
|
844
844
|
static get originalStyleUrls() {
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import { Host, h } from "@stencil/core";
|
|
6
6
|
import cs from "classnames";
|
|
7
7
|
import { Generate } from "../../../helper/generate";
|
|
8
|
-
import { StringHelper } from "../../../helper/string-helper";
|
|
9
8
|
import Bcm from "../../../models/bcm";
|
|
10
9
|
import { delay } from "../../../utils/utils";
|
|
11
10
|
export class BcmToast {
|
|
@@ -23,6 +22,13 @@ export class BcmToast {
|
|
|
23
22
|
this.visible = false;
|
|
24
23
|
this.visibleContainer = false;
|
|
25
24
|
}
|
|
25
|
+
renderMultiline(text) {
|
|
26
|
+
if (!text) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const lines = text.split("\n");
|
|
30
|
+
return lines.map((line, index) => [index > 0 && h("br", null), line]);
|
|
31
|
+
}
|
|
26
32
|
async show() {
|
|
27
33
|
const toast = document.getElementById(this._id + "-container");
|
|
28
34
|
if (toast) {
|
|
@@ -78,7 +84,7 @@ export class BcmToast {
|
|
|
78
84
|
return container;
|
|
79
85
|
}
|
|
80
86
|
render() {
|
|
81
|
-
return (h(Host, { class: "tw-hidden" }, h("div", { class: cs({ "tw-hidden": !this.visible }), id: this._id + "-container", onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("div", { class: cs("tw-pointer-events-auto tw-transform tw-transition tw-duration-300 tw-ease-in-out", "tw-flex tw-min-w-[256px] tw-max-w-[420px] tw-flex-col tw-gap-2 tw-rounded-lg tw-border tw-font-sans tw-font-normal tw-shadow-2", "tw-border-
|
|
87
|
+
return (h(Host, { class: "tw-hidden" }, h("div", { class: cs({ "tw-hidden": !this.visible }), id: this._id + "-container", onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("div", { class: cs("tw-pointer-events-auto tw-transform tw-transition tw-duration-300 tw-ease-in-out", "tw-flex tw-min-w-[256px] tw-max-w-[420px] tw-flex-col tw-gap-2 tw-rounded-lg tw-border tw-font-sans tw-font-normal tw-shadow-2", "tw-border-gray-300 tw-bg-white tw-text-slate-600", {
|
|
82
88
|
"tw-p-4": !this.description,
|
|
83
89
|
"tw-p-6": this.description,
|
|
84
90
|
}, "tw-transform tw-transition tw-duration-300 tw-ease-in-out ", {
|
|
@@ -86,11 +92,11 @@ export class BcmToast {
|
|
|
86
92
|
"tw-opacity-0": !this.visibleContainer,
|
|
87
93
|
"tw-translate-y-[-100%]": !this.visibleContainer && this.position.split("-")[0] === "top",
|
|
88
94
|
"tw-translate-y-[100%]": !this.visibleContainer && this.position.split("-")[0] === "bottom",
|
|
89
|
-
}) }, h("div", { class: "tw-flex tw-items-
|
|
90
|
-
"tw-text-
|
|
91
|
-
"tw-text-
|
|
92
|
-
"tw-text-
|
|
93
|
-
"tw-text-
|
|
95
|
+
}) }, h("div", { class: "tw-flex tw-items-start tw-justify-between tw-gap-5" }, h("div", { class: "tw-flex tw-items-start tw-gap-3 " }, this.status && (h("i", { class: cs("tw-text-6 tw-pt-0.5", this.messageIcon ? this.messageIcon : "far", {
|
|
96
|
+
"tw-text-emerald-500": this.status === "success",
|
|
97
|
+
"tw-text-red-500": this.status === "error",
|
|
98
|
+
"tw-text-amber-500": this.status === "warning",
|
|
99
|
+
"tw-text-blue-500": this.status === "info",
|
|
94
100
|
}, {
|
|
95
101
|
"fa-check-circle": !this.messageIcon && this.status === "success",
|
|
96
102
|
"fa-exclamation-circle": !this.messageIcon && this.status === "error",
|
|
@@ -99,9 +105,9 @@ export class BcmToast {
|
|
|
99
105
|
}) })), h("span", { class: cs({
|
|
100
106
|
"tw-text-4": !this.description,
|
|
101
107
|
"tw-text-6 tw-font-medium": this.description,
|
|
102
|
-
}) },
|
|
108
|
+
}) }, this.renderMultiline(this.message))), h("div", { class: "tw-flex tw-items-baseline tw-gap-2" }, this.viewButton && (h("button", { onClick: () => this.bcmToastView.emit(), title: "View details", class: cs("tw-cursor-pointer tw-rounded tw-bg-transparent tw-p-0 tw-px-1 tw-text-4 tw-text-inherit", "hover:tw-bg-gray-100 hover:tw-text-slate-800", "active:tw-bg-gray-200", "tw-transition tw-duration-300 tw-ease-in-out", {
|
|
103
109
|
"tw-font-medium": this.description,
|
|
104
|
-
}) }, "View")), this.closeButton && (h("button", { title: "Close", onClick: () => this.hide(), class: cs("tw-
|
|
110
|
+
}) }, "View")), this.closeButton && (h("button", { title: "Close", onClick: () => this.hide(), class: cs("tw-rounded tw-bg-transparent tw-p-0", "tw-flex tw-h-6 tw-w-6 tw-cursor-pointer tw-items-center tw-justify-center tw-text-3 tw-text-inherit", "hover:tw-bg-gray-100 hover:tw-text-slate-800", "active:tw-bg-gray-200") }, h("i", { class: "fal fa-times" }))))), this.description && h("div", { class: "tw-text-3 " }, this.renderMultiline(this.description)), h("slot", null)))));
|
|
105
111
|
}
|
|
106
112
|
static get is() { return "bcm-toast"; }
|
|
107
113
|
static get properties() {
|
|
@@ -6,7 +6,7 @@ import { h } from '@stencil/core';
|
|
|
6
6
|
import cs from 'classnames';
|
|
7
7
|
import { CheckboxTemplate } from './checkbox-template';
|
|
8
8
|
import { StringHelper } from '@bcm/helpers';
|
|
9
|
-
export const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selectedItem, openGroup, checkedItem, focusItem, searchIsOnlyChilds }) => {
|
|
9
|
+
export const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selectedItem, openGroup, checkedItem, focusItem, searchIsOnlyChilds, disabled: parentDisabled, readonly: parentReadonly }) => {
|
|
10
10
|
const isHaveChildren = item.items && item.items.length > 0;
|
|
11
11
|
var text = StringHelper.htmlEntities(item.text);
|
|
12
12
|
let intersection = [];
|
|
@@ -25,8 +25,8 @@ export const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size,
|
|
|
25
25
|
}
|
|
26
26
|
text = item.isHtmlContent ? item.isHtmlContent : item.template && intersection.length > 0 ? StringHelper.templateParser(item.template, Object.assign(Object.assign({}, item.itemObject), { text })) : text;
|
|
27
27
|
const unClickable = !treeview && item.type == "group" && !item.clickable;
|
|
28
|
-
const disabled = item.disabled;
|
|
29
|
-
const readonly = item.readonly;
|
|
28
|
+
const disabled = item.disabled || parentDisabled;
|
|
29
|
+
const readonly = item.readonly || parentReadonly;
|
|
30
30
|
const itemClick = (event) => {
|
|
31
31
|
let path = event.path || event.composedPath();
|
|
32
32
|
if (path.filter(x => x.attributes && x.attributes.getNamedItem("unlinked"))[0]) {
|
|
@@ -49,6 +49,6 @@ export const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size,
|
|
|
49
49
|
'bcm-list__item-' + size, {
|
|
50
50
|
'bcm-list__item--group': !treeview && item.type == 'group',
|
|
51
51
|
'bcm-list__item--readonly': readonly,
|
|
52
|
-
}) }, h("div", { class: cs('bcm-list__item-content', !checkboxes && item.selected && 'selected', { disabled, readonly }) }, treeview && (h("div", { class: "bcm-list__item-content-collapse-icon", onClick: () => collapseClick() }, isHaveChildren && h("bcm-icon", { icon: cs('fas fa-caret-' + (item.isSearching || item.open ? 'down' : 'right')) }))), h("div", { class: cs('bcm-list__item-content-text', { treeview }), onClick: (e) => itemClick(e) }, checkboxes && (treeview || (!treeview && item.type != 'group')) && (h("div", { class: "bcm-list__item-content-text-checkbox" }, h(CheckboxTemplate, { indeterminate: item.indeterminate, checked: item.checked, disabled:
|
|
52
|
+
}) }, h("div", { class: cs('bcm-list__item-content', !checkboxes && item.selected && 'selected', { disabled, readonly }) }, treeview && (h("div", { class: "bcm-list__item-content-collapse-icon", onClick: () => collapseClick() }, isHaveChildren && h("bcm-icon", { icon: cs('fas fa-caret-' + (item.isSearching || item.open ? 'down' : 'right')) }))), h("div", { class: cs('bcm-list__item-content-text', { treeview }), onClick: (e) => itemClick(e) }, checkboxes && (treeview || (!treeview && item.type != 'group')) && (h("div", { class: "bcm-list__item-content-text-checkbox" }, h(CheckboxTemplate, { indeterminate: item.indeterminate, checked: item.checked, disabled: disabled }))), h("span", Object.assign({ class: "bcm-list__item-content-text-inner" }, (item.title && { "title": item.title }), { innerHTML: text })))), (treeview || !treeview && item.type == "group") && isHaveChildren && (h("div", { class: "bcm-list__item-childs" }, (item.isSearching || item.open || (!treeview && item.type == "group")) &&
|
|
53
53
|
item.items.map((item) => (h(ListItemTemplate, { highlight: highlight, item: item, searchIsOnlyChilds: searchIsOnlyChilds, treeview: treeview, checkboxes: checkboxes, size: size, selectedItem: selectedItem, checkedItem: checkedItem, openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId) })))))));
|
|
54
54
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { h } from '@stencil/core';
|
|
6
6
|
import { InfoFooterTemplate } from './info-footer-template';
|
|
7
7
|
import { ListItemTemplate } from './list-item-template';
|
|
8
|
-
export const ListTemplate = ({ type, highlight, selectAllItem, bcmListContainer, treeview, checkboxes, checkAll, infoFooter, value, totalData, searchFound, variableText, _id, tempId, data, width, height, size, searchPlaceholder, minSearchLength, selectedItem, openGroup, checkedItem, onScrollEvent, focusItem, items, searchable, searchIsOnlyChilds, emptyText, emptyIcon, handleTransitionEnd, }) => {
|
|
8
|
+
export const ListTemplate = ({ type, highlight, selectAllItem, bcmListContainer, treeview, checkboxes, checkAll, infoFooter, value, totalData, searchFound, variableText, _id, tempId, data, width, height, size, searchPlaceholder, minSearchLength, selectedItem, openGroup, checkedItem, onScrollEvent, focusItem, items, searchable, searchIsOnlyChilds, emptyText, emptyIcon, handleTransitionEnd, disabled, readonly, }) => {
|
|
9
9
|
const showSelectAll = !(treeview && searchFound > 0) && !(searchFound > 0);
|
|
10
10
|
const setScrollHeight = () => {
|
|
11
11
|
const itemHeight = size === 'small' ? 28 : size === 'medium' ? 36 : 48;
|
|
@@ -13,5 +13,5 @@ export const ListTemplate = ({ type, highlight, selectAllItem, bcmListContainer,
|
|
|
13
13
|
const scrollHeight = itemCount * itemHeight || 0;
|
|
14
14
|
return Object.assign(Object.assign({ 'min-height': `${scrollHeight}px` }, (type === 'select' && { 'overscroll-behavior': 'none' })), { 'height': '100%', 'display': 'flex', 'flex-direction': 'column' });
|
|
15
15
|
};
|
|
16
|
-
return (h("div", { id: `bcm-list-${_id}`, class: bcmListContainer, "temp-id": `bcm-list-${tempId}`, style: { '--height': height, '--width': width }, onTransitionEnd: e => handleTransitionEnd(e) }, data && searchable && (h("section", { class: "bcm-list__container-search" }, h("bcm-search", { size: size, id: `bcm-list-${_id}-search`, data: data, clearable: true, placeholder: searchPlaceholder, "min-search-length": minSearchLength, searchIsOnlyChilds: searchIsOnlyChilds }))), h("main", { onScroll: e => onScrollEvent(e), class: "scrolling", style: Object.assign({}, (type === 'select' && { 'overscroll-behavior': 'none' })) }, h("div", { style: setScrollHeight() }, checkAll && searchFound != 0 && items && items.length > 0 && checkboxes && showSelectAll && (h("section", { class: "bcm-list__container-select-all" }, h(ListItemTemplate, { size: size, item: selectAllItem, treeview: false, checkboxes: true, selectedItem: itemId => selectedItem(itemId), checkedItem: itemId => checkedItem(itemId), openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId) }))), items.map((item) => (h(ListItemTemplate, { highlight: highlight, size: size, item: item, searchIsOnlyChilds: searchIsOnlyChilds, treeview: treeview, checkboxes: checkboxes, selectedItem: itemId => selectedItem(itemId), checkedItem: itemId => checkedItem(itemId), openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId) }))), (!items || items.length === 0) && searchFound != 0 && (h("section", { class: "bcm-list__container-no-data" }, h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon }, h("span", { innerHTML: emptyText || 'No data' })))), searchFound == 0 && (h("section", { class: "bcm-list__container-no-data" }, h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon }, h("span", { innerHTML: emptyText || 'No Data Found' })))))), infoFooter && data && data.length > 0 && (h(InfoFooterTemplate, { selected: value === null || value === void 0 ? void 0 : value.length, total: totalData, found: searchFound, multiple: checkboxes, variableText: variableText }))));
|
|
16
|
+
return (h("div", { id: `bcm-list-${_id}`, class: bcmListContainer, "temp-id": `bcm-list-${tempId}`, style: { '--height': height, '--width': width }, onTransitionEnd: e => handleTransitionEnd(e) }, data && searchable && (h("section", { class: "bcm-list__container-search" }, h("bcm-search", { size: size, id: `bcm-list-${_id}-search`, data: data, clearable: true, placeholder: searchPlaceholder, "min-search-length": minSearchLength, searchIsOnlyChilds: searchIsOnlyChilds }))), h("main", { onScroll: e => onScrollEvent(e), class: "scrolling", style: Object.assign({}, (type === 'select' && { 'overscroll-behavior': 'none' })) }, h("div", { style: setScrollHeight() }, checkAll && searchFound != 0 && items && items.length > 0 && checkboxes && showSelectAll && (h("section", { class: "bcm-list__container-select-all" }, h(ListItemTemplate, { size: size, item: selectAllItem, treeview: false, checkboxes: true, selectedItem: itemId => selectedItem(itemId), checkedItem: itemId => checkedItem(itemId), openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId), disabled: disabled, readonly: readonly }))), items.map((item) => (h(ListItemTemplate, { highlight: highlight, size: size, item: item, searchIsOnlyChilds: searchIsOnlyChilds, treeview: treeview, checkboxes: checkboxes, selectedItem: itemId => selectedItem(itemId), checkedItem: itemId => checkedItem(itemId), openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId), disabled: disabled, readonly: readonly }))), (!items || items.length === 0) && searchFound != 0 && (h("section", { class: "bcm-list__container-no-data" }, h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon }, h("span", { innerHTML: emptyText || 'No data' })))), searchFound == 0 && (h("section", { class: "bcm-list__container-no-data" }, h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon }, h("span", { innerHTML: emptyText || 'No Data Found' })))))), infoFooter && data && data.length > 0 && (h(InfoFooterTemplate, { selected: value === null || value === void 0 ? void 0 : value.length, total: totalData, found: searchFound, multiple: checkboxes, variableText: variableText }))));
|
|
17
17
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import { proxyCustomElement, HTMLElement,
|
|
5
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
6
6
|
import './color-helper.js';
|
|
7
7
|
import './validators.js';
|
|
8
8
|
import { G as Generate } from './generate.js';
|
|
@@ -36,26 +36,9 @@ const BcmColorInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
36
36
|
}
|
|
37
37
|
handleChange(color) {
|
|
38
38
|
this.value = color;
|
|
39
|
-
this.getInputElement().setValue(color);
|
|
40
|
-
forceUpdate(this.el);
|
|
41
39
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
getPickerElement() {
|
|
46
|
-
return document.querySelector("#" + this._id + "-picker");
|
|
47
|
-
}
|
|
48
|
-
handleInputChanged(e) {
|
|
49
|
-
this.value = e.detail;
|
|
50
|
-
const picker = this.getPickerElement();
|
|
51
|
-
if (picker) {
|
|
52
|
-
if (this.type === "palette") {
|
|
53
|
-
picker.value = e.detail;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
picker.color = e.detail;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
40
|
+
handleInputChanged(value) {
|
|
41
|
+
this.value = value;
|
|
59
42
|
}
|
|
60
43
|
eyeDropper() {
|
|
61
44
|
const eyeDropper = new window.EyeDropper();
|
|
@@ -77,9 +60,9 @@ const BcmColorInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
77
60
|
return typeof window !== "undefined" && "EyeDropper" in window;
|
|
78
61
|
}
|
|
79
62
|
render() {
|
|
80
|
-
return (h(Host, { class: "tw-block" }, h("bcm-input", { id: this._id + "-color", fullWidth: this.fullWidth, label: this.label, placeholder: this.placeholder, type: "text", disabled: this.disabled, readonly: this.readonly, "onBcm-change":
|
|
63
|
+
return (h(Host, { class: "tw-block" }, h("bcm-input", { id: this._id + "-color", fullWidth: this.fullWidth, label: this.label, placeholder: this.placeholder, type: "text", disabled: this.disabled, readonly: this.readonly, "onBcm-change": ({ detail }) => this.handleInputChanged(detail), value: this.value }, h("i", { slot: "prefix", class: "tw-flex tw-h-4 tw-w-4 tw-items-center tw-justify-center tw-rounded-full tw-border tw-border-solid tw-border-color-default", style: {
|
|
81
64
|
backgroundColor: this.value,
|
|
82
|
-
} }), this.isEyeDropperSupported() && h("i", { slot: "suffix", class: "far fa-eye-dropper", onClick: () => this.eyeDropper() })), h("bcm-linked", { targetId: this._id + "-color" }, this.type === 'palette' ? (h("bcm-color-palette", { id: this._id + "-picker", value: this.value, "onBcm-change":
|
|
65
|
+
} }), this.isEyeDropperSupported() && h("i", { slot: "suffix", class: "far fa-eye-dropper", onClick: () => this.eyeDropper() })), h("bcm-linked", { targetId: this._id + "-color-container" }, this.type === 'palette' ? (h("bcm-color-palette", { id: this._id + "-picker", value: this.value, "onBcm-change": ({ detail }) => this.handleChange(detail) })) : (h("bcm-colorful", { id: this._id + "-picker", color: this.value, onBcmChange: ({ detail }) => this.handleChange(detail) })))));
|
|
83
66
|
}
|
|
84
67
|
get el() { return this; }
|
|
85
68
|
static get style() { return colorInputCss; }
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
6
6
|
import { c as classnames } from './index2.js';
|
|
7
7
|
import { G as Generate } from './generate.js';
|
|
8
|
-
import { S as StringHelper } from './string-helper.js';
|
|
9
8
|
import { a as Bcm } from './bcm.js';
|
|
10
9
|
import { d as delay } from './utils.js';
|
|
11
10
|
|
|
@@ -29,6 +28,13 @@ const BcmToast$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
29
28
|
this.visible = false;
|
|
30
29
|
this.visibleContainer = false;
|
|
31
30
|
}
|
|
31
|
+
renderMultiline(text) {
|
|
32
|
+
if (!text) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const lines = text.split("\n");
|
|
36
|
+
return lines.map((line, index) => [index > 0 && h("br", null), line]);
|
|
37
|
+
}
|
|
32
38
|
async show() {
|
|
33
39
|
const toast = document.getElementById(this._id + "-container");
|
|
34
40
|
if (toast) {
|
|
@@ -84,7 +90,7 @@ const BcmToast$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
84
90
|
return container;
|
|
85
91
|
}
|
|
86
92
|
render() {
|
|
87
|
-
return (h(Host, { class: "tw-hidden" }, h("div", { class: classnames({ "tw-hidden": !this.visible }), id: this._id + "-container", onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("div", { class: classnames("tw-pointer-events-auto tw-transform tw-transition tw-duration-300 tw-ease-in-out", "tw-flex tw-min-w-[256px] tw-max-w-[420px] tw-flex-col tw-gap-2 tw-rounded-lg tw-border tw-font-sans tw-font-normal tw-shadow-2", "tw-border-
|
|
93
|
+
return (h(Host, { class: "tw-hidden" }, h("div", { class: classnames({ "tw-hidden": !this.visible }), id: this._id + "-container", onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("div", { class: classnames("tw-pointer-events-auto tw-transform tw-transition tw-duration-300 tw-ease-in-out", "tw-flex tw-min-w-[256px] tw-max-w-[420px] tw-flex-col tw-gap-2 tw-rounded-lg tw-border tw-font-sans tw-font-normal tw-shadow-2", "tw-border-gray-300 tw-bg-white tw-text-slate-600", {
|
|
88
94
|
"tw-p-4": !this.description,
|
|
89
95
|
"tw-p-6": this.description,
|
|
90
96
|
}, "tw-transform tw-transition tw-duration-300 tw-ease-in-out ", {
|
|
@@ -92,11 +98,11 @@ const BcmToast$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
92
98
|
"tw-opacity-0": !this.visibleContainer,
|
|
93
99
|
"tw-translate-y-[-100%]": !this.visibleContainer && this.position.split("-")[0] === "top",
|
|
94
100
|
"tw-translate-y-[100%]": !this.visibleContainer && this.position.split("-")[0] === "bottom",
|
|
95
|
-
}) }, h("div", { class: "tw-flex tw-items-
|
|
96
|
-
"tw-text-
|
|
97
|
-
"tw-text-
|
|
98
|
-
"tw-text-
|
|
99
|
-
"tw-text-
|
|
101
|
+
}) }, h("div", { class: "tw-flex tw-items-start tw-justify-between tw-gap-5" }, h("div", { class: "tw-flex tw-items-start tw-gap-3 " }, this.status && (h("i", { class: classnames("tw-text-6 tw-pt-0.5", this.messageIcon ? this.messageIcon : "far", {
|
|
102
|
+
"tw-text-emerald-500": this.status === "success",
|
|
103
|
+
"tw-text-red-500": this.status === "error",
|
|
104
|
+
"tw-text-amber-500": this.status === "warning",
|
|
105
|
+
"tw-text-blue-500": this.status === "info",
|
|
100
106
|
}, {
|
|
101
107
|
"fa-check-circle": !this.messageIcon && this.status === "success",
|
|
102
108
|
"fa-exclamation-circle": !this.messageIcon && this.status === "error",
|
|
@@ -105,9 +111,9 @@ const BcmToast$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
105
111
|
}) })), h("span", { class: classnames({
|
|
106
112
|
"tw-text-4": !this.description,
|
|
107
113
|
"tw-text-6 tw-font-medium": this.description,
|
|
108
|
-
}) },
|
|
114
|
+
}) }, this.renderMultiline(this.message))), h("div", { class: "tw-flex tw-items-baseline tw-gap-2" }, this.viewButton && (h("button", { onClick: () => this.bcmToastView.emit(), title: "View details", class: classnames("tw-cursor-pointer tw-rounded tw-bg-transparent tw-p-0 tw-px-1 tw-text-4 tw-text-inherit", "hover:tw-bg-gray-100 hover:tw-text-slate-800", "active:tw-bg-gray-200", "tw-transition tw-duration-300 tw-ease-in-out", {
|
|
109
115
|
"tw-font-medium": this.description,
|
|
110
|
-
}) }, "View")), this.closeButton && (h("button", { title: "Close", onClick: () => this.hide(), class: classnames("tw-
|
|
116
|
+
}) }, "View")), this.closeButton && (h("button", { title: "Close", onClick: () => this.hide(), class: classnames("tw-rounded tw-bg-transparent tw-p-0", "tw-flex tw-h-6 tw-w-6 tw-cursor-pointer tw-items-center tw-justify-center tw-text-3 tw-text-inherit", "hover:tw-bg-gray-100 hover:tw-text-slate-800", "active:tw-bg-gray-200") }, h("i", { class: "fal fa-times" }))))), this.description && h("div", { class: "tw-text-3 " }, this.renderMultiline(this.description)), h("slot", null)))));
|
|
111
117
|
}
|
|
112
118
|
get el() { return this; }
|
|
113
119
|
}, [4, "bcm-toast", {
|
|
@@ -37,8 +37,8 @@ const BcmColorPalette = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
37
37
|
this.bcmChange.emit(hex);
|
|
38
38
|
};
|
|
39
39
|
this.value = undefined;
|
|
40
|
-
this.paletteKeys = ["orange", "yellow", "lime", "green", "teal", "cyan", "sky", "indigo", "violet", "purple", "fuchsia", "pink"];
|
|
41
|
-
this.shades = [900, 800, 700, 600,
|
|
40
|
+
this.paletteKeys = ["orange", "yellow", "lime", "green", "teal", "cyan", "sky", "indigo", "violet", "purple", "fuchsia", "pink", "rose", "stone", "slate"];
|
|
41
|
+
this.shades = [950, 900, 800, 700, 600, 400, 300, 200, 100, 50];
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
44
|
const { host, column, box } = colorPaletteStyle();
|