@orangelogic/design-system 2.143.0 → 2.144.0
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/library/assets/validation.worker-D3_lxKZ_.js +1 -0
- package/library/chunks/{AxisLabelRadial.D-dnNhId.js → AxisLabelRadial.BVjTmOAK.js} +1 -1
- package/library/chunks/{BaseColumnSeries.DuJGGHnE.js → BaseColumnSeries.CBs_QAAc.js} +1 -1
- package/library/chunks/{CandlestickSeries.Dvk4WnlG.js → CandlestickSeries.Cx0wpT9T.js} +2 -2
- package/library/chunks/{Circle.CSPkPGZR.js → Circle.CPg-MUlK.js} +1 -1
- package/library/chunks/{ColumnSeries.BgqnNaWx.js → ColumnSeries.CGSxIqPG.js} +2 -2
- package/library/chunks/{EditableAxisLabel.htXPpq9V.js → EditableAxisLabel.BE0SAubP.js} +2 -2
- package/library/chunks/{EditableLabel.BVdITrjV.js → EditableLabel.L5NEdtkw.js} +1 -1
- package/library/chunks/{Gradient.Bw8LaBZS.js → Gradient.oQ6wJQll.js} +1 -1
- package/library/chunks/{LinearGradient.DryVGwkQ.js → LinearGradient.CEimwU0Q.js} +2 -2
- package/library/chunks/{Picture.GEGxHvQB.js → Picture.BfLKhIYn.js} +1 -1
- package/library/chunks/{Polygon.B7Vu5sIv.js → Polygon.iNK22k_h.js} +1 -1
- package/library/chunks/{ProgressPie.C2sMNGxC.js → ProgressPie.Bcqzaeqx.js} +5 -5
- package/library/chunks/{RadialLabel.DCE1UsLn.js → RadialLabel.a3toiXax.js} +1 -1
- package/library/chunks/{Scrollbar.DoQ3emzl.js → Scrollbar.CAoY7xcW.js} +1 -1
- package/library/chunks/{Slice.BtEmJlKG.js → Slice.DLvisUPP.js} +1 -1
- package/library/chunks/{Slider.BkWEJjkG.js → Slider.syeHIyBN.js} +1 -1
- package/library/chunks/{SpriteResizer.CkJ6wMt2.js → SpriteResizer.BDWAslnu.js} +1 -1
- package/library/chunks/{Triangle.DRbqqwUv.js → Triangle.adLo6odq.js} +1 -1
- package/library/chunks/{ZoomTools.B2lVZ7om.js → ZoomTools.4NFU6RVT.js} +1 -1
- package/library/chunks/{_baseIteratee.Dhw-0WrS.js → _baseIteratee.CzjK3VFY.js} +2 -2
- package/library/chunks/{_baseUniq.DP9Qak6V.js → _baseUniq.CoXu-orP.js} +1 -1
- package/library/chunks/{_baseXor.DY_sP7af.js → _baseXor.DRclcoaa.js} +4 -4
- package/library/chunks/{am-chart.DaqbO8CU.js → am-chart.Bf-o9SaR.js} +252 -252
- package/library/chunks/{animation.DYTPen16.js → animation.BSFdTpqz.js} +1 -1
- package/library/chunks/{asset-link-format.BVoE-GrD.js → asset-link-format.D6XVEha7.js} +10 -10
- package/library/chunks/{button.Bja8HrmJ.js → button.Bx7AnUu4.js} +4 -4
- package/library/chunks/button.styles.svc2lIwC.js +5 -0
- package/library/chunks/{capitalize.WZm6pIpy.js → capitalize.DKzUtjlF.js} +1 -1
- package/library/chunks/{checkbox.kdSMUgR1.js → checkbox.aQnF4Zc3.js} +2 -2
- package/library/chunks/{color-swatch-group.CwHdAKQv.js → color-swatch-group.DORzYTrn.js} +831 -747
- package/library/chunks/{color-swatch.DCePblYs.js → color-swatch.Pczcitrc.js} +3 -3
- package/library/chunks/{colorPicker.B1c_VK97.js → colorPicker.fDJa_Rz5.js} +5 -5
- package/library/chunks/{confirm-popover.CQm_rVIt.js → confirm-popover.DLb5agj9.js} +3 -3
- package/library/chunks/{content-builder.D-_Ou8sw.js → content-builder.DZRw6hpX.js} +1 -1
- package/library/chunks/{dialog.0TzzxNXE.js → dialog.B1uHEUsi.js} +3 -3
- package/library/chunks/{document-viewer.Bb1M9uJ-.js → document-viewer.PHoFv8xz.js} +1460 -1414
- package/library/chunks/{dot-pagination.BwSugdZk.js → dot-pagination.171qk-p2.js} +2 -2
- package/library/chunks/{exporting.C47Rlm_F.js → exporting.Co0vJIff.js} +2 -2
- package/library/chunks/{flow.DhXYaDTn.js → flow.0ah2v6L5.js} +5 -5
- package/library/chunks/{folder-select.5f4e8jqB.js → folder-select.COFTAu2f.js} +6 -6
- package/library/chunks/{gantt.B-KoNU00.js → gantt.CPSE8Grs.js} +8 -8
- package/library/chunks/{header.BZKaF_-o.js → header.DP4ZGEwN.js} +3 -3
- package/library/chunks/{hierarchy.DZcTzpNv.js → hierarchy.Dlq2MwWz.js} +5 -5
- package/library/chunks/{hub-connection.C9j9Ce_a.js → hub-connection.CIUZJBdQ.js} +1 -1
- package/library/chunks/{i18n.C4wPyPTR.js → i18n.DYXys45m.js} +7 -3
- package/library/chunks/{icon-button.Ce2tPGuf.js → icon-button.B0L-_zT9.js} +2 -2
- package/library/chunks/{icon.-k4fR0bD.js → icon.CsF1BoUl.js} +1 -1
- package/library/chunks/{iframe.CnG8EcG1.js → iframe._3_Z5IJc.js} +7 -7
- package/library/chunks/{image.C2acLx6g.js → image.DVbY2O89.js} +3 -3
- package/library/chunks/{index.B7KpCL4Q.js → index.q6xCNzcK.js} +17 -17
- package/library/chunks/{input.BAvin1Qu.js → input.CSI9KLz7.js} +3 -3
- package/library/chunks/{json.CYp1GBUl.js → json.lgvYjT5K.js} +3 -3
- package/library/chunks/{map.DCp6R-yn.js → map.Cz4qZnZB.js} +2 -2
- package/library/chunks/{option.DT-6HmoC.js → option.BweUpygr.js} +4 -4
- package/library/chunks/{pagination.KvDdhXZL.js → pagination.CyY982g0.js} +6 -6
- package/library/chunks/{percent.C253sJzT.js → percent.TSAQO6y8.js} +3 -3
- package/library/chunks/{radar.Bh033jVx.js → radar.mnUjkEJF.js} +4 -4
- package/library/chunks/{sliceGrouper.BOB7t0KC.js → sliceGrouper.B9Hml2R8.js} +1 -1
- package/library/chunks/{stock.rKM7Pn6U.js → stock.CSGPjDQK.js} +9 -9
- package/library/chunks/{tab-group.DyInpwMz.js → tab-group.BJImZf-n.js} +4 -4
- package/library/chunks/{timeline.8Dbc5Mzg.js → timeline.CzbNFkA3.js} +5 -5
- package/library/chunks/{toString.BDhOhZPZ.js → toString.bJgZMf_C.js} +1 -1
- package/library/chunks/{toast.BYVF5TVe.js → toast.NfNkPs5d.js} +1 -1
- package/library/chunks/{tree.BpSudcAI.js → tree.CvxvKWUm.js} +176 -159
- package/library/chunks/{venn.9MIxwncF.js → venn.Cq0RJAER.js} +1 -1
- package/library/chunks/{watch.CkGTlwIo.js → watch.K-dbDP6P.js} +102 -101
- package/library/chunks/{wc.s24RZyr1.js → wc.Cae1yJ4l.js} +1 -1
- package/library/chunks/{xy.QPSrxL0Q.js → xy.CseMLD2I.js} +10 -10
- package/library/components/alert.js +3 -3
- package/library/components/am-chart.js +2 -2
- package/library/components/animated-image.js +2 -2
- package/library/components/animation.js +2 -2
- package/library/components/array-line-clamp.js +1 -1
- package/library/components/asset-link-format.js +4 -4
- package/library/components/atoms.js +20 -20
- package/library/components/audio.js +3 -3
- package/library/components/avatar.js +2 -2
- package/library/components/border-input-group.js +2 -2
- package/library/components/breadcrumb-item.js +1 -1
- package/library/components/breadcrumb.js +2 -2
- package/library/components/button.js +5 -5
- package/library/components/checkbox.js +3 -3
- package/library/components/color-picker.js +5 -5
- package/library/components/color-swatch-group.js +6 -6
- package/library/components/color-swatch.js +3 -3
- package/library/components/confirm-popover.js +4 -4
- package/library/components/copy-button.js +3 -3
- package/library/components/corner-position-input-group.js +3 -3
- package/library/components/date-calendar.js +1 -1
- package/library/components/details.js +4 -4
- package/library/components/dialog.js +4 -4
- package/library/components/diff.js +1 -1
- package/library/components/divider.js +1 -1
- package/library/components/document-viewer.js +4 -4
- package/library/components/dot-pagination.js +3 -3
- package/library/components/drawer.js +4 -4
- package/library/components/dropdown.js +3 -3
- package/library/components/dynamic-select.js +7 -7
- package/library/components/e-chart.js +2 -2
- package/library/components/element-clamp.js +3 -3
- package/library/components/file-on-demand.js +13 -13
- package/library/components/folder-select.js +6 -6
- package/library/components/format-bytes.js +1 -1
- package/library/components/format-date.js +1 -1
- package/library/components/format-number.js +1 -1
- package/library/components/format-time.js +2 -2
- package/library/components/grid-item.js +1 -1
- package/library/components/header.js +3 -3
- package/library/components/hub-connection.js +2 -2
- package/library/components/icon-button.js +3 -3
- package/library/components/icon.js +2 -2
- package/library/components/iframe.js +3 -3
- package/library/components/image-comparer.js +3 -3
- package/library/components/image.js +4 -4
- package/library/components/include.js +1 -1
- package/library/components/input.js +4 -4
- package/library/components/line-clamp.js +1 -1
- package/library/components/markdown.js +1 -1
- package/library/components/masonry.js +3 -3
- package/library/components/menu-item.js +3 -3
- package/library/components/menu.js +1 -1
- package/library/components/molecules.js +3 -3
- package/library/components/mutation-observer.js +1 -1
- package/library/components/option.js +4 -4
- package/library/components/organisms.js +2 -2
- package/library/components/padding-input-group.js +1 -1
- package/library/components/pagination.js +7 -7
- package/library/components/popup.js +1 -1
- package/library/components/position-picker.js +1 -1
- package/library/components/progress-bar.js +1 -1
- package/library/components/progress-ring.js +1 -1
- package/library/components/qr-code.js +1 -1
- package/library/components/radio-button.js +2 -2
- package/library/components/radio-card.js +1 -1
- package/library/components/radio-group.js +1 -1
- package/library/components/radio.js +2 -2
- package/library/components/range.js +2 -2
- package/library/components/rating.js +3 -3
- package/library/components/relative-time.js +1 -1
- package/library/components/resize-observer.js +1 -1
- package/library/components/select.js +4 -4
- package/library/components/shadow-input-group.js +1 -1
- package/library/components/share-option-list.js +3 -3
- package/library/components/sidebar.js +3 -3
- package/library/components/size-input-group.js +4 -4
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +2 -2
- package/library/components/step.js +1 -1
- package/library/components/stepper-wizard.js +1 -1
- package/library/components/stepper.js +1 -1
- package/library/components/switch.js +2 -2
- package/library/components/tab-group.js +5 -5
- package/library/components/tab-panel.js +1 -1
- package/library/components/tab.js +4 -4
- package/library/components/tag.js +2 -2
- package/library/components/textarea.js +1 -1
- package/library/components/timecode.js +1 -1
- package/library/components/tooltip.js +3 -3
- package/library/components/tree-item.js +5 -5
- package/library/components/tree.js +3 -3
- package/library/components/typeface.js +8 -8
- package/library/components/types.js +52 -48
- package/library/components/video.js +3 -3
- package/library/css/ol-base.css +3 -3
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/tree/tree.d.ts +13 -0
- package/library/packages/hybrid/book-reader/src/react/constant.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/useBookEvents.d.ts +1 -1
- package/library/packages/hybrid/book-reader/src/react/hooks/useRestoreFocusOnClose.d.ts +8 -0
- package/library/packages/hybrid/table-core/src/table/controllers/filter-controller.d.ts +10 -0
- package/library/packages/hybrid/table-core/src/table/controllers/select-all-controller.d.ts +12 -0
- package/library/packages/hybrid/table-core/src/table/table.d.ts +13 -0
- package/library/packages/organisms/src/content-builder/plugins/rich-text-editor/components/rte-bubble-menu/rte-bubble-menu.d.ts +1 -1
- package/library/packages/organisms/src/content-builder/plugins/rich-text-editor/constant.d.ts +2 -2
- package/library/packages/types/src/table.d.ts +9 -0
- package/library/packages/utils/src/custom-element/i18n.d.ts +4 -0
- package/library/utils.js +4 -4
- package/package.json +1 -1
- package/library/assets/validation.worker-Dc_pkZlD.js +0 -1
- package/library/chunks/button.styles.CATjjP1T.js +0 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { C as R, n as l } from "./lib-cortex-element.CVMmyPMC.js";
|
|
2
2
|
import { c as N } from "./component.styles.CRO4Odto.js";
|
|
3
3
|
import { c as G } from "./custom-element.L4WJXn1j.js";
|
|
4
|
-
import { L as M } from "./i18n.
|
|
4
|
+
import { L as M } from "./i18n.DYXys45m.js";
|
|
5
5
|
import { c as K } from "./math.DuKzLacZ.js";
|
|
6
|
-
import { w as f } from "./watch.
|
|
7
|
-
import { i as
|
|
6
|
+
import { w as f } from "./watch.K-dbDP6P.js";
|
|
7
|
+
import { i as H, x as b, E as L } from "./lit-element.jLBm65_O.js";
|
|
8
8
|
import { r as y } from "./state.CSDxrqLd.js";
|
|
9
9
|
import { e as x } from "./query.BBf1UFkC.js";
|
|
10
10
|
import { s as U, a as z, b as $ } from "./event.BeKOsirN.js";
|
|
@@ -12,18 +12,18 @@ import { e as C } from "./class-map.BiVq-cVR.js";
|
|
|
12
12
|
import { o as E } from "./if-defined.BRoBj_Rp.js";
|
|
13
13
|
import { l as W } from "./live.DCegntDo.js";
|
|
14
14
|
import { n as S } from "./when.Dr1es41R.js";
|
|
15
|
-
import { g as P, s as
|
|
16
|
-
import { C as Y } from "./checkbox.
|
|
17
|
-
import { C as J } from "./icon
|
|
15
|
+
import { g as P, s as Z } from "./animation-registry.HmpwNuGH.js";
|
|
16
|
+
import { C as Y } from "./checkbox.aQnF4Zc3.js";
|
|
17
|
+
import { C as J } from "./icon.CsF1BoUl.js";
|
|
18
18
|
import Q from "../components/line-clamp.js";
|
|
19
19
|
import ee from "../components/spinner.js";
|
|
20
20
|
import { i as te } from "./browser.BHOCIF_A.js";
|
|
21
21
|
import { S as ie } from "./sortable.esm.oSzf6C5Q.js";
|
|
22
22
|
function ne(e, t, i) {
|
|
23
23
|
let n;
|
|
24
|
-
return function(...
|
|
25
|
-
const
|
|
26
|
-
n = null, e.apply(
|
|
24
|
+
return function(...s) {
|
|
25
|
+
const o = this, d = function() {
|
|
26
|
+
n = null, e.apply(o, s);
|
|
27
27
|
};
|
|
28
28
|
n && clearTimeout(n), n = window.setTimeout(d, t);
|
|
29
29
|
};
|
|
@@ -31,30 +31,30 @@ function ne(e, t, i) {
|
|
|
31
31
|
const p = [];
|
|
32
32
|
for (let e = 0; e < 256; ++e)
|
|
33
33
|
p.push((e + 256).toString(16).slice(1));
|
|
34
|
-
function
|
|
34
|
+
function oe(e, t = 0) {
|
|
35
35
|
return (p[e[t + 0]] + p[e[t + 1]] + p[e[t + 2]] + p[e[t + 3]] + "-" + p[e[t + 4]] + p[e[t + 5]] + "-" + p[e[t + 6]] + p[e[t + 7]] + "-" + p[e[t + 8]] + p[e[t + 9]] + "-" + p[e[t + 10]] + p[e[t + 11]] + p[e[t + 12]] + p[e[t + 13]] + p[e[t + 14]] + p[e[t + 15]]).toLowerCase();
|
|
36
36
|
}
|
|
37
|
-
let
|
|
38
|
-
const
|
|
39
|
-
function
|
|
40
|
-
if (!
|
|
37
|
+
let w;
|
|
38
|
+
const ae = new Uint8Array(16);
|
|
39
|
+
function se() {
|
|
40
|
+
if (!w) {
|
|
41
41
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
42
42
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
43
|
-
|
|
43
|
+
w = crypto.getRandomValues.bind(crypto);
|
|
44
44
|
}
|
|
45
|
-
return
|
|
45
|
+
return w(ae);
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const re = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), F = { randomUUID: re };
|
|
48
48
|
function le(e, t, i) {
|
|
49
49
|
if (F.randomUUID && !e)
|
|
50
50
|
return F.randomUUID();
|
|
51
51
|
e = e || {};
|
|
52
|
-
const n = e.random ?? e.rng?.() ??
|
|
52
|
+
const n = e.random ?? e.rng?.() ?? se();
|
|
53
53
|
if (n.length < 16)
|
|
54
54
|
throw new Error("Random bytes length must be >= 16");
|
|
55
|
-
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128,
|
|
55
|
+
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, oe(n);
|
|
56
56
|
}
|
|
57
|
-
const de =
|
|
57
|
+
const de = H`:host{--selected-color:var(--cx-color-primary-600);--selected-background-color:var(--cx-color-primary-50);--hover-background-color:var(--cx-menu-item-background-color-hover);--active-background-color:var(--cx-color-neutral-200);--item-padding:var(--cx-spacing-2x-small) var(--cx-spacing-x-small);outline:0;display:block}:host(:focus-visible) .tree-item{outline:var(--cx-focus-ring);outline-offset:calc(-1 * var(--cx-focus-ring-width))}[hidden]{display:none!important}slot:not([name])::slotted(cx-icon){margin-inline-end:var(--cx-spacing-x-small)}.tree-item{color:var(--cx-color-neutral);cursor:pointer;-webkit-user-select:none;user-select:none;flex-direction:column;align-items:stretch;display:flex;position:relative}.tree-item__checkbox{margin-inline-end:var(--cx-spacing-x-small)}.tree-item__expand-button,.tree-item__checkbox,.tree-item__label{font-family:var(--cx-font-sans);font-size:var(--cx-tree-item-font-size,var(--cx-font-size-small));font-weight:var(--cx-tree-item-font-weight,var(--cx-font-weight-medium));line-height:var(--cx-tree-item-line-height,var(--cx-line-height-large));letter-spacing:var(--cx-tree-item-letter-spacing,var(--cx-letter-spacing-normal))}.tree-item__checkbox::part(base){align-items:center;display:flex}.tree-item__checkbox::part(label){margin-inline-start:0}.tree-item__indentation{flex-shrink:0;width:1em;display:block}.tree-item__expand-spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.tree-item__expand-button{box-sizing:content-box;color:var(--cx-color-neutral-500);cursor:pointer;min-width:max(1em,1rem);min-height:max(1em,1rem);transition:var(--cx-transition-medium) rotate ease;flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative}.tree-item--expanded .tree-item__expand-button{rotate:90deg}.tree-item--expanded.tree-item--rtl .tree-item__expand-button{rotate:-90deg}.tree-item--expanded slot[name=expand-icon],.tree-item:not(.tree-item--expanded) slot[name=collapse-icon]{display:none}:host(:not([aria-disabled=true])) .tree-item--selected .tree-item__item .tree-item__expand-icon-slot{color:var(--selected-color)}.tree-item:not(.tree-item--has-expand-button) .tree-item__expand-icon-slot{visibility:hidden;opacity:0;pointer-events:none}.tree-item__expand-button--visible{cursor:pointer}.tree-item__item{border-radius:var(--cx-border-radius-large);padding:var(--item-padding,var(--cx-spacing-x-small) var(--cx-spacing-small));transition:var(--cx-transition-x-fast) background-color ease;align-items:center;display:flex}.tree-item__item:hover{background-color:var(--hover-background-color)}.tree-item__item:active{background-color:var(--active-background-color)}.tree-item--disabled .tree-item__item{opacity:.5;cursor:default;outline:none}:host(:not([aria-disabled=true])) .tree-item--selected .tree-item__item{background-color:var(--selected-background-color);color:var(--selected-color)}:host(:not([aria-disabled=true])) .tree-item__expand-button{color:var(--cx-color-neutral)}:host(:not([aria-disabled=true])) .tree-item--selected,:host(:not([aria-disabled=true])) .tree-item--selected .tree-item__expand-button,:host(:not([aria-disabled=true])) .tree-item--selected .tree-item__actions::slotted(cx-icon-button){color:var(--cx-color-neutral-0)}:host(:not([aria-disabled=true])) .tree-item--selected .tree-item__actions::slotted(cx-icon-button){--hover-background-color:var(--cx-color-neutral-0)}.tree-item__label{align-items:center;display:flex}.tree-item__actions{font-size:var(--cx-font-size-medium);align-items:center;width:fit-content;margin-inline-start:auto;display:flex}.tree-item__actions::slotted(*){visibility:hidden;opacity:0;transition:var(--cx-transition-x-fast) visibility, var(--cx-transition-x-fast) opacity ease}.tree-item__item:hover .tree-item__actions::slotted(*){visibility:visible;opacity:1}@supports not (overlay:auto){.tree-item__actions::slotted(cx-dropdown[open]){visibility:visible;opacity:1}}.tree-item__children{font-size:calc(1em + var(--indent-size,var(--cx-spacing-medium)));gap:var(--children-gap,0);flex-direction:column;display:flex}@media (forced-colors:active){:host(:not([aria-disabled=true])) .tree-item--selected .tree-item__item{outline:1px dashed selecteditem}}::slotted(cx-tree-item){--hover-background-color:inherit;--active-background-color:inherit;--selected-background-color:inherit;--selected-color:inherit}:host([data-dragging]){position:relative}:host([data-dragging=inside]){background-color:var(--cx-color-primary-400)}:host([data-dragging=before]):before{content:"";border-top:var(--cx-spacing-2x-small) solid var(--cx-color-primary-400);width:100%;position:absolute;top:0;left:0}:host([data-dragging=after]):before{content:"";border-bottom:var(--cx-spacing-2x-small) solid var(--cx-color-primary-400);width:100%;position:absolute;bottom:0;left:0}`, k = "tree-sortable", I = 0.2, O = (e) => e == null;
|
|
58
58
|
function ce() {
|
|
59
59
|
function e() {
|
|
60
60
|
}
|
|
@@ -72,8 +72,8 @@ function ce() {
|
|
|
72
72
|
dragOverValid({
|
|
73
73
|
activeSortable: i,
|
|
74
74
|
cancel: n,
|
|
75
|
-
changed:
|
|
76
|
-
completed:
|
|
75
|
+
changed: s,
|
|
76
|
+
completed: o,
|
|
77
77
|
dragEl: d,
|
|
78
78
|
originalEvent: m,
|
|
79
79
|
putSortable: g,
|
|
@@ -88,17 +88,17 @@ function ce() {
|
|
|
88
88
|
n();
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
const T = B.getBoundingClientRect(),
|
|
91
|
+
const T = B.getBoundingClientRect(), D = (m.clientY - T.top) / T.height, _ = g || this.sortable;
|
|
92
92
|
_.captureAnimationState(), _ !== i && i.captureAnimationState();
|
|
93
93
|
const V = u.parentNode;
|
|
94
94
|
if (d && V)
|
|
95
|
-
if (
|
|
95
|
+
if (D < i.options.insertBeforeZonePercentage)
|
|
96
96
|
t = {
|
|
97
97
|
dragEl: d,
|
|
98
98
|
el: u,
|
|
99
99
|
position: -1
|
|
100
100
|
}, u.setAttribute("data-dragging", "before");
|
|
101
|
-
else if (
|
|
101
|
+
else if (D > i.options.insertAfterZonePercentage)
|
|
102
102
|
t = {
|
|
103
103
|
dragEl: d,
|
|
104
104
|
el: u,
|
|
@@ -106,7 +106,7 @@ function ce() {
|
|
|
106
106
|
}, u.setAttribute("data-dragging", "after");
|
|
107
107
|
else {
|
|
108
108
|
if (u.hasAttribute("no-drag-inside")) {
|
|
109
|
-
|
|
109
|
+
s(), o(!0), n();
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
112
|
t = {
|
|
@@ -116,7 +116,7 @@ function ce() {
|
|
|
116
116
|
}, u.setAttribute("data-dragging", "inside");
|
|
117
117
|
}
|
|
118
118
|
if (_.animateAll(), _ !== i && i.animateAll(), t)
|
|
119
|
-
|
|
119
|
+
s(), o(!0), n();
|
|
120
120
|
else
|
|
121
121
|
return !0;
|
|
122
122
|
},
|
|
@@ -124,7 +124,7 @@ function ce() {
|
|
|
124
124
|
cancel: i,
|
|
125
125
|
dragEl: n
|
|
126
126
|
}) {
|
|
127
|
-
if (n && !
|
|
127
|
+
if (n && !a.isTreeItem(n)) {
|
|
128
128
|
i();
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
@@ -156,8 +156,8 @@ const j = (e) => ({
|
|
|
156
156
|
fallbackOnBody: !0,
|
|
157
157
|
forceFallback: te(),
|
|
158
158
|
getDropZone: (t) => t?.shadowRoot?.querySelector(".tree-item__item"),
|
|
159
|
-
insertAfterZonePercentage: 1 -
|
|
160
|
-
insertBeforeZonePercentage:
|
|
159
|
+
insertAfterZonePercentage: 1 - I,
|
|
160
|
+
insertBeforeZonePercentage: I,
|
|
161
161
|
invertSwap: !0,
|
|
162
162
|
onStart(t) {
|
|
163
163
|
if (e.onStart?.(t), t.item.tagName === "CX-TREE-ITEM") {
|
|
@@ -166,14 +166,14 @@ const j = (e) => ({
|
|
|
166
166
|
}
|
|
167
167
|
},
|
|
168
168
|
[k]: !0,
|
|
169
|
-
swapThreshold:
|
|
169
|
+
swapThreshold: I
|
|
170
170
|
});
|
|
171
|
-
var he = Object.defineProperty, pe = Object.getOwnPropertyDescriptor,
|
|
172
|
-
for (var
|
|
173
|
-
(d = e[
|
|
174
|
-
return n &&
|
|
171
|
+
var he = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, r = (e, t, i, n) => {
|
|
172
|
+
for (var s = n > 1 ? void 0 : n ? pe(t, i) : t, o = e.length - 1, d; o >= 0; o--)
|
|
173
|
+
(d = e[o]) && (s = (n ? d(t, i, s) : d(s)) || s);
|
|
174
|
+
return n && s && he(t, i, s), s;
|
|
175
175
|
};
|
|
176
|
-
let
|
|
176
|
+
let a = class extends R {
|
|
177
177
|
constructor() {
|
|
178
178
|
super(), this.localize = new M(this), this.expanded = !1, this.selected = !1, this.disabled = !1, this.readonly = !1, this.lazy = !1, this.href = "", this.rel = "noreferrer noopener", this.itemId = "", this.sortable = !1, this.noDrag = !1, this.noSelect = !1, this.noDragInside = !1, this.sortableGroup = void 0, this.expandButtonPlacement = "start", this.noForwardExpandButtonPlacement = !1, this.disabledSyncCheckboxes = !1, this.partialSyncCheckboxes = !1, this.previouslySelected = !1, this.focusable = !1, this.maxLines = -1, this.indeterminate = !1, this.isLeaf = !1, this.loading = !1, this.selectable = !1, this.sortableInstance = null, this.onDragStart = (e) => {
|
|
179
179
|
if (e.dataTransfer) {
|
|
@@ -207,7 +207,7 @@ let o = class extends R {
|
|
|
207
207
|
// Checks whether the item is nested into an item
|
|
208
208
|
isNestedItem() {
|
|
209
209
|
const e = this.parentElement;
|
|
210
|
-
return !!e &&
|
|
210
|
+
return !!e && a.isTreeItem(e);
|
|
211
211
|
}
|
|
212
212
|
/**
|
|
213
213
|
* Wait for this item to be fully updated before processing the slot change.
|
|
@@ -259,7 +259,7 @@ let o = class extends R {
|
|
|
259
259
|
includeDisabled: e = !0
|
|
260
260
|
} = {}) {
|
|
261
261
|
return this.childrenSlot ? [...this.childrenSlot.assignedElements({ flatten: !0 })].filter(
|
|
262
|
-
(t) =>
|
|
262
|
+
(t) => a.isTreeItem(t) && (e || !t.disabled)
|
|
263
263
|
) : [];
|
|
264
264
|
}
|
|
265
265
|
renderExpandButton() {
|
|
@@ -340,7 +340,7 @@ let o = class extends R {
|
|
|
340
340
|
"><div class="tree-item__indentation" part="indentation"></div>${S(
|
|
341
341
|
this.expandButtonPlacement === "start",
|
|
342
342
|
this.renderExpandButton,
|
|
343
|
-
() =>
|
|
343
|
+
() => L
|
|
344
344
|
)}
|
|
345
345
|
${S(
|
|
346
346
|
this.selectable,
|
|
@@ -362,165 +362,165 @@ let o = class extends R {
|
|
|
362
362
|
)}<slot class="tree-item__actions" part="actions" name="actions"></slot>${S(
|
|
363
363
|
this.expandButtonPlacement === "end",
|
|
364
364
|
this.renderExpandButton,
|
|
365
|
-
() =>
|
|
365
|
+
() => L
|
|
366
366
|
)}</div><div class="tree-item__children" part="children" role="group"><slot name="children" @slotchange=${this.handleChildrenSlotChange}></slot></div>`);
|
|
367
367
|
}
|
|
368
368
|
};
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
a.styles = [N, de];
|
|
370
|
+
a.dependencies = {
|
|
371
371
|
"cx-checkbox": Y,
|
|
372
372
|
"cx-icon": J,
|
|
373
373
|
"cx-line-clamp": Q,
|
|
374
374
|
"cx-spinner": ee
|
|
375
375
|
};
|
|
376
|
-
|
|
376
|
+
r([
|
|
377
377
|
x("slot:not([name])")
|
|
378
|
-
],
|
|
379
|
-
|
|
378
|
+
], a.prototype, "defaultSlot", 2);
|
|
379
|
+
r([
|
|
380
380
|
x("slot[name=children]")
|
|
381
|
-
],
|
|
382
|
-
|
|
381
|
+
], a.prototype, "childrenSlot", 2);
|
|
382
|
+
r([
|
|
383
383
|
x(".tree-item__item")
|
|
384
|
-
],
|
|
385
|
-
|
|
384
|
+
], a.prototype, "itemElement", 2);
|
|
385
|
+
r([
|
|
386
386
|
x(".tree-item__children")
|
|
387
|
-
],
|
|
388
|
-
|
|
387
|
+
], a.prototype, "childrenContainer", 2);
|
|
388
|
+
r([
|
|
389
389
|
x(".tree-item__expand-button slot")
|
|
390
|
-
],
|
|
391
|
-
|
|
390
|
+
], a.prototype, "expandButtonSlot", 2);
|
|
391
|
+
r([
|
|
392
392
|
l({ reflect: !0, type: Boolean })
|
|
393
|
-
],
|
|
394
|
-
|
|
393
|
+
], a.prototype, "expanded", 2);
|
|
394
|
+
r([
|
|
395
395
|
l({ reflect: !0, type: Boolean })
|
|
396
|
-
],
|
|
397
|
-
|
|
396
|
+
], a.prototype, "selected", 2);
|
|
397
|
+
r([
|
|
398
398
|
l({ reflect: !0, type: Boolean })
|
|
399
|
-
],
|
|
400
|
-
|
|
399
|
+
], a.prototype, "disabled", 2);
|
|
400
|
+
r([
|
|
401
401
|
l({ reflect: !0, type: Boolean })
|
|
402
|
-
],
|
|
403
|
-
|
|
402
|
+
], a.prototype, "readonly", 2);
|
|
403
|
+
r([
|
|
404
404
|
l({ reflect: !0, type: Boolean })
|
|
405
|
-
],
|
|
406
|
-
|
|
405
|
+
], a.prototype, "lazy", 2);
|
|
406
|
+
r([
|
|
407
407
|
l()
|
|
408
|
-
],
|
|
409
|
-
|
|
408
|
+
], a.prototype, "href", 2);
|
|
409
|
+
r([
|
|
410
410
|
l()
|
|
411
|
-
],
|
|
412
|
-
|
|
411
|
+
], a.prototype, "target", 2);
|
|
412
|
+
r([
|
|
413
413
|
l()
|
|
414
|
-
],
|
|
415
|
-
|
|
414
|
+
], a.prototype, "rel", 2);
|
|
415
|
+
r([
|
|
416
416
|
l()
|
|
417
|
-
],
|
|
418
|
-
|
|
417
|
+
], a.prototype, "download", 2);
|
|
418
|
+
r([
|
|
419
419
|
l({ attribute: "itemid", reflect: !0, type: String })
|
|
420
|
-
],
|
|
421
|
-
|
|
420
|
+
], a.prototype, "itemId", 2);
|
|
421
|
+
r([
|
|
422
422
|
l({ reflect: !0, type: Boolean })
|
|
423
|
-
],
|
|
424
|
-
|
|
423
|
+
], a.prototype, "sortable", 2);
|
|
424
|
+
r([
|
|
425
425
|
l({ attribute: "no-drag", reflect: !0, type: Boolean })
|
|
426
|
-
],
|
|
427
|
-
|
|
426
|
+
], a.prototype, "noDrag", 2);
|
|
427
|
+
r([
|
|
428
428
|
l({ attribute: "no-select", reflect: !0, type: Boolean })
|
|
429
|
-
],
|
|
430
|
-
|
|
429
|
+
], a.prototype, "noSelect", 2);
|
|
430
|
+
r([
|
|
431
431
|
l({ attribute: "no-drag-inside", reflect: !0, type: Boolean })
|
|
432
|
-
],
|
|
433
|
-
|
|
432
|
+
], a.prototype, "noDragInside", 2);
|
|
433
|
+
r([
|
|
434
434
|
l({ attribute: "sortable-group", type: String })
|
|
435
|
-
],
|
|
436
|
-
|
|
435
|
+
], a.prototype, "sortableGroup", 2);
|
|
436
|
+
r([
|
|
437
437
|
l({
|
|
438
438
|
attribute: "expand-button-placement",
|
|
439
439
|
reflect: !0,
|
|
440
440
|
type: String
|
|
441
441
|
})
|
|
442
|
-
],
|
|
443
|
-
|
|
442
|
+
], a.prototype, "expandButtonPlacement", 2);
|
|
443
|
+
r([
|
|
444
444
|
l({ attribute: "no-forward-expand-button-placement", type: Boolean })
|
|
445
|
-
],
|
|
446
|
-
|
|
445
|
+
], a.prototype, "noForwardExpandButtonPlacement", 2);
|
|
446
|
+
r([
|
|
447
447
|
l({
|
|
448
448
|
attribute: "disabled-sync-checkboxes",
|
|
449
449
|
reflect: !0,
|
|
450
450
|
type: Boolean
|
|
451
451
|
})
|
|
452
|
-
],
|
|
453
|
-
|
|
452
|
+
], a.prototype, "disabledSyncCheckboxes", 2);
|
|
453
|
+
r([
|
|
454
454
|
l({
|
|
455
455
|
attribute: "partial-sync-checkboxes",
|
|
456
456
|
reflect: !0,
|
|
457
457
|
type: Boolean
|
|
458
458
|
})
|
|
459
|
-
],
|
|
460
|
-
|
|
459
|
+
], a.prototype, "partialSyncCheckboxes", 2);
|
|
460
|
+
r([
|
|
461
461
|
l({ attribute: "previously-selected", reflect: !0, type: Boolean })
|
|
462
|
-
],
|
|
463
|
-
|
|
462
|
+
], a.prototype, "previouslySelected", 2);
|
|
463
|
+
r([
|
|
464
464
|
l({ reflect: !0, type: Boolean })
|
|
465
|
-
],
|
|
466
|
-
|
|
465
|
+
], a.prototype, "focusable", 2);
|
|
466
|
+
r([
|
|
467
467
|
l({ attribute: "max-lines", type: Number })
|
|
468
|
-
],
|
|
469
|
-
|
|
468
|
+
], a.prototype, "maxLines", 2);
|
|
469
|
+
r([
|
|
470
470
|
y()
|
|
471
|
-
],
|
|
472
|
-
|
|
471
|
+
], a.prototype, "indeterminate", 2);
|
|
472
|
+
r([
|
|
473
473
|
y()
|
|
474
|
-
],
|
|
475
|
-
|
|
474
|
+
], a.prototype, "isLeaf", 2);
|
|
475
|
+
r([
|
|
476
476
|
y()
|
|
477
|
-
],
|
|
478
|
-
|
|
477
|
+
], a.prototype, "loading", 2);
|
|
478
|
+
r([
|
|
479
479
|
y()
|
|
480
|
-
],
|
|
481
|
-
|
|
480
|
+
], a.prototype, "selectable", 2);
|
|
481
|
+
r([
|
|
482
482
|
y()
|
|
483
|
-
],
|
|
484
|
-
|
|
483
|
+
], a.prototype, "sortableInstance", 2);
|
|
484
|
+
r([
|
|
485
485
|
f("loading", { waitUntilFirstUpdate: !0 })
|
|
486
|
-
],
|
|
487
|
-
|
|
486
|
+
], a.prototype, "handleLoadingChange", 1);
|
|
487
|
+
r([
|
|
488
488
|
f("disabled")
|
|
489
|
-
],
|
|
490
|
-
|
|
489
|
+
], a.prototype, "handleDisabledChange", 1);
|
|
490
|
+
r([
|
|
491
491
|
f("selected")
|
|
492
|
-
],
|
|
493
|
-
|
|
492
|
+
], a.prototype, "handleSelectedChange", 1);
|
|
493
|
+
r([
|
|
494
494
|
f("expanded", { waitUntilFirstUpdate: !0 })
|
|
495
|
-
],
|
|
496
|
-
|
|
495
|
+
], a.prototype, "handleExpandedChange", 1);
|
|
496
|
+
r([
|
|
497
497
|
f("expanded", { waitUntilFirstUpdate: !0 })
|
|
498
|
-
],
|
|
499
|
-
|
|
498
|
+
], a.prototype, "handleExpandAnimation", 1);
|
|
499
|
+
r([
|
|
500
500
|
f("lazy", { waitUntilFirstUpdate: !0 })
|
|
501
|
-
],
|
|
502
|
-
|
|
501
|
+
], a.prototype, "handleLazyChange", 1);
|
|
502
|
+
a = r([
|
|
503
503
|
G("cx-tree-item")
|
|
504
|
-
],
|
|
505
|
-
|
|
504
|
+
], a);
|
|
505
|
+
Z("tree-item.expand", {
|
|
506
506
|
keyframes: [
|
|
507
507
|
{ height: "0", opacity: "0", overflow: "hidden" },
|
|
508
508
|
{ height: "auto", opacity: "1", overflow: "hidden" }
|
|
509
509
|
],
|
|
510
510
|
options: { duration: 250, easing: "cubic-bezier(0.4, 0.0, 0.2, 1)" }
|
|
511
511
|
});
|
|
512
|
-
|
|
512
|
+
Z("tree-item.collapse", {
|
|
513
513
|
keyframes: [
|
|
514
514
|
{ height: "auto", opacity: "1", overflow: "hidden" },
|
|
515
515
|
{ height: "0", opacity: "0", overflow: "hidden" }
|
|
516
516
|
],
|
|
517
517
|
options: { duration: 200, easing: "cubic-bezier(0.4, 0.0, 0.2, 1)" }
|
|
518
518
|
});
|
|
519
|
-
const ue =
|
|
519
|
+
const ue = H`:host{--indent-guide-color:var(--cx-color-neutral-200);--indent-guide-offset:0;--indent-guide-style:solid;--indent-guide-width:0;--indent-size:var(--cx-spacing-large);font-size:0;display:block}:host::part(children){gap:var(--children-gap,0);flex-direction:column;display:flex}:host([dragging]) ::slotted(cx-tree-item){--hover-background-color:transparent!important;--active-background-color:transparent!important;--selected-background-color:transparent!important}`;
|
|
520
520
|
var me = Object.defineProperty, be = Object.getOwnPropertyDescriptor, h = (e, t, i, n) => {
|
|
521
|
-
for (var
|
|
522
|
-
(d = e[
|
|
523
|
-
return n &&
|
|
521
|
+
for (var s = n > 1 ? void 0 : n ? be(t, i) : t, o = e.length - 1, d; o >= 0; o--)
|
|
522
|
+
(d = e[o]) && (s = (n ? d(t, i, s) : d(s)) || s);
|
|
523
|
+
return n && s && me(t, i, s), s;
|
|
524
524
|
};
|
|
525
525
|
function q(e) {
|
|
526
526
|
const t = e.getChildrenItems({ includeDisabled: !1 });
|
|
@@ -528,33 +528,33 @@ function q(e) {
|
|
|
528
528
|
const i = t.every((d) => d.selected), n = t.every(
|
|
529
529
|
(d) => !d.selected && !d.indeterminate
|
|
530
530
|
);
|
|
531
|
-
let
|
|
532
|
-
(!i && !n || e.partialSyncCheckboxes && (i || n && e.previouslySelected)) && (
|
|
531
|
+
let s = !1, o = !1;
|
|
532
|
+
(!i && !n || e.partialSyncCheckboxes && (i || n && e.previouslySelected)) && (s = !0), e.partialSyncCheckboxes ? o = i && !s : o = i, e.indeterminate = s, e.selected = o;
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
function X(e, t = "single") {
|
|
536
536
|
const i = e.parentElement;
|
|
537
|
-
|
|
537
|
+
a.isTreeItem(i) && !i.disabledSyncCheckboxes && t === "multiple" && (q(i), X(i, t));
|
|
538
538
|
}
|
|
539
539
|
function A(e, t = !1, i = "single") {
|
|
540
|
-
function n(
|
|
541
|
-
if (!(!(
|
|
542
|
-
for (const
|
|
543
|
-
|
|
544
|
-
t && q(
|
|
540
|
+
function n(s) {
|
|
541
|
+
if (!(!(s instanceof a) && s.getAttribute("role") !== "treeitem")) {
|
|
542
|
+
for (const o of s.getChildrenItems())
|
|
543
|
+
o.selected = t ? s.selected || o.selected : !o.disabled && !o.readonly && s.selected, n(o);
|
|
544
|
+
t && q(s);
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
!e.disabledSyncCheckboxes && i === "multiple" && (e.partialSyncCheckboxes && (e.selected ? e.previouslySelected = !0 : e.previouslySelected = !1), n(e)), X(e, i);
|
|
548
548
|
}
|
|
549
549
|
let c = class extends R {
|
|
550
550
|
constructor() {
|
|
551
|
-
super(), this.sortable = !1, this.sortableGroup = null, this.disabledSortableGroup = !1, this.selection = "single", this.disabledAutoExpand = !1, this.autoExpandToSelected = !1, this.expandButtonPlacement = "start", this.noForwardExpandButtonPlacement = !1, this.forceOnChange = !1, this.labelSelectSingle = !1, this.noDragInside = !1, this.focusable = !1, this.clickTarget = null, this.localize = new M(this), this.sortableInstance = null, this.handleSortableUpdate = this.handleSortableUpdate.bind(this), this.handleSortableStart = this.handleSortableStart.bind(this), this.handleSortableEnd = this.handleSortableEnd.bind(this), this.handleFocusIn = this.handleFocusIn.bind(this), this.handleFocusOut = this.handleFocusOut.bind(this), this.handleSlotChange = this.handleSlotChange.bind(this), this.handleTreeChanged = this.handleTreeChanged.bind(this), this.initTreeItem = this.initTreeItem.bind(this);
|
|
551
|
+
super(), this.sortable = !1, this.sortableGroup = null, this.disabledSortableGroup = !1, this.selection = "single", this.disabledAutoExpand = !1, this.autoExpandToSelected = !1, this.expandButtonPlacement = "start", this.noForwardExpandButtonPlacement = !1, this.forceOnChange = !1, this.labelSelectSingle = !1, this.noDragInside = !1, this.focusable = !1, this.clickTarget = null, this.localize = new M(this), this.sortableInstance = null, this.handleSortableUpdate = this.handleSortableUpdate.bind(this), this.handleSortableStart = this.handleSortableStart.bind(this), this.handleSortableEnd = this.handleSortableEnd.bind(this), this.handleFocusIn = this.handleFocusIn.bind(this), this.handleFocusOut = this.handleFocusOut.bind(this), this.handleHostMouseDown = this.handleHostMouseDown.bind(this), this.handleSlotChange = this.handleSlotChange.bind(this), this.handleTreeChanged = this.handleTreeChanged.bind(this), this.initTreeItem = this.initTreeItem.bind(this);
|
|
552
552
|
}
|
|
553
553
|
runFirstUpdated() {
|
|
554
554
|
this.setAttribute("role", "tree"), this.setAttribute("tabindex", "0");
|
|
555
555
|
}
|
|
556
556
|
runConnectedCallback() {
|
|
557
|
-
if (this.addEventListener("focusin", this.handleFocusIn), this.addEventListener("focusout", this.handleFocusOut), this.addEventListener("cx-lazy-change", this.handleSlotChange), this.mutationObserver = new MutationObserver(this.handleTreeChanged), this.mutationObserver.observe(this, { childList: !0, subtree: !0 }), this.autoExpandToSelected) {
|
|
557
|
+
if (this.addEventListener("focusin", this.handleFocusIn), this.addEventListener("focusout", this.handleFocusOut), this.addEventListener("mousedown", this.handleHostMouseDown), this.addEventListener("cx-lazy-change", this.handleSlotChange), this.mutationObserver = new MutationObserver(this.handleTreeChanged), this.mutationObserver.observe(this, { childList: !0, subtree: !0 }), this.autoExpandToSelected) {
|
|
558
558
|
const e = ne(() => {
|
|
559
559
|
customElements.whenDefined("cx-tree-item").then(() => {
|
|
560
560
|
this.selectedItems.forEach((t) => {
|
|
@@ -572,7 +572,7 @@ let c = class extends R {
|
|
|
572
572
|
this.hasUpdated && this.sortable && this.initSortable();
|
|
573
573
|
}
|
|
574
574
|
disconnectedCallback() {
|
|
575
|
-
super.disconnectedCallback(), this.removeEventListener("focusin", this.handleFocusIn), this.removeEventListener("focusout", this.handleFocusOut), this.removeEventListener("cx-lazy-change", this.handleSlotChange), this.mutationObserver?.disconnect(), this.autoExpandObserver?.disconnect(), this.destroySortable();
|
|
575
|
+
super.disconnectedCallback(), this.removeEventListener("focusin", this.handleFocusIn), this.removeEventListener("focusout", this.handleFocusOut), this.removeEventListener("mousedown", this.handleHostMouseDown), this.removeEventListener("cx-lazy-change", this.handleSlotChange), this.mutationObserver?.disconnect(), this.autoExpandObserver?.disconnect(), this.destroySortable();
|
|
576
576
|
}
|
|
577
577
|
/**
|
|
578
578
|
* Generates a clone of the expand icon element to use for each tree item
|
|
@@ -582,7 +582,7 @@ let c = class extends R {
|
|
|
582
582
|
if (i) {
|
|
583
583
|
const n = i.cloneNode(!0);
|
|
584
584
|
return [n, ...n.querySelectorAll("[id]")].forEach(
|
|
585
|
-
(
|
|
585
|
+
(s) => s.removeAttribute("id")
|
|
586
586
|
), n.setAttribute("data-default", ""), n.slot = `${e}-icon`, n;
|
|
587
587
|
}
|
|
588
588
|
return null;
|
|
@@ -602,9 +602,9 @@ let c = class extends R {
|
|
|
602
602
|
handleTreeChanged(e) {
|
|
603
603
|
for (const t of e) {
|
|
604
604
|
const i = [...t.addedNodes].filter(
|
|
605
|
-
|
|
605
|
+
a.isTreeItem
|
|
606
606
|
), n = [...t.removedNodes].filter(
|
|
607
|
-
|
|
607
|
+
a.isTreeItem
|
|
608
608
|
);
|
|
609
609
|
i.forEach(this.initTreeItem), this.lastFocusedItem && n.includes(this.lastFocusedItem) && (this.lastFocusedItem = null);
|
|
610
610
|
}
|
|
@@ -619,18 +619,18 @@ let c = class extends R {
|
|
|
619
619
|
const i = [...this.selectedItems], n = this.getAllTreeItems();
|
|
620
620
|
if (this.selection === "multiple")
|
|
621
621
|
t && await Promise.all(
|
|
622
|
-
n.map(async (
|
|
623
|
-
|
|
622
|
+
n.map(async (o) => {
|
|
623
|
+
o.selected = !1, o.indeterminate = !1, o.previouslySelected = !1, await o.updateComplete;
|
|
624
624
|
})
|
|
625
625
|
), e.selected = t || !e.selected, e.lazy && !this.disabledAutoExpand && (e.expanded = !0), A(e, !1, this.selection);
|
|
626
626
|
else if ((this.selection === "single" || e.isLeaf) && !e.noSelect)
|
|
627
|
-
for (const
|
|
628
|
-
|
|
627
|
+
for (const o of n)
|
|
628
|
+
o.selected = o === e;
|
|
629
629
|
else (this.selection === "leaf" || e.noSelect) && (e.expanded = !e.expanded);
|
|
630
630
|
if (e.noSelect)
|
|
631
631
|
return;
|
|
632
|
-
const
|
|
633
|
-
(i.length !==
|
|
632
|
+
const s = this.selectedItems;
|
|
633
|
+
(i.length !== s.length || s.some((o) => !i.includes(o)) || this.forceOnChange || t) && Promise.all(s.map((o) => o.updateComplete)).then(() => {
|
|
634
634
|
this.emit("cx-selection-change", {
|
|
635
635
|
/**
|
|
636
636
|
* Use this.selectedItems instead of nextSelection because
|
|
@@ -646,8 +646,8 @@ let c = class extends R {
|
|
|
646
646
|
getAllDirectTreeItems() {
|
|
647
647
|
return [...this.querySelectorAll(":scope > cx-tree-item")];
|
|
648
648
|
}
|
|
649
|
-
focusItem(e) {
|
|
650
|
-
e?.focus();
|
|
649
|
+
focusItem(e, t) {
|
|
650
|
+
e?.focus(t);
|
|
651
651
|
}
|
|
652
652
|
handleKeyDown(e) {
|
|
653
653
|
if (![
|
|
@@ -660,27 +660,27 @@ let c = class extends R {
|
|
|
660
660
|
"Enter",
|
|
661
661
|
" "
|
|
662
662
|
].includes(e.key) || e.composedPath().some(
|
|
663
|
-
(
|
|
664
|
-
|
|
663
|
+
(s) => ["input", "textarea"].includes(
|
|
664
|
+
s?.tagName?.toLowerCase()
|
|
665
665
|
)
|
|
666
666
|
))
|
|
667
667
|
return;
|
|
668
668
|
const t = this.getFocusableItems(), i = this.localize.dir() === "ltr", n = this.localize.dir() === "rtl";
|
|
669
669
|
if (t.length > 0) {
|
|
670
670
|
e.preventDefault();
|
|
671
|
-
const
|
|
671
|
+
const s = t.findIndex((g) => g.matches(":focus")), o = t[s], d = (g) => {
|
|
672
672
|
const u = t[K(g, 0, t.length - 1)];
|
|
673
673
|
this.focusItem(u);
|
|
674
674
|
}, m = (g) => {
|
|
675
|
-
|
|
675
|
+
o.expanded = g;
|
|
676
676
|
};
|
|
677
|
-
e.key === "ArrowDown" ? d(
|
|
677
|
+
e.key === "ArrowDown" ? d(s + 1) : e.key === "ArrowUp" ? d(s - 1) : i && e.key === "ArrowRight" || n && e.key === "ArrowLeft" ? !o || o.disabled || o.readonly || o.expanded || o.isLeaf && !o.lazy ? d(s + 1) : m(!0) : i && e.key === "ArrowLeft" || n && e.key === "ArrowRight" ? !o || o.disabled || o.readonly || o.isLeaf || !o.expanded ? d(s - 1) : m(!1) : e.key === "Home" ? d(0) : e.key === "End" ? d(t.length - 1) : (e.key === "Enter" || e.key === " ") && !o.disabled && !o.readonly && this.selectItem(o);
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
680
|
handleClick(e) {
|
|
681
|
-
const t = e.composedPath(), i = e.target, n = i.closest("cx-tree-item"),
|
|
681
|
+
const t = e.composedPath(), i = e.target, n = i.closest("cx-tree-item"), s = e.composedPath().some(
|
|
682
682
|
(m) => m?.classList?.contains("tree-item__expand-button")
|
|
683
|
-
),
|
|
683
|
+
), o = e.composedPath().some(
|
|
684
684
|
(m) => m?.classList?.contains("tree-item__actions")
|
|
685
685
|
);
|
|
686
686
|
if (!n || n.disabled || n.readonly || i !== this.clickTarget)
|
|
@@ -688,7 +688,7 @@ let c = class extends R {
|
|
|
688
688
|
const d = !t.find(
|
|
689
689
|
(m) => m.tagName?.toLowerCase() === "cx-checkbox"
|
|
690
690
|
);
|
|
691
|
-
|
|
691
|
+
s && n.showExpandButton ? n.expanded = !n.expanded : o || this.selectItem(
|
|
692
692
|
n,
|
|
693
693
|
d && this.labelSelectSingle && this.selection === "multiple"
|
|
694
694
|
);
|
|
@@ -696,13 +696,30 @@ let c = class extends R {
|
|
|
696
696
|
handleMouseDown(e) {
|
|
697
697
|
this.clickTarget = e.target;
|
|
698
698
|
}
|
|
699
|
+
/**
|
|
700
|
+
* A `mousedown` whose real, non-retargeted origin (`composedPath()[0]`) is
|
|
701
|
+
* the tree host itself is only reachable by clicking the host's own
|
|
702
|
+
* scrollbar/gutter — shadow content otherwise fills the box, so a content
|
|
703
|
+
* click's real origin is always a descendant. The browser's default action
|
|
704
|
+
* for that mousedown focuses the host, and since the host is itself the
|
|
705
|
+
* scrollable element (`overflow: auto`), focusing it resets its own
|
|
706
|
+
* scrollTop natively — before any of our JS runs, so `preventScroll` on a
|
|
707
|
+
* later `this.focusItem(...)` call can't undo it. Cancel that default
|
|
708
|
+
* action outright; it doesn't affect the scrollbar's own drag/track
|
|
709
|
+
* behavior, only whether the mousedown also focuses the element.
|
|
710
|
+
*/
|
|
711
|
+
handleHostMouseDown(e) {
|
|
712
|
+
e.composedPath()[0] === this && e.preventDefault();
|
|
713
|
+
}
|
|
699
714
|
handleFocusOut(e) {
|
|
700
715
|
const t = e.relatedTarget;
|
|
701
716
|
(!t || !this.contains(t)) && (this.tabIndex = 0);
|
|
702
717
|
}
|
|
703
718
|
handleFocusIn(e) {
|
|
704
719
|
const t = e.target;
|
|
705
|
-
e.target === this && this.focusItem(this.lastFocusedItem || this.getAllTreeItems()[0]
|
|
720
|
+
e.target === this && this.focusItem(this.lastFocusedItem || this.getAllTreeItems()[0], {
|
|
721
|
+
preventScroll: !0
|
|
722
|
+
}), a.isTreeItem(t) && !t.disabled && !t.readonly && (this.lastFocusedItem && !this.focusable && (this.lastFocusedItem.tabIndex = -1), this.lastFocusedItem = t, this.tabIndex = -1, t.tabIndex = 0);
|
|
706
723
|
}
|
|
707
724
|
expandToItem(e) {
|
|
708
725
|
const t = e.parentElement?.closest("cx-tree-item");
|
|
@@ -787,7 +804,7 @@ let c = class extends R {
|
|
|
787
804
|
if (i.disabled || i.readonly)
|
|
788
805
|
return !1;
|
|
789
806
|
const n = i.parentElement?.closest("[role=treeitem]");
|
|
790
|
-
return n instanceof
|
|
807
|
+
return n instanceof a ? (n && (!n.expanded || n.loading || t.has(n)) && t.add(i), !t.has(i)) : !0;
|
|
791
808
|
});
|
|
792
809
|
}
|
|
793
810
|
render() {
|
|
@@ -857,7 +874,7 @@ c = h([
|
|
|
857
874
|
G("cx-tree")
|
|
858
875
|
], c);
|
|
859
876
|
export {
|
|
860
|
-
|
|
877
|
+
a as C,
|
|
861
878
|
c as a,
|
|
862
879
|
X as b,
|
|
863
880
|
q as c,
|