bromcom-ui 3.0.0-alpha.2 → 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-c47463b1.entry.js → p-0b7de283.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a141b2bc.entry.js → p-0e75f6ba.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9d41ff2a.entry.js → p-112b9a62.entry.js} +1 -1
- package/dist/bromcom-ui/p-1535f9b1.js +5 -0
- package/dist/bromcom-ui/{p-2a0b6273.entry.js → p-32ce6cf6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-46628fcd.entry.js → p-33b2ed75.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7416d1f6.entry.js → p-4545a13d.entry.js} +1 -1
- package/dist/bromcom-ui/p-45b811ef.entry.js +5 -0
- package/dist/bromcom-ui/{p-369948e7.entry.js → p-5532696c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8363990a.entry.js → p-69adb859.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d4e4aeee.js → p-6ce02d0a.js} +1 -1
- package/dist/bromcom-ui/p-7c08789d.entry.js +5 -0
- package/dist/bromcom-ui/{p-22e3161d.entry.js → p-803739bc.entry.js} +1 -1
- package/dist/bromcom-ui/{p-14b04371.entry.js → p-8390dd02.entry.js} +1 -1
- package/dist/bromcom-ui/{p-217934a4.entry.js → p-8e7274e4.entry.js} +1 -1
- package/dist/bromcom-ui/p-91197b04.js +5 -0
- package/dist/bromcom-ui/{p-cbeaa059.entry.js → p-9e0dd503.entry.js} +3 -3
- package/dist/bromcom-ui/p-a320cde8.entry.js +5 -0
- package/dist/bromcom-ui/p-a80e6310.entry.js +5 -0
- package/dist/bromcom-ui/{p-b85227c8.entry.js → p-acab07ec.entry.js} +1 -1
- package/dist/bromcom-ui/{p-51ba3626.entry.js → p-b333a3d7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a080c8ea.entry.js → p-b7787c11.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6f224017.entry.js → p-b7c56cbe.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e7c31126.entry.js → p-c36a7889.entry.js} +1 -1
- package/dist/bromcom-ui/p-ce0ab4e3.entry.js +5 -0
- package/dist/bromcom-ui/{p-367bc8e0.js → p-d3cf91a9.js} +1 -1
- package/dist/bromcom-ui/{p-5bf051b9.entry.js → p-d7a619c5.entry.js} +1 -1
- package/dist/bromcom-ui/p-ddd9e192.entry.js +5 -0
- package/dist/bromcom-ui/{p-9015080d.entry.js → p-e36b6b08.entry.js} +1 -1
- package/dist/bromcom-ui/{p-acfceb2b.entry.js → p-f15c1d3d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-858cee66.js → p-fc29c94d.js} +1 -1
- package/dist/cjs/{bcm-accordion_68.cjs.entry.js → bcm-accordion_69.cjs.entry.js} +120 -43
- 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-segment.cjs.entry.js +51 -0
- package/dist/cjs/bcm-segmented-picker.cjs.entry.js +158 -0
- 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 +3 -3
- package/dist/cjs/{generate-a25d8fc8.js → generate-9d1bf6b3.js} +1 -1
- package/dist/cjs/{global-08c079a8.js → global-d69a64ec.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{number-helper-3a56812f.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-6afe17f3.js → package-6de220be.js} +1 -1
- package/dist/cjs/{validators-78797513.js → validators-3381bee2.js} +1 -1
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/molecules/color-input/color-input.css +127 -0
- package/dist/collection/components/molecules/color-input/color-input.js +34 -13
- package/dist/collection/components/molecules/color-palette/color-palette.js +114 -0
- package/dist/collection/components/molecules/color-palette/color-palette.style.js +25 -0
- package/dist/collection/components/organism/list/list.js +74 -20
- package/dist/collection/components/other/segmented-picker/segment.component.js +200 -0
- package/dist/collection/components/other/segmented-picker/segment.css +28 -0
- package/dist/collection/components/other/segmented-picker/segmented-picker.component.js +365 -0
- package/dist/collection/components/other/segmented-picker/segmented-picker.css +16 -0
- package/dist/collection/components/other/segmented-picker/types.js +1 -0
- 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 +18 -15
- package/dist/components/bcm-color-palette.d.ts +11 -0
- package/dist/components/bcm-color-palette.js +10 -0
- package/dist/components/bcm-segment.d.ts +11 -0
- package/dist/components/bcm-segment.js +71 -0
- package/dist/components/bcm-segmented-picker.d.ts +11 -0
- package/dist/components/bcm-segmented-picker.js +182 -0
- package/dist/components/bcm-toast.js +15 -9
- package/dist/components/color-palette.js +71 -0
- package/dist/components/generate.js +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/components/list.js +64 -27
- package/dist/esm/{bcm-accordion_68.entry.js → bcm-accordion_69.entry.js} +120 -44
- 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-segment.entry.js +47 -0
- package/dist/esm/bcm-segmented-picker.entry.js +154 -0
- 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 +3 -3
- package/dist/esm/{generate-a4b85775.js → generate-56d49b70.js} +1 -1
- package/dist/esm/{global-1baa11cd.js → global-97c42a5f.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{number-helper-872d5482.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-1d6f13ed.js → package-edee14d5.js} +1 -1
- package/dist/esm/{validators-e9800e9a.js → validators-cc882165.js} +1 -1
- package/dist/types/components/molecules/color-input/color-input.d.ts +5 -4
- package/dist/types/components/molecules/color-palette/color-palette.d.ts +36 -0
- package/dist/types/components/molecules/color-palette/color-palette.style.d.ts +76 -0
- package/dist/types/components/organism/list/list.d.ts +4 -0
- package/dist/types/components/other/segmented-picker/segment.component.d.ts +42 -0
- package/dist/types/components/other/segmented-picker/segmented-picker.component.d.ts +86 -0
- package/dist/types/components/other/segmented-picker/types.d.ts +1 -0
- package/dist/types/components/other/toast/toast.d.ts +1 -0
- package/dist/types/components.d.ts +281 -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-485ed6c1.entry.js +0 -5
- package/dist/bromcom-ui/p-5c4939a7.js +0 -5
- package/dist/bromcom-ui/p-8457670e.entry.js +0 -5
- package/dist/bromcom-ui/p-dcd69786.entry.js +0 -5
- package/dist/bromcom-ui/p-e9a43560.js +0 -5
- package/dist/bromcom-ui/p-ea24a822.entry.js +0 -5
package/dist/components/list.js
CHANGED
|
@@ -61,7 +61,7 @@ const InfoFooterTemplate = ({ selected, total, found, multiple, variableText })
|
|
|
61
61
|
` ${variableText} found. `)));
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selectedItem, openGroup, checkedItem, focusItem, searchIsOnlyChilds }) => {
|
|
64
|
+
const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selectedItem, openGroup, checkedItem, focusItem, searchIsOnlyChilds, disabled: parentDisabled, readonly: parentReadonly }) => {
|
|
65
65
|
const isHaveChildren = item.items && item.items.length > 0;
|
|
66
66
|
var text = StringHelper.htmlEntities(item.text);
|
|
67
67
|
let intersection = [];
|
|
@@ -80,8 +80,8 @@ const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selecte
|
|
|
80
80
|
}
|
|
81
81
|
text = item.isHtmlContent ? item.isHtmlContent : item.template && intersection.length > 0 ? StringHelper.templateParser(item.template, Object.assign(Object.assign({}, item.itemObject), { text })) : text;
|
|
82
82
|
const unClickable = !treeview && item.type == "group" && !item.clickable;
|
|
83
|
-
const disabled = item.disabled;
|
|
84
|
-
const readonly = item.readonly;
|
|
83
|
+
const disabled = item.disabled || parentDisabled;
|
|
84
|
+
const readonly = item.readonly || parentReadonly;
|
|
85
85
|
const itemClick = (event) => {
|
|
86
86
|
let path = event.path || event.composedPath();
|
|
87
87
|
if (path.filter(x => x.attributes && x.attributes.getNamedItem("unlinked"))[0]) {
|
|
@@ -109,13 +109,13 @@ const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selecte
|
|
|
109
109
|
treeview && (h("div", { class: "bcm-list__item-content-collapse-icon", onClick: () => collapseClick() }, isHaveChildren && h("bcm-icon", { icon: classnames('fas fa-caret-' + (item.isSearching || item.open ? 'down' : 'right')) }))),
|
|
110
110
|
h("div", { class: classnames('bcm-list__item-content-text', { treeview }), onClick: (e) => itemClick(e) },
|
|
111
111
|
checkboxes && (treeview || (!treeview && item.type != 'group')) && (h("div", { class: "bcm-list__item-content-text-checkbox" },
|
|
112
|
-
h(CheckboxTemplate, { indeterminate: item.indeterminate, checked: item.checked, disabled:
|
|
112
|
+
h(CheckboxTemplate, { indeterminate: item.indeterminate, checked: item.checked, disabled: disabled }))),
|
|
113
113
|
h("span", Object.assign({ class: "bcm-list__item-content-text-inner" }, (item.title && { "title": item.title }), { innerHTML: text })))),
|
|
114
114
|
(treeview || !treeview && item.type == "group") && isHaveChildren && (h("div", { class: "bcm-list__item-childs" }, (item.isSearching || item.open || (!treeview && item.type == "group")) &&
|
|
115
115
|
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) })))))));
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
-
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, }) => {
|
|
118
|
+
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, }) => {
|
|
119
119
|
const showSelectAll = !(treeview && searchFound > 0) && !(searchFound > 0);
|
|
120
120
|
const setScrollHeight = () => {
|
|
121
121
|
const itemHeight = size === 'small' ? 28 : size === 'medium' ? 36 : 48;
|
|
@@ -129,8 +129,8 @@ const ListTemplate = ({ type, highlight, selectAllItem, bcmListContainer, treevi
|
|
|
129
129
|
h("main", { onScroll: e => onScrollEvent(e), class: "scrolling", style: Object.assign({}, (type === 'select' && { 'overscroll-behavior': 'none' })) },
|
|
130
130
|
h("div", { style: setScrollHeight() },
|
|
131
131
|
checkAll && searchFound != 0 && items && items.length > 0 && checkboxes && showSelectAll && (h("section", { class: "bcm-list__container-select-all" },
|
|
132
|
-
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) }))),
|
|
133
|
-
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) }))),
|
|
132
|
+
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 }))),
|
|
133
|
+
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 }))),
|
|
134
134
|
(!items || items.length === 0) && searchFound != 0 && (h("section", { class: "bcm-list__container-no-data" },
|
|
135
135
|
h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon },
|
|
136
136
|
h("span", { innerHTML: emptyText || 'No data' })))),
|
|
@@ -949,6 +949,7 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
949
949
|
this.shouldTriggerChange = undefined;
|
|
950
950
|
this.placement = Bcm$1.Placement["bottom-start"];
|
|
951
951
|
this.disableChangeEvent = false;
|
|
952
|
+
this.autoFocusSelected = false;
|
|
952
953
|
this.data = [];
|
|
953
954
|
window.addEventListener("scroll", this.handleWheel.bind(this), true);
|
|
954
955
|
window.addEventListener("wheel", this.handleWheel.bind(this), true);
|
|
@@ -1061,6 +1062,7 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1061
1062
|
}
|
|
1062
1063
|
}
|
|
1063
1064
|
async handleOpen() {
|
|
1065
|
+
const isAutoSelected = this.autoFocusSelected && this.type == "select" && !this.checkboxes && this.value;
|
|
1064
1066
|
if (this.isOpen) {
|
|
1065
1067
|
this.detectClone();
|
|
1066
1068
|
if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
|
|
@@ -1075,10 +1077,15 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1075
1077
|
this.onSelectSearch();
|
|
1076
1078
|
await delay(50);
|
|
1077
1079
|
this.isOpenAnimation = true;
|
|
1080
|
+
if (isAutoSelected) {
|
|
1081
|
+
this.focusSelectedElement();
|
|
1082
|
+
}
|
|
1078
1083
|
}
|
|
1079
1084
|
else {
|
|
1085
|
+
if (!isAutoSelected) {
|
|
1086
|
+
this.listScrollToTop();
|
|
1087
|
+
}
|
|
1080
1088
|
this.isOpenAnimation = false;
|
|
1081
|
-
this.listScrollToTop();
|
|
1082
1089
|
this.close.emit();
|
|
1083
1090
|
this.listClose.emit();
|
|
1084
1091
|
await delay(100);
|
|
@@ -1431,22 +1438,33 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1431
1438
|
this.markForCheck();
|
|
1432
1439
|
}
|
|
1433
1440
|
async initState() {
|
|
1434
|
-
var _a, _b, _c;
|
|
1441
|
+
var _a, _b, _c, _d, _e;
|
|
1435
1442
|
this.onClearSearch();
|
|
1436
1443
|
await listState.setValue({
|
|
1437
1444
|
id: this._id,
|
|
1438
1445
|
dataSource: this.data && snq(() => (typeof this.data == "string" ? JSON.parse(this.data) : this.data), []),
|
|
1439
1446
|
options: this,
|
|
1440
1447
|
});
|
|
1441
|
-
const { totalRoots, totalItems } = listState.getValue(this._id);
|
|
1448
|
+
const { totalRoots, totalItems, dataSource } = listState.getValue(this._id);
|
|
1442
1449
|
this.totalData = (totalItems === null || totalItems === void 0 ? void 0 : totalItems.total) || 0;
|
|
1443
1450
|
this.totalRootData = totalRoots || 0;
|
|
1444
1451
|
this.value = this.checkboxes ? (await this.getCheckedList()).checkedList : listState.selectedItem(this._id) ? listState.selectedItem(this._id)[0] : null;
|
|
1452
|
+
/** @description Focus selected element * BUG 282262 */
|
|
1453
|
+
if (this.autoFocusSelected && this.type == "select" && this.value && !this.checkboxes) {
|
|
1454
|
+
const selectedId = Array.isArray(this.value) ? (_a = this.value[0]) === null || _a === void 0 ? void 0 : _a.id : (_b = this.value) === null || _b === void 0 ? void 0 : _b.id;
|
|
1455
|
+
if (selectedId && dataSource) {
|
|
1456
|
+
const selectedIndex = dataSource.findIndex(item => item.id === selectedId);
|
|
1457
|
+
if (selectedIndex !== -1 && selectedIndex >= this.limit) {
|
|
1458
|
+
this.limit = selectedIndex + 5;
|
|
1459
|
+
this.searchResultLimit = this.limit;
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1445
1463
|
if (!this.checkboxes) {
|
|
1446
|
-
this.inputText = Generate.domParser((
|
|
1464
|
+
this.inputText = Generate.domParser((_c = this.value) === null || _c === void 0 ? void 0 : _c.text) || null;
|
|
1447
1465
|
}
|
|
1448
1466
|
// checkli olan subparentların indeterminate kontrolü için
|
|
1449
|
-
if (this.checkboxes && ((
|
|
1467
|
+
if (this.checkboxes && ((_d = this.value) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
1450
1468
|
const checkedIDs = [];
|
|
1451
1469
|
this.value.forEach(item => {
|
|
1452
1470
|
if (!item.items || item.items.length === 0) {
|
|
@@ -1455,7 +1473,7 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1455
1473
|
});
|
|
1456
1474
|
await this.addChecked(checkedIDs, false, false);
|
|
1457
1475
|
}
|
|
1458
|
-
await this.handleIndeterminate((
|
|
1476
|
+
await this.handleIndeterminate((_e = this.value) === null || _e === void 0 ? void 0 : _e.length, this.totalData);
|
|
1459
1477
|
await this.markForCheck();
|
|
1460
1478
|
}
|
|
1461
1479
|
async markForCheck() {
|
|
@@ -1538,20 +1556,16 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1538
1556
|
getAutoCompleteInput() {
|
|
1539
1557
|
return document.getElementById(`bcm-list-input-tag-container-${this._id}-autocomplete-input`);
|
|
1540
1558
|
}
|
|
1559
|
+
/** @description Fixes the issue where the list appears empty during fast scrolling. */
|
|
1541
1560
|
dataScrollEvent(event) {
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
io = null;
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
}, this.options);
|
|
1554
|
-
io.observe(event.target.lastElementChild);
|
|
1561
|
+
var _a, _b;
|
|
1562
|
+
const itemHeight = this.size === 'small' ? 28 : this.size === 'large' ? 48 : 36;
|
|
1563
|
+
const currentScrollBottom = ((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.scrollTop) + ((_b = event === null || event === void 0 ? void 0 : event.target) === null || _b === void 0 ? void 0 : _b.clientHeight);
|
|
1564
|
+
const requiredItems = Math.ceil(currentScrollBottom / itemHeight) + 20;
|
|
1565
|
+
if (requiredItems > this.limit) {
|
|
1566
|
+
this.limit = requiredItems;
|
|
1567
|
+
this.searchResultLimit = requiredItems;
|
|
1568
|
+
}
|
|
1555
1569
|
}
|
|
1556
1570
|
async calculateLocation() {
|
|
1557
1571
|
var _a, _b;
|
|
@@ -1621,6 +1635,28 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1621
1635
|
this.listOpen.emit();
|
|
1622
1636
|
}
|
|
1623
1637
|
}
|
|
1638
|
+
/** @description Focus selected element * BUG 282262 */
|
|
1639
|
+
focusSelectedElement() {
|
|
1640
|
+
var _a;
|
|
1641
|
+
const listElement = document.querySelector(`#bcm-list-${this._id}`);
|
|
1642
|
+
if (!listElement)
|
|
1643
|
+
return;
|
|
1644
|
+
const selectedId = (_a = this.value) === null || _a === void 0 ? void 0 : _a.id;
|
|
1645
|
+
if (selectedId) {
|
|
1646
|
+
const targetItem = listElement.querySelector(`[id*="${selectedId}"]`);
|
|
1647
|
+
if (targetItem) {
|
|
1648
|
+
targetItem.scrollIntoView({
|
|
1649
|
+
block: 'center',
|
|
1650
|
+
inline: 'nearest',
|
|
1651
|
+
behavior: 'auto'
|
|
1652
|
+
});
|
|
1653
|
+
targetItem.focus();
|
|
1654
|
+
const items = listElement.querySelectorAll(".bcm-list__item");
|
|
1655
|
+
items.forEach(i => i.classList.remove("focused"));
|
|
1656
|
+
targetItem.classList.add("focused");
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1624
1660
|
render() {
|
|
1625
1661
|
const { checkboxes, treeview, label, size, disabled, readonly, required, hidden, fullWidth, searchable } = this.getOptions();
|
|
1626
1662
|
const hostClasses = classnames("bcm-list", `bcm-list__size-${size}`, `bcm-list__${this.type}`, size === "large" ? "size-3" : "size-2", {
|
|
@@ -1649,7 +1685,7 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1649
1685
|
"--min-height": openedType ? "inherit" : this.minHeight,
|
|
1650
1686
|
} }, 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: classnames("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: classnames("bcm-list__input-buttons", {
|
|
1651
1687
|
disabled: disabled,
|
|
1652
|
-
}) }, 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: classnames(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 })));
|
|
1688
|
+
}) }, 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: classnames(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 })));
|
|
1653
1689
|
}
|
|
1654
1690
|
get el() { return this; }
|
|
1655
1691
|
static get watchers() { return {
|
|
@@ -1705,6 +1741,7 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1705
1741
|
"emptyIcon": [1, "empty-icon"],
|
|
1706
1742
|
"placement": [1025],
|
|
1707
1743
|
"disableChangeEvent": [4, "disable-change-event"],
|
|
1744
|
+
"autoFocusSelected": [4, "auto-focus-selected"],
|
|
1708
1745
|
"data": [1032],
|
|
1709
1746
|
"inputText": [32],
|
|
1710
1747
|
"isOpen": [32],
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
5
|
import { r as registerInstance, h as h$2, H as Host, g as getElement, c as createEvent, a as getRenderingRef, f as forceUpdate, d as getAssetPath } from './index-4614b7f0.js';
|
|
6
|
-
import { G as Generate, S as StatusProps, T as TypeProps, s as snq } from './generate-
|
|
6
|
+
import { G as Generate, S as StatusProps, T as TypeProps, s as snq } from './generate-56d49b70.js';
|
|
7
7
|
import { c as classnames } from './index-00c8a8f7.js';
|
|
8
8
|
import { S as StringHelper } from './string-helper-69203215.js';
|
|
9
9
|
import { C as ColorHelper } from './color-helper-ba15b0d8.js';
|
|
10
10
|
import './datetime-helper-df25808a.js';
|
|
11
|
-
import { N as NumberHelper } from './number-helper-
|
|
12
|
-
import { V as Validators } from './validators-
|
|
11
|
+
import { N as NumberHelper } from './number-helper-455ab41e.js';
|
|
12
|
+
import { V as Validators } from './validators-cc882165.js';
|
|
13
13
|
import './element-dragger-b75266e6.js';
|
|
14
14
|
import { B as Bcm, a as Bcm$1 } from './bcm-a50d55ba.js';
|
|
15
15
|
import { c as ce } from './index-3bc8c6e3.js';
|
|
@@ -26,7 +26,7 @@ import { F as FloatingUI } from './floating-ui-3f4394da.js';
|
|
|
26
26
|
import { g as getPlacement, s as setPosition } from './popover-placement-2bf3a181.js';
|
|
27
27
|
import { C as ColorPalette } from './colors-1d7854ea.js';
|
|
28
28
|
import { T as TypeProps$1, S as SizeProps, D as DirectionProps } from './types-b211a5eb.js';
|
|
29
|
-
import './package-
|
|
29
|
+
import './package-edee14d5.js';
|
|
30
30
|
import './colors-ed4e7579.js';
|
|
31
31
|
|
|
32
32
|
const accordionCss = "@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}:host{display:block}.bcm-accordion .bcm-expansion-panel{border-radius:0}.bcm-accordion .bcm-expansion-panel .bcm-expansion-panel__header{border-radius:0}.bcm-accordion .bcm-expansion-panel:first-child{border-top-left-radius:var(--bcm-ui-border-radius-default);border-top-right-radius:var(--bcm-ui-border-radius-default)}.bcm-accordion .bcm-expansion-panel:first-child .bcm-expansion-panel__header{border-top-left-radius:var(--bcm-ui-border-radius-default);border-top-right-radius:var(--bcm-ui-border-radius-default)}.bcm-accordion .bcm-expansion-panel:last-child{border-bottom-left-radius:var(--bcm-ui-border-radius-default);border-bottom-right-radius:var(--bcm-ui-border-radius-default)}.bcm-accordion .bcm-expansion-panel:last-child .bcm-expansion-panel__header{border-bottom-left-radius:var(--bcm-ui-border-radius-default);border-bottom-right-radius:var(--bcm-ui-border-radius-default)}";
|
|
@@ -2393,7 +2393,7 @@ ref, handleBlur, handleFocus, handleInput, handleChange, isEyeDropperSupported,
|
|
|
2393
2393
|
h$2("i", { class: "far fa-eye-dropper", onClick: () => eyeDropper() })))))));
|
|
2394
2394
|
};
|
|
2395
2395
|
|
|
2396
|
-
const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selectedItem, openGroup, checkedItem, focusItem, searchIsOnlyChilds }) => {
|
|
2396
|
+
const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selectedItem, openGroup, checkedItem, focusItem, searchIsOnlyChilds, disabled: parentDisabled, readonly: parentReadonly }) => {
|
|
2397
2397
|
const isHaveChildren = item.items && item.items.length > 0;
|
|
2398
2398
|
var text = StringHelper.htmlEntities(item.text);
|
|
2399
2399
|
let intersection = [];
|
|
@@ -2412,8 +2412,8 @@ const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selecte
|
|
|
2412
2412
|
}
|
|
2413
2413
|
text = item.isHtmlContent ? item.isHtmlContent : item.template && intersection.length > 0 ? StringHelper.templateParser(item.template, Object.assign(Object.assign({}, item.itemObject), { text })) : text;
|
|
2414
2414
|
const unClickable = !treeview && item.type == "group" && !item.clickable;
|
|
2415
|
-
const disabled = item.disabled;
|
|
2416
|
-
const readonly = item.readonly;
|
|
2415
|
+
const disabled = item.disabled || parentDisabled;
|
|
2416
|
+
const readonly = item.readonly || parentReadonly;
|
|
2417
2417
|
const itemClick = (event) => {
|
|
2418
2418
|
let path = event.path || event.composedPath();
|
|
2419
2419
|
if (path.filter(x => x.attributes && x.attributes.getNamedItem("unlinked"))[0]) {
|
|
@@ -2441,13 +2441,13 @@ const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selecte
|
|
|
2441
2441
|
treeview && (h$2("div", { class: "bcm-list__item-content-collapse-icon", onClick: () => collapseClick() }, isHaveChildren && h$2("bcm-icon", { icon: classnames('fas fa-caret-' + (item.isSearching || item.open ? 'down' : 'right')) }))),
|
|
2442
2442
|
h$2("div", { class: classnames('bcm-list__item-content-text', { treeview }), onClick: (e) => itemClick(e) },
|
|
2443
2443
|
checkboxes && (treeview || (!treeview && item.type != 'group')) && (h$2("div", { class: "bcm-list__item-content-text-checkbox" },
|
|
2444
|
-
h$2(CheckboxTemplate, { indeterminate: item.indeterminate, checked: item.checked, disabled:
|
|
2444
|
+
h$2(CheckboxTemplate, { indeterminate: item.indeterminate, checked: item.checked, disabled: disabled }))),
|
|
2445
2445
|
h$2("span", Object.assign({ class: "bcm-list__item-content-text-inner" }, (item.title && { "title": item.title }), { innerHTML: text })))),
|
|
2446
2446
|
(treeview || !treeview && item.type == "group") && isHaveChildren && (h$2("div", { class: "bcm-list__item-childs" }, (item.isSearching || item.open || (!treeview && item.type == "group")) &&
|
|
2447
2447
|
item.items.map((item) => (h$2(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) })))))));
|
|
2448
2448
|
};
|
|
2449
2449
|
|
|
2450
|
-
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, }) => {
|
|
2450
|
+
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, }) => {
|
|
2451
2451
|
const showSelectAll = !(treeview && searchFound > 0) && !(searchFound > 0);
|
|
2452
2452
|
const setScrollHeight = () => {
|
|
2453
2453
|
const itemHeight = size === 'small' ? 28 : size === 'medium' ? 36 : 48;
|
|
@@ -2461,8 +2461,8 @@ const ListTemplate = ({ type, highlight, selectAllItem, bcmListContainer, treevi
|
|
|
2461
2461
|
h$2("main", { onScroll: e => onScrollEvent(e), class: "scrolling", style: Object.assign({}, (type === 'select' && { 'overscroll-behavior': 'none' })) },
|
|
2462
2462
|
h$2("div", { style: setScrollHeight() },
|
|
2463
2463
|
checkAll && searchFound != 0 && items && items.length > 0 && checkboxes && showSelectAll && (h$2("section", { class: "bcm-list__container-select-all" },
|
|
2464
|
-
h$2(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) }))),
|
|
2465
|
-
items.map((item) => (h$2(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) }))),
|
|
2464
|
+
h$2(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 }))),
|
|
2465
|
+
items.map((item) => (h$2(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 }))),
|
|
2466
2466
|
(!items || items.length === 0) && searchFound != 0 && (h$2("section", { class: "bcm-list__container-no-data" },
|
|
2467
2467
|
h$2("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon },
|
|
2468
2468
|
h$2("span", { innerHTML: emptyText || 'No data' })))),
|
|
@@ -19858,6 +19858,8 @@ const BcmCollapseGroup = class {
|
|
|
19858
19858
|
get el() { return getElement(this); }
|
|
19859
19859
|
};
|
|
19860
19860
|
|
|
19861
|
+
const colorInputCss = "@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}:host{display:block}";
|
|
19862
|
+
|
|
19861
19863
|
const BcmColorInput = class {
|
|
19862
19864
|
constructor(hostRef) {
|
|
19863
19865
|
registerInstance(this, hostRef);
|
|
@@ -19869,20 +19871,13 @@ const BcmColorInput = class {
|
|
|
19869
19871
|
this.disabled = false;
|
|
19870
19872
|
this.readonly = false;
|
|
19871
19873
|
this.fullWidth = false;
|
|
19874
|
+
this.type = 'default';
|
|
19872
19875
|
}
|
|
19873
19876
|
handleChange(color) {
|
|
19874
19877
|
this.value = color;
|
|
19875
|
-
this.getInputElement().setValue(color);
|
|
19876
|
-
forceUpdate(this.el);
|
|
19877
|
-
}
|
|
19878
|
-
getInputElement() {
|
|
19879
|
-
return this.el.querySelector(`bcm-input`);
|
|
19880
19878
|
}
|
|
19881
|
-
|
|
19882
|
-
|
|
19883
|
-
}
|
|
19884
|
-
handleInputChanged(e) {
|
|
19885
|
-
this.getPickerElement().color = e.detail;
|
|
19879
|
+
handleInputChanged(value) {
|
|
19880
|
+
this.value = value;
|
|
19886
19881
|
}
|
|
19887
19882
|
eyeDropper() {
|
|
19888
19883
|
const eyeDropper = new window.EyeDropper();
|
|
@@ -19904,12 +19899,57 @@ const BcmColorInput = class {
|
|
|
19904
19899
|
return typeof window !== "undefined" && "EyeDropper" in window;
|
|
19905
19900
|
}
|
|
19906
19901
|
render() {
|
|
19907
|
-
return (h$2(Host, { class: "tw-block" }, h$2("bcm-input", { id: this._id + "-color", fullWidth: this.fullWidth, label: this.label, placeholder: this.placeholder, type: "text", "onBcm-change":
|
|
19902
|
+
return (h$2(Host, { class: "tw-block" }, h$2("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$2("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: {
|
|
19908
19903
|
backgroundColor: this.value,
|
|
19909
|
-
} }), this.isEyeDropperSupported() && h$2("i", { slot: "suffix", class: "far fa-eye-dropper", onClick: () => this.eyeDropper() })), h$2("bcm-linked", { targetId: this._id + "-color-container" }, h$2("bcm-colorful", { id: this._id + "-picker", color: this.value, onBcmChange:
|
|
19904
|
+
} }), this.isEyeDropperSupported() && h$2("i", { slot: "suffix", class: "far fa-eye-dropper", onClick: () => this.eyeDropper() })), h$2("bcm-linked", { targetId: this._id + "-color-container" }, this.type === 'palette' ? (h$2("bcm-color-palette", { id: this._id + "-picker", value: this.value, "onBcm-change": ({ detail }) => this.handleChange(detail) })) : (h$2("bcm-colorful", { id: this._id + "-picker", color: this.value, onBcmChange: ({ detail }) => this.handleChange(detail) })))));
|
|
19910
19905
|
}
|
|
19911
19906
|
get el() { return getElement(this); }
|
|
19912
19907
|
};
|
|
19908
|
+
BcmColorInput.style = colorInputCss;
|
|
19909
|
+
|
|
19910
|
+
const colorPaletteStyle = ce({
|
|
19911
|
+
slots: {
|
|
19912
|
+
host: "tw-flex tw-gap-4 tw-p-3 tw-bg-color-base tw-border tw-rounded-md tw-box-border tw-w-fit tw-h-fit",
|
|
19913
|
+
column: "tw-flex tw-flex-col tw-gap-4",
|
|
19914
|
+
box: "tw-w-6 tw-h-6 tw-rounded-md tw-cursor-pointer tw-transition-all tw-duration-200 tw-relative tw-flex tw-items-center tw-justify-center tw-border",
|
|
19915
|
+
},
|
|
19916
|
+
variants: {
|
|
19917
|
+
selected: {
|
|
19918
|
+
true: {
|
|
19919
|
+
box: "tw-z-10 tw-ring-2 tw-ring-primary tw-ring-offset-2 tw-scale-100 tw-border-transparent",
|
|
19920
|
+
},
|
|
19921
|
+
false: {
|
|
19922
|
+
box: "tw-border-transparent hover:tw-border-black/10 hover:tw-scale-110",
|
|
19923
|
+
},
|
|
19924
|
+
},
|
|
19925
|
+
},
|
|
19926
|
+
defaultVariants: {
|
|
19927
|
+
selected: false,
|
|
19928
|
+
},
|
|
19929
|
+
});
|
|
19930
|
+
|
|
19931
|
+
const BcmColorPalette = class {
|
|
19932
|
+
constructor(hostRef) {
|
|
19933
|
+
registerInstance(this, hostRef);
|
|
19934
|
+
this.bcmChange = createEvent(this, "bcm-change", 7);
|
|
19935
|
+
this.onColorChange = (hex) => {
|
|
19936
|
+
this.value = hex;
|
|
19937
|
+
this.bcmChange.emit(hex);
|
|
19938
|
+
};
|
|
19939
|
+
this.value = undefined;
|
|
19940
|
+
this.paletteKeys = ["orange", "yellow", "lime", "green", "teal", "cyan", "sky", "indigo", "violet", "purple", "fuchsia", "pink", "rose", "stone", "slate"];
|
|
19941
|
+
this.shades = [950, 900, 800, 700, 600, 400, 300, 200, 100, 50];
|
|
19942
|
+
}
|
|
19943
|
+
render() {
|
|
19944
|
+
const { host, column, box } = colorPaletteStyle();
|
|
19945
|
+
return (h$2(Host, { class: host() }, this.paletteKeys.map((colorName) => (h$2("div", { class: column(), key: colorName }, this.shades.map((shade) => {
|
|
19946
|
+
const colorKey = `${colorName}-${shade}`;
|
|
19947
|
+
const hex = ColorHelper.getTwColorToHex(colorKey);
|
|
19948
|
+
const isSelected = this.value === hex;
|
|
19949
|
+
return (h$2("div", { key: colorKey, class: box({ selected: isSelected }), style: { backgroundColor: hex }, onClick: () => this.onColorChange(hex) }));
|
|
19950
|
+
}))))));
|
|
19951
|
+
}
|
|
19952
|
+
};
|
|
19913
19953
|
|
|
19914
19954
|
function u$1(){return (u$1=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e}).apply(this,arguments)}function c$1(e,r){if(null==e)return {};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r.indexOf(t=a[n])>=0||(o[t]=e[t]);return o}function i(e){var t=react.useRef(e),n=react.useRef(function(e){t.current&&t.current(e);});return t.current=e,n.current}var s=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=1),e>t?t:e<r?r:e},f$1=function(e){return "touches"in e},v$1=function(e){return e&&e.ownerDocument.defaultView||self},d$1=function(e,r,t){var n=e.getBoundingClientRect(),o=f$1(r)?function(e,r){for(var t=0;t<e.length;t++)if(e[t].identifier===r)return e[t];return e[0]}(r.touches,t):r;return {left:s((o.pageX-(n.left+v$1(e).pageXOffset))/n.width),top:s((o.pageY-(n.top+v$1(e).pageYOffset))/n.height)}},h$1=function(e){!f$1(e)&&e.preventDefault();},m$1=react.memo(function(o){var a=o.onMove,l=o.onKey,s=c$1(o,["onMove","onKey"]),m=react.useRef(null),g=i(a),p=i(l),b=react.useRef(null),_=react.useRef(!1),x=react.useMemo(function(){var e=function(e){h$1(e),(f$1(e)?e.touches.length>0:e.buttons>0)&&m.current?g(d$1(m.current,e,b.current)):t(!1);},r=function(){return t(!1)};function t(t){var n=_.current,o=v$1(m.current),a=t?o.addEventListener:o.removeEventListener;a(n?"touchmove":"mousemove",e),a(n?"touchend":"mouseup",r);}return [function(e){var r=e.nativeEvent,n=m.current;if(n&&(h$1(r),!function(e,r){return r&&!f$1(e)}(r,_.current)&&n)){if(f$1(r)){_.current=!0;var o=r.changedTouches||[];o.length&&(b.current=o[0].identifier);}n.focus(),g(d$1(n,r,b.current)),t(!0);}},function(e){var r=e.which||e.keyCode;r<37||r>40||(e.preventDefault(),p({left:39===r?.05:37===r?-.05:0,top:40===r?.05:38===r?-.05:0}));},t]},[p,g]),C=x[0],E=x[1],H=x[2];return react.useEffect(function(){return H},[H]),react.createElement("div",u$1({},s,{onTouchStart:C,onMouseDown:C,className:"react-colorful__interactive",ref:m,onKeyDown:E,tabIndex:0,role:"slider"}))}),g$1=function(e){return e.filter(Boolean).join(" ")},p$1=function(r){var t=r.color,n=r.left,o=r.top,a=void 0===o?.5:o,l=g$1(["react-colorful__pointer",r.className]);return react.createElement("div",{className:l,style:{top:100*a+"%",left:100*n+"%"}},react.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},b$1=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=Math.pow(10,r)),Math.round(t*e)/t},x=function(e){return L(C(e))},C=function(e){return "#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?b$1(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?b$1(parseInt(e.substring(6,8),16)/255,2):1}},w=function(e){return K(I(e))},y=function(e){var r=e.s,t=e.v,n=e.a,o=(200-r)*t/100;return {h:b$1(e.h),s:b$1(o>0&&o<200?r*t/100/(o<=100?o:200-o)*100:0),l:b$1(o/2),a:b$1(n,2)}},q$1=function(e){var r=y(e);return "hsl("+r.h+", "+r.s+"%, "+r.l+"%)"},I=function(e){var r=e.h,t=e.s,n=e.v,o=e.a;r=r/360*6,t/=100,n/=100;var a=Math.floor(r),l=n*(1-t),u=n*(1-(r-a)*t),c=n*(1-(1-r+a)*t),i=a%6;return {r:b$1(255*[n,u,l,l,c,n][i]),g:b$1(255*[c,n,n,u,l,l][i]),b:b$1(255*[l,l,c,n,n,u][i]),a:b$1(o,2)}},D=function(e){var r=e.toString(16);return r.length<2?"0"+r:r},K=function(e){var r=e.r,t=e.g,n=e.b,o=e.a,a=o<1?D(b$1(255*o)):"";return "#"+D(r)+D(t)+D(n)+a},L=function(e){var r=e.r,t=e.g,n=e.b,o=e.a,a=Math.max(r,t,n),l=a-Math.min(r,t,n),u=l?a===r?(t-n)/l:a===t?2+(n-r)/l:4+(r-t)/l:0;return {h:b$1(60*(u<0?u+6:u)),s:b$1(a?l/a*100:0),v:b$1(a/255*100),a:o}},S=react.memo(function(r){var t=r.hue,n=r.onChange,o=g$1(["react-colorful__hue",r.className]);return react.createElement("div",{className:o},react.createElement(m$1,{onMove:function(e){n({h:360*e.left});},onKey:function(e){n({h:s(t+360*e.left,0,360)});},"aria-label":"Hue","aria-valuenow":b$1(t),"aria-valuemax":"360","aria-valuemin":"0"},react.createElement(p$1,{className:"react-colorful__hue-pointer",left:t/360,color:q$1({h:t,s:100,v:100,a:1})})))}),T=react.memo(function(r){var t=r.hsva,n=r.onChange,o={backgroundColor:q$1({h:t.h,s:100,v:100,a:1})};return react.createElement("div",{className:"react-colorful__saturation",style:o},react.createElement(m$1,{onMove:function(e){n({s:100*e.left,v:100-100*e.top});},onKey:function(e){n({s:s(t.s+100*e.left,0,100),v:s(t.v-100*e.top,0,100)});},"aria-label":"Color","aria-valuetext":"Saturation "+b$1(t.s)+"%, Brightness "+b$1(t.v)+"%"},react.createElement(p$1,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:q$1(t)})))}),F=function(e,r){if(e===r)return !0;for(var t in e)if(e[t]!==r[t])return !1;return !0},X=function(e,r){return e.toLowerCase()===r.toLowerCase()||F(C(e),C(r))};function Y(e,t,l){var u=i(l),c=react.useState(function(){return e.toHsva(t)}),s=c[0],f=c[1],v=react.useRef({color:t,hsva:s});react.useEffect(function(){if(!e.equal(t,v.current.color)){var r=e.toHsva(t);v.current={hsva:r,color:t},f(r);}},[t,e]),react.useEffect(function(){var r;F(s,v.current.hsva)||e.equal(r=e.fromHsva(s),v.current.color)||(v.current={hsva:s,color:r},u(r));},[s,e,u]);var d=react.useCallback(function(e){f(function(r){return Object.assign({},r,e)});},[]);return [s,d]}var V="undefined"!=typeof window?react.useLayoutEffect:react.useEffect,$=function(){return ("undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0)},J=new Map,Q=function(e){V(function(){var r=e.current?e.current.ownerDocument:document;if(void 0!==r&&!J.has(r)){var t=r.createElement("style");t.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',J.set(r,t);var n=$();n&&t.setAttribute("nonce",n),r.head.appendChild(t);}},[]);},U=function(t){var n=t.className,o=t.colorModel,a=t.color,l=void 0===a?o.defaultColor:a,i=t.onChange,s=c$1(t,["className","colorModel","color","onChange"]),f=react.useRef(null);Q(f);var v=Y(o,l,i),d=v[0],h=v[1],m=g$1(["react-colorful",n]);return react.createElement("div",u$1({},s,{ref:f,className:m}),react.createElement(T,{hsva:d,onChange:h}),react.createElement(S,{hue:d.h,onChange:h,className:"react-colorful__last-control"}))},W={defaultColor:"000",toHsva:x,fromHsva:function(e){return w({h:e.h,s:e.s,v:e.v,a:1})},equal:X},Z=function(r){return react.createElement(U,u$1({},r,{colorModel:W}))};
|
|
19915
19955
|
|
|
@@ -27061,6 +27101,7 @@ const BcmList = class {
|
|
|
27061
27101
|
this.shouldTriggerChange = undefined;
|
|
27062
27102
|
this.placement = Bcm.Placement["bottom-start"];
|
|
27063
27103
|
this.disableChangeEvent = false;
|
|
27104
|
+
this.autoFocusSelected = false;
|
|
27064
27105
|
this.data = [];
|
|
27065
27106
|
window.addEventListener("scroll", this.handleWheel.bind(this), true);
|
|
27066
27107
|
window.addEventListener("wheel", this.handleWheel.bind(this), true);
|
|
@@ -27173,6 +27214,7 @@ const BcmList = class {
|
|
|
27173
27214
|
}
|
|
27174
27215
|
}
|
|
27175
27216
|
async handleOpen() {
|
|
27217
|
+
const isAutoSelected = this.autoFocusSelected && this.type == "select" && !this.checkboxes && this.value;
|
|
27176
27218
|
if (this.isOpen) {
|
|
27177
27219
|
this.detectClone();
|
|
27178
27220
|
if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
|
|
@@ -27187,10 +27229,15 @@ const BcmList = class {
|
|
|
27187
27229
|
this.onSelectSearch();
|
|
27188
27230
|
await delay$1(50);
|
|
27189
27231
|
this.isOpenAnimation = true;
|
|
27232
|
+
if (isAutoSelected) {
|
|
27233
|
+
this.focusSelectedElement();
|
|
27234
|
+
}
|
|
27190
27235
|
}
|
|
27191
27236
|
else {
|
|
27237
|
+
if (!isAutoSelected) {
|
|
27238
|
+
this.listScrollToTop();
|
|
27239
|
+
}
|
|
27192
27240
|
this.isOpenAnimation = false;
|
|
27193
|
-
this.listScrollToTop();
|
|
27194
27241
|
this.close.emit();
|
|
27195
27242
|
this.listClose.emit();
|
|
27196
27243
|
await delay$1(100);
|
|
@@ -27543,22 +27590,33 @@ const BcmList = class {
|
|
|
27543
27590
|
this.markForCheck();
|
|
27544
27591
|
}
|
|
27545
27592
|
async initState() {
|
|
27546
|
-
var _a, _b, _c;
|
|
27593
|
+
var _a, _b, _c, _d, _e;
|
|
27547
27594
|
this.onClearSearch();
|
|
27548
27595
|
await listState.setValue({
|
|
27549
27596
|
id: this._id,
|
|
27550
27597
|
dataSource: this.data && snq(() => (typeof this.data == "string" ? JSON.parse(this.data) : this.data), []),
|
|
27551
27598
|
options: this,
|
|
27552
27599
|
});
|
|
27553
|
-
const { totalRoots, totalItems } = listState.getValue(this._id);
|
|
27600
|
+
const { totalRoots, totalItems, dataSource } = listState.getValue(this._id);
|
|
27554
27601
|
this.totalData = (totalItems === null || totalItems === void 0 ? void 0 : totalItems.total) || 0;
|
|
27555
27602
|
this.totalRootData = totalRoots || 0;
|
|
27556
27603
|
this.value = this.checkboxes ? (await this.getCheckedList()).checkedList : listState.selectedItem(this._id) ? listState.selectedItem(this._id)[0] : null;
|
|
27604
|
+
/** @description Focus selected element * BUG 282262 */
|
|
27605
|
+
if (this.autoFocusSelected && this.type == "select" && this.value && !this.checkboxes) {
|
|
27606
|
+
const selectedId = Array.isArray(this.value) ? (_a = this.value[0]) === null || _a === void 0 ? void 0 : _a.id : (_b = this.value) === null || _b === void 0 ? void 0 : _b.id;
|
|
27607
|
+
if (selectedId && dataSource) {
|
|
27608
|
+
const selectedIndex = dataSource.findIndex(item => item.id === selectedId);
|
|
27609
|
+
if (selectedIndex !== -1 && selectedIndex >= this.limit) {
|
|
27610
|
+
this.limit = selectedIndex + 5;
|
|
27611
|
+
this.searchResultLimit = this.limit;
|
|
27612
|
+
}
|
|
27613
|
+
}
|
|
27614
|
+
}
|
|
27557
27615
|
if (!this.checkboxes) {
|
|
27558
|
-
this.inputText = Generate.domParser((
|
|
27616
|
+
this.inputText = Generate.domParser((_c = this.value) === null || _c === void 0 ? void 0 : _c.text) || null;
|
|
27559
27617
|
}
|
|
27560
27618
|
// checkli olan subparentların indeterminate kontrolü için
|
|
27561
|
-
if (this.checkboxes && ((
|
|
27619
|
+
if (this.checkboxes && ((_d = this.value) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
27562
27620
|
const checkedIDs = [];
|
|
27563
27621
|
this.value.forEach(item => {
|
|
27564
27622
|
if (!item.items || item.items.length === 0) {
|
|
@@ -27567,7 +27625,7 @@ const BcmList = class {
|
|
|
27567
27625
|
});
|
|
27568
27626
|
await this.addChecked(checkedIDs, false, false);
|
|
27569
27627
|
}
|
|
27570
|
-
await this.handleIndeterminate((
|
|
27628
|
+
await this.handleIndeterminate((_e = this.value) === null || _e === void 0 ? void 0 : _e.length, this.totalData);
|
|
27571
27629
|
await this.markForCheck();
|
|
27572
27630
|
}
|
|
27573
27631
|
async markForCheck() {
|
|
@@ -27650,20 +27708,16 @@ const BcmList = class {
|
|
|
27650
27708
|
getAutoCompleteInput() {
|
|
27651
27709
|
return document.getElementById(`bcm-list-input-tag-container-${this._id}-autocomplete-input`);
|
|
27652
27710
|
}
|
|
27711
|
+
/** @description Fixes the issue where the list appears empty during fast scrolling. */
|
|
27653
27712
|
dataScrollEvent(event) {
|
|
27654
|
-
|
|
27655
|
-
|
|
27656
|
-
|
|
27657
|
-
|
|
27658
|
-
|
|
27659
|
-
|
|
27660
|
-
|
|
27661
|
-
|
|
27662
|
-
io = null;
|
|
27663
|
-
}
|
|
27664
|
-
}
|
|
27665
|
-
}, this.options);
|
|
27666
|
-
io.observe(event.target.lastElementChild);
|
|
27713
|
+
var _a, _b;
|
|
27714
|
+
const itemHeight = this.size === 'small' ? 28 : this.size === 'large' ? 48 : 36;
|
|
27715
|
+
const currentScrollBottom = ((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.scrollTop) + ((_b = event === null || event === void 0 ? void 0 : event.target) === null || _b === void 0 ? void 0 : _b.clientHeight);
|
|
27716
|
+
const requiredItems = Math.ceil(currentScrollBottom / itemHeight) + 20;
|
|
27717
|
+
if (requiredItems > this.limit) {
|
|
27718
|
+
this.limit = requiredItems;
|
|
27719
|
+
this.searchResultLimit = requiredItems;
|
|
27720
|
+
}
|
|
27667
27721
|
}
|
|
27668
27722
|
async calculateLocation() {
|
|
27669
27723
|
var _a, _b;
|
|
@@ -27733,6 +27787,28 @@ const BcmList = class {
|
|
|
27733
27787
|
this.listOpen.emit();
|
|
27734
27788
|
}
|
|
27735
27789
|
}
|
|
27790
|
+
/** @description Focus selected element * BUG 282262 */
|
|
27791
|
+
focusSelectedElement() {
|
|
27792
|
+
var _a;
|
|
27793
|
+
const listElement = document.querySelector(`#bcm-list-${this._id}`);
|
|
27794
|
+
if (!listElement)
|
|
27795
|
+
return;
|
|
27796
|
+
const selectedId = (_a = this.value) === null || _a === void 0 ? void 0 : _a.id;
|
|
27797
|
+
if (selectedId) {
|
|
27798
|
+
const targetItem = listElement.querySelector(`[id*="${selectedId}"]`);
|
|
27799
|
+
if (targetItem) {
|
|
27800
|
+
targetItem.scrollIntoView({
|
|
27801
|
+
block: 'center',
|
|
27802
|
+
inline: 'nearest',
|
|
27803
|
+
behavior: 'auto'
|
|
27804
|
+
});
|
|
27805
|
+
targetItem.focus();
|
|
27806
|
+
const items = listElement.querySelectorAll(".bcm-list__item");
|
|
27807
|
+
items.forEach(i => i.classList.remove("focused"));
|
|
27808
|
+
targetItem.classList.add("focused");
|
|
27809
|
+
}
|
|
27810
|
+
}
|
|
27811
|
+
}
|
|
27736
27812
|
render() {
|
|
27737
27813
|
const { checkboxes, treeview, label, size, disabled, readonly, required, hidden, fullWidth, searchable } = this.getOptions();
|
|
27738
27814
|
const hostClasses = classnames("bcm-list", `bcm-list__size-${size}`, `bcm-list__${this.type}`, size === "large" ? "size-3" : "size-2", {
|
|
@@ -27761,7 +27837,7 @@ const BcmList = class {
|
|
|
27761
27837
|
"--min-height": openedType ? "inherit" : this.minHeight,
|
|
27762
27838
|
} }, h$2("div", { id: `bcm-list-label-${this._id}`, class: "bcm-list__label" }, label && (h$2("div", null, h$2("bcm-label", { tooltip: this.tooltip, size: this.size, type: this.captionType, value: label, required: required, htmlFor: this._id })))), this.type == "select" && (h$2("div", { id: `bcm-list-input-${this._id}`, class: bcmListInput }, h$2("span", { class: classnames("bcm-list__input-container", { "type-single": !checkboxes, "value-empty": !this.value }) }, this.checkboxes ? (this.value && this.value.length > 0 ? (h$2("bcm-rc-overflow", { data: this.tagData, maxCount: this.tagCount })) : (h$2("span", { class: "bcm-list__input-placeholder" }, this.placeholder))) : this.value ? (this.inputText) : (h$2("span", { class: "bcm-list__input-placeholder" }, this.placeholder))), h$2("span", { class: classnames("bcm-list__input-buttons", {
|
|
27763
27839
|
disabled: disabled,
|
|
27764
|
-
}) }, this.clearable && this.value && (h$2("div", { class: "bcm-list__input-buttons-button" }, h$2("bcm-icon", { icon: "fal fa-times", onClick: e => !disabled && this.setClear(e) }))), h$2("div", { class: `bcm-list__input-buttons-button caret-is ${this.isOpen && this.calculatedViewport && "caret-is-open"}` }, h$2("bcm-icon", { icon: `far fa-angle-down` }))))), this.type === "autocomplete" && (h$2("div", { id: `bcm-list-input-${this._id}`, class: classnames(bcmListInput, { "bcm-list__input-autocomplete": this.type == "autocomplete" }) }, h$2("span", { class: "bcm-list__input-container", id: `bcm-list-input-tag-container-${this._id}` }, this.checkboxes && h$2("span", { class: "bcm-list__input-tag-container", id: `bcm-list-input-tag-container-${this._id}-autocomplete` }), h$2("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$2(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$2(CaptionTemplate, { noCaption: this.noCaption, captionType: this.captionType, captionError: this.captionError, caption: this.caption })));
|
|
27840
|
+
}) }, this.clearable && this.value && (h$2("div", { class: "bcm-list__input-buttons-button" }, h$2("bcm-icon", { icon: "fal fa-times", onClick: e => !disabled && this.setClear(e) }))), h$2("div", { class: `bcm-list__input-buttons-button caret-is ${this.isOpen && this.calculatedViewport && "caret-is-open"}` }, h$2("bcm-icon", { icon: `far fa-angle-down` }))))), this.type === "autocomplete" && (h$2("div", { id: `bcm-list-input-${this._id}`, class: classnames(bcmListInput, { "bcm-list__input-autocomplete": this.type == "autocomplete" }) }, h$2("span", { class: "bcm-list__input-container", id: `bcm-list-input-tag-container-${this._id}` }, this.checkboxes && h$2("span", { class: "bcm-list__input-tag-container", id: `bcm-list-input-tag-container-${this._id}-autocomplete` }), h$2("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$2(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$2(CaptionTemplate, { noCaption: this.noCaption, captionType: this.captionType, captionError: this.captionError, caption: this.caption })));
|
|
27765
27841
|
}
|
|
27766
27842
|
get el() { return getElement(this); }
|
|
27767
27843
|
static get watchers() { return {
|
|
@@ -47108,4 +47184,4 @@ const BcmTypography = class {
|
|
|
47108
47184
|
get el() { return getElement(this); }
|
|
47109
47185
|
};
|
|
47110
47186
|
|
|
47111
|
-
export { BcmAccordion as bcm_accordion, BcmAlert as bcm_alert, BcmAttendance as bcm_attendance, BcmAttendanceActions as bcm_attendance_actions, BcmAvatar as bcm_avatar, BcmBadge as bcm_badge, BcmButton as bcm_button, BcmButtonGroup as bcm_button_group, BcmCheckbox as bcm_checkbox, BcmCheckboxGroup as bcm_checkbox_group, BcmCheckboxLite as bcm_checkbox_lite, BcmChip as bcm_chip, BcmChipGroup as bcm_chip_group, BcmCollapse as bcm_collapse, BcmCollapseGroup as bcm_collapse_group, BcmColorInput as bcm_color_input, BcmColorful as bcm_colorful, BcmDate as bcm_date, BcmDivider as bcm_divider, BcmDrawer as bcm_drawer, BcmDropdown as bcm_dropdown, BcmEmpty as bcm_empty, BcmErrorLayout as bcm_error_layout, BcmExpansionPanel as bcm_expansion_panel, BcmForm as bcm_form, BcmIcon as bcm_icon, BcmInput as bcm_input, BcmItem as bcm_item, BcmItems as bcm_items, BcmLabel as bcm_label, BcmLink as bcm_link, BcmLinked as bcm_linked, BcmList as bcm_list, BcmListbox as bcm_listbox, BcmListboxGroup as bcm_listbox_group, BcmListboxItem as bcm_listbox_item, BcmMenu as bcm_menu, BcmModal as bcm_modal, BcmOldInput as bcm_old_input, BcmOldSearch as bcm_old_search, BcmOldTag as bcm_old_tag, BcmPopconfirm as bcm_popconfirm, BcmPopconfirmBox as bcm_popconfirm_box, BcmPopover as bcm_popover, BcmProgress as bcm_progress, BcmRadio as bcm_radio, BcmRadioGroup as bcm_radio_group, BcmRange as bcm_range, BcmRcOverflow as bcm_rc_overflow, BcmRcPicker as bcm_rc_picker, BcmSearch as bcm_search, BcmSelect as bcm_select, BcmSelectBox as bcm_select_box, BcmShortcut as bcm_shortcut, BcmStep as bcm_step, BcmStepper as bcm_stepper, BcmSwitch as bcm_switch, BcmTab as bcm_tab, BcmTabGroup as bcm_tab_group, BcmTabItem as bcm_tab_item, BcmTabItemHeader as bcm_tab_item_header, BcmTabs as bcm_tabs, BcmText as bcm_text, BcmTextarea as bcm_textarea, BcmTooltip as bcm_tooltip, Bcmtreeview as bcm_treeview, BcmtreeviewItem as bcm_treeview_item, BcmTypography as bcm_typography };
|
|
47187
|
+
export { BcmAccordion as bcm_accordion, BcmAlert as bcm_alert, BcmAttendance as bcm_attendance, BcmAttendanceActions as bcm_attendance_actions, BcmAvatar as bcm_avatar, BcmBadge as bcm_badge, BcmButton as bcm_button, BcmButtonGroup as bcm_button_group, BcmCheckbox as bcm_checkbox, BcmCheckboxGroup as bcm_checkbox_group, BcmCheckboxLite as bcm_checkbox_lite, BcmChip as bcm_chip, BcmChipGroup as bcm_chip_group, BcmCollapse as bcm_collapse, BcmCollapseGroup as bcm_collapse_group, BcmColorInput as bcm_color_input, BcmColorPalette as bcm_color_palette, BcmColorful as bcm_colorful, BcmDate as bcm_date, BcmDivider as bcm_divider, BcmDrawer as bcm_drawer, BcmDropdown as bcm_dropdown, BcmEmpty as bcm_empty, BcmErrorLayout as bcm_error_layout, BcmExpansionPanel as bcm_expansion_panel, BcmForm as bcm_form, BcmIcon as bcm_icon, BcmInput as bcm_input, BcmItem as bcm_item, BcmItems as bcm_items, BcmLabel as bcm_label, BcmLink as bcm_link, BcmLinked as bcm_linked, BcmList as bcm_list, BcmListbox as bcm_listbox, BcmListboxGroup as bcm_listbox_group, BcmListboxItem as bcm_listbox_item, BcmMenu as bcm_menu, BcmModal as bcm_modal, BcmOldInput as bcm_old_input, BcmOldSearch as bcm_old_search, BcmOldTag as bcm_old_tag, BcmPopconfirm as bcm_popconfirm, BcmPopconfirmBox as bcm_popconfirm_box, BcmPopover as bcm_popover, BcmProgress as bcm_progress, BcmRadio as bcm_radio, BcmRadioGroup as bcm_radio_group, BcmRange as bcm_range, BcmRcOverflow as bcm_rc_overflow, BcmRcPicker as bcm_rc_picker, BcmSearch as bcm_search, BcmSelect as bcm_select, BcmSelectBox as bcm_select_box, BcmShortcut as bcm_shortcut, BcmStep as bcm_step, BcmStepper as bcm_stepper, BcmSwitch as bcm_switch, BcmTab as bcm_tab, BcmTabGroup as bcm_tab_group, BcmTabItem as bcm_tab_item, BcmTabItemHeader as bcm_tab_item_header, BcmTabs as bcm_tabs, BcmText as bcm_text, BcmTextarea as bcm_textarea, BcmTooltip as bcm_tooltip, Bcmtreeview as bcm_treeview, BcmtreeviewItem as bcm_treeview_item, BcmTypography as bcm_typography };
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-4614b7f0.js';
|
|
6
6
|
import './color-helper-ba15b0d8.js';
|
|
7
7
|
import './datetime-helper-df25808a.js';
|
|
8
|
-
import { G as Generate } from './generate-
|
|
9
|
-
import './number-helper-
|
|
8
|
+
import { G as Generate } from './generate-56d49b70.js';
|
|
9
|
+
import './number-helper-455ab41e.js';
|
|
10
10
|
import './string-helper-69203215.js';
|
|
11
|
-
import './validators-
|
|
11
|
+
import './validators-cc882165.js';
|
|
12
12
|
import './element-dragger-b75266e6.js';
|
|
13
13
|
import { d as delay } from './utils-7727d09e.js';
|
|
14
14
|
import { F as FloatingUI } from './floating-ui-3f4394da.js';
|
|
@@ -17,7 +17,7 @@ import { c as ce } from './index-3bc8c6e3.js';
|
|
|
17
17
|
import './colors-1d7854ea.js';
|
|
18
18
|
import './colors-ed4e7579.js';
|
|
19
19
|
import './_commonjsHelpers-7002e5de.js';
|
|
20
|
-
import './package-
|
|
20
|
+
import './package-edee14d5.js';
|
|
21
21
|
|
|
22
22
|
const attendanceActionCommentStyle = ce({
|
|
23
23
|
slots: {
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-4614b7f0.js';
|
|
6
6
|
import './color-helper-ba15b0d8.js';
|
|
7
7
|
import './datetime-helper-df25808a.js';
|
|
8
|
-
import { G as Generate } from './generate-
|
|
9
|
-
import './number-helper-
|
|
8
|
+
import { G as Generate } from './generate-56d49b70.js';
|
|
9
|
+
import './number-helper-455ab41e.js';
|
|
10
10
|
import './string-helper-69203215.js';
|
|
11
|
-
import './validators-
|
|
11
|
+
import './validators-cc882165.js';
|
|
12
12
|
import './element-dragger-b75266e6.js';
|
|
13
13
|
import { F as FloatingUI } from './floating-ui-3f4394da.js';
|
|
14
14
|
import { B as Bcm } from './bcm-a50d55ba.js';
|
|
@@ -18,7 +18,7 @@ import './colors-1d7854ea.js';
|
|
|
18
18
|
import './utils-7727d09e.js';
|
|
19
19
|
import './colors-ed4e7579.js';
|
|
20
20
|
import './_commonjsHelpers-7002e5de.js';
|
|
21
|
-
import './package-
|
|
21
|
+
import './package-edee14d5.js';
|
|
22
22
|
|
|
23
23
|
const attendanceActionDropdownStyle = ce({
|
|
24
24
|
slots: {
|